+
    <YjA                     t   ^ RI HtHtHtHtHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIt^ RIt^ RIt^ RIt]! ]4      tR]P$                  R&   R]P$                  R&   RP]P$                  R	&   R
]P$                  R&   R]P$                  R&   ]! ]4      P)                  4       P*                  t]R,          R,          t]R,          R,          t]R,          R,          t]R,          R,          t]]P$                  R,          ,          t]P9                  RRR7       ]P*                  P9                  RRR7       ]P*                  P9                  RRR7       ]P*                  P9                  RRR7       ]P*                  P9                  RRR7       R t]! 4       sR tR t ] ! 4       s!R t"]"! 4       s#R t$R t%R t&]&! 4       s'R t(]PR                  R 4       t*]PW                  R4      R 4       t,]PW                  R R!R".R#7      R$ 4       t-]PW                  R%4      R& 4       t.]PW                  R'4      R( 4       t/R) t0RQR* lt1]PW                  R+4      R, 4       t2R- t3]PW                  R.4      ]3R/ 4       4       t4]PW                  R04      ]3R1 4       4       t5]PW                  R24      ]3R3 4       4       t6]PW                  R44      ]3R5 4       4       t7]PW                  R64      ]3R7 4       4       t8]PW                  R84      ]3R9 4       4       t9]PW                  R:4      ]3R; 4       4       t:]PW                  R<4      ]3R= 4       4       t;]PW                  R>R".R#7      ]3R? 4       4       t<]PW                  R@R".R#7      ]3RA 4       4       t=]PW                  RB4      ]3RC 4       4       t>]PW                  RD4      ]3RE 4       4       t?]PW                  RFR".R#7      ]3RG 4       4       t@]PW                  RHR".R#7      ]3RI 4       4       tA]PW                  RJR".R#7      ]3RK 4       4       tB]PW                  RLR".R#7      ]3RM 4       4       tC]RN8X  d   ]P                  RRO7       R# R# )R    )Flaskrender_templateredirecturl_forrequestflashsession)secure_filename)PathNzdev-secret-key
SECRET_KEYzstatic/uploadsUPLOAD_FOLDERMAX_CONTENT_LENGTH
2rareadminADMIN_USERNAME	2rare2026ADMIN_PASSWORDdataz
pages.jsonz	team.jsonzsite_settings.jsonz
users.jsonT)parentsexist_okc            	         \         P                  4       '       dA   \         P                  R RR7      ;_uu_ 4       p \        P                  ! V 4      uuRRR4       # RRRRRR	R
R/RRRRRRR
R/.#   + '       g   i     L$; i)rutf-8encodingNslughometitleHomecontentzWelcome to 2rare.image aboutAboutz%We are a rising esports organization.)	DATA_FILEexistsopenjsonloadhandles    +C:\Users\Warar\Desktop\2rare website\app.py
load_pagesr,      s|    ^^C'^22f99V$ 32 
&)5H'SUV	'7I7^`gikl  32s   A//A?	c                      \         P                  R RR7      ;_uu_ 4       p \        P                  ! \        V ^R7       RRR4       R#   + '       g   i     R# ; iwr   r   )indentN)r$   r&   r'   dumppagesr)   s    r+   
save_pagesr3   *   s6    	g	.	.&		%* 
/	.	.	.   AA	c                  j   \         P                  4       '       dA   \         P                  R RR7      ;_uu_ 4       p \        P                  ! V 4      uuRRR4       # RRRRRR	R
RR/R	RRR/R	RRR/R	RRR/.RRRRRR	R/RRRRR	R/RRRRR	R/.RR R!RR"RRR#R/RR$RRR#R/.R%. /#   + '       g   i     LW; i)&r   r   r   Nr   
2rare Teamintro<Follow the squad across competition, culture, and community.statslabelzCurrent Rankvaluez#12zWin Ratez68%Tournaments24	Followers48KsocialsnameDiscordurlzhttps://discord.comzJoin the communityTikTokzhttps://www.tiktok.comzWatch highlightsYouTubezhttps://www.youtube.comzMatch recapsdiscord_widgetr!   postszNew highlights liveplatformzLatest match recaproster)TEAM_DATA_FILEr%   r&   r'   r(   r)   s    r+   load_team_settingsrK   /   s     w 77699V$ 87 	Ongu5j'51mWd3k7E2	
 	Y'<gG[\Xu&>I[\Y'@'>Z

 	"+U4LjZbc*E3LjZcd
 	"'  87s   B""B2	c                      \         P                  4       '       dA   \         P                  R RR7      ;_uu_ 4       p \        P                  ! V 4      uuRRR4       # RRRRRR/#   + '       g   i     L; i)r   r   r   Nlogor!   background_image	audio_url)SITE_SETTINGS_FILEr%   r&   r'   r(   r)   s    r+   load_site_settingsrQ   M   sZ      ""$$S7$;;v99V$ <;B*BR@@ <;s   A##A3	c                      \         P                  R RR7      ;_uu_ 4       p \        P                  ! \        V ^R7       RRR4       R#   + '       g   i     R# ; ir.   )rJ   r&   r'   r1   team_settingsr)   s    r+   save_team_settingsrT   W   s9    			S7		3	3v		-2 
4	3	3	3r4   c                      \         P                  R RR7      ;_uu_ 4       p \        P                  ! \        V ^R7       RRR4       R#   + '       g   i     R# ; ir.   )rP   r&   r'   r1   site_settingsr)   s    r+   save_site_settingsrW   \   s9    		 	 w	 	7	76		-2 
8	7	7	7r4   c                      \         P                  4       '       dA   \         P                  R RR7      ;_uu_ 4       p \        P                  ! V 4      uuRRR4       # . #   + '       g   i     . # ; i)r   r   r   N)
USERS_FILEr%   r&   r'   r(   r)   s    r+   
load_usersrZ   a   sM    __S7_33v99V$ 43I 43Is   AA.	c                      \         P                  R RR7      ;_uu_ 4       p \        P                  ! \        V ^R7       RRR4       R#   + '       g   i     R# ; ir.   )rY   r&   r'   r1   usersr)   s    r+   
save_usersr]   k   s6    	w	/	/6		%* 
0	/	/	/r4   c                  L    R \         R\        P                  ! RR4      R\        /# )r2   is_adminFrV   )r2   r	   getrV        r+   inject_pagesrc   p   s!    UJJ(FYfggrb   /c                      \        R 4      # )z
index.htmlr   ra   rb   r+   r   r   u   s    <((rb   z/loginGETPOST)methodsc                    aa \         P                  R 8X  Ed(   \         P                  P                  RR4      P	                  4       o\         P                  P                  RR4      P	                  4       oS\
        P                  R,          8X  dO   S\
        P                  R,          8X  d3   R\        R&   S\        R&   \        RR	4       \        \        R
4      4      # \        VV3R l\         4       R4      p V '       d3   R\        R&   S\        R&   \        RR	4       \        \        R
4      4      # \        RR4       \        R4      # )rh   usernamer!   passwordr   r   Tr_   zYou are now logged in.successadminc              3      <"   T F6  qP                  R 4      S8X  g   K  VP                  R4      S8X  g   K2  Vx  K8  	  R# 5i)rk   rl   Nr`   ).0userrl   rk   s   & r+   	<genexpr>login.<locals>.<genexpr>   s9     ~ut8LPX8Xd]a]e]efp]qu}]}ddus   AA
ANFzInvalid credentials.errorz
login.html)r   methodformr`   stripappconfigr	   r   r   r   nextr\   r   )matching_userrl   rk   s    @@r+   loginr}   z   s   ~~<<##J399;<<##J399;szz"233CJJO_D`8`"&GJ"*GJ*I6GG,--~u~  AE  F"'GJ"*GJ*I6GG,--$g.<((rb   z/logoutc                      \         P                  ! R R4       \         P                  ! RR4       \        RR4       \        \	        R4      4      # )r_   Nrk   zYou have been logged out.rm   r   )r	   popr   r   r   ra   rb   r+   logoutr      s8    KK
D!KK
D!	
%y1GFO$$rb   z/page/<slug>c                 |   a  \        V 3R  l\         4       R4      pV'       g   \        R4      R3# \        RVR7      # )c              3   F   <"   T F  qR ,          S8X  g   K  Vx  K  	  R# 5ir   Nra   )rq   pr   s   & r+   rs   page.<locals>.<genexpr>   s     <AF)t*;aas   !
!Nz404.htmli  z	page.html)page)r{   r2   r   )r   	page_datas   f r+   r   r      s5    <<dCIz*C//;Y77rb   c                 >    \         P                  ! R V  2^RR/R7      pVP                  '       d   VP                  4       p\	        V\
        4      '       d   VP                  R/ 4      P                  R4      ;'       g#    VP                  R/ 4      P                  R/ 4      p\	        V\
        4      '       dS   VP                  R4      ;'       g+    VP                  R4      ;'       g    VP                  R4      pVe   \        V4      # R	#   \         d     R	# i ; i)
z(https://www.tiktok.com/node/share/user/@
User-AgentMozilla/5.0timeoutheadersuserInforr   followerCount	followersfollower_countN)requestsr`   okr'   
isinstancedictstr	Exception)rk   responser   rr   r   s   &    r+   get_tiktok_follower_countr      s    <<6xjA!=1

 ;;;==?D$%%xx
B/33F;kktxx
TV?W?[?[\fhj?kdD))%)XXo%>%u%u$((;BW%u%u[_[c[cdt[uN%1">22   s*   /D AD  AD D * D DDc           
          \         P                  ! R V  2^RR/R7      pVP                  '       d   VP                  p. p\        P
                  ! RV4       F#  pVP                  VP                  ^4      4       K%  	  V'       d.   . pVRV  F   pVP                  RRRR V  R	V 2R
R/4       K"  	  V# . #   \         d     . # i ; i)zhttps://www.tiktok.com/@r   r   r   z"videoId":"([^"]+)"Nr   zLatest TikTok postrC   z/video/rH   rD   )	r   r`   r   textrefinditerappendgroupr   )rk   limitr   htmlmatchesmatchrG   video_ids   &&      r+   get_tiktok_recent_postsr      s    <<&xj1!=1

 ;;;==DG%;TBu{{1~. C 'HLL#5!9(78*U"H"  !0  I  Is   /B5 AB5 ,B5 5CCz/teamc                     R p \         P                  RR4      P                  4       P                  R4      pV'       d   \	        V4      p \        \         R,          4      pV '       d   RRRV /.V,           p\        \         P                  R. 4      4      p\         P                  RR4      P                  4       P                  R4      pV'       d   \        V^R	7      pV'       d   Tp\        R
V\         R,          \         R,          \         R,          \         P                  RR4      V\         P                  R. 4      R7      # )Ntiktok_usernamer!   @r9   r:   zTikTok Followersr;   rG   )r   z	team.htmlr@   r   r7   rF   rI   )r9   r@   r   r7   rF   rG   rI   )rS   r`   rx   lstripr   listr   r   )live_followersr   r9   rG   
live_postss        r+   teamr      s   N#''(92>DDFMMcRO2?Cw'(E('>B
 ""7B/0E#''(92>DDFMMcRO,_AF
Ei(G$G$$(()92>  2.	 	rb   c                 6   a  V 3R  lpS P                   Vn         V# )c                     < \         P                  ! R 4      '       g!   \        RR4       \        \	        R4      4      # S! V / VB # )r_   z'Please log in to access the admin area.ru   r}   )r	   r`   r   r   r   )argskwargsfuncs   *,r+   wrapperadmin_required.<locals>.wrapper   s=    {{:&&;WEGG,--T$V$$rb   )__name__)r   r   s   f r+   admin_requiredr      s    %
 }}GNrb   z/adminc                      \        R 4      # )z
admin.htmlrf   ra   rb   r+   rn   rn      s     <((rb   z/admin/pagesc                      \        R 4      # )zadmin_pages.htmlrf   ra   rb   r+   admin_pagesr           -..rb   z/admin/brandingc                      \        R 4      # )zadmin_branding.htmlrf   ra   rb   r+   admin_brandingr     s     011rb   z/admin/team-overviewc                      \        R 4      # )zadmin_team_overview.htmlrf   ra   rb   r+   admin_team_overviewr   
  s     566rb   z/admin/team-statsc                      \        R 4      # )zadmin_team_stats.htmlrf   ra   rb   r+   admin_team_statsr     s     233rb   z/admin/social-linksc                      \        R 4      # )zadmin_social_links.htmlrf   ra   rb   r+   admin_social_linksr     s     455rb   z/admin/embedsc                      \        R 4      # )zadmin_embeds.htmlrf   ra   rb   r+   admin_embedsr     s     .//rb   z/admin/usersc                  $    \        R \        R7      # )zadmin_users.html)r\   )r   r\   ra   rb   r+   admin_usersr   "  s     -U;;rb   z/admin/create-userc                  r  a \         P                  P                  R R4      P                  4       o\         P                  P                  RR4      P                  4       p S'       d	   V '       g!   \	        RR4       \        \        R4      4      # \        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       d!   \	        R	R4       \        \        R4      4      # \        P                  R SRV /4       \        4        \	        R
R4       \        \        R4      4      # )rk   r!   rl   z#Username and password are required.ru   r   c              3   J   <"   T F  qP                  R 4      S8H  x  K  	  R# 5i)rk   Nrp   )rq   rr   rk   s   & r+   rs   create_user.<locals>.<genexpr>3  s     
>88J8+s    #TFzThat username already exists.zUser created successfully.rm   )r   rw   r`   rx   r   r   r   anyr\   r   r]   )rl   rk   s    @r+   create_userr   (  s     ||
B/557H||
B/557H83W=.//
s
>
>sss
>
>>>-w7.//	LL*h
H=>L	
&	2GM*++rb   z/admin/delete-user/<username>c                     \          Uu. uF  qP                  R 4      V 8w  g   K  VNK  	  up\         R&   \        4        \        RR4       \	        \        R4      4      # u upi )rk   :NNNzUser deleted.rm   r   )r\   r`   r]   r   r   r   )rk   rr   s   & r+   delete_userr   =  sQ     "'K((:*>(*JKE!HL	/9%GM*++ Ls
   AAz/admin/rosterc                      \         P                  P                  R ^\        R7      p V e   V ^8  d   ^p \	        RV R7      # )rows)defaulttypezadmin_roster.htmlr   )r   r   r`   intr   r   s    r+   admin_rosterr   G  s=     <<FAC8D|tax.T::rb   z/admin/postsc                      \        R 4      # )zadmin_posts.htmlrf   ra   rb   r+   admin_postsr   P  r   rb   z/admin/add-pagec            
        a \         P                  P                  R R4      P                  4       p \         P                  P                  RR4      P                  4       P	                  4       P                  RR4      o\         P                  P                  RR4      P                  4       p\         P                  P                  R4      pV '       d   S'       d	   V'       g!   \        RR4       \        \        R	4      4      # \        ;QJ d#    V3R
 l\         4       F  '       g   K   RM	  RM! V3R
 l\         4       4      '       d!   \        RR4       \        \        R	4      4      # V'       dN   VP                  '       d<   \        VP                  4      pVP                  \        \         V,          4      4       MRp\        P#                  RSR V RVRV/4       \%        4        \        RR4       \        \        R	4      4      # )r   r!   r    -r   r    z&Title, slug, and content are required.ru   rn   c              3   :   <"   T F  qR ,          S8H  x  K  	  R# 5ir   ra   )rq   existingr   s   & r+   rs   add_page.<locals>.<genexpr>b  s     
:EFt#Es   TFz%A page with that slug already exists.zPage added successfully.rm   )r   rw   r`   rx   lowerreplacefilesr   r   r   r   r2   filenamer
   saver   
UPLOAD_DIRr   r3   )r   r   r    r   r   s       @r+   add_pager   V  s[    LLWb)//1E<<FB'--/557??SIDlly"-335GMMg&EG6@())
s
:E
:sss
:E
:::5w?())"5>>2

3zH,-.	LL&$	7GXVWL	
$i0GG$%%rb   z/admin/delete-page/<slug>c                     \          Uu. uF  qR ,          V 8w  g   K  VNK  	  ups \        4        \        RR4       \        \	        R4      4      # u upi )r   zPage deleted.rm   rn   )r2   r3   r   r   r   )r   r   s   & r+   delete_pager   r  sG     316d!2QQ3EL	/9%GG$%% 4s
   AAz/admin/update-teamc                     \         P                  P                  R R4      P                  4       ;'       g    R\        R&   \         P                  P                  RR4      P                  4       ;'       g    R\        R&   . \        R&   \        ^^4       EF=  p \         P                  P                  RV  24      R	8X  d   K-  \         P                  P                  R
V  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       p\         P                  P                  RV  2R4      P                  4       pV'       g4   V'       g,   V'       g$   V'       g   V'       g   V'       g   V'       g   EK  RT;'       g    RV  2RT;'       g    R/pV'       g!   V'       g   V'       g   V'       g	   V'       d   VP                  RVRVRVRVRVRR/4       \        R,          P                  V4       EK@  	  . \        R&   \        ^^4       EF  p \         P                  P                  RV  24      R	8X  d   K-  \         P                  P                  RV  2R4      P                  4       p	\         P                  P                  RV  2R4      P                  4       p
\         P                  P                  R V  2R4      P                  4       pV	'       g   V
'       g   V'       g   K  \        R,          P                  R!T	;'       g    R"V  2R#T
;'       g    R$RT;'       g    R%/4       EK   	  \         P                  P                  R&R4      P                  4       \        R&&   \         P                  P                  R'R4      P                  4       \        R'&   . p\        ^^4       EF  p \         P                  P                  R(V  24      R	8X  d   K-  \         P                  P                  R)V  2R4      P                  4       p\         P                  P                  R*V  2R4      P                  4       p
\         P                  P                  R+V  2R4      P                  4       pV'       g   V
'       g   V'       g   K  TP                  RT;'       g    R,V  2R#T
;'       g    R$R-T;'       g    R./4       EK  	  V\        R/&   . p\        ^^4       EF  p \         P                  P                  R0V  24      R	8X  d   K-  \         P                  P                  R1V  2R4      P                  4       p	\         P                  P                  R2V  2R4      P                  4       p\         P                  P                  R3V  2R4      P                  4       pV	'       g   V'       g   V'       g   K  TP                  R!T	;'       g    R4V  2R5T;'       g    R6R7V/4       EK  	  V\        R8&   \        4        \        R9R:4       \        \        R;4      4      # )<
team_titler!   r6   r   
team_intror8   r7   r9   remove_stat_1stat_label_stat_value_stat_opponent_stat_score_stat_result_
stat_date_stat_details_r:   zStat r;   r   opponentscoreresultdatedetailsis_matchTr@   remove_social_social_name_social_url_social_label_rA   zSocial rC   #ConnectrF   r   remove_post_post_title_	post_url_post_platform_zPost rH   SocialrG   remove_roster_roster_name_roster_role_roster_link_zMember roleRosterlinkrI   z#Team settings updated successfully.rm   rn   )r   rw   r`   rx   rS   rangeupdater   rT   r   r   r   )indexr:   r;   r   r   r   r   r   
stat_entryrA   rC   rG   r   rH   rI   r  r	  s                    r+   update_teamr  |  s    %\\--lB?EEGWW<M'$\\--lB?EEG  J  J  LJM'M'q!<<l5'23s:  ;ug!6;AAC  ;ug!6;AAC<<##nUG$<bAGGI  ;ug!6;AAC!!L"8"=CCE||*UG 4b9??A,,""]5'#:B?EEGEX&DGG!5#;#;eE7OWellsSJ5Fdg!!UfDw#  '"))*5+ .  "M)q!<<nUG45<||,ug 6;AACllUG4b9??A  =!8"=CCE3%%)$++VT5N5Nwug=NPUWZWaWa^acjlql~l~u~,  A  '.ll&6&67G&L&R&R&TM"#'.||'7'78I2'N'T'T'VM#$Eq!<<l5'23s:  ;ug!6;AACll5'2B7==?<<##nUG$<bAGGIC88LL'5#;#;eE7OUCJJ3PZ\d\p\phpqr  #M'Fq"<<nUG45<||,ug 6;AAC||,ug 6;AAC||,ug 6;AAC444MM11'% 1((   %M(	
/;GG$%%rb   z/admin/update-site-settingsc                     \         P                  P                  R 4      p V '       dW   V P                  '       dE   \	        V P                  4      pV P                  \        \        V,          4      4       V\        R&   M-\         P                  P                  R4      R8X  d
   R\        R&   \         P                  P                  R4      pV'       dW   VP                  '       dE   \	        VP                  4      pVP                  \        \        V,          4      4       V\        R&   M-\         P                  P                  R4      R8X  d
   R\        R&   \         P                  P                  RR4      P                  4       pV'       d   V\        R	&   M-\         P                  P                  R
4      R8X  d
   R\        R	&   \        4        \        RR4       \        \        R4      4      # )	site_logorM   remove_logor   r!   site_backgroundrN   remove_backgroundsite_audio_urlrO   remove_audioz#Site branding updated successfully.rm   rn   )r   r   r`   r   r
   r   r   r   rV   rw   rx   rW   r   r   r   )	logo_filer   background_filerO   s       r+   update_site_settingsr    s_    !!+.IY'''"9#5#56s:012 (f			-	(C	/ "fmm''(9:O?333"?#;#;<Sh!678,4()			-	.#	5,.()  !126<<>I%.k"			.	)S	0%'k"	
/;GG$%%rb   __main__)debugi   )   )Eflaskr   r   r   r   r   r   r	   werkzeug.utilsr
   pathlibr   r'   osr   r   r   ry   rz   __file__resolveparentBASE_DIRr$   rJ   rP   rY   r   mkdirr,   r2   r3   rK   rS   rQ   rV   rT   rW   rZ   r\   r]   context_processorrc   router   r}   r   r   r   r   r   r   rn   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  runra   rb   r+   <module>r(     s   T T T *   	 	 Ho+

< .

? #3

  +

 *

 >!!#**v,	F"[0&)== -


?33
 
    - 	    td  3     D4  8     t  < 
    t  4 	+
6 #$A #$3
3
 	+
 h h 3) ) 8eV_-) .)* 9% % >8 8(4 7 > 8)  ) >/  / 2  2 !"7  #7 4   4  !6  "6 ?0  0 ><  < &2,  3,& *VH=,  >, ?;  ; >/  / vh/&  0&4 &9&  :& &2F&  3F&R (6(;&  <&: zGG$G rb   