WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
! function ( e ) { var t = { } ; function n ( r ) { if ( t [ r ] ) return t [ r ] . exports ; var i = t [ r ] = { i : r , l : ! 1 , exports : { } } ; return e [ r ] . call ( i . exports , i , i . exports , n ) , i . l = ! 0 , i . exports } n . m = e , n . c = t , n . d = function ( e , t , r ) { n . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : r } ) } , n . r = function ( e ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } , n . t = function ( e , t ) { if ( 1 & t && ( e = n ( e ) ) , 8 & t ) return e ; if ( 4 & t && "object" == typeof e && e && e . _ _esModule ) return e ; var r = Object . create ( null ) ; if ( n . r ( r ) , Object . defineProperty ( r , "default" , { enumerable : ! 0 , value : e } ) , 2 & t && "string" != typeof e ) for ( var i in e ) n . d ( r , i , function ( t ) { return e [ t ] } . bind ( null , i ) ) ; return r } , n . n = function ( e ) { var t = e && e . _ _esModule ? function ( ) { return e . default } : function ( ) { return e } ; return n . d ( t , "a" , t ) , t } , n . o = function ( e , t ) { return Object . prototype . hasOwnProperty . call ( e , t ) } , n . p = "/" , n ( n . s = 220 ) } ( [ function ( e , t , n ) { "use strict" ; e . exports = n ( 104 ) } , function ( e , t ) { "function" == typeof Object . create ? e . exports = function ( e , t ) { t && ( e . super _ = t , e . prototype = Object . create ( t . prototype , { constructor : { value : e , enumerable : ! 1 , writable : ! 0 , configurable : ! 0 } } ) ) } : e . exports = function ( e , t ) { if ( t ) { e . super _ = t ; var n = function ( ) { } ; n . prototype = t . prototype , e . prototype = new n , e . prototype . constructor = e } } } , function ( e , t , n ) { var r = n ( 3 ) , i = r . Buffer ; function o ( e , t ) { for ( var n in e ) t [ n ] = e [ n ] } function a ( e , t , n ) { return i ( e , t , n ) } i . from && i . alloc && i . allocUnsafe && i . allocUnsafeSlow ? e . exports = r : ( o ( r , t ) , t . Buffer = a ) , o ( i , a ) , a . from = function ( e , t , n ) { if ( "number" == typeof e ) throw new TypeError ( "Argument must not be a number" ) ; return i ( e , t , n ) } , a . alloc = function ( e , t , n ) { if ( "number" != typeof e ) throw new TypeError ( "Argument must be a number" ) ; var r = i ( e ) ; return void 0 !== t ? "string" == typeof n ? r . fill ( t , n ) : r . fill ( t ) : r . fill ( 0 ) , r } , a . allocUnsafe = function ( e ) { if ( "number" != typeof e ) throw new TypeError ( "Argument must be a number" ) ; return i ( e ) } , a . allocUnsafeSlow = function ( e ) { if ( "number" != typeof e ) throw new TypeError ( "Argument must be a number" ) ; return r . SlowBuffer ( e ) } } , function ( e , t , n ) { "use strict" ; ( function ( e ) {
/ * !
* The buffer module from node . js , for the browser .
*
* @ author Feross Aboukhadijeh < http : //feross.org>
* @ license MIT
2020-06-13 19:24:28 +00:00
* / v a r r = n ( 1 1 8 ) , i = n ( 1 1 9 ) , o = n ( 1 2 0 ) ; f u n c t i o n a ( ) { r e t u r n u . T Y P E D _ A R R A Y _ S U P P O R T ? 2 1 4 7 4 8 3 6 4 7 : 1 0 7 3 7 4 1 8 2 3 } f u n c t i o n s ( e , t ) { i f ( a ( ) < t ) t h r o w n e w R a n g e E r r o r ( " I n v a l i d t y p e d a r r a y l e n g t h " ) ; r e t u r n u . T Y P E D _ A R R A Y _ S U P P O R T ? ( e = n e w U i n t 8 A r r a y ( t ) ) . _ _ p r o t o _ _ = u . p r o t o t y p e : ( n u l l = = = e & & ( e = n e w u ( t ) ) , e . l e n g t h = t ) , e } f u n c t i o n u ( e , t , n ) { i f ( ! ( u . T Y P E D _ A R R A Y _ S U P P O R T | | t h i s i n s t a n c e o f u ) ) r e t u r n n e w u ( e , t , n ) ; i f ( " n u m b e r " = = t y p e o f e ) { i f ( " s t r i n g " = = t y p e o f t ) t h r o w n e w E r r o r ( " I f e n c o d i n g i s s p e c i f i e d t h e n t h e f i r s t a r g u m e n t m u s t b e a s t r i n g " ) ; r e t u r n l ( t h i s , e ) } r e t u r n f ( t h i s , e , t , n ) } f u n c t i o n f ( e , t , n , r ) { i f ( " n u m b e r " = = t y p e o f t ) t h r o w n e w T y p e E r r o r ( ' " v a l u e " a r g u m e n t m u s t n o t b e a n u m b e r ' ) ; r e t u r n " u n d e f i n e d " ! = t y p e o f A r r a y B u f f e r & & t i n s t a n c e o f A r r a y B u f f e r ? f u n c t i o n ( e , t , n , r ) { i f ( t . b y t e L e n g t h , n < 0 | | t . b y t e L e n g t h < n ) t h r o w n e w R a n g e E r r o r ( " ' o f f s e t ' i s o u t o f b o u n d s " ) ; i f ( t . b y t e L e n g t h < n + ( r | | 0 ) ) t h r o w n e w R a n g e E r r o r ( " ' l e n g t h ' i s o u t o f b o u n d s " ) ; t = v o i d 0 = = = n & & v o i d 0 = = = r ? n e w U i n t 8 A r r a y ( t ) : v o i d 0 = = = r ? n e w U i n t 8 A r r a y ( t , n ) : n e w U i n t 8 A r r a y ( t , n , r ) ; u . T Y P E D _ A R R A Y _ S U P P O R T ? ( e = t ) . _ _ p r o t o _ _ = u . p r o t o t y p e : e = d ( e , t ) ; r e t u r n e } ( e , t , n , r ) : " s t r i n g " = = t y p e o f t ? f u n c t i o n ( e , t , n ) { " s t r i n g " = = t y p e o f n & & " " ! = = n | | ( n = " u t f 8 " ) ; i f ( ! u . i s E n c o d i n g ( n ) ) t h r o w n e w T y p e E r r o r ( ' " e n c o d i n g " m u s t b e a v a l i d s t r i n g e n c o d i n g ' ) ; v a r r = 0 | p ( t , n ) , i = ( e = s ( e , r ) ) . w r i t e ( t , n ) ; i ! = = r & & ( e = e . s l i c e ( 0 , i ) ) ; r e t u r n e } ( e , t , n ) : f u n c t i o n ( e , t ) { i f ( u . i s B u f f e r ( t ) ) { v a r n = 0 | h ( t . l e n g t h ) ; r e t u r n 0 = = = ( e = s ( e , n ) ) . l e n g t h | | t . c o p y ( e , 0 , 0 , n ) , e } i f ( t ) { i f ( " u n d e f i n e d " ! = t y p e o f A r r a y B u f f e r & & t . b u f f e r i n s t a n c e o f A r r a y B u f f e r | | " l e n g t h " i n t ) r e t u r n " n u m b e r " ! = t y p e o f t . l e n g t h | | ( r = t . l e n g t h ) ! = r ? s ( e , 0 ) : d ( e , t ) ; i f ( " B u f f e r " = = = t . t y p e & & o ( t . d a t a ) ) r e t u r n d ( e , t . d a t a ) } v a r r ; t h r o w n e w T y p e E r r o r ( " F i r s t a r g u m e n t m u s t b e a s t r i n g , B u f f e r , A r r a y B u f f e r , A r r a y , o r a r r a y - l i k e o b j e c t . " ) } ( e , t ) } f u n c t i o n c ( e ) { i f ( " n u m b e r " ! = t y p e o f e ) t h r o w n e w T y p e E r r o r ( ' " s i z e " a r g u m e n t m u s t b e a n u m b e r ' ) ; i f ( e < 0 ) t h r o w n e w R a n g e E r r o r ( ' " s i z e " a r g u m e n t m u s t n o t b e n e g a t i v e ' ) } f u n c t i o n l ( e , t ) { i f ( c ( t ) , e = s ( e , t < 0 ? 0 : 0 | h ( t ) ) , ! u . T Y P E D _ A R R A Y _ S U P P O R T ) f o r ( v a r n = 0 ; n < t ; + + n ) e [ n ] = 0 ; r e t u r n e } f u n c t i o n d ( e , t ) { v a r n = t . l e n g t h < 0 ? 0 : 0 | h ( t . l e n g t h ) ; e = s ( e , n ) ; f o r ( v a r r = 0 ; r < n ; r + = 1 ) e [ r ] = 2 5 5 & t [ r ] ; r e t u r n e } f u n c t i o n h ( e ) { i f ( e > = a ( ) ) t h r o w n e w R a n g e E r r o r ( " A t t e m p t t o a l l o c a t e B u f f e r l a r g e r t h a n m a x i m u m s i z e : 0 x " + a ( ) . t o S t r i n g ( 1 6 ) + " b y t e s " ) ; r e t u r n 0 | e } f u n c t i o n p ( e , t ) { i f ( u . i s B u f f e r ( e ) ) r e t u r n e . l e n g t h ; i f ( " u n d e f i n e d " ! = t y p e o f A r r a y B u f f e r & & " f u n c t i o n " = = t y p e o f A r r a y B u f f e r . i s V i e w & & ( A r r a y B u f f e r . i s V i e w ( e ) | | e i n s t a n c e o f A r r a y B u f f e r ) ) r e t u r n e . b y t e L e n g t h ; " s t r i n g " ! = t y p e o f e & & ( e = " " + e ) ; v a r n = e . l e n g t h ; i f ( 0 = = = n ) r e t u r n 0 ; f o r ( v a r r = ! 1 ; ; ) s w i t c h ( t ) { c a s e " a s c i i " : c a s e " l a t i n 1 " : c a s e " b i n a r y " : r e t u r n n ; c a s e " u t f 8 " : c a s e " u t f - 8 " : c a s e v o i d 0 : r e t u r n U ( e ) . l e n g t h ; c a s e " u c s 2 " : c a s e " u c s - 2 " : c a s e " u t f 1 6 l e " : c a s e " u t f - 1 6 l e " : r e t u r n 2 * n ; c a s e " h e x " : r e t u r n n > > > 1 ; c a s e " b a s e 6 4 " : r e t u r n F ( e ) . l e n g t h ; d e f a u l t : i f ( r ) r e t u r n U ( e ) . l e n g t h ; t = ( " " + t ) . t o L o w e r C a s e ( ) , r = ! 0 } } f u n c t i o n b ( e , t , n ) { v a r r = ! 1 ; i f ( ( v o i d 0 = = = t | | t < 0 ) & & ( t = 0 ) , t > t h i s . l e n g t h ) r e t u r n " " ; i f ( ( v o i d 0 = = = n | | n > t h i s . l e n g t h ) & & ( n = t h i s . l e n g t h ) , n < = 0 ) r e t u r n " " ; i f ( ( n > > > = 0 ) < = ( t > > > = 0 ) ) r e t u r n " " ; f o r ( e | | ( e = " u t f 8 " ) ; ; ) s w i t c h ( e ) { c a s e " h e x " : r e t u r n C ( t h i s , t , n ) ; c a s e " u t f 8 " : c a s e " u t f - 8 " : r e t u r n M ( t h i s , t , n ) ; c a s e " a s c i i " : r e t u r n T ( t h i s , t , n ) ; c a s e " l a t i n 1 " : c a s e " b i n a r y " : r e t u r n A ( t h i s , t , n ) ; c a s e " b a s e 6 4 " : r e t u r n x ( t h i s , t , n ) ; c a s e " u c s 2 " : c a s e " u c s - 2 " : c a s e " u t f 1 6 l e " : c a s e " u t f - 1 6 l e " : r e t u r n P ( t h i s , t , n ) ; d e f a u l t : i f ( r ) t h r o w n e w T y p e E r r o r ( " U n k n o w n e n c o d i n g : " + e ) ; e = ( e + " " ) . t o L o w e r C a s e ( ) , r = ! 0 } } f u n c t i o n m ( e , t , n ) { v a r r = e [ t ] ; e [ t ] = e [ n ] , e [ n ] = r } f u n c t i o n y ( e , t , n , r , i ) { i f ( 0 = = = e . l e n g t h ) r e t u r n - 1 ; i f ( " s t r i n g " = = t y p e o f n ? ( r = n , n = 0 ) : n > 2 1 4 7 4 8 3 6 4 7 ? n = 2 1 4 7 4 8 3 6 4 7 : n < - 2 1 4 7 4 8 3 6 4 8 & & ( n = - 2 1 4 7 4 8 3 6 4 8 ) , n = + n , i s N a N ( n ) & & ( n = i ? 0 : e . l e n g t h - 1 ) , n < 0 & & ( n = e . l e n g t h + n ) , n > = e . l e n g t h ) { i f ( i ) r e t u r n - 1 ; n = e . l e n g t h - 1 } e l s e i f ( n < 0 ) { i f ( ! i ) r e t u r n - 1 ; n = 0 } i f ( " s t r i n g " = = t y p e o f t & & ( t = u . f r o m ( t , r ) ) , u . i s B u f f e r ( t ) ) r e t u r n 0 = = = t . l e n g t h ? - 1 : v ( e , t , n , r , i ) ; i f ( " n u m b e r " = = t y p e o f t ) r e t u r n t & = 2 5 5 , u . T Y P E D _ A R R A Y _ S U P P O R T & & " f u n c t i o n " = = t y p e o f U i n t 8 A r r a y . p r o t o t y p e . i n d e x O f ? i ? U i n t 8 A r r a y . p r o t o t y p e . i n d e x O f . c a l l ( e , t , n ) : U i n t 8 A r r a y . p r o t o t y p e . l a s t I n d e x O f . c a l l ( e , t , n ) : v ( e , [ t ] , n , r , i ) ; t h r o w n e w T y p e E r r o r ( " v a l m u s t b e s t r i n g , n u m b e r o r B u f f e r " ) } f u n c t i o n v ( e , t , n , r , i ) { v a r o , a = 1 , s = e . l e n g t h , u = t . l e n g t h ; i f ( v o i d 0 ! = = r & & ( " u c s 2 " = = = ( r = S t r i n g ( r ) . t o L o w e r C a s e ( ) )
WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
/ *
object - assign
( c ) Sindre Sorhus
@ license MIT
2020-06-13 19:24:28 +00:00
* / v a r r = O b j e c t . g e t O w n P r o p e r t y S y m b o l s , i = O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y , o = O b j e c t . p r o t o t y p e . p r o p e r t y I s E n u m e r a b l e ; f u n c t i o n a ( e ) { i f ( n u l l = = e ) t h r o w n e w T y p e E r r o r ( " O b j e c t . a s s i g n c a n n o t b e c a l l e d w i t h n u l l o r u n d e f i n e d " ) ; r e t u r n O b j e c t ( e ) } e . e x p o r t s = f u n c t i o n ( ) { t r y { i f ( ! O b j e c t . a s s i g n ) r e t u r n ! 1 ; v a r e = n e w S t r i n g ( " a b c " ) ; i f ( e [ 5 ] = " d e " , " 5 " = = = O b j e c t . g e t O w n P r o p e r t y N a m e s ( e ) [ 0 ] ) r e t u r n ! 1 ; f o r ( v a r t = { } , n = 0 ; n < 1 0 ; n + + ) t [ " _ " + S t r i n g . f r o m C h a r C o d e ( n ) ] = n ; i f ( " 0 1 2 3 4 5 6 7 8 9 " ! = = O b j e c t . g e t O w n P r o p e r t y N a m e s ( t ) . m a p ( ( f u n c t i o n ( e ) { r e t u r n t [ e ] } ) ) . j o i n ( " " ) ) r e t u r n ! 1 ; v a r r = { } ; r e t u r n " a b c d e f g h i j k l m n o p q r s t " . s p l i t ( " " ) . f o r E a c h ( ( f u n c t i o n ( e ) { r [ e ] = e } ) ) , " a b c d e f g h i j k l m n o p q r s t " = = = O b j e c t . k e y s ( O b j e c t . a s s i g n ( { } , r ) ) . j o i n ( " " ) } c a t c h ( e ) { r e t u r n ! 1 } } ( ) ? O b j e c t . a s s i g n : f u n c t i o n ( e , t ) { f o r ( v a r n , s , u = a ( e ) , f = 1 ; f < a r g u m e n t s . l e n g t h ; f + + ) { f o r ( v a r c i n n = O b j e c t ( a r g u m e n t s [ f ] ) ) i . c a l l ( n , c ) & & ( u [ c ] = n [ c ] ) ; i f ( r ) { s = r ( n ) ; f o r ( v a r l = 0 ; l < s . l e n g t h ; l + + ) o . c a l l ( n , s [ l ] ) & & ( u [ s [ l ] ] = n [ s [ l ] ] ) } } r e t u r n u } } , f u n c t i o n ( e , t , n ) { " u s e s t r i c t " ; v a r r = n ( 1 2 1 ) . B u f f e r , i = n ( 1 2 2 ) . T r a n s f o r m ; f u n c t i o n o ( e ) { i . c a l l ( t h i s ) , t h i s . _ b l o c k = r . a l l o c U n s a f e ( e ) , t h i s . _ b l o c k S i z e = e , t h i s . _ b l o c k O f f s e t = 0 , t h i s . _ l e n g t h = [ 0 , 0 , 0 , 0 ] , t h i s . _ f i n a l i z e d = ! 1 } n ( 1 ) ( o , i ) , o . p r o t o t y p e . _ t r a n s f o r m = f u n c t i o n ( e , t , n ) { v a r r = n u l l ; t r y { t h i s . u p d a t e ( e , t ) } c a t c h ( e ) { r = e } n ( r ) } , o . p r o t o t y p e . _ f l u s h = f u n c t i o n ( e ) { v a r t = n u l l ; t r y { t h i s . p u s h ( t h i s . d i g e s t ( ) ) } c a t c h ( e ) { t = e } e ( t ) } , o . p r o t o t y p e . u p d a t e = f u n c t i o n ( e , t ) { i f ( f u n c t i o n ( e , t ) { i f ( ! r . i s B u f f e r ( e ) & & " s t r i n g " ! = t y p e o f e ) t h r o w n e w T y p e E r r o r ( t + " m u s t b e a s t r i n g o r a b u f f e r " ) } ( e , " D a t a " ) , t h i s . _ f i n a l i z e d ) t h r o w n e w E r r o r ( " D i g e s t a l r e a d y c a l l e d " ) ; r . i s B u f f e r ( e ) | | ( e = r . f r o m ( e , t ) ) ; f o r ( v a r n = t h i s . _ b l o c k , i = 0 ; t h i s . _ b l o c k O f f s e t + e . l e n g t h - i > = t h i s . _ b l o c k S i z e ; ) { f o r ( v a r o = t h i s . _ b l o c k O f f s e t ; o < t h i s . _ b l o c k S i z e ; ) n [ o + + ] = e [ i + + ] ; t h i s . _ u p d a t e ( ) , t h i s . _ b l o c k O f f s e t = 0 } f o r ( ; i < e . l e n g t h ; ) n [ t h i s . _ b l o c k O f f s e t + + ] = e [ i + + ] ; f o r ( v a r a = 0 , s = 8 * e . l e n g t h ; s > 0 ; + + a ) t h i s . _ l e n g t h [ a ] + = s , ( s = t h i s . _ l e n g t h [ a ] / 4 2 9 4 9 6 7 2 9 6 | 0 ) > 0 & & ( t h i s . _ l e n g t h [ a ] - = 4 2 9 4 9 6 7 2 9 6 * s ) ; r e t u r n t h i s } , o . p r o t o t y p e . _ u p d a t e = f u n c t i o n ( ) { t h r o w n e w E r r o r ( " _ u p d a t e i s n o t i m p l e m e n t e d " ) } , o . p r o t o t y p e . d i g e s t = f u n c t i o n ( e ) { i f ( t h i s . _ f i n a l i z e d ) t h r o w n e w E r r o r ( " D i g e s t a l r e a d y c a l l e d " ) ; t h i s . _ f i n a l i z e d = ! 0 ; v a r t = t h i s . _ d i g e s t ( ) ; v o i d 0 ! = = e & & ( t = t . t o S t r i n g ( e ) ) , t h i s . _ b l o c k . f i l l ( 0 ) , t h i s . _ b l o c k O f f s e t = 0 ; f o r ( v a r n = 0 ; n < 4 ; + + n ) t h i s . _ l e n g t h [ n ] = 0 ; r e t u r n t } , o . p r o t o t y p e . _ d i g e s t = f u n c t i o n ( ) { t h r o w n e w E r r o r ( " _ d i g e s t i s n o t i m p l e m e n t e d " ) } , e . e x p o r t s = o } , f u n c t i o n ( e , t , n ) { " u s e s t r i c t " ; ( f u n c t i o n ( t , r ) { v a r i ; e . e x p o r t s = x , x . R e a d a b l e S t a t e = k ; n ( 2 2 ) . E v e n t E m i t t e r ; v a r o = f u n c t i o n ( e , t ) { r e t u r n e . l i s t e n e r s ( t ) . l e n g t h } , a = n ( 5 8 ) , s = n ( 3 ) . B u f f e r , u = t . U i n t 8 A r r a y | | f u n c t i o n ( ) { } ; v a r f , c = n ( 1 2 3 ) ; f = c & & c . d e b u g l o g ? c . d e b u g l o g ( " s t r e a m " ) : f u n c t i o n ( ) { } ; v a r l , d , h , p = n ( 1 2 4 ) , b = n ( 5 9 ) , m = n ( 6 0 ) . g e t H i g h W a t e r M a r k , y = n ( 1 6 ) . c o d e s , v = y . E R R _ I N V A L I D _ A R G _ T Y P E , g = y . E R R _ S T R E A M _ P U S H _ A F T E R _ E O F , w = y . E R R _ M E T H O D _ N O T _ I M P L E M E N T E D , _ = y . E R R _ S T R E A M _ U N S H I F T _ A F T E R _ E N D _ E V E N T ; n ( 1 ) ( x , a ) ; v a r S = b . e r r o r O r D e s t r o y , E = [ " e r r o r " , " c l o s e " , " d e s t r o y " , " p a u s e " , " r e s u m e " ] ; f u n c t i o n k ( e , t , r ) { i = i | | n ( 1 7 ) , e = e | | { } , " b o o l e a n " ! = t y p e o f r & & ( r = t i n s t a n c e o f i ) , t h i s . o b j e c t M o d e = ! ! e . o b j e c t M o d e , r & & ( t h i s . o b j e c t M o d e = t h i s . o b j e c t M o d e | | ! ! e . r e a d a b l e O b j e c t M o d e ) , t h i s . h i g h W a t e r M a r k = m ( t h i s , e , " r e a d a b l e H i g h W a t e r M a r k " , r ) , t h i s . b u f f e r = n e w p , t h i s . l e n g t h = 0 , t h i s . p i p e s = n u l l , t h i s . p i p e s C o u n t = 0 , t h i s . f l o w i n g = n u l l , t h i s . e n d e d = ! 1 , t h i s . e n d E m i t t e d = ! 1 , t h i s . r e a d i n g = ! 1 , t h i s . s y n c = ! 0 , t h i s . n e e d R e a d a b l e = ! 1 , t h i s . e m i t t e d R e a d a b l e = ! 1 , t h i s . r e a d a b l e L i s t e n i n g = ! 1 , t h i s . r e s u m e S c h e d u l e d = ! 1 , t h i s . p a u s e d = ! 0 , t h i s . e m i t C l o s e = ! 1 ! = = e . e m i t C l o s e , t h i s . a u t o D e s t r o y = ! ! e . a u t o D e s t r o y , t h i s . d e s t r o y e d = ! 1 , t h i s . d e f a u l t E n c o d i n g = e . d e f a u l t E n c o d i n g | | " u t f 8 " , t h i s . a w a i t D r a i n = 0 , t h i s . r e a d i n g M o r e = ! 1 , t h i s . d e c o d e r = n u l l , t h i s . e n c o d i n g = n u l l , e . e n c o d i n g & & ( l | | ( l = n ( 2 3 ) . S t r i n g D e c o d e r ) , t h i s . d e c o d e r = n e w l ( e . e n c o d i n g ) , t h i s . e n c o d i n g = e . e n c o d i n g ) } f u n c t i o n x ( e ) { i f ( i = i | | n ( 1 7 ) , ! ( t h i s i n s t a n c e o f x ) ) r e t u r n n e w x ( e ) ; v a r t = t h i s i n s t a n c e o f i ; t h i s . _ r e a d a b l e S t a t e = n e w k ( e , t h i s , t ) , t h i s . r e a d a b l e = ! 0 , e & & ( " f u n c t i o n " = = t y p e o f e . r e a d & & ( t h i s . _ r e a d = e . r e a d ) , " f u n c t i o n " = = t y p e o f e . d e s t r o y & & ( t h i s . _ d e s t r o y = e . d e s t r o y ) ) , a . c a l l ( t h i s ) } f u n c t i o n M ( e , t , n , r , i ) { f ( " r e a d a b l e A d d C h u n k " , t ) ; v a r o , a = e . _ r e a d a b l e S t a t e ; i f ( n u l l = = = t ) a . r e a d i n g = ! 1 , f u n c t i o n ( e , t ) { i f ( f ( " o n E o f C h u n k " ) , t . e n d e d ) r e t u r n ; i f ( t . d e c o d e r ) { v a r n = t . d e c o d e r . e n d ( ) ; n & & n . l e n g t h & & ( t . b
WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
/ * * @ l i c e n s e R e a c t v 1 6 . 1 3 . 1
* react . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2020-06-13 19:24:28 +00:00
* /var r=n(55),i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,f=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,l=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,h=i?Symbol.for("react.suspense"):60113,p=i?Symbol.for("react.memo"):60115,b=i?Symbol.for("react.lazy"):60116,m="function"==typeof Symbol&&Symbol.iterator;function y(e){for(var t="https:/ / reactjs . org / docs / error - decoder . html ? invariant = "+e,n=1;n<arguments.length;n++)t+=" & args [ ] = "+encodeURIComponent(arguments[n]);return" Minified React error # "+e+" ; visit "+t+" for the full message or use the non - minified dev environment for full errors and additional helpful warnings . "}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g={};function w(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||v}function _(){}function S(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||v}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if(" object "!=typeof e&&" function "!=typeof e&&null!=e)throw Error(y(85));this.updater.enqueueSetState(this,e,t," setState ")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e," forceUpdate ")},_.prototype=w.prototype;var E=S.prototype=new _;E.constructor=S,r(E,w.prototype),E.isPureReactComponent=!0;var k={current:null},x=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,n){var r,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=" "+t.key),t)x.call(t,r)&&!M.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var f=Array(u),c=0;c<u;c++)f[c]=arguments[c+2];i.children=f}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:k.current}}function A(e){return" object "==typeof e&&null!==e&&e.$$typeof===o}var C=/\/+/g,P=[];function R(e,t,n,r){if(P.length){var i=P.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function O(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>P.length&&P.push(e)}function I(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;" undefined "!==s&&" boolean "!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case" string ":case" number ":u=!0;break;case" object ":switch(t.$$typeof){case o:case a:u=!0}}if(u)return r(i,t," "===n?" . "+j(t,0):n),1;if(u=0,n=" "===n?" . ":n+" : ",Array.isArray(t))for(var f=0;f<t.length;f++){var c=n+j(s=t[f],f);u+=e(s,c,r,i)}else if(null===t||" object "!=typeof t?c=null:c=" function "==typeof(c=m&&t[m]||t[" @ @ iterator "])?c:null," function "==typeof c)for(t=c.call(t),f=0;!(s=t.next()).done;)u+=e(s=s.value,c=n+j(s,f++),r,i);else if(" object "===s)throw r=" "+t,Error(y(31," [ object Object ] "===r?" object with keys { "+Object.keys(t).join(" , ")+" } ":r," "));return u}(e," ",t,n)}function j(e,t){return" object "==typeof e&&null!==e&&null!=e.key?function(e){var t={" = ":" = 0 "," : ":" = 2 "};return" $ "+(" "+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function B(e,t){e.func.call(e.context,t,e.count++)}function N(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?D(e,r,n,(function(e){return e})):null!=e&&(A(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?" ":(" "+e.key).replace(C," $ & /")+"/ ")+n)),r.push(e))}function D(e,t,n,r,i){var o=" ";null!=n&&(o=(" "+n).replace(C," $ & /")+"/ " ) , I ( e , N , t = R ( t , o , r , i ) ) , O ( t ) } var L = { current : null } ; function z ( ) { var e = L . current ; if ( null === e ) throw Error ( y ( 321 ) ) ; return e } var U = { ReactCurrentDispatcher : L , ReactCurrentBatchConfig : { suspense : null } , ReactCurrentOwner : k , IsSomeRendererActing : { current : ! 1 } , assign : r } ; t . Children = { map : function ( e , t , n ) { if ( null == e ) return e ; var r = [ ] ; return D ( e , r ,
WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
/ * * @ l i c e n s e R e a c t v 1 6 . 1 3 . 1
* react - dom . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2020-06-13 19:24:28 +00:00
* /var r=n(0),i=n(55),o=n(106);function a(e){for(var t="https:/ / reactjs . org / docs / error - decoder . html ? invariant = "+e,n=1;n<arguments.length;n++)t+=" & args [ ] = "+encodeURIComponent(arguments[n]);return" Minified React error # "+e+" ; visit "+t+" for the full message or use the non - minified dev environment for full errors and additional helpful warnings . "}if(!r)throw Error(a(227));function s(e,t,n,r,i,o,a,s,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(n,f)}catch(e){this.onError(e)}}var u=!1,f=null,c=!1,l=null,d={onError:function(e){u=!0,f=e}};function h(e,t,n,r,i,o,a,c,l){u=!1,f=null,s.apply(d,arguments)}var p=null,b=null,m=null;function y(e,t,n){var r=e.type||" unknown - event ";e.currentTarget=m(n),function(e,t,n,r,i,o,s,d,p){if(h.apply(this,arguments),u){if(!u)throw Error(a(198));var b=f;u=!1,f=null,c||(c=!0,l=b)}}(r,t,void 0,e),e.currentTarget=null}var v=null,g={};function w(){if(v)for(var e in g){var t=g[e],n=v.indexOf(e);if(!(-1<n))throw Error(a(96,e));if(!S[n]){if(!t.extractEvents)throw Error(a(97,e));for(var r in S[n]=t,n=t.eventTypes){var i=void 0,o=n[r],s=t,u=r;if(E.hasOwnProperty(u))throw Error(a(99,u));E[u]=o;var f=o.phasedRegistrationNames;if(f){for(i in f)f.hasOwnProperty(i)&&_(f[i],s,u);i=!0}else o.registrationName?(_(o.registrationName,s,u),i=!0):i=!1;if(!i)throw Error(a(98,r,e))}}}}function _(e,t,n){if(k[e])throw Error(a(100,e));k[e]=t,x[e]=t.eventTypes[n].dependencies}var S=[],E={},k={},x={};function M(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!g.hasOwnProperty(t)||g[t]!==r){if(g[t])throw Error(a(102,t));g[t]=r,n=!0}}n&&w()}var T=!(" undefined "==typeof window||void 0===window.document||void 0===window.document.createElement),A=null,C=null,P=null;function R(e){if(e=b(e)){if(" function "!=typeof A)throw Error(a(280));var t=e.stateNode;t&&(t=p(t),A(e.stateNode,e.type,t))}}function O(e){C?P?P.push(e):P=[e]:C=e}function I(){if(C){var e=C,t=P;if(P=C=null,R(e),t)for(e=0;e<t.length;e++)R(t[e])}}function j(e,t){return e(t)}function B(e,t,n,r,i){return e(t,n,r,i)}function N(){}var D=j,L=!1,z=!1;function U(){null===C&&null===P||(N(),I())}function F(e,t,n){if(z)return e(t,n);z=!0;try{return D(e,t,n)}finally{z=!1,U()}}var q=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,H=Object.prototype.hasOwnProperty,W={},K={};function V(e,t,n,r,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var $={};" children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style ".split(" ").forEach((function(e){$[e]=new V(e,0,!1,e,null,!1)})),[[" acceptCharset "," accept - charset "],[" className "," class "],[" htmlFor "," for "],[" httpEquiv "," http - equiv "]].forEach((function(e){var t=e[0];$[t]=new V(t,1,!1,e[1],null,!1)})),[" contentEditable "," draggable "," spellCheck "," value "].forEach((function(e){$[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),[" autoReverse "," externalResourcesRequired "," focusable "," preserveAlpha "].forEach((function(e){$[e]=new V(e,2,!1,e,null,!1)}))," allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope ".split(" ").forEach((function(e){$[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),[" checked "," multiple "," muted "," selected "].forEach((function(e){$[e]=new V(e,3,!0,e,null,!1)})),[" capture "," download "].forEach((function(e){$[e]=new V(e,4,!1,e,null,!1)})),[" cols "," rows "," size "," span "].forEach((function(e){$[e]=new V(e,6,!1,e,null,!1)})),[" rowSpan "," start "].forEach((function(e){$[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var Y=/[\-:]([a-z])/g;function X(e){return e[1].toUpperCase()}" accent -
WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
/ * * @ l i c e n s e R e a c t v 0 . 1 9 . 1
* scheduler . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2020-06-13 19:24:28 +00:00
* /var r,i,o,a,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,f=null,c=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(c,0),e}},l=Date.now();t.unstable_now=function(){return Date.now()-l},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(c,0))},i=function(e,t){f=setTimeout(e,t)},o=function(){clearTimeout(f)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,h=window.Date,p=window.setTimeout,b=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https:/ / fb . me / react - polyfills ")," function "!=typeof m&&console.error(" This browser doesn ' t support cancelAnimationFrame . Make sure that you load a polyfill in older browsers . https : //fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var y=h.now();t.unstable_now=function(){return h.now()-y}}var v=!1,g=null,w=-1,_=5,S=0;a=function(){return t.unstable_now()>=S},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):_=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,k=E.port2;E.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();S=e+_;try{g(!0,e)?k.postMessage(null):(v=!1,g=null)}catch(e){throw k.postMessage(null),e}}else v=!1},r=function(e){g=e,v||(v=!0,k.postMessage(null))},i=function(e,n){w=p((function(){e(t.unstable_now())}),n)},o=function(){b(w),w=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<A(i,t)))break e;e[r]=t,e[n]=i,n=r}}function M(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var o=2*(r+1)-1,a=e[o],s=o+1,u=e[s];if(void 0!==a&&0>A(a,n))void 0!==u&&0>A(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>A(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function A(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],P=[],R=1,O=null,I=3,j=!1,B=!1,N=!1;function D(e){for(var t=M(P);null!==t;){if(null===t.callback)T(P);else{if(!(t.startTime<=e))break;T(P),t.sortIndex=t.expirationTime,x(C,t)}t=M(P)}}function L(e){if(N=!1,D(e),!B)if(null!==M(C))B=!0,r(z);else{var t=M(P);null!==t&&i(L,t.startTime-e)}}function z(e,n){B=!1,N&&(N=!1,o()),j=!0;var r=I;try{for(D(n),O=M(C);null!==O&&(!(O.expirationTime>n)||e&&!a());){var s=O.callback;if(null!==s){O.callback=null,I=O.priorityLevel;var u=s(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?O.callback=u:O===M(C)&&T(C),D(n)}else T(C);O=M(C)}if(null!==O)var f=!0;else{var c=M(P);null!==c&&i(L,c.startTime-n),f=!1}return f}finally{O=null,I=r,j=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){B||j||(B=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return M(C)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0<u?s+u:s,a="number"==typeof a.timeout?a.timeout:U(e)}else a=U(e),u=s;return e={id:R++,callback:n,
WebUI (#100)
* Object-Oriented base changes for web-ui prep
* remove debug raise
* optimize broadcast to serialize once
* Implement WebUI socket, static assets, and classes
- Still need to wrap logging functions and send output to UI
- UI commands are successfully being sent to the server
* GUI operational. Wrap logging functions, implement server address selection on GUI, automatically launch web browser when client websocket is served
* Update MultiServer status when a user disconnects / reconnects
* Implement colored item and hint checks, improve GUI readability
* Fix improper formatting on received items
* Update SNES connection status on disconnect / reconnect. Implement itemFound, prevent accidentally printing JS objects
* Minor text change for itemFound
* Fixed a very wrong comment
* Fixed client commands not working, fixed un-helpful error messages appearing in GUI
* Fix a bug causing a failure to connect to a multiworld server if a previously existing cached address was present and the client was loaded without an address passed in
* Convert WebUI to React /w Redux. WebSocket communications not yet operational.
* WebUI fully converted to React / Redux.
- Websocket communication operational
- Added a button to connect to the multiserver which appears only when a SNES is connected and a server connection is not active
* Restore some features lost in WebUI
- Restore (found) notification on hints if the item has already been obtained
- Restore (x/y) indicator on received items, which indicates the number of items the client is waiting to receive from the client in a queue
* Fix a grammatical UI big causing player names to show only an apostrophe when possessive
* Add support for multiple SNES Devices, and switching between them
* freeze support for client
* make sure flask works when frozen
* UI Improvements
- Hint messages now actually show a found status via ✔ and ❌ emoji
- Active player name is always a different color than other players (orange for now)
- Add a toggle to show only entries relevant to the active player
- Added a WidgetArea
- Added a notes widget
* Received items now marked as relevant
* Include production build for deployment
* Notes now survive a browser close. Minimum width applied to monitor to prevent CSS issues.
* include webUi folder in setup.py
* Bugfixes for Monitor
- Fix a bug causing the monitor window to grow beyond it's intended content limit
- Reduced monitor content limit to 200 items
- Ensured each monitor entry has a unique key
* Prevent eslint from yelling at me about stupid things
* Add button to collapse sidebar, press enter on empty server input to disconnect on purpose
* WebUI is now aware of client disconnect, message log limit increased to 350, fix !missing output
* Update WebUI to v2.2.1
- Added color to WebUI for entrance-span
- Make !missing show total count at bottom of list to match /missing behavior
* Fix a bug causing clients version <= 2.2.0 to crash when anyone asks for a hint
- Also fix a bug in the WebUI causing the entrance location to always show as "somewhere"
* Update WebUI color palette (this cost me $50)
* allow text console input alongside web-ui
* remove Flask
a bit overkill for what we're doing
* remove jinja2
* Update WebUI to work with new hosting mechanism
* with flask gone, we no longer need subprocess shenanigans
* If multiple web ui clients try to run, at least present a working console
* Update MultiClient and WebUI to handle multiple clients simultaneously.
- The port on which the websocket for the WebUI is hosted is not chosen randomly from 5000 - 5999. This port is passed to the browser so it knows which MultiClient to connect to
- Removed failure condition if a web server is already running, as there is no need to run more than one web server on a single system. If an exception is thrown while attempting to launch a web server, a check is made for the port being unavailable. If the port is unavailable, it probably means the user is launching a second MultiClient. A web browser is then opened with a connection to the correct webui_socket_port.
- Add a /web command to the MultiClient to repoen the appropriate browser window and get params in case a user accidentally closes the tab
* Use proper name for WebUI
* move webui into /data with other data files
* make web ui optional
This is mostly for laptop users wanting to preserve some battery, should not be needed outside of that.
* fix direct server start
* re-add connection timer
* fix indentation
Co-authored-by: Chris <chris@legendserver.info>
2020-06-03 19:29:43 +00:00
/ * * @ l i c e n s e R e a c t v 1 6 . 1 3 . 1
* react - is . production . min . js
*
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
2020-06-13 19:24:28 +00:00
* / v a r r = " f u n c t i o n " = = t y p e o f S y m b o l & & S y m b o l . f o r , i = r ? S y m b o l . f o r ( " r e a c t . e l e m e n t " ) : 6 0 1 0 3 , o = r ? S y m b o l . f o r ( " r e a c t . p o r t a l " ) : 6 0 1 0 6 , a = r ? S y m b o l . f o r ( " r e a c t . f r a g m e n t " ) : 6 0 1 0 7 , s = r ? S y m b o l . f o r ( " r e a c t . s t r i c t _ m o d e " ) : 6 0 1 0 8 , u = r ? S y m b o l . f o r ( " r e a c t . p r o f i l e r " ) : 6 0 1 1 4 , f = r ? S y m b o l . f o r ( " r e a c t . p r o v i d e r " ) : 6 0 1 0 9 , c = r ? S y m b o l . f o r ( " r e a c t . c o n t e x t " ) : 6 0 1 1 0 , l = r ? S y m b o l . f o r ( " r e a c t . a s y n c _ m o d e " ) : 6 0 1 1 1 , d = r ? S y m b o l . f o r ( " r e a c t . c o n c u r r e n t _ m o d e " ) : 6 0 1 1 1 , h = r ? S y m b o l . f o r ( " r e a c t . f o r w a r d _ r e f " ) : 6 0 1 1 2 , p = r ? S y m b o l . f o r ( " r e a c t . s u s p e n s e " ) : 6 0 1 1 3 , b = r ? S y m b o l . f o r ( " r e a c t . s u s p e n s e _ l i s t " ) : 6 0 1 2 0 , m = r ? S y m b o l . f o r ( " r e a c t . m e m o " ) : 6 0 1 1 5 , y = r ? S y m b o l . f o r ( " r e a c t . l a z y " ) : 6 0 1 1 6 , v = r ? S y m b o l . f o r ( " r e a c t . b l o c k " ) : 6 0 1 2 1 , g = r ? S y m b o l . f o r ( " r e a c t . f u n d a m e n t a l " ) : 6 0 1 1 7 , w = r ? S y m b o l . f o r ( " r e a c t . r e s p o n d e r " ) : 6 0 1 1 8 , _ = r ? S y m b o l . f o r ( " r e a c t . s c o p e " ) : 6 0 1 1 9 ; f u n c t i o n S ( e ) { i f ( " o b j e c t " = = t y p e o f e & & n u l l ! = = e ) { v a r t = e . $ $ t y p e o f ; s w i t c h ( t ) { c a s e i : s w i t c h ( e = e . t y p e ) { c a s e l : c a s e d : c a s e a : c a s e u : c a s e s : c a s e p : r e t u r n e ; d e f a u l t : s w i t c h ( e = e & & e . $ $ t y p e o f ) { c a s e c : c a s e h : c a s e y : c a s e m : c a s e f : r e t u r n e ; d e f a u l t : r e t u r n t } } c a s e o : r e t u r n t } } } f u n c t i o n E ( e ) { r e t u r n S ( e ) = = = d } t . A s y n c M o d e = l , t . C o n c u r r e n t M o d e = d , t . C o n t e x t C o n s u m e r = c , t . C o n t e x t P r o v i d e r = f , t . E l e m e n t = i , t . F o r w a r d R e f = h , t . F r a g m e n t = a , t . L a z y = y , t . M e m o = m , t . P o r t a l = o , t . P r o f i l e r = u , t . S t r i c t M o d e = s , t . S u s p e n s e = p , t . i s A s y n c M o d e = f u n c t i o n ( e ) { r e t u r n E ( e ) | | S ( e ) = = = l } , t . i s C o n c u r r e n t M o d e = E , t . i s C o n t e x t C o n s u m e r = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = c } , t . i s C o n t e x t P r o v i d e r = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = f } , t . i s E l e m e n t = f u n c t i o n ( e ) { r e t u r n " o b j e c t " = = t y p e o f e & & n u l l ! = = e & & e . $ $ t y p e o f = = = i } , t . i s F o r w a r d R e f = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = h } , t . i s F r a g m e n t = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = a } , t . i s L a z y = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = y } , t . i s M e m o = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = m } , t . i s P o r t a l = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = o } , t . i s P r o f i l e r = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = u } , t . i s S t r i c t M o d e = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = s } , t . i s S u s p e n s e = f u n c t i o n ( e ) { r e t u r n S ( e ) = = = p } , t . i s V a l i d E l e m e n t T y p e = f u n c t i o n ( e ) { r e t u r n " s t r i n g " = = t y p e o f e | | " f u n c t i o n " = = t y p e o f e | | e = = = a | | e = = = d | | e = = = u | | e = = = s | | e = = = p | | e = = = b | | " o b j e c t " = = t y p e o f e & & n u l l ! = = e & & ( e . $ $ t y p e o f = = = y | | e . $ $ t y p e o f = = = m | | e . $ $ t y p e o f = = = f | | e . $ $ t y p e o f = = = c | | e . $ $ t y p e o f = = = h | | e . $ $ t y p e o f = = = g | | e . $ $ t y p e o f = = = w | | e . $ $ t y p e o f = = = _ | | e . $ $ t y p e o f = = = v ) } , t . t y p e O f = S } , f u n c t i o n ( e , t , n ) { v a r r = n ( 1 2 ) , i = n ( 1 1 3 ) ; " s t r i n g " = = t y p e o f ( i = i . _ _ e s M o d u l e ? i . d e f a u l t : i ) & & ( i = [ [ e . i , i , " " ] ] ) ; v a r o = { i n s e r t : " h e a d " , s i n g l e t o n : ! 1 } ; r ( i , o ) ; e . e x p o r t s = i . l o c a l s | | { } } , f u n c t i o n ( e , t , n ) { ( t = n ( 1 3 ) ( ! 1 ) ) . p u s h ( [ e . i , " # h e a d e r - b a r { f o n t - s i z e : 3 . 4 e m ; m i n - w i d t h : 1 0 3 6 p x } \ n " , " " ] ) , e . e x p o r t s = t } , f u n c t i o n ( e , t , n ) { v a r r = n ( 1 2 ) , i = n ( 1 1 5 ) ; " s t r i n g " = = t y p e o f ( i = i . _ _ e s M o d u l e ? i . d e f a u l t : i ) & & ( i = [ [ e . i , i , " " ] ] ) ; v a r o = { i n s e r t : " h e a d " , s i n g l e t o n : ! 1 } ; r ( i , o ) ; e . e x p o r t s = i . l o c a l s | | { } } , f u n c t i o n ( e , t , n ) { ( t = n ( 1 3 ) ( ! 1 ) ) . p u s h ( [ e . i , " # m o n i t o r { f l e x - g r o w : 1 ; m i n - w i d t h : 8 0 0 p x } \ n " , " " ] ) , e . e x p o r t s = t } , f u n c t i o n ( e , t , n ) { ( f u n c t i o n ( t ) { v a r r ; e . e x p o r t s = ( r = r | | f u n c t i o n ( e , r ) { v a r i ; i f ( " u n d e f i n e d " ! = t y p e o f w i n d o w & & w i n d o w . c r y p t o & & ( i = w i n d o w . c r y p t o ) , ! i & & " u n d e f i n e d " ! = t y p e o f w i n d o w & & w i n d o w . m s C r y p t o & & ( i = w i n d o w . m s C r y p t o ) , ! i & & v o i d 0 ! = = t & & t . c r y p t o & & ( i = t . c r y p t o ) , ! i ) t r y { i = n ( 1 1 7 ) } c a t c h ( e ) { } v a r o = f u n c t i o n ( ) { i f ( i ) { i f ( " f u n c t i o n " = = t y p e o f i . g e t R a n d o m V a l u e s ) t r y { r e t u r n i . g e t R a n d o m V a l u e s ( n e w U i n t 3 2 A r r a y ( 1 ) ) [ 0 ] } c a t c h ( e ) { } i f ( " f u n c t i o n " = = t y p e o f i . r a n d o m B y t e s ) t r y { r e t u r n i . r a n d o m B y t e s ( 4 ) . r e a d I n t 3 2 L E ( ) } c a t c h ( e ) { } } t h r o w n e w E r r o r ( " N a t i v e c r y p t o m o d u l e c o u l d n o t b e u s e d t o g e t s e c u r e r a n d o m n u m b e r . " ) } , a = O b j e c t . c r e a t e | | f u n c t i o n ( ) { f u n c t i o n e ( ) { } r e t u r n f u n c t i o n ( t ) { v a r n ; r e t u r n e . p r o t o t y p e = t , n = n e w e , e . p r o t o t y p e = n u l l , n } } ( ) , s = { } , u = s . l i b = { } , f = u . B a s e = { e x t e n d : f u n c t i o n ( e ) { v a r t = a ( t h i s ) ; r e t u r n e & & t . m i x I n ( e ) , t . h a s O w n P r o p e r t y ( " i n i t " ) & & t h i s . i n i t ! = = t . i n i t | | ( t . i n i t = f u n c t i o n ( ) { t . $ s u p e r . i n i t . a p p l y ( t h i s , a r g u m e n t s ) } ) , t . i n i t . p r o t o t y p e = t , t . $ s u p e r = t h i s , t } , c r e a t e : f u n c t i o n ( ) { v a r e = t h i s . e x t e n d ( ) ; r e t u r n e . i n i t . a p p l y ( e , a r g u m e n t s ) , e } , i n i t : f u n c t i o n ( ) { } , m i x I n : f u n c t i o n ( e ) { f o r ( v a r t i n e ) e . h a s O w n P r o p e r t y ( t ) & & ( t h i s [ t ] = e [ t ] ) ; e . h a s O w n P r o p e r t y ( " t o S t r i n g " ) & & ( t h i s . t o S t r i n g = e . t o S t r i n g ) } , c l o n e : f u n c t i o n ( ) { r e t u r n t h i s . i n i t . p r o t o t y p e . e x t e n d ( t h i s ) } } , c = u . W o r d A r r a y = f . e x t e n d ( { i n i t : f u n c t i o n ( e , t ) { e = t h i s . w o r d s = e | | [ ] , t h i s . s i g B y t e s = n u l l ! = t ? t : 4 * e . l e n g t h } , t o S t r i n g : f u n c t i o n ( e ) { r e t u r n ( e | | d ) . s t r i n g i f y ( t h i s ) } , c o n c a t : f u n c t i o n ( e ) { v a r t = t h i s . w o r d s , n = e . w o r d s , r = t h i s . s i g B y t e s , i = e . s i g B y t e s ; i f ( t h i s . c l a m p ( ) , r % 4 ) f o r ( v a r o =