1import{W as ht,dR as Ie,el as Re,e6 as Ye,eo as qe,e8 as ve,e7 as Qe,dc as t,dd as I,c as J,e as te,X as we,P as se,a9 as Q,ed as pt,d_ as gt,h as ie,F as Se,cF as St,du as bt,en as Je,a8 as yt,aN as _t,ek as xt,e5 as Ct,dW as It,G as Rt,j as vt}from"./index--83fOlxX.js";import{b1 as S,D as Xe,u as Ze,s as je,aj as q,m as ae,e as L,A as oe,aE as ne,r as et,g as X,a as wt,ae as Dt,N as be,P as ye,ay as tt,w as Ft,l as _e,k as ot,z as Nt,G as Et,b0 as Ot,C as Te,ag as me,j as kt,aH as xe,i as Pt,a6 as Lt,M as At,a4 as Tt,n as zt,a1 as Mt,a0 as fe,Y as he,Z as pe,v as Wt,p as Bt,au as $t}from"./ui-NzJGZCOf.js";import{R as Gt,a as Ut,u as Vt,b as Ht,c as Kt}from"./useFilteredRotations-BO9BzrUO.js";import{C as Yt,a as qt,u as Qt,M as Jt,S as Xt,I as Ce,r as Zt}from"./useItemsDndMonitor-CIuR561M.js";import{c as jt,b as eo,f as to,F as oo,a as ro,o as io}from"./FormProvider-hbZ5gvCG.js";import{f as rt}from"./Helper-72nS2ijv.js";import{S as it}from"./SavingTeamPicker-CUHNeVh-.js";import{k as De,a as no}from"./useTags-D071mfMh.js";import{P as nt}from"./PlayingTimeTable-CzE1yHpg.js";import{P as so}from"./Page-sZlrZlHc.js";import{H as ao}from"./HeaderBreadcrumbs-Da2g3DEq.js";import{F as lo}from"./FolderBreadcrumbs-BFE1tMEA.js";import{d as co}from"./debounce-BCBYI5hr.js";import{p as uo}from"./PlaysFilter-Bv5JPYiK.js";import{C as mo}from"./CollectionToolbar-9ocHo5dd.js";import{u as fo,V as ho,e as po,b as ze}from"./VirtualizedTable-TiHmejIB.js";import{h as go,x as st,d as at,k as So,w as bo,f as yo,b as _o,n as Me,m as xo}from"./folderAwarePlaceholders-BgAwPeE6.js";import{u as Co,F as Io}from"./FolderItem-CUUwnHje.js";import{a as Ro}from"./formatTime-DtD0MVK8.js";import{P as We}from"./MobileItemDate-DwYDdfMy.js";import{S as Be}from"./StatusLabel-RlBPQiFe.js";import{R as vo}from"./RotationActionsDropdown-CoPj3y1m.js";import{t as wo,b as Do,a as Fo,C as No,n as Eo}from"./collectionCardStyles-FOOtgxu4.js";import{u as Oo}from"./useIsFirstRender-BEILyyIo.js";import{g as ko}from"./index-CJRF5krZ.js";import{I as Po,U as Lo}from"./UpgradeAlert-CyY_GS5O.js";import{G as Ao}from"./GlassIconButton-CG6pwfic.js";import{P as To}from"./plus-BpwBiDvW.js";import{F as zo}from"./FilterChips-C89w19FZ.js";import{u as Mo}from"./useIsOnline-CnTLWmR0.js";import{u as Wo}from"./useIsPayingUserV2-X-KbnFht.js";import{T as Bo}from"./TeamSubscriptionErrorComponent-7scwUfR-.js";import{u as $o}from"./useTable-BBkMR8E8.js";import"./media-CfhA99EZ.js";import"./editor-BBDzBLhk.js";import"./auth-Vr3hANQi.js";import"./MenuPopover-B2dYuTBk.js";import"./ConfirmationDialog-Bd7fAo1n.js";import"./TableRowActionCheckbox-BYpoypk2.js";import"./NestedMenuItem-E0f3SJiK.js";import"./index-vdnyNLeo.js";import"./MyAvatar-BPuWNWEE.js";import"./createAvatar-CSWNX66E.js";import"./Avatar-DA_rmJdn.js";import"./TeamAvatar-BoWFWCdD.js";import"./MobileItemTitle-BqBX31fM.js";import"./MobileItemInfo-CkEtkpwH.js";import"./useCollapseDrawer-zcugjKI8.js";import"./PlaysTableSelectedActions-DF0qkYN0.js";import"./MobileViewerHeader-cKU-StT7.js";import"./ArrowBackIos-D0jsvfFg.js";import"./FloatingBar-keKmqyr2.js";import"./useSafeAreaInset-DQpKGBcu.js";import"./ScrollEdgeFade-BE0SOQ5l.js";import"./glassLayout-BHeHozmU.js";import"./element-DvAk1eOA.js";import"./PlaygroundSelect-Bb1fwXWd.js";import"./Label-CJGVkcgn.js";import"./Breadcrumbs-B2ggCnrY.js";import"./ArrowBack-CUS5WKy0.js";import"./tslib.es6-DNoqNiN7.js";import"./index-3IwWtNql.js";import"./LibraryPlaySort-ODIre1Au.js";import"./arrow-right-BT43YZgn.js";import"./createLucideIcon-BBljSknj.js";import"./ResizeObserver.es-BS4_j6we.js";import"./utils-lktSqjmV.js";import"./ShareRotationDialog-D1MGh_y6.js";import"./FolderPickerDialog-CHxQVfnG.js";import"./useTabs-mh-sJZ2W.js";import"./useTeamAdmin-DiFdoxOo.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new o.Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="435771e4-0d71-4171-8e4d-cb1c5c8e5b12",o._sentryDebugIdIdentifier="sentry-dbid-435771e4-0d71-4171-8e4d-cb1c5c8e5b12")}catch{}})();async function Go(o){let e=await ht.get(`https://app.thehoopsgeek.com/apiv2/public/shared_rotation/${o}`);return{...e.data,data:rt(e.data)}}const $e=o=>{try{let e=new URL(o),i=new URLSearchParams(e.search).get("code");if(!i){let s=e.pathname;if(!s.includes("/rotation/"))return!1;let a=s.split("/rotation/").pop();if(a.length!==10)return!1;i=a}return i}catch{return!1}};function Uo(o){var O,D,P,V;const{user:e}
1=Ie(),r=Re(),[i,s]=S.useState({status:"PUBLIC",team:r,userId:r?null:e.db_user_id}),a=De({right:"EDIT_PLAY"}),{mixpanel:l}=Ye(),[c,u]=S.useState("INPUT_LINK"),[p,x]=S.useState(null),{enqueueSnackbar:C}=qe(),F=ve(),A=jt().shape({url:eo().url("Not a valid URL").required("Not a valid URL").test("code","URL is not in valid format",f=>$e(f))}),k={url:""},T=to({resolver:io(A),defaultValues:k}),{reset:d,setError:B,handleSubmit:$,getValues:h,formState:{errors:b,isSubmitting:y}}=T,_=Qe({mutationFn:f=>Go(f)}),v=async()=>{try{let f=$e(h("url"));f||B("afterSubmit",{message:"Url is not in a valid format"});let R=await _.mutateAsync(f);R.user_id==e.db_user_id&&!r?B("afterSubmit",{message:"You already have this rotation in your library"}):(x(R),u("SHOW_CONFIRMATION_SCREEN"),l.track("Import Shared Rotation",{code:R.code,title:R.title}))}catch(f){B("afterSubmit",{...f,message:f.message}),C(f.message,{variant:"error"})}},w=async f=>{var m;let R={title:f.title??f.data.settings.title,tags:[],data:f.data,userId:(i==null?void 0:i.userId)??null,status:(i==null?void 0:i.status)??"PUBLIC",team_id:((m=i==null?void 0:i.team)==null?void 0:m.team_id)??null};try{u("SAVING");let n=await we.post("/rotation",{...R});C("Rotation was imported successfully",{variant:"success"}),o.close(),F(se.rotations.rotation(n.data.rotation_id)),u("DONE")}catch(n){B("afterSubmit",{...n,message:n.message}),C(te.printError(n),{variant:"error"}),u("ERROR")}};return S.useEffect(()=>{o.isOpen&&d(k)},[o.isOpen]),S.useEffect(()=>{(async()=>{if(o.code){u("LOADING_CODE");try{const f=await _.mutateAsync(o.code);f.user_id==e.db_user_id?(B("afterSubmit",{message:"You already have this rotation in your library"}),u("ERROR")):(x(f),u("SHOW_CONFIRMATION_SCREEN"),l.track("Import Shared Rotation",{code:f.code,title:f.title}))}catch(f){B("afterSubmit",{...f,message:f.message}),u("ERROR")}}})()},[]),t(Xe,{fullWidth:!0,maxWidth:"sm",open:o.isOpen,onClose:()=>{o.close()},children:I(oo,{methods:T,onSubmit:$(v),children:[I(Ze,{children:[["INPUT_LINK","LOADING_CODE","ERROR"].includes(c)&&"Import Rotation",(c==="SHOW_CONFIRMATION_SCREEN"||c==="SAVING")&&"Do you want to import "+p.title+"?"]}),I(je,{dividers:!0,children:[c==="LOADING_CODE"&&I(q,{sx:{minHeight:100,alignItems:"center",justifyContent:"center"},children:[t(ae,{size:24}),t(L,{sx:{mt:1,fontSize:14},children:"...fetching rotation"})]}),(c==="SHOW_CONFIRMATION_SCREEN"||c==="SAVING")&&t(J,{children:I(L,{children:[t(L,{sx:{mb:3},children:t(nt,{periods:p.data.periods,periodLength:p.data.periodLength,players:p.data.players,minutes:p.data.minutes})}),t(it,{showLabels:!1,pickedTeam:i,onChange:s,teams:a})]})}),c==="INPUT_LINK"&&I(q,{spacing:3,children:[t(ro,{placeholder:te.getRotationLink("JFgUZ8qvaQ"),sx:{"& input":{fontSize:14}},name:"url",label:"Import URL"}),!!b.afterSubmit&&t(oe,{severity:"error",children:((D=(O=b.afterSubmit.response)==null?void 0:O.data)==null?void 0:D.error)??b.afterSubmit.message}),t(L,{sx:{mt:2},children:I(ne,{variant:"body2",children:["You can import rotations using shared links that look like"," "+te.getRotationLink("JFgUZ8qvaQ")]})})]}),c==="ERROR"&&t(oe,{severity:"error",children:((V=(P=b.afterSubmit.response)==null?void 0:P.data)==null?void 0:V.error)??b.afterSubmit.message})]}),I(et,{children:[c==="INPUT_LINK"&&t(X,{type:"submit",variant:"contained",loading:y||c==="SAVING",children:"Import Rotation"}),(c==="SHOW_CONFIRMATION_SCREEN"||c==="SAVING")&&t(X,{variant:"contained",onClick:()=>w(p),loading:y||c==="SAVING",children:"Import Rotation"})]})]})})}async function Vo(o){var r,i;let e=await we.get(`https://app.thehoopsgeek.com/apiv2/free_rotation/${o}`);return{...e.data,data:rt(e.data),title:e.data.title??((i=(r=e.data)==null?void 0:r.data)==null?void 0:i.title)}}function Ho(o){var z,E;const e=Q.c(54),{mixpanel:r}=Ye(),[i,s]=S.useState("LOADING_CODE"),[a,l]=S.useState(null),{enqueueSnackbar:c}=qe(),u=ve(),{user:p}=Ie(),x=pt(),C=Re();let F;e[0]===Symbol.for("react.memo_cache_sentinel")?(F={right:"EDIT_PLAY"},e[0]=F):F=e[0];const A=De(F),k=C?null:p.db_user_id;let T;e[1]!==C||e[2]!==k?(T={status:"PUBLIC",team:C,userId:k},e[1]=C,e[2]=k,e[3]=T):T=e[3];const[d,B]=S.useState(T);let $;e[4]===Symbol.for("react.memo_cache_sentinel")?($={mutationFn:Ko},e[4]=$):$=e[4];const h=Qe($);let b;e[5]!==h?(b=async W=>{try{const H=await h.mutateAsync(W);
1l(H),s("SHOW_CONFIRMATION_SCREEN")}catch{s("ERROR")}},e[5]=h,e[6]=b):b=e[6];const y=b;let _;e[7]!==c||e[8]!==r||e[9]!==u||e[10]!==(d==null?void 0:d.status)||e[11]!==((z=d==null?void 0:d.team)==null?void 0:z.team_id)||e[12]!==(d==null?void 0:d.userId)||e[13]!==o||e[14]!==x||e[15]!==p?(_=async W=>{var G;const H={title:W.title,tags:[],data:W.data,userId:(d==null?void 0:d.userId)??null,status:(d==null?void 0:d.status)??"PUBLIC",team_id:((G=d==null?void 0:d.team)==null?void 0:G.team_id)??null};try{s("SAVING");const K=await we.post("/rotation",{...H});c("Rotation was imported successfully",{variant:"success"}),x.invalidateQueries({queryKey:[p.db_user_id,"filtered_rotations_with_folders"]}),r.track("Import Free Rotation",{code:o.code,title:W.title}),o.close(),u("/dashboard/rotation/"+K.data.rotation_id),s("DONE")}catch{c("Error when trying to import rotation",{variant:"error"})}},e[7]=c,e[8]=r,e[9]=u,e[10]=d==null?void 0:d.status,e[11]=(E=d==null?void 0:d.team)==null?void 0:E.team_id,e[12]=d==null?void 0:d.userId,e[13]=o,e[14]=x,e[15]=p,e[16]=_):_=e[16];const v=_;let w;e[17]!==y||e[18]!==o.code?(w=()=>{y(o.code)},e[17]=y,e[18]=o.code,e[19]=w):w=e[19];let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=[],e[20]=O):O=e[20],S.useEffect(w,O);let D;e[21]!==o?(D=()=>{o.close()},e[21]=o,e[22]=D):D=e[22];let P;e[23]!==i?(P=["LOADING_CODE","ERROR"].includes(i)&&"Import Rotation",e[23]=i,e[24]=P):P=e[24];const V=(i==="SHOW_CONFIRMATION_SCREEN"||i==="SAVING")&&"Do you want to import "+(a==null?void 0:a.title)+"?";let f;e[25]!==V||e[26]!==P?(f=I(Ze,{children:[P,V]}),e[25]=V,e[26]=P,e[27]=f):f=e[27];let R;e[28]!==(h==null?void 0:h.error)||e[29]!==i?(R=i==="ERROR"&&I(oe,{severity:"error",children:[t(wt,{children:"Error"}),te.printError(h==null?void 0:h.error)]}),e[28]=h==null?void 0:h.error,e[29]=i,e[30]=R):R=e[30];let m;e[31]!==i?(m=i==="LOADING_CODE"&&I(q,{sx:{minHeight:100,alignItems:"center",justifyContent:"center"},children:[t(ae,{size:24}),t(L,{sx:{mt:1,fontSize:14},children:"...fetching rotation"})]}),e[31]=i,e[32]=m):m=e[32];let n;e[33]!==a||e[34]!==d||e[35]!==i||e[36]!==A?(n=(i==="SHOW_CONFIRMATION_SCREEN"||i==="SAVING")&&t(J,{children:I(L,{children:[t(L,{sx:{mb:3},children:t(nt,{periods:a.data.periods,periodLength:a.data.periodLength,players:a.data.players,minutes:a.data.minutes})}),t(it,{showLabels:!1,pickedTeam:d,onChange:B,teams:A})]})}),e[33]=a,e[34]=d,e[35]=i,e[36]=A,e[37]=n):n=e[37];let N;e[38]!==R||e[39]!==m||e[40]!==n?(N=I(je,{dividers:!0,children:[R,m,n]}),e[38]=R,e[39]=m,e[40]=n,e[41]=N):N=e[41];let g;e[42]!==a||e[43]!==v||e[44]!==i?(g=(i==="SHOW_CONFIRMATION_SCREEN"||i==="SAVING")&&t(X,{variant:"contained",onClick:()=>v(a),loading:i==="SAVING",children:"Import Rotation"}),e[42]=a,e[43]=v,e[44]=i,e[45]=g):g=e[45];let M;e[46]!==g?(M=t(et,{children:g}),e[46]=g,e[47]=M):M=e[47];let U;return e[48]!==o.isOpen||e[49]!==f||e[50]!==N||e[51]!==M||e[52]!==D?(U=I(Xe,{fullWidth:!0,maxWidth:"sm",open:o.isOpen,onClose:D,children:[f,N,M]}),e[48]=o.isOpen,e[49]=f,e[50]=N,e[51]=M,e[52]=D,e[53]=U):U=e[53],U}function Ko(o){return Vo(o)}function Yo(o){const e=Q.c(52),{stats:r,filter:i,searchParamsObject:s,updateFilters:a,open:l,onClose:c,resetFilters:u,showLoadingIndicator:p,filterCount:x}=o,C=gt(a);let F;e[0]!==C?(F=co(async G=>{C.current({title:G,pg:""})},500),e[0]=C,e[1]=F):F=e[1];const A=Dt.useRef(F).current,[k,T]=S.useState((s==null?void 0:s.title)??"");let d;e[2]!==(s==null?void 0:s.title)?(d=()=>{T((s==null?void 0:s.title)??"")},e[2]=s==null?void 0:s.title,e[3]=d):d=e[3];const B=s==null?void 0:s.title;let $;e[4]!==B?($=[B],e[4]=B,e[5]=$):$=e[5],S.useEffect(d,$);let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={zIndex:"1399"},e[6]=h):h=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={position:"absolute",top:"calc(5px + var(--thg-safe-top, 0px))",right:5},e[7]=b):b=e[7];let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=t(ie,{icon:"eva:close-fill",sx:{width:30,height:30}}),e[8]=y):y=e[8];let _;e[9]!==c?(_=t(be,{size:"large",sx:b,onClick:c,children:y}),e[9]=c,e[10]=_):_=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v={flex:1,p:3,width:400,maxWidth:"100vw"},e[11]=v):v=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t(L,{sx:{fontSize:20,fontWeight:700,mb:2},children:"Filter Rotations"}),e[12]=w):w=e[12];let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O={pb:2,maxWidth:300},e[13]=O):O=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=G=>{T(G.target.value),A(G.target.value)},e[14]=D):D=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t(ye,{position:"start",children:t(ie,{icon:"eva:search-fill",sx:{color:"text.disabled",width:20,height:20}})}),e[15]=P):P=e[15];const V=k===""?"none":"block";let f;e[16]!==V?(f={width:30,height:30,display:V},e[16]=V,e[17]=f):f=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{T(""),A("")},e[18]=R):R=e[18];let m;e[19]===Symbol.for("react.memo_cache_sentinel")?(m=t(ie,{icon:"eva:close-fill",sx:{width:20,height:20}}),e[19]=m):m=e[19];let n;e[20]!==f?(n={input:{startAdornment:P,endAdornment:t(ye,{position:"end",children:t(be,{size:"small",color:"error",sx:f,onClick:R,children:m})})}},e[20]=f,e[21]=n):n=e[21];let N;e[22]!==k||e[23]!==n?(N=t(tt,{size:"small",sx:O,value:k,onChange:D,placeholder:"Search rotation...",slotProps:n}),e[22]=k,e[23]=n,e[24]=N):N=e[24];let g;if(e[25]!==i||e[26]!==s||e[27]!==a){let G;e[29]!==s||e[30]!==a?(G=K=>t(qo,{filter:K,children:t(Qo,{searchParamsObject:s,updateFilters:a,filter:K})},K.data),e[29]=s,e[30]=a,e[31]=G):G=e[31],g=i.map(G),e[25]=i,e[26]=s,e[27]=a,e[28]=g}else g=e[28];let M;e[32]!==x||e[33]!==u?(M=x>0&&t(L,{children:t(X,{startIcon:t(Se,{style:{fontSize:16},icon:St}),variant:"outlined",color:"error",onClick:u,children:"Clear All Filters"})}),e[32]=x,e[33]=u,e[34]=M):M=e[34];let U;e[35]===Symbol.for("react.memo_cache_sentinel")?(U=t(L,{sx:{flex:1}}),e[35]=U):U=e[35];let z;e[36]!==p||e[37]!==(r==null?void 0:r.count)?(z=p?t(ae,{sx:{color:"white"},size:20}):I(J,{children:["Show ",r==null?void 0:r.count," Rotations "]}),e[36]=p,e[37]=r==null?void 0:r.count,e[38]=z):z=e[38];let E;e[39]!==c||e[40]!==z?(E=t(X,{onClick:c,size:"large",variant:"contained",children:z}),e[39]=c,e[40]=z,e[41]=E):E=e[41];let W;e[42]!==N||e[43]!==g||e[44]!==M||e[45]!==E?(W=I(q,{sx:v,children:[w,N,g,M,U,E]}),e[42]=N,e[43]=g,e[44]=M,e[45]=E,e[46]=W):W=e[46];let H;return e[47]!==c||e[48]!==l||e[49]!==W||e[50]!==_?(H=I(Ft,{style:h,open:l,onClose:c,anch
1or:"right",children:[_,W]}),e[47]=c,e[48]=l,e[49]=W,e[50]=_,e[51]=H):H=e[51],H}const qo=o=>{const e=Q.c(7),{filter:r,children:i}=o;if(r.options.reduce(Xo,0)===0)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={mb:3},e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={fontWeight:700},e[1]=l):l=e[1];let c;e[2]!==r.text?(c=t(L,{sx:l,children:r.text}),e[2]=r.text,e[3]=c):c=e[3];let u;return e[4]!==i||e[5]!==c?(u=I(L,{sx:a,children:[c,i]}),e[4]=i,e[5]=c,e[6]=u):u=e[6],u},Qo=o=>{var $;const e=Q.c(62),{filter:r,updateFilters:i,searchParamsObject:s}=o;let a,l,c;e[0]!==r||e[1]!==s?(a=(($=s==null?void 0:s[r==null?void 0:r.data])==null?void 0:$.split(","))??[],l=S.useState,c=Ge(r,a),e[0]=r,e[1]=s,e[2]=a,e[3]=l,e[4]=c):(a=e[2],l=e[3],c=e[4]);const[u,p]=l(c),[x,C]=S.useState("");let F;e[5]!==r||e[6]!==a?(F=()=>{p(Ge(r,a))},e[5]=r,e[6]=a,e[7]=F):F=e[7];const A=s==null?void 0:s[r==null?void 0:r.data];let k;e[8]!==r||e[9]!==A?(k=[r,A],e[8]=r,e[9]=A,e[10]=k):k=e[10],S.useEffect(F,k);let T;e[11]!==r.data||e[12]!==i?(T=(h,b,y)=>{const _=bt(y,w=>{const O=w.findIndex(D=>D.option===h.option);w[O].isChecked=b});p(_);const v=_.filter(Zo).map(jo).join(",");i({[r.data]:v,pg:""})},e[11]=r.data,e[12]=i,e[13]=T):T=e[13];const d=T;if(r.options.reduce(er,0)===0){let h;return e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t(L,{sx:{color:"text.disabled"},children:"No selections"}),e[14]=h):h=e[14],h}if(r.type==="tag"){let h,b,y;e[15]!==u||e[16]!==d?(b=u.filter(tr),h=L,y=b.length>0&&t(q,{sx:{mt:1},useFlexGap:!0,flexWrap:"wrap",direction:"row",spacing:.5,children:b.map((E,W)=>t(_e,{color:"primary",onDelete:()=>{d(E,!1,u)},onClick:()=>{d(E,!0,u)},sx:{borderRadius:1},label:`${E.option}`},E.option))}),e[15]=u,e[16]=d,e[17]=h,e[18]=b,e[19]=y):(h=e[17],b=e[18],y=e[19]);let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_={fontSize:13,p:0,mt:2,maxWidth:300},e[20]=_):_=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=E=>{C(E.target.value)},e[21]=v):v=e[21];let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w={fontSize:13},e[22]=w):w=e[22];const O=x===""?"none":"inline-flex";let D;e[23]!==O?(D={display:O},e[23]=O,e[24]=D):D=e[24];const P=x===""?"inherit":"error";let V,f;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{C("")},f=t(ie,{icon:"eva:close-fill"}),e[25]=V,e[26]=f):(V=e[25],f=e[26]);let R;e[27]!==D||e[28]!==P?(R={input:{sx:w,endAdornment:t(ye,{position:"end",children:t(be,{size:"small",sx:D,color:P,onClick:V,children:f})})}},e[27]=D,e[28]=P,e[29]=R):R=e[29];let m;e[30]!==R||e[31]!==x?(m=t(tt,{size:"small",sx:_,value:x,onChange:v,placeholder:"Search in tags...",slotProps:R}),e[30]=R,e[31]=x,e[32]=m):m=e[32];const n=b.length>0?2:1;let N;e[33]!==n?(N={mt:n},e[33]=n,e[34]=N):N=e[34];let g;if(e[35]!==u||e[36]!==x||e[37]!==d){let E;e[39]!==x?(E=H=>H.option.toLowerCase().includes(x.toLowerCase()),e[39]=x,e[40]=E):E=e[40];let W;e[41]!==u||e[42]!==d?(W=(H,G)=>t(_e,{onClick:()=>{d(H,!0,u)},variant:"outlined",sx:{borderRadius:1},label:`${H.option} (${H.count})`},H.option+"-"+G),e[41]=u,e[42]=d,e[43]=W):W=e[43],g=u.filter(or).filter(E).map(W),e[35]=u,e[36]=x,e[37]=d,e[38]=g}else g=e[38];let M;e[44]!==N||e[45]!==g?(M=t(q,{sx:N,useFlexGap:!0,flexWrap:"wrap",direction:"row",spacing:.5,children:g}),e[44]=N,e[45]=g,e[46]=M):M=e[46];let U;e[47]!==u?(U=u.filter(rr).length===0&&t(L,{sx:{color:"text.disabled"},children:"No tags"}),e[47]=u,e[48]=U):U=e[48];let z;return e[49]!==h||e[50]!==m||e[51]!==M||e[52]!==U||e[53]!==y?(z=I(h,{children:[y,m,M,U]}),e[49]=h,e[50]=m,e[51]=M,e[52]=U,e[53]=y,e[54]=z):z=e[54],z}else{let h;e[55]===Symbol.for("react.memo_cache_sentinel")?(h={mt:1},e[55]=h):h=e[55];let b;e[56]!==r.data||e[57]!==u||e[58]!==d?(b=u.map((_,v)=>_.count===0?null:t(Nt,{control:t(ot,{sx:{py:.5},color:"primary",onChange:w=>{d(_,!_.isChecked,u)},checked:_.isChecked,id:_.option,name:_.option}),label:`${Jo(r.data,_.option)} (${_.count})`},_.option+"-"+v)),e[56]=r.data,e[57]=u,e[58]=d,e[59]=b):b=e[59];let y;return e[60]!==b?(y=t(Et,{sx:h,children:b}),e[60]=b,e[61]=y):y=e[61],y}},Ge=(o,e)=>o.options.map(r=>({...r,isChecked:r.tag_id?e.includes(r.tag_id.toString()):e.includes(r.option.toString())})),Jo=(o,e)=>o==="status"?uo(e):e;function Xo(o,e){return o+e.count}function Zo(o){return o.isChecked===!0}function jo(o){return o.tag_id??o.option}function er(o,e){return o+e.count}function tr(o){return o.isChecked}function or(o){return!o.isChecked&&o.count>0}function rr(o){return o.count>0}const Ue=[{value:"newest",label:"Newest Rotations",filterObject:{sortBy:"edit_date",order:"desc"}},{value:"oldest",label:"Oldest Rotations",filterObject:{sortBy:"edit_date",order:"asc"}}
1,{value:"title_asc",label:"Title â",filterObject:{sortBy:"title",order:"asc"}},{value:"title_desc",label:"Title â",filterObject:{sortBy:"title",order:"desc"}}];function ir(o){const e=Q.c(24),{stats:r,filter:i,updateFilters:s,searchParamsObject:a,filterCount:l,showLoadingIndicator:c,resetFilters:u,onChange:p,addControl:x}=o;let C;e[0]!==i?(C=i===void 0?[]:i,e[0]=i,e[1]=C):C=e[1];const F=C,A=c===void 0?!1:c,k=u===void 0?sr:u,T=p===void 0?nr:p,{themeRotationsView:d,onChangeRotationsView:B}=Je(),[$,h]=S.useState(!1);let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=()=>h(!1),e[2]=b):b=e[2];let y;e[3]!==F||e[4]!==l||e[5]!==k||e[6]!==a||e[7]!==$||e[8]!==A||e[9]!==r||e[10]!==s?(y=t(Yo,{sortOptions:Ue,showLoadingIndicator:A,filterCount:l,resetFilters:k,stats:r,filter:F,open:$,onClose:b,updateFilters:s,searchParamsObject:a}),e[3]=F,e[4]=l,e[5]=k,e[6]=a,e[7]=$,e[8]=A,e[9]=r,e[10]=s,e[11]=y):y=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=()=>h(!0),e[12]=_):_=e[12];let v;e[13]!==x||e[14]!==l||e[15]!==T||e[16]!==B||e[17]!==a||e[18]!==d||e[19]!==s?(v=t(mo,{addControl:x,searchParamsObject:a,updateFilters:s,onChange:T,filterCount:l,onOpenFilter:_,sortOptions:Ue,view:d,onChangeView:B}),e[13]=x,e[14]=l,e[15]=T,e[16]=B,e[17]=a,e[18]=d,e[19]=s,e[20]=v):v=e[20];let w;return e[21]!==y||e[22]!==v?(w=I(J,{children:[y,v]}),e[21]=y,e[22]=v,e[23]=w):w=e[23],w}function nr(){}function sr(){}function ar(o){var m;let{rotation:e,selectedTeamId:r,teams:i,isSelected:s=!1,anySelected:a=!1,onToggleSelect:l=null,allFolders:c=[],currentFolderId:u=null,onNavigateFolder:p=null,showFolderLocation:x=!1,selectedRotationIds:C=[],selectedFolderIds:F=[]}=o;const A=o.to??se.rotations.rotation(e.rotation_id),k=x?go(c,e,u):null,T=fo(),d=S.useRef(!1),B=a&&!!l,$=n=>{n.preventDefault(),n.stopPropagation(),l(e,n)},h=ho(n=>{d.current=!0,l==null||l(e,n)},{cancelOnMovement:!0,filterEvents:n=>n.button!==2,onCancel:()=>{d.current=!1},onFinish:()=>{setTimeout(()=>{d.current=!1},50)}}),b=T&&l&&o.editPermission?h():{},y=n=>{if(d.current){n.preventDefault(),n.stopPropagation();return}B&&$(n)};S.useEffect(()=>{o.measure&&o.measure()},[o.rotation]);const _=st(),v=S.useRef(null),[w,O]=S.useState(!1),D=S.useRef(o.editPermission);D.current=o.editPermission;const P=S.useRef(C);P.current=C;const V=S.useRef(F);V.current=F;const f=S.useRef(e);f.current=e;const R=_&&o.editPermission&&!e.placeholder;return S.useEffect(()=>{const n=v.current;if(!(!n||!R))return at.draggable({element:n,canDrag:()=>D.current&&!f.current.placeholder,getInitialData:()=>{const N=f.current;return yo({itemKind:"rotation",itemId:N.rotation_id,sourceFolderId:N.folder_id??null,selectedItemIds:P.current??[],selectedFolderIds:V.current??[]})},onDragStart:()=>O(!0),onDrop:()=>O(!1),onGenerateDragPreview:({nativeSetDragImage:N})=>{const g=f.current,{itemCount:M,folderCount:U,count:z}=So({itemKind:"rotation",itemId:g.rotation_id,selectedItemIds:P.current??[],selectedFolderIds:V.current??[]});bo.setCustomNativeDragPreview({nativeSetDragImage:N,getOffset:()=>({x:12,y:12}),render:({container:E})=>{const W=yt.createRoot(E);return Ot.flushSync(()=>{W.render(t(Gt,{rotation:g,count:z,itemCount:M,folderCount:U}))}),()=>W.unmount()}})}})},[R]),e.placeholder?I(Te,{sx:{flex:1,borderRadius:1},children:[t(L,{sx:{height:0,overflow:"hidden",paddingTop:"86.5%",position:"relative"},children:t(me,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},variant:"rounded"})}),I(kt,{sx:{py:1},children:[t(me,{variant:"text"}),t(me,{variant:"text"})]})]}):I(Te,{ref:v,...b,onClick:y,sx:n=>({flex:1,borderRadius:1,position:"relative",opacity:w?.4:1,cursor:B?"pointer":void 0,...T&&{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent"},border:s?`1px solid ${n.palette.primary.main}`:"1px solid #f6f6f6",backgroundColor:s?{xs:n.palette.primary.lighter,sm:xe(n.palette.primary.main,n.palette.action.selectedOpacity)}:void 0,transition:n.transitions.create(["background-color","border-color"]),"&:hover":{backgroundColor:s?{xs:n.palette.primary.lighter,sm:xe(n.palette.primary.main,n.palette.action.selectedOpacity)}:n.palette.action.hover},"& .rotation-item-reveal":{visibility:s||a?"visible":"hidden"},...s||a?{}:{"@media (hover: hover)":{"&:hover .rotation-item-reveal":{visibility:"visible"}}},...Eo(n)}),children:[I(L,{sx:{opacity:1,position:"relative",p:"10px"},children:[t(We,{style:{textDecoration:"none",display:"block"}
1,to:A,onClick:y,draggable:!1,children:t(Ut,{boxShadow:!1,rotation:e,allPeriods:!0,fullBleed:!0,width:"100%",height:170})}),t(L,{sx:{backgroundColor:"transparent",backgroundImage:"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.03))",bottom:0,left:0,right:0,height:85,position:"absolute",pointerEvents:"none",zIndex:1}}),o.editPermission&&l&&t(ot,{className:"rotation-item-reveal",size:"small",checked:s,onClick:n=>{n.stopPropagation(),n.preventDefault(),l(e,n)},sx:{...wo,position:"absolute",top:6,left:6,zIndex:2},inputProps:{"aria-label":"Select rotation"}})]}),I(L,{className:Do,sx:{pl:{xs:2,md:3},pr:6,pt:{xs:1.5},pb:1.5,position:"relative"},children:[I(q,{children:[(e==null?void 0:e.synced)===!1&&t(Be,{status:"offline"}),t(We,{style:{color:"inherit",textDecoration:"none"},to:A,onClick:y,draggable:!1,children:I(L,{children:[t(ne,{sx:{display:"inline",wordBreak:"break-word",fontWeight:700},variant:"subtitle1",component:"div",children:e.title}),o.editPermission&&r&&e.status==="DRAFT"&&I(J,{children:["  ",t(Be,{status:"draft"})]})]})}),t(_o,{location:k,onNavigateFolder:p,noWrap:!0}),I(ne,{sx:{mt:.5,color:"text.secondary"},variant:"body2",component:"div",children:[e.data.periods," x ",e.periodLength," min "," · ",e.player_count," players"]}),t(ne,{sx:{mt:.5},variant:"body2",component:"div",children:Ro(te.getDateFromMysql(e.edit_date))})]}),((m=e.tags)==null?void 0:m.length)>0&&t(q,{direction:"row",className:Fo,sx:{mt:1,ml:-1,mr:-4,flexWrap:"wrap"},children:e.tags.map(n=>t(_e,{sx:{mr:.5,mb:.5},size:"small",variant:"outlined",label:n.label},n.tag_id))}),o.editPermission&&!B&&t(L,{className:No,onClick:n=>n.stopPropagation(),sx:{position:"absolute",top:8,right:4},children:t(vo,{rotation:e,selectedTeamId:r,teams:i})})]})]})}const lr=o=>Math.max(1,Math.ceil(o/320));function cr({editPermission:o,selectedTeam:e,items:r=[],teams:i,allFolders:s=[],folderScope:a=null,onNavigateFolder:l=null,currentFolderId:c=null,showFolderLocation:u=!1,selected:p=[],onSelectItem:x=()=>{},anySelected:C=!1}){const F=S.useRef(null);let{ref:A,dimensions:k}=Co("rotations_grid");const T=st(),d=S.useMemo(()=>Me(p,"rotation"),[p]),B=S.useMemo(()=>Me(p,"folder"),[p]),[$,h]=S.useState(!1),b=S.useRef(a);b.current=a,S.useEffect(()=>{if(!T)return;const m=F.current;if(!m)return;const n=c==null,N=g=>g?n?g.kind==="rotation"?g.sourceFolderId!=null:g.kind==="folder"?g.sourceParentId!=null:!1:g.kind==="rotation"?g.sourceFolderId!==c:g.kind==="folder"?g.folderId!==c&&g.sourceParentId!==c:!1:!1;return at.dropTargetForElements({element:m,canDrop:({source:g})=>N(g==null?void 0:g.data),getData:()=>n?{kind:"library",scope:b.current}:{kind:"folder",folderId:c,scope:b.current},onDragEnter:({source:g})=>{N(g==null?void 0:g.data)&&h(!0)},onDragLeave:()=>h(!1),onDrop:()=>h(!1)})},[c,T]);let y=lr(k.width);const _=S.useMemo(()=>l?r.filter(m=>(m==null?void 0:m.kind)==="folder"):[],[r,l]),v=S.useMemo(()=>r.filter(m=>(m==null?void 0:m.kind)!=="folder"),[r]),w=S.useMemo(()=>{const m=[];for(let n=0;n<_.length;n+=y)m.push(_.slice(n,n+y));for(let n=0;n<v.length;n+=y)m.push(v.slice(n,n+y));return m},[_,v,y]),O=S.useCallback(m=>xo(w[m],m),[w]),D=po({count:w.length,getItemKey:O,estimateSize:()=>320,overscan:5,scrollToFn:()=>{},scrollPaddingStart:70,initialMeasurementsCache:typeof sessionStorage<"u"?JSON.parse(sessionStorage.getItem("virtualizer_rotations_grid_measurementsCache"))??[]:[]});S.useEffect(()=>()=>{typeof sessionStorage<"u"&&sessionStorage.setItem("virtualizer_rotations_grid_measurementsCache",JSON.stringify(D.measurementsCache))},[]);const P=Oo(),V=ze(()=>D.getVirtualItems()),f=ze(()=>D.getTotalSize()),R=(k.width-(y-1)*16)/y;return t(L,{sx:{width:"100%"},ref:A,children:t(L,{ref:F,sx:m=>({borderRadius:1,outline:$?`2px dashed ${m.palette.primary.main}`:"2px dashed transparent",outlineOffset:-2,backgroundColor:$?xe(m.palette.primary.main,.04):"transparent",transition:m.transitions.create(["background-color","outline-color"],{duration:m.transitions.duration.shortest})}),children:t(L,{sx:{height:`${f}px`,width:"100%",position:"relative"},children:V.map(m=>{var M,U;const n=w[m.index]??[],N=w[m.index+1],g=((M=n[0])==null?void 0:M.kind)==="folder"&&N!=null&&((U=N[0])==null?void 0:U.kind)!=="folder";return t("div",{ref:D.measureElement,style:{position:"absolute",width:"100%",height:P?`${m.size}px`:void 0,transform:`translateY(${m.start-D.options.scrollMargin}px)`},"data-index":m.index,children:t(q,{direction:"row",sx:{pb:g?4:2},spacing:2,children:n.map(z=>(z==null?void 0:z.kind)==="folder"?t(L,{sx:{display:"flex",width:R},children:t(Io,{folder:z,scope:a,editPermission:o,allFolders:s,teams:i,currentFolderId:c,onNavigateFolder:l,showFolderLocation:u,onOpen:E=>l(E.folder_id),isSelected:p.includes(z.id),onToggleSelect:(E,W,H)=>x(E.id,H),anySelected:C,itemKind:"rotation",selected:p})},z.id):t(L,{sx:{display:"flex",width:R},children:t(ar,{selectedTeamId:e==null?void 0:e.team_id,editPermission:o,rotation:z,teams:i,allFolders:s,currentFolderId:c,onNavigateFolder:l,showFolderLocation:u,isSelected:p.includes(z.id),onToggleSelect:(E,W)=>x(E.id,W),anySelected:C,selectedRotationIds:d,selectedFolderIds:B})},z.id??`rotation-${z.rotation_id}`))})},m.key)})})})})}function ge({isOnline:o=!0,onNewRotation:e,onNewFolder:r,onImportUrl:i,trigger:s="button"}){const a=S.useRef(),[l,c]=S.useState(!1),u=s==="floating",p=s==="icon"||u,x=C=>()=>{c(!1),C==null||C()};return I(J,{children:[p?t(Ao,{ref:a,label:"Add new","aria-haspopup":"menu","aria-expanded":l,"aria-controls":l?"add-new-rotation-menu":void 0,onClick:()=>c(C=>!C),children:t(To,{strokeWidth:2.75})}):I(Pt,{ref:a,size:"medium",variant:"contained","aria-label":"New rotation options",sx:{flexShrink:0,whiteSpace:"nowrap"},children:[t(X,{onClick:x(e),children:"New rotation"}),t(X,{"aria-label":"More add options","aria-haspopup":"menu","aria-expanded":l,"aria-controls":l?"add-new-rotation-menu":void 0,onClick:()=>c(C=>!C),sx:{px:1},children:t(Se,{icon:_t})})]}),t(Lt,{placement:u?"top-end":"bottom-end",sx:{zIndex:u?1300:2},open:l,anchorEl:a.current,transition:!0,disablePortal:!u,children:({TransitionProps:C})=>t(At,{...C,style:{transformOrigin:u?"right bottom":"right top"},children:t(Tt,{sx:{...u?{mb:.5}:{mt:.5},minWidth:240},elevation:12,children:t(zt,{onClickAway:()=>c(!1),children:I(Mt,{id:"add-new-rotation-menu",autoFocusItem:!0,children:[p&&I(fe,{onClick:x(e),sx:{fontSize:14},children:[t(he,{children:t(Se,{style:{fontSize:18},icon:ko})}),t(pe,{primaryTypographyProps:{fontSize:14},children:"New Rotation"})]}),I(fe,{onClick:x(r),sx:{fontSize:14},children:[t(he,{children:t(Yt,{fontSize:"small"})}),t(pe,{primaryTypographyProps:{fontSize:14},children:"New Folder"})]}),t(Wt,{sx:{my:.5}}),I(fe,{disabled:!o,onClick:x(i),sx:{fontSize:14},children:[t(he,{children:t(Po,{fontSize:"small"})}),t(pe,{primaryTypographyProps:{fontSize:14},children:"Import Shared Rotation from URL"})]})]})})})})})]})}
1function dr(o){const e=Q.c(5);let r;e[0]!==o?(r=o===void 0?{}:o,e[0]=o,e[1]=r):r=e[1];const{sourceScope:i,onAfterMove:s}=r;let a;e[2]!==s||e[3]!==i?(a={itemKind:"rotation",itemNoun:"rotation",sourceScope:i,onAfterMove:s},e[2]=s,e[3]=i,e[4]=a):a=e[4],qt(a)}const Ve=[20,50,100],He=o=>{const e=Q.c(12),{isEmpty:r,hasSearch:i,searchQuery:s,filterCount:a,currentFolderId:l,editPermission:c,returnTo:u}=o;let p;e[0]!==l||e[1]!==c||e[2]!==a||e[3]!==i||e[4]!==r?(p=Zt({isEmpty:r,hasSearch:i,filterCount:a,currentFolderId:l,editPermission:c}),e[0]=l,e[1]=c,e[2]=a,e[3]=i,e[4]=r,e[5]=p):p=e[5];const x=p;if(!x)return null;if(x==="createFirst"){let F;e[6]===Symbol.for("react.memo_cache_sentinel")?(F={color:"inherit",fontWeight:"bold"},e[6]=F):F=e[6];let A;if(e[7]!==u){const k=t(vt,{style:F,to:se.rotations.editor+"?id=new",state:{returnTo:u},children:"here"});A=I(Ce,{variant:"message",children:["Start creating your first rotation! Click ",k,"."]}),e[7]=u,e[8]=A}else A=e[8];return A}let C;return e[9]!==s||e[10]!==x?(C=t(Ce,{variant:x,itemNoun:"rotation",searchQuery:s}),e[9]=s,e[10]=x,e[11]=C):C=e[11],C},Ke=o=>{const e=Q.c(4),{isOnline:r,showOfflineIndicator:i,isError:s,error:a}=o;if(!r&&!i){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t(oe,{sx:{my:3},severity:"warning",children:"You are currently offline. This data may not be up to date."}),e[0]=l):l=e[0],l}else if(i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t(oe,{sx:{my:3},severity:"error",children:"You are currently offline. This data is not available"}),e[1]=l):l=e[1],l}else if(s){let l;return e[2]!==a?(l=t(Bo,{error:a}),e[2]=a,e[3]=l):l=e[3],l}};function ur(){const o=Re(),[e,r]=xt(),i=Ct(),s=ve(),{user:a}=Ie(),l=De({right:"EDIT_PLAY"}),{checkPermissions:c}=It(),{isOnline:u}=Mo(),p=S.useMemo(()=>!o||c({teamId:o==null?void 0:o.team_id,permissions:["EDIT_PLAY"]}),[o,c]),{themeRotationsView:x,themeRotationsPerPage:C,onChangeRotationsPerPage:F}=Je(),[A,k]=S.useState(!1),[T,d]=S.useState(!1),[B,$]=S.useState(!1),{order:h,orderBy:b,onSort:y}=$o(),_=S.useMemo(()=>Object.fromEntries(e.entries()),[e]),{items:v,filter:w,stats:O,page:D,showLoadingIndicator:P,rowsPerPage:V,searchParamsObject:f,updateFilters:R,filterCount:m,error:n,showOfflineIndicator:N,isError:g,resetFilters:M}=Vt({selectedTeamId:o==null?void 0:o.team_id,db_user_id:a.db_user_id,searchParams:_,rowsPerPage:C??20}),{selected:U,setSelected:z,anySelected:E,onSelectItem:W,clear:H,currentFolderId:G,currentFolder:K,folderNotFound:lt,folderScope:Z,allFolders:le,navigateToFolder:j,onSelectAllRows:Fe,navbarWidth:ct,isMobile:Ne,showMobileFolderHeader:Ee}=Qt({items:v,searchParams:e,updateFilters:R,selectedTeam:o,user:a,folderType:"rotation",editPermission:p});dr({sourceScope:Z,onAfterMove:H});const re=((f==null?void 0:f.title)??"").trim(),ee=re!=="",dt=S.useCallback(Y=>{R({sortBy:Y.orderBy,order:Y.order})},[R]),Oe=S.useRef(!0);S.useLayoutEffect(()=>{Oe.current===!1&&dt({order:h,orderBy:b}),Oe.current=!1},[h,b]),S.useEffect(()=>{let Y=e.get("code"),ue=e.get("free_rotation");Y&&k(!0),ue&&d(!0)},[]);const ke=S.useCallback((Y,ue)=>{R({page:ue+1})},[R]),Pe=S.useCallback(Y=>{F(Y.target.value),R({page:""})},[F,R]),Le=Wo(),ut=!o&&(O==null?void 0:O.count)>=3&&Le.status==="NO",mt=se.rotations.editor+"?id=new"+(G!=null?`&folder_id=${G}`:""),ce={isOnline:u,onNewRotation:()=>s(mt,{state:{returnTo:i.pathname+i.search}}),onNewFolder:()=>$(!0),onImportUrl:()=>k(!0)},de=!P&&v.length===0,Ae=i.pathname+i.search,ft=S.useCallback(()=>t(He,{isEmpty:de,hasSearch:ee,searchQuery:re,filterCount:m,currentFolderId:G,editPermission:p,returnTo:Ae}),[de,ee,re,m,G,p,Ae]);return I(so,{title:"Rotations",children:[Ee&&t(Jt,{folderName:(K==null?void 0:K.name)??"",onBack:()=>j((K==null?void 0:K.parent_folder_id)??null),addMenu:p&&t(ge,{trigger:"icon",...ce})}),A&&t(Uo,{code:e.get("code"),isOpen:A,close:()=>{k(!1),e.delete("code"),r(e,{replace:!0})}}),T&&t(Ho,{code:e.get("free_rotation"),isOpen:T,close:()=>{d(!1),e.delete("free_rotation"),r(e,{replace:!0})}}),t(Bt,{maxWidth:!1,children:I(Rt,{team:o,children:[!Ee&&t(ao,{heading:G==null?"Rotations":t(lo,{size:"title",rootLabel:"Rotations",currentFolderId:G,allFolders:le,scope:Z,onNavigate:j,itemKind:"rotation"}),action:p&&t(ge,{...ce})}),E&&t(Xt,{ActionsComponent:Ht,navbarWidth:ct,isMobile:Ne,selectedTeamId:o==null?void 0:o.team_id,onSelectAllRows:Fe,selected:U,items:v,clearSelection:H,teams:l,currentFolderId:G}),(!E||Ne)&&t(ir,{addControl:p&&t(ge,{trigger:"floating",...ce}),showLoadingIndicator:P,filterCount:m,updateFilters:R,stats:O,filter:w,searchParamsObject:f,editPermission:p,selectedTeamId:o==null?void 0:o.team_id,resetFilters:M}),ut&&t(Lo,{page:"rotations",payingUser:Le,selectedTeam:o}),t(zo,{filterCount:m,filter:w,searchParamsObject:f,updateFilters:R}),t(L,{sx:{width:"100%"}}),B&&t(no,{open:B,onClose:()=>$(!1),scope:Z,parent_folder_id:G,type:"rotation"}),lt?t(Ce,{variant:"folderNotFound",rootLabel:"Rotations",onBackToRoot:()=>j(null)}):I(L,{sx:{position:"relative",opacity:P?.5:1},children:[x==="grid"&&I(J,{children:[t(Ke,{isOnline:u,showOfflineIndicator:N,isError:g,error:n}),P&&t(L,{sx:{zIndex:1,position:"absolute",top:100,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center",opacity:.5},children:t(ae,{})}),!g&&I(J,{children:[t(cr,{editPermission:p,selectedTeam:o,items:v,teams:l,allFolders:le,folderScope:Z,onNavigateFolder:j,currentFolderId:G,showFolderLocation:ee,selected:U,onSelectItem:W,anySelected:E}),t(He,{isEmpty:de,hasSearch:ee,searchQuery:re,filterCount:m,currentFolderId:G,editPermission:p,returnTo:i.pathname+i.search}),t($t,{sx:{borderTop:0},rowsPerPageOptions:Ve,component:"div",count:Number(O==null?void 0:O.count),rowsPerPage:V,page:D-1,onPageChange:ke,onRowsPerPageChange:Pe})]})]}),x==="list"&&I(L,{sx:Y=>({[Y.breakpoints.down("sm")]:{borderRadius:0,mx:{xs:-2,sm:0}}}),children:[t(Ke,{isOnline:u,showOfflineIndicator:N,isError:g,error:n}
1),!g&&t(Kt,{virtualizerType:"window",selectedTeamId:o==null?void 0:o.team_id,editPermission:p,handlePageChange:ke,handleRowsPerPageChange:Pe,page:D-1,rowsPerPage:V,rowsPerPageOptions:Ve,items:v,showLoadingIndicator:P,stats:O,displayType:"view",order:h,orderBy:b,onSort:y,selected:U,setSelected:z,onSelectRow:W,onSelectAllRows:Fe,teams:l,allFolders:le,folderScope:Z,onNavigateFolder:j,currentFolderId:G,showFolderLocation:ee,showSelectedActionsBar:!1,EmptyComponent:ft},o==null?void 0:o.team_id)]})]})]})})]})}function Ni(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t(ur,{}),o[0]=e):e=o[0],e}export{Ni as default}; 2//# sourceMappingURL=_auth.dashboard.rotations-C1-BkYl1.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.