1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{_ as t,b as n,f as r,g as i,u as a}from"./vendor-react-Ccu8BlQU.js";import{n as o}from"./bridge-Cq_Szqk4.js";import{n as s,r as c,t as l}from"./useHideNativeBottomTabs-C_i-vpDp.js";async function u(e,t){if(typeof window>`u`||!o())return!1;let n=window.wixMobileNativeBridge?.base44?.actions;if(!n?.onItemClicked)return!1;try{return await n.onItemClicked({id:e,data:t}),!0}catch{return!1}}function d(e){if(e.startsWith(`http://`)||e.startsWith(`https://`))return e;let t=window.location.origin;return e.startsWith(`/`)?`${t}${e}`:`${t}/${e}`}function f(){return o()?window.wixMobileNativeBridge?.base44.linking.openUrl:void 0}function p(e,t=`_blank`,n){let r=typeof e==`string`?e:e.url,i=typeof e==`string`?t:e.target??`_blank`,a=typeof e==`string`?n:e.features,o=f();o?o({url:d(r)}):window.open(r,i,a)}async function m(e){if(f()){p(await e);return}let t=window.open(``,`_blank`);try{let n=await e;t?t.location.replace(n):p(n)}catch(e){throw t?.close(),e}}var h=e(n());function g(){let e=r(),t=c();return(0,h.useCallback)(async(n,r)=>{if(!t.isNativeMobile){e(n,r);return}if(typeof n==`number`){e(n);return}if(t.navigation.requestWebViewNavigation)try{let e=n.startsWith(`http`)?n:`${window.location.origin}${n.startsWith(`/`)?``:`/`}${n}`;
1if(await Promise.race([t.navigation.requestWebViewNavigation({url:e}),new Promise(e=>setTimeout(()=>e(void 0),5e3))])===!1)return}catch{}e(n,r)},[e,t])}function _({skip:e=!1}={}){let{platform:t}=c(),n=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(e||n.current)return;let r=requestAnimationFrame(()=>{n.current=!0,t.updateContentHeight({height:document.body.scrollHeight})});return()=>cancelAnimationFrame(r)},[e,t])}function v(e){let{pathname:t}=a();return i(e,t)?.some(e=>e.route.hidesFloatingTabs)??!1}function y(e,t){let n=e=>e.trim().split(`.`).map(Number),r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??0,n=i[e]??0;if(!Number.isFinite(t)||!Number.isFinite(n))return!1;if(t!==n)return t>n}return!0}var b=`native-floating-tabs`,x=`native-drawer-shell`,S=null;function C(){let{isNativeMobile:e,platform:t}=c(),[n,r]=(0,h.useState)(null);return(0,h.useEffect)(()=>{if(!e)return;let n=window.wixMobileNativeBridge;S?.bridge!==n&&(S={bridge:n,promise:t.appVersion().then(e=>e??null,()=>null)});let i=!1;return S.promise.then(e=>{!i&&e&&r(e)}),()=>{i=!0}},[e,t]),n}function w(){let e=C();return!!e&&y(e,`2.130000.0`)&&!y(e,`3.0.0`)}function T(){let e=C();return!!e&&y(e,`3.0.0`)}function E(e=!0){let{isNativeMobile:t,actions:n}=c();(0,h.useEffect)(()=>{!e||!t||l()||n?.setBottomTabsVisible?.({visible:!0})},[e,t,n])}function D({routes:e}){let t=w(),n=T(),r=v(e),i=t&&!r;return(0,h.useEffect)(()=>{document.documentElement.classList.toggle(b,i)},[i]),(0,h.useEffect)(()=>{document.documentElement.classList.toggle(x,n)},[n]),s(t&&!i),E(i),null}var O=t(),k=(0,h.createContext)(null);function A({children:e}){let{platform:t,isNativeMobile:n}=c(),[r,i]=(0,h.useState)(void 0);(0,h.useEffect)(()=>{n&&t.os().then(i)},[t,n]);let a=(0,h.useMemo)(()=>({platformOS:r,isIOS:r===`ios`,isAndroid:r===`android`,shouldHidePlanAndBilling:!1}),[r]);return(0,O.jsx)(k.Provider,{value:a,children:e})}function j(){return(0,h.useContext)(k)||{platformOS:void 0,isIOS:!1,isAndroid:!1,shouldHidePlanAndBilling:!1}}export{T as a,g as c,m as d,u as f,E as i,f as l,j as n,y as o,D as r,_ as s,A as t,p as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.