
    <i                         d dl mZ daed             Zd Zd Zd dlZej        dk     r; e              e	            
                    d t          j        D                        [	 d dlmZ dS # e$ r Y dS w xY w)	    )contextmanagerNc               #   "  K   	 ddl m} m} n0# t          $ r# 	 ddlm} m} n# t          $ r	 dV  Y Y dS w xY wY nw xY w| |z  }ddl} |j                    }	  |j        |           dV   |j        |           dS #  |j        |           w xY w)at  
    A context manager for enabling binary Lua module loading when importing Lua.

    This can only be used once within a Python runtime and must wrap the import of the
    ``lupa.*`` Lua module, e.g.::

        import lupa
        with lupa.allow_lua_module_loading()
            from lupa import lua54

        lua = lua54.LuaRuntime()
        lua.require('cjson')
    r   )RTLD_NOWRTLD_GLOBALN)osr   r   ImportErrorDLFCNsysgetdlopenflagssetdlopenflags)r   r   dlopen_flagsr
   	old_flagss        /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/lupa/__init__.pyallow_lua_module_loadingr      s     ,,,,,,,,,   	333333333 	 	 	EEEFFF	 43 k)LJJJ""$$I&<(((9%%%%%9%%%%s0    
:!:4:4::A< <Bc                  b   t           t           S dd l} dd l| j                            t
                    }d fd|                     |          D             D             }|st          d          t          |d           }t          |d         ddt                      	          a t           S )
Nr   c                 :    g | ]}||                                 S  )groups).0matchs     r   
<listcomp>z&_import_newest_lib.<locals>.<listcomp>5   s8               c              3   D   K   | ]}                     d |          V  dS )z((lua[a-z]*)([0-9]*))\..*N)r   )r   filenameres     r   	<genexpr>z%_import_newest_lib.<locals>.<genexpr>6   sF       %
 %
 HH18<<%
 %
 %
 %
 %
 %
r   z$Failed to import Lupa binary module.c                 n    | d         dk    t          t          t          | d         pd                    fS )N   lua   0)tuplemapint)ms    r   <lambda>z$_import_newest_lib.<locals>.<lambda>?   s.    ademU3sAaDKTWCXCX=Y=Y-Z r   )keyr   *)levelfromlistglobals)_newest_libos.pathr   pathdirname__file__listdirRuntimeErrormax
__import__r+   )r   package_dirmodulesmodule_namer   s       @r   _import_newest_libr8   ,   s    NNNIII'//(++K %
 %
 %
 %
JJ{33%
 %
 %
  G  CABBBg#Z#Z[[[K[^1sGIIVVVKr   c                    |                      d          rddl}|                    d|           ro| t                      vsJ 	 t	          | t                      t                      d          }| t                      v sJ |S # t          $ r t          |           w xY wt          t          nt                      }t          ||           xt                      | <   }|S )zh
    Get a name from the latest available Lua (or LuaJIT) module.
    Imports the module as needed.
    r   r   Nz((lua[a-z]*)([0-9]*))$r   )r+   localsr)   )
startswithr   r   r+   r4   r:   r   AttributeErrorr,   r8   getattr)namer   moduler   attrs        r   __getattr__rA   E   s    
 u 			88-t44 		wyy((((#D'))FHHTUVVV wyy((((	  + + +$T***+ %0++6H6J6JC$S$///GIIdOdKs   +B B)      c              #   D   K   | ]}|t          t          |          fV  d S )N)r=   r,   )r   r>   s     r   r   r   a   sE         
w{D))*     r   )__version__)
contextlibr   _contextmanagerr,   r   r8   rA   r
   version_infor+   update__all__lupa.versionrE   r   r   r   r   <module>rL      s   8 8 8 8 8 8  !& !& !&H  2  0 


fGII  '      	(((((((( 	 	 	DD	s   &A. .A76A7