@sybz-components/utils 1.0.22 → 1.0.23

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.
@@ -142,6 +142,7 @@ function formatTime(time = /* @__PURE__ */ new Date(), cFormat = "{y}-{m}-{d} {h
142
142
  });
143
143
  }
144
144
  function formatDurationTime(timestamp, cFormat = "{d}\u5929{h}\u65F6{i}\u5206{s}\u79D2") {
145
+ var _a, _b, _c, _d, _e, _f;
145
146
  const secondsPerMinute = 60;
146
147
  const minutesPerHour = 60;
147
148
  const hoursPerDay = 24;
@@ -163,11 +164,11 @@ function formatDurationTime(timestamp, cFormat = "{d}\u5929{h}\u65F6{i}\u5206{s}
163
164
  };
164
165
  let parseFormat = cFormat;
165
166
  if (days === 0) {
166
- parseFormat = cFormat.match(/{h}.*/g)?.[0] ?? "";
167
+ parseFormat = (_b = (_a = cFormat.match(/{h}.*/g)) == null ? void 0 : _a[0]) != null ? _b : "";
167
168
  if (hours === 0) {
168
- parseFormat = cFormat.match(/{i}.*/g)?.[0] ?? "";
169
+ parseFormat = (_d = (_c = cFormat.match(/{i}.*/g)) == null ? void 0 : _c[0]) != null ? _d : "";
169
170
  if (minutes === 0) {
170
- parseFormat = cFormat.match(/{s}.*/g)?.[0] ?? "";
171
+ parseFormat = (_f = (_e = cFormat.match(/{s}.*/g)) == null ? void 0 : _e[0]) != null ? _f : "";
171
172
  }
172
173
  }
173
174
  }
@@ -219,13 +220,16 @@ function formatTextToHtml(str) {
219
220
  return withBreaks.replace(/\t/g, "    ");
220
221
  }
221
222
 
223
+ var __defProp = Object.defineProperty;
224
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
225
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
222
226
  class HttpError extends Error {
223
- status;
224
- code;
225
- data;
226
- cause;
227
227
  constructor(message, options = {}) {
228
228
  super(message);
229
+ __publicField(this, "status");
230
+ __publicField(this, "code");
231
+ __publicField(this, "data");
232
+ __publicField(this, "cause");
229
233
  this.name = "HttpError";
230
234
  Object.assign(this, options);
231
235
  }
@@ -258,10 +262,10 @@ function createHttp(options = {}) {
258
262
  return new HttpError(error instanceof Error ? error.message : "\u8BF7\u6C42\u5931\u8D25", { cause: error });
259
263
  const response = error.response;
260
264
  const message = error.code === AxiosError.ECONNABORTED || error.code === "ETIMEDOUT" ? "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u91CD\u8BD5" : error.code === AxiosError.ERR_CANCELED ? "\u8BF7\u6C42\u5DF2\u53D6\u6D88" : response ? `\u8BF7\u6C42\u5931\u8D25\uFF08${response.status}\uFF09` : "\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5";
261
- return new HttpError(getBusinessMessage(response?.data, message), {
262
- status: response?.status,
265
+ return new HttpError(getBusinessMessage(response == null ? void 0 : response.data, message), {
266
+ status: response == null ? void 0 : response.status,
263
267
  code: error.code,
264
- data: response?.data,
268
+ data: response == null ? void 0 : response.data,
265
269
  cause: error
266
270
  });
267
271
  };
@@ -269,11 +273,11 @@ function createHttp(options = {}) {
269
273
  const requestConfig = config;
270
274
  requestConfig.headers = AxiosHeaders.from(requestConfig.headers);
271
275
  if (!requestConfig.skipAuth) {
272
- const token = getToken?.();
276
+ const token = getToken == null ? void 0 : getToken();
273
277
  if (token && !requestConfig.headers.has("Authorization"))
274
278
  requestConfig.headers.set("Authorization", `Bearer ${token}`);
275
279
  }
276
- return onRequest?.(requestConfig) || requestConfig;
280
+ return (onRequest == null ? void 0 : onRequest(requestConfig)) || requestConfig;
277
281
  });
278
282
  instance.interceptors.response.use(
279
283
  (response) => {
@@ -288,17 +292,18 @@ function createHttp(options = {}) {
288
292
  response.data,
289
293
  response
290
294
  );
291
- onResponse?.(response);
295
+ onResponse == null ? void 0 : onResponse(response);
292
296
  return response;
293
297
  },
294
298
  async (error) => {
299
+ var _a;
295
300
  const normalized = normalizeError ? normalizeError(error) : normalize(error);
296
301
  const response = axios.isAxiosError(error) ? error.response : void 0;
297
- const requestConfig = response?.config;
298
- const customMessage = requestConfig?.message;
302
+ const requestConfig = response == null ? void 0 : response.config;
303
+ const customMessage = requestConfig == null ? void 0 : requestConfig.message;
299
304
  const message = typeof customMessage === "function" ? customMessage(normalized) : customMessage || normalized.message;
300
- if (requestConfig?.showErrorToast ?? showErrorToast) toast?.(message);
301
- await onError?.(normalized, response);
305
+ if ((_a = requestConfig == null ? void 0 : requestConfig.showErrorToast) != null ? _a : showErrorToast) toast == null ? void 0 : toast(message);
306
+ await (onError == null ? void 0 : onError(normalized, response));
302
307
  throw normalized;
303
308
  }
304
309
  );
@@ -355,7 +360,7 @@ function _getBrowserStorage(isSession = false) {
355
360
  }
356
361
  try {
357
362
  return isSession ? window.sessionStorage : window.localStorage;
358
- } catch {
363
+ } catch (e) {
359
364
  return null;
360
365
  }
361
366
  }
@@ -368,7 +373,7 @@ function _parseStorageValue(value) {
368
373
  if (typeof parsed !== "number") {
369
374
  return parsed;
370
375
  }
371
- } catch {
376
+ } catch (e) {
372
377
  }
373
378
  return value;
374
379
  }
@@ -376,16 +381,17 @@ function renderToastComponents(message, components, handlers) {
376
381
  const template = document.createElement("template");
377
382
  template.innerHTML = message;
378
383
  const renderNode = (node) => {
379
- if (node.nodeType === Node.TEXT_NODE) return node.textContent ?? "";
384
+ var _a, _b;
385
+ if (node.nodeType === Node.TEXT_NODE) return (_a = node.textContent) != null ? _a : "";
380
386
  if (node.nodeType !== Node.ELEMENT_NODE) return null;
381
387
  const element = node;
382
388
  const tag = element.tagName.toLowerCase();
383
389
  const pascalTag = tag.replace(/(^|-)([a-z])/g, (_, _separator, letter) => letter.toUpperCase());
384
- const component = components[tag] ?? components[pascalTag];
390
+ const component = (_b = components[tag]) != null ? _b : components[pascalTag];
385
391
  const attrs = {};
386
392
  for (const { name, value } of Array.from(element.attributes)) {
387
393
  if (name.startsWith("@")) {
388
- const handler = handlers?.[value];
394
+ const handler = handlers == null ? void 0 : handlers[value];
389
395
  if (handler) {
390
396
  const eventName = name.slice(1).replace(/(^|-)([a-z])/g, (_, _separator, letter) => letter.toUpperCase());
391
397
  attrs[`on${eventName}`] = handler;
@@ -417,6 +423,7 @@ function $toast(message, type = "success", otherParams = {}) {
417
423
  return typeof obj === "object" && obj !== null && !isVNode(obj);
418
424
  }
419
425
  function showToast(options) {
426
+ var _a, _b;
420
427
  const {
421
428
  theme = utilsConfig.theme,
422
429
  customClass,
@@ -427,9 +434,9 @@ function $toast(message, type = "success", otherParams = {}) {
427
434
  } = options;
428
435
  let htmlStringEnabled = dangerouslyUseHTMLString;
429
436
  const appContext = _resolveAppContext(null);
430
- const appComponents = appContext?.components;
437
+ const appComponents = appContext == null ? void 0 : appContext.components;
431
438
  if (typeof messageOptions.icon === "string") {
432
- const icon = appComponents?.SIcon ?? appComponents?.["s-icon"];
439
+ const icon = (_a = appComponents == null ? void 0 : appComponents.SIcon) != null ? _a : appComponents == null ? void 0 : appComponents["s-icon"];
433
440
  if (icon) {
434
441
  const iconName = messageOptions.icon;
435
442
  messageOptions.icon = () => h(icon, { cursor: "default", ...iconAttrs, icon: iconName });
@@ -439,7 +446,7 @@ function $toast(message, type = "success", otherParams = {}) {
439
446
  messageOptions.icon = () => h(icon, iconAttrs);
440
447
  }
441
448
  if (typeof messageOptions.message === "string" && htmlStringEnabled) {
442
- const registeredComponents = appComponents ?? {};
449
+ const registeredComponents = appComponents != null ? appComponents : {};
443
450
  if (Object.keys(registeredComponents).length > 0) {
444
451
  messageOptions.message = renderToastComponents(messageOptions.message, registeredComponents, handlers);
445
452
  htmlStringEnabled = false;
@@ -457,7 +464,7 @@ function $toast(message, type = "success", otherParams = {}) {
457
464
  const resolvedMessageOptions = {
458
465
  ...messageOptions,
459
466
  dangerouslyUseHTMLString: htmlStringEnabled,
460
- showClose: options.showClose ?? true,
467
+ showClose: (_b = options.showClose) != null ? _b : true,
461
468
  customClass: resolvedCustomClass
462
469
  };
463
470
  if (appContext) ElMessage(resolvedMessageOptions, appContext);
@@ -513,14 +520,14 @@ function clearStorage(str = "") {
513
520
  return;
514
521
  }
515
522
  if (isEmpty(str)) {
516
- sessionStorageRef?.clear();
517
- localStorageRef?.clear();
523
+ sessionStorageRef == null ? void 0 : sessionStorageRef.clear();
524
+ localStorageRef == null ? void 0 : localStorageRef.clear();
518
525
  }
519
526
  if (typeof str === "string" || Array.isArray(str)) {
520
527
  const strArr = Array.isArray(str) ? str : [str];
521
528
  for (let i = 0; i < strArr.length; i++) {
522
- sessionStorageRef?.removeItem(strArr[i]);
523
- localStorageRef?.removeItem(strArr[i]);
529
+ sessionStorageRef == null ? void 0 : sessionStorageRef.removeItem(strArr[i]);
530
+ localStorageRef == null ? void 0 : localStorageRef.removeItem(strArr[i]);
524
531
  }
525
532
  }
526
533
  if (_isObjectWithExclude(str)) {
@@ -540,8 +547,8 @@ function clearStorage(str = "") {
540
547
  }
541
548
  }
542
549
  }
543
- sessionStorageRef?.clear();
544
- localStorageRef?.clear();
550
+ sessionStorageRef == null ? void 0 : sessionStorageRef.clear();
551
+ localStorageRef == null ? void 0 : localStorageRef.clear();
545
552
  for (const key in sessionStorageObj) {
546
553
  setStorage(key, sessionStorageObj[key], true);
547
554
  }
@@ -557,23 +564,24 @@ function _isObjectWithExclude(obj) {
557
564
  function validateForm(ref, { message, detail = false, showMessage = true } = {}) {
558
565
  return new Promise((resolve, reject) => {
559
566
  unref(ref).validate((valid, status) => {
567
+ var _a;
560
568
  if (valid) {
561
569
  resolve(status);
562
570
  } else {
563
571
  if (showMessage) {
564
- const fieldNames = Object.keys(status ?? {});
572
+ const fieldNames = Object.keys(status != null ? status : {});
565
573
  const errors = fieldNames.flatMap((field) => {
566
574
  const fieldErrors = status[field];
567
575
  return Array.isArray(fieldErrors) ? fieldErrors : [fieldErrors];
568
576
  });
569
- const errorMessages = errors.map((error) => error?.message).filter((errorMessage) => typeof errorMessage === "string" && !!errorMessage.trim());
570
- const nonRequiredMessage = errors.find((error) => {
571
- const errorMessage = error?.message;
577
+ const errorMessages = errors.map((error) => error == null ? void 0 : error.message).filter((errorMessage) => typeof errorMessage === "string" && !!errorMessage.trim());
578
+ const nonRequiredMessage = (_a = errors.find((error) => {
579
+ const errorMessage = error == null ? void 0 : error.message;
572
580
  if (typeof errorMessage !== "string" || !errorMessage.trim()) return false;
573
581
  if ("fieldValue" in Object(error) && !isEmpty(error.fieldValue)) return true;
574
582
  return !/^(请输入|请选择|请填写|请上传|请勾选|不能为空)/.test(errorMessage) || /^请输入(?:正确|非负|正|整数|数字|\d|至少|最多|不超过)/.test(errorMessage);
575
- })?.message;
576
- const defaultMessage = nonRequiredMessage ?? (errorMessages.length ? "\u5B58\u5728\u5FC5\u586B\u9879\u672A\u586B\u5199\uFF0C\u8BF7\u8865\u5145\u5B8C\u6574" : "\u8868\u5355\u6821\u9A8C\u672A\u901A\u8FC7\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165");
583
+ })) == null ? void 0 : _a.message;
584
+ const defaultMessage = nonRequiredMessage != null ? nonRequiredMessage : errorMessages.length ? "\u5B58\u5728\u5FC5\u586B\u9879\u672A\u586B\u5199\uFF0C\u8BF7\u8865\u5145\u5B8C\u6574" : "\u8868\u5355\u6821\u9A8C\u672A\u901A\u8FC7\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165";
577
585
  const toastMessage = message === void 0 ? defaultMessage : message;
578
586
  if (toastMessage) $toast(detail ? toastMessage + fieldNames.join(",") : toastMessage, "e");
579
587
  }
@@ -659,7 +667,7 @@ function mockValue(type = "", length = 4, options = {}) {
659
667
  type = unref2(type);
660
668
  if (Array.isArray(type)) {
661
669
  if (type.length === 0) return "";
662
- const randIndex = optionsIndex ?? random2(0, type.length - 1);
670
+ const randIndex = optionsIndex != null ? optionsIndex : random2(0, type.length - 1);
663
671
  const selectedItem = type[randIndex];
664
672
  if (typeof selectedItem === "object" && selectedItem !== null && "value" in selectedItem) {
665
673
  return selectedItem.value;
@@ -714,12 +722,13 @@ function getType(type) {
714
722
  function delay(delay2 = 0, fn) {
715
723
  return new Promise(
716
724
  (resolve) => setTimeout(() => {
717
- fn?.();
725
+ fn == null ? void 0 : fn();
718
726
  resolve();
719
727
  }, delay2)
720
728
  );
721
729
  }
722
730
  function validateOnSubmit(type = "required", rules = {}, pureValid = false) {
731
+ var _a;
723
732
  const normalized = normalizeValidateParams(type, rules, pureValid);
724
733
  if (normalized.pureValid) {
725
734
  return validate(normalized.type, normalized.rawRules, true);
@@ -728,7 +737,7 @@ function validateOnSubmit(type = "required", rules = {}, pureValid = false) {
728
737
  normalized.type,
729
738
  {
730
739
  ...normalized.rulesObject,
731
- trigger: normalized.rulesObject.trigger ?? []
740
+ trigger: (_a = normalized.rulesObject.trigger) != null ? _a : []
732
741
  },
733
742
  normalized.pureValid
734
743
  );
@@ -753,14 +762,15 @@ var ValidateType = /* @__PURE__ */ ((ValidateType2) => {
753
762
  return ValidateType2;
754
763
  })(ValidateType || {});
755
764
  function validate(type = "required", rules = {}, pureValid = false) {
765
+ var _a, _b, _c, _d, _e, _f;
756
766
  const normalized = normalizeValidateParams(type, rules, pureValid);
757
767
  const rulesObject = normalized.rulesObject;
758
768
  const rawRules = normalized.rawRules;
759
769
  const validType = normalized.type;
760
770
  const isPureValid = normalized.pureValid;
761
- const trigger = rulesObject.trigger ?? ["blur", "change"];
771
+ const trigger = (_a = rulesObject.trigger) != null ? _a : ["blur", "change"];
762
772
  const typeMaps = Object.values(ValidateType);
763
- const parseRequired = rulesObject.required ?? true;
773
+ const parseRequired = (_b = rulesObject.required) != null ? _b : true;
764
774
  const defaultRequiredMessage = validType === "change" /* CHANGE */ ? "\u8BF7\u9009\u62E9" : "\u8BF7\u8F93\u5165";
765
775
  const getPureValue = () => Object.prototype.hasOwnProperty.call(rulesObject, "value") ? rulesObject.value : rawRules;
766
776
  if (!typeMaps.includes(validType)) {
@@ -773,7 +783,7 @@ function validate(type = "required", rules = {}, pureValid = false) {
773
783
  if (validType === "required" /* REQUIRED */ || validType === "change" /* CHANGE */) {
774
784
  return {
775
785
  required: parseRequired,
776
- message: rulesObject.message ?? defaultRequiredMessage,
786
+ message: (_c = rulesObject.message) != null ? _c : defaultRequiredMessage,
777
787
  trigger
778
788
  };
779
789
  }
@@ -831,8 +841,8 @@ function validate(type = "required", rules = {}, pureValid = false) {
831
841
  );
832
842
  }
833
843
  if (validType === "between" /* BETWEEN */) {
834
- let minValue = rulesObject.min ?? "";
835
- let maxValue = rulesObject.max ?? "";
844
+ let minValue = (_d = rulesObject.min) != null ? _d : "";
845
+ let maxValue = (_e = rulesObject.max) != null ? _e : "";
836
846
  const validateBetween = (rule, value, callback) => {
837
847
  let validFlag = /^-?[0-9]+$/.test(value);
838
848
  if (!validFlag) {
@@ -856,7 +866,7 @@ function validate(type = "required", rules = {}, pureValid = false) {
856
866
  return {
857
867
  min: rulesObject.min,
858
868
  max: rulesObject.max,
859
- message: rulesObject.message ?? `\u8BF7\u8F93\u5165${rulesObject.min}\u5230${rulesObject.max}\u4E2A\u5B57\u7B26`,
869
+ message: (_f = rulesObject.message) != null ? _f : `\u8BF7\u8F93\u5165${rulesObject.min}\u5230${rulesObject.max}\u4E2A\u5B57\u7B26`,
860
870
  trigger,
861
871
  required: parseRequired
862
872
  };
@@ -884,20 +894,22 @@ function validate(type = "required", rules = {}, pureValid = false) {
884
894
  return _validValue(getPureValue(), rulesObject.message, isPureValid, rulesObject.reg);
885
895
  }
886
896
  function _validValue(value, msg, pureValid2, reg) {
897
+ var _a2;
887
898
  if (pureValid2) {
888
899
  return reg.test(value);
889
900
  }
890
901
  const validatePhone = (rule, value2, callback) => {
902
+ var _a3;
891
903
  let validFlag = reg.test(value2);
892
904
  if (!validFlag) {
893
- callback(new Error(rulesObject.message ?? msg));
905
+ callback(new Error((_a3 = rulesObject.message) != null ? _a3 : msg));
894
906
  } else {
895
907
  callback();
896
908
  }
897
909
  };
898
910
  return {
899
911
  validator: validatePhone,
900
- required: rulesObject.required ?? true,
912
+ required: (_a2 = rulesObject.required) != null ? _a2 : true,
901
913
  trigger
902
914
  };
903
915
  }
@@ -936,7 +948,8 @@ const copy = (text, toastParams = {}) => {
936
948
  return true;
937
949
  };
938
950
  function log(variableStr, variable, otherInfo = "") {
939
- const stack = new Error().stack?.split("\n")[2]?.trim() ?? "";
951
+ var _a, _b, _c;
952
+ const stack = (_c = (_b = (_a = new Error().stack) == null ? void 0 : _a.split("\n")[2]) == null ? void 0 : _b.trim()) != null ? _c : "";
940
953
  const matchResult = stack.match(/\((.*):(\d+):(\d+)\)/);
941
954
  let fileInfo = "";
942
955
  try {
@@ -944,7 +957,7 @@ function log(variableStr, variable, otherInfo = "") {
944
957
  const lineNumber = matchResult[2];
945
958
  fileInfo = `vscode://file${JSON.parse(otherInfo)}:${lineNumber}`;
946
959
  }
947
- } catch {
960
+ } catch (e) {
948
961
  fileInfo = otherInfo;
949
962
  }
950
963
  if (isRef(variable)) {
@@ -1037,7 +1050,7 @@ function throttle(fn, delay2 = 1e3, options = {}, resultCallback) {
1037
1050
  lastThis = void 0;
1038
1051
  const nextResult = fn.apply(context, args);
1039
1052
  result = nextResult;
1040
- resultCallback?.(nextResult);
1053
+ resultCallback == null ? void 0 : resultCallback(nextResult);
1041
1054
  return result;
1042
1055
  };
1043
1056
  const flush = () => {
@@ -1136,9 +1149,10 @@ function debounce(func, delay2 = 500, immediate, resultCallback) {
1136
1149
  return _debounce;
1137
1150
  }
1138
1151
  function confirm(messageOrOptions, optionsOrAppContext = null, appContext = null) {
1152
+ var _a;
1139
1153
  const isOptionsCall = typeof messageOrOptions === "object" && messageOrOptions !== null && !isVNode(messageOrOptions);
1140
- const options = isOptionsCall ? messageOrOptions : optionsOrAppContext ?? {};
1141
- const message = isOptionsCall ? options.message ?? "" : messageOrOptions;
1154
+ const options = isOptionsCall ? messageOrOptions : optionsOrAppContext != null ? optionsOrAppContext : {};
1155
+ const message = isOptionsCall ? (_a = options.message) != null ? _a : "" : messageOrOptions;
1142
1156
  const argumentAppContext = isOptionsCall ? optionsOrAppContext : appContext;
1143
1157
  const {
1144
1158
  message: _message,
@@ -1236,7 +1250,7 @@ function _resolveAppendTarget(appendTo) {
1236
1250
  try {
1237
1251
  const selector = rawSelector.startsWith("#") || rawSelector.startsWith(".") || rawSelector.startsWith("[") ? rawSelector : `#${rawSelector}`;
1238
1252
  return document.querySelector(selector) || appendTo;
1239
- } catch {
1253
+ } catch (e) {
1240
1254
  return appendTo;
1241
1255
  }
1242
1256
  }
@@ -1257,17 +1271,18 @@ function _resolveAppContext(appContext) {
1257
1271
  }
1258
1272
  const installWithContext = ElMessageBox.install;
1259
1273
  const messageBoxWithContext = ElMessageBox;
1260
- const elementPlusContext = installWithContext?.context || messageBoxWithContext._context || null;
1274
+ const elementPlusContext = (installWithContext == null ? void 0 : installWithContext.context) || messageBoxWithContext._context || null;
1261
1275
  if (typeof document === "undefined") {
1262
1276
  return elementPlusContext;
1263
1277
  }
1264
1278
  return elementPlusContext || _mountedAppContext();
1265
1279
  }
1266
1280
  function _mountedAppContext() {
1281
+ var _a, _b, _c;
1267
1282
  const roots = [document.querySelector("#app"), document.querySelector("[data-v-app]")];
1268
1283
  for (const root of roots) {
1269
1284
  const element = root;
1270
- const context = element?.__vue_app__?._context ?? element?._vue_app?._context;
1285
+ const context = (_c = (_a = element == null ? void 0 : element.__vue_app__) == null ? void 0 : _a._context) != null ? _c : (_b = element == null ? void 0 : element._vue_app) == null ? void 0 : _b._context;
1271
1286
  if (context) {
1272
1287
  return context;
1273
1288
  }
@@ -1284,7 +1299,7 @@ function getVariable(propertyName, fallback = "") {
1284
1299
  const DEFAULT_BUILD_TIME_FALLBACK = "\u672A\u6CE8\u5165";
1285
1300
  function getUtilsBuildTime(fallback = DEFAULT_BUILD_TIME_FALLBACK) {
1286
1301
  {
1287
- return "2026-11-23 13:45:27";
1302
+ return "2026-11-24 15:42:10";
1288
1303
  }
1289
1304
  }
1290
1305
  function test() {