@hot-updater/console 1.2.0-rc.25 → 1.2.0-rc.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{index-DVMlgaFl.js → index-CJclLsbG.js} +2 -2
- package/.output/public/assets/native-builds_._buildId-BnP31v32.js +1 -0
- package/.output/public/assets/{native-builds_._buildId-BP2XhCKZ.js → native-builds_._buildId-Cp9LJiMP.js} +2 -2
- package/.output/server/{__23tanstack-start-server-fn-resolver--r_G_ZaG.mjs → __23tanstack-start-server-fn-resolver-z8rr63xV.mjs} +49 -49
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_ssr/{BundleIdDisplay-DDern9jB.mjs → BundleIdDisplay-DRnAzJse.mjs} +2 -2
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-CTd0m8zX.mjs → ConsoleFeatureUnavailable-BEU7r4aH.mjs} +5 -5
- package/.output/server/_ssr/{EventDetails-DJZCF4Fl.mjs → EventDetails-CjT6o2sJ.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-Dw-yJQu2.mjs → HashValueDisplay-Bkim8r3-.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-CatxvfYS.mjs → InsightsPageHeader-Ctw4N3SZ.mjs} +5 -5
- package/.output/server/_ssr/{NotFoundPage-fsuVz18J.mjs → NotFoundPage-Bh3gFsR6.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-By1Mznk1.mjs → RelativeTime-DjdCU0J7.mjs} +3 -3
- package/.output/server/_ssr/{RolloutPercentageBadge-QSNweSPV.mjs → RolloutPercentageBadge-BiIHw-V2.mjs} +3 -3
- package/.output/server/_ssr/{StoreSubmission-90V_EvES.mjs → StoreSubmission-Cv59joPo.mjs} +2 -2
- package/.output/server/_ssr/{TargetDisplay-PBnFQ4IN.mjs → TargetDisplay-D1PKOupt.mjs} +4 -4
- package/.output/server/_ssr/{alert-dialog-DsIP3d47.mjs → alert-dialog-BOKQTpmP.mjs} +1 -1
- package/.output/server/_ssr/{api-DWecT-0h.mjs → api-CDvGGB1B.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-DBc1hDoJ.mjs → api-keys-DvbSgd9L.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-_XdWGw9v.mjs → api-keys-NYJ0VaDB.mjs} +9 -9
- package/.output/server/_ssr/{api-keys-rpc-BvSB1wmm.mjs → api-keys-rpc-B0MrcD15.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-BxbhpCA7.mjs → api-rpc-CIB9gcI7.mjs} +5 -5
- package/.output/server/_ssr/{auth-rpc-DTW5PCh3.mjs → auth-rpc-DsIffEXe.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-BeLpUdro.mjs → auth.server-Dt9XHLs_.mjs} +2 -2
- package/.output/server/_ssr/{badge-BkveKUGG.mjs → badge-KS3YftV5.mjs} +1 -1
- package/.output/server/_ssr/{card-Ba4yg8jK.mjs → card-CG5GqIoA.mjs} +1 -1
- package/.output/server/_ssr/{config.server-CkSQxsyv.mjs → config.server-CJs-9Zd_.mjs} +3 -3
- package/.output/server/_ssr/{console-access-DrutHTly.mjs → console-access-ClmTMpo_.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-D9nA0DCT.mjs → console-features-api-CpMYF0Pb.mjs} +3 -3
- package/.output/server/_ssr/{console-features-rpc-BVfXaSKp.mjs → console-features-rpc-D-dr-WF8.mjs} +3 -3
- package/.output/server/_ssr/{dialog-Bq8jjax8.mjs → dialog-DvHMJkq7.mjs} +1 -1
- package/.output/server/_ssr/{empty-BcDUTOx4.mjs → empty-Bx8DnyWN.mjs} +2 -2
- package/.output/server/_ssr/{field-C4nwuzxx.mjs → field-BVI4lxoz.mjs} +2 -2
- package/.output/server/_ssr/{input-group-Bc0aaP2W.mjs → input-group-CpJwooTk.mjs} +1 -1
- package/.output/server/_ssr/{insights-DqzmbdzT.mjs → insights-B-VtObqr.mjs} +5 -5
- package/.output/server/_ssr/{insights-BkDLlsSG.mjs → insights-DxlHHXPK.mjs} +19 -19
- package/.output/server/_ssr/{insights-api-emewkmpE.mjs → insights-api-8PWQ7PiR.mjs} +3 -3
- package/.output/server/_ssr/{insights-DXW-isCU.mjs → insights-b1hq1O0p.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-rpc-DowZCjy6.mjs → insights-failures-rpc-pY2KV9HI.mjs} +4 -4
- package/.output/server/_ssr/{insights-recovery-rpc-CuRKjiFD.mjs → insights-recovery-rpc-CejmWL_y.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-j8XsNQqk.mjs → insights-rpc-D_7d_AAJ.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-Dp55WtwA.mjs → insights-search-CoMkZvRt.mjs} +2 -2
- package/.output/server/_ssr/{insights-usage-rpc-zIgn2C1O.mjs → insights-usage-rpc-B1XSuara.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-CRT9G-UN.mjs → insights-usage-rpc-CrGZDHzO.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-Be6QuYi-.mjs → insights_.distribution-B9sPDvG4.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-BSXQCN6X.mjs → insights_.distribution-CpqnDZNG.mjs} +13 -13
- package/.output/server/_ssr/{insights_.distribution-cIOophCi.mjs → insights_.distribution-EOOOOTb6.mjs} +2 -2
- package/.output/server/_ssr/{installations-DbWHAWYX.mjs → installations-BOI_y7Ma.mjs} +11 -11
- package/.output/server/_ssr/{installations-Cfv92huF.mjs → installations-D0_0hzdi.mjs} +4 -4
- package/.output/server/_ssr/{installations-DL6xGKQV.mjs → installations-dWlOOS7Y.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-CQ2or1jy.mjs → native-builds-Bx_az6YZ.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-BVwIjuMb.mjs → native-builds-C721Rw23.mjs} +11 -11
- package/.output/server/_ssr/{native-builds_._buildId-9gbO1oUK.mjs → native-builds_._buildId-YItxv8j9.mjs} +2 -2
- package/.output/server/_ssr/{native-builds_._buildId-QadrPuX2.mjs → native-builds_._buildId-ubi48Sfs.mjs} +82 -65
- package/.output/server/_ssr/{nativeBuildDevice-CJ2obp_i.mjs → nativeBuildDevice-DJUAzAIj.mjs} +25 -44
- package/.output/server/_ssr/{nativeBuildDownloadLink-BgHU2jer.mjs → nativeBuildDownloadLink-C0I8eLpS.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-YRK3anmZ.mjs → nativeBuildInstall-CxG8K8TL.mjs} +2 -2
- package/.output/server/_ssr/{release-adoption-rpc-BeICf-ls.mjs → release-adoption-rpc-DcZAYRWJ.mjs} +5 -5
- package/.output/server/_ssr/{remote-config-B9Rh9MYB.mjs → remote-config-BZ_vGV97.mjs} +17 -17
- package/.output/server/_ssr/{remote-config-Bn3iwL4O.mjs → remote-config-DOcSXzxG.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-La2M_14q.mjs → remote-config-gKqDKMxk.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-rpc-D2hgZLcR.mjs → remote-config-rpc-CVPd3V69.mjs} +3 -3
- package/.output/server/_ssr/{router-BHTaxXOH.mjs → router-Bcyej4cr.mjs} +30 -25
- package/.output/server/_ssr/{routes-BNp3BHpQ.mjs → routes-B10xsCh4.mjs} +19 -19
- package/.output/server/_ssr/{routes-BgGwD6gI.mjs → routes-ddBRVSju.mjs} +8 -8
- package/.output/server/_ssr/{schema-migration-rpc-JTXXTG_7.mjs → schema-migration-rpc-iWZzLv70.mjs} +3 -3
- package/.output/server/_ssr/{select-D4Qtq6i4.mjs → select-i4WT0c9r.mjs} +1 -1
- package/.output/server/_ssr/{server-CWOAS1ox.mjs → server-CMgMPrDx.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-B2htNQ31.mjs → sidebar-mIQgB0iy.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-C7nt9D5t.mjs → switch-DR8EAh5C.mjs} +2 -2
- package/.output/server/_ssr/{table-BEDdZRg2.mjs → table-DXmK6G7A.mjs} +1 -1
- package/.output/server/_ssr/{tabs-CMXGA63y.mjs → tabs-DAfypcYe.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-8rDaj5Hv.mjs → _tanstack-start-manifest_v-8M7ggCuB.mjs} +5 -5
- package/.output/server/index.mjs +146 -146
- package/package.json +7 -7
- package/src/components/ThemeProvider.tsx +11 -2
- package/src/components/features/native-builds/InstallCard.tsx +3 -1
- package/src/components/features/native-builds/IosInstall.tsx +77 -47
- package/src/lib/server/nativeBuildDevice.ts +22 -43
- package/.output/public/assets/native-builds_._buildId-DZVhvBXQ.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/console",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.26",
|
|
5
5
|
"files": [
|
|
6
6
|
".output",
|
|
7
7
|
"lib",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"tw-animate-css": "^1.4.0",
|
|
60
60
|
"uqr": "^0.1.3",
|
|
61
61
|
"verkit": "0.4.0",
|
|
62
|
-
"@hot-updater/bsdiff": "1.2.0-rc.
|
|
63
|
-
"@hot-updater/plugin-core": "1.2.0-rc.
|
|
64
|
-
"@hot-updater/
|
|
65
|
-
"@hot-updater/
|
|
62
|
+
"@hot-updater/bsdiff": "1.2.0-rc.26",
|
|
63
|
+
"@hot-updater/plugin-core": "1.2.0-rc.26",
|
|
64
|
+
"@hot-updater/protocol": "1.2.0-rc.26",
|
|
65
|
+
"@hot-updater/server": "1.2.0-rc.26"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/devtools-vite": "^0.6.0",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"vite-tsconfig-paths": "^6.1.1",
|
|
88
88
|
"vitest": "4.1.4",
|
|
89
89
|
"web-vitals": "^5.1.0",
|
|
90
|
-
"@hot-updater/cli-tools": "1.2.0-rc.
|
|
91
|
-
"@hot-updater/mock": "1.2.0-rc.
|
|
90
|
+
"@hot-updater/cli-tools": "1.2.0-rc.26",
|
|
91
|
+
"@hot-updater/mock": "1.2.0-rc.26"
|
|
92
92
|
},
|
|
93
93
|
"description": "React Native OTA solution for self-hosted",
|
|
94
94
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -24,7 +24,12 @@ export function ThemeProvider({
|
|
|
24
24
|
const [theme, setTheme] = useState<Theme>(defaultTheme);
|
|
25
25
|
|
|
26
26
|
useEffect(() => {
|
|
27
|
-
|
|
27
|
+
let stored: Theme | null = null;
|
|
28
|
+
try {
|
|
29
|
+
stored = localStorage.getItem(storageKey) as Theme | null;
|
|
30
|
+
} catch {
|
|
31
|
+
// A browser that keeps nothing: the default theme stands.
|
|
32
|
+
}
|
|
28
33
|
if (stored) {
|
|
29
34
|
setTheme(stored);
|
|
30
35
|
}
|
|
@@ -97,7 +102,11 @@ export function ThemeProvider({
|
|
|
97
102
|
const value = {
|
|
98
103
|
theme,
|
|
99
104
|
setTheme: (newTheme: Theme) => {
|
|
100
|
-
|
|
105
|
+
try {
|
|
106
|
+
localStorage.setItem(storageKey, newTheme);
|
|
107
|
+
} catch {
|
|
108
|
+
// A browser that keeps nothing: the theme lasts this visit.
|
|
109
|
+
}
|
|
101
110
|
setTheme(newTheme);
|
|
102
111
|
},
|
|
103
112
|
};
|
|
@@ -324,7 +324,9 @@ function SignedLink({
|
|
|
324
324
|
<CopyableText label="the download link" value={url} />
|
|
325
325
|
<p className="text-xs text-muted-foreground">
|
|
326
326
|
Anyone with this link can download this build until{" "}
|
|
327
|
-
|
|
327
|
+
<span className="whitespace-nowrap">
|
|
328
|
+
{dayjs(link.expiresAt).format("YYYY-MM-DD")}.
|
|
329
|
+
</span>
|
|
328
330
|
</p>
|
|
329
331
|
</div>
|
|
330
332
|
);
|
|
@@ -36,28 +36,66 @@ export const isIosBrowser = (
|
|
|
36
36
|
/iPhone|iPod|iPad/u.test(browser.userAgent) ||
|
|
37
37
|
(/Macintosh/u.test(browser.userAgent) && browser.maxTouchPoints > 1);
|
|
38
38
|
|
|
39
|
+
/** The UDID the profile's page passed in the fragment, if any. */
|
|
40
|
+
const fragmentUdid = () => {
|
|
41
|
+
if (typeof window === "undefined") return null;
|
|
42
|
+
const udid = new URLSearchParams(window.location.hash.slice(1)).get("udid");
|
|
43
|
+
return udid !== null && IOS_UDID_PATTERN.test(udid) ? udid : null;
|
|
44
|
+
};
|
|
45
|
+
|
|
39
46
|
/**
|
|
40
|
-
* Whether this page is open on an iPhone, and
|
|
41
|
-
*
|
|
42
|
-
* browser. Null until then.
|
|
47
|
+
* Whether this page is open on an iPhone, and its UDID: the one this phone
|
|
48
|
+
* kept, else the one the profile's page passed in the fragment. Read after the
|
|
49
|
+
* page mounts: the server renders it without a browser. Null until then.
|
|
43
50
|
*/
|
|
44
51
|
export const useIosDevice = () => {
|
|
45
52
|
const [device, setDevice] = useState<{
|
|
46
53
|
readonly ios: boolean;
|
|
47
54
|
readonly udid: string | null;
|
|
48
55
|
} | null>(null);
|
|
56
|
+
// Read at the first render, so an effect that runs again (React's
|
|
57
|
+
// development check) still has it after the fragment is gone.
|
|
58
|
+
const [passed] = useState(fragmentUdid);
|
|
49
59
|
useEffect(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
const valid = (udid: string | null | undefined) =>
|
|
61
|
+
udid != null && IOS_UDID_PATTERN.test(udid) ? udid : null;
|
|
62
|
+
// A browser that keeps nothing still has the ID from the fragment, in memory.
|
|
63
|
+
if (passed !== null && window.location.hash !== "") {
|
|
64
|
+
window.history.replaceState(
|
|
65
|
+
window.history.state,
|
|
66
|
+
"",
|
|
67
|
+
`${window.location.pathname}${window.location.search}`,
|
|
68
|
+
);
|
|
55
69
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
const read = () => {
|
|
71
|
+
let udid: string | null = null;
|
|
72
|
+
try {
|
|
73
|
+
udid = window.localStorage.getItem(IOS_UDID_STORAGE_KEY);
|
|
74
|
+
} catch {
|
|
75
|
+
// A browser that keeps nothing: the fragment's ID, if any, stands.
|
|
76
|
+
}
|
|
77
|
+
const kept = valid(udid) ?? passed;
|
|
78
|
+
setDevice((current) =>
|
|
79
|
+
current?.udid === kept && current !== null
|
|
80
|
+
? current
|
|
81
|
+
: { ios: isIosBrowser(navigator), udid: kept },
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
read();
|
|
85
|
+
// The profile's answer may land in another tab, which keeps the ID there:
|
|
86
|
+
// this tab reads it when that tab writes it, or when Safari shows it again.
|
|
87
|
+
const onStorage = (event: StorageEvent) => {
|
|
88
|
+
if (event.key === null || event.key === IOS_UDID_STORAGE_KEY) read();
|
|
89
|
+
};
|
|
90
|
+
window.addEventListener("storage", onStorage);
|
|
91
|
+
window.addEventListener("pageshow", read);
|
|
92
|
+
document.addEventListener("visibilitychange", read);
|
|
93
|
+
return () => {
|
|
94
|
+
window.removeEventListener("storage", onStorage);
|
|
95
|
+
window.removeEventListener("pageshow", read);
|
|
96
|
+
document.removeEventListener("visibilitychange", read);
|
|
97
|
+
};
|
|
98
|
+
}, [passed]);
|
|
61
99
|
return device;
|
|
62
100
|
};
|
|
63
101
|
|
|
@@ -116,21 +154,16 @@ function RenewInstallLink({
|
|
|
116
154
|
function InstallButton({
|
|
117
155
|
build,
|
|
118
156
|
token,
|
|
119
|
-
secondary = false,
|
|
120
157
|
}: {
|
|
121
158
|
readonly build: NativeBuildRow;
|
|
122
159
|
readonly token: string;
|
|
123
|
-
readonly secondary?: boolean;
|
|
124
160
|
}) {
|
|
125
161
|
return (
|
|
126
162
|
<a
|
|
127
|
-
className={buttonVariants({
|
|
128
|
-
className: ACTION_CLASS,
|
|
129
|
-
variant: secondary ? "outline" : "default",
|
|
130
|
-
})}
|
|
163
|
+
className={buttonVariants({ className: ACTION_CLASS })}
|
|
131
164
|
href={nativeBuildItmsUrl(window.location, build.id, token)}
|
|
132
165
|
>
|
|
133
|
-
|
|
166
|
+
Install
|
|
134
167
|
</a>
|
|
135
168
|
);
|
|
136
169
|
}
|
|
@@ -150,25 +183,27 @@ function InstallNotes() {
|
|
|
150
183
|
|
|
151
184
|
/**
|
|
152
185
|
* The link that hands this iPhone the profile that reads its UDID, under the
|
|
153
|
-
* console's path. A plain link, so iOS offers the profile.
|
|
186
|
+
* console's path. A plain link, so iOS offers the profile. Once it's installed,
|
|
187
|
+
* the phone comes back to this page, which then offers Install.
|
|
154
188
|
*/
|
|
155
|
-
function
|
|
189
|
+
function InstallProfile({
|
|
156
190
|
build,
|
|
157
|
-
|
|
191
|
+
again = false,
|
|
158
192
|
}: {
|
|
159
193
|
readonly build: NativeBuildRow;
|
|
160
|
-
|
|
194
|
+
/** Second to the command: for a phone whose kept ID isn't its own. */
|
|
195
|
+
readonly again?: boolean;
|
|
161
196
|
}) {
|
|
162
197
|
return (
|
|
163
198
|
<a
|
|
164
199
|
className={buttonVariants({
|
|
165
200
|
className: ACTION_CLASS,
|
|
166
|
-
variant:
|
|
201
|
+
variant: again ? "secondary" : "default",
|
|
167
202
|
})}
|
|
168
203
|
href={`${consolePathOf(window.location, build.id)}${nativeBuildDeviceProfilePath(build.id)}`}
|
|
169
204
|
>
|
|
170
205
|
<Smartphone data-icon="inline-start" />
|
|
171
|
-
|
|
206
|
+
{again ? "Install the profile again" : "Install profile"}
|
|
172
207
|
</a>
|
|
173
208
|
);
|
|
174
209
|
}
|
|
@@ -190,7 +225,8 @@ export function IosInstall({
|
|
|
190
225
|
const { refetch } = eligibility;
|
|
191
226
|
const expired = useInstallLinkExpired(
|
|
192
227
|
eligibility.dataUpdatedAt,
|
|
193
|
-
eligibility.data?.status === "installable"
|
|
228
|
+
eligibility.data?.status === "installable" &&
|
|
229
|
+
eligibility.data.device === "included",
|
|
194
230
|
);
|
|
195
231
|
useEffect(() => {
|
|
196
232
|
if (expired) void refetch();
|
|
@@ -241,20 +277,18 @@ export function IosInstall({
|
|
|
241
277
|
);
|
|
242
278
|
}
|
|
243
279
|
if (token === null) return null;
|
|
244
|
-
const install = ({ secondary = false } = {}) =>
|
|
245
|
-
expired ? (
|
|
246
|
-
<RenewInstallLink
|
|
247
|
-
fetching={eligibility.isFetching}
|
|
248
|
-
onRenew={() => void refetch()}
|
|
249
|
-
/>
|
|
250
|
-
) : (
|
|
251
|
-
<InstallButton build={build} secondary={secondary} token={token} />
|
|
252
|
-
);
|
|
253
280
|
if (result.device === "included") {
|
|
254
281
|
return (
|
|
255
282
|
<div className="flex min-w-0 flex-col gap-3">
|
|
256
283
|
<p className="text-sm font-medium">This iPhone is in this build.</p>
|
|
257
|
-
{
|
|
284
|
+
{expired ? (
|
|
285
|
+
<RenewInstallLink
|
|
286
|
+
fetching={eligibility.isFetching}
|
|
287
|
+
onRenew={() => void refetch()}
|
|
288
|
+
/>
|
|
289
|
+
) : (
|
|
290
|
+
<InstallButton build={build} token={token} />
|
|
291
|
+
)}
|
|
258
292
|
<InstallNotes />
|
|
259
293
|
</div>
|
|
260
294
|
);
|
|
@@ -275,26 +309,22 @@ export function IosInstall({
|
|
|
275
309
|
value={nativeBuildDeviceAddCommand(udid ?? "")}
|
|
276
310
|
wrap
|
|
277
311
|
/>
|
|
278
|
-
{
|
|
279
|
-
<InstallNotes />
|
|
312
|
+
<InstallProfile build={build} again />
|
|
280
313
|
</div>
|
|
281
314
|
);
|
|
282
315
|
}
|
|
283
316
|
return (
|
|
284
317
|
<div className="flex min-w-0 flex-col gap-3">
|
|
285
318
|
<div className="flex min-w-0 flex-col gap-1">
|
|
286
|
-
<p className="text-sm font-medium">
|
|
319
|
+
<p className="text-sm font-medium">Install the profile first</p>
|
|
287
320
|
<p className="text-xs text-muted-foreground">
|
|
288
|
-
iOS installs this IPA only on the devices it lists.
|
|
321
|
+
iOS installs this IPA only on the devices it lists. The profile reads
|
|
289
322
|
this iPhone's ID and nothing else: allow the download, then install it
|
|
290
|
-
|
|
323
|
+
in Settings, where iOS calls it not signed. Safari comes back here to
|
|
324
|
+
install the app, and nothing stays installed.
|
|
291
325
|
</p>
|
|
292
326
|
</div>
|
|
293
|
-
<
|
|
294
|
-
<CheckThisIphone build={build} />
|
|
295
|
-
{install({ secondary: true })}
|
|
296
|
-
</div>
|
|
297
|
-
<InstallNotes />
|
|
327
|
+
<InstallProfile build={build} />
|
|
298
328
|
</div>
|
|
299
329
|
);
|
|
300
330
|
}
|
|
@@ -4,7 +4,6 @@ import { readProfileServiceUdid } from "@hot-updater/protocol/native-artifact";
|
|
|
4
4
|
import {
|
|
5
5
|
IOS_UDID_PATTERN,
|
|
6
6
|
IOS_UDID_STORAGE_KEY,
|
|
7
|
-
nativeBuildDeviceAddCommand,
|
|
8
7
|
nativeBuildDeviceProfilePath,
|
|
9
8
|
} from "../native-builds";
|
|
10
9
|
import { escapePlistText } from "./plistText";
|
|
@@ -74,11 +73,11 @@ export const serveDeviceProfile = (request: Request, id: string): Response => {
|
|
|
74
73
|
<key>PayloadOrganization</key>
|
|
75
74
|
<string>Hot Updater</string>
|
|
76
75
|
<key>PayloadDisplayName</key>
|
|
77
|
-
<string>
|
|
76
|
+
<string>Hot Updater Device Profile</string>
|
|
78
77
|
<key>PayloadDescription</key>
|
|
79
78
|
<string>Sends this iPhone's ID (UDID) to ${escapePlistText(host)}, to check whether a build can install on it. Nothing stays installed.</string>
|
|
80
79
|
<key>PayloadIdentifier</key>
|
|
81
|
-
<string>dev.hot-updater.
|
|
80
|
+
<string>dev.hot-updater.device-profile</string>
|
|
82
81
|
<key>PayloadUUID</key>
|
|
83
82
|
<string>6D3F4C0E-52C4-4C8B-9E0A-7B1E5A0C2F11</string>
|
|
84
83
|
<key>PayloadVersion</key>
|
|
@@ -161,13 +160,9 @@ const page = ({
|
|
|
161
160
|
readonly buildId: string;
|
|
162
161
|
readonly nonce: string;
|
|
163
162
|
}) => {
|
|
164
|
-
const [commandStart, commandEnd] =
|
|
165
|
-
nativeBuildDeviceAddCommand("UDID").split("UDID");
|
|
166
163
|
const script = JSON.stringify({
|
|
167
164
|
pattern: IOS_UDID_PATTERN.source,
|
|
168
165
|
key: IOS_UDID_STORAGE_KEY,
|
|
169
|
-
commandStart,
|
|
170
|
-
commandEnd,
|
|
171
166
|
}).replaceAll("<", "\\u003c");
|
|
172
167
|
return `<!doctype html>
|
|
173
168
|
<html lang="en">
|
|
@@ -176,38 +171,30 @@ const page = ({
|
|
|
176
171
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
177
172
|
<meta name="color-scheme" content="dark light">
|
|
178
173
|
<meta name="robots" content="noindex">
|
|
179
|
-
<title>
|
|
174
|
+
<title>Back to the build</title>
|
|
180
175
|
<style nonce="${nonce}">
|
|
181
|
-
:root { color-scheme: dark light; --bg: oklch(1 0 0); --fg: oklch(0.147 0.004 49.25); --muted: oklch(0.553 0.013 58.071); --line: oklch(0.923 0.003 48.717); --
|
|
182
|
-
@media (prefers-color-scheme: dark) { :root { --bg: oklch(0.147 0.004 49.25); --fg: oklch(0.985 0.001 106.423); --muted: oklch(0.709 0.01 56.259); --line: oklch(1 0 0 / 10%);
|
|
176
|
+
:root { color-scheme: dark light; --bg: oklch(1 0 0); --fg: oklch(0.147 0.004 49.25); --muted: oklch(0.553 0.013 58.071); --line: oklch(0.923 0.003 48.717); --radius: 0.45rem; }
|
|
177
|
+
@media (prefers-color-scheme: dark) { :root { --bg: oklch(0.147 0.004 49.25); --fg: oklch(0.985 0.001 106.423); --muted: oklch(0.709 0.01 56.259); --line: oklch(1 0 0 / 10%); } }
|
|
183
178
|
* { box-sizing: border-box; }
|
|
184
179
|
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 -apple-system, system-ui, sans-serif; }
|
|
185
180
|
main { display: flex; flex-direction: column; gap: 16px; max-width: 32rem; margin: 0 auto; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); }
|
|
186
181
|
h1 { margin: 0; font-size: 22px; line-height: 1.25; }
|
|
187
182
|
p { margin: 0; color: var(--muted); font-size: 15px; }
|
|
188
|
-
.
|
|
189
|
-
code { display: block; padding: 12px; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font: 14px/1.4 ui-monospace, Menlo, monospace; }
|
|
190
|
-
button, a.action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 8px 16px; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; }
|
|
191
|
-
button { border: 0; background: var(--primary); color: var(--on-primary); }
|
|
192
|
-
a.action { border: 1px solid var(--line); color: var(--fg); }
|
|
183
|
+
a.action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 8px 16px; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--fg); }
|
|
193
184
|
[hidden] { display: none; }
|
|
194
185
|
</style>
|
|
195
186
|
</head>
|
|
196
187
|
<body>
|
|
197
188
|
<main>
|
|
198
|
-
<div id="
|
|
199
|
-
<h1>
|
|
189
|
+
<div id="returning" hidden>
|
|
190
|
+
<h1>Back to the build</h1>
|
|
191
|
+
<p>Opening the build's page to install it.</p>
|
|
200
192
|
</div>
|
|
201
193
|
<div id="missing" hidden>
|
|
202
194
|
<h1>No iPhone ID here</h1>
|
|
203
195
|
</div>
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
<p id="next" hidden>A maintainer runs this command to register the iPhone, then rebuilds. Open the build again afterwards to install it.</p>
|
|
207
|
-
<code id="command" hidden translate="no"></code>
|
|
208
|
-
<button id="copy" type="button" hidden>Copy command</button>
|
|
209
|
-
<p id="retry" hidden>Open the build's page in Safari and check this iPhone again. On a Mac, Finder shows an iPhone's ID, which a maintainer can register with native-build devices add.</p>
|
|
210
|
-
<a class="action" href="../../../native-builds/${encodeURIComponent(buildId)}">Back to the build</a>
|
|
196
|
+
<p id="retry" hidden>Open the build's page in Safari and install the profile again. On a Mac, Finder shows an iPhone's ID, which a maintainer can register with native-build devices add.</p>
|
|
197
|
+
<a class="action" id="back" href="../../../native-builds/${encodeURIComponent(buildId)}">Back to the build</a>
|
|
211
198
|
</main>
|
|
212
199
|
<script nonce="${nonce}">
|
|
213
200
|
(function () {
|
|
@@ -220,19 +207,11 @@ a.action { border: 1px solid var(--line); color: var(--fg); }
|
|
|
220
207
|
if (location.hash) history.replaceState(null, "", location.pathname);
|
|
221
208
|
if (!udid || !pattern.test(udid)) { show("missing"); show("retry"); return; }
|
|
222
209
|
try { localStorage.setItem(c.key, udid); } catch (e) {}
|
|
223
|
-
|
|
224
|
-
document.getElementById("
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
button.addEventListener("click", function () {
|
|
229
|
-
navigator.clipboard.writeText(command).then(function () {
|
|
230
|
-
button.textContent = "Copied";
|
|
231
|
-
}, function () {
|
|
232
|
-
getSelection().selectAllChildren(document.getElementById("command"));
|
|
233
|
-
button.textContent = "Select and copy above";
|
|
234
|
-
});
|
|
235
|
-
});
|
|
210
|
+
// The ID goes along in the fragment too, for a browser that keeps nothing.
|
|
211
|
+
var back = document.getElementById("back");
|
|
212
|
+
back.href = back.href.split("#")[0] + "#udid=" + encodeURIComponent(udid);
|
|
213
|
+
show("returning");
|
|
214
|
+
location.replace(back.href);
|
|
236
215
|
})();
|
|
237
216
|
</script>
|
|
238
217
|
</body>
|
|
@@ -241,12 +220,12 @@ a.action { border: 1px solid var(--line); color: var(--fg); }
|
|
|
241
220
|
};
|
|
242
221
|
|
|
243
222
|
/**
|
|
244
|
-
* The page the callback lands on
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
223
|
+
* The page the callback lands on. It keeps the UDID in the phone's
|
|
224
|
+
* `localStorage` and goes straight back to the build's page with the UDID in
|
|
225
|
+
* the fragment too, for a browser that keeps nothing. The build's page offers
|
|
226
|
+
* Install, or the command for a maintainer, which asks whose iPhone it is,
|
|
227
|
+
* since a crafted link can carry any ID. The UDID stays in the browser: a
|
|
228
|
+
* fragment never reaches a server. It takes no session.
|
|
250
229
|
*
|
|
251
230
|
* - 400: the ID isn't a UUIDv7;
|
|
252
231
|
* - 405: a method other than GET or HEAD.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Fn as t,In as n,Ln as r,Wr as i,ii as a,ir as o,p as s,ti as c}from"./sidebar-Di9SN47G.js";import{t as l}from"./link-DTEyW70e.js";import{t as u}from"./arrow-up-right-DK8Zdg40.js";import{C as d,S as f,_ as ee,a as te,c as p,d as ne,f as re,g as ie,h as ae,i as oe,l as se,m,o as ce,p as le,r as ue,s as de,t as fe,v as pe,w as me,x as he,y as h}from"./TargetDisplay-DwOaMOiI.js";import{t as ge}from"./chevron-right-BoUXo82O.js";import{n as _e,t as g}from"./native-builds_._buildId-BP2XhCKZ.js";import{r as ve}from"./HashValueDisplay-MoZMmTeP.js";import{i as ye,n as be,r as _,t as xe}from"./RolloutPercentageBadge-G6qt8rVb.js";import{n as Se,t as Ce}from"./history-DakJoeSM.js";import{r as we}from"./-native-builds-search-OlRj4Jz0.js";import{t as Te}from"./refresh-cw-C-tvoCcE.js";import{i as Ee,n as v,r as De,t as Oe}from"./StoreSubmission-CqSg880n.js";import{t as ke}from"./smartphone-r0rRdPas.js";import{a as y,i as b,n as x,o as S,r as Ae,t as je}from"./badge-D0NFvUY5.js";import{n as C}from"./dist-Bf1BPKMs.js";import{a as w,n as T,o as E,t as D}from"./card-ulgg5xHn.js";import{r as Me}from"./uuidv7-cI6C63Fm.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./empty-Bhlj8PEo.js";import{n as Ne}from"./relativeTime-DvyxGIsm.js";import{t as Pe}from"./PlatformIcon-CJ69KopR.js";import{a as Fe,d as Ie,f as Le,l as Re,m as ze,p as Be,u as Ve}from"./api-LQJH44FU.js";import{a as He,i as P,n as Ue,o as F,r as I,t as We}from"./table-TUtVz-2l.js";import{t as Ge}from"./BundleIdDisplay-CP6rsdFO.js";var Ke=o(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),L=i();function qe({value:e,length:t,label:n}){let r=async()=>{try{await navigator.clipboard.writeText(e),C.success(`Copied to clipboard`,{description:e})}catch{C.error(`Could not copy the ${n}`)}};return(0,L.jsx)(`button`,{"aria-label":`Copy the ${n} ${e}`,className:`relative cursor-copy rounded-sm font-mono after:absolute after:-inset-x-2 after:-inset-y-4 sm:after:hidden text-xs whitespace-nowrap tabular-nums underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:e=>{e.stopPropagation(),r()},title:e,translate:`no`,type:`button`,children:e.slice(0,t)})}function Je({hash:e}){let t=Fe();if(e===null)return(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=be(t.data?.console.gitUrl,e);return n===null?(0,L.jsx)(qe,{label:`commit`,length:7,value:e}):(0,L.jsx)(`a`,{className:`relative font-mono text-xs whitespace-nowrap underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:underline sm:after:hidden`,href:n,onClick:e=>e.stopPropagation(),rel:`noreferrer`,target:`_blank`,title:e,translate:`no`,children:e.slice(0,7)})}function R({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4`,children:[(0,L.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}function Ye({detail:e}){let{build:n}=e,r=Re();if(n.is_sandbox)return null;let i=!n.is_store_build;return(0,L.jsx)(t,{className:`min-h-11 shrink-0 sm:min-h-8`,disabled:r.isPending,onClick:()=>r.mutate({id:n.id,storeBuild:i},{onSuccess:()=>{C.success(i?`Marked as the store build`:`Mark cleared`)},onError:e=>{C.error(`Could not change the mark`,{description:e.message})}}),size:`sm`,type:`button`,variant:`outline`,children:i?`Mark as store build`:`Clear mark`})}function Xe({detail:e}){let{build:t,newestInScope:n,storeBuildInScope:r}=e,i=r??n;if(i===null)return null;let a=i.id===t.id;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-muted/40 p-3 text-xs sm:flex-row sm:items-center sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(a?_e:Ce,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),r?.id===t.id?(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium`,children:`Store build.`}),` New deploys to this scope patch from this build.`]}):a?(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium`,children:`Current baseline.`}),` The newest build, and no store build is marked. New deploys to this scope patch from this build.`]}):(0,L.jsxs)(`p`,{children:[(0,L.jsx)(`span`,{className:`font-medium`,children:`Not the base.`}),` New deploys patch from`,` `,(0,L.jsxs)(l,{className:`inline-flex items-center gap-0.5 font-medium underline underline-offset-4`,params:{buildId:i.id},to:`/native-builds/$buildId`,children:[ee(i)??(0,L.jsxs)(L.Fragment,{children:[h(i.platform),` `,se[i.artifact_kind].label,` ·`,` `,(0,L.jsx)(_,{uuid:i.id})]}),(0,L.jsx)(u,{"aria-hidden":`true`,className:`size-3`})]}),`, so this one gets no new patches.`]})]}),(0,L.jsx)(Ye,{detail:e})]})}function Ze({detail:e}){let{build:t,builtInBundle:n,channel:r}=e,i=n?.childCount??0;return(0,L.jsxs)(D,{className:`overflow-hidden shadow-sm`,children:[(0,L.jsx)(w,{className:`border-b px-4 py-3`,children:(0,L.jsx)(E,{className:`text-sm`,children:(0,L.jsx)(`h2`,{children:`Built-in bundle`})})}),(0,L.jsxs)(T,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,L.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(R,{label:`Bundle ID`,children:(0,L.jsx)(Ge,{bundleId:t.min_bundle_id})}),(0,L.jsx)(R,{label:`OTAs patching from it`,children:(0,L.jsx)(`span`,{className:`tabular-nums`,children:i===1?`1 bundle`:`${i} bundles`})}),(0,L.jsx)(R,{label:`Scope`,children:(0,L.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(l,{"aria-label":`Show the builds that embed ${r}`,className:`relative rounded-md after:absolute after:inset-x-0 after:-inset-y-[11px] sm:after:hidden`,search:{channel:r},to:`/native-builds`,children:(0,L.jsx)(d,{channel:r})}),(0,L.jsx)(`span`,{className:`text-xs`,children:h(t.platform)})]})}),(0,L.jsx)(R,{label:`Target`,children:(0,L.jsx)(`span`,{className:`text-xs`,children:(0,L.jsx)(ue,{appVersion:t.app_version,fingerprintHash:t.fingerprint_hash})})}),(0,L.jsx)(R,{label:`Build key`,children:(0,L.jsx)(`span`,{className:`text-xs`,children:(0,L.jsx)(fe,{value:t.build_key})})}),t.build_number?(0,L.jsx)(R,{label:`Build`,children:(0,L.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,translate:`no`,children:t.build_number})}):null,v(t)?(0,L.jsx)(R,{label:`Store`,children:(0,L.jsx)(Oe,{build:t,withTime:!0})}):null,(0,L.jsx)(R,{label:`Commit`,children:(0,L.jsx)(Je,{hash:t.git_commit_hash})}),(0,L.jsx)(R,{label:`Created`,children:(0,L.jsx)(_,{format:`both`,uuid:t.id})})]}),(0,L.jsx)(Xe,{detail:e}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A store or test install of this build runs this bundle until its first OTA. That OTA downloads as a patch from this bundle when one exists, and as the full bundle otherwise.`})]})]})}var z=a(c(),1),Qe=a(Ne(),1),B=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(B||{}),$e=[0,1],et=[1,0],tt=[2,3],nt=[3,2],rt={L:$e,M:et,Q:tt,H:nt},it=/^\d*$/,at=/^[A-Z0-9 $%*+./:-]*$/,V=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,H=1,U=40,ot=3,st=3,W=40,ct=10,lt=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],ut=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],dt=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<H||e>U)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,B.Timing),this.setFunctionModule(e,6,e%2==0,B.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,K(r,e));this.setFunctionModule(8,7,K(r,6)),this.setFunctionModule(8,8,K(r,7)),this.setFunctionModule(7,8,K(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,K(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,K(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,K(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=K(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,B.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,B.Alignment)}setFunctionModule(e,t,n,r=B.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==Y(t,n))throw RangeError(`Invalid argument`);let r=ut[n[0]][t],i=lt[n[0]][t],a=Math.floor(J(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=wt(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=Tt(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(J(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=K(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=ot:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*W),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*W}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=ot:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*W),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*W}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=st)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*ct,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function G(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function K(e,t){return(e>>>t&1)!=0}var q=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},ft=[1,10,12,14],pt=[2,9,11,13],mt=[4,8,16,16];function ht(e,t){return e[Math.floor((t+7)/17)+1]}function gt(e){let t=[];for(let n of e)G(n,8,t);return new q(mt,e.length,t)}function _t(e){if(!bt(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);G(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new q(ft,e.length,t)}function vt(e){if(!xt(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n;for(n=0;n+2<=e.length;n+=2){let r=V.indexOf(e.charAt(n))*45;r+=V.indexOf(e.charAt(n+1)),G(r,11,t)}return n<e.length&&G(V.indexOf(e.charAt(n)),6,t),new q(pt,e.length,t)}function yt(e){return e===``?[]:bt(e)?[_t(e)]:xt(e)?[vt(e)]:[gt(Ct(e))]}function bt(e){return it.test(e)}function xt(e){return at.test(e)}function St(e,t){let n=0;for(let r of e){let e=ht(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function Ct(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function J(e){if(e<H||e>U)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function Y(e,t){return Math.floor(J(e)/8)-lt[t[0]][e]*ut[t[0]][e]}function wt(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=X(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=X(n,2)}return t}function Tt(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=X(t,e))}return n}function X(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function Et(e,t,n=1,r=40,i=-1,a=!0){if(!(H<=n&&n<=r&&r<=U)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=Y(o,t)*8,i=St(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[et,tt,nt])a&&s<=Y(o,e)*8&&(t=e);let c=[];for(let t of e){G(t.mode[0],4,c),G(t.numChars,ht(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=Y(o,t)*8;G(0,Math.min(4,l-c.length),c),G(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)G(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new dt(o,t,u,i)}function Dt(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?yt(e):Array.isArray(e)?[gt(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=Et(c,rt[n],i,a,o,r),u=Ot({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function Ot(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=B.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}var kt=e=>{let{data:t,size:n}=Dt(e,{ecc:`M`,border:4}),r=``;return t.forEach((e,t)=>e.forEach((e,n)=>{e&&(r+=`M${n} ${t}h1v1h-1z`)})),{size:n,path:r}};function At({value:e,label:t,className:n}){let{size:i,path:a}=(0,z.useMemo)(()=>kt(e),[e]);return(0,L.jsxs)(`svg`,{"aria-label":t,className:r(`aspect-square rounded-md`,n),role:`img`,shapeRendering:`crispEdges`,viewBox:`0 0 ${i} ${i}`,children:[(0,L.jsx)(`rect`,{fill:`#fff`,height:i,width:i}),(0,L.jsx)(`path`,{d:a,fill:`#000`})]})}var jt=`With the same bundle ID, this install replaces the App Store's copy of the app on this iPhone.`,Z=`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,Mt=e=>/iPhone|iPod|iPad/u.test(e.userAgent)||/Macintosh/u.test(e.userAgent)&&e.maxTouchPoints>1,Nt=()=>{let[e,t]=(0,z.useState)(null);return(0,z.useEffect)(()=>{let e=null;try{e=window.localStorage.getItem(te)}catch{}t({ios:Mt(navigator),udid:e!==null&&oe.test(e)?e:null})},[]),e},Pt=300*1e3,Ft=(e,t)=>{let[,n]=(0,z.useReducer)(e=>e+1,0),r=e+ce-Pt;return(0,z.useEffect)(()=>{if(!t)return;let e=setTimeout(n,Math.max(0,r-Date.now()));return document.addEventListener(`visibilitychange`,n),window.addEventListener(`pageshow`,n),()=>{clearTimeout(e),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pageshow`,n)}},[r,t]),t&&Date.now()>=r};function It({fetching:e,onRenew:n}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`This install link has expired.`,e?` Getting a new one.`:``]}),e?null:(0,L.jsx)(t,{className:Z,onClick:n,variant:`outline`,children:`Get a new link`})]})}function Lt({build:e,token:t,secondary:r=!1}){return(0,L.jsx)(`a`,{className:n({className:Z,variant:r?`outline`:`default`}),href:ie(window.location,e.id,t),children:r?`Install anyway`:`Install`})}function Q(){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On iOS 16 or later, the app opens only with Developer Mode on: Settings, Privacy & Security, Developer Mode.`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:jt})]})}function Rt({build:e,outline:t=!1}){return(0,L.jsxs)(`a`,{className:n({className:Z,variant:t?`outline`:`default`}),href:`${de(window.location,e.id)}${re(e.id)}`,children:[(0,L.jsx)(ke,{"data-icon":`inline-start`}),`Check this iPhone`]})}function zt({build:t,udid:n}){let r=Be(t.id,n),{refetch:i}=r,a=Ft(r.dataUpdatedAt,r.data?.status===`installable`);if((0,z.useEffect)(()=>{a&&i()},[a,i]),r.isPending)return(0,L.jsx)(e,{"aria-label":`Reading this IPA`,className:`h-11 w-full`});let o=r.data;if(o===void 0||o.status===`unavailable`)return(0,L.jsxs)(x,{children:[(0,L.jsx)(S,{}),(0,L.jsx)(y,{children:`Installation details unavailable`}),(0,L.jsx)(b,{children:`The Console couldn't read this IPA from storage in parts, which takes an HTTPS download link that answers Range requests. Xcode or Apple Configurator still installs the download over USB.`})]});if(o.status===`store`)return(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This IPA is an App Store export, which installs through TestFlight, not from this page.`});if(o.status===`expired`)return(0,L.jsxs)(x,{variant:`destructive`,children:[(0,L.jsx)(S,{}),(0,L.jsx)(y,{children:`This build's profile has expired`}),(0,L.jsxs)(b,{children:[`It expired on `,(0,Qe.default)(o.expiresAt).format(`YYYY-MM-DD`),`. A maintainer rebuilds it to install again.`]})]});let s=o.link.status===`issued`?o.link.token:null;if(o.link.status===`no-secret`)return(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,o.link.secretName,` on the Console to install from this page.`]});if(s===null)return null;let c=({secondary:e=!1}={})=>a?(0,L.jsx)(It,{fetching:r.isFetching,onRenew:()=>void i()}):(0,L.jsx)(Lt,{build:t,secondary:e,token:s});return o.device===`included`?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:`This iPhone is in this build.`}),c(),(0,L.jsx)(Q,{})]}):o.device===`not-included`?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:`Not in this build`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This IPA was signed without this iPhone. Send a maintainer this command, then open the newer build once they've rebuilt. Send it only if this is your iPhone.`})]}),(0,L.jsx)(f,{label:`the command that registers this iPhone`,value:ne(n??``),wrap:!0}),c({secondary:!0}),(0,L.jsx)(Q,{})]}):(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:`Is this iPhone in this build?`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`iOS installs this IPA only on the devices it lists. A profile reads this iPhone's ID and nothing else: allow the download, then install it from Settings, where iOS calls it not signed. Nothing stays installed.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,L.jsx)(Rt,{build:t}),c({secondary:!0})]}),(0,L.jsx)(Q,{})]})}var $={ipa:`The .ipa installs only on devices its signing profile allows (development or ad hoc); an App Store export reaches testers through TestFlight.`,aab:`The .aab installs through Google Play or bundletool, not from the file.`},Bt={apk:`Scan with an Android phone's camera, then open the APK to install it.`,ipa:`Scan to download. ${$.ipa}`,aab:`Scan to download. ${$.aab}`,app:`Scan to download the .app.zip on a Mac.`};function Vt(){let{origin:e,pathname:t}=window.location;return(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,L.jsx)(At,{className:`size-48`,label:`Open this page on an iPhone`,value:`${e}${t}`}),(0,L.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:`Scan with an iPhone to install this build from here. The phone signs in to the Console first.`})]})}function Ht({build:e,url:t,note:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,L.jsx)(At,{className:`size-48`,label:`Download ${m(e)}`,value:t}),(0,L.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:Bt[e.artifact_kind]}),n?(0,L.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:n}):null]})}function Ut({message:e}){return(0,L.jsxs)(x,{variant:`destructive`,children:[(0,L.jsx)(S,{}),(0,L.jsx)(y,{children:`The download link couldn't be created`}),(0,L.jsx)(b,{children:e})]})}function Wt({build:t}){let n=Le(t.id),r=n.data?.url;if(r===null){let e=$[t.artifact_kind];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`p`,{children:`This storage gives no download link a phone can open without signing in, so there is no QR code. Download the build here, or open this page on the phone signed in to the console.`}),e?(0,L.jsx)(`p`,{children:e}):null]})}return r===void 0?n.isError?(0,L.jsx)(Ut,{message:n.error.message}):(0,L.jsx)(e,{className:`size-48`}):(0,L.jsx)(Ht,{build:t,note:`This link expires. If the download fails, reload this page.`,url:r})}function Gt({build:e}){return(0,L.jsx)(`span`,{className:`font-mono text-foreground`,translate:`no`,children:e.submitted_version??`this build`})}function Kt({build:e}){let t=e.submitted_to===`testflight`?{name:`App Store Connect`,url:`https://appstoreconnect.apple.com/apps`}:{name:`Play Console`,url:`https://play.google.com/console`};return(0,L.jsxs)(D,{className:`overflow-hidden shadow-sm`,children:[(0,L.jsx)(w,{className:`border-b px-4 py-3`,children:(0,L.jsx)(E,{className:`text-sm`,children:(0,L.jsx)(`h2`,{children:`Install`})})}),(0,L.jsxs)(T,{className:`flex min-w-0 flex-col gap-4 p-4 sm:p-6`,children:[(0,L.jsx)(qt,{build:e}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,L.jsxs)(`a`,{className:n({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`}),href:t.url,rel:`noreferrer`,target:`_blank`,children:[(0,L.jsx)(ye,{"data-icon":`inline-start`}),`Open `,t.name]}),(0,L.jsxs)(`a`,{className:n({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:`outline`}),download:!0,href:le(e.id),children:[(0,L.jsx)(ve,{"data-icon":`inline-start`}),(0,L.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,m(e)]})]})]})]})]})}function qt({build:e}){switch(e.artifact_kind){case`apk`:return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your browser needs the "Install unknown apps" permission.`}),e.is_sandbox?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Its .sandbox ID installs it beside a Play copy.`}):(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`If this package is already installed with another signing key, such as a Play copy, the install fails. Uninstall that copy first, or build with sandbox: true, whose .sandbox ID installs beside it.`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On an emulator or a phone over USB, install and open it from your project:`}),(0,L.jsx)(f,{label:`the install command`,value:ae(e)})]});case`app`:return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs only in the iOS Simulator. In your project, install and open it on the booted one:`}),(0,L.jsx)(f,{label:`the install command`,value:ae(e)})]});case`aab`:return v(e)?(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Submitted to`,` `,e.submitted_to===`play-internal`?De[`play-internal`].name:De[e.submitted_to].label,` `,`as `,(0,L.jsx)(Gt,{build:e}),`.`,` `,e.submitted_to===`play-production`?`Users`:`Testers`,` get it once its release is rolled out; on an app Play Console hasn't published, the release is a draft you roll out in Play Console.`]}):(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`For testers, build and release to internal testing:`}),(0,L.jsx)(f,{label:`the Google Play command`,value:`npx hot-updater google-play upload`})]});case`ipa`:return v(e)?(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`On TestFlight as `,(0,L.jsx)(Gt,{build:e}),`. Internal testers install it from the TestFlight app once App Store Connect has processed it, and a preview's pull request comment shows that state.`]}):(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Over USB, Xcode or Apple Configurator installs it. For testers without a registered device:`}),(0,L.jsx)(f,{label:`the TestFlight command`,value:`npx hot-updater testflight`})]})}}function Jt({link:e,url:t}){return e?.status===`no-secret`?(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,e.secretName,` on the Console to create links.`]}):e?.status!==`issued`||t===null?null:(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(f,{label:`the download link`,value:t}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Anyone with this link can download this build until`,` `,(0,Qe.default)(e.expiresAt).format(`YYYY-MM-DD`),`.`]})]})}function Yt({build:e}){return v(e)&&(e.artifact_kind===`ipa`||e.artifact_kind===`aab`)?(0,L.jsx)(Kt,{build:e}):(0,L.jsx)(Xt,{build:e})}function Xt({build:t}){let r=m(t),i=Ie(t.id),a=i.data?.status===`issued`?pe(window.location,t.id,i.data.token):null,o=Nt(),s=t.artifact_kind===`ipa`,c=s&&o?.ios===!0;return(0,L.jsxs)(D,{className:`overflow-hidden shadow-sm`,children:[(0,L.jsx)(w,{className:`border-b px-4 py-3`,children:(0,L.jsx)(E,{className:`text-sm`,children:(0,L.jsx)(`h2`,{children:`Install`})})}),(0,L.jsxs)(T,{className:c?`flex min-w-0 flex-col gap-6 p-4 sm:p-6`:`grid gap-6 p-4 sm:grid-cols-[12rem_minmax(0,1fr)] sm:p-6`,children:[c?(0,L.jsx)(zt,{build:t,udid:o.udid}):s&&a!==null?(0,L.jsx)(Vt,{}):a===null?i.data===void 0?i.isError?(0,L.jsx)(Ut,{message:i.error.message}):(0,L.jsx)(e,{className:`size-48`}):(0,L.jsx)(Wt,{build:t}):(0,L.jsx)(Ht,{build:t,url:a}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsx)(qt,{build:t}),(0,L.jsxs)(`a`,{className:n({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:`outline`}),download:!0,href:a??le(t.id),children:[(0,L.jsx)(ve,{"data-icon":`inline-start`}),(0,L.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,r]})]}),(0,L.jsx)(Jt,{link:i.data,url:a})]})]})]})}var Zt=`https://hot-updater.dev/docs/guides/bundle-diffing#first-ota-update`;function Qt({detail:r,page:i,onPage:a}){let o=i.before!==void 0||i.after!==void 0,s=ze(r.build.min_bundle_id,i,o),c=o?s.data:r.patches,{next:d,previous:f}=c??{};return(0,L.jsxs)(D,{className:`overflow-hidden shadow-sm`,id:`patches`,children:[(0,L.jsx)(w,{className:`border-b px-4 py-3`,children:(0,L.jsx)(E,{className:`text-sm`,children:(0,L.jsx)(`h2`,{children:`Patches from this build`})})}),(0,L.jsxs)(T,{className:`p-0`,children:[o&&s.isError?(0,L.jsx)(`div`,{className:`p-4`,children:(0,L.jsxs)(x,{variant:`destructive`,children:[(0,L.jsx)(S,{}),(0,L.jsx)(y,{children:`Patches couldn't be loaded`}),(0,L.jsx)(b,{children:s.error.message}),(0,L.jsx)(Ae,{children:(0,L.jsxs)(t,{onClick:()=>void s.refetch(),size:`xs`,variant:`outline`,children:[(0,L.jsx)(Te,{"data-icon":`inline-start`}),`Retry`]})})]})}):c===void 0?(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Loading patches`}),(0,L.jsx)(e,{className:`h-4 w-full`}),(0,L.jsx)(e,{className:`h-4 w-2/3`})]}):c.data.length===0?o?(0,L.jsxs)(N,{className:`py-10`,children:[(0,L.jsx)(k,{children:(0,L.jsx)(j,{children:`No more patches`})}),(0,L.jsx)(t,{className:`min-h-11 sm:min-h-8`,onClick:()=>a({}),variant:`outline`,children:`Show the newest patches`})]}):(0,L.jsxs)(N,{className:`py-10`,children:[(0,L.jsxs)(k,{children:[(0,L.jsx)(O,{variant:`icon`,children:(0,L.jsx)(Se,{})}),(0,L.jsx)(j,{children:`No patches from this build`}),(0,L.jsxs)(M,{children:[`A deploy adds a patch from this build's bundle while it is its scope's store build, or its newest build with none marked, and the deploy config turns patches on, with`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`patch`}),` in`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`hot-updater.config.ts`}),`.`]})]}),(0,L.jsx)(A,{children:(0,L.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:Zt,rel:`noreferrer`,target:`_blank`,children:[`Bundle diffing guide`,(0,L.jsx)(u,{"data-icon":`inline-end`})]})})]}):(0,L.jsxs)(We,{"aria-busy":o&&s.isPlaceholderData,"aria-label":`Patches from this build`,className:`table-fixed`,children:[(0,L.jsx)(He,{children:(0,L.jsxs)(F,{children:[(0,L.jsx)(P,{children:`Target bundle`}),(0,L.jsx)(P,{className:`w-28`,children:`Patch size`}),(0,L.jsx)(P,{className:`hidden w-32 sm:table-cell`,children:`Created`})]})}),(0,L.jsx)(Ue,{children:c.data.map(e=>(0,L.jsxs)(F,{children:[(0,L.jsx)(I,{className:`py-3 whitespace-normal`,children:(0,L.jsx)(l,{className:`block font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{bundleId:e.bundleId},title:e.bundleId,to:`/`,translate:`no`,children:e.bundleId})}),(0,L.jsx)(I,{className:`text-xs tabular-nums`,children:p(e.byteSize)}),(0,L.jsx)(I,{className:`hidden sm:table-cell`,children:(0,L.jsx)(_,{uuid:e.bundleId})})]},e.bundleId))})]}),d!==void 0||f!==void 0?(0,L.jsxs)(`nav`,{"aria-label":`Patch pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,L.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:f===void 0||o&&s.isPlaceholderData,onClick:()=>a({after:f}),size:`sm`,variant:`ghost`,children:[(0,L.jsx)(me,{"data-icon":`inline-start`}),`Newer`]}),(0,L.jsxs)(t,{className:`min-h-11 sm:min-h-7`,disabled:d===void 0||o&&s.isPlaceholderData,onClick:()=>a({before:d}),size:`sm`,variant:`ghost`,children:[`Older`,(0,L.jsx)(ge,{"data-icon":`inline-end`})]})]}):null]})]})}var $t=(e,t)=>{let n=e.data.find(e=>e.bundleId===t);if(n!==void 0)return{kind:`patch`,byteSize:n.byteSize};let r=e.data.at(-1)?.bundleId;return e.next!==void 0&&r!==void 0&&t<r?{kind:`unknown`}:{kind:`full`}};function en({download:e}){switch(e.kind){case`patch`:return(0,L.jsxs)(`span`,{className:`text-xs`,children:[`Patch`,` `,(0,L.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,p(e.byteSize),`)`]})]});case`full`:return(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Full bundle`});case`unknown`:return(0,L.jsx)(`a`,{className:`text-xs underline-offset-4 hover:underline`,href:`#patches`,children:`See patches`})}}function tn({detail:e}){let{build:t,channel:r,servedNow:i,patches:a,catalogScopeKey:o}=e,s=i.find(({rolloutCohortCount:e,targetCohorts:t})=>e>0||t.length>0)?.bundleId,c=t.is_store_build&&s!=null&&$t(a,s).kind===`full`?[`npx hot-updater patch`,`-p ${t.platform}`,`-c ${he(r)}`,`-b ${he(s)}`,`--base-artifact-id ${he(t.min_bundle_id)}`].join(` `):null,d=(0,L.jsxs)(l,{className:`inline-flex items-center gap-0.5 underline-offset-4 hover:underline`,search:{scopeKey:o},to:`/`,children:[`All releases in this scope`,(0,L.jsx)(u,{"aria-hidden":`true`,className:`size-3`})]});return(0,L.jsxs)(D,{className:`overflow-hidden shadow-sm`,children:[(0,L.jsx)(w,{className:`border-b px-4 py-3`,children:(0,L.jsx)(E,{className:`text-sm`,children:(0,L.jsx)(`h2`,{children:`Served now`})})}),(0,L.jsx)(T,{className:`p-0`,children:i.length===0?(0,L.jsxs)(N,{className:`py-10`,children:[(0,L.jsxs)(k,{children:[(0,L.jsx)(O,{variant:`icon`,children:(0,L.jsx)(Ke,{})}),(0,L.jsx)(j,{children:`No OTA for this build yet`}),(0,L.jsxs)(M,{children:[`No release in this build's scope is newer than its built-in bundle. Deploy one with`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`hot-updater deploy`}),`, and it shows here.`]})]}),(0,L.jsx)(A,{children:(0,L.jsx)(l,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{scopeKey:o},to:`/`,children:`All releases in this scope`})})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(We,{"aria-label":`Served now`,className:`table-fixed`,children:[(0,L.jsx)(He,{children:(0,L.jsxs)(F,{children:[(0,L.jsx)(P,{children:`Bundle`}),(0,L.jsx)(P,{className:`hidden w-40 md:table-cell`,children:`Rollout`}),(0,L.jsx)(P,{className:`hidden w-32 sm:table-cell`,children:`Created`}),(0,L.jsx)(P,{className:`w-32`,children:`First OTA download`})]})}),(0,L.jsx)(Ue,{children:i.map(e=>{let t=e.bundleId,n=e.rolloutCohortCount/Me*100;return(0,L.jsxs)(F,{children:[(0,L.jsx)(I,{className:`py-3 whitespace-normal`,children:(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(l,{className:`font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{releaseId:e.releaseId},title:t,to:`/`,translate:`no`,children:t}),e.message?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.message}):null]})}),(0,L.jsx)(I,{className:`hidden md:table-cell`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.targetCohorts.length>0?(0,L.jsx)(je,{variant:`secondary`,children:e.targetCohorts.length===1?`1 cohort`:`${e.targetCohorts.length} cohorts`}):(0,L.jsx)(xe,{percentage:n}),e.shouldForceUpdate?(0,L.jsx)(je,{variant:`outline`,children:`Forced`}):null]})}),(0,L.jsx)(I,{className:`hidden sm:table-cell`,children:(0,L.jsx)(_,{uuid:t})}),(0,L.jsx)(I,{children:(0,L.jsx)(en,{download:$t(a,t)})})]},e.releaseId)})})]}),c===null?null:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 border-t px-4 py-3 text-xs`,children:[(0,L.jsx)(`p`,{children:`The OTA fresh installs get first has no patch from this store build, so they download all of it. Add one from your project:`}),(0,L.jsx)(f,{label:`the patch command`,value:c})]}),(0,L.jsxs)(`p`,{className:`border-t px-4 py-3 text-xs text-muted-foreground`,children:[`What the update check serves an install of this build now, newest first: not the history. `,d]})]})})]})}function nn({buildId:r,search:i,onSearchChange:a}){let o=Ve(r),c=o.data,u={...i.patchesBefore===void 0?{}:{before:i.patchesBefore},...i.patchesAfter===void 0?{}:{after:i.patchesAfter}};return(0,L.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,L.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 items-center gap-x-2 border-b bg-background px-3 py-3 sm:min-h-12 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,L.jsx)(s,{className:`-ml-1 size-11 lg:size-7`}),(0,L.jsxs)(l,{className:n({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds`,children:[(0,L.jsx)(me,{"data-icon":`inline-start`}),`Native builds`]}),c?(0,L.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium`,children:[(0,L.jsx)(Pe,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:c.build.platform}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,L.jsxs)(`span`,{className:`sr-only`,children:[h(c.build.platform),` `]}),se[c.build.artifact_kind].label,(0,L.jsx)(Ee,{build:c.build})]}),(0,L.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,(0,L.jsx)(`span`,{translate:`no`,children:c.channel})]})]}),(0,L.jsx)(`span`,{className:`hidden text-xs font-normal text-muted-foreground tabular-nums sm:inline`,children:p(c.build.byte_size)})]}):(0,L.jsx)(`h1`,{className:`sr-only`,children:`Native build`})]}),(0,L.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,L.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 sm:gap-6`,children:o.isError?(0,L.jsxs)(x,{variant:`destructive`,children:[(0,L.jsx)(S,{}),(0,L.jsx)(y,{children:`The native build couldn't be loaded`}),(0,L.jsx)(b,{children:o.error.message}),(0,L.jsx)(Ae,{children:(0,L.jsxs)(t,{onClick:()=>void o.refetch(),size:`xs`,variant:`outline`,children:[(0,L.jsx)(Te,{"data-icon":`inline-start`}),`Retry`]})})]}):c===void 0?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Loading the native build`}),(0,L.jsx)(e,{className:`h-56 w-full rounded-xl`}),(0,L.jsx)(e,{className:`h-64 w-full rounded-xl`})]}):c===null?(0,L.jsxs)(N,{className:`border py-16`,children:[(0,L.jsxs)(k,{children:[(0,L.jsx)(O,{variant:`icon`,children:(0,L.jsx)(we,{})}),(0,L.jsx)(j,{children:`Native build not found`}),(0,L.jsxs)(M,{children:[`No native build has this ID. It may have been deleted with`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`native-build delete`}),`, or be from another console.`]})]}),(0,L.jsx)(A,{children:(0,L.jsx)(l,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),to:`/native-builds`,children:`Show all native builds`})})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Yt,{build:c.build}),(0,L.jsx)(Ze,{detail:c}),(0,L.jsx)(tn,{detail:c}),(0,L.jsx)(Qt,{detail:c,onPage:e=>a({...e.before===void 0?{}:{patchesBefore:e.before},...e.after===void 0?{}:{patchesAfter:e.after}}),page:u})]})})})]})}function rn(){let{buildId:e}=g.useParams(),t=g.useSearch(),n=g.useNavigate();return(0,L.jsx)(nn,{buildId:e,onSearchChange:e=>void n({search:e,replace:!0}),search:t})}export{rn as component};
|