"use strict";var e=require("react/jsx-runtime"),n=require("react"),t=require("./context-rs-ygOK2.js"),a=require("./internal-context-CdsQ3LEl.js");function r({src:n,...t}){/*#__PURE__*/return e.jsx("img",{src:n,...t,style:{display:"none"}})}const i=/*#__PURE__*/n.createContext({currentScreen:null,lastScreen:null,navigate:a.notImplemented,navigateBack:a.notImplemented,resetNavigation:a.notImplemented,setModalData:a.notImplemented,onUserCloseViaDialogOrKeybindRef:void 0});exports.ModalProvider=a=>{let l=t.useAppConfig(),[o,s]=n.useState(a.initialScreen),c=n.useRef(null);n.useEffect((()=>{a.open||(c.current=null)}),[a.open]),n.useEffect((()=>{c.current=null}),[a.initialScreen]);let u={data:a.data,setModalData:a.setModalData,currentScreen:a.initialScreen,lastScreen:o,navigate:(e,n=!0)=>{a.setInitialScreen(e),n&&s(a.initialScreen)},navigateBack:()=>{a.setInitialScreen(o)},resetNavigation:()=>{a.setInitialScreen(null),s(null)},onUserCloseViaDialogOrKeybindRef:c};/*#__PURE__*/return e.jsxs(i.Provider,{value:u,children:[("string"==typeof l.appearance.logo||"img"===l.appearance.logo?.type)&&/*#__PURE__*/e.jsx(r,{src:"string"==typeof l.appearance.logo?l.appearance.logo:l.appearance.logo.props.src}),a.children]})},exports.usePrivyModal=()=>n.useContext(i);
//# sourceMappingURL=modal-context-BgeioxwT.js.map
