PageSourceSearch

https://balance-engine.vercel.app/packages/client/paidFeatureUnlocks.js

js balance-engine.vercel.app collected 2026-10-03 06:12:48 UTC 1,413 bytes, 45 lines download raw bytes

1/**
2 * ¥365 付费账户 · 核心档案功能自动解锁(成长档案 / 平衡点解读 / 能量药方)
3 */
4import { hasPaidAccess } from './paidAccess.js';
5import { saveFeatureFlags } from '../state/features.js';
6import { setReplenishPlanUnlocked } from '../storage/replenish.js';
7import { setBaziMultiViewUnlocked } from '../storage/baziMultiViewUnlock.js';
8import { getSeedTier } from '../storage/inviteCode.js';
9import { setMeihuaReportUnlocked } from '../storage/meihuaUnlock.js';
10
11/**
12 * 未付费 · 清除本机 premium 解锁标记(防 localStorage 篡改残留)
13 */
14export function clearPaidFeatureUnlocks() {
15  if (typeof window === 'undefined') return;
16  setReplenishPlanUnlocked(false);
17  setBaziMultiViewUnlocked(false);
18  saveFeatureFlags({
19    lossGuideEnabled: false,
20    foldingEnabled: false,
21  });
22}
23
24/**
25 * 已付费(¥365 账户 / 邀请码 / 本地预览)→ 写入本机解锁标记
26 * 成长档案导出 + 平衡点解读 + 能量药方:无需二次付费或手动点「解锁」
27 */
28export function syncPaidFeatureUnlocks() {
29  if (typeof window === 'undefined') return;
30  if (!hasPaidAccess()) {
31    clearPaidFeatureUnlocks();
32    return;
33  }
34
35  saveFeatureFlags({
36    lossGuideEnabled: true,
37    foldingEnabled: true,
38  });
39  setReplenishPlanUnlocked(true);
40  setBaziMultiViewUnlocked(true);
41
42  if (getSeedTier() === 'plus') {
43    setMeihuaReportUnlocked(true);
44  }
45}

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.