1import{ht as e,n as t}from"./dist-CMd3SAB-.js";import"./open-in-app-CqgwJ9gX.js";t();var n={minimumSupportedVersion:`0.0.0`,latestVersion:`0.0.0`,critical:!1,maintenanceMode:!1};function r(e,t,n){if(e===`info`)return;let r=n===void 0?t:`${t} ${i(n)}`;try{e===`error`?console.error(`[ota]`,r):e===`warn`?console.warn(`[ota]`,r):console.log(`[ota]`,r)}catch{}}function i(e){try{return JSON.stringify(e)}catch{return String(e)}}function a(e){let t=typeof e==`string`?e.trim():``;return t.length>0?t:null}function o(){return a({}.EXPO_PUBLIC_UPDATE_CONFIG_URL)??`https://www.sheconomy.in/update-config.json`}function s(){return a({}.EXPO_PUBLIC_APP_ENV)??a(`production`)??`development`}function c(){return a({}.EXPO_PUBLIC_IOS_APP_STORE_URL)??`https://apps.apple.com/app/id6499198194`}function l(){return a({}.EXPO_PUBLIC_ANDROID_PLAY_STORE_URL)??`https://play.google.com/store/apps/details?id=com.sheconomy.ecommerce`}function u(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.minimumSupportedVersion==`string`&&typeof t.latestVersion==`string`&&typeof t.critical==`boolean`&&typeof t.maintenanceMode==`boolean`}function d(e,t){if(t!==`android`&&t!==`ios`)return{};let n=e.platforms;if(!n||typeof n!=`object`)return{};let r=n[t];if(!r||typeof r!=`object`)return{};let i=r,a={};return typeof i.minimumSupportedVersion==`string`&&(a.minimumSupportedVersion=i.minimumSupportedVersion),typeof i.latestVersion==`string`&&(a.latestVersion=i.latestVersion),typeof i.critical==`boolean`&&(a.critical=i.critical),typeof i.maintenanceMode==`boolean`&&(a.maintenanceMode=i.maintenanceMode),typeof i.maintenanceMessage==`string`&&(a.maintenanceMessage=i.maintenanceMessage),a}async function f(t,i=e.OS){let a=o();if(!a)return null;try{let e=await fetch(a,{method:`GET`,headers:{Accept:`application/json`},signal:t});if(!e.ok)return r(`warn`,`Remote update config HTTP ${e.status}`),null;let o=await e.json();if(!u(o))return r(`warn`,`Remote update config shape invalid`),null;let s=d(o,i);return{...n,minimumSupportedVersion:s.minimumSupportedVersion??o.minimumSupportedVersion,latestVersion:s.latestVersion??o.latestVersion,critical:s.critical??o.critical,maintenanceMode:s.maintenanceMode??o.maintenanceMode,maintenanceMessage:s.maintenanceMessage??(typeof o.maintenanceMessage==`string`?o.maintenanceMessage:void 0)}}catch(e){return r(`warn`,`Remote update config fetch failed`,e),null}}export{o as a,c as i,l as n,r as o,s as r,f as t};
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.