L iddlmZddlmZddlmZddlmZ ddZ ddZ GddZ Gd d e Z Gd d e Z y )) annotations)Any)util)get_script_run_ctxcP|g}|j||j||SN)extendappend)root_container parent_pathindex delta_paths V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/cursor.pymake_delta_pathrs.!!Jk"e c|yt}|y||jvr|j|St|}||j|<|S)zReturn the top-level RunningCursor for the given container. This is the cursor that is used when user code calls something like `st.foo` (which uses the main container) or `st.sidebar.foo` (which uses the sidebar container). N)r )rcursors RunningCursor)r ctxcursors rget_container_cursorr sU  C {${{>** . 9F"(CKK MrceZdZdZd dZed dZed dZed dZeddZ eddZ ddZ edd Z y )CursorzA pointer to a delta location in the app. When adding an element to the app, you should always call get_locked_cursor() on that element's respective Cursor. c,tj|Sr)rrepr_selfs r__repr__zCursor.__repr__?szz$rct)zwThe top-level container this cursor lives within - either RootContainer.MAIN or RootContainer.SIDEBAR. NotImplementedErrorrs rr zCursor.root_containerBs "##rct)z0The cursor's parent's path within its container.r rs rr zCursor.parent_pathI "##rct)z/The index of the Delta within its parent block.r rs rr z Cursor.indexNr#rcXt|j|j|jS)zrThe complete path of the delta pointed to by this cursor - its container, parent path, and index. )rr r r rs rrzCursor.delta_pathSs# t22D4D4DdjjQQrctrr rs r is_lockedzCursor.is_lockedZs !##rc trr rpropss rget_locked_cursorzCursor.get_locked_cursor^s !##rct)zOther data in this cursor. This is a temporary measure that will go away when we implement improved return values for elements. This is only implemented in LockedCursor. r rs rr*z Cursor.propsas "##rN)returnstrr-intr-tuple[int, ...])r- list[int]r-boolr*rr- LockedCursorr-r) __name__ __module__ __qualname____doc__rpropertyr r r rr'r+r*rrrr8s  $$ $$$$RR $$$$$rrcfeZdZdd dZed dZed dZed dZed dZd dZ y)rc.||_||_d|_y)aA moving pointer to a delta location in the app. RunningCursors auto-increment to the next available location when you call get_locked_cursor() on them. Parameters ---------- root_container: int The root container this cursor lives in. parent_path: tuple of ints The full path of this cursor, consisting of the IDs of all ancestors. The 0th item is the topmost ancestor. rN)_root_container _parent_path_index)rr r s r__init__zRunningCursor.__init__ls .' rc|jSrrArs rr zRunningCursor.root_container###rc|jSrrBrs rr zRunningCursor.parent_path   rc|jSrrCrs rr zRunningCursor.index {{rcy)NFr>rs rr'zRunningCursor.is_lockedsrc td|j|j|jd|}|xjdz c_|S)N)r r r r>)r7rArBrC)rr* locked_cursors rr+zRunningCursor.get_locked_cursorsJ$ //))++    q rN)r>)r r0r r2r-Noner/r1r4r6) r9r:r;rDr=r r r r'r+r>rrrrks\&$$!! rrceZdZ d d dZed dZed dZed dZed dZddZ eddZ y)r7c <||_||_||_||_y)aA locked pointer to a location in the app. LockedCursors always point to the same location, even when you call get_locked_cursor() on them. Parameters ---------- root_container: int The root container this cursor lives in. parent_path: tuple of ints The full path of this cursor, consisting of the IDs of all ancestors. The 0th item is the topmost ancestor. index: int **props: any Anything else you want to store in this cursor. This is a temporary measure that will go away when we implement improved return values for elements. N)rArCrB_props)rr r r r*s rrDzLockedCursor.__init__s"4 . ' rc|jSrrFrs rr zLockedCursor.root_containerrGrc|jSrrIrs rr zLockedCursor.parent_pathrJrc|jSrrLrs rr zLockedCursor.indexrMrcy)NTr>rs rr'zLockedCursor.is_lockedsrc ||_|SrrUr)s rr+zLockedCursor.get_locked_cursors  rc|jSrr[rs rr*zLockedCursor.propsrMrN)r>r) r r0r r2r r0r*rr-rRr/r1r4r6r8) r9r:r;rDr=r r r r'r+r*r>rrr7r7s(* %     >$$!!rr7N)r r0r r2r r0r-r3)r z int | Noner-zRunningCursor | None) __future__rtypingr streamlitr7streamlit.runtime.scriptrunner_utils.script_run_contextrrrrrr7r>rrrasq#V&5>A00$0$f.F.b666r