PageSourceSearch

https://assets.fieldlevel.com/6e79aae1c4/assets/OrganizationProgramMapPage-Bp8wKvH1.js

js fieldlevel.com collected 2026-09-24 10:00:52 UTC 11,018 bytes, 2 lines download raw bytes

1import{j as r,i as A,M as U,I as k,S as D,h as L,r as f,A as q,H as K}from"./playbook-BN4J3fpY.js";import{P as Y}from"./PageTitle-FYR7CltF.js";import{i as J}from"./SearchFilters-Bq02KMbs.js";import{u as j}from"./useURLParams-CByhGSg-.js";import{z as T,w,C as G}from"./app-public-BA_F7Vjg.js";import{a as H,b as Q,u as W}from"./useGetSearchOptions-BVQBhWg8.js";import{m as h}from"./mapbox-gl-CwcQqeFu.js";import{W as V,C as $}from"./AppUpdateMonitor-B2IzIKp2.js";import{O as Z}from"./OrgLogo-Cogq09D3.js";import{u as X}from"./urlBuilder-BNSuALzq.js";import{s as ee}from"./queryUtils-BMPR3ius.js";import{u as M}from"./useQuery-DQVsgF3X.js";import{c as te}from"./dataTypes-ByzyanJy.js";import{u as re}from"./useParamTools-Bhzy_RwR.js";import"./DropdownMenu-Bi-ejoUS.js";import"./dateUtils-DoT-fxLW.js";import"./use_UNSTABLE_horizontalScrollTracking-DU4cDvPC.js";import"./TwitterMajor-CLsdpYfn.js";import"./LinkedinMajor-DuUR9cIi.js";import"./PrimeBadgeIcon-BTXfpHmw.js";import"./imageSrcManager--1PQR1yA.js";import"./useBaseQuery-cvMOEPrV.js";import"./utils-B3Wd421l.js";const oe=`${T.organizationProgramMap}_detail`,ae=e=>[oe,ee({params:{orgId:e}})],se=({params:{orgId:e}={},options:o={}}={})=>M(ae(e),()=>H(e),o),ne=({org:e})=>r.jsxs(L,{noWrap:!0,align:"center",children:[r.jsx(L.Item,{children:r.jsx(Z,{shortName:e.ShortName,organizationName:e.OrganizationName,size:"Base"})}),r.jsxs(L.Item,{fill:!0,children:[r.jsx("div",{className:"font-bold truncate text-body-lg",title:e.OrganizationName,children:e.OrganizationName}),r.jsxs("div",{className:"text-body-sm text-muted",children:[e.AthleticAssociationEnum.Label," • ",e.City,", ",e.State]})]})]}),ie=({isOpen:e,onDismiss:o,org:l,onLinkClick:i})=>{const s=X(),{data:n,isLoading:c}=se({params:{orgId:l?.OrganizationId},options:{enabled:!!l,useErrorBoundary:!0,staleTime:300*1e3}}),a=c?r.jsx(A,{size:"small"}):l?r.jsx(ne,{org:n.Organization}):null;return r.jsx(U,{open:e,onDismiss:o,title:a,children:!c&&n&&r.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:n.Organization.Teams.map(u=>r.jsx("div",{className:"font-bold bg-[#F6F6F6] p-3 rounded-lg",children:r.jsx(V,{onClick:i,...s.organizationTeamOverviewPage({pathParams:{shortName:n.Organization.ShortName,sportEnum:u.SportEnum.Value.toLowerCase()}}).wiredLinkProps,children:r.jsxs("div",{className:"flex justify-between",children:[u.SportEnum.LabelAlternate,r.jsx("span",{className:"m-0",children:r.jsx(k,{source:D})})]})},u.TeamId)},u.TeamId))})})},le=[-125,24,-66,50],E="organization-program-map-selected-org",p="organizations",b={default:{base:"#7c8e9a",hover:"#63727b"},highschool:{base:"#4ea375",hover:"#3e825e"},clubhighschool:{base:"#e355c0",hover:"#b6449a"},trainingfacility:{base:"#4294f8",hover:"#3576c6"},recruiter:{base:"#ee863d",hover:"#be6b31"}},v=e=>["match",["get","IconType"],"highschool",b.highschool[e],"clubhighschool",b.clubhighschool[e],"trainingfacility",b.trainingfacility[e],"recruiter",b.recruiter[e],b.default[e]],ce={type:"FeatureCollection",features:[]},ue=e=>({...e,Teams:JSON.parse(e.Teams??"[]"),SportEnums:JSON.parse(e.SportEnums??"[]"),AthleticAssociationEnums:JSON.parse(e.AthleticAssociationEnums??"[]"),AthleticConferenceEnums:JSON.parse(e.AthleticConferenceEnums??"[]"),Aliases:JSON.parse(e.Aliases??"[]")}),me=({organizations:e,onMapAction:o,initialLat:l,initialLng:i,initialZoom:s})=>{const n=f.useRef(null),c=f.useRef(null),a=f.useRef(o),[u,y]=f.useState(null);return f.useEffect(()=>{a.current=o},[o]),f.useEffect(()=>{const m=sessionStorage.getItem(E);m&&(sessionStorage.removeItem(E),y(JSON.parse(m)))},[]),f.useEffect(()=>{if(!h.supported())return;h.accessToken=$();const m=l&&i&&s,t=new h.Map({container:n.current,style:"mapbox://styles/mapbox/streets-v12",projection:"mercator",...m?{center:[Number(i),Number(l)],zoom:Number(s)}:{bounds:le,fitBoundsOptions:{padding:50}}});c.current=t,t.on("load",()=>{t.setLayoutProperty("poi-label","visibility","none"),t.setLayoutProperty("transit-label","visibility","none"),t.setLayoutProperty("road-number-shield","visibility","none"),t.setLayoutProperty("airport-label","visibility","none"),t.setLayoutProperty("golf-hole-line","visibility","none"),t.setLayoutProperty("ferry-aerialway-label","visibility","none"),t.addSource(p,{type:"geojson",data:ce,cluster:!0,clusterMa
1xZoom:14,clusterRadius:60,promoteId:"OrganizationId"}),t.addLayer({id:"clusters",type:"circle",source:p,filter:["has","point_count"],paint:{"circle-color":"#3182ce","circle-radius":30}}),t.addLayer({id:"cluster-count",type:"symbol",source:p,filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-size":12},paint:{"text-color":"#ffffff"}}),t.addLayer({id:"unclustered-point",type:"circle",source:p,filter:["!",["has","point_count"]],paint:{"circle-radius":["interpolate",["linear"],["zoom"],4,["case",["boolean",["feature-state","hover"],!1],6,4],6,["case",["boolean",["feature-state","hover"],!1],9,7],14,["case",["boolean",["feature-state","hover"],!1],12,10]],"circle-color":["case",["boolean",["feature-state","hover"],!1],v("hover"),v("base")],"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}}),t.addLayer({id:"unclustered-point-label",type:"symbol",source:p,minzoom:6,filter:["!",["has","point_count"]],layout:{"text-field":["get","OrganizationName"],"text-font":["DIN Offc Pro Bold","Arial Unicode MS Bold"],"text-size":14,"text-offset":[1.1,0],"text-anchor":"left","text-max-width":10,"text-allow-overlap":!0},paint:{"text-color":["case",["boolean",["feature-state","hover"],!1],v("hover"),v("base")],"text-halo-color":"#ffffff","text-halo-width":1}});let d=null;const z=g=>{t.getCanvas().style.cursor="pointer",d!==null&&t.setFeatureState({source:p,id:d},{hover:!1}),d=g.features[0].id,t.setFeatureState({source:p,id:d},{hover:!0})},C=()=>{t.getCanvas().style.cursor="",d!==null&&(t.setFeatureState({source:p,id:d},{hover:!1}),d=null)},N=g=>{y(ue(g.features[0].properties))};t.on("click","clusters",g=>{const x=t.queryRenderedFeatures(g.point,{layers:["clusters"]}),O=x[0].properties.cluster_id,I=x[0].properties.point_count;t.getSource(p).getClusterLeaves(O,I,0,(F,P)=>{if(F)return;const _=P.reduce((R,B)=>R.extend(B.geometry.coordinates),new h.LngLatBounds(P[0].geometry.coordinates,P[0].geometry.coordinates));t.fitBounds(_,{padding:60,maxZoom:15})})}),t.on("click","unclustered-point",N),t.on("mouseenter","unclustered-point",z),t.on("mouseleave","unclustered-point",C),t.on("click","unclustered-point-label",N),t.on("mouseenter","unclustered-point-label",z),t.on("mouseleave","unclustered-point-label",C),t.on("mouseenter","clusters",()=>t.getCanvas().style.cursor="pointer"),t.on("mouseleave","clusters",()=>t.getCanvas().style.cursor=""),t.on("moveend",()=>{if(!a.current)return;const{lng:g,lat:x}=t.getCenter(),O=t.getZoom();a.current({lng:g.toFixed(6),lat:x.toFixed(6),zoom:O.toFixed(2)})})}),t.addControl(new h.NavigationControl({showCompass:!1}),"bottom-right");const S=new h.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0,showUserHeading:!1,showAccuracyCircle:!1,fitBoundsOptions:{zoom:7}});return c.current.addControl(S,"bottom-right"),()=>{t.remove(),c.current=null}},[]),f.useEffect(()=>{const m=c.current;if(!m||!e)return;const t=()=>m.getSource(p)?.setData(e);m.isStyleLoaded()?t():m.once("load",t)},[e]),h.supported()?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:n,className:"w-full h-full"}),r.jsx(ie,{isOpen:!!u,onDismiss:()=>y(null),org:u,onLinkClick:()=>sessionStorage.setItem(E,JSON.stringify(u))})]}):r.jsx(q,{variant:"critical",title:"Unsupported Browser",children:"Your browser doesn't support WebGL, which is required for interactive maps. Please try Chrome, Firefox, Safari, or Edge."})},pe=[T.organizationProgramMap],de=()=>pe,fe=({params:e={},options:o={}}={})=>M(de(),()=>Q(),o),ge=({data:e})=>{const{search:o}=j();return f.useMemo(()=>{if(!e?.Organizations)return null;const l=e.Organizations.features.filter(i=>{let s=!0;if(o.query&&(s=s&&(i.properties.OrganizationName.toLowerCase().includes(o.query?.trim().toLowerCase())||i.properties.Aliases.includes(o.query.toLowerCase()))),o.sportEnum&&(s=s&&i.properties.SportEnums.includes(o.sportEnum)),o.athleticAssociation){let n=[o.athleticAssociation].flat().map(a=>parseInt(a,10));n[0]===4&&(n=[...te]);const c=i.properties.AthleticAssociationEnums.some(a=>n.includes(a));s=s&&c}if(o.conference){const n=o.conference.replaceAll("-","");s=s&&i.properties.AthleticConferenceEnums.includes(n)}return s});return{...e.Organizations,features:l}},[e,o])},he=({searchOptions:e})=>{const o=w(),l=e&&{secondary:[{label:"All sports",selectionType:"singleSelect",options:[{label:"All sports",value:""},...e.SportOptions.map(a=>({label:a.Label,value:a.Value}))],searchParamKey:"sportEnum",requestParamKey:"sportEnum",displayLimit:5,displayLimitLabel:"Show all sports"},{label:"Level",selectionType:"multiSelect",options:e.AthleticAssociationOptions.map(a=>({label:a.Label,value:`${a.Value}`})),searchParamKey:"athleticAssociation",requestParamKey:"athleticAssociation",displayLimit:5,displayLimitLabel:"Show all levels"},{label:"Conference",selectionType:"singleSelect",options:e.ConferenceOptions.map(a=>({label:a.Label,value:a.Value})),searchParamKey:"conference",requestParamKey:"conference",displayLimit:5,displayLimitLabel:"Show all conferences"}],text:{placeholder:"Search by name",searchParamKey:"query",requestParamKey:"query"}},i=re({filterDef:l});if(!i)return{};
1const{deriveSearchParamsOnValuesChange:s,values:n,requestParams:c}=i;return{filterProps:{filterDef:l,onChange:({key:a,value:u})=>{o.organizationProgramMap({searchParams:{...s({values:{[a]:u}})},options:{go:{preventScrollReset:!0}}}).go()},onChangeMany:({values:a})=>{o.organizationProgramMap({searchParams:{...s({values:a})},options:{go:{preventScrollReset:!0}}}).go()},values:n},requestParams:c}},ke=()=>{const{search:e}=j(),o=w(),{data:l,isLoading:i}=W({options:{useErrorBoundary:!0,staleTime:360*60*1e3}}),{lat:s,lng:n,zoom:c}=e,{filterProps:a}=he({searchOptions:!i&&{...l,StateOptions:l.StateOptions.us.concat(l.StateOptions.ca)}}),{data:u,isLoading:y}=fe({options:{useErrorBoundary:!0,staleTime:300*1e3}}),m=ge({data:u});return r.jsxs(r.Fragment,{children:[r.jsx(Y,{title:"Explore Teams | FieldLevel"}),r.jsxs(G,{children:[r.jsx("div",{children:r.jsx("div",{className:"px-4 mb-4 flex items-center justify-between md:px-0",children:r.jsx(K,{as:"h1",children:"Teams"})})}),r.jsx("div",{className:"p-4 bg-foreground-base md:rounded-t",children:!i&&r.jsx(J,{...a})}),r.jsx("div",{className:"h-[calc(100dvh-200px)] min-h-96",children:y?r.jsx("div",{className:"flex items-center justify-center h-[250px]",children:r.jsx(A,{})}):r.jsx(me,{organizations:m,initialLat:s,initialLng:n,initialZoom:c,onMapAction:({lat:t,lng:S,zoom:d})=>{o.organizationProgramMap({searchParams:{...e,lat:t,lng:S,zoom:d},options:{go:{location:"replace",preventScrollReset:!0}}}).go()}})})]})]})};export{ke as default};
2//# sourceMappingURL=OrganizationProgramMapPage-Bp8wKvH1.js.map

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.