gc_i18n 1.6.7 → 1.6.8

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/lib/gc_i18n.es.js CHANGED
@@ -3,7 +3,7 @@ import _t from "keyboardjs";
3
3
  import { h as xe, ref as ie, computed as He, onMounted as to, nextTick as Et, Vue as _e } from "vue-demi";
4
4
  import it from "axios";
5
5
  import E from "store2";
6
- import y from "lodash-es";
6
+ import m from "lodash-es";
7
7
  import { jws as no } from "jsrsasign";
8
8
  const oo = [
9
9
  "ar-SA",
@@ -24,9 +24,9 @@ const oo = [
24
24
  return e;
25
25
  }, io = (t, e, n) => (e.forEach((o) => {
26
26
  const s = o.key.split(".");
27
- s[0] === "common" && y.find(t, { key: `${n}.${s[1]}` }) && y.remove(t, { key: `${n}.${s[1]}` });
28
- const i = y.find(t, { key: o.key });
29
- i ? y.merge(i, o) : t.push(o);
27
+ s[0] === "common" && m.find(t, { key: `${n}.${s[1]}` }) && m.remove(t, { key: `${n}.${s[1]}` });
28
+ const i = m.find(t, { key: o.key });
29
+ i ? m.merge(i, o) : t.push(o);
30
30
  }), t), ce = it.create({
31
31
  timeout: 8e3
32
32
  }), Ae = /* @__PURE__ */ new Map(), ro = "https://extendapi.ihotel.cn", ao = "https://test.ihotel.cn", lo = /^https?:\/\//i, Je = (t) => String(t || "guest").replace(/[^\w-]/g, "_"), we = async (t, e) => typeof e != "function" ? t : await e(t) || t, Kt = ({ env: t, dev: e } = {}) => {
@@ -55,7 +55,7 @@ const oo = [
55
55
  }
56
56
  });
57
57
  if (l.data && l.data.result === 0) {
58
- const a = y.get(l.data, "retVal", []), d = a.map((u) => ({
58
+ const a = m.get(l.data, "retVal", []), d = a.map((u) => ({
59
59
  langCode: u.language || u.langCode || u,
60
60
  langName: u.langName || u.language || u
61
61
  }));
@@ -122,7 +122,7 @@ const oo = [
122
122
  const e = t.trim();
123
123
  return !e || /^<!doctype/i.test(e) || /^<html/i.test(e) ? (console.warn("i18n_token 接口未返回有效 token,请检查业务项目接口"), "") : e;
124
124
  }
125
- return y.get(t, "retVal.i18n_token") || y.get(t, "retVal.token") || y.get(t, "i18n_token") || y.get(t, "token") || "";
125
+ return m.get(t, "retVal.i18n_token") || m.get(t, "retVal.token") || m.get(t, "i18n_token") || m.get(t, "token") || "";
126
126
  }, co = async ({
127
127
  request: t,
128
128
  appCode: e,
@@ -165,7 +165,7 @@ const oo = [
165
165
  getRequestToken: r
166
166
  }) => {
167
167
  try {
168
- const l = Je(i), a = `I18N_${y.toUpper(e)}_${l}`, d = E.namespace(a), u = {
168
+ const l = Je(i), a = `I18N_${m.toUpper(e)}_${l}`, d = E.namespace(a), u = {
169
169
  baseUrl: t,
170
170
  appCode: e,
171
171
  language: n,
@@ -177,23 +177,23 @@ const oo = [
177
177
  n || "",
178
178
  l,
179
179
  o || "",
180
- y.get(h, "lastPullDate", "")
180
+ m.get(h, "lastPullDate", "")
181
181
  ].join("|");
182
182
  if (Ae.has(f))
183
183
  return Ae.get(f);
184
184
  const x = (async () => {
185
185
  if (!h || !h.lastPullDate) {
186
186
  const _ = await At(u);
187
- return _ ? (d.set(n, _), y.get(_, "translatesDTOs", [])) : y.get(h, "translatesDTOs", []);
187
+ return _ ? (d.set(n, _), m.get(_, "translatesDTOs", [])) : m.get(h, "translatesDTOs", []);
188
188
  }
189
189
  const { lastPullDate: S } = h, L = await At({
190
190
  ...u,
191
191
  lastPullDate: S
192
192
  });
193
193
  if (!L)
194
- return y.get(h, "translatesDTOs", []);
195
- const I = y.get(h, "translatesDTOs", []);
196
- if (!y.isEmpty(L.translatesDTOs)) {
194
+ return m.get(h, "translatesDTOs", []);
195
+ const I = m.get(h, "translatesDTOs", []);
196
+ if (!m.isEmpty(L.translatesDTOs)) {
197
197
  const _ = io(I, L.translatesDTOs, s), w = {
198
198
  lastPullDate: L.lastPullDate,
199
199
  translatesDTOs: _
@@ -207,16 +207,16 @@ const oo = [
207
207
  }), x;
208
208
  } catch (l) {
209
209
  console.error("处理翻译数据失败:", l);
210
- const a = Je(i), d = E.namespace(`I18N_${y.toUpper(e)}_${a}`);
211
- return y.get(d.get(n), "translatesDTOs", []);
210
+ const a = Je(i), d = E.namespace(`I18N_${m.toUpper(e)}_${a}`);
211
+ return m.get(d.get(n), "translatesDTOs", []);
212
212
  }
213
213
  }, St = ({ appCode: t, cacheScope: e } = {}) => {
214
214
  if (t) {
215
215
  if (e) {
216
- E.namespace(`I18N_${y.toUpper(t)}_${Je(e)}`).clearAll();
216
+ E.namespace(`I18N_${m.toUpper(t)}_${Je(e)}`).clearAll();
217
217
  return;
218
218
  }
219
- E.namespace(`I18N_${y.toUpper(t)}`).clearAll();
219
+ E.namespace(`I18N_${m.toUpper(t)}`).clearAll();
220
220
  }
221
221
  };
222
222
  function Lt(t) {
@@ -314,7 +314,7 @@ function Xt(t) {
314
314
  }), n.length ? n : [{ type: "text", value: t }];
315
315
  }
316
316
  function It(t) {
317
- return y.reduce(
317
+ return m.reduce(
318
318
  t,
319
319
  (e, n) => {
320
320
  const o = e[e.length - 1];
@@ -397,11 +397,11 @@ class mo {
397
397
  baseUrl: this.baseUrl,
398
398
  appCode: this.appCode
399
399
  }), o = Fe(n);
400
- o && o.result === 0 ? (y.isEmpty(e) && (e = ["zh-CN", "en-US", "zh-TW"]), this.languages = y.map(o.retVal || [], (s) => {
400
+ o && o.result === 0 ? (m.isEmpty(e) && (e = ["zh-CN", "en-US", "zh-TW"]), this.languages = m.map(o.retVal || [], (s) => {
401
401
  const i = po(s);
402
402
  return {
403
403
  ...i,
404
- checked: y.includes(e, i.langCode)
404
+ checked: m.includes(e, i.langCode)
405
405
  };
406
406
  }), await this.getPageData()) : (this.loading = !1, this.showError("获取语言失败,出错了"), this.render());
407
407
  } catch (e) {
@@ -409,8 +409,8 @@ class mo {
409
409
  }
410
410
  }
411
411
  saveLanguageSetting() {
412
- const e = y.map(
413
- y.filter(this.languages, (n) => n.checked),
412
+ const e = m.map(
413
+ m.filter(this.languages, (n) => n.checked),
414
414
  "langCode"
415
415
  );
416
416
  E.set("I18N_LANGUAGE_SETTING", e);
@@ -428,7 +428,7 @@ class mo {
428
428
  });
429
429
  }
430
430
  updateTranslationValue(e, n, o) {
431
- const { dictKey: s } = e, i = y.findIndex(this.mySaveData, {
431
+ const { dictKey: s } = e, i = m.findIndex(this.mySaveData, {
432
432
  dictKey: s
433
433
  });
434
434
  e[n] = o, e[`${n}_fromAi`] = "F", i > -1 ? (this.mySaveData[i][n] = o, this.mySaveData[i][`${n}_fromAi`] = "F", this.mySaveData[i].changedLangs = {
@@ -443,11 +443,11 @@ class mo {
443
443
  });
444
444
  }
445
445
  isProtectedValue(e) {
446
- return y.some(Lt(e), { type: "locked" });
446
+ return m.some(Lt(e), { type: "locked" });
447
447
  }
448
448
  isProtectedEditor() {
449
449
  var e;
450
- return y.some(((e = this.editor) == null ? void 0 : e.parts) || [], { type: "locked" });
450
+ return m.some(((e = this.editor) == null ? void 0 : e.parts) || [], { type: "locked" });
451
451
  }
452
452
  openEditor(e, n) {
453
453
  const o = this.data[e];
@@ -466,13 +466,13 @@ class mo {
466
466
  const e = (n = this.root) == null ? void 0 : n.querySelector(
467
467
  ".gc_i18n_config_protected_editor"
468
468
  );
469
- !e || !this.editor || y.forEach(e.querySelectorAll("[data-editor-index]"), (o) => {
469
+ !e || !this.editor || m.forEach(e.querySelectorAll("[data-editor-index]"), (o) => {
470
470
  const s = Number(o.dataset.editorIndex), i = this.editor.parts[s];
471
471
  i && i.type === "text" && (i.value = o.innerText);
472
472
  });
473
473
  }
474
474
  getEditorSubmitValue() {
475
- return this.editor ? this.isProtectedEditor() ? (this.syncEditorPartsFromDom(), y.map(this.editor.parts, "value").join("")) : this.editor.value : "";
475
+ return this.editor ? this.isProtectedEditor() ? (this.syncEditorPartsFromDom(), m.map(this.editor.parts, "value").join("")) : this.editor.value : "";
476
476
  }
477
477
  confirmEditor() {
478
478
  if (!this.editor)
@@ -485,8 +485,8 @@ class mo {
485
485
  }
486
486
  getSubmitData() {
487
487
  const e = [];
488
- return y.map(this.mySaveData, (n) => {
489
- y.map(y.keys(n.changedLangs || {}), (o) => {
488
+ return m.map(this.mySaveData, (n) => {
489
+ m.map(m.keys(n.changedLangs || {}), (o) => {
490
490
  e.push({
491
491
  key: n.dictKey,
492
492
  page: n.page,
@@ -499,7 +499,7 @@ class mo {
499
499
  }
500
500
  async saveData({ msg: e = "保存成功" } = {}, n = !0) {
501
501
  const o = this.getSubmitData();
502
- if (y.isEmpty(o)) {
502
+ if (m.isEmpty(o)) {
503
503
  this.showError("没有需要保存的数据");
504
504
  return;
505
505
  }
@@ -536,7 +536,7 @@ class mo {
536
536
  }
537
537
  }
538
538
  async saveNoEqual() {
539
- y.isEmpty(this.mySaveData) || await this.saveData({ msg: "已为您自动保存" }, !1);
539
+ m.isEmpty(this.mySaveData) || await this.saveData({ msg: "已为您自动保存" }, !1);
540
540
  }
541
541
  async changePage(e) {
542
542
  await this.saveNoEqual();
@@ -571,7 +571,7 @@ class mo {
571
571
  data: {
572
572
  appCode: this.appCode,
573
573
  searchBlur: this.searchText,
574
- commaSeparatedLangs: y.map(this.languages, "langCode").toString(),
574
+ commaSeparatedLangs: m.map(this.languages, "langCode").toString(),
575
575
  page: n === "loginData" ? this.loginRouteName : n === "pageData" ? this.name : "common",
576
576
  pageSize: 10,
577
577
  ...e
@@ -581,7 +581,7 @@ class mo {
581
581
  }), s = Fe(o);
582
582
  if (s && s.result === 0) {
583
583
  const i = s.retVal || {};
584
- this.data = y.cloneDeep(i.datas || []), this.page = {
584
+ this.data = m.cloneDeep(i.datas || []), this.page = {
585
585
  firstResult: i.firstResult || 0,
586
586
  pageSize: i.pageSize || 10,
587
587
  totalRows: i.totalRows || 0
@@ -643,7 +643,7 @@ class mo {
643
643
  return Math.max(1, Math.ceil((this.page.totalRows || 0) / this.page.pageSize));
644
644
  }
645
645
  get checkedLanguages() {
646
- return y.filter(this.languages, (e) => e.checked);
646
+ return m.filter(this.languages, (e) => e.checked);
647
647
  }
648
648
  renderStatus() {
649
649
  var n;
@@ -741,7 +741,7 @@ class mo {
741
741
  return '<div class="gc_i18n_config_loading">加载中...</div>';
742
742
  }
743
743
  renderTable() {
744
- return y.isEmpty(this.data) ? `
744
+ return m.isEmpty(this.data) ? `
745
745
  <div class="gc_i18n_config_table_wrap">
746
746
  <div class="gc_i18n_config_empty">暂无数据</div>
747
747
  </div>
@@ -2715,7 +2715,7 @@ class lr {
2715
2715
  getRequestToken: this.getRequestToken
2716
2716
  });
2717
2717
  if (n.data && n.data.result === 0) {
2718
- const o = y.get(n.data, "retVal", []);
2718
+ const o = m.get(n.data, "retVal", []);
2719
2719
  this.languages = o.map((s) => ({
2720
2720
  langCode: s.language || s.langCode || s,
2721
2721
  langName: s.langName || s.language || s
@@ -2910,7 +2910,7 @@ class lr {
2910
2910
  type="text"
2911
2911
  class="i18n-edit-input"
2912
2912
  data-lang="${l.langCode}"
2913
- value="${this.escapeHtml(y.get(o, l.langCode) || "")}"
2913
+ value="${this.escapeHtml(m.get(o, l.langCode) || "")}"
2914
2914
  placeholder="请输入${l.langName}翻译"
2915
2915
  />
2916
2916
  </div>
@@ -2975,7 +2975,7 @@ class lr {
2975
2975
  data: {
2976
2976
  appCode: this.appCode,
2977
2977
  commaSeparatedKeys: e,
2978
- commaSeparatedLangs: y.map(this.languages, "langCode").toString(),
2978
+ commaSeparatedLangs: m.map(this.languages, "langCode").toString(),
2979
2979
  searchBlur: "",
2980
2980
  page: o,
2981
2981
  pageSize: 10
@@ -2984,7 +2984,7 @@ class lr {
2984
2984
  getRequestToken: this.getRequestToken
2985
2985
  });
2986
2986
  if (s.data && s.data.result === 0)
2987
- return y.get(s.data, "retVal.datas", []);
2987
+ return m.get(s.data, "retVal.datas", []);
2988
2988
  } catch (n) {
2989
2989
  console.error("获取翻译数据失败:", n);
2990
2990
  }
@@ -2993,31 +2993,34 @@ class lr {
2993
2993
  /**
2994
2994
  * 保存翻译数据
2995
2995
  */
2996
- async saveTranslations(e, n, o) {
2997
- var a;
2998
- const s = o[0], { page: i } = s;
2999
- console.log(n);
3000
- const r = [];
3001
- y.map(n, (d, u) => {
3002
- r.push({
2996
+ getChangedTranslationData(e, n, o) {
2997
+ const s = o[0], i = (s == null ? void 0 : s.page) || "", r = [];
2998
+ return m.map(n, (l, a) => {
2999
+ l !== m.get(s, a) && r.push({
3003
3000
  appCode: this.appCode,
3004
3001
  page: i,
3005
3002
  key: e,
3006
3003
  unitCode: this.unitCode,
3007
- lang: u,
3008
- value: d,
3004
+ lang: a,
3005
+ value: l,
3009
3006
  fromAi: "F"
3010
3007
  });
3011
- });
3012
- const l = await Zt({
3013
- data: { data: r, isLocal: "F" },
3008
+ }), r;
3009
+ }
3010
+ async saveTranslations(e, n, o) {
3011
+ var r;
3012
+ const s = this.getChangedTranslationData(e, n, o);
3013
+ if (m.isEmpty(s))
3014
+ return !0;
3015
+ const i = await Zt({
3016
+ data: { data: s, isLocal: "F" },
3014
3017
  token: this.token,
3015
3018
  getRequestToken: this.getRequestToken,
3016
3019
  baseUrl: this.baseUrl
3017
3020
  });
3018
- if (l.data && l.data.result === 0)
3021
+ if (i.data && i.data.result === 0)
3019
3022
  return !0;
3020
- throw new Error(((a = l.data) == null ? void 0 : a.message) || "保存失败");
3023
+ throw new Error(((r = i.data) == null ? void 0 : r.message) || "保存失败");
3021
3024
  }
3022
3025
  /**
3023
3026
  * HTML 转义
@@ -3136,55 +3139,55 @@ function ur() {
3136
3139
  },
3137
3140
  _compress: function(a, d, u) {
3138
3141
  if (a == null) return "";
3139
- var h, f, x = {}, S = {}, L = "", I = "", _ = "", w = 2, C = 3, v = 2, k = [], g = 0, m = 0, b;
3140
- for (b = 0; b < a.length; b += 1)
3141
- if (L = a.charAt(b), Object.prototype.hasOwnProperty.call(x, L) || (x[L] = C++, S[L] = !0), I = _ + L, Object.prototype.hasOwnProperty.call(x, I))
3142
+ var h, f, x = {}, S = {}, L = "", I = "", _ = "", w = 2, C = 3, v = 2, k = [], g = 0, b = 0, y;
3143
+ for (y = 0; y < a.length; y += 1)
3144
+ if (L = a.charAt(y), Object.prototype.hasOwnProperty.call(x, L) || (x[L] = C++, S[L] = !0), I = _ + L, Object.prototype.hasOwnProperty.call(x, I))
3142
3145
  _ = I;
3143
3146
  else {
3144
3147
  if (Object.prototype.hasOwnProperty.call(S, _)) {
3145
3148
  if (_.charCodeAt(0) < 256) {
3146
3149
  for (h = 0; h < v; h++)
3147
- g = g << 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++;
3150
+ g = g << 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++;
3148
3151
  for (f = _.charCodeAt(0), h = 0; h < 8; h++)
3149
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3152
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3150
3153
  } else {
3151
3154
  for (f = 1, h = 0; h < v; h++)
3152
- g = g << 1 | f, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = 0;
3155
+ g = g << 1 | f, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = 0;
3153
3156
  for (f = _.charCodeAt(0), h = 0; h < 16; h++)
3154
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3157
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3155
3158
  }
3156
3159
  w--, w == 0 && (w = Math.pow(2, v), v++), delete S[_];
3157
3160
  } else
3158
3161
  for (f = x[_], h = 0; h < v; h++)
3159
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3162
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3160
3163
  w--, w == 0 && (w = Math.pow(2, v), v++), x[I] = C++, _ = String(L);
3161
3164
  }
3162
3165
  if (_ !== "") {
3163
3166
  if (Object.prototype.hasOwnProperty.call(S, _)) {
3164
3167
  if (_.charCodeAt(0) < 256) {
3165
3168
  for (h = 0; h < v; h++)
3166
- g = g << 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++;
3169
+ g = g << 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++;
3167
3170
  for (f = _.charCodeAt(0), h = 0; h < 8; h++)
3168
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3171
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3169
3172
  } else {
3170
3173
  for (f = 1, h = 0; h < v; h++)
3171
- g = g << 1 | f, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = 0;
3174
+ g = g << 1 | f, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = 0;
3172
3175
  for (f = _.charCodeAt(0), h = 0; h < 16; h++)
3173
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3176
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3174
3177
  }
3175
3178
  w--, w == 0 && (w = Math.pow(2, v), v++), delete S[_];
3176
3179
  } else
3177
3180
  for (f = x[_], h = 0; h < v; h++)
3178
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3181
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3179
3182
  w--, w == 0 && (w = Math.pow(2, v), v++);
3180
3183
  }
3181
3184
  for (f = 2, h = 0; h < v; h++)
3182
- g = g << 1 | f & 1, m == d - 1 ? (m = 0, k.push(u(g)), g = 0) : m++, f = f >> 1;
3185
+ g = g << 1 | f & 1, b == d - 1 ? (b = 0, k.push(u(g)), g = 0) : b++, f = f >> 1;
3183
3186
  for (; ; )
3184
- if (g = g << 1, m == d - 1) {
3187
+ if (g = g << 1, b == d - 1) {
3185
3188
  k.push(u(g));
3186
3189
  break;
3187
- } else m++;
3190
+ } else b++;
3188
3191
  return k.join("");
3189
3192
  },
3190
3193
  decompress: function(a) {
@@ -3193,47 +3196,47 @@ function ur() {
3193
3196
  });
3194
3197
  },
3195
3198
  _decompress: function(a, d, u) {
3196
- var h = [], f = 4, x = 4, S = 3, L = "", I = [], _, w, C, v, k, g, m, b = { val: u(0), position: d, index: 1 };
3199
+ var h = [], f = 4, x = 4, S = 3, L = "", I = [], _, w, C, v, k, g, b, y = { val: u(0), position: d, index: 1 };
3197
3200
  for (_ = 0; _ < 3; _ += 1)
3198
3201
  h[_] = _;
3199
3202
  for (C = 0, k = Math.pow(2, 2), g = 1; g != k; )
3200
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3203
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3201
3204
  switch (C) {
3202
3205
  case 0:
3203
3206
  for (C = 0, k = Math.pow(2, 8), g = 1; g != k; )
3204
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3205
- m = n(C);
3207
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3208
+ b = n(C);
3206
3209
  break;
3207
3210
  case 1:
3208
3211
  for (C = 0, k = Math.pow(2, 16), g = 1; g != k; )
3209
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3210
- m = n(C);
3212
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3213
+ b = n(C);
3211
3214
  break;
3212
3215
  case 2:
3213
3216
  return "";
3214
3217
  }
3215
- for (h[3] = m, w = m, I.push(m); ; ) {
3216
- if (b.index > a)
3218
+ for (h[3] = b, w = b, I.push(b); ; ) {
3219
+ if (y.index > a)
3217
3220
  return "";
3218
3221
  for (C = 0, k = Math.pow(2, S), g = 1; g != k; )
3219
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3220
- switch (m = C) {
3222
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3223
+ switch (b = C) {
3221
3224
  case 0:
3222
3225
  for (C = 0, k = Math.pow(2, 8), g = 1; g != k; )
3223
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3224
- h[x++] = n(C), m = x - 1, f--;
3226
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3227
+ h[x++] = n(C), b = x - 1, f--;
3225
3228
  break;
3226
3229
  case 1:
3227
3230
  for (C = 0, k = Math.pow(2, 16), g = 1; g != k; )
3228
- v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3229
- h[x++] = n(C), m = x - 1, f--;
3231
+ v = y.val & y.position, y.position >>= 1, y.position == 0 && (y.position = d, y.val = u(y.index++)), C |= (v > 0 ? 1 : 0) * g, g <<= 1;
3232
+ h[x++] = n(C), b = x - 1, f--;
3230
3233
  break;
3231
3234
  case 2:
3232
3235
  return I.join("");
3233
3236
  }
3234
- if (f == 0 && (f = Math.pow(2, S), S++), h[m])
3235
- L = h[m];
3236
- else if (m === x)
3237
+ if (f == 0 && (f = Math.pow(2, S), S++), h[b])
3238
+ L = h[b];
3239
+ else if (b === x)
3237
3240
  L = w + w.charAt(0);
3238
3241
  else
3239
3242
  return null;
@@ -3522,15 +3525,15 @@ const Ht = {
3522
3525
  },
3523
3526
  preConfirm: async () => {
3524
3527
  const k = document.querySelectorAll(".i18n-edit-input"), g = {};
3525
- k.forEach((b) => {
3526
- g[b.getAttribute("data-lang")] = b.value;
3528
+ k.forEach((y) => {
3529
+ g[y.getAttribute("data-lang")] = y.value;
3527
3530
  });
3528
- const m = document.getElementById("i18n-save-error");
3529
- if (m && (m.style.display = "none", m.textContent = ""), t.request && typeof t.request == "function")
3531
+ const b = document.getElementById("i18n-save-error");
3532
+ if (b && (b.style.display = "none", b.textContent = ""), t.request && typeof t.request == "function")
3530
3533
  try {
3531
3534
  return await t.request(g), g;
3532
- } catch (b) {
3533
- return m && (m.textContent = b.message || "保存失败", m.style.display = "block"), !1;
3535
+ } catch (y) {
3536
+ return b && (b.textContent = y.message || "保存失败", b.style.display = "block"), !1;
3534
3537
  }
3535
3538
  return g;
3536
3539
  }
@@ -4173,7 +4176,7 @@ class J {
4173
4176
  let u;
4174
4177
  if (d) {
4175
4178
  const x = `${d}.${o}`, S = n.i18n.t(x, void 0, i);
4176
- if (S !== x && !y.isEmpty(S))
4179
+ if (S !== x && !m.isEmpty(S))
4177
4180
  u = S;
4178
4181
  else {
4179
4182
  const L = `common.${o}`, I = n.i18n.t(L, void 0, i);
@@ -4307,7 +4310,7 @@ class J {
4307
4310
  e = this.normalizeLocale(e);
4308
4311
  const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, i = ++this.languageVersion, r = "I18N_MESSAGES_COMMON_" + e;
4309
4312
  let l = E.get(r);
4310
- if (y.isEmpty(l))
4313
+ if (m.isEmpty(l))
4311
4314
  try {
4312
4315
  const a = await Jn.get(
4313
4316
  `https://cdn.ihotel.cn/i18n_messages/${e}.json`
@@ -4335,18 +4338,18 @@ class J {
4335
4338
  if (s !== this.authVersion || i !== this.languageVersion)
4336
4339
  return !1;
4337
4340
  if (a && Array.isArray(a)) {
4338
- const d = so(a), u = y.assign(
4341
+ const d = so(a), u = m.assign(
4339
4342
  {},
4340
4343
  l,
4341
- y.get(this.messages, e),
4344
+ m.get(this.messages, e),
4342
4345
  d
4343
4346
  );
4344
4347
  this.i18n.global.setLocaleMessage(e, u);
4345
4348
  } else {
4346
- const d = y.assign(
4349
+ const d = m.assign(
4347
4350
  {},
4348
4351
  l,
4349
- y.get(this.messages, e)
4352
+ m.get(this.messages, e)
4350
4353
  );
4351
4354
  this.i18n.global.setLocaleMessage(e, d);
4352
4355
  }
@@ -4354,10 +4357,10 @@ class J {
4354
4357
  } catch (a) {
4355
4358
  if (console.error(`设置语言 ${e} 失败,使用本地消息继续运行:`, a), s !== this.authVersion || i !== this.languageVersion)
4356
4359
  return !1;
4357
- const d = y.assign(
4360
+ const d = m.assign(
4358
4361
  {},
4359
4362
  l,
4360
- y.get(this.messages, e)
4363
+ m.get(this.messages, e)
4361
4364
  );
4362
4365
  return this.i18n.global.setLocaleMessage(e, d), this.locale = e, this._isRTL = Ee(e), this.i18n.global.locale.value = e, E.set("I18N_LANGUAGE", e), this.persistI18nConfig(), this.updateDocumentDir(), this.notifyLanguageChanged(e, !1), !1;
4363
4366
  }