vue-layout-gitcode 1.1.12 → 1.1.13

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.
@@ -208,6 +208,35 @@ const useRequestReport = (request, globalStore) => {
208
208
  useReport: useReport2
209
209
  };
210
210
  };
211
+ const isBrowser$1 = typeof window !== "undefined" && typeof window.localStorage !== "undefined";
212
+ let localStorage$1;
213
+ if (isBrowser$1) {
214
+ localStorage$1 = window.localStorage;
215
+ } else {
216
+ const data = {};
217
+ localStorage$1 = {
218
+ setItem(id, val) {
219
+ data[id] = String(val);
220
+ },
221
+ getItem(id) {
222
+ return Object.prototype.hasOwnProperty.call(data, id) ? data[id] : null;
223
+ },
224
+ removeItem(id) {
225
+ delete data[id];
226
+ },
227
+ clear() {
228
+ Object.keys(data).forEach((key) => delete data[key]);
229
+ },
230
+ get length() {
231
+ return Object.keys(data).length;
232
+ },
233
+ key(index2) {
234
+ const keys2 = Object.keys(data);
235
+ return index2 < keys2.length ? keys2[index2] : null;
236
+ }
237
+ };
238
+ }
239
+ const localStorage$2 = localStorage$1;
211
240
  function generateRandomString(length) {
212
241
  let result2 = "";
213
242
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
@@ -290,7 +319,7 @@ function udeskInit(config = {}) {
290
319
  return;
291
320
  const randomNum = generateRandomString(16);
292
321
  const nowTimeStr = Date.now().toString();
293
- const userInfo = localStorage.getItem("userInfo") || "";
322
+ const userInfo = localStorage$2.getItem("userInfo") || "";
294
323
  const cPhone = userInfo ? (_a = JSON.parse(userInfo)) == null ? void 0 : _a.mobile : "";
295
324
  const cName = userInfo ? (_b = JSON.parse(userInfo)) == null ? void 0 : _b.username : "";
296
325
  const cEmail = userInfo ? (_c = JSON.parse(userInfo)) == null ? void 0 : _c.email : "";
@@ -1407,7 +1436,7 @@ function createDOMPurify() {
1407
1436
  }
1408
1437
  var purify = createDOMPurify();
1409
1438
  const purifyConfig = { FORBID_TAGS: ["img"] };
1410
- if (typeof purify.addHook === "function") {
1439
+ if (typeof purify.addHook === "function" && typeof document !== "undefined" && document.createElement) {
1411
1440
  purify.addHook("uponSanitizeElement", (node, data) => {
1412
1441
  if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(data.tagName)) {
1413
1442
  const tag = document.createElement("span");
@@ -1417,6 +1446,8 @@ if (typeof purify.addHook === "function") {
1417
1446
  });
1418
1447
  }
1419
1448
  function xssPurify(str) {
1449
+ if (typeof window === "undefined")
1450
+ return str;
1420
1451
  return purify.sanitize(str, purifyConfig);
1421
1452
  }
1422
1453
  const highlightWords = (Word, title, inherit) => {
@@ -1890,7 +1921,7 @@ const DOT = ".";
1890
1921
  const LITERAL_DELIMITER = "'";
1891
1922
  const ERROR_DOMAIN$3 = "tokenizer";
1892
1923
  function createTokenizer(source, options = {}) {
1893
- const location2 = options.location !== false;
1924
+ const location = options.location !== false;
1894
1925
  const _scnr = createScanner(source);
1895
1926
  const currentOffset = () => _scnr.index();
1896
1927
  const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index());
@@ -1916,7 +1947,7 @@ function createTokenizer(source, options = {}) {
1916
1947
  pos.column += offset;
1917
1948
  pos.offset += offset;
1918
1949
  if (onError) {
1919
- const loc = location2 ? createLocation(ctx.startLoc, pos) : null;
1950
+ const loc = location ? createLocation(ctx.startLoc, pos) : null;
1920
1951
  const err = createCompileError(code2, loc, {
1921
1952
  domain: ERROR_DOMAIN$3,
1922
1953
  args
@@ -1928,7 +1959,7 @@ function createTokenizer(source, options = {}) {
1928
1959
  context2.endLoc = currentPosition();
1929
1960
  context2.currentType = type;
1930
1961
  const token = { type };
1931
- if (location2) {
1962
+ if (location) {
1932
1963
  token.loc = createLocation(context2.startLoc, context2.endLoc);
1933
1964
  }
1934
1965
  if (value != null) {
@@ -2571,14 +2602,14 @@ function fromEscapeSequence(match, codePoint4, codePoint6) {
2571
2602
  }
2572
2603
  }
2573
2604
  function createParser(options = {}) {
2574
- const location2 = options.location !== false;
2605
+ const location = options.location !== false;
2575
2606
  const { onError, onWarn } = options;
2576
2607
  function emitError(tokenzer, code2, start, offset, ...args) {
2577
2608
  const end = tokenzer.currentPosition();
2578
2609
  end.offset += offset;
2579
2610
  end.column += offset;
2580
2611
  if (onError) {
2581
- const loc = location2 ? createLocation(start, end) : null;
2612
+ const loc = location ? createLocation(start, end) : null;
2582
2613
  const err = createCompileError(code2, loc, {
2583
2614
  domain: ERROR_DOMAIN$2,
2584
2615
  args
@@ -2591,13 +2622,13 @@ function createParser(options = {}) {
2591
2622
  end.offset += offset;
2592
2623
  end.column += offset;
2593
2624
  if (onWarn) {
2594
- const loc = location2 ? createLocation(start, end) : null;
2625
+ const loc = location ? createLocation(start, end) : null;
2595
2626
  onWarn(createCompileWarn(code2, loc, args));
2596
2627
  }
2597
2628
  }
2598
2629
  function startNode(type, offset, loc) {
2599
2630
  const node = { type };
2600
- if (location2) {
2631
+ if (location) {
2601
2632
  node.start = offset;
2602
2633
  node.end = offset;
2603
2634
  node.loc = { start: loc, end: loc };
@@ -2608,7 +2639,7 @@ function createParser(options = {}) {
2608
2639
  if (type) {
2609
2640
  node.type = type;
2610
2641
  }
2611
- if (location2) {
2642
+ if (location) {
2612
2643
  node.end = offset;
2613
2644
  if (node.loc) {
2614
2645
  node.loc.end = pos;
@@ -2831,7 +2862,7 @@ function createParser(options = {}) {
2831
2862
  const tokenizer = createTokenizer(source, assign({}, options));
2832
2863
  const context = tokenizer.context();
2833
2864
  const node = startNode(0, context.offset, context.startLoc);
2834
- if (location2 && node.loc) {
2865
+ if (location && node.loc) {
2835
2866
  node.loc.source = source;
2836
2867
  }
2837
2868
  node.body = parseResource(tokenizer);
@@ -3048,7 +3079,7 @@ function minify(node) {
3048
3079
  const ERROR_DOMAIN = "parser";
3049
3080
  function createCodeGenerator(ast, options) {
3050
3081
  const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;
3051
- const location2 = options.location !== false;
3082
+ const location = options.location !== false;
3052
3083
  const _context = {
3053
3084
  filename,
3054
3085
  code: "",
@@ -3060,7 +3091,7 @@ function createCodeGenerator(ast, options) {
3060
3091
  needIndent: _needIndent,
3061
3092
  indentLevel: 0
3062
3093
  };
3063
- if (location2 && ast.loc) {
3094
+ if (location && ast.loc) {
3064
3095
  _context.source = ast.loc.source;
3065
3096
  }
3066
3097
  const context = () => _context;
@@ -8099,7 +8130,9 @@ function setLocale(i18n2, locale2) {
8099
8130
  }
8100
8131
  }
8101
8132
  function setupI18n(options = { locale: LANG_EN }) {
8102
- document.documentElement.lang = options.locale;
8133
+ if (typeof document !== "undefined" && document.documentElement) {
8134
+ document.documentElement.lang = options.locale;
8135
+ }
8103
8136
  const i18n2 = createI18n(options);
8104
8137
  setI18nLanguage(i18n2, options.locale);
8105
8138
  return i18n2;
@@ -8108,11 +8141,14 @@ function setI18nLanguage(i18n2, locale2) {
8108
8141
  setLocale(i18n2, locale2);
8109
8142
  }
8110
8143
  const getLocaleLang = () => {
8111
- let localLang = localStorage.getItem(LANG_KEY);
8112
- if (location.pathname.startsWith("/ai-copilot")) {
8144
+ let localLang = localStorage$2.getItem(LANG_KEY);
8145
+ if (typeof window !== "undefined" && window.location.pathname.startsWith("/ai-copilot")) {
8113
8146
  localLang = LANG_ZH;
8114
8147
  }
8115
- const navigatorLang = navigator.language.includes(LANG_ZH) ? LANG_ZH : LANG_EN;
8148
+ let navigatorLang = LANG_EN;
8149
+ if (typeof window !== "undefined" && window.navigator) {
8150
+ navigatorLang = window.navigator.language.includes(LANG_ZH) ? LANG_ZH : LANG_EN;
8151
+ }
8116
8152
  const lang = localLang ?? navigatorLang;
8117
8153
  return lang;
8118
8154
  };
@@ -8129,17 +8165,19 @@ const $i18n = setupI18n({
8129
8165
  const i18n = $i18n;
8130
8166
  const layoutConfig$4 = useLayoutConfig();
8131
8167
  function scrollToTop() {
8132
- const c = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
8133
- if (c > 0) {
8134
- window.requestAnimationFrame(scrollToTop);
8135
- window.scrollTo(0, c - c / 8);
8168
+ if (typeof window !== "undefined" && window.pageYOffset) {
8169
+ const c = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
8170
+ if (c > 0) {
8171
+ window.requestAnimationFrame(scrollToTop);
8172
+ window.scrollTo(0, c - c / 8);
8173
+ }
8136
8174
  }
8137
8175
  }
8138
8176
  const handleAvatarRedPoint = (type, other) => {
8139
8177
  if (type === CLICK_TIME_MODULE.GROWTH_CENTER) {
8140
8178
  const dateString = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
8141
- localStorage.setItem(AVATAR_VISITED_DATE, dateString);
8142
- localStorage.setItem(AVATAR_VISITED_USERNAME, other);
8179
+ localStorage$2.setItem(AVATAR_VISITED_DATE, dateString);
8180
+ localStorage$2.setItem(AVATAR_VISITED_USERNAME, other);
8143
8181
  }
8144
8182
  };
8145
8183
  function extractRepoInfoWithURL(repoUrl) {
@@ -8221,7 +8259,7 @@ const getUtmSourceSign = () => {
8221
8259
  };
8222
8260
  function removeIsLoginParam(url) {
8223
8261
  const isAbsolute = url.startsWith("http");
8224
- const fullUrl = isAbsolute ? url : `${location.origin}${url}`;
8262
+ const fullUrl = isAbsolute ? url : `${window.location.origin}${url}`;
8225
8263
  const urlObj = new URL(fullUrl);
8226
8264
  urlObj.searchParams.delete("isLogin");
8227
8265
  return urlObj.toString();
@@ -10651,11 +10689,14 @@ axios.HttpStatusCode = HttpStatusCode$1;
10651
10689
  axios.default = axios;
10652
10690
  const axios$1 = axios;
10653
10691
  function isPhone() {
10654
- const flag = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
10655
- return flag;
10692
+ if (typeof window !== "undefined" && window.navigator) {
10693
+ const flag = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent);
10694
+ return flag;
10695
+ }
10696
+ return false;
10656
10697
  }
10657
10698
  const getDeviceType = () => {
10658
- const userAgent = navigator.userAgent || navigator.vendor || window.opera;
10699
+ const userAgent = (window == null ? void 0 : window.navigator.userAgent) || (window == null ? void 0 : window.navigator.vendor) || (window == null ? void 0 : window.opera);
10659
10700
  if (/iPad/i.test(userAgent)) {
10660
10701
  return "iPadOS";
10661
10702
  } else if (/iPhone/i.test(userAgent)) {
@@ -10732,7 +10773,7 @@ const getOSVersion = () => {
10732
10773
  return version;
10733
10774
  };
10734
10775
  const getNetworkType = () => {
10735
- const connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
10776
+ const connection = (window == null ? void 0 : window.navigator.connection) || (window == null ? void 0 : window.navigator.mozConnection) || (window == null ? void 0 : window.navigator.webkitConnection);
10736
10777
  if (connection) {
10737
10778
  return connection.effectiveType;
10738
10779
  } else {
@@ -10785,7 +10826,7 @@ const proxyService = (params, customConfigs) => {
10785
10826
  service.interceptors.request.use(
10786
10827
  (config) => {
10787
10828
  var _a, _b;
10788
- const access_token = window.localStorage.getItem("access_token");
10829
+ const access_token = localStorage$2.getItem("access_token");
10789
10830
  const { url } = config;
10790
10831
  if (access_token && !notAuthorization(url)) {
10791
10832
  config.headers.Authorization = `Bearer ${access_token}`;
@@ -10930,7 +10971,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10930
10971
  { name: "gt-nps-4", title: t2("gitCodeLayout.home.bad"), index: 3 },
10931
10972
  { name: "gt-nps-5", title: t2("gitCodeLayout.home.veryBad"), index: 4 }
10932
10973
  ];
10933
- const store = localStorage.getItem("spmStatus");
10974
+ const store = localStorage$2.getItem("spmStatus");
10934
10975
  const status = store ? JSON.parse(store) : null;
10935
10976
  if (status !== null) {
10936
10977
  const { nps_global } = status;
@@ -10961,7 +11002,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10961
11002
  window.dispatchEvent(new Event("resize"));
10962
11003
  const nextStatus = status || {};
10963
11004
  nextStatus.nps_global = { expire: Date.now() + 864e5 * 15 };
10964
- localStorage.setItem("spmStatus", JSON.stringify(nextStatus));
11005
+ localStorage$2.setItem("spmStatus", JSON.stringify(nextStatus));
10965
11006
  setTimeout(() => {
10966
11007
  npsPopVisible.value = false;
10967
11008
  }, 500);
@@ -10975,8 +11016,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10975
11016
  return {};
10976
11017
  });
10977
11018
  const fetchAdList = async () => {
10978
- const closeActive = localStorage.getItem("closeActive");
10979
- const closeDate = localStorage.getItem("closeDate");
11019
+ const closeActive = localStorage$2.getItem("closeActive");
11020
+ const closeDate = localStorage$2.getItem("closeDate");
10980
11021
  const nowDate = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
10981
11022
  if (closeActive && closeActive === "1" && closeDate === nowDate) {
10982
11023
  return false;
@@ -10988,7 +11029,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
10988
11029
  fetchAdList();
10989
11030
  const handleLogin = (type) => {
10990
11031
  emitEvent("login", { type, triggerType: activeAdItem.value.title });
10991
- localStorage.setItem("sign_path", location.href);
11032
+ (window == null ? void 0 : window.location.href) && localStorage$2.setItem("sign_path", window == null ? void 0 : window.location.href);
10992
11033
  };
10993
11034
  const handleActive = () => {
10994
11035
  if (activeAdJson.value) {
@@ -11008,14 +11049,16 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
11008
11049
  ad_title: activeAdItem.value.title
11009
11050
  });
11010
11051
  activeAdJson.value = null;
11011
- localStorage.setItem("closeActive", "1");
11052
+ localStorage$2.setItem("closeActive", "1");
11012
11053
  const dateString = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
11013
- localStorage.setItem("closeDate", dateString);
11054
+ localStorage$2.setItem("closeDate", dateString);
11014
11055
  };
11015
11056
  const showScrollToTopBtn = ref(false);
11016
11057
  const handleScroll = () => {
11017
- const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
11018
- showScrollToTopBtn.value = scrollTop > REPO_PAGE_SIZE.HEADERS_HEIGHT + REPO_PAGE_SIZE.REPO_INFO_HEIGHT;
11058
+ if (typeof window !== "undefined" && window.document) {
11059
+ const scrollTop = window.document.documentElement.scrollTop || window.document.body.scrollTop;
11060
+ showScrollToTopBtn.value = scrollTop > REPO_PAGE_SIZE.HEADERS_HEIGHT + REPO_PAGE_SIZE.REPO_INFO_HEIGHT;
11061
+ }
11019
11062
  };
11020
11063
  onMounted(() => {
11021
11064
  if (isModuleVisible(ToolsFloatDisplayItem.ELSE)) {
@@ -11278,9 +11321,9 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
11278
11321
  };
11279
11322
  }
11280
11323
  });
11281
- const index_vue_vue_type_style_index_0_scoped_855bea01_lang = "";
11324
+ const index_vue_vue_type_style_index_0_scoped_1ef34c7b_lang = "";
11282
11325
  const index_vue_vue_type_style_index_1_lang$3 = "";
11283
- const ToolsFloat = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-855bea01"]]);
11326
+ const ToolsFloat = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-1ef34c7b"]]);
11284
11327
  function usePopup(className, rootElement) {
11285
11328
  const root2 = rootElement || document.getElementById("app");
11286
11329
  let cacheClass = "popup-container";
@@ -11823,15 +11866,17 @@ const currentTheme = computed(() => {
11823
11866
  return setThemeVal.value || currentThemeStorage.value || ThemeType.WHITE;
11824
11867
  });
11825
11868
  const setTheme = (theme2) => {
11826
- setThemeVal.value = theme2 || localStorage.getItem("gitcode_theme") || ThemeType.WHITE;
11827
- document.documentElement.setAttribute("data-theme", setThemeVal.value);
11869
+ setThemeVal.value = theme2 || localStorage$2.getItem("gitcode_theme") || ThemeType.WHITE;
11870
+ if (typeof document !== "undefined" && document.documentElement) {
11871
+ document.documentElement.setAttribute("data-theme", setThemeVal.value);
11872
+ }
11828
11873
  };
11829
11874
  class Theme {
11830
11875
  constructor() {
11831
- this.darkModeMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
11876
+ this.darkModeMediaQuery = typeof window !== "undefined" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : { matches: false, onchange: null };
11832
11877
  }
11833
11878
  getIsAutoTheme() {
11834
- return localStorage.getItem("AutoTheme") === "AUTO";
11879
+ return localStorage$2.getItem("AutoTheme") === "AUTO";
11835
11880
  }
11836
11881
  applyTheme() {
11837
11882
  const isAutoTheme = this.getIsAutoTheme();
@@ -11846,7 +11891,7 @@ class Theme {
11846
11891
  }
11847
11892
  }
11848
11893
  initAutoTheme() {
11849
- const defaultTheme = localStorage.getItem("gitcode_theme");
11894
+ const defaultTheme = localStorage$2.getItem("gitcode_theme");
11850
11895
  if (!defaultTheme) {
11851
11896
  this.startAutoTheme();
11852
11897
  return;
@@ -11860,14 +11905,14 @@ class Theme {
11860
11905
  }
11861
11906
  startAutoTheme(isInit = false) {
11862
11907
  if (!isInit) {
11863
- localStorage.setItem("AutoTheme", "AUTO");
11908
+ localStorage$2.setItem("AutoTheme", "AUTO");
11864
11909
  }
11865
11910
  this.darkModeMediaQuery.onchange = () => this.applyTheme();
11866
11911
  this.applyTheme();
11867
11912
  }
11868
11913
  stopAutoTheme(isInit = false) {
11869
11914
  if (!isInit) {
11870
- localStorage.removeItem("AutoTheme");
11915
+ localStorage$2.removeItem("AutoTheme");
11871
11916
  }
11872
11917
  this.darkModeMediaQuery.onchange = null;
11873
11918
  }
@@ -14484,9 +14529,9 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
14484
14529
  };
14485
14530
  }
14486
14531
  });
14487
- const AiHubMenus_vue_vue_type_style_index_0_scoped_8c889f96_lang = "";
14532
+ const AiHubMenus_vue_vue_type_style_index_0_scoped_b21e73c1_lang = "";
14488
14533
  const AiHubMenus_vue_vue_type_style_index_1_lang = "";
14489
- const AiHubMenus = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-8c889f96"]]);
14534
+ const AiHubMenus = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-b21e73c1"]]);
14490
14535
  const _hoisted_1$q = ["src"];
14491
14536
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
14492
14537
  ...{ name: "FlashTag" },
@@ -14511,9 +14556,9 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14511
14556
  return getCNDImageUrl(tagType);
14512
14557
  });
14513
14558
  const handleClick = () => {
14514
- if (props == null ? void 0 : props.href) {
14559
+ if ((props == null ? void 0 : props.href) && typeof window !== "undefined") {
14515
14560
  window.open(props.href, props.target);
14516
- localStorage.setItem("GStarOrigin", props.origin || "home");
14561
+ localStorage$2.setItem("GStarOrigin", props.origin || "home");
14517
14562
  }
14518
14563
  emits("click");
14519
14564
  };
@@ -16466,7 +16511,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
16466
16511
  if (!topicTag.value)
16467
16512
  return;
16468
16513
  const aiUrl = `${layoutConfig2.VITE_AI_HOST}${topicTag.value.linkUrl}`;
16469
- location.href = aiUrl;
16514
+ if (typeof window !== "undefined" && window.location) {
16515
+ window.location.href = aiUrl;
16516
+ }
16470
16517
  };
16471
16518
  const showTimeTopic = computed(() => {
16472
16519
  var _a, _b;
@@ -16734,9 +16781,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
16734
16781
  };
16735
16782
  }
16736
16783
  });
16737
- const HeaderCustom_vue_vue_type_style_index_0_scoped_de0ada08_lang = "";
16784
+ const HeaderCustom_vue_vue_type_style_index_0_scoped_b1bd3db4_lang = "";
16738
16785
  const HeaderCustom_vue_vue_type_style_index_1_lang = "";
16739
- const HeaderCustom = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-de0ada08"]]);
16786
+ const HeaderCustom = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-b1bd3db4"]]);
16740
16787
  const logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAAkCAYAAADrcPSPAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv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+t0i6WysqM64DlAQOlScVzOkcPOVFblDRVER16GtneMpEPKW+li89PpmsnHpc4Iv/jxrPb4QXmQjg2OC1rwSXqCD9UwG0QAP95yvlqdsTw5bBOzBqVOOY84RVHcUpRcpe8qz8Qu3kKxDzgnMeiwkFzgXcwjPxD3KUURfMTJ7vLueqyGeL6SzocHpjK99rc9nzTSBpSLz9pyh4u46vj8k8DsUHv4JPxbf33kN/5V1TmgdbAjECibE32xkbCAc4kFB8KMwXqZHN1fPhAtYuPE51YiTU0nmdmzjUOfgpFNiRzOf8dFG5noJqnGUepBMzEnASZ24I4u85M6mGAlkJehTJ7SSrJHrm0Un2XKd8xKDzU+yPcUJu1mpWawvXgvLcDqO8JOK02RyRw10FievR2cpdYvqLK4MXyPQ2W7B0DAKa1gnIpvtEoSKmfj9Jfzg2qY1m8e4GD2x1F/t2hSxRqlvfSKSosFv7uWcwriRx3vdG5Mj7ijR8qlzIQoCVgeRTBxhmELsUsQ75WKezHOOu15S9PrRTJIiGd8F62XqbKD3ea9lFWUYY8ofu85xiJ2svGs/zSPZMuSEMt7VQd6vqnI+28Pv+XjMudl3su79intlYCXuPmJTpXhE4ZEFcsJM7M1rXHTWfmWArw4oUeIkIjEXsaiRFQPuDwGO97OAXaLE/xNSk329uZGgUWagsen6aefmmdK4SjwIyLVg9GdiDi3vdW7HeO00v4gUV0/q69pKlLgbyL8iC4GhcdZDvn9hpN9JAUA0umiUhlXiQUQhA4uC17eCLHl+aNMTKGgdRb8scr/853slSpQoUeKu4b/VMDt15riwZwAAAABJRU5ErkJggg==";
16741
16788
  const _hoisted_1$o = ["src"];
16742
16789
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
@@ -16795,9 +16842,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
16795
16842
  };
16796
16843
  }
16797
16844
  });
16798
- const index_vue_vue_type_style_index_0_scoped_e4d63444_lang = "";
16799
- const OptionLink = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-e4d63444"]]);
16800
- const index_vue_vue_type_style_index_0_scoped_c3069aa5_lang = "";
16845
+ const index_vue_vue_type_style_index_0_scoped_7712be3b_lang = "";
16846
+ const OptionLink = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-7712be3b"]]);
16847
+ const index_vue_vue_type_style_index_0_scoped_b0e16f5f_lang = "";
16801
16848
  const _sfc_main$r = /* @__PURE__ */ Object.assign({
16802
16849
  name: "Create"
16803
16850
  }, {
@@ -16816,8 +16863,8 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({
16816
16863
  const res = await API.checkUserCreateOrg({ username: user });
16817
16864
  if (!res.error) {
16818
16865
  if (!user) {
16819
- localStorage.setItem("group_quota", (_a = res.data) == null ? void 0 : _a.data.group_quota);
16820
- localStorage.setItem("manageable_group_num", (_b = res.data) == null ? void 0 : _b.data.manageable_group_num);
16866
+ localStorage$2.setItem("group_quota", (_a = res.data) == null ? void 0 : _a.data.group_quota);
16867
+ localStorage$2.setItem("manageable_group_num", (_b = res.data) == null ? void 0 : _b.data.manageable_group_num);
16821
16868
  orgStore.setIsCreateOrg(((_c = res.data) == null ? void 0 : _c.data.group_quota) - ((_d = res.data) == null ? void 0 : _d.data.manageable_group_num) > 0);
16822
16869
  }
16823
16870
  }
@@ -16833,7 +16880,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({
16833
16880
  useRouter();
16834
16881
  const handleClick = async (linkItem, event) => {
16835
16882
  if (linkItem.linkName === `newOrg`) {
16836
- const userInfo = JSON.parse(localStorage.getItem("userInfo") || "{}");
16883
+ const userInfo = JSON.parse(localStorage$2.getItem("userInfo") || "{}");
16837
16884
  const flag = await getUserCreateOrg(userInfo == null ? void 0 : userInfo.username);
16838
16885
  if (!flag) {
16839
16886
  Message.warning($t("gitCodeLayout.userSetting.tips.youCanCreOrManUp", { num: 5 }));
@@ -16889,7 +16936,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign({
16889
16936
  };
16890
16937
  }
16891
16938
  });
16892
- const Create = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-c3069aa5"]]);
16939
+ const Create = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-b0e16f5f"]]);
16893
16940
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
16894
16941
  ...{
16895
16942
  name: "DocumentCenter"
@@ -17214,17 +17261,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17214
17261
  const orgInfo = inject("orgInfo");
17215
17262
  const userInfo = inject("userInfo");
17216
17263
  const { t: t2 } = i18n.global;
17217
- useLocalStorage(LANG_KEY, LANG_ZH);
17218
17264
  const props = __props;
17219
17265
  const router2 = useRouter();
17220
17266
  const route = useRoute();
17221
17267
  const haveVisited = ref(false);
17222
17268
  const clearSurveyDelayStatus = () => {
17223
- const surveyDelay = localStorage.getItem(HARMONY_VISITED_DATE);
17269
+ const surveyDelay = localStorage$2.getItem(HARMONY_VISITED_DATE);
17224
17270
  if (surveyDelay === "true") {
17225
- localStorage.removeItem(HARMONY_VISITED_DATE);
17271
+ localStorage$2.removeItem(HARMONY_VISITED_DATE);
17226
17272
  }
17227
- localStorage.removeItem(HARMONY_SURVEY_DELAY);
17273
+ localStorage$2.removeItem(HARMONY_SURVEY_DELAY);
17228
17274
  };
17229
17275
  const logout = async () => {
17230
17276
  var _a, _b;
@@ -17237,7 +17283,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17237
17283
  } else {
17238
17284
  const $route = Object.assign({}, route);
17239
17285
  delete $route.query.isLogin;
17240
- location.href = router2.resolve($route).href;
17286
+ if (typeof window !== "undefined" && window.location) {
17287
+ window.location.href = router2.resolve($route).href;
17288
+ }
17241
17289
  }
17242
17290
  } else {
17243
17291
  props.loginOutFinish && props.loginOutFinish();
@@ -17312,9 +17360,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17312
17360
  }
17313
17361
  }
17314
17362
  const getVisit = async (value) => {
17315
- const visitedDate = value || localStorage.getItem(AVATAR_VISITED_DATE);
17363
+ const visitedDate = value || localStorage$2.getItem(AVATAR_VISITED_DATE);
17316
17364
  const nowDate = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
17317
- const nowUserName = localStorage.getItem(AVATAR_VISITED_USERNAME);
17365
+ const nowUserName = localStorage$2.getItem(AVATAR_VISITED_USERNAME);
17318
17366
  if (visitedDate === nowDate && nowUserName === props.accountInfo.username) {
17319
17367
  haveVisited.value = true;
17320
17368
  }
@@ -17385,8 +17433,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17385
17433
  };
17386
17434
  }
17387
17435
  });
17388
- const UserAvatarMenu_vue_vue_type_style_index_0_scoped_1280ec07_lang = "";
17389
- const UserAvatarMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-1280ec07"]]);
17436
+ const UserAvatarMenu_vue_vue_type_style_index_0_scoped_f5353edc_lang = "";
17437
+ const UserAvatarMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-f5353edc"]]);
17390
17438
  const _hoisted_1$k = { class: "g-user-avatar flex-center ml-1" };
17391
17439
  const _hoisted_2$e = {
17392
17440
  key: 0,
@@ -17404,7 +17452,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
17404
17452
  accountInfo.value = inject("userInfo");
17405
17453
  if (!accountInfo.value.avatar) {
17406
17454
  console.log("accountInfo", accountInfo.value.avatar);
17407
- accountInfo.value = JSON.parse(localStorage.getItem("userInfo") || "{}");
17455
+ accountInfo.value = JSON.parse(localStorage$2.getItem("userInfo") || "{}");
17408
17456
  }
17409
17457
  console.log("accountInfo", accountInfo.value.avatar);
17410
17458
  const haveVisited = ref(false);
@@ -17430,25 +17478,31 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
17430
17478
  handleAvatarRedPoint(CLICK_TIME_MODULE.GROWTH_CENTER, accountInfo.value.username);
17431
17479
  };
17432
17480
  const getVisit = async (value) => {
17433
- const visitedDate = value || localStorage.getItem(AVATAR_VISITED_DATE);
17481
+ const visitedDate = value || localStorage$2.getItem(AVATAR_VISITED_DATE);
17434
17482
  const nowDate = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
17435
- const nowUserName = localStorage.getItem(AVATAR_VISITED_USERNAME);
17483
+ const nowUserName = localStorage$2.getItem(AVATAR_VISITED_USERNAME);
17436
17484
  if (visitedDate === nowDate && nowUserName === accountInfo.value.username) {
17437
17485
  haveVisited.value = true;
17438
17486
  }
17439
17487
  };
17440
- getVisit();
17488
+ getVisit("");
17441
17489
  const getScrollDom = () => {
17442
- const appDom = document.getElementById("app");
17443
- return appDom;
17490
+ if (typeof document !== "undefined" && document.getElementById) {
17491
+ const appDom = document.getElementById("app");
17492
+ return appDom;
17493
+ }
17494
+ return null;
17444
17495
  };
17445
17496
  const judgeDrawerScroll = () => {
17446
17497
  var _a;
17447
- const userDrawerWarpDom = (_a = document.querySelector(".g-user-dropdown")) == null ? void 0 : _a.querySelector(".devui-dropdown__menu-wrap");
17448
- if (!userDrawerWarpDom) {
17449
- return false;
17498
+ if (typeof document !== "undefined" && document.querySelector) {
17499
+ const userDrawerWarpDom = (_a = document.querySelector(".g-user-dropdown")) == null ? void 0 : _a.querySelector(".devui-dropdown__menu-wrap");
17500
+ if (!userDrawerWarpDom) {
17501
+ return false;
17502
+ }
17503
+ return userDrawerWarpDom.scrollHeight > userDrawerWarpDom.clientHeight;
17450
17504
  }
17451
- return userDrawerWarpDom.scrollHeight > userDrawerWarpDom.clientHeight;
17505
+ return false;
17452
17506
  };
17453
17507
  const handleDrawerStatus = (status) => {
17454
17508
  const appDom = getScrollDom();
@@ -17500,9 +17554,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
17500
17554
  };
17501
17555
  }
17502
17556
  });
17503
- const UserAvatar_vue_vue_type_style_index_0_scoped_975139cd_lang = "";
17557
+ const UserAvatar_vue_vue_type_style_index_0_scoped_11438075_lang = "";
17504
17558
  const UserAvatar_vue_vue_type_style_index_1_lang = "";
17505
- const UserAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-975139cd"]]);
17559
+ const UserAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-11438075"]]);
17506
17560
  var EVENT_NAME = /* @__PURE__ */ ((EVENT_NAME2) => {
17507
17561
  EVENT_NAME2["START_SEARCH"] = "开始搜索";
17508
17562
  EVENT_NAME2["SEARCH"] = "搜索";
@@ -17562,7 +17616,7 @@ function _frEventTrack(eventName, type = "custom") {
17562
17616
  }
17563
17617
  const setlocalVistHistory = (data, localType) => {
17564
17618
  const storeName = localType || "localVistList";
17565
- const localData = window.localStorage.getItem(storeName);
17619
+ const localData = localStorage$2.getItem(storeName);
17566
17620
  let cur = [];
17567
17621
  if (localData) {
17568
17622
  try {
@@ -17592,7 +17646,7 @@ const setlocalVistHistory = (data, localType) => {
17592
17646
  const isLocalSearch = localType === "localSearchText";
17593
17647
  const storageCount = isLocalSearch ? 10 : 5;
17594
17648
  cur.splice(storageCount);
17595
- window.localStorage.setItem(storeName, JSON.stringify(cur));
17649
+ localStorage$2.setItem(storeName, JSON.stringify(cur));
17596
17650
  return cur;
17597
17651
  };
17598
17652
  var repoTypeEnum = /* @__PURE__ */ ((repoTypeEnum2) => {
@@ -17672,13 +17726,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17672
17726
  setup(__props) {
17673
17727
  var _a;
17674
17728
  const { t: $t } = i18n.global;
17675
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-8104467a.js"));
17676
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-1126b1cd.js"));
17677
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-cf6e2dea.js"));
17678
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-8b663180.js"));
17679
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-821d94d3.js"));
17680
- const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-f873b07a.js"));
17681
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-bbe069d5.js"));
17729
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-5cf60f4e.js"));
17730
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-c21145bd.js"));
17731
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-467e80d4.js"));
17732
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-126f6acd.js"));
17733
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-68765536.js"));
17734
+ const SearchPrefixTag = defineAsyncComponent(() => import("./SearchPrefixTag-81a098a9.js"));
17735
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-b33b0da9.js"));
17682
17736
  const props = __props;
17683
17737
  const repoInfo = inject("repoInfo");
17684
17738
  const orgInfo = inject("orgInfo");
@@ -17803,7 +17857,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17803
17857
  }
17804
17858
  return [{ title: $t("gitCodeLayout.header.platformSearch") }];
17805
17859
  });
17806
- let localSearchText = localStorage.getItem("localSearchText");
17860
+ let localSearchText = localStorage$2.getItem("localSearchText");
17807
17861
  if (localSearchText) {
17808
17862
  try {
17809
17863
  localSearchText = JSON.parse(localSearchText).splice(0, 3);
@@ -17811,7 +17865,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17811
17865
  console.error(e);
17812
17866
  }
17813
17867
  }
17814
- let localVistList = localStorage.getItem("localVistList");
17868
+ let localVistList = localStorage$2.getItem("localVistList");
17815
17869
  if (localVistList) {
17816
17870
  try {
17817
17871
  localVistList = JSON.parse(localVistList);
@@ -17871,7 +17925,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17871
17925
  isFocus.value = false;
17872
17926
  inputRef.value.blur();
17873
17927
  searchDropDownVisible.value = false;
17874
- if (!searchStr.value && !searchParams.q) {
17928
+ if (!searchStr.value && !searchParams.q && typeof document !== "undefined" && document.querySelector) {
17875
17929
  (_a2 = document.querySelector("#golbalSearch")) == null ? void 0 : _a2.blur();
17876
17930
  return;
17877
17931
  }
@@ -17930,7 +17984,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17930
17984
  var _a2;
17931
17985
  if (isFocus.value) {
17932
17986
  searchDropDownVisible.value = true;
17933
- (_a2 = document.querySelector(".custom-h-searchinput input")) == null ? void 0 : _a2.focus();
17987
+ if (typeof document !== "undefined" && document.querySelector) {
17988
+ (_a2 = document.querySelector(".custom-h-searchinput input")) == null ? void 0 : _a2.focus();
17989
+ }
17934
17990
  }
17935
17991
  }, 300);
17936
17992
  };
@@ -17956,15 +18012,15 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17956
18012
  };
17957
18013
  const clearHistoryData = () => {
17958
18014
  searchHistoryList.value = [];
17959
- window.localStorage.setItem("localSearchText", JSON.stringify([]));
18015
+ localStorage$2.setItem("localSearchText", JSON.stringify([]));
17960
18016
  };
17961
18017
  const onDeleteHistory = (index2) => {
17962
18018
  searchHistoryList.value.splice(index2, 1);
17963
- window.localStorage.setItem("localSearchText", JSON.stringify(searchHistoryList.value));
18019
+ localStorage$2.setItem("localSearchText", JSON.stringify(searchHistoryList.value));
17964
18020
  };
17965
18021
  const onDeleteVist = (index2) => {
17966
18022
  visitHistoryList.value.splice(index2, 1);
17967
- window.localStorage.setItem("localVistList", JSON.stringify(visitHistoryList.value));
18023
+ localStorage$2.setItem("localVistList", JSON.stringify(visitHistoryList.value));
17968
18024
  };
17969
18025
  const onVistPage = (data) => {
17970
18026
  const url = `${window.location.origin}${data.path}`;
@@ -17977,8 +18033,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
17977
18033
  activeIndex.value = -1;
17978
18034
  };
17979
18035
  useEventListener(document, "keydown", (e) => {
17980
- if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") {
17981
- return;
18036
+ if (typeof document !== "undefined" && document.activeElement) {
18037
+ if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") {
18038
+ return;
18039
+ }
17982
18040
  }
17983
18041
  if (e.key === "/" && !isFocus.value) {
17984
18042
  onInputClick();
@@ -18193,13 +18251,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
18193
18251
  };
18194
18252
  }
18195
18253
  });
18196
- const index_vue_vue_type_style_index_0_scoped_274b2f03_lang = "";
18254
+ const index_vue_vue_type_style_index_0_scoped_3074798a_lang = "";
18197
18255
  const index_vue_vue_type_style_index_1_lang$2 = "";
18198
- const Search = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-274b2f03"]]);
18199
- const NoticeModal = defineAsyncComponent(() => import("./notice-69ef6dc2.js"));
18256
+ const Search = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-3074798a"]]);
18257
+ const NoticeModal = defineAsyncComponent(() => import("./notice-fe8afb5d.js"));
18200
18258
  function clearNotice() {
18201
- if (localStorage.getItem("validator_email")) {
18202
- localStorage.removeItem("validator_email");
18259
+ if (localStorage$2.getItem("validator_email")) {
18260
+ localStorage$2.removeItem("validator_email");
18203
18261
  }
18204
18262
  }
18205
18263
  function useNotification() {
@@ -18344,21 +18402,21 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
18344
18402
  });
18345
18403
  const handleLogin = (type) => {
18346
18404
  emitEvent("login", { type, triggerType: "主动注册" });
18347
- localStorage.setItem("sign_path", location.href);
18405
+ localStorage$2.setItem("sign_path", (window == null ? void 0 : window.location.href) || "");
18348
18406
  };
18349
18407
  const { notice } = useNotification();
18350
18408
  const status = ref(false);
18351
18409
  const { login, isMounted } = useLogin(props.request);
18352
18410
  const { t: t2 } = i18n.global;
18353
18411
  const toNotice = () => {
18354
- if (localStorage.getItem("validator_email") === "invalid") {
18412
+ if (localStorage$2.getItem("validator_email") === "invalid") {
18355
18413
  notice();
18356
18414
  }
18357
18415
  };
18358
18416
  onMounted(() => {
18359
18417
  toNotice();
18360
18418
  addEventListener("logout", (options) => {
18361
- const token = localStorage.getItem("access_token");
18419
+ const token = localStorage$2.getItem("access_token");
18362
18420
  if (!status.value) {
18363
18421
  status.value = true;
18364
18422
  if (isMounted()) {
@@ -18536,8 +18594,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
18536
18594
  };
18537
18595
  }
18538
18596
  });
18539
- const index_vue_vue_type_style_index_0_scoped_9ee1402d_lang = "";
18540
- const GitCodeHeader = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-9ee1402d"]]);
18597
+ const index_vue_vue_type_style_index_0_scoped_7f0c99aa_lang = "";
18598
+ const GitCodeHeader = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-7f0c99aa"]]);
18541
18599
  const createSetting = () => {
18542
18600
  const { t: t2 } = i18n.global;
18543
18601
  const settings = {
@@ -18557,6 +18615,35 @@ const createSetting = () => {
18557
18615
  };
18558
18616
  return settings;
18559
18617
  };
18618
+ const isBrowser = typeof window !== "undefined" && typeof window.sessionStorage !== "undefined";
18619
+ let sessionStorage;
18620
+ if (isBrowser) {
18621
+ sessionStorage = window.sessionStorage;
18622
+ } else {
18623
+ const data = {};
18624
+ sessionStorage = {
18625
+ setItem(id, val) {
18626
+ data[id] = String(val);
18627
+ },
18628
+ getItem(id) {
18629
+ return Object.prototype.hasOwnProperty.call(data, id) ? data[id] : null;
18630
+ },
18631
+ removeItem(id) {
18632
+ delete data[id];
18633
+ },
18634
+ clear() {
18635
+ Object.keys(data).forEach((key) => delete data[key]);
18636
+ },
18637
+ get length() {
18638
+ return Object.keys(data).length;
18639
+ },
18640
+ key(index2) {
18641
+ const keys2 = Object.keys(data);
18642
+ return index2 < keys2.length ? keys2[index2] : null;
18643
+ }
18644
+ };
18645
+ }
18646
+ const sessionStorage$1 = sessionStorage;
18560
18647
  const _hoisted_1$h = { class: "tools-item-wrapper" };
18561
18648
  const _hoisted_2$b = { class: "tools-item-wrapper-checkbox" };
18562
18649
  const _hoisted_3$8 = ["onClick", "title"];
@@ -18573,7 +18660,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
18573
18660
  lang.value = linkItem.value;
18574
18661
  const isHomePage = router2.currentRoute.value.name === "home";
18575
18662
  if (isHomePage) {
18576
- sessionStorage.setItem("page_reload", "changedLang");
18663
+ sessionStorage$1.setItem("page_reload", "changedLang");
18577
18664
  }
18578
18665
  window.location.reload();
18579
18666
  };
@@ -18629,7 +18716,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
18629
18716
  } else {
18630
18717
  theme.stopAutoTheme();
18631
18718
  }
18632
- localStorage.setItem(THEME_KEY, themeItem.value);
18719
+ localStorage$2.setItem(THEME_KEY, themeItem.value);
18633
18720
  setTheme(activeTheme.value);
18634
18721
  };
18635
18722
  return (_ctx, _cache) => {
@@ -19068,9 +19155,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
19068
19155
  };
19069
19156
  }
19070
19157
  });
19071
- const ProjectMenuList_vue_vue_type_style_index_0_scoped_6b68ebf7_lang = "";
19158
+ const ProjectMenuList_vue_vue_type_style_index_0_scoped_78f758d1_lang = "";
19072
19159
  const ProjectMenuList_vue_vue_type_style_index_1_lang = "";
19073
- const ProjectMenuList = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-6b68ebf7"]]);
19160
+ const ProjectMenuList = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-78f758d1"]]);
19074
19161
  const _hoisted_1$e = { class: "side-bar-label" };
19075
19162
  const _hoisted_2$8 = {
19076
19163
  key: 0,
@@ -19120,6 +19207,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19120
19207
  isLogin: { type: Boolean, default: false },
19121
19208
  asideDefaultWidth: { default: 240 },
19122
19209
  asideSetShowLittle: { type: Boolean, default: false },
19210
+ independence: { type: Boolean, default: false },
19123
19211
  showPreferencesSetting: { type: Boolean },
19124
19212
  showThemeSetting: { type: Boolean },
19125
19213
  showLangSetting: { type: Boolean }
@@ -19158,7 +19246,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19158
19246
  const isModuleVisible = (auth) => {
19159
19247
  return visibleItems.value.includes(auth);
19160
19248
  };
19161
- const username = computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage.getItem("userInfo") || "{}").username);
19249
+ const username = computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage$2.getItem("userInfo") || "{}").username);
19162
19250
  const showPreferencesSetting = computed(() => {
19163
19251
  if (props.showPreferencesSetting !== void 0)
19164
19252
  return !props.asideSetShowLittle && props.showPreferencesSetting;
@@ -19189,8 +19277,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19189
19277
  label: t2("gitCodeLayout.header.home"),
19190
19278
  host: layoutConfig2.VITE_HOST,
19191
19279
  // 跳转的域名
19192
- route: { name: "home", microApp: HOMEWEB_APP_NAME }
19280
+ route: props.independence ? "" : { name: "home", microApp: HOMEWEB_APP_NAME },
19193
19281
  // 跳转的路径
19282
+ href: `${layoutConfig2.VITE_HOST}`
19194
19283
  },
19195
19284
  {
19196
19285
  key: "issues",
@@ -19198,7 +19287,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19198
19287
  activeIcon: "gt-plane-issues-2",
19199
19288
  label: "Issues",
19200
19289
  host: layoutConfig2.VITE_HOST,
19201
- route: { name: "issues", login: true }
19290
+ route: props.independence ? "" : { name: "issues", login: true },
19291
+ href: `${layoutConfig2.VITE_HOST}/issues`
19202
19292
  },
19203
19293
  {
19204
19294
  key: "merge",
@@ -19206,7 +19296,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19206
19296
  activeIcon: "gt-plane-pullRequest-2",
19207
19297
  label: props.asideSetShowLittle ? "PR" : "Pull Requests",
19208
19298
  host: layoutConfig2.VITE_HOST,
19209
- route: { name: "merge", login: true }
19299
+ route: props.independence ? "" : { name: "merge", login: true },
19300
+ href: `${layoutConfig2.VITE_HOST}/pulls`
19210
19301
  },
19211
19302
  {
19212
19303
  key: "kanban",
@@ -19215,9 +19306,10 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19215
19306
  label: t2("gitCodeLayout.org.board"),
19216
19307
  host: layoutConfig2.VITE_HOST,
19217
19308
  // 跳转的域名
19218
- route: { name: "kanban", login: true },
19309
+ route: props.independence ? "" : { name: "kanban", login: true },
19219
19310
  // 跳转的路径
19220
- hidden: isMobile.value
19311
+ hidden: isMobile.value,
19312
+ href: `${layoutConfig2.VITE_HOST}/kanban`
19221
19313
  },
19222
19314
  {
19223
19315
  key: "discussionCreated",
@@ -19225,7 +19317,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19225
19317
  activeIcon: "gt-plane-discussions-2",
19226
19318
  label: t2("gitCodeLayout.repo.pr.discussion"),
19227
19319
  host: layoutConfig2.VITE_HOST,
19228
- route: { name: "discussionCreated", login: true }
19320
+ route: props.independence ? "" : { name: "discussionCreated", login: true },
19321
+ href: `${layoutConfig2.VITE_HOST}/discussion`
19229
19322
  }
19230
19323
  // {
19231
19324
  // key: 'userFollowing',
@@ -19663,9 +19756,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
19663
19756
  };
19664
19757
  }
19665
19758
  });
19666
- const asideContent_vue_vue_type_style_index_0_scoped_005ddc7b_lang = "";
19759
+ const asideContent_vue_vue_type_style_index_0_scoped_76d7f3fb_lang = "";
19667
19760
  const asideContent_vue_vue_type_style_index_1_lang = "";
19668
- const AsideContent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-005ddc7b"]]);
19761
+ const AsideContent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-76d7f3fb"]]);
19669
19762
  const _hoisted_1$d = { class: "p-[16px] flex justify-between items-center h-[60px]" };
19670
19763
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
19671
19764
  __name: "index",
@@ -19678,6 +19771,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19678
19771
  globalStore: { default: () => ({
19679
19772
  httpStatus: 200
19680
19773
  }) },
19774
+ independence: { type: Boolean, default: false },
19681
19775
  showPreferencesSetting: { type: Boolean, default: void 0 },
19682
19776
  showThemeSetting: { type: Boolean, default: void 0 },
19683
19777
  showLangSetting: { type: Boolean, default: void 0 }
@@ -19752,8 +19846,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19752
19846
  isLogin: _ctx.isLogin,
19753
19847
  showPreferencesSetting: _ctx.showPreferencesSetting,
19754
19848
  showThemeSetting: _ctx.showThemeSetting,
19755
- showLangSetting: _ctx.showLangSetting
19756
- }, null, 8, ["sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting"])) : createCommentVNode("", true)
19849
+ showLangSetting: _ctx.showLangSetting,
19850
+ independence: _ctx.independence
19851
+ }, null, 8, ["sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence"])) : createCommentVNode("", true)
19757
19852
  ]),
19758
19853
  _: 1
19759
19854
  }, 8, ["class", "style"])) : createCommentVNode("", true),
@@ -19787,8 +19882,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19787
19882
  showPreferencesSetting: _ctx.showPreferencesSetting,
19788
19883
  showThemeSetting: _ctx.showThemeSetting,
19789
19884
  showLangSetting: _ctx.showLangSetting,
19885
+ independence: _ctx.independence,
19790
19886
  style: { "height": "calc(100% - 60px)", "padding-top": "0" }
19791
- }, null, 8, ["sceneValue", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting"])) : createCommentVNode("", true)
19887
+ }, null, 8, ["sceneValue", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence"])) : createCommentVNode("", true)
19792
19888
  ]),
19793
19889
  _: 1
19794
19890
  }, 8, ["modelValue"])
@@ -19796,9 +19892,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
19796
19892
  };
19797
19893
  }
19798
19894
  });
19799
- const index_vue_vue_type_style_index_0_scoped_d4e2262d_lang = "";
19895
+ const index_vue_vue_type_style_index_0_scoped_db4c58e3_lang = "";
19800
19896
  const index_vue_vue_type_style_index_1_lang$1 = "";
19801
- const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-d4e2262d"]]);
19897
+ const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-db4c58e3"]]);
19802
19898
  const repoInfoData = {
19803
19899
  "star_count": 0,
19804
19900
  "forks_count": 0,
@@ -20321,17 +20417,17 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
20321
20417
  const loginSuccess = (data) => {
20322
20418
  isLogin.value = true;
20323
20419
  const { access_token, refresh_token, xauth_token, ...userInfo2 } = data;
20324
- localStorage.setItem("access_token", access_token);
20325
- localStorage.setItem("refresh_token", refresh_token);
20326
- localStorage.setItem("xauth_token", xauth_token);
20327
- localStorage.setItem("userInfo", JSON.stringify(userInfo2));
20420
+ localStorage$2.setItem("access_token", access_token);
20421
+ localStorage$2.setItem("refresh_token", refresh_token);
20422
+ localStorage$2.setItem("xauth_token", xauth_token);
20423
+ localStorage$2.setItem("userInfo", JSON.stringify(userInfo2));
20328
20424
  };
20329
20425
  const loginOutFinish = () => {
20330
20426
  isLogin.value = false;
20331
- localStorage.removeItem("access_token");
20332
- localStorage.removeItem("refresh_token");
20333
- localStorage.removeItem("xauth_token");
20334
- localStorage.removeItem("userInfo");
20427
+ localStorage$2.removeItem("access_token");
20428
+ localStorage$2.removeItem("refresh_token");
20429
+ localStorage$2.removeItem("xauth_token");
20430
+ localStorage$2.removeItem("userInfo");
20335
20431
  };
20336
20432
  const sceneSelected = ref(SceneValue.home);
20337
20433
  const independence = ref(false);
@@ -20373,7 +20469,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
20373
20469
  httpStatus: 200
20374
20470
  });
20375
20471
  onMounted(() => {
20376
- const userInfo2 = localStorage.getItem("userInfo");
20472
+ const userInfo2 = localStorage$2.getItem("userInfo");
20377
20473
  if (userInfo2) {
20378
20474
  isLogin.value = true;
20379
20475
  }
@@ -20405,8 +20501,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
20405
20501
  userInfo: userInfo.value,
20406
20502
  isLogin: isLogin.value,
20407
20503
  request: unref(proxyService),
20408
- globalStore: globalStore.value
20409
- }, null, 8, ["sceneValue", "userInfo", "isLogin", "request", "globalStore"])
20504
+ globalStore: globalStore.value,
20505
+ independence: independence.value
20506
+ }, null, 8, ["sceneValue", "userInfo", "isLogin", "request", "globalStore", "independence"])
20410
20507
  ]),
20411
20508
  createElementVNode("div", _hoisted_4$3, [
20412
20509
  _cache[4] || (_cache[4] = createElementVNode("h1", null, "控制 Header 值传入", -1)),
@@ -20484,23 +20581,23 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
20484
20581
  const loginSuccess = (data) => {
20485
20582
  isLogin.value = true;
20486
20583
  const { access_token, refresh_token, xauth_token, ...userInfo } = data;
20487
- localStorage.setItem("access_token", access_token);
20488
- localStorage.setItem("refresh_token", refresh_token);
20489
- localStorage.setItem("xauth_token", xauth_token);
20490
- localStorage.setItem("userInfo", JSON.stringify(userInfo));
20584
+ localStorage$2.setItem("access_token", access_token);
20585
+ localStorage$2.setItem("refresh_token", refresh_token);
20586
+ localStorage$2.setItem("xauth_token", xauth_token);
20587
+ localStorage$2.setItem("userInfo", JSON.stringify(userInfo));
20491
20588
  };
20492
20589
  const loginOutFinish = () => {
20493
20590
  isLogin.value = false;
20494
- localStorage.removeItem("access_token");
20495
- localStorage.removeItem("refresh_token");
20496
- localStorage.removeItem("xauth_token");
20497
- localStorage.removeItem("userInfo");
20591
+ localStorage$2.removeItem("access_token");
20592
+ localStorage$2.removeItem("refresh_token");
20593
+ localStorage$2.removeItem("xauth_token");
20594
+ localStorage$2.removeItem("userInfo");
20498
20595
  };
20499
20596
  const globalStore = ref({
20500
20597
  httpStatus: 200
20501
20598
  });
20502
20599
  onMounted(() => {
20503
- const userInfo = localStorage.getItem("userInfo");
20600
+ const userInfo = localStorage$2.getItem("userInfo");
20504
20601
  if (userInfo) {
20505
20602
  isLogin.value = true;
20506
20603
  }
@@ -20590,24 +20687,24 @@ async function csdnloginCheck(route, loginCallback, request) {
20590
20687
  if ((_a = route == null ? void 0 : route.query) == null ? void 0 : _a.utm_source) {
20591
20688
  setUtmSourceSign(((_b = route == null ? void 0 : route.query) == null ? void 0 : _b.utm_source) || "");
20592
20689
  }
20593
- if (((_c = route == null ? void 0 : route.query) == null ? void 0 : _c.isLogin) && !localStorage.getItem("access_token")) {
20594
- const cache_timeStamp = Number(localStorage.getItem("cache_timeStamp") || 0);
20595
- let loginTimes = Number(localStorage.getItem("cache_loginTimes") || 0);
20690
+ if (((_c = route == null ? void 0 : route.query) == null ? void 0 : _c.isLogin) && !localStorage$2.getItem("access_token")) {
20691
+ const cache_timeStamp = Number(localStorage$2.getItem("cache_timeStamp") || 0);
20692
+ let loginTimes = Number(localStorage$2.getItem("cache_loginTimes") || 0);
20596
20693
  const loginList = ["88", "99", "always"];
20597
20694
  const nowDate = (/* @__PURE__ */ new Date()).toLocaleDateString("zh-CN");
20598
20695
  const targetDate = new Date(cache_timeStamp).toLocaleDateString("zh-CN");
20599
20696
  const isToDay = nowDate === targetDate;
20600
20697
  if (!isToDay) {
20601
- localStorage.setItem("cache_loginTimes", `0`);
20602
- loginTimes = Number(localStorage.getItem("cache_loginTimes") || 0);
20698
+ localStorage$2.setItem("cache_loginTimes", `0`);
20699
+ loginTimes = Number(localStorage$2.getItem("cache_loginTimes") || 0);
20603
20700
  }
20604
20701
  if (loginList.includes((_d = route == null ? void 0 : route.query) == null ? void 0 : _d.isLogin) || !cache_timeStamp || (!isToDay || isToDay && loginTimes < 3 && ((_e = route == null ? void 0 : route.query) == null ? void 0 : _e.isLogin) === "1")) {
20605
20702
  const currentTimestamp = Date.now();
20606
- localStorage.setItem("cache_timeStamp", currentTimestamp.toString());
20607
- localStorage.setItem("cache_loginTimes", `${Number(loginTimes) + 1}`);
20703
+ localStorage$2.setItem("cache_timeStamp", currentTimestamp.toString());
20704
+ localStorage$2.setItem("cache_loginTimes", `${Number(loginTimes) + 1}`);
20608
20705
  window.page_title = ((_f = route.meta) == null ? void 0 : _f.reportTitle) || "";
20609
20706
  await useReport("pageview", {}, request);
20610
- sessionStorage.setItem(GOTO_QUICK_LOGIN, "1");
20707
+ sessionStorage$1.setItem(GOTO_QUICK_LOGIN, "1");
20611
20708
  loginCallback();
20612
20709
  return true;
20613
20710
  }
@@ -20698,7 +20795,7 @@ const createLoginConfig = (request) => {
20698
20795
  async beforeCsdnQuickLogin(param) {
20699
20796
  const { route } = param;
20700
20797
  const loginCallback = () => {
20701
- saveLoginReturnUrl(location.href);
20798
+ saveLoginReturnUrl((window == null ? void 0 : window.location.href) || "");
20702
20799
  saveSignPath();
20703
20800
  goAuthPage(AuthTypeEnum.CSDN, true);
20704
20801
  };
@@ -20742,7 +20839,7 @@ const createLoginConfig = (request) => {
20742
20839
  };
20743
20840
  function saveStatusBeforeLogin(param) {
20744
20841
  const { triggerType, needRedirect } = param;
20745
- localStorage.removeItem(UTM_SOURCE);
20842
+ localStorage$2.removeItem(UTM_SOURCE);
20746
20843
  if (needRedirect) {
20747
20844
  saveLoginReturnUrl();
20748
20845
  }
@@ -20751,22 +20848,22 @@ function saveStatusBeforeLogin(param) {
20751
20848
  }
20752
20849
  function saveLoginReturnUrl(url = "") {
20753
20850
  const returnUrl = url || router.currentRoute.value.query.returnUrl || "";
20754
- localStorage.setItem("loginReturnUrl", returnUrl);
20851
+ localStorage$2.setItem("loginReturnUrl", returnUrl);
20755
20852
  }
20756
20853
  function saveSignPath() {
20757
- localStorage.setItem("sign_path", location.href);
20854
+ localStorage$2.setItem("sign_path", (window == null ? void 0 : window.location.href) || "");
20758
20855
  }
20759
20856
  function saveLoginType(triggerType = "") {
20760
- sessionStorage.setItem("loginType", triggerType);
20857
+ sessionStorage$1.setItem("loginType", triggerType);
20761
20858
  }
20762
20859
  function getLoginReturnUrl() {
20763
- return api.get("third_utm_source_sign_path") || localStorage.getItem("loginReturnUrl") || "/";
20860
+ return api.get("third_utm_source_sign_path") || localStorage$2.getItem("loginReturnUrl") || "/";
20764
20861
  }
20765
20862
  function setEmailValid(username, email) {
20766
20863
  if (`${username}@gitcode.com` === email) {
20767
- localStorage.setItem("validator_email", "invalid");
20864
+ localStorage$2.setItem("validator_email", "invalid");
20768
20865
  } else {
20769
- localStorage.setItem("validator_email", "valid");
20866
+ localStorage$2.setItem("validator_email", "valid");
20770
20867
  }
20771
20868
  }
20772
20869
  function goAuthPage(type, noOpen = false) {
@@ -20776,7 +20873,7 @@ function goAuthPage(type, noOpen = false) {
20776
20873
  url = `${url}${utm_source}`;
20777
20874
  }
20778
20875
  if (isPhone() || noOpen) {
20779
- location.href = url;
20876
+ window.location.href = url;
20780
20877
  } else {
20781
20878
  const windowFeatures = computeWindowFeatures();
20782
20879
  window.open(url, AUTH_WINDOW, windowFeatures);
@@ -20812,8 +20909,8 @@ async function checkProjectIssuePrInfo(API) {
20812
20909
  const res = await API.getProjectIssuePrInfo();
20813
20910
  const { created_issue, created_pr, created_project } = res.data.data || {};
20814
20911
  const haveRepositoryInfo = created_issue || created_pr || created_project;
20815
- localStorage.setItem("project_issue_pr_info", haveRepositoryInfo);
20816
- localStorage.setItem("project_issue_pr_info_time", (/* @__PURE__ */ new Date()).getTime().toString());
20912
+ localStorage$2.setItem("project_issue_pr_info", haveRepositoryInfo);
20913
+ localStorage$2.setItem("project_issue_pr_info_time", (/* @__PURE__ */ new Date()).getTime().toString());
20817
20914
  return haveRepositoryInfo;
20818
20915
  }
20819
20916
  async function checkUserRepositoryIssue(API) {
@@ -20908,11 +21005,13 @@ function failResolve(params) {
20908
21005
  defaultBackResolve(returnUrl);
20909
21006
  }
20910
21007
  function removeStatusAfterLogin() {
20911
- localStorage.removeItem("loginReturnUrl");
21008
+ localStorage$2.removeItem("loginReturnUrl");
20912
21009
  api.set("third_utm_source_sign_path", "", { expires: -1, domain: layoutConfig.VITE_COOKIE_DOMAIN });
20913
21010
  }
20914
21011
  function defaultBackResolve(url) {
20915
- location.replace(removeIsLoginParam(url));
21012
+ if (typeof window !== "undefined" && window.location) {
21013
+ window.location.replace(removeIsLoginParam(url));
21014
+ }
20916
21015
  }
20917
21016
  const HandleParentWindowGetLoginInfo = (request) => {
20918
21017
  const API = headRequest(request);
@@ -21132,7 +21231,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
21132
21231
  const API = headRequest(inject("request"));
21133
21232
  const props = __props;
21134
21233
  const emits = __emit;
21135
- const cache_countdown = JSON.parse(localStorage.getItem("cache_countdown"));
21234
+ const cache_countdown = JSON.parse(localStorage$2.getItem("cache_countdown"));
21136
21235
  const { vModels } = useModel(props, emits);
21137
21236
  console.log(cache_countdown, "cache_countdown");
21138
21237
  const country = ref((cache_countdown == null ? void 0 : cache_countdown.country) || DEFAULT_COUNTRY);
@@ -21352,7 +21451,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
21352
21451
  };
21353
21452
  const handleClick = () => {
21354
21453
  };
21355
- const cache_countdown = JSON.parse(localStorage.getItem("cache_countdown"));
21454
+ const cache_countdown = JSON.parse(localStorage$2.getItem("cache_countdown"));
21356
21455
  const handleOperate = (config) => {
21357
21456
  var _a;
21358
21457
  const key = ((_a = config == null ? void 0 : config.props) == null ? void 0 : _a.aliasKey) || config.key;
@@ -24022,7 +24121,7 @@ const isPhoneNumber = (phone, country = "CN") => {
24022
24121
  };
24023
24122
  const getPhone = (conf) => {
24024
24123
  const { value, country } = conf;
24025
- const cache_countdown = JSON.parse(localStorage.getItem("cache_countdown"));
24124
+ const cache_countdown = JSON.parse(localStorage$2.getItem("cache_countdown"));
24026
24125
  const _country = country || (cache_countdown == null ? void 0 : cache_countdown.country);
24027
24126
  const isChina = !_country || _country === DEFAULT_COUNTRY;
24028
24127
  const countryCode = isChina ? "" : (_country || DEFAULT_COUNTRY).split("_")[1];
@@ -24489,7 +24588,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
24489
24588
  const MFA_vue_vue_type_style_index_0_lang = "";
24490
24589
  const MFA_vue_vue_type_style_index_1_scoped_02a2d8c5_lang = "";
24491
24590
  const MFA = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-02a2d8c5"]]);
24492
- const SlidCaptcha = defineAsyncComponent(() => import("./index-d6a4fcea.js"));
24591
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-72da4dc3.js"));
24493
24592
  const useSlidCaptcha = () => {
24494
24593
  const { mount, unMount } = usePopup("slid-captcha-popup");
24495
24594
  const open = (config) => {
@@ -25258,7 +25357,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25258
25357
  if (!res.error) {
25259
25358
  cacheForm.mobile = conf.value;
25260
25359
  cacheForm.country = conf.country;
25261
- localStorage.setItem("cache_countdown", JSON.stringify({
25360
+ localStorage$2.setItem("cache_countdown", JSON.stringify({
25262
25361
  mobile: conf.value,
25263
25362
  country: conf.country
25264
25363
  }));
@@ -25386,9 +25485,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25386
25485
  }
25387
25486
  });
25388
25487
  const hackMsgError = (show_error) => {
25389
- const el = document.querySelector(".g-input-button");
25390
- if (el) {
25391
- msgError.value = show_error;
25488
+ if (typeof document !== "undefined" && document.querySelector) {
25489
+ const el = document.querySelector(".g-input-button");
25490
+ if (el) {
25491
+ msgError.value = show_error;
25492
+ }
25392
25493
  }
25393
25494
  };
25394
25495
  watch(
@@ -25427,12 +25528,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25427
25528
  }
25428
25529
  return status.value;
25429
25530
  }
25430
- localStorage.removeItem("loginReturnUrl");
25431
- localStorage.removeItem("loginModalAuth");
25531
+ localStorage$2.removeItem("loginReturnUrl");
25532
+ localStorage$2.removeItem("loginModalAuth");
25432
25533
  const authType = ref(null);
25433
25534
  const pcAuthLogin = (type) => {
25434
25535
  authType.value = type;
25435
- if (localStorage.getItem("access_token")) {
25536
+ if (localStorage$2.getItem("access_token")) {
25436
25537
  emits("close", true);
25437
25538
  } else {
25438
25539
  const loginParams = { type, validFunc: checkAgree, triggerType: props.triggerType };
@@ -25444,8 +25545,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25444
25545
  [AuthTypeEnum.H_BUILDER]: () => LoginConfig.beforeOtherLogin(loginParams)
25445
25546
  };
25446
25547
  loginMap[type]();
25447
- if (localStorage.getItem("utm_source")) {
25448
- localStorage.removeItem("utm_source");
25548
+ if (localStorage$2.getItem("utm_source")) {
25549
+ localStorage$2.removeItem("utm_source");
25449
25550
  }
25450
25551
  }
25451
25552
  };
@@ -25842,9 +25943,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25842
25943
  };
25843
25944
  }
25844
25945
  });
25845
- const index_vue_vue_type_style_index_0_scoped_0b2f634a_lang = "";
25946
+ const index_vue_vue_type_style_index_0_scoped_aaa917cf_lang = "";
25846
25947
  const index_vue_vue_type_style_index_1_lang = "";
25847
- const LoginModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0b2f634a"]]);
25948
+ const LoginModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-aaa917cf"]]);
25848
25949
  const { t } = i18n.global;
25849
25950
  function useLogin(request) {
25850
25951
  const successMsg = t("gitCodeLayout.common.tips.welcome");
@@ -25859,8 +25960,8 @@ function useLogin(request) {
25859
25960
  if (isPhone()) {
25860
25961
  saveLoginType(triggerType || "");
25861
25962
  let url = window.location.href;
25862
- if (location.search.includes("?returnUrl=")) {
25863
- url = location.search;
25963
+ if (window.location.search.includes("?returnUrl=")) {
25964
+ url = window.location.search;
25864
25965
  }
25865
25966
  const returnUrl = url.replace("?returnUrl=", "");
25866
25967
  router2.replace(`/${type}?returnUrl=${returnUrl}`);
@@ -25881,14 +25982,14 @@ function useLogin(request) {
25881
25982
  loginSuccess && loginSuccess(conf);
25882
25983
  Message.success(successMsg);
25883
25984
  if (`${username}@gitcode.com` === email) {
25884
- localStorage.setItem("validator_email", "invalid");
25985
+ localStorage$2.setItem("validator_email", "invalid");
25885
25986
  } else {
25886
- localStorage.setItem("validator_email", "valid");
25987
+ localStorage$2.setItem("validator_email", "valid");
25887
25988
  }
25888
25989
  setTimeout(() => {
25889
25990
  const returnUrl = route.query.returnUrl;
25890
25991
  if (returnUrl) {
25891
- location.href = returnUrl;
25992
+ window.location.href = returnUrl;
25892
25993
  } else {
25893
25994
  router2.go(0);
25894
25995
  }
@@ -25945,14 +26046,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25945
26046
  const { t: t2 } = i18n.global;
25946
26047
  const { notice } = useNotification();
25947
26048
  const toNotice = () => {
25948
- if (localStorage.getItem("validator_email") === "invalid") {
26049
+ if (localStorage$2.getItem("validator_email") === "invalid") {
25949
26050
  notice();
25950
26051
  }
25951
26052
  };
25952
26053
  onMounted(() => {
25953
26054
  toNotice();
25954
26055
  addEventListener("logout", (options) => {
25955
- const token = localStorage.getItem("access_token");
26056
+ const token = localStorage$2.getItem("access_token");
25956
26057
  if (!status.value) {
25957
26058
  status.value = true;
25958
26059
  if (isMounted()) {
@@ -26011,8 +26112,9 @@ const index = {
26011
26112
  }
26012
26113
  };
26013
26114
  export {
26014
- setTheme as A,
26015
- index as B,
26115
+ currentTheme as A,
26116
+ setTheme as B,
26117
+ index as C,
26016
26118
  EVENT_NAME as E,
26017
26119
  GIcon as G,
26018
26120
  REPO_MODULE as R,
@@ -26030,19 +26132,19 @@ export {
26030
26132
  isPhone as i,
26031
26133
  isGstarRepo as j,
26032
26134
  _sfc_main$v as k,
26033
- isIncubationRepo as l,
26034
- highlightWords as m,
26035
- _frEventTrack as n,
26036
- useLayoutConfig as o,
26037
- ToolsFloat as p,
26038
- _sfc_main as q,
26135
+ localStorage$2 as l,
26136
+ isIncubationRepo as m,
26137
+ highlightWords as n,
26138
+ _frEventTrack as o,
26139
+ useLayoutConfig as p,
26140
+ ToolsFloat as q,
26039
26141
  reqCatch as r,
26040
- GitCodeAside as s,
26142
+ _sfc_main as s,
26041
26143
  transWebUrl as t,
26042
26144
  useModel as u,
26043
- GitCodeHeader as v,
26044
- useLogin as w,
26045
- setLayoutConfig as x,
26046
- GitCodeLayoutEmitter as y,
26047
- currentTheme as z
26145
+ GitCodeAside as v,
26146
+ GitCodeHeader as w,
26147
+ useLogin as x,
26148
+ setLayoutConfig as y,
26149
+ GitCodeLayoutEmitter as z
26048
26150
  };