1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5819],{81506:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/onboarding/playing-community",function(){return t(23638)}])},75696:function(e,n,t){"use strict";t.d(n,{Z:function(){return OnboardingRouteGuard}});var i=t(85893),o=t(67294),a=t(11163),r=t(35617),l=t(91579),s=t(46122);function OnboardingRouteGuard(e){let{children:n}=e,t=(0,a.useRouter)(),{organization:d}=(0,r.Z)(),c=null==d?void 0:d.organizationSelected,u=c?(0,l.l4)(c):null;return((0,o.useEffect)(()=>{if(t.isReady){if(null===u){t.push("/");return}!1===u&&t.push("/")}},[u,t]),null===u)?(0,i.jsx)(s.Z,{isFullHeight:!0,title:"Loading..."}):!1===u?(0,i.jsx)(s.Z,{isFullHeight:!0,title:"Redirecting..."}):(0,i.jsx)(i.Fragment,{children:n})}},34415:function(e,n,t){"use strict";t.d(n,{Z:function(){return PlayingCommunityContent}});var i=t(85893),o=t(88329),a=t(3712),r=t(38491),l=t(90092),s=t(68029),d=t(65243);function PlayingCommunityContent(e){let{showBack:n=!1,onBack:t,title:c="Your Playing Community",description:u="This is the Playing Community you confirmed during with your RCX Growth representative. It defines where your league operates and helps us tailor support and resources to your area.",showConfirmedBadge:p=!1,confirmedLabel:g,iframeSrc:h,iframeHeight:x,onIframeLoad:m,onIframeError:f,showAgreementSection:y,checkboxText:b,isAgreed:w,onAgreedChange:v,isDisabled:C=!1,showSubmitButton:j=!1,submitLabel:k="Continue",onSubmit:S,submitDisabled:_=!1,submitLoading:z=!1}=e;return(0,i.jsx)(o.k,{direction:"column",w:"full",maxW:"1440px",h:{base:"auto",lg:"full"},px:{base:"24px",sm:"32px",md:"48px",lg:"64px"},py:{base:"32px",md:"40px",lg:"32px"},mx:"auto",children:(0,i.jsxs)(a.K,{spacing:"32px",maxW:"872px",w:"full",mx:"auto",children:[n&&t&&(0,i.jsx)(r.z,{variant:"secondary",onClick:t,leftIcon:(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,i.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),alignSelf:"flex-start",children:"Back"}),(0,i.jsxs)(a.K,{spacing:"0",children:[(0,i.jsxs)(o.k,{justify:"space-between",align:"center",gap:"16px",flexWrap:"wrap",children:[(0,i.jsx)(l.x,{fontSize:{base:"24px",md:"28px",lg:"32px"},fontWeight:"400",lineHeight:{base:"36px",md:"42px",lg:"48px"},color:"#17181C",children:c}),p&&g&&(0,i.jsx)(o.k,{bg:"#F6F9FD",color:"#2467DA",fontSize:"14px",fontWeight:"600",h:"40px",px:"12px",py:"6px",borderRadius:"6px",align:"center",children:(0,i.jsx)(l.x,{whiteSpace:"nowrap",children:g})})]}),(0,i.jsx)(l.x,{fontSize:{base:"14px",md:"15px",lg:"16px"},fontWeight:"400",lineHeight:{base:"21px",md:"22px",lg:"24px"},color:"#17181C",mt:"8px",children:u})]}),(0,i.jsx)(s.x,{as:"iframe",src:h,w:"100%",h:null!=x?x:{base:"930px",lg:"450px"},bg:"#F5F5F5",borderRadius:"8px",overflow:"hidden",border:"none",scrolling:"no",sx:{"&::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none"},title:"Territoria Map and Community Details",onLoad:m,onError:f}),y&&(0,i.jsx)(a.K,{spacing:"0px",mt:"8px",children:(0,i.jsx)(s.x,{w:"full",children:(0,i.jsx)(d.X,{isChecked:w,isDisabled:C,onChange:e=>v(e.target.checked),colorScheme:"blue",size:"md",alignItems:"flex-start",spacing:"12px",children:(0,i.jsx)(l.x,{fontSize:"14px",fontWeight:"400",color:"#17181C",lineHeight:"21px",children:b})})})}),j&&S&&(0,i.jsx)(r.z,{variant:"primary",size:"lg",onClick:S,isLoading:z,isDisabled:_,alignSelf:"center",px:"2rem",children:k})]})})}},23638:function(e,n,t){"use strict";t.r(n);var i=t(85893),o=t(11163),a=t(68029),r=t(34415),l=t(67294),s=t(6657),d=t(66230),c=t(88767),u=t(46122),p=t(70186),g=t(75696),h=t(77472),x=t(35617),m=t(60250),f=t(72942);let normalizeOrigin=e=>e.replace(/\/+$/,"").trim();n.default=()=>{let e=(0,o.useRouter)(),n=(0,s.ls)(),t=(0,c.useQueryClient)(),{organization:{organizationSelected:y}}=(0,x.Z)(),b=Number(null==y?void 0:y.id)||0,{data:w}=(0,d.$g)(b),v=(0,d.h$)(),[C]=(0,m.Z)(h.Z),j=!!(null==y?void 0:y.community_accepted_at),k=(null==y?void 0:y.community_accepted_at)?(0,f.p)(y.community_accepted_at,!0):null,S="https://territoria.rcx.technology",_=S?normalizeOrigin(S):"",z=_?"".concat(_,"/iframe?orgId=").concat(b):"",[L,D]=(0,l.useState)(!1),[T,E]=(0,l.useState)(!0),[I,R]=(0,l.useState)(!1),[F,B]=(0,l.useState)(!1),[Z,O]=(0,l.useState)(!1);(0,l.useEffect)(()=>
1{if(e.isReady&&b&&!_){e.replace("/onboarding/playing-community-error");return}},[e,e.isReady,b,_]),(0,l.useEffect)(()=>{let handleMessage=n=>{var t,i,o,a,r;n.origin===_&&(((null===(t=n.data)||void 0===t?void 0:t.type)==="territoria-error"||(null===(i=n.data)||void 0===i?void 0:i.error)||(null===(o=n.data)||void 0===o?void 0:o.status)==="error"||"string"==typeof n.data&&n.data.toLowerCase().includes("no communities"))&&(console.error("â Territoria error message received:",n.data),B(!0),O(!1),e.replace("/onboarding/playing-community-error")),((null===(a=n.data)||void 0===a?void 0:a.type)==="territoria-loaded"||(null===(r=n.data)||void 0===r?void 0:r.status)==="ready")&&(console.log("â
Territoria success message received"),O(!0),B(!1)))};return window.addEventListener("message",handleMessage),()=>{window.removeEventListener("message",handleMessage)}},[_,e]),(0,l.useEffect)(()=>{n.email&&n.isSet&&e.isReady&&e.push("/").then()},[e,n]);let W=L&&!F&&Z,P="dashboard"===e.query.from,handleContinue=async()=>{if(W&&(null==y?void 0:y.id)&&!I)try{R(!0),await v.mutateAsync({organizationId:y.id,data:{community_accepted_at:new Date().toISOString()}}),await t.invalidateQueries(["organization"]),await t.invalidateQueries(["organization-by-id"]),(null==y?void 0:y.id)&&await t.invalidateQueries(["onboarding-status",y.id.toString()]),P?e.push("/onboarding/dashboard"):e.push("/onboarding/msa")}catch(e){console.error("Failed to update playing community confirmation:",e),R(!1)}},H="true"===e.query.viewOnly||j;return(0,i.jsx)(g.Z,{children:(0,i.jsx)(p.Z,{onContinue:H||!Z?void 0:handleContinue,onBack:H?()=>{C({contactType:"onboarding-specialist",contactTeam:w,onClickButton:()=>{}})}:P?void 0:()=>{C({contactType:"growth-team",contactTeam:w,onClickButton:()=>{}})},continueLabel:"Continue",backLabel:H?"Contact your Onboarding Specialist":"Contact RCX Growth Team",showBack:H||!P,backButtonWidth:H?"305px":"270px",backButtonVariant:"primary",continueButtonWidth:"163px",continueDisabled:!!H||!W||I,continueLoading:I,children:(0,i.jsxs)(a.x,{position:"relative",w:"full",children:[T&&(0,i.jsx)(a.x,{position:"absolute",inset:"0",zIndex:"1",bg:"white",children:(0,i.jsx)(u.Z,{isFullHeight:!1,title:"Loading community details..."})}),(0,i.jsx)(a.x,{opacity:T?0:1,pointerEvents:T?"none":"auto",children:(0,i.jsx)(r.Z,{showBack:P,onBack:()=>{e.push("/onboarding/dashboard")},showConfirmedBadge:H&&!!k,confirmedLabel:k?"Confirmed on ".concat(k):void 0,iframeSrc:z,onIframeLoad:()=>{console.log("â
Iframe onLoad event fired - marking as loaded successfully"),E(!1),O(!0),B(!1)},onIframeError:()=>{console.error("â Iframe onError event fired"),E(!1),B(!0),e.replace("/onboarding/playing-community-error")},showAgreementSection:!H&&!F&&Z,checkboxText:"I agree that this is the Playing Community that I discussed with RCX Sports and confirm that I will operate within this definition.*",isAgreed:L,onAgreedChange:D,isDisabled:F||T||!Z})})]})})})}},72942:function(e,n,t){"use strict";function formatDate(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!e)return null;let t=new Date(e),i=new Date(t.valueOf()+6e4*t.getTimezoneOffset()),o=(i.getUTCMonth()+1).toString().padStart(2,"0"),a=i.getUTCDate().toString().padStart(2,"0"),r=n?i.getUTCFullYear().toString().slice(-2):i.getUTCFullYear();return"".concat(o,"/").concat(a,"/").concat(r)}t.d(n,{P:function(){return normalizeDate},p:function(){return formatDate}});let normalizeDate=e=>{let n=new Date(e);return n.setUTCHours(0,0,0,0),n}}},function(e){e.O(0,[5243,1968,9774,2888,179],function(){return e(e.s=81506)}),_N_E=e.O()}]);
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.