PageSourceSearch

https://eip-ogw-8c88dc873801.herokuapp.com/assets/Alerts-BE30_uq8.js

js eip-ogw-8c88dc873801.herokuapp.com collected 2026-10-03 14:47:53 UTC 15,045 bytes, 1 lines download raw bytes

1import{d as re,K as ye,l as c,p,q as e,L as N,m as $,r as R,a as P,c as ee,o as te,H as oe,M as se,b as I,f as ne,J as he,N as ge,s as fe,F as w,u as C,v as A,C as M,t as x,E as Y,O as _e,_ as me}from"./index-Dmkw508R.js";import{m as E}from"./mapbox-gl-j4QCYeOE.js";const Pe={class:"arrows"},ve={width:"24",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ae={"clip-path":"url(#a)",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},Te=["opacity"],be=["opacity"],we=e("defs",null,[e("clipPath",{id:"a"},[e("path",{fill:"#fff",d:"M0 0h24v24H0z"})])],-1),Ce=re({__name:"SortArrows",props:{type:{}},setup(J){const i=ye("sortOrder");return(d,s)=>(c(),p("span",Pe,[(c(),p("svg",ve,[e("g",Ae,[e("path",{d:"M7.5 16.5 12 21l4.5-4.5",opacity:N(i).type===d.type&&N(i).direction==="A-Z"?"0.25":"1"},null,8,Te),e("path",{d:"M7.5 7.5 12 3l4.5 4.5",opacity:N(i).type===d.type&&N(i).direction==="A-Z"?"1":"0.25"},null,8,be)]),we]))]))}}),Z=10,je=re({__name:"Alerts",setup(J,{expose:i}){i(),E.accessToken=$;let d;const s=R(null),q=[[-54.35,51.96],[-139.64,20.77]],j=P({type:"FeatureCollection",features:[]}),t=P({type:"FeatureCollection",features:[]}),{useExportData:T}=oe(),{exportAlertsToCSV:G}=T();let H=null;const y=R({type:"",direction:""});se("sortOrder",y);const b=P([]),le=P([]),f=P({totalLength:0,totalPagination:0,currentPage:1,showNavigation:!0,filteredAlerts:0}),S=P([]),B=P([]),k=P([]),L=P([]),F=P([]),ae=P(["Newest to Oldest","Oldest to Newest"]),m=P({alertType:"",state:"",projectType:"",date:"",energyEmergency:""}),W=async()=>{const n="10-00_ALERTS",a=JSON.stringify({columns:[],summaries:{total:{count:"*"}}});await I(n,_=>{var l,r;_&&_.summaries&&(f.totalLength=((r=(l=_==null?void 0:_.summaries)==null?void 0:l.total)==null?void 0:r.count)??0)},a,"summarize")},K=async()=>{const n="10-00_ALERTS",a=JSON.stringify({columns:["AlertTitle","created_by","DatePublished","AlertType","AlertDescription","PublicActionDeadline","Published","Active","energy_emergency","ReviewedBy","Facility.id","Facility.facility_name","Facility.State","Facility.Latitude","Facility.Longitude","Pipeline.id","Pipeline.pipeline_name","Pipeline.AffectedStates","Pipeline.Route","Pipeline.ProductType","Project.id","Project.ProjectType"],filter:{Published:!0,Active:!0},page:{size:f.totalLength}});await I(n,_=>{if(!_||!_.records)return;const l=_.records.filter(o=>o.DatePublished&&new Date(o.DatePublished).getTime()>0);let r=Math.ceil(b.length/10)+1;l.sort((o,g)=>new Date(g.DatePublished).getTime()-new Date(o.DatePublished).getTime()).forEach((o,g)=>{if(o.Active&&o.Published){if(o.Project&&o.Project.ProjectType){const h=o.Project.ProjectType.split(",").map(v=>v.trim());o.Project.ProjectType=h}if(o.Pipeline&&o.Pipeline.ProductType){const h=o.Pipeline.ProductType.split(",").map(v=>`${v.trim()} Pipeline`);o.Pipeline.ProductType=h}o.pageCount=r,(g+1)%10===0&&r++;const D=[];if(o.Pipeline&&o.Pipeline.AffectedStates){const h=o.Pipeline.AffectedStates.split(",").map(v=>v.trim());D.push(...h)}if(o.Facility&&o.Facility.State){const h=o.Facility.State.split(",").map(v=>v.trim());D.push(...h)}o.states=Array.from(new Set(D)),b.push(o),S.push(o.AlertType),B.push(o.states.flat().join(", ")),B.length>0&&B.forEach(h=>{h.split(",").forEach(z=>{k.push(z.trim())})}),o.Project&&o.Project.ProjectType&&L.push(...o.Project.ProjectType.flat().map(h=>({source:"Project",value:h}))),o.Pipeline&&o.Pipeline.ProductType&&L.push(...o.Pipeline.ProductType.flat().map(h=>({source:"Pipeline",value:h}))),L.length>0&&L.forEach(h=>{h.value.split(",").forEach(z=>{let de=z.trim();F.push(de)})}),f.totalPagination=Math.ceil(b.length/10)}})},a,"query")},U=()=>{if(b)return Array.from({length:f.totalPagination},(n,a)=>a+1)},ie=n=>{f.currentPage=n},ce=(n,a)=>{const u=n.target.value;m[a]=u;const _=Object.values(m).every(l=>l==="");f.showNavigation=!!_,V(O.value),d.getSource("facilities").setData(j),d.getSource("pipelines").setData(t)},pe=n=>{y.value.type===n?y.value.direction=y.value.direction==="A-Z"?"Z-A":"A-Z":(y.value.type=n,y.value.direction="A-Z"),f.currentPage=1},O=ee(()=>{let n=b.filter(l=>{var o,g,D,h,v;let r=!0;return m.alertType&&(r=r&&l.AlertType===m.alertType),m.state&&(r=r&&((o=l.states)==null?void 0:o.includes(m.state))),m.projectType&&(r=r&&(((D=(g=l.Project)==null?void 0:g.ProjectType)==null?void 0:D.includes(m.projectType))||((v=(h=l.Pipeline)==null?void 0:h.ProductType)==null?void 0:v.includes(m.projectType)))),m.energyEmergency==="true"?r=r&&!!l.energy_emergency:m.energyEmergency==="false"&&(r=r&&!l.energy_emergency),r});y.value.type==="Date"?n.sort((l,r)=>{const o=new Date(l.DatePublished).getTime(),g=new Date(r.DatePublished).getTime();return y.value.direction==="A-Z"?o-g:g-o}):y.value.type==="AlertType"?n.sort((l,r)=>{if(y.value.direction==="A-Z")return l.AlertType.localeCompare(r.AlertType);if(y.value.direction==="Z-A")return r.AlertType.localeCompare(l.AlertType)}):y.value.type==="ProjectType"?n.sort((l,r)=>{const o=l.Project&&l.Project.ProjectType?l.Project.ProjectType[0]:"",g=r.Project&&r.Project.ProjectType?r.Project.ProjectType[0]:"";if(y.value.direction==="A-Z")return o.localeCompare(g);if(y.value.direction==="Z-A")return g.localeCompare(o)}):y.value.type==="State"?n.sort((l,r)=>{const o=Array.isArray(l.states)?l.states[0]:typeof l.states=="string"?l.states:"",g=Array.isArray(r.states)?r.states[0]:typeof r.states=="string"?r.states:"";if(o!==void 0&&g!==void 0){if(y.value.direction==="A-Z")return o.localeCompare(g);if(y.value.direction==="Z-A")return g.localeCompare(o)}}):y.value.type==="AlertTitle"&&n.sort((l,r)=>{if(y.value.direction==="A-Z")return l.AlertTitle.localeCompare(r.AlertTitle);if(y.value.direction==="Z-A")return r.AlertTitle.localeCompare(l.AlertTitle)}),f.filteredAlerts=n.length;const a=Math.max(Math.ceil(n.length/Z),1);f.currentPage>a&&(f.currentPage=a);const u=(f.currentPage-1)*Z,_=u+Z;return a>1?(f.showNavigation=!0,f.totalPagination=a):f.showNavigation=!1,n.slice(u,_)}
1),ue=()=>{G(b)},V=n=>{j.features=[],t.features=[],n.forEach(a=>{if(a.Facility){const u=a.Facility;j.features.push({type:"Feature",properties:{id:u.id,type:"Facility",name:u.facility_name},geometry:{type:"Point",coordinates:[u.Longitude,u.Latitude]}})}if(a.Pipeline&&a.Pipeline.Route){const u=a.Pipeline;t.features.push({type:"Feature",properties:{id:u.id,type:"Pipeline",name:u.pipeline_name},geometry:{type:"MultiLineString",coordinates:JSON.parse(`[${u.Route}]`)}})}})},Q=async()=>{s.value!==null&&(d=new E.Map({container:s.value,style:ne,bounds:q,maxZoom:14}),d.addControl(new E.ScaleControl).addControl(new E.NavigationControl),d.on("load",async()=>{V(b),d.addSource("pipelines",{type:"geojson",data:t}),d.addSource("facilities",{type:"geojson",data:j}),d.addLayer({id:"pipelines",type:"line",source:"pipelines",layout:{"line-join":"round"},paint:{"line-color":"#FFFFFF","line-width":5,"line-border-color":"#58ACF2","line-border-width":1}}),d.addLayer({id:"facilities",type:"circle",source:"facilities",filter:["!",["has","point_count"]],paint:{"circle-radius":6,"circle-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-color":"#58ACF2"}}),d.on("click","facilities",a=>{n(a)}),d.on("click","pipelines",a=>{n(a)});const n=a=>{const u=a.features[0].properties,_=[a.lngLat.lng,a.lngLat.lat];let l=`<span class="type">${u.type}</span>`;l+=`<a class="title" href="/${u.type}/${u.id}"><span>${u.name}</span></a>`,new E.Popup().setLngLat(_).setHTML(l).addTo(d)};d.on("mouseenter","facilities",()=>{d.getCanvas().style.cursor="pointer"}),d.on("mouseleave","facilities",()=>{d.getCanvas().style.cursor=""})}))};te(async()=>{if(await W(),await K(),U(),O.value){const n=O.value.filter(a=>a.pageCount===1);O.value.splice(0,O.value.length,...n)}if(S){const n=[...new Set(S.sort())];S.splice(0,S.length,...n)}if(F){const n=[...new Set(F.sort())];F.splice(0,F.length,...n)}if(k){const a=[...new Set(k)].filter(u=>u.trim()!=="").sort();k.splice(0,k.length,...a)}await Q()});const X={get map(){return d},set map(n){d=n},mapContainer:s,mapDefaultBounds:q,mapFacilitiesData:j,mapPipelinesData:t,useExportData:T,exportAlertsToCSV:G,get nextPageCursor(){return H},set nextPageCursor(n){H=n},sortOrder:y,alerts:b,displayedAlerts:le,ui:f,alertTypeOptions:S,alertStatesToStrings:B,alertStatesOptions:k,alertProjectTypeToStrings:L,alertProjectTypeOptions:F,alertDateOptions:ae,alertsFilters:m,fetchCount:W,fetchAlerts:K,generatePaginationNumbers:U,handleButtonClick:ie,handleChange:ce,toggleSortOrder:pe,pageSize:Z,filteredAlertTypes:O,exportAlerts:ue,formatMapData:V,renderMapboxMap:Q,onMounted:te,reactive:P,computed:ee,ref:R,provide:se,get moment(){return he},get getAll(){return I},get mapboxStyle(){return ne},get mapboxToken(){return $},get sortByMonth(){return ge},get setBadgeColor(){return fe},get useCommon(){return oe},SortArrows:Ce,get mapboxgl(){return E}};return Object.defineProperty(X,"__isScriptSetup",{enumerable:!1,value:!0}),X}}),Se={class:"alert-archive"},ke=e("section",{class:"intro",id:"intro"},[e("hgroup",null,[e("h1",null,"Oil & Gas Watch Alerts"),e("div",{class:"desc"},[e("p",null,"Using public databases, corporate filings, company announcements, and news reports, the Oil & Gas Watch team produces weekly alerts to provide up-to-date information on projects and facilities tracked in the database. Alerts are also the best way to keep up with public comment opportunities and other chances to get involved. Search alerts below by type, state, and publication date. To receive alerts in your inbox each week, sign up for the Oil & Gas Watch Newsletter.")])])],-1),Fe={class:"alert-list",id:"alertList"},Oe={class:"map-group"},De={class:"map",ref:"mapContainer",style:{height:"clamp(200px, 50vw, 520px)"}},xe={class:"filter-row"},Ee={class:"filter"},Le=e("label",null,"Alert Type",-1),Me={name:"alert type"},Be=e("option",{value:""},"All",-1),Ne={class:"filter"},Ze=e("label",null,"State",-1),qe={name:"state"},Ve=e("option",{value:""},"All",-1),ze={class:"filter"},Re=e("label",null,"Project Type",-1),Ie={name:"state"},Ye=e("option",{value:""},"All",-1),Je={class:"filter"},Ge=e("label",null,"National Energy Emergency",-1),He=e("select",{name:"energy-emergency"},[e("option",{value:""},"All"),e("option",{value:"true"},"Yes"),e("option",{value:"false"}
1,"No")],-1),We=[He],Ke={class:"data"},Ue={class:"--monospace"},Qe=e("span",null," Showing ",-1),Xe={class:"total"},$e={class:"table-wrapper"},et={key:0,class:"table table-alerts",role:"table"},tt={class:"rowgroup",role:"rowgroup"},ot={class:"row",role:"row"},st={class:"columnheader",role:"columnheader","aria-sort":"none"},nt=e("span",null,"Alert Type",-1),rt={class:"columnheader",role:"columnheader","aria-sort":"none"},lt=e("span",null,"Alert Title",-1),at={class:"columnheader",role:"columnheader","aria-sort":"none"},it=e("span",null,"State",-1),ct={class:"columnheader",role:"columnheader","aria-sort":"none"},pt=e("span",null,"Project Type",-1),ut={class:"columnheader",role:"columnheader","aria-sort":"none"},dt=e("span",null,"Publication Date",-1),yt={key:0,class:"rowgroup",role:"rowgroup"},ht={class:"row",role:"row"},gt={class:"cell type"},ft={key:0,class:"emergency-badge"},_t={class:"cell name"},mt=["href"],Pt={class:"cell state-names"},vt={key:0},At={class:"cell project-types"},Tt={key:0},bt={class:"badge--square"},wt={key:1},Ct={class:"badge--square"},jt={class:"cell"},St={key:1,style:{"margin-top":"1.5rem"}},kt={key:1,class:"pagination"},Ft=["disabled"],Ot=["id","onClick"],Dt=["disabled"];function xt(J,i,d,s,q,j){return c(),p("main",Se,[e("article",null,[ke,e("section",Fe,[e("div",Oe,[e("div",De,null,512),e("div",xe,[e("div",Ee,[Le,e("span",{class:"select",onChange:i[0]||(i[0]=t=>s.handleChange(t,"alertType"))},[e("select",Me,[Be,(c(!0),p(w,null,C(s.alertTypeOptions,t=>(c(),p("option",null,A(t),1))),256))])],32)]),e("div",Ne,[Ze,e("span",{class:"select",onChange:i[1]||(i[1]=t=>s.handleChange(t,"state"))},[e("select",qe,[Ve,(c(!0),p(w,null,C(s.alertStatesOptions,t=>(c(),p("option",null,A(t),1))),256))])],32)]),e("div",ze,[Re,e("span",{class:"select",onChange:i[2]||(i[2]=t=>s.handleChange(t,"projectType"))},[e("select",Ie,[Ye,(c(!0),p(w,null,C(s.alertProjectTypeOptions,t=>(c(),p("option",null,A(t),1))),256))])],32)]),e("div",Je,[Ge,e("span",{class:"select",onChange:i[3]||(i[3]=t=>s.handleChange(t,"energyEmergency"))},We,32)])]),e("div",Ke,[e("p",Ue,[Qe,e("span",Xe,A(s.ui.filteredAlerts),1),e("span",null,A(s.ui.filteredAlerts===1?" alert.":" alerts."),1)])]),e("div",$e,[s.alerts?(c(),p("div",et,[e("div",tt,[e("div",ot,[e("span",st,[e("button",{class:"table-sort",onClick:i[4]||(i[4]=t=>s.toggleSortOrder("AlertType"))},[nt,M(s.SortArrows,{type:"AlertType"})])]),e("span",rt,[e("button",{class:"table-sort",onClick:i[5]||(i[5]=t=>s.toggleSortOrder("AlertTitle"))},[lt,M(s.SortArrows,{type:"AlertTitle"})])]),e("span",at,[e("button",{class:"table-sort",onClick:i[6]||(i[6]=t=>s.toggleSortOrder("State"))},[it,M(s.SortArrows,{type:"State"})])]),e("span",ct,[e("button",{class:"table-sort",onClick:i[7]||(i[7]=t=>s.toggleSortOrder("ProjectType"))},[pt,M(s.SortArrows,{type:"ProjectType"})])]),e("span",ut,[e("button",{class:"table-sort",onClick:i[8]||(i[8]=t=>s.toggleSortOrder("Date"))},[dt,M(s.SortArrows,{type:"Date"})])])])]),s.filteredAlertTypes.length?(c(),p("div",yt,[(c(!0),p(w,null,C(s.filteredAlertTypes,t=>(c(),p("div",ht,[e("div",gt,[e("span",{class:"badge",style:Y({backgroundColor:s.setBadgeColor(t.AlertType),borderColor:s.setBadgeColor(t.AlertType)})},A(t.AlertType),5),t.energy_emergency?(c(),p("span",ft,"Energy Emergency")):x("",!0)]),e("div",_t,[e("a",{href:`/alert/${t.id}`},A(t.AlertTitle),9,mt)]),e("div",Pt,[t.states&&t.states.length>0?(c(),p("ul",vt,[(c(!0),p(w,null,C(t.states,T=>(c(),p("li",null,A(T),1))),256))])):x("",!0)]),e("div",At,[t.Project&&t.Project.ProjectType?(c(),p("ul",Tt,[(c(!0),p(w,null,C(t.Project.ProjectType,T=>(c(),p("li",bt,A(T),1))),256))])):x("",!0),t.Pipeline&&t.Pipeline.ProductType?(c(),p("ul",wt,[(c(!0),p(w,null,C(t.Pipeline.ProductType,T=>(c(),p("li",Ct,A(T),1))),256))])):x("",!0)]),e("div",jt,A(s.moment(t.DatePublished).utc().format("MMM D, YYYY")),1)]))),256))])):(c(),p("p",St,"There are no current alerts with this combination of filters."))])):x("",!0),s.ui.showNavigation?(c(),p("nav",kt,[e("ol",null,[e("li",null,[e("button",{class:"button button--prev","data-icon":"arrow",onClick:i[9]||(i[9]=t=>s.handleButtonClick(s.ui.currentPage-1)),disabled:s.ui.currentPage===1,style:Y(`display: ${s.ui.currentPage===1?"none":"flex"}`)},"Back",12,Ft)]),(c(!0),p(w,null,C(s.generatePaginationNumbers(),t=>(c(),p("li",{key:t},[e("button",{class:_e(["number",{"number--active":t===s.ui.currentPage}]),id:t,onClick:T=>s.handleButtonClick(t)},A(t),11,Ot)]))),128)),e("li",null,[e("button",{class:"button button--next","data-icon":"arrow",onClick:i[10]||(i[10]=t=>s.handleButtonClick(s.ui.currentPage+1)),disabled:s.ui.currentPage>=s.ui.totalPagination,style:Y(`display: ${s.ui.currentPage>=s.ui.totalPagination?"none":"flex"}`)},"Next",12,Dt)])])])):x("",!0)])])])])])}const Mt=me(je,[["render",xt]]);export{Mt as default};

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.