@dooboostore/simple-boot-http-server-ssr 1.0.12 → 1.0.14

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.
Files changed (59) hide show
  1. package/README.MD +1 -3
  2. package/dist/cjs/filters/IntentSchemeFilter.js.map +2 -2
  3. package/dist/cjs/filters/SSRDomParserFilter.js +186 -0
  4. package/dist/cjs/filters/SSRDomParserFilter.js.map +7 -0
  5. package/dist/cjs/filters/SSRFilter.js +1 -1
  6. package/dist/cjs/filters/SSRFilter.js.map +2 -2
  7. package/dist/cjs/filters/SSRLinkDomDomFilter.js +183 -0
  8. package/dist/cjs/filters/SSRLinkDomDomFilter.js.map +7 -0
  9. package/dist/cjs/initializers/DomParserInitializer.js +79 -0
  10. package/dist/cjs/initializers/DomParserInitializer.js.map +7 -0
  11. package/dist/cjs/initializers/LinkedomInitializer.js +81 -0
  12. package/dist/cjs/initializers/LinkedomInitializer.js.map +7 -0
  13. package/dist/cjs/proxy/SymbolIntentApiServiceProxy.js +85 -73
  14. package/dist/cjs/proxy/SymbolIntentApiServiceProxy.js.map +2 -2
  15. package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.js +2 -77
  16. package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.js.map +2 -2
  17. package/dist/esm/filters/IntentSchemeFilter.js.map +2 -2
  18. package/dist/esm/filters/SSRDomParserFilter.js +163 -0
  19. package/dist/esm/filters/SSRDomParserFilter.js.map +7 -0
  20. package/dist/esm/filters/SSRFilter.js +1 -1
  21. package/dist/esm/filters/SSRFilter.js.map +2 -2
  22. package/dist/esm/filters/SSRLinkDomDomFilter.js +160 -0
  23. package/dist/esm/filters/SSRLinkDomDomFilter.js.map +7 -0
  24. package/dist/esm/initializers/DomParserInitializer.js +46 -0
  25. package/dist/esm/initializers/DomParserInitializer.js.map +7 -0
  26. package/dist/esm/initializers/LinkedomInitializer.js +48 -0
  27. package/dist/esm/initializers/LinkedomInitializer.js.map +7 -0
  28. package/dist/esm/proxy/SymbolIntentApiServiceProxy.js +85 -73
  29. package/dist/esm/proxy/SymbolIntentApiServiceProxy.js.map +2 -2
  30. package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.js +2 -77
  31. package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.js.map +2 -2
  32. package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js +1184 -525
  33. package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js.map +4 -4
  34. package/dist/types/filters/IntentSchemeFilter.d.ts.map +1 -1
  35. package/dist/types/filters/SSRDomParserFilter.d.ts +57 -0
  36. package/dist/types/filters/SSRDomParserFilter.d.ts.map +1 -0
  37. package/dist/types/filters/SSRLinkDomDomFilter.d.ts +57 -0
  38. package/dist/types/filters/SSRLinkDomDomFilter.d.ts.map +1 -0
  39. package/dist/types/index.d.ts +0 -19
  40. package/dist/types/initializers/DomParserInitializer.d.ts +11 -0
  41. package/dist/types/initializers/DomParserInitializer.d.ts.map +1 -0
  42. package/dist/types/initializers/LinkedomInitializer.d.ts +11 -0
  43. package/dist/types/initializers/LinkedomInitializer.d.ts.map +1 -0
  44. package/dist/types/proxy/SymbolIntentApiServiceProxy.d.ts +2 -0
  45. package/dist/types/proxy/SymbolIntentApiServiceProxy.d.ts.map +1 -1
  46. package/dist/types/proxy/SymbolIntentApiServiceProxyBase.d.ts +0 -8
  47. package/dist/types/proxy/SymbolIntentApiServiceProxyBase.d.ts.map +1 -1
  48. package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js +1184 -525
  49. package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js.map +4 -4
  50. package/package.json +16 -14
  51. package/src/filters/IntentSchemeFilter.ts +51 -48
  52. package/src/filters/SSRDomParserFilter.ts +233 -0
  53. package/src/filters/SSRFilter.ts +2 -2
  54. package/src/filters/SSRLinkDomDomFilter.ts +227 -0
  55. package/src/initializers/DomParserInitializer.ts +70 -0
  56. package/src/initializers/LinkedomInitializer.ts +69 -0
  57. package/src/proxy/SymbolIntentApiServiceProxy.ts +100 -116
  58. package/src/proxy/SymbolIntentApiServiceProxyBase.ts +7 -85
  59. package/tsconfig.json +2 -1
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // ../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js
33
+ // ../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js
34
34
  var require_dist = __commonJS({
35
- "../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js"(exports, module) {
35
+ "../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js"(exports, module) {
36
36
  "use strict";
37
37
  var zlib = __require("zlib");
38
38
  module.exports = {
@@ -218,6 +218,14 @@ var ValidUtils;
218
218
  const isConstructorLike = (fn) => {
219
219
  return typeof fn === "function" && typeof fn.prototype !== "undefined";
220
220
  };
221
+ ValidUtils2.isUrl = (str) => {
222
+ try {
223
+ new URL(str);
224
+ return true;
225
+ } catch (_) {
226
+ return false;
227
+ }
228
+ };
221
229
  ValidUtils2.isFrozen = (obj) => {
222
230
  return Object.isFrozen(obj);
223
231
  };
@@ -654,57 +662,70 @@ var ObjectUtils;
654
662
  if (Path2.isFunctionScript(path2) || Path2.isArrowFunctionScript(path2)) {
655
663
  return path2;
656
664
  }
657
- if (path2.includes(" ? ") && path2.includes(" : ")) {
658
- const parts = path2.split(/(\s+\?\s+|\s+:\s+)/);
659
- const result = parts.map((part, index) => {
660
- if (index === 0) {
661
- const tokens2 = part.match(/[^?.[\]]+|\[[^\]]*\]/g);
662
- if (tokens2 && tokens2.length > 1) {
663
- return tokens2.join("?.");
664
- }
665
+ const nullishCoalescingPlaceholder = "__NULLISH_COALESCING__";
666
+ const hasNullishCoalescing = path2.includes("??");
667
+ let tempPath = path2;
668
+ if (hasNullishCoalescing) {
669
+ tempPath = tempPath.replace(/\?\?/g, nullishCoalescingPlaceholder);
670
+ }
671
+ const ternaryMatch = tempPath.match(/\?\s+[^:]*:/);
672
+ if (ternaryMatch) {
673
+ const questionMarkIndex = tempPath.indexOf("?");
674
+ const colonIndex = tempPath.indexOf(":", questionMarkIndex);
675
+ if (questionMarkIndex !== -1 && colonIndex !== -1) {
676
+ const charAfterQuestion = tempPath.charAt(questionMarkIndex + 1);
677
+ if (charAfterQuestion === " " || charAfterQuestion === " " || charAfterQuestion === "\n") {
678
+ const condition = tempPath.substring(0, questionMarkIndex).trim();
679
+ const trueBranch = tempPath.substring(questionMarkIndex + 1, colonIndex).trim();
680
+ const falseBranch = tempPath.substring(colonIndex + 1).trim();
681
+ const processedCondition = Path2.toOptionalChainPath(condition);
682
+ const processedTrueBranch = Path2.toOptionalChainPath(trueBranch);
683
+ const processedFalseBranch = Path2.toOptionalChainPath(falseBranch);
684
+ const finalResult = `${processedCondition} ? ${processedTrueBranch} : ${processedFalseBranch}`;
685
+ return hasNullishCoalescing ? finalResult.replace(new RegExp(nullishCoalescingPlaceholder, "g"), "??") : finalResult;
665
686
  }
666
- return part;
667
- });
668
- return result.join("");
687
+ }
669
688
  }
670
- if (path2.includes("(")) {
689
+ if (tempPath.includes("(")) {
671
690
  const functionCallMatches = [];
672
- let tempPath = path2;
691
+ let workingPath = tempPath;
673
692
  let counter = 0;
674
693
  const functionCallRegex = /(\w+)\(([^()]*(?:\([^()]*\)[^()]*)*)\)/g;
675
694
  let match;
676
- while ((match = functionCallRegex.exec(path2)) !== null) {
695
+ while ((match = functionCallRegex.exec(tempPath)) !== null) {
677
696
  const fullMatch = match[0];
678
697
  const funcName = match[1];
679
698
  const funcArgs = match[2];
680
699
  const placeholder = `__FUNC_CALL_${counter}__`;
681
- const processedArgs = funcArgs ? Path2.toOptionalChainPath(funcArgs) : "";
700
+ let processedArgs = funcArgs ? Path2.toOptionalChainPath(funcArgs) : "";
701
+ processedArgs = processedArgs.replace(/\?\.\s*$/, "");
682
702
  const processedFuncCall = `${funcName}?.(${processedArgs})`;
683
703
  functionCallMatches.push({
684
704
  original: fullMatch,
685
705
  processed: processedFuncCall,
686
706
  placeholder
687
707
  });
688
- tempPath = tempPath.replace(fullMatch, placeholder);
708
+ workingPath = workingPath.replace(fullMatch, placeholder);
689
709
  counter++;
690
710
  }
691
- const tokens2 = tempPath.match(/[^?.[\]]+|\[[^\]]*\]/g);
711
+ const tokens2 = workingPath.match(/[^?.[\]]+|\[[^\]]*\]/g);
692
712
  let processedPath = "";
693
713
  if (tokens2 && tokens2.length > 1) {
694
714
  processedPath = tokens2.join("?.");
695
715
  } else {
696
- processedPath = tempPath;
716
+ processedPath = workingPath;
697
717
  }
698
718
  for (const funcMatch of functionCallMatches) {
699
719
  processedPath = processedPath.replace(funcMatch.placeholder, funcMatch.processed);
700
720
  }
701
- return processedPath;
721
+ return hasNullishCoalescing ? processedPath.replace(new RegExp(nullishCoalescingPlaceholder, "g"), "??") : processedPath;
702
722
  }
703
- const tokens = path2.match(/[^?.[\]]+|\[[^\]]*\]/g);
723
+ const tokens = tempPath.match(/[^?.[\]]+|\[[^\]]*\]/g);
704
724
  if (!tokens) {
705
- return path2;
725
+ return hasNullishCoalescing ? path2 : path2;
706
726
  }
707
- return tokens.join("?.");
727
+ const result = tokens.join("?.");
728
+ return hasNullishCoalescing ? result.replace(new RegExp(nullishCoalescingPlaceholder, "g"), "??") : result;
708
729
  };
709
730
  Path2.removeOptionalChainOperator = (path2) => {
710
731
  if (!path2) {
@@ -945,7 +966,7 @@ var ObjectUtils;
945
966
  const func = new Function("window", "document", "console", `"use strict"; ${script}; `);
946
967
  func.call(destUser, globalContext.window, globalContext.document, globalContext.console);
947
968
  } catch (e) {
948
- console.error("detectPathFromScript error:", e);
969
+ console.error("detectPathFromScript error:", script, e);
949
970
  }
950
971
  if (options?.excludeThis) {
951
972
  const filteredVars = /* @__PURE__ */ new Set();
@@ -1077,117 +1098,6 @@ var getStorage = (window2) => {
1077
1098
  return window2.aroundStorage;
1078
1099
  };
1079
1100
 
1080
- // ../core/dist/esm/string/StringUtils.js
1081
- var StringUtils;
1082
- ((StringUtils2) => {
1083
- StringUtils2.deleteEnter = (data) => {
1084
- return data.replace(/\r?\n/g, "");
1085
- };
1086
- StringUtils2.pickEmoji = (data) => {
1087
- return data.match(/[\p{Emoji}]/gu) ?? [];
1088
- };
1089
- StringUtils2.regexExec = (regex, text) => {
1090
- let varExec = regex.exec(text);
1091
- const usingVars = [];
1092
- while (varExec) {
1093
- usingVars.push(varExec);
1094
- varExec = regex.exec(varExec.input);
1095
- }
1096
- return usingVars;
1097
- };
1098
- StringUtils2.regexExecArrayReplace = (origin, regexpExecArrayOrRegex, replace) => {
1099
- const regexpExecArrays = Array.isArray(regexpExecArrayOrRegex) ? regexpExecArrayOrRegex : StringUtils2.regexExec(regexpExecArrayOrRegex, origin);
1100
- regexpExecArrays.reverse().forEach((it) => {
1101
- const r = typeof replace === "string" ? replace : replace(it);
1102
- origin = origin.substr(0, it.index) + origin.substr(it.index).replace(it[0], r);
1103
- });
1104
- return origin;
1105
- };
1106
- StringUtils2.escapeSpecialCharacterRegExp = (data) => {
1107
- return data.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1108
- };
1109
- StringUtils2.trim = (data) => data.trim();
1110
- StringUtils2.rsubString = (data_s, blen_n) => data_s.substring(data_s.length - blen_n, data_s.length);
1111
- StringUtils2.lsubString = (data_s, alen_n) => data_s.substring(0, alen_n);
1112
- StringUtils2.lpad = (fill_s, len_n, full_s) => {
1113
- while (len_n > full_s.length) {
1114
- full_s = fill_s + full_s;
1115
- }
1116
- return StringUtils2.rsubString(full_s, len_n);
1117
- };
1118
- StringUtils2.rpad = (fill_s, len_n, full_s) => {
1119
- while (len_n > full_s.length) {
1120
- full_s += fill_s;
1121
- }
1122
- return StringUtils2.lsubString(full_s, len_n);
1123
- };
1124
- StringUtils2.lappend = (count_n, input_s) => {
1125
- let s = "";
1126
- let i = 0;
1127
- while (i++ < count_n) {
1128
- s += input_s;
1129
- }
1130
- return s;
1131
- };
1132
- StringUtils2.unescape = (html) => {
1133
- if (!html) return "";
1134
- const htmlEntity = {
1135
- quot: '"',
1136
- amp: "&",
1137
- apos: "'",
1138
- lt: "<",
1139
- gt: ">",
1140
- nbsp: "\xA0",
1141
- iexcl: "\xA1",
1142
- cent: "\xA2",
1143
- pound: "\xA3",
1144
- curren: "\xA4",
1145
- yen: "\xA5",
1146
- brvbar: "\xA6",
1147
- sect: "\xA7",
1148
- uml: "\xA8",
1149
- copy: "\xA9",
1150
- ordf: "\xAA",
1151
- laquo: "\xAB",
1152
- not: "\xAC",
1153
- shy: "\xAD",
1154
- reg: "\xAE",
1155
- macr: "\xAF",
1156
- deg: "\xB0",
1157
- plusmn: "\xB1",
1158
- sup2: "\xB2",
1159
- sup3: "\xB3",
1160
- acute: "\xB4",
1161
- micro: "\xB5",
1162
- para: "\xB6",
1163
- middot: "\xB7",
1164
- cedil: "\xB8",
1165
- sup1: "\xB9",
1166
- ordm: "\xBA",
1167
- raquo: "\xBB",
1168
- frac14: "\xBC",
1169
- frac12: "\xBD",
1170
- frac34: "\xBE",
1171
- iquest: "\xBF",
1172
- "#x27": "'"
1173
- };
1174
- return html.replace(/&((?:(?:[a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?)+);/gi, (match, entity) => {
1175
- const entities = entity.toLowerCase().split(";");
1176
- return entities.map((it) => it in htmlEntity ? htmlEntity[it] : match).join("");
1177
- });
1178
- };
1179
- StringUtils2.executeExpression = (formatString, object) => {
1180
- return formatString.replace(/\${([^{}]*)}/g, (matched, piece) => String(object[piece] ?? matched));
1181
- };
1182
- StringUtils2.ellipsis = (text, length) => {
1183
- if (text.length > length) return `${text.slice(0, length)}...`;
1184
- return text;
1185
- };
1186
- StringUtils2.appendPostposition = (text, { vowel, consonant }) => {
1187
- return `${text}${ValidUtils.lastConsonantLetter(text) ? consonant : vowel}`;
1188
- };
1189
- })(StringUtils || (StringUtils = {}));
1190
-
1191
1101
  // ../core/dist/esm/expression/Expression.js
1192
1102
  var Expression;
1193
1103
  ((Expression2) => {
@@ -1202,17 +1112,6 @@ var Expression;
1202
1112
  return binder;
1203
1113
  });
1204
1114
  };
1205
- let Group;
1206
- ((Group2) => {
1207
- Group2.isExpression = (data) => {
1208
- const reg = /[$#]\{([\s\S.]*?)\}[$#]/g;
1209
- return reg.test(data ?? "");
1210
- };
1211
- Group2.expressionGroups = (data) => {
1212
- const reg = /[$#]\{([\s\S.]*?)\}[$#]/g;
1213
- return StringUtils.regexExec(reg, data ?? "");
1214
- };
1215
- })(Group = Expression2.Group || (Expression2.Group = {}));
1216
1115
  let Path;
1217
1116
  ((Path2) => {
1218
1117
  Path2.pathNameData = (pathName, urlExpression) => {
@@ -1299,19 +1198,64 @@ var Intent = class {
1299
1198
  const paths = this.fullPath.split("?");
1300
1199
  return paths[1] ?? "";
1301
1200
  }
1201
+ getQueryParamDecodeURI(key) {
1202
+ const p = this.queryParamsDecodeURI;
1203
+ if (key) {
1204
+ return p[key];
1205
+ } else {
1206
+ return p;
1207
+ }
1208
+ }
1209
+ getQueryParamDecodeURIFirst(key) {
1210
+ const param = this.getQueryParamDecodeURI(key);
1211
+ if (Array.isArray(param)) {
1212
+ return param[0];
1213
+ } else {
1214
+ return param;
1215
+ }
1216
+ }
1217
+ getQueryParam(key) {
1218
+ const p = this.queryParams;
1219
+ if (key) {
1220
+ return p[key];
1221
+ } else {
1222
+ return p;
1223
+ }
1224
+ }
1225
+ getQueryParamFirst(key) {
1226
+ const param = this.getQueryParam(key);
1227
+ if (Array.isArray(param)) {
1228
+ return param[0];
1229
+ } else {
1230
+ return param;
1231
+ }
1232
+ }
1302
1233
  get queryParams() {
1303
1234
  const param = {};
1304
1235
  this.query.split("&")?.forEach((it) => {
1305
1236
  const a = it.split("=");
1306
- param[a[0]] = a[1];
1237
+ if (param[a[0]]) {
1238
+ if (Array.isArray(param[a[0]])) {
1239
+ param[a[0]].push(a[1]);
1240
+ } else {
1241
+ param[a[0]] = [param[a[0]], a[1]];
1242
+ }
1243
+ } else {
1244
+ param[a[0]] = a[1];
1245
+ }
1307
1246
  });
1308
1247
  return param;
1309
1248
  }
1310
- get queryParamsAfterDecodeURI() {
1249
+ get queryParamsDecodeURI() {
1311
1250
  const params = this.queryParams;
1312
1251
  for (const key in params) {
1313
1252
  if (params.hasOwnProperty(key)) {
1314
- params[key] = decodeURIComponent(params[key]);
1253
+ const param = params[key];
1254
+ if (Array.isArray(param)) {
1255
+ params[key] = param.map((p) => decodeURIComponent(p));
1256
+ } else {
1257
+ params[key] = decodeURIComponent(param);
1258
+ }
1315
1259
  }
1316
1260
  }
1317
1261
  return params;
@@ -2701,9 +2645,19 @@ var ConvertUtils;
2701
2645
  ConvertUtils22.jsonToMap = (jsonStr) => {
2702
2646
  return new Map(JSON.parse(jsonStr));
2703
2647
  };
2648
+ ConvertUtils22.toUrl = (data) => {
2649
+ try {
2650
+ return new URL(data);
2651
+ } catch (e) {
2652
+ throw new Error(`Invalid URL string: ${data}`);
2653
+ }
2654
+ };
2704
2655
  ConvertUtils22.decodeURIString = (data) => {
2705
2656
  return decodeURIComponent(data);
2706
2657
  };
2658
+ ConvertUtils22.encodeURIString = (data) => {
2659
+ return encodeURIComponent(data);
2660
+ };
2707
2661
  ConvertUtils22.objToStrMap = (obj) => {
2708
2662
  const strMap = /* @__PURE__ */ new Map();
2709
2663
  for (const k of Object.keys(obj)) {
@@ -2841,6 +2795,74 @@ var ConvertUtils;
2841
2795
  ConvertUtils22.decodeHTMLEscape = (data) => {
2842
2796
  return data.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&#x2F;/g, "/");
2843
2797
  };
2798
+ function escapeHTML(htmlString, option) {
2799
+ if (!htmlString) return "";
2800
+ const escapeMap = {
2801
+ "&": "&amp;",
2802
+ // 반드시 먼저 처리
2803
+ "<": "&lt;",
2804
+ ">": "&gt;",
2805
+ '"': "&quot;",
2806
+ "'": "&#39;",
2807
+ // or &apos; (하지만 HTML4에서는 &#39; 권장)
2808
+ "/": "&#x2F;",
2809
+ "`": "&#x60;",
2810
+ "=": "&#x3D;",
2811
+ "{": "&#123;",
2812
+ "}": "&#125;",
2813
+ "#": "&#35;",
2814
+ "$": "&#36;",
2815
+ "\n": "&#10;",
2816
+ // newline
2817
+ "\r": "&#13;",
2818
+ // carriage return
2819
+ " ": "&#9;",
2820
+ // tab
2821
+ "\xA0": "&nbsp;",
2822
+ // non-breaking space
2823
+ "\xA2": "&cent;",
2824
+ "\xA3": "&pound;",
2825
+ "\xA5": "&yen;",
2826
+ "\u20AC": "&euro;",
2827
+ "\xA9": "&copy;",
2828
+ "\xAE": "&reg;",
2829
+ "\u2122": "&trade;",
2830
+ "\xB0": "&deg;",
2831
+ "\xB1": "&plusmn;",
2832
+ "\xD7": "&times;",
2833
+ "\xF7": "&divide;",
2834
+ "\u2212": "&minus;",
2835
+ "\u2022": "&bull;",
2836
+ "\u2026": "&hellip;",
2837
+ "\u2190": "&larr;",
2838
+ "\u2192": "&rarr;",
2839
+ "\u2191": "&uarr;",
2840
+ "\u2193": "&darr;",
2841
+ "\u2194": "&harr;"
2842
+ };
2843
+ const targetsSet = option?.targets ? new Set(option.targets) : null;
2844
+ const filteredEscapeMap = targetsSet ? Object.fromEntries(Object.entries(escapeMap).filter(([key]) => targetsSet.has(key))) : escapeMap;
2845
+ const shouldEscapeAmpersand = !targetsSet || targetsSet.has("&");
2846
+ const charsToEscape = Object.keys(filteredEscapeMap).filter((char) => char !== "&");
2847
+ if (charsToEscape.length === 0 && !shouldEscapeAmpersand) {
2848
+ return htmlString;
2849
+ }
2850
+ const escapedChars = charsToEscape.map((char) => {
2851
+ return char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2852
+ }).join("");
2853
+ let result = htmlString;
2854
+ if (shouldEscapeAmpersand) {
2855
+ result = result.replace(/&/g, "&amp;");
2856
+ }
2857
+ if (escapedChars.length > 0) {
2858
+ const regex = new RegExp(`[${escapedChars}]`, "g");
2859
+ result = result.replace(regex, (match) => {
2860
+ return filteredEscapeMap[match] || match;
2861
+ });
2862
+ }
2863
+ return result;
2864
+ }
2865
+ ConvertUtils22.escapeHTML = escapeHTML;
2844
2866
  ConvertUtils22.copyObject = (obj, update = {}) => {
2845
2867
  return { ...obj, ...update };
2846
2868
  };
@@ -3003,6 +3025,29 @@ var ConvertUtils;
3003
3025
  ConvertUtils22.stringJsonToKeyPairs = (stringJson) => {
3004
3026
  return Array.from(stringJson.matchAll(/(\w+):\s*([^,}]+)/g)).map((match) => ({ key: match[1], value: match[2] }));
3005
3027
  };
3028
+ ConvertUtils22.stringToBase64 = (str) => {
3029
+ return btoa(str);
3030
+ };
3031
+ ConvertUtils22.uint8ArrayToBase64 = (bytes) => {
3032
+ let binary = "";
3033
+ const len = bytes.byteLength;
3034
+ for (let i = 0; i < len; i++) {
3035
+ binary += String.fromCharCode(bytes[i]);
3036
+ }
3037
+ return btoa(binary);
3038
+ };
3039
+ ConvertUtils22.base64ToString = (base64) => {
3040
+ return atob(base64);
3041
+ };
3042
+ ConvertUtils22.base64ToUint8Array = (base64) => {
3043
+ const binaryString = atob(base64);
3044
+ const len = binaryString.length;
3045
+ const bytes = new Uint8Array(len);
3046
+ for (let i = 0; i < len; i++) {
3047
+ bytes[i] = binaryString.charCodeAt(i);
3048
+ }
3049
+ return bytes;
3050
+ };
3006
3051
  })(ConvertUtils || (ConvertUtils = {}));
3007
3052
 
3008
3053
  // ../simple-boot/dist/esm/lifecycle/OnSimCreate.js
@@ -3127,17 +3172,37 @@ var RouterModule = class {
3127
3172
  return this.routerChains[0];
3128
3173
  }
3129
3174
  get firstRouteChainValue() {
3130
- return this.firstRouteChain.getValue();
3175
+ return this.firstRouteChain?.getValue();
3131
3176
  }
3132
3177
  get lastRouteChain() {
3133
3178
  return this.routerChains[this.routerChains.length - 1];
3134
3179
  }
3135
3180
  get lastRouteChainValue() {
3136
- return this.lastRouteChain.getValue();
3181
+ return this.lastRouteChain?.getValue();
3137
3182
  }
3138
3183
  hasActivateInLastRoute(obj) {
3139
3184
  return this.lastRouteChainValue?.hasActivate(obj) === true;
3140
3185
  }
3186
+ getQueryParamDecodeURI(key) {
3187
+ if (this.intent) {
3188
+ return this.intent.getQueryParamDecodeURI(key);
3189
+ }
3190
+ }
3191
+ getQueryParamDecodeURIFirst(key) {
3192
+ if (this.intent) {
3193
+ return this.intent.getQueryParamDecodeURIFirst(key);
3194
+ }
3195
+ }
3196
+ getQueryParam(key) {
3197
+ if (this.intent) {
3198
+ return this.intent.getQueryParam(key);
3199
+ }
3200
+ }
3201
+ getQueryParamFirst(key) {
3202
+ if (this.intent) {
3203
+ return this.intent.getQueryParamFirst(key);
3204
+ }
3205
+ }
3141
3206
  get queryParams() {
3142
3207
  if (this.intent) {
3143
3208
  return this.intent.queryParams;
@@ -3145,7 +3210,7 @@ var RouterModule = class {
3145
3210
  }
3146
3211
  get queryParamsAfterDecodeURI() {
3147
3212
  if (this.intent) {
3148
- return this.intent.queryParamsAfterDecodeURI;
3213
+ return this.intent.queryParamsDecodeURI;
3149
3214
  }
3150
3215
  }
3151
3216
  };
@@ -3164,7 +3229,7 @@ var RouterAction;
3164
3229
  };
3165
3230
  })(RouterAction || (RouterAction = {}));
3166
3231
 
3167
- // ../core/dist/esm/message/Subscriber..js
3232
+ // ../core/dist/esm/message/Subscriber.js
3168
3233
  var Subscriber = class {
3169
3234
  constructor(destination) {
3170
3235
  this.destination = destination;
@@ -4269,6 +4334,53 @@ var SimstanceManager = class _SimstanceManager {
4269
4334
  }
4270
4335
  };
4271
4336
 
4337
+ // ../simple-boot/dist/esm/intent/IntentSubscribe.js
4338
+ var isIntentSubscribe = (obj) => {
4339
+ return !!obj && typeof obj.intentSubscribe === "function";
4340
+ };
4341
+
4342
+ // ../simple-boot/dist/esm/decorators/cache/CacheDecorator.js
4343
+ var CacheMetadataKey = Symbol("Cache");
4344
+
4345
+ // ../simple-boot/dist/esm/decorators/event/EventListener.js
4346
+ var EventListenerMetadataKey = Symbol("EventListener");
4347
+
4348
+ // ../simple-boot/dist/esm/decorators/validate/Validation.js
4349
+ var ValidMetadataKey = Symbol("ValidMetadataKey");
4350
+ var getValidIndex = (target, propertyKey) => {
4351
+ if (target !== null && void 0 !== target && typeof target === "object") {
4352
+ target = target.constructor;
4353
+ }
4354
+ if (propertyKey) {
4355
+ const parameters = Reflect.getOwnMetadata(ValidMetadataKey, target, propertyKey);
4356
+ return parameters ?? [];
4357
+ } else {
4358
+ return ReflectUtils.getMetadata(ValidMetadataKey, target) ?? [];
4359
+ }
4360
+ };
4361
+ var ValidationMetadataKey = Symbol("ValidationMetadataKey");
4362
+ var getValidators = (target) => {
4363
+ if (target !== null && void 0 !== target && typeof target === "object") {
4364
+ target = target.constructor;
4365
+ }
4366
+ return ReflectUtils.getMetadata(ValidationMetadataKey, target) ?? [];
4367
+ };
4368
+ var execValidationInValid = (obj) => {
4369
+ return execValidation(obj).filter((it) => !it.valid);
4370
+ };
4371
+ var execValidation = (obj) => {
4372
+ const validators = getValidators(obj);
4373
+ const reesults = [];
4374
+ validators.forEach((it) => {
4375
+ reesults.push({
4376
+ name: it.propertyKey,
4377
+ valid: it.validator(it.propertyKey, it),
4378
+ message: ""
4379
+ });
4380
+ });
4381
+ return reesults;
4382
+ };
4383
+
4272
4384
  // ../simple-boot/dist/esm/intent/IntentManager.js
4273
4385
  var __decorate2 = function(decorators, target, key, desc) {
4274
4386
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -4310,7 +4422,7 @@ var IntentManager = class IntentManager2 {
4310
4422
  } else if (typeof it === "string") {
4311
4423
  it = new Intent(it, data);
4312
4424
  }
4313
- let intent = it;
4425
+ const intent = it;
4314
4426
  const r = [];
4315
4427
  if (!routerMatch) {
4316
4428
  if (intent.symbols) {
@@ -4329,7 +4441,7 @@ var IntentManager = class IntentManager2 {
4329
4441
  }
4330
4442
  });
4331
4443
  this.subject.next(it);
4332
- targetInstances.forEach((data2) => {
4444
+ for (let data2 of targetInstances) {
4333
4445
  let orNewSim = data2;
4334
4446
  if (orNewSim) {
4335
4447
  if (intent.paths.length > 0) {
@@ -4341,6 +4453,18 @@ var IntentManager = class IntentManager2 {
4341
4453
  lastProp = i;
4342
4454
  });
4343
4455
  if (orNewSim && typeof orNewSim === "function") {
4456
+ const injects = getInject(callthis, orNewSim.name);
4457
+ if (injects) {
4458
+ for (const inject of injects) {
4459
+ let v = this.simstanceManager.findLastSim(inject.config).getValue();
4460
+ if (typeof inject.config.returnFactory === "function") {
4461
+ v = await inject.config.returnFactory({ instance: callthis, methodName: orNewSim.name, parameter: intent.data }, v);
4462
+ } else if (typeof inject.config.returnFactory === "string") {
4463
+ v = await v[inject.config.returnFactory]({ instance: callthis, methodName: orNewSim.name, parameter: intent.data }, v);
4464
+ }
4465
+ intent.data[inject.index] = v;
4466
+ }
4467
+ }
4344
4468
  if (PublishType.DATA_PARAMETERS === intent.publishType) {
4345
4469
  r.push(orNewSim.call(callthis, intent.data));
4346
4470
  } else if (PublishType.INLINE_DATA_PARAMETERS === intent.publishType) {
@@ -4354,15 +4478,22 @@ var IntentManager = class IntentManager2 {
4354
4478
  }
4355
4479
  } else {
4356
4480
  if (PublishType.DATA_PARAMETERS === intent.publishType) {
4357
- r.push(orNewSim?.intentSubscribe?.(intent.data));
4481
+ if (isIntentSubscribe(orNewSim)) {
4482
+ r.push(orNewSim.intentSubscribe(intent.data));
4483
+ }
4358
4484
  } else if (PublishType.INLINE_DATA_PARAMETERS === intent.publishType) {
4359
- r.push(orNewSim?.intentSubscribe?.(...intent.data));
4485
+ if (isIntentSubscribe(orNewSim)) {
4486
+ r.push(orNewSim.intentSubscribe(...intent.data));
4487
+ }
4360
4488
  } else {
4361
- r.push(orNewSim?.intentSubscribe?.(intent));
4489
+ if (isIntentSubscribe(orNewSim)) {
4490
+ r.push(orNewSim?.intentSubscribe?.(intent));
4491
+ }
4362
4492
  }
4363
4493
  }
4364
4494
  }
4365
- });
4495
+ }
4496
+ ;
4366
4497
  return r;
4367
4498
  }
4368
4499
  };
@@ -4374,6 +4505,7 @@ IntentManager = __decorate2([
4374
4505
  // ../simple-boot-http-server/dist/esm/codes/HttpStatus.js
4375
4506
  var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
4376
4507
  HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
4508
+ HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
4377
4509
  HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
4378
4510
  HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
4379
4511
  HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
@@ -4550,6 +4682,136 @@ var NotFoundError = class extends HttpError {
4550
4682
  }
4551
4683
  };
4552
4684
 
4685
+ // ../core/dist/esm/string/StringUtils.js
4686
+ var StringUtils;
4687
+ ((StringUtils2) => {
4688
+ StringUtils2.deleteEnter = (data) => {
4689
+ return data.replace(/\r?\n/g, "");
4690
+ };
4691
+ StringUtils2.pickEmoji = (data) => {
4692
+ return data.match(/[\p{Emoji}]/gu) ?? [];
4693
+ };
4694
+ StringUtils2.regexExec = (regex, text) => {
4695
+ let varExec = regex.exec(text);
4696
+ const usingVars = [];
4697
+ while (varExec) {
4698
+ usingVars.push(varExec);
4699
+ varExec = regex.exec(varExec.input);
4700
+ }
4701
+ return usingVars;
4702
+ };
4703
+ StringUtils2.escapeSpecialCharacterRegExp = (data) => {
4704
+ return data.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4705
+ };
4706
+ StringUtils2.trim = (data) => data.trim();
4707
+ StringUtils2.rsubString = (data_s, blen_n) => data_s.substring(data_s.length - blen_n, data_s.length);
4708
+ StringUtils2.lsubString = (data_s, alen_n) => data_s.substring(0, alen_n);
4709
+ StringUtils2.lpad = (fill_s, len_n, full_s) => {
4710
+ while (len_n > full_s.length) {
4711
+ full_s = fill_s + full_s;
4712
+ }
4713
+ return StringUtils2.rsubString(full_s, len_n);
4714
+ };
4715
+ StringUtils2.rpad = (fill_s, len_n, full_s) => {
4716
+ while (len_n > full_s.length) {
4717
+ full_s += fill_s;
4718
+ }
4719
+ return StringUtils2.lsubString(full_s, len_n);
4720
+ };
4721
+ StringUtils2.lappend = (count_n, input_s) => {
4722
+ let s = "";
4723
+ let i = 0;
4724
+ while (i++ < count_n) {
4725
+ s += input_s;
4726
+ }
4727
+ return s;
4728
+ };
4729
+ StringUtils2.unescape = (html) => {
4730
+ if (!html) return "";
4731
+ const htmlEntity = {
4732
+ quot: '"',
4733
+ amp: "&",
4734
+ apos: "'",
4735
+ lt: "<",
4736
+ gt: ">",
4737
+ nbsp: "\xA0",
4738
+ iexcl: "\xA1",
4739
+ cent: "\xA2",
4740
+ pound: "\xA3",
4741
+ curren: "\xA4",
4742
+ yen: "\xA5",
4743
+ brvbar: "\xA6",
4744
+ sect: "\xA7",
4745
+ uml: "\xA8",
4746
+ copy: "\xA9",
4747
+ ordf: "\xAA",
4748
+ laquo: "\xAB",
4749
+ not: "\xAC",
4750
+ shy: "\xAD",
4751
+ reg: "\xAE",
4752
+ macr: "\xAF",
4753
+ deg: "\xB0",
4754
+ plusmn: "\xB1",
4755
+ sup2: "\xB2",
4756
+ sup3: "\xB3",
4757
+ acute: "\xB4",
4758
+ micro: "\xB5",
4759
+ para: "\xB6",
4760
+ middot: "\xB7",
4761
+ cedil: "\xB8",
4762
+ sup1: "\xB9",
4763
+ ordm: "\xBA",
4764
+ raquo: "\xBB",
4765
+ frac14: "\xBC",
4766
+ frac12: "\xBD",
4767
+ frac34: "\xBE",
4768
+ iquest: "\xBF",
4769
+ "#x27": "'"
4770
+ };
4771
+ return html.replace(/&((?:(?:[a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?)+);/gi, (match, entity) => {
4772
+ const entities = entity.toLowerCase().split(";");
4773
+ return entities.map((it) => it in htmlEntity ? htmlEntity[it] : match).join("");
4774
+ });
4775
+ };
4776
+ StringUtils2.executeExpression = (formatString, object) => {
4777
+ return formatString.replace(/\${([^{}]*)}/g, (matched, piece) => String(object[piece] ?? matched));
4778
+ };
4779
+ StringUtils2.ellipsis = (text, length) => {
4780
+ if (text.length > length) return `${text.slice(0, length)}...`;
4781
+ return text;
4782
+ };
4783
+ StringUtils2.appendPostposition = (text, { vowel, consonant }) => {
4784
+ return `${text}${ValidUtils.lastConsonantLetter(text) ? consonant : vowel}`;
4785
+ };
4786
+ StringUtils2.replaceSequentially = (text, replacements) => {
4787
+ let remainingText = text;
4788
+ let result = "";
4789
+ while (remainingText.length > 0) {
4790
+ let bestMatch = null;
4791
+ for (const replacement of replacements) {
4792
+ const newRegex = new RegExp(replacement.regex);
4793
+ const match = newRegex.exec(remainingText);
4794
+ if (match) {
4795
+ if (bestMatch === null || match.index < bestMatch.index) {
4796
+ bestMatch = { index: match.index, match, replacement };
4797
+ }
4798
+ }
4799
+ }
4800
+ if (bestMatch) {
4801
+ const { index, match, replacement } = bestMatch;
4802
+ const matchedString = match[0];
4803
+ result += remainingText.substring(0, index);
4804
+ result += replacement.callback(matchedString);
4805
+ remainingText = remainingText.substring(index + matchedString.length);
4806
+ } else {
4807
+ result += remainingText;
4808
+ break;
4809
+ }
4810
+ }
4811
+ return result;
4812
+ };
4813
+ })(StringUtils || (StringUtils = {}));
4814
+
4553
4815
  // ../core-web/dist/esm/script/ScriptUtils.js
4554
4816
  var ScriptUtils = class _ScriptUtils {
4555
4817
  /**
@@ -4766,6 +5028,71 @@ var Promises;
4766
5028
  });
4767
5029
  return { promise, resolve, reject };
4768
5030
  };
5031
+ Promises2.executeInChunks = async (promiseFactories, chunkSize = 10) => {
5032
+ const results = [];
5033
+ for (let i = 0; i < promiseFactories.length; i += chunkSize) {
5034
+ const chunk = promiseFactories.slice(i, i + chunkSize);
5035
+ const chunkResults = await Promise.all(chunk.map((factory) => factory()));
5036
+ results.push(...chunkResults);
5037
+ if (i + chunkSize < promiseFactories.length) {
5038
+ await (0, Promises2.sleep)(100);
5039
+ }
5040
+ }
5041
+ return results;
5042
+ };
5043
+ Promises2.executeWithConcurrency = async (promiseFactories, concurrency = 10) => {
5044
+ const results = new Array(promiseFactories.length);
5045
+ let currentIndex = 0;
5046
+ const executeNext = async (index) => {
5047
+ while (currentIndex < promiseFactories.length) {
5048
+ const factoryIndex = currentIndex++;
5049
+ results[factoryIndex] = await promiseFactories[factoryIndex]();
5050
+ }
5051
+ };
5052
+ const workers = Array(Math.min(concurrency, promiseFactories.length)).fill(0).map((_, i) => executeNext(i));
5053
+ await Promise.all(workers);
5054
+ return results;
5055
+ };
5056
+ Promises2.executeWithLimit = async (promiseFactories, limit = 5) => {
5057
+ const results = new Array(promiseFactories.length);
5058
+ const executing = [];
5059
+ for (const [index, factory] of promiseFactories.entries()) {
5060
+ const promise = factory().then((result) => {
5061
+ results[index] = result;
5062
+ }).finally(() => {
5063
+ executing.splice(executing.indexOf(promise), 1);
5064
+ });
5065
+ executing.push(promise);
5066
+ if (executing.length >= limit) {
5067
+ await Promise.race(executing);
5068
+ }
5069
+ }
5070
+ await Promise.all(executing);
5071
+ return results;
5072
+ };
5073
+ Promises2.retry = async (factory, config) => {
5074
+ const initialDelay = config.delay?.initialDelay ?? 0;
5075
+ const retryDelay = config.delay?.retryDelay ?? 0;
5076
+ if (initialDelay > 0) {
5077
+ await (0, Promises2.sleep)(initialDelay);
5078
+ }
5079
+ let lastError;
5080
+ for (let attempt = 0; attempt <= config.retry; attempt++) {
5081
+ try {
5082
+ return await factory(attempt, lastError);
5083
+ } catch (error) {
5084
+ lastError = error;
5085
+ if (attempt === config.retry) {
5086
+ break;
5087
+ }
5088
+ config.onRetry?.(error, attempt + 1);
5089
+ if (retryDelay > 0) {
5090
+ await (0, Promises2.sleep)(retryDelay);
5091
+ }
5092
+ }
5093
+ }
5094
+ throw lastError;
5095
+ };
4769
5096
  let Result;
4770
5097
  ((Result2) => {
4771
5098
  async function awaitWrap(promise) {
@@ -5283,11 +5610,11 @@ var _EventManager = class _EventManager2 {
5283
5610
  findAttrElements(fragment, config) {
5284
5611
  const elements = /* @__PURE__ */ new Set();
5285
5612
  const addAttributes = config?.applyEvents?.map((it) => it.attrName) ?? [];
5286
- addAttributes.concat([..._EventManager2.attrNames]).forEach((attrName) => {
5287
- fragment?.querySelectorAll(`[${attrName}]`).forEach((it) => {
5288
- elements.add(it);
5289
- });
5290
- });
5613
+ const attrs = addAttributes.concat([..._EventManager2.attrNames]).filter(Boolean);
5614
+ if (attrs.length) {
5615
+ const selector = attrs.map((a) => `[${a}]`).join(",");
5616
+ fragment?.querySelectorAll(selector).forEach((it) => elements.add(it));
5617
+ }
5291
5618
  return elements;
5292
5619
  }
5293
5620
  applyEvent(obj, childNodes, config) {
@@ -5299,7 +5626,7 @@ var _EventManager = class _EventManager2 {
5299
5626
  this.procAttr(childNodes, _EventManager2.valueAttrName, (it, attribute) => {
5300
5627
  const script = attribute;
5301
5628
  if (script) {
5302
- const data = ScriptUtils.evaluateReturn(script, obj);
5629
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5303
5630
  if (it.value !== data) {
5304
5631
  it.value = data;
5305
5632
  }
@@ -5308,7 +5635,7 @@ var _EventManager = class _EventManager2 {
5308
5635
  this.procAttr(childNodes, _EventManager2.checkedAttrName, (it, attribute) => {
5309
5636
  const script = attribute;
5310
5637
  if (script) {
5311
- const data = ScriptUtils.evaluateReturn(script, obj);
5638
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5312
5639
  if (it.checked !== data) {
5313
5640
  it.checked = data;
5314
5641
  }
@@ -5317,7 +5644,7 @@ var _EventManager = class _EventManager2 {
5317
5644
  this.procAttr(childNodes, _EventManager2.selectedAttrName, (it, attribute) => {
5318
5645
  const script = attribute;
5319
5646
  if (script) {
5320
- const data = ScriptUtils.evaluateReturn(script, obj);
5647
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5321
5648
  if (it.selected !== data) {
5322
5649
  it.selected = data;
5323
5650
  }
@@ -5326,7 +5653,7 @@ var _EventManager = class _EventManager2 {
5326
5653
  this.procAttr(childNodes, _EventManager2.readonlyAttrName, (it, attribute) => {
5327
5654
  const script = attribute;
5328
5655
  if (script) {
5329
- const data = ScriptUtils.evaluateReturn(script, obj);
5656
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5330
5657
  if (it.readOnly !== data) {
5331
5658
  it.readOnly = data;
5332
5659
  }
@@ -5335,7 +5662,7 @@ var _EventManager = class _EventManager2 {
5335
5662
  this.procAttr(childNodes, _EventManager2.disabledAttrName, (it, attribute) => {
5336
5663
  const script = attribute;
5337
5664
  if (script) {
5338
- const data = ScriptUtils.evaluateReturn(script, obj);
5665
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5339
5666
  if (it.disabled !== data) {
5340
5667
  it.disabled = data;
5341
5668
  }
@@ -5344,7 +5671,7 @@ var _EventManager = class _EventManager2 {
5344
5671
  this.procAttr(childNodes, _EventManager2.hiddenAttrName, (it, attribute) => {
5345
5672
  const script = attribute;
5346
5673
  if (script) {
5347
- const data = ScriptUtils.evaluateReturn(script, obj);
5674
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5348
5675
  if (it.hidden !== data) {
5349
5676
  it.hidden = data;
5350
5677
  }
@@ -5353,7 +5680,7 @@ var _EventManager = class _EventManager2 {
5353
5680
  this.procAttr(childNodes, _EventManager2.requiredAttrName, (it, attribute) => {
5354
5681
  const script = attribute;
5355
5682
  if (script) {
5356
- const data = ScriptUtils.evaluateReturn(script, obj);
5683
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5357
5684
  if (it.required !== data) {
5358
5685
  it.required = data;
5359
5686
  }
@@ -5362,7 +5689,7 @@ var _EventManager = class _EventManager2 {
5362
5689
  this.procAttr(childNodes, _EventManager2.openAttrName, (it, attribute) => {
5363
5690
  const script = attribute;
5364
5691
  if (script) {
5365
- const data = ScriptUtils.evaluateReturn(script, obj);
5692
+ const data = ObjectUtils.Script.evaluateReturn(script, obj);
5366
5693
  if (it.open !== data) {
5367
5694
  it.open = data;
5368
5695
  }
@@ -5371,13 +5698,29 @@ var _EventManager = class _EventManager2 {
5371
5698
  this.procAttr(childNodes, _EventManager2.normalAttrMapAttrName, (it, attribute) => {
5372
5699
  const map = new Map(JSON.parse(attribute));
5373
5700
  map.forEach((v, k) => {
5374
- const data = ScriptUtils.evaluate(`const $element = this.element; return ${v} `, Object.assign(obj, {
5701
+ const variablePaths = v.variablePaths;
5702
+ let targetScript = v.originalAttrValue;
5703
+ let script;
5704
+ if (v.isStringTemplate) {
5705
+ variablePaths.forEach((it2) => {
5706
+ let r = ObjectUtils.Path.toOptionalChainPath(it2.inner);
5707
+ targetScript = targetScript.replaceAll(it2.origin, `\${${r}}`);
5708
+ });
5709
+ script = "`" + targetScript + "`";
5710
+ } else {
5711
+ variablePaths.forEach((it2) => {
5712
+ let r = ObjectUtils.Path.toOptionalChainPath(it2.inner);
5713
+ targetScript = targetScript.replaceAll(it2.origin, `${r}`);
5714
+ });
5715
+ script = targetScript;
5716
+ }
5717
+ const data = ObjectUtils.Script.evaluate(`const $element = this.element; return ${script}`, Object.assign(obj, {
5375
5718
  __render: Object.freeze({
5376
5719
  element: it,
5377
5720
  attribute: ElementUtils.getAttributeToObject(it)
5378
5721
  })
5379
5722
  }));
5380
- if (data === null) {
5723
+ if (data === null || data === void 0) {
5381
5724
  it.removeAttribute(k);
5382
5725
  } else {
5383
5726
  it.setAttribute(k, data);
@@ -5396,19 +5739,19 @@ var _EventManager = class _EventManager2 {
5396
5739
  const mapScript = it.getAttribute(`${linkInfo.name}:map`);
5397
5740
  let bindObj = obj;
5398
5741
  if (ownerVariablePathName) {
5399
- bindObj = ScriptUtils.evaluateReturn(ownerVariablePathName, obj);
5742
+ bindObj = ObjectUtils.Script.evaluateReturn(ownerVariablePathName, obj);
5400
5743
  }
5401
5744
  const getValue = this.getValue(obj, varName, bindObj);
5402
5745
  if (typeof getValue === "function" && getValue) {
5403
5746
  let setValue = it[linkInfo.property];
5404
5747
  if (mapScript) {
5405
- setValue = ScriptUtils.evaluate(`${this.getBindScript(config)} return ${mapScript}`, Object.assign(bindObj, { __render: Object.freeze({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: _EventManager2.setBindProperty(config?.scripts, obj), ...config?.eventVariables }) }));
5748
+ setValue = ObjectUtils.Script.evaluate(`${this.getBindScript(config)} return ${mapScript}`, Object.assign(bindObj, { __render: Object.freeze({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: _EventManager2.setBindProperty(config?.scripts, obj), ...config?.eventVariables }) }));
5406
5749
  }
5407
5750
  getValue(setValue);
5408
5751
  } else if (getValue) {
5409
5752
  let setValue = getValue;
5410
5753
  if (mapScript) {
5411
- setValue = ScriptUtils.evaluate(`${this.getBindScript(config)} return ${mapScript}`, Object.assign(bindObj, { __render: Object.freeze({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: _EventManager2.setBindProperty(config?.scripts, obj), ...config?.eventVariables }) }));
5754
+ setValue = ObjectUtils.Script.evaluate(`${this.getBindScript(config)} return ${mapScript}`, Object.assign(bindObj, { __render: Object.freeze({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: _EventManager2.setBindProperty(config?.scripts, obj), ...config?.eventVariables }) }));
5412
5755
  }
5413
5756
  if (setValue === null) {
5414
5757
  it.removeAttribute(linkInfo.property);
@@ -5431,10 +5774,10 @@ var _EventManager = class _EventManager2 {
5431
5774
  const filterScript = element.getAttribute(`${attr}:filter`);
5432
5775
  let filter2 = true;
5433
5776
  if (filterScript) {
5434
- filter2 = ScriptUtils.evaluate(`${this.getBindScript(config)} return ${filterScript}`, context) ?? false;
5777
+ filter2 = ObjectUtils.Script.evaluate(`${this.getBindScript(config)} return ${filterScript}`, context) ?? false;
5435
5778
  }
5436
5779
  if (filter2) {
5437
- ScriptUtils.evaluate(`${this.getBindScript(config)} ${script}`, context);
5780
+ ObjectUtils.Script.evaluate(`${this.getBindScript(config)} ${script}`, context);
5438
5781
  }
5439
5782
  };
5440
5783
  element.addEventListener(eventName, handler);
@@ -5446,7 +5789,7 @@ var _EventManager = class _EventManager2 {
5446
5789
  script = "return " + script;
5447
5790
  }
5448
5791
  if (script) {
5449
- ScriptUtils.evaluate(`${this.getBindScript(config)}; ${script} `, Object.assign(obj, {
5792
+ ObjectUtils.Script.evaluate(`${this.getBindScript(config)}; ${script} `, Object.assign(obj, {
5450
5793
  __render: Object.freeze({
5451
5794
  element: it,
5452
5795
  attribute: ElementUtils.getAttributeToObject(it),
@@ -5472,7 +5815,7 @@ var _EventManager = class _EventManager2 {
5472
5815
  script = "return " + script;
5473
5816
  }
5474
5817
  if (script) {
5475
- ScriptUtils.evaluate(`${this.getBindScript(config)}; ${script} `, Object.assign(obj, {
5818
+ ObjectUtils.Script.evaluate(`${this.getBindScript(config)}; ${script} `, Object.assign(obj, {
5476
5819
  __render: Object.freeze({
5477
5820
  element: it,
5478
5821
  attribute: ElementUtils.getAttributeToObject(it),
@@ -5489,21 +5832,29 @@ var _EventManager = class _EventManager2 {
5489
5832
  script = "return " + script;
5490
5833
  }
5491
5834
  if (_EventManager2.isUsingThisVar(script, varName) || varName === void 0) {
5492
- const data = ScriptUtils.evaluate(`const $element = this.__render.element; ${script} `, Object.assign(obj, {
5835
+ const data = ObjectUtils.Script.evaluate(`const $element = this.__render.element; ${script} `, Object.assign(obj, {
5493
5836
  __render: Object.freeze({
5494
5837
  element: it,
5495
5838
  attribute: ElementUtils.getAttributeToObject(it)
5496
5839
  })
5497
5840
  }));
5498
5841
  if (typeof data === "string") {
5499
- it.setAttribute("style", data);
5842
+ data.split(";").forEach((sit) => {
5843
+ const [key, value] = sit.split(":").map((s) => s.trim());
5844
+ if (key && value) {
5845
+ it.style[key] = value;
5846
+ }
5847
+ });
5500
5848
  } else if (Array.isArray(data)) {
5501
- it.setAttribute("style", data.join(";"));
5849
+ data.forEach((sit) => {
5850
+ const [key, value] = sit.split(":").map((s) => s.trim());
5851
+ if (key && value) {
5852
+ it.style[key] = value;
5853
+ }
5854
+ });
5502
5855
  } else {
5503
5856
  for (const [key, value] of Object.entries(data)) {
5504
- if (it instanceof HTMLElement) {
5505
- it.style[key] = String(value);
5506
- }
5857
+ it.style[key] = value === null ? null : String(value);
5507
5858
  }
5508
5859
  }
5509
5860
  }
@@ -5514,29 +5865,77 @@ var _EventManager = class _EventManager2 {
5514
5865
  script = "return " + script;
5515
5866
  }
5516
5867
  if (_EventManager2.isUsingThisVar(script, varName) || varName === void 0) {
5517
- const data = ScriptUtils.evaluate(`const $element = this.element; ${script} `, Object.assign(obj, {
5868
+ const data = ObjectUtils.Script.evaluate(`const $element = this.element; ${script} `, Object.assign(obj, {
5518
5869
  __render: Object.freeze({
5519
5870
  element: it,
5520
5871
  attribute: ElementUtils.getAttributeToObject(it)
5521
5872
  })
5522
5873
  }));
5523
5874
  if (typeof data === "string") {
5524
- it.setAttribute("class", data);
5875
+ data.split(" ").forEach((cit) => it.classList.add(cit.trim()));
5525
5876
  } else if (Array.isArray(data)) {
5526
- it.setAttribute("class", data.join(" "));
5877
+ data.forEach((cit) => it.classList.add(cit.trim()));
5527
5878
  } else {
5528
5879
  for (const [key, value] of Object.entries(data)) {
5529
5880
  if (it instanceof HTMLElement) {
5530
5881
  if (value) {
5531
- it.classList.add(key);
5882
+ it.classList.add(key.trim());
5532
5883
  } else {
5533
- it.classList.remove(key);
5884
+ it.classList.remove(key.trim());
5534
5885
  }
5535
5886
  }
5536
5887
  }
5537
5888
  }
5538
5889
  }
5539
5890
  });
5891
+ this.procAttr(elements, _EventManager2.valueAttrName, (it, attribute) => {
5892
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5893
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5894
+ if (it.value !== data) it.value = data;
5895
+ }
5896
+ });
5897
+ this.procAttr(elements, _EventManager2.checkedAttrName, (it, attribute) => {
5898
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5899
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5900
+ if (it.checked !== data) it.checked = data;
5901
+ }
5902
+ });
5903
+ this.procAttr(elements, _EventManager2.selectedAttrName, (it, attribute) => {
5904
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5905
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5906
+ if (it.selected !== data) it.selected = data;
5907
+ }
5908
+ });
5909
+ this.procAttr(elements, _EventManager2.readonlyAttrName, (it, attribute) => {
5910
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5911
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5912
+ if (it.readOnly !== data) it.readOnly = data;
5913
+ }
5914
+ });
5915
+ this.procAttr(elements, _EventManager2.disabledAttrName, (it, attribute) => {
5916
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5917
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5918
+ if (it.disabled !== data) it.disabled = data;
5919
+ }
5920
+ });
5921
+ this.procAttr(elements, _EventManager2.hiddenAttrName, (it, attribute) => {
5922
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5923
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5924
+ if (it.hidden !== data) it.hidden = data;
5925
+ }
5926
+ });
5927
+ this.procAttr(elements, _EventManager2.requiredAttrName, (it, attribute) => {
5928
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5929
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5930
+ if (it.required !== data) it.required = data;
5931
+ }
5932
+ });
5933
+ this.procAttr(elements, _EventManager2.openAttrName, (it, attribute) => {
5934
+ if (_EventManager2.isUsingThisVar(attribute, varName) || varName === void 0) {
5935
+ const data = ObjectUtils.Script.evaluateReturn(attribute, obj);
5936
+ if (it.open !== data) it.open = data;
5937
+ }
5938
+ });
5540
5939
  }
5541
5940
  procAttr(elements = /* @__PURE__ */ new Set(), attrName, callBack) {
5542
5941
  const sets = /* @__PURE__ */ new Set();
@@ -5561,7 +5960,7 @@ var _EventManager = class _EventManager2 {
5561
5960
  });
5562
5961
  }
5563
5962
  getValue(obj, name, bindObj) {
5564
- let r = ScriptUtils.evaluateReturn(name, obj);
5963
+ let r = ObjectUtils.Script.evaluateReturn(name, obj);
5565
5964
  if (typeof r === "function") {
5566
5965
  r = r.bind(bindObj ?? obj);
5567
5966
  }
@@ -5661,6 +6060,7 @@ _EventManager.VARNAMES = [_EventManager.SCRIPTS_VARNAME, _EventManager.FAG_VARNA
5661
6060
  _EventManager.WINDOW_EVENT_POPSTATE = "popstate";
5662
6061
  _EventManager.WINDOW_EVENT_RESIZE = "resize";
5663
6062
  _EventManager.WINDOW_EVENTS = [_EventManager.WINDOW_EVENT_POPSTATE, _EventManager.WINDOW_EVENT_RESIZE];
6063
+ _EventManager.noDetectAttr = [_EventManager.normalAttrMapAttrName];
5664
6064
  _EventManager.attrNames = [
5665
6065
  _EventManager.valueAttrName,
5666
6066
  _EventManager.checkedAttrName,
@@ -5751,7 +6151,7 @@ var Dr = class extends OperatorExecuterAttrRequire {
5751
6151
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
5752
6152
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
5753
6153
  const newTemp = this.source.config.window.document.createElement("temp");
5754
- ScriptUtils.evaluate(`
6154
+ ObjectUtils.Script.evaluate(`
5755
6155
  ${this.render.bindScript}
5756
6156
  const n = $element.cloneNode(true);
5757
6157
  var destIt = ${this.elementSource.attrs.drItOption};
@@ -5794,7 +6194,7 @@ var DrIf = class extends OperatorExecuterAttrRequire {
5794
6194
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, "DrIf");
5795
6195
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
5796
6196
  const newTemp = this.source.config.window.document.createElement("temp");
5797
- const keepgoing = ScriptUtils.evaluate(`
6197
+ const keepgoing = ObjectUtils.Script.evaluate(`
5798
6198
  ${this.render.bindScript}
5799
6199
  ${this.elementSource.attrs.drBeforeOption ?? ""}
5800
6200
  if ($rawSet.data === (${ObjectUtils.Path.toOptionalChainPath(attr)})) {
@@ -5909,7 +6309,7 @@ var isOnDrThisBind = (obj) => {
5909
6309
  var DrThis = class extends OperatorExecuterAttrRequire {
5910
6310
  async executeAttrRequire(attr) {
5911
6311
  const optionIf = this.elementSource.attrs.drDetectIfOption ?? this.elementSource.attrs.drIfOption;
5912
- const ok = ScriptUtils.evaluate(`
6312
+ const ok = ObjectUtils.Script.evaluate(`
5913
6313
  ${this.render.bindScript}
5914
6314
  try {
5915
6315
  const ok = ${this.elementSource.attrs.drThis};
@@ -6245,9 +6645,9 @@ var DrForm = class extends OperatorExecuterAttrRequire {
6245
6645
  }
6246
6646
  async executeAttrRequire(attr) {
6247
6647
  RawSet.drFormOtherMoveAttr(this.elementSource.element, "name", "temp-name", this.source.config);
6248
- const data = ScriptUtils.evaluateReturn(`${attr}`, this.source.obj);
6648
+ const data = ObjectUtils.Script.evaluateReturn(`${attr}`, this.source.obj);
6249
6649
  const childs = Array.from(this.elementSource.element.querySelectorAll("[name]"));
6250
- const fromName = ScriptUtils.evaluateReturn(this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`) ?? "", this.source.obj);
6650
+ const fromName = ObjectUtils.Script.evaluateReturn(this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`) ?? "", this.source.obj);
6251
6651
  const thisName = fromName ?? this.elementSource.element.getAttribute("name");
6252
6652
  if (childs.length <= 0 && thisName) {
6253
6653
  childs.push(this.elementSource.element);
@@ -6260,10 +6660,10 @@ var DrForm = class extends OperatorExecuterAttrRequire {
6260
6660
  const eventName = it.getAttribute(`${RawSet.DR_FORM_NAME}:event`) ?? "change";
6261
6661
  const validatorName = it.getAttribute(`${RawSet.DR_FORM_NAME}:validator`);
6262
6662
  const attrEventName = EventManager.attrPrefix + "event-" + eventName;
6263
- let varpath = ScriptUtils.evaluateReturn(this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`) ?? "", this.source.obj) ?? it.getAttribute("name");
6663
+ let varpath = ObjectUtils.Script.evaluateReturn(this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`) ?? "", this.source.obj) ?? it.getAttribute("name");
6264
6664
  if (varpath != null) {
6265
6665
  if (validatorName) {
6266
- ScriptUtils.evaluate(
6666
+ ObjectUtils.Script.evaluate(
6267
6667
  `
6268
6668
  ${this.render.bindScript}
6269
6669
  const validator = typeof ${validatorName} ==='function' ? new ${validatorName}() : ${validatorName};
@@ -6281,7 +6681,7 @@ var DrForm = class extends OperatorExecuterAttrRequire {
6281
6681
  );
6282
6682
  }
6283
6683
  varpath = `${attr}['${varpath}']`;
6284
- const data2 = ScriptUtils.evaluateReturn(`${varpath}`, this.source.obj);
6684
+ const data2 = ObjectUtils.Script.evaluateReturn(`${varpath}`, this.source.obj);
6285
6685
  if (data2 instanceof ValidatorArray) {
6286
6686
  it.setAttribute(attrEventName, `${varpath}.setArrayValue($target, $target.value, $event); ${it.getAttribute(attrEventName) ?? ""};`);
6287
6687
  data2.addValidator(it.value, it);
@@ -6307,7 +6707,7 @@ var DrInnerText = class extends OperatorExecuterAttrRequire {
6307
6707
  }
6308
6708
  async executeAttrRequire(attr) {
6309
6709
  const newTemp = this.source.config.window.document.createElement("temp");
6310
- ScriptUtils.evaluate(`
6710
+ ObjectUtils.Script.evaluate(`
6311
6711
  ${this.render.bindScript}
6312
6712
  const n = $element.cloneNode(true);
6313
6713
  ${this.elementSource.attrs.drBeforeOption ?? ""}
@@ -6342,7 +6742,7 @@ var DrInnerHTML = class extends OperatorExecuterAttrRequire {
6342
6742
  }
6343
6743
  async executeAttrRequire(attr) {
6344
6744
  const newTemp = this.source.config.window.document.createElement("temp");
6345
- ScriptUtils.evaluate(`
6745
+ ObjectUtils.Script.evaluate(`
6346
6746
  ${this.render.bindScript}
6347
6747
  const n = $element.cloneNode(true);
6348
6748
  ${this.elementSource.attrs.drBeforeOption ?? ""}
@@ -6381,7 +6781,7 @@ var DrFor = class extends OperatorExecuterAttrRequire {
6381
6781
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
6382
6782
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
6383
6783
  const newTemp = this.source.config.window.document.createElement("temp");
6384
- ScriptUtils.evaluate(`
6784
+ ObjectUtils.Script.evaluate(`
6385
6785
  ${this.render.bindScript}
6386
6786
  ${this.elementSource.attrs.drBeforeOption ?? ""}
6387
6787
  for(${attr}) {
@@ -6427,13 +6827,21 @@ var DrForOf = class extends OperatorExecuterAttrRequire {
6427
6827
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, "DrForOf");
6428
6828
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
6429
6829
  const newTemp = this.source.config.window.document.createElement("temp");
6430
- ScriptUtils.evaluate(`
6830
+ const variableName = this.elementSource.element.getAttribute(RawSet.DR_VARIABLE_NAME_OPTIONNAME);
6831
+ const itemVariableName = this.elementSource.element.getAttribute(RawSet.DR_ITEM_VARIABLE_NAME_OPTIONNAME);
6832
+ const itemIndexVariableName = this.elementSource.element.getAttribute(RawSet.DR_ITEM_INDEX_VARIABLE_NAME_OPTIONNAME);
6833
+ const hasVariableName = this.elementSource.element.hasAttribute(RawSet.DR_VARIABLE_NAME_OPTIONNAME);
6834
+ const hasItemVariableName = this.elementSource.element.hasAttribute(RawSet.DR_ITEM_VARIABLE_NAME_OPTIONNAME);
6835
+ const hasItemIndexVariableName = this.elementSource.element.hasAttribute(RawSet.DR_ITEM_INDEX_VARIABLE_NAME_OPTIONNAME);
6836
+ const t0 = performance.now();
6837
+ ObjectUtils.Script.evaluate(`
6431
6838
  ${this.render.bindScript}
6432
6839
  ${this.elementSource.attrs.drBeforeOption ?? ""}
6433
6840
  var i = -1;
6434
6841
  const forOf = ${ObjectUtils.Path.toOptionalChainPath(attr)};
6435
6842
  const forOfStr = \`${attr}\`.trim();
6436
6843
  // console.log('forOf---',forOf);
6844
+ // debugger;
6437
6845
  if (forOf) {
6438
6846
  for(const it of forOf) {
6439
6847
  i++;
@@ -6450,11 +6858,41 @@ var DrForOf = class extends OperatorExecuterAttrRequire {
6450
6858
  destIt = forOfStr + '[' + i +']'
6451
6859
  }
6452
6860
  const n = this.__render.element.cloneNode(true);
6453
- // console.log('zzzzzzzzzzz', n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}'));
6454
6861
  Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
6455
- // console.log('---------'+destIt,n, Array.from(n.getAttributeNames()).map(it=>({name:it,attr: n.getAttribute(it)})));
6456
- // console.log('---------destItdestIt',destIt);
6457
6862
  n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))
6863
+ if (${hasVariableName} && '${variableName}') {
6864
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replaceAll('#${variableName}#', forOfStr)));
6865
+ }
6866
+ if (${hasItemVariableName} && '${itemVariableName}') {
6867
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replaceAll('#${itemVariableName}#', destIt)));
6868
+ }
6869
+ if (${hasItemIndexVariableName} && '${itemIndexVariableName}') {
6870
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replaceAll('#${itemIndexVariableName}#', i)));
6871
+ }
6872
+
6873
+ const hasDrOptionAttr = n.hasAttribute('${RawSet.DR_ATTR_OPTIONNAME}');
6874
+ if (hasDrOptionAttr) {
6875
+ const drOptionAttr = n.getAttribute('${RawSet.DR_ATTR_OPTIONNAME}');
6876
+ const drOptionAttrResult = $scriptUtils.evaluateReturn(drOptionAttr, this);
6877
+ Array.from(Object.entries(drOptionAttrResult??{})).forEach(([k,v])=>{
6878
+ if (v === null) {
6879
+ n.removeAttribute(k);
6880
+ } else {
6881
+ n.setAttribute(k,v);
6882
+ }
6883
+ })
6884
+
6885
+ }
6886
+ const hasDrOptionIf = n.hasAttribute('${RawSet.DR_IF_OPTIONNAME}');
6887
+ if (hasDrOptionIf) {
6888
+ const drOptionIf = n.getAttribute('${RawSet.DR_IF_OPTIONNAME}');
6889
+ const e = $scriptUtils.evaluateReturn(drOptionIf, this);
6890
+ if(!e) {
6891
+ continue;
6892
+ }
6893
+
6894
+ }
6895
+
6458
6896
  const drOptionAttr = n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}');
6459
6897
  if (drOptionAttr) {
6460
6898
  const drOptionAttrResult = $scriptUtils.evaluateReturn(drOptionAttr, this);
@@ -6477,12 +6915,16 @@ var DrForOf = class extends OperatorExecuterAttrRequire {
6477
6915
  }
6478
6916
 
6479
6917
  n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);
6480
- // console.log('!@@@@', n.innerHTML);
6481
- // DR_THIS_OPTIONNAME \uB294 \uC81C\uAC70\uD55C\uB2E4 \uAF2C\uC778\uB2E4. strip \uD560\uB54C \uB9C9 \uAF2C\uC5EC\uBC84\uB9B0\uB2E4.
6482
- // const drOptionThis = n.getAttribute('${RawSet.DR_THIS_OPTIONNAME}');
6483
- // if (drOptionThis) {
6484
- // n.setAttribute('${RawSet.DR_THIS_NAME}', drOptionThis)
6485
- // }
6918
+ if (${hasVariableName} && '${variableName}') {
6919
+ n.innerHTML = n.innerHTML.replaceAll('#${variableName}#', forOfStr);
6920
+ }
6921
+ if (${hasItemVariableName} && '${itemVariableName}') {
6922
+ n.innerHTML = n.innerHTML.replaceAll('#${itemVariableName}#', destIt);
6923
+ }
6924
+ if (${hasItemIndexVariableName} && '${itemIndexVariableName}') {
6925
+ n.innerHTML = n.innerHTML.replaceAll('#${itemIndexVariableName}#', i);
6926
+ }
6927
+
6486
6928
  if (this.__render.drStripOption === 'true') {
6487
6929
  Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
6488
6930
  } else {
@@ -6533,7 +6975,7 @@ var DrAppender = class extends OperatorExecuterAttrRequire {
6533
6975
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
6534
6976
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
6535
6977
  const newTemp = this.source.config.window.document.createElement("temp");
6536
- ScriptUtils.evaluate(`
6978
+ ObjectUtils.Script.evaluate(`
6537
6979
  try{
6538
6980
  ${this.render.bindScript}
6539
6981
  ${this.elementSource.attrs.drBeforeOption ?? ""}
@@ -6591,7 +7033,7 @@ var DrRepeat = class extends OperatorExecuterAttrRequire {
6591
7033
  const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
6592
7034
  const vars = RawSet.drVarEncoding(this.elementSource.element, this.elementSource.attrs.drVarOption ?? "");
6593
7035
  const newTemp = this.source.config.window.document.createElement("temp");
6594
- ScriptUtils.evaluate(`
7036
+ ObjectUtils.Script.evaluate(`
6595
7037
  ${this.render.bindScript}
6596
7038
  ${this.elementSource.attrs.drBeforeOption ?? ""}
6597
7039
  var i = 0;
@@ -6646,9 +7088,18 @@ var DrTargetElement = class extends OperatorExecuter {
6646
7088
  super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
6647
7089
  }
6648
7090
  async execute() {
6649
- const targetElement = this.source.config?.targetElements?.find(
6650
- (it) => it.name.toLowerCase() === this.elementSource.element.tagName.toLowerCase()
6651
- );
7091
+ let targetElement = void 0;
7092
+ let isTargetElementElement = this.elementSource.element.tagName.toLowerCase() === RawSet.DR_TARGET_ELEMENT_ELEMENTNAME.toLowerCase();
7093
+ if (isTargetElementElement) {
7094
+ const targetElementTagName = this.elementSource.element.getAttribute(`${RawSet.DR_TARGET_ELEMENT_ELEMENTNAME}:is`)?.toLowerCase();
7095
+ targetElement = this.source.config?.targetElements?.find(
7096
+ (it) => it.name.toLowerCase() === targetElementTagName
7097
+ );
7098
+ } else {
7099
+ targetElement = this.source.config?.targetElements?.find(
7100
+ (it) => it.name.toLowerCase() === this.elementSource.element.tagName.toLowerCase()
7101
+ );
7102
+ }
6652
7103
  if (targetElement) {
6653
7104
  if (this.rawSet.point.start instanceof this.source.config.window.HTMLMetaElement && this.rawSet.point.end instanceof this.source.config.window.HTMLMetaElement) {
6654
7105
  this.rawSet.point.start.setAttribute("this-path", `this.__domrender_components.${this.rawSet.uuid}`);
@@ -6668,7 +7119,7 @@ var DrTargetElement = class extends OperatorExecuter {
6668
7119
  this.rawSet.detect = {
6669
7120
  action: () => {
6670
7121
  const script = `var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ${detectAction} `;
6671
- ScriptUtils.evaluate(
7122
+ ObjectUtils.Script.evaluate(
6672
7123
  script,
6673
7124
  Object.assign(this.source.obj, {
6674
7125
  __render: this.rawSet.dataSet.render
@@ -6749,7 +7200,7 @@ var DrStripElement = class extends OperatorExecuterAttrRequire {
6749
7200
  }
6750
7201
  async executeAttrRequire(attr) {
6751
7202
  const newTemp = this.source.config.window.document.createElement("temp");
6752
- ScriptUtils.evaluate(`
7203
+ ObjectUtils.Script.evaluate(`
6753
7204
  ${this.render.bindScript}
6754
7205
  ${this.elementSource.attrs.drBeforeOption ?? ""}
6755
7206
  const n = $element.cloneNode(true);
@@ -6811,7 +7262,7 @@ var DrThisProperty = class extends OperatorExecuterAttrRequire {
6811
7262
  const newTemp = this.source.config.window.document.createElement("temp");
6812
7263
  const dictioanry = ScriptUtils.evaluateReturn(attr, this.source.obj);
6813
7264
  const dictionaryKey = this.elementSource.attrs.drKeyOption ?? "";
6814
- ScriptUtils.evaluate(`
7265
+ ObjectUtils.Script.evaluate(`
6815
7266
  ${this.render.bindScript}
6816
7267
  ${this.elementSource.attrs.drBeforeOption ?? ""}
6817
7268
  var i = 0;
@@ -7319,7 +7770,7 @@ var DrTargetElementIsElement = class extends OperatorExecuter {
7319
7770
  this.rawSet.detect = {
7320
7771
  action: () => {
7321
7772
  const script = `var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ${detectAction} `;
7322
- ScriptUtils.evaluate(script, Object.assign(this.source.obj, {
7773
+ ObjectUtils.Script.evaluate(script, Object.assign(this.source.obj, {
7323
7774
  __render: this.rawSet.dataSet.render
7324
7775
  }));
7325
7776
  }
@@ -7377,7 +7828,7 @@ var NodeUtils;
7377
7828
  NodeUtils2.replaceNode = (targetNode, newNode) => {
7378
7829
  return targetNode.parentNode?.replaceChild(newNode, targetNode);
7379
7830
  };
7380
- NodeUtils2.addNode = (targetNode, newNode) => {
7831
+ NodeUtils2.insertAfter = (targetNode, newNode) => {
7381
7832
  return targetNode.parentNode?.insertBefore(newNode, targetNode.nextSibling);
7382
7833
  };
7383
7834
  NodeUtils2.cloneNode = (element, deep) => {
@@ -7475,7 +7926,8 @@ var _RawSet = class _RawSet2 {
7475
7926
  const targetAttrMap = element.getAttribute(EventManager.normalAttrMapAttrName);
7476
7927
  if (targetAttrMap) {
7477
7928
  new Map(JSON.parse(targetAttrMap)).forEach((v, k) => {
7478
- targetScripts.push(`(${v})`);
7929
+ const variablePaths = v.variablePaths;
7930
+ variablePaths.forEach((it) => targetScripts.push(`(${it.inner})`));
7479
7931
  });
7480
7932
  }
7481
7933
  script = targetScripts.join(";");
@@ -7490,10 +7942,49 @@ var _RawSet = class _RawSet2 {
7490
7942
  });
7491
7943
  return usingTriggerVariables;
7492
7944
  }
7493
- // 중요 render 처리 부분
7494
- // public async render(obj: any, config: DomRenderConfig): Promise<RawSet[]> {
7495
- // }
7496
7945
  async render(obj, config) {
7946
+ if (this.dataSet.fragment.childNodes.length === 1 && this.dataSet.fragment.childNodes[0].nodeType === Node.TEXT_NODE) {
7947
+ const textContent = this.dataSet.fragment.childNodes[0].textContent;
7948
+ if (textContent) {
7949
+ const runText = _RawSet2.expressionGroups(textContent)[0][1];
7950
+ const __render = {
7951
+ rawSet: this,
7952
+ scripts: EventManager.setBindProperty(config?.scripts, obj),
7953
+ router: config?.router,
7954
+ range: Range.range,
7955
+ element: this.dataSet.fragment.childNodes[0],
7956
+ attribute: {},
7957
+ rootObject: obj,
7958
+ scriptUtils: ObjectUtils.Script,
7959
+ nearThis: this.findNearThis(obj),
7960
+ parentThis: this.findParentThis(obj),
7961
+ bindScript: ` /** render **/
7962
+ const ${EventManager.SCRIPTS_VARNAME} = this.__render.scripts;
7963
+ const ${EventManager.RAWSET_VARNAME} = this.__render.rawSet;
7964
+ const ${EventManager.ELEMENT_VARNAME} = this.__render.element;
7965
+ const ${EventManager.ATTRIBUTE_VARNAME} = this.__render.attribute;
7966
+ const ${EventManager.RANGE_VARNAME} = this.__render.range;
7967
+ const ${EventManager.ROUTER_VARNAME} = this.__render.router;
7968
+ const ${EventManager.NEAR_THIS_VARNAME} = this.__render.nearThis;
7969
+ const ${EventManager.PARENT_THIS_VARNAME} = this.__render.parentThis;
7970
+ const ${EventManager.SCRIPT_UTILS_VARNAME} = this.__render.scriptUtils;
7971
+ const ${EventManager.ROOT_OBJECT_VARNAME} = this.__render.rootObject;
7972
+ `
7973
+ };
7974
+ try {
7975
+ const newValue = ObjectUtils.Script.evaluateReturn({
7976
+ bodyScript: __render.bindScript,
7977
+ returnScript: runText
7978
+ }, Object.assign(obj, { __render }));
7979
+ const newValueStr = String(newValue);
7980
+ if (this.lastRenderedValue === newValueStr) {
7981
+ return { raws: [], executedOperators: [] };
7982
+ }
7983
+ this.lastRenderedValue = newValueStr;
7984
+ } catch (e) {
7985
+ }
7986
+ }
7987
+ }
7497
7988
  const genNode = config.window.document.importNode(this.dataSet.fragment, true);
7498
7989
  const raws = [];
7499
7990
  const onAttrInitCallBacks = [];
@@ -7536,12 +8027,15 @@ var _RawSet = class _RawSet2 {
7536
8027
  const runText = _RawSet2.expressionGroups(textContent)[0][1];
7537
8028
  let newNode;
7538
8029
  if (textContent?.startsWith("#")) {
7539
- const r = ObjectUtils.Script.evaluate(`${__render.bindScript} return ${runText}`, Object.assign(obj, { __render }));
8030
+ const r = ObjectUtils.Script.evaluateReturn(
8031
+ { bodyScript: __render.bindScript, returnScript: runText },
8032
+ Object.assign(obj, { __render })
8033
+ );
7540
8034
  const template = config.window.document.createElement("template");
7541
8035
  template.innerHTML = r;
7542
8036
  newNode = template.content;
7543
8037
  } else {
7544
- const r = ObjectUtils.Script.evaluate(`${__render.bindScript} return ${runText}`, Object.assign(obj, { __render }));
8038
+ const r = ObjectUtils.Script.evaluateReturn({ bodyScript: __render.bindScript, returnScript: runText }, Object.assign(obj, { __render }));
7545
8039
  newNode = config.window.document.createTextNode(r);
7546
8040
  }
7547
8041
  cNode.parentNode?.replaceChild(newNode, cNode);
@@ -7636,12 +8130,12 @@ var _RawSet = class _RawSet2 {
7636
8130
  });
7637
8131
  for (const it of onThisComponentSetCallBacks) {
7638
8132
  if (isOnInitRender(it.obj)) {
7639
- it.obj?.onInitRender?.({}, this);
8133
+ await it.obj?.onInitRender?.({}, this);
7640
8134
  }
7641
8135
  }
7642
8136
  for (const it of onElementInitCallBacks) {
7643
8137
  if (isOnInitRender(this.dataSet.render?.currentThis)) {
7644
- this.dataSet.render.currentThis.onInitRender({}, this);
8138
+ await this.dataSet.render.currentThis.onInitRender({}, this);
7645
8139
  }
7646
8140
  config?.onElementInit?.(it.name, obj, this, it.targetElement);
7647
8141
  }
@@ -7659,6 +8153,7 @@ var _RawSet = class _RawSet2 {
7659
8153
  }
7660
8154
  });
7661
8155
  }
8156
+ console.groupEnd();
7662
8157
  return { raws, executedOperators };
7663
8158
  }
7664
8159
  // 중요 스타일 적용 부분
@@ -7743,7 +8238,10 @@ var _RawSet = class _RawSet2 {
7743
8238
  getDrAppendAttributeAndDelete(element, obj) {
7744
8239
  let data = element.getAttribute(_RawSet2.DR_APPENDER_NAME);
7745
8240
  if (data && !/\[.+\]/g.test(data)) {
7746
- const currentIndex = ObjectUtils.Script.evaluateReturn(`${ObjectUtils.Path.toOptionalChainPath(data)}?.length -1`, obj);
8241
+ const currentIndex = ObjectUtils.Script.evaluateReturn(
8242
+ `${ObjectUtils.Path.toOptionalChainPath(data)}?.length -1`,
8243
+ obj
8244
+ );
7747
8245
  data = `${data}[${currentIndex}]`;
7748
8246
  element.setAttribute(_RawSet2.DR_APPENDER_NAME, data);
7749
8247
  }
@@ -7774,7 +8272,7 @@ var _RawSet = class _RawSet2 {
7774
8272
  }
7775
8273
  if (element2.hasAttribute(EventManager.attrAttrName)) {
7776
8274
  const script = element2.getAttribute(EventManager.attrAttrName) ?? "";
7777
- const keyValuePairs = Array.from(script.matchAll(/(\w+):\s*([^,}]+)/g)).map((match) => ({
8275
+ const keyValuePairs = Array.from(script.matchAll(/['"]?([\w-_]+)['"]?:\s*([^,}]+)/g)).map((match) => ({
7778
8276
  key: match[1],
7779
8277
  value: match[2]
7780
8278
  }));
@@ -7784,27 +8282,35 @@ var _RawSet = class _RawSet2 {
7784
8282
  }
7785
8283
  const targetElementIs = element2.getAttribute(_RawSet2.DR_REPLACE_TARGET_ELEMENT_IS_NAME);
7786
8284
  const targetElementNames = config.targetElements?.map((it) => it.name.toLowerCase()) ?? [];
8285
+ targetElementNames.push(..._RawSet2.DR_ELEMENTS);
7787
8286
  const isElement = targetElementNames.includes(element2.tagName.toLowerCase()) || targetElementNames.includes(targetElementIs?.toLowerCase());
7788
8287
  const targetAttrNames = (config.targetAttrs?.map((it) => it.name) ?? []).concat([..._RawSet2.DR_ATTRIBUTES]);
7789
8288
  const normalAttrs = /* @__PURE__ */ new Map();
7790
8289
  const linkVariables = /* @__PURE__ */ new Map();
7791
8290
  const linkNames = EventManager.linkAttrs.map((it) => it.name);
7792
- const isAttr = element2.getAttributeNames().filter((it) => {
7793
- const value = element2.getAttribute(it);
8291
+ const isAttr = element2.getAttributeNames().filter((it) => !EventManager.noDetectAttr.includes(it)).filter((it) => {
8292
+ const value = element2.getAttribute(it)?.trim();
7794
8293
  if (value && linkNames.includes(it)) {
7795
8294
  linkVariables.set(it, value);
7796
8295
  } else if (value && _RawSet2.isExpression(value)) {
7797
- let variablePath = _RawSet2.expressionGroups(value)[0][1];
7798
- const originVariable = variablePath;
7799
- variablePath = variablePath.replace(/#[^#]*#/g, "({})");
7800
- const optionalChainPath = ObjectUtils.Path.toOptionalChainPath(variablePath);
7801
- const cval = ObjectUtils.Script.evaluateReturn(optionalChainPath, Object.assign(obj));
8296
+ const variablePaths = _RawSet2.expressionGroups(value).map((it2) => ({
8297
+ origin: it2[0].trim(),
8298
+ inner: it2[1].trim()
8299
+ }));
8300
+ const isStringTemplate = variablePaths.length > 1 || variablePaths[0] && variablePaths[0].origin !== value;
8301
+ let targetScript = value;
8302
+ variablePaths.forEach((it2) => {
8303
+ let r3 = it2.inner.replace(/#[^#]*#/g, "({})");
8304
+ r3 = ObjectUtils.Path.toOptionalChainPath(r3);
8305
+ targetScript = targetScript.replaceAll(it2.origin, `\${${r3}}`);
8306
+ });
8307
+ const cval = ObjectUtils.Script.evaluateReturn("`" + targetScript + "`", Object.assign(obj));
7802
8308
  if (cval === null) {
7803
8309
  element2.removeAttribute(it);
7804
8310
  } else {
7805
8311
  element2.setAttribute(it, cval);
7806
8312
  }
7807
- normalAttrs.set(it, originVariable);
8313
+ normalAttrs.set(it, { originalAttrValue: value, variablePaths, isStringTemplate });
7808
8314
  }
7809
8315
  const isTargetAttr = targetAttrNames.includes(it.toLowerCase());
7810
8316
  return isTargetAttr;
@@ -7875,7 +8381,8 @@ var _RawSet = class _RawSet2 {
7875
8381
  lasterIndex = regexArr.index + it.content.length;
7876
8382
  }
7877
8383
  template.content.append(config.window.document.createTextNode(text.substring(lasterIndex, text.length)));
7878
- currentNode2?.parentNode?.replaceChild(template.content, currentNode2);
8384
+ const p = currentNode2?.parentNode;
8385
+ p?.replaceChild(template.content, currentNode2);
7879
8386
  } else if (currentNode2.nodeType === Node2.ELEMENT_NODE) {
7880
8387
  const uuid = `${RandomUtils.alphabet(40)}`;
7881
8388
  const element2 = currentNode2;
@@ -7884,6 +8391,7 @@ var _RawSet = class _RawSet2 {
7884
8391
  const startEndPoint = _RawSet2.createStartEndPoint({ node: element2, id: uuid, type: elementType }, config);
7885
8392
  const targetElementIs = element2.getAttribute(_RawSet2.DR_REPLACE_TARGET_ELEMENT_IS_NAME);
7886
8393
  const targetElementNames = config.targetElements?.map((it) => it.name.toLowerCase()) ?? [];
8394
+ targetElementNames.push(..._RawSet2.DR_ELEMENTS);
7887
8395
  const isElement = targetElementNames.includes(element2.tagName.toLowerCase()) || targetElementNames.includes(targetElementIs?.toLowerCase());
7888
8396
  const targetAttrNames = (config.targetAttrs?.map((it) => it.name) ?? []).concat(_RawSet2.DR_ATTRIBUTES);
7889
8397
  const isAttr = element2.getAttributeNames().filter((it) => targetAttrNames.includes(it.toLowerCase())).length > 0;
@@ -8218,15 +8726,39 @@ var _RawSet = class _RawSet2 {
8218
8726
  targetElement.querySelectorAll(EventManager.attrNames.map((it) => `[${it}]`).join(",")).forEach((it) => {
8219
8727
  it.setAttribute(EventManager.ownerVariablePathAttrName, "this");
8220
8728
  });
8221
- const componentNameReplaceKey = RandomUtils.uuid();
8222
8729
  rawSet.point.innerHTML = element.innerHTML;
8223
- const innerHTMLName = targetElement.getAttribute(_RawSet2.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME) ?? "innerHTML";
8730
+ const innerText = element.textContent?.trim() ?? "";
8731
+ const escapedInnerHTML = ConvertUtils.escapeHTML(element.innerHTML);
8732
+ const innerHTMLName = targetElement.getAttribute(_RawSet2.DR_INNER_HTML_NAME_OPTIONNAME) ?? "innerHTML";
8733
+ const innerTEXTName = targetElement.getAttribute(_RawSet2.DR_INNER_TEXT_NAME_OPTIONNAME) ?? "innerTEXT";
8734
+ const innerHTMLEscapedName = targetElement.getAttribute(_RawSet2.DR_INNER_HTML_ESCAPED_NAME_OPTIONNAME) ?? "innerHTMLEscaped";
8735
+ const templateReplacements = [];
8224
8736
  if (innerHTMLName) {
8225
- _RawSet2.replaceInnerHTML(targetElement, { asIs: `#${innerHTMLName}#`, toBe: element.innerHTML });
8737
+ templateReplacements.push({
8738
+ regex: new RegExp(`#${innerHTMLName}#`, "g"),
8739
+ callback: () => element.innerHTML
8740
+ });
8741
+ }
8742
+ if (innerTEXTName) {
8743
+ templateReplacements.push({
8744
+ regex: new RegExp(`#${innerTEXTName}#`, "g"),
8745
+ callback: () => innerText
8746
+ });
8747
+ }
8748
+ if (innerHTMLEscapedName) {
8749
+ templateReplacements.push({
8750
+ regex: new RegExp(`#${innerHTMLEscapedName}#`, "g"),
8751
+ callback: () => escapedInnerHTML
8752
+ });
8753
+ }
8754
+ if (templateReplacements.length > 0) {
8755
+ targetElement.innerHTML = StringUtils.replaceSequentially(targetElement.innerHTML, templateReplacements);
8226
8756
  }
8757
+ const componentName = targetElement.getAttribute(_RawSet2.DR_VARIABLE_NAME_OPTIONNAME) ?? "component";
8227
8758
  const optionThisName = targetElement.getAttribute(_RawSet2.DR_THIS_NAME_OPTIONNAME);
8228
8759
  targetElement.getAttributeNames().forEach((it) => targetElement.setAttribute(it, targetElement.getAttribute(it).replace(/#this#/g, drThis)));
8229
8760
  const thisRandom = this.drThisEncoding(targetElement, drThis, { asIs: /@this@/g });
8761
+ targetElement.innerHTML = targetElement.innerHTML.replaceAll(`#${componentName}#`, drThis);
8230
8762
  if (optionThisName) {
8231
8763
  targetElement.innerHTML = targetElement.innerHTML.replaceAll(`@${optionThisName}@`, drThis);
8232
8764
  }
@@ -8299,7 +8831,6 @@ var _RawSet = class _RawSet2 {
8299
8831
  obj.__domrender_components ?? (obj.__domrender_components = {});
8300
8832
  const domrenderComponents = obj.__domrender_components;
8301
8833
  const renderScript = ` /*createComponentTargetElement*/
8302
- // console.log('-------------------',this.__render);
8303
8834
  var ${EventManager.RAWSET_VARNAME} = this.__render.rawSet;
8304
8835
  var ${EventManager.COMPONENT_VARNAME} = this.__render.component;
8305
8836
  var ${EventManager.ELEMENT_VARNAME} = this.__render.element;
@@ -8354,15 +8885,40 @@ var _RawSet = class _RawSet2 {
8354
8885
  rawSet.dataSet.render = render;
8355
8886
  instance.__rawSet = rawSet;
8356
8887
  let applayTemplate = element.innerHTML;
8888
+ let applayTemplateText = element.textContent?.trim() ?? "";
8889
+ let applayTemplateEscape = ConvertUtils.escapeHTML(element.innerHTML);
8357
8890
  let innerHTMLThisRandom;
8358
- const componentName = element.getAttribute(_RawSet2.DR_COMPONENT_NAME_OPTIONNAME) ?? "component";
8359
- const innerHTMLName = element.getAttribute(_RawSet2.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME) ?? "innerHTML";
8891
+ const componentName = element.getAttribute(_RawSet2.DR_VARIABLE_NAME_OPTIONNAME) ?? "component";
8892
+ const innerHTMLName = element.getAttribute(_RawSet2.DR_INNER_HTML_NAME_OPTIONNAME) ?? "innerHTML";
8893
+ const innerTEXTName = element.getAttribute(_RawSet2.DR_INNER_TEXT_NAME_OPTIONNAME) ?? "innerTEXT";
8894
+ const innerHTMLEscapedName = element.getAttribute(_RawSet2.DR_INNER_HTML_ESCAPED_NAME_OPTIONNAME) ?? "innerHTMLEscaped";
8360
8895
  if (applayTemplate) {
8361
8896
  innerHTMLThisRandom = RandomUtils.uuid();
8362
- applayTemplate = applayTemplate.replace(/this\./g, innerHTMLThisRandom);
8363
- applayTemplate = applayTemplate.replace(RegExp(`#${componentName}#`, "g"), "this");
8897
+ applayTemplate = StringUtils.replaceSequentially(applayTemplate, [
8898
+ {
8899
+ regex: /this\./g,
8900
+ callback: () => innerHTMLThisRandom
8901
+ },
8902
+ {
8903
+ regex: new RegExp(`#${componentName}#`, "g"),
8904
+ callback: () => nearThisPath
8905
+ }
8906
+ ]);
8364
8907
  }
8365
- applayTemplate = (this.template ?? "").replace(RegExp(`#${innerHTMLName}#`, "g"), applayTemplate);
8908
+ applayTemplate = StringUtils.replaceSequentially(this.template ?? "", [
8909
+ {
8910
+ regex: new RegExp(`#${innerHTMLName}#`, "g"),
8911
+ callback: () => applayTemplate
8912
+ },
8913
+ {
8914
+ regex: new RegExp(`#${innerTEXTName}#`, "g"),
8915
+ callback: () => applayTemplateText
8916
+ },
8917
+ {
8918
+ regex: new RegExp(`#${innerHTMLEscapedName}#`, "g"),
8919
+ callback: () => applayTemplateEscape
8920
+ }
8921
+ ]);
8366
8922
  const style = _RawSet2.generateStyleTransform(this.styles, rawSet.uuid, true);
8367
8923
  element.innerHTML = style + (applayTemplate ?? "");
8368
8924
  let data = await _RawSet2.drThisCreate(
@@ -8376,8 +8932,9 @@ var _RawSet = class _RawSet2 {
8376
8932
  );
8377
8933
  if (data && innerHTMLThisRandom) {
8378
8934
  const template2 = config.window.document.createElement("template");
8379
- template2.content.append(data);
8380
- template2.innerHTML = template2.innerHTML.replace(RegExp(innerHTMLThisRandom, "g"), "this.");
8935
+ let s = ElementUtils.toInnerHTML(data, { document: config.window.document });
8936
+ template2.innerHTML = s.replace(RegExp(innerHTMLThisRandom, "g"), "this.");
8937
+ ;
8381
8938
  data = template2.content;
8382
8939
  }
8383
8940
  return data;
@@ -8414,8 +8971,19 @@ var _RawSet = class _RawSet2 {
8414
8971
  const normalAttribute = attribute[EventManager.normalAttrMapAttrName];
8415
8972
  if (normalAttribute) {
8416
8973
  new Map(JSON.parse(normalAttribute)).forEach((v, k) => {
8974
+ const variablePaths = v.variablePaths;
8975
+ let targetScript = v.originalAttrValue.trim();
8976
+ if (v.isStringTemplate) {
8977
+ variablePaths.forEach((it) => {
8978
+ let r = ObjectUtils.Path.toOptionalChainPath(it.inner);
8979
+ targetScript = targetScript.replaceAll(it.origin, `\${${r}}`);
8980
+ });
8981
+ } else {
8982
+ let r = ObjectUtils.Path.toOptionalChainPath(variablePaths[0].inner);
8983
+ targetScript = targetScript.replaceAll(variablePaths[0].origin, r);
8984
+ }
8417
8985
  const cval = ObjectUtils.Script.evaluateReturn(
8418
- { bodyScript: config.script, returnScript: v },
8986
+ { bodyScript: config.script, returnScript: v.isStringTemplate ? "`" + targetScript + "`" : targetScript },
8419
8987
  Object.assign(config.obj, config.renderData ? { __render: config.renderData } : void 0)
8420
8988
  );
8421
8989
  attribute[k] = cval;
@@ -8439,6 +9007,7 @@ _RawSet.DR_INNERTEXT_NAME = "dr-inner-text";
8439
9007
  _RawSet.DR_DETECT_NAME = "dr-detect";
8440
9008
  _RawSet.DR_STRIP_NAME = "dr-strip";
8441
9009
  _RawSet.DR_REPLACE_TARGET_ELEMENT_IS_NAME = "dr-replace-target-element-is";
9010
+ _RawSet.DR_TARGET_ELEMENT_ELEMENTNAME = "dr-target-element";
8442
9011
  _RawSet.DR_DETECT_IF_OPTIONNAME = "dr-detect-option-if";
8443
9012
  _RawSet.DR_DETECT_FILTER_OPTIONNAME = "dr-detect-option-filter";
8444
9013
  _RawSet.DR_DETECT_ATTR_OPTIONNAME = "dr-detect-option-attr";
@@ -8454,8 +9023,12 @@ _RawSet.DR_COMPLETE_OPTIONNAME = "dr-option-complete";
8454
9023
  _RawSet.DR_STRIP_OPTIONNAME = "dr-option-strip";
8455
9024
  _RawSet.DR_DESTROY_OPTIONNAME = "dr-option-destroy";
8456
9025
  _RawSet.DR_THIS_NAME_OPTIONNAME = "dr-option-this-name";
8457
- _RawSet.DR_COMPONENT_NAME_OPTIONNAME = "dr-option-component-name";
8458
- _RawSet.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME = "dr-option-component-inner-html-name";
9026
+ _RawSet.DR_VARIABLE_NAME_OPTIONNAME = "dr-option-variable-name";
9027
+ _RawSet.DR_ITEM_VARIABLE_NAME_OPTIONNAME = "dr-option-item-variable-name";
9028
+ _RawSet.DR_ITEM_INDEX_VARIABLE_NAME_OPTIONNAME = "dr-option-item-index-variable-name";
9029
+ _RawSet.DR_INNER_HTML_NAME_OPTIONNAME = "dr-option-inner-html-name";
9030
+ _RawSet.DR_INNER_TEXT_NAME_OPTIONNAME = "dr-option-inner-text-name";
9031
+ _RawSet.DR_INNER_HTML_ESCAPED_NAME_OPTIONNAME = "dr-option-inner-html-escaped-name";
8459
9032
  _RawSet.DR_KEY_OPTIONNAME = "dr-option-key";
8460
9033
  _RawSet.DR_HAS_KEYS_OPTIONNAME = "dr-option-has-keys";
8461
9034
  _RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME = "dr-on-create:arguments";
@@ -8491,6 +9064,9 @@ _RawSet.drAttrsOriginName = {
8491
9064
  drKeyOption: _RawSet.DR_KEY_OPTIONNAME
8492
9065
  };
8493
9066
  _RawSet.DR_TAGS = [];
9067
+ _RawSet.DR_ELEMENTS = [
9068
+ _RawSet.DR_TARGET_ELEMENT_ELEMENTNAME
9069
+ ];
8494
9070
  _RawSet.DR_ATTRIBUTES = [
8495
9071
  _RawSet.DR_NAME,
8496
9072
  _RawSet.DR_APPENDER_NAME,
@@ -8504,7 +9080,7 @@ _RawSet.DR_ATTRIBUTES = [
8504
9080
  _RawSet.DR_INNERHTML_NAME,
8505
9081
  _RawSet.DR_INNERTEXT_NAME,
8506
9082
  _RawSet.DR_REPEAT_NAME,
8507
- _RawSet.DR_DETECT_NAME,
9083
+ // RawSet.DR_DETECT_NAME, // TODO: DrDetect 오퍼레이터 구현 필요
8508
9084
  _RawSet.DR_STRIP_NAME
8509
9085
  ];
8510
9086
  var RawSet = _RawSet;
@@ -8512,10 +9088,7 @@ var RawSet = _RawSet;
8512
9088
  // ../dom-render/dist/esm/decorators/DomRenderNoProxy.js
8513
9089
  var DomRenderNoProxyKey = "DomRender:NoProxy";
8514
9090
  var getDomRenderNoProxy = (target, propertyKey) => {
8515
- if (propertyKey === void 0) {
8516
- return Reflect.getMetadata(DomRenderNoProxyKey, target);
8517
- }
8518
- return Reflect.getMetadata(DomRenderNoProxyKey, target, propertyKey);
9091
+ return ReflectUtils.getMetadata(DomRenderNoProxyKey, target, propertyKey);
8519
9092
  };
8520
9093
  var isDomRenderNoProxy = (target, propertyKey) => {
8521
9094
  return ValidUtils.isNullOrUndefined(target) || getDomRenderNoProxy(target, propertyKey) === true;
@@ -8560,8 +9133,26 @@ var isOnRawSetRendered = (obj) => {
8560
9133
  return typeof obj?.onRawSetRendered === "function";
8561
9134
  };
8562
9135
 
9136
+ // ../dom-render/dist/esm/lifecycle/OnChildRawSetRendered.js
9137
+ var isOnChildRawSetRendered = (obj) => {
9138
+ return typeof obj?.onChildRawSetRendered === "function";
9139
+ };
9140
+
8563
9141
  // ../dom-render/dist/esm/DomRenderProxy.js
8564
- var excludeGetSetPropertys = ["onBeforeReturnGet", "onBeforeReturnSet", "__domrender_components", "__render", "_DomRender_isFinal", "_domRender_ref", "_rawSets", "_domRender_proxy", "_targets", "_DomRender_origin", "_DomRender_ref", "_DomRender_proxy"];
9142
+ var excludeGetSetPropertys = [
9143
+ "onBeforeReturnGet",
9144
+ "onBeforeReturnSet",
9145
+ "__domrender_components",
9146
+ "__render",
9147
+ "_DomRender_isFinal",
9148
+ "_domRender_ref",
9149
+ "_rawSets",
9150
+ "_domRender_proxy",
9151
+ "_targets",
9152
+ "_DomRender_origin",
9153
+ "_DomRender_ref",
9154
+ "_DomRender_proxy"
9155
+ ];
8565
9156
  var isWrapProxyDomRenderProxy = (obj) => {
8566
9157
  return obj && typeof obj === "object" && "_DomRender_isProxy" in obj;
8567
9158
  };
@@ -8578,6 +9169,7 @@ var getDomRenderConfig = (obj) => {
8578
9169
  return void 0;
8579
9170
  };
8580
9171
  var DomRenderProxy = class _DomRenderProxy {
9172
+ // public name = Math.random();
8581
9173
  constructor(_domRender_origin, target, _domRender_config) {
8582
9174
  this._domRender_origin = _domRender_origin;
8583
9175
  this._domRender_config = _domRender_config;
@@ -8597,7 +9189,7 @@ var DomRenderProxy = class _DomRenderProxy {
8597
9189
  static isFinal(obj) {
8598
9190
  return ValidUtils.isNull(obj) || DomRenderFinalProxy.isFinal(obj);
8599
9191
  }
8600
- run(objProxy) {
9192
+ async run(objProxy) {
8601
9193
  this._domRender_proxy = objProxy;
8602
9194
  if (isOnProxyDomRender(objProxy)) {
8603
9195
  objProxy.onProxyDomRender(this._domRender_config);
@@ -8622,18 +9214,18 @@ var DomRenderProxy = class _DomRenderProxy {
8622
9214
  }
8623
9215
  });
8624
9216
  }
8625
- this._targets.forEach((target) => {
8626
- this.initRender(target);
8627
- });
9217
+ for (let target of this._targets) {
9218
+ await this.initRender(target);
9219
+ }
8628
9220
  }
8629
- initRender(target, rawSet) {
9221
+ async initRender(target, rawSet) {
8630
9222
  if (target instanceof Element) {
8631
9223
  target.innerHTML = target.innerHTML.replace(/@this@/g, "this");
8632
9224
  }
8633
9225
  const onCreate = target.getAttribute?.(RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);
8634
9226
  let createParam = [];
8635
9227
  if (onCreate) {
8636
- createParam = ScriptUtils.evaluateReturn(onCreate, this._domRender_proxy);
9228
+ createParam = ObjectUtils.Script.evaluateReturn(onCreate, this._domRender_proxy);
8637
9229
  if (!Array.isArray(createParam)) {
8638
9230
  createParam = [createParam];
8639
9231
  }
@@ -8646,7 +9238,11 @@ var DomRenderProxy = class _DomRenderProxy {
8646
9238
  }
8647
9239
  this._targets.add(target);
8648
9240
  const rawSets = RawSet.checkPointCreates(target, this._domRender_proxy, this._domRender_config);
8649
- this._domRender_config.eventManager.applyEvent(this._domRender_proxy, this._domRender_config.eventManager.findAttrElements(target, this._domRender_config), this._domRender_config);
9241
+ this._domRender_config.eventManager.applyEvent(
9242
+ this._domRender_proxy,
9243
+ this._domRender_config.eventManager.findAttrElements(target, this._domRender_config),
9244
+ this._domRender_config
9245
+ );
8650
9246
  rawSets.forEach((it) => {
8651
9247
  const variables = it.getUsingTriggerVariables(this._domRender_config);
8652
9248
  if (variables.size <= 0) {
@@ -8657,16 +9253,20 @@ var DomRenderProxy = class _DomRenderProxy {
8657
9253
  });
8658
9254
  }
8659
9255
  });
8660
- this.render(this.getRawSets()).then((it) => {
9256
+ const targetRawSets = await this.render(this.getRawSets());
9257
+ for (let targetRawSet of targetRawSets) {
8661
9258
  const onInit = target.getAttribute?.(RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME);
8662
9259
  let initParam;
8663
9260
  if (onCreate) {
8664
- initParam = ScriptUtils.evaluateReturn(onCreate, this._domRender_proxy);
9261
+ initParam = ObjectUtils.Script.evaluateReturn(onCreate, this._domRender_proxy);
8665
9262
  }
8666
9263
  if (isOnInitRender(this._domRender_proxy)) {
8667
- this._domRender_proxy.onInitRender(initParam, rawSet ?? { dataSet: { config: this._domRender_config } });
9264
+ await this._domRender_proxy.onInitRender(
9265
+ initParam,
9266
+ rawSet ?? { dataSet: { config: this._domRender_config } }
9267
+ );
8668
9268
  }
8669
- });
9269
+ }
8670
9270
  }
8671
9271
  getRawSets() {
8672
9272
  const set = /* @__PURE__ */ new Set();
@@ -8687,43 +9287,65 @@ var DomRenderProxy = class _DomRenderProxy {
8687
9287
  }
8688
9288
  const removeRawSets = [];
8689
9289
  const rawSets = raws ?? this.getRawSets();
8690
- for (const it of rawSets) {
8691
- it.getUsingTriggerVariables(this._domRender_config).forEach((path2) => {
8692
- this.addRawSet(path2, it);
8693
- });
8694
- let renderResult;
8695
- if (it.isConnected) {
8696
- const targetAttrMap = it.point.node?.getAttribute?.(EventManager.normalAttrMapAttrName);
8697
- if (it.detect?.action) {
8698
- it.detect.action();
8699
- } else if (it.type === RawSetType.TARGET_ELEMENT && it.dataSet?.render?.currentThis && fullPathStr && targetAttrMap) {
8700
- new Map(JSON.parse(targetAttrMap)).forEach((v, k) => {
8701
- var _a7;
8702
- const isUsing = EventManager.isUsingThisVar(v, `this.${fullPathStr}`);
8703
- if (isUsing) {
8704
- const targetAttrObject = RawSet.getAttributeObject(it.point.node, { script: it.dataSet?.render?.renderScript ?? "", obj: Object.assign(this._domRender_proxy ?? {}, { __render: it.dataSet?.render }) });
8705
- (_a7 = it.dataSet).render ?? (_a7.render = {});
8706
- it.dataSet.render.attribute = targetAttrObject;
8707
- if (isOnChangeAttrRender(it.dataSet?.render?.currentThis)) {
8708
- it.dataSet?.render?.currentThis?.onChangeAttrRender?.(k, targetAttrObject[k], { rawSet: it });
9290
+ const CHUNK_SIZE = 50;
9291
+ const chunks = [];
9292
+ const rawSetsArray = Array.from(rawSets);
9293
+ for (let i = 0; i < rawSetsArray.length; i += CHUNK_SIZE) {
9294
+ chunks.push(rawSetsArray.slice(i, i + CHUNK_SIZE));
9295
+ }
9296
+ for (const chunk of chunks) {
9297
+ const promises2 = chunk.map(async (it) => {
9298
+ it.getUsingTriggerVariables(this._domRender_config).forEach((path2) => {
9299
+ this.addRawSet(path2, it);
9300
+ });
9301
+ let renderResult;
9302
+ if (it.isConnected) {
9303
+ const targetAttrMap = it.point.node?.getAttribute?.(EventManager.normalAttrMapAttrName);
9304
+ if (it.detect?.action) {
9305
+ it.detect.action();
9306
+ } else if (it.type === RawSetType.TARGET_ELEMENT && it.dataSet?.render?.currentThis && fullPathStr && targetAttrMap) {
9307
+ const attrStart = performance.now();
9308
+ new Map(JSON.parse(targetAttrMap)).forEach((v, k) => {
9309
+ var _a7;
9310
+ const isUsing = v.variablePaths.some((it2) => EventManager.isUsingThisVar(it2.inner, `this.${fullPathStr}`));
9311
+ if (isUsing) {
9312
+ const targetAttrObject = RawSet.getAttributeObject(it.point.node, {
9313
+ script: it.dataSet?.render?.renderScript ?? "",
9314
+ obj: Object.assign(this._domRender_proxy ?? {}, { __render: it.dataSet?.render })
9315
+ });
9316
+ (_a7 = it.dataSet).render ?? (_a7.render = {});
9317
+ it.dataSet.render.attribute = targetAttrObject;
9318
+ if (isOnChangeAttrRender(it.dataSet?.render?.currentThis)) {
9319
+ it.dataSet?.render?.currentThis?.onChangeAttrRender?.(k, targetAttrObject[k], { rawSet: it });
9320
+ }
8709
9321
  }
9322
+ });
9323
+ const attrEnd = performance.now();
9324
+ } else {
9325
+ const renderStart = performance.now();
9326
+ const rawSets2 = await it.render(this._domRender_proxy, this._domRender_config);
9327
+ const renderEnd = performance.now();
9328
+ renderResult = rawSets2;
9329
+ if (rawSets2 && rawSets2.raws.length > 0) {
9330
+ await this.render(rawSets2.raws);
8710
9331
  }
8711
- });
8712
- } else {
8713
- const rawSets2 = await it.render(this._domRender_proxy, this._domRender_config);
8714
- renderResult = rawSets2;
8715
- if (rawSets2 && rawSets2.raws.length > 0) {
8716
- await this.render(rawSets2.raws);
8717
9332
  }
9333
+ } else {
9334
+ removeRawSets.push(it);
8718
9335
  }
8719
- } else {
8720
- removeRawSets.push(it);
8721
- }
8722
- const t = it.findNearThis(this._domRender_proxy);
8723
- if (isOnRawSetRendered(t)) {
8724
- await t.onRawSetRendered(it, { path: fullPathStr, renderResult });
9336
+ const t = it.findNearThis(this._domRender_proxy);
9337
+ if (isOnRawSetRendered(t)) {
9338
+ await t.onRawSetRendered(it, { path: fullPathStr, value: ObjectUtils.Script.evaluateReturn(`this.${fullPathStr}`, this._domRender_proxy), root: this._domRender_proxy, renderResult });
9339
+ }
9340
+ });
9341
+ await Promise.all(promises2);
9342
+ if (chunks.length > 1) {
9343
+ await new Promise((resolve) => requestAnimationFrame(resolve));
8725
9344
  }
8726
9345
  }
9346
+ if (isOnChildRawSetRendered(this._domRender_proxy)) {
9347
+ await this._domRender_proxy.onChildRawSetRendered();
9348
+ }
8727
9349
  if (removeRawSets.length > 0) {
8728
9350
  this.removeRawSet(...removeRawSets);
8729
9351
  }
@@ -8738,14 +9360,21 @@ var DomRenderProxy = class _DomRenderProxy {
8738
9360
  // return current;
8739
9361
  // }
8740
9362
  root(pathInfos, value, lastDoneExecute = true) {
9363
+ const rootStartTime = Date.now();
9364
+ const pathKey = pathInfos.flat().map((i) => i.path).join(".");
8741
9365
  const fullPaths = [];
8742
9366
  if (this._domRender_ref.size > 0) {
8743
9367
  this._domRender_ref.forEach((it, key) => {
8744
9368
  if ("_DomRender_isProxy" in key) {
8745
9369
  it.forEach((sit) => {
8746
9370
  try {
9371
+ const recursiveStartTime = Date.now();
8747
9372
  const concat = pathInfos.concat([[{ path: sit, obj: key }]]);
8748
- const items = key._DomRender_proxy?.root(concat, value, lastDoneExecute);
9373
+ const items = key._DomRender_proxy?.root(
9374
+ concat,
9375
+ value,
9376
+ lastDoneExecute
9377
+ );
8749
9378
  fullPaths.push(items.flat());
8750
9379
  } catch (e) {
8751
9380
  }
@@ -8753,6 +9382,7 @@ var DomRenderProxy = class _DomRenderProxy {
8753
9382
  }
8754
9383
  });
8755
9384
  } else {
9385
+ const pathProcessStartTime = Date.now();
8756
9386
  const strings = pathInfos.reverse().map((it) => it.map((it2) => it2.path).join(","));
8757
9387
  const fullPathStr = strings.map((it) => isNaN(Number(it)) ? "." + it : `[${it}]`).join("").slice(1);
8758
9388
  if (lastDoneExecute) {
@@ -8760,10 +9390,13 @@ var DomRenderProxy = class _DomRenderProxy {
8760
9390
  const front = strings.slice(0, strings.length - 1).map((it) => isNaN(Number(it)) ? "." + it : `[${it}]`).join("");
8761
9391
  const lastPropertyName = strings[strings.length - 1];
8762
9392
  const path2 = "this" + front;
8763
- const data = ScriptUtils.evaluateReturn(ObjectUtils.Path.toOptionalChainPath(path2), this._domRender_proxy);
9393
+ const data = ObjectUtils.Script.evaluateReturn(ObjectUtils.Path.toOptionalChainPath(path2), this._domRender_proxy);
9394
+ const promiseStartTime = Date.now();
8764
9395
  new Promise(async (resolve) => {
9396
+ const promiseInnerStartTime = Date.now();
8765
9397
  let rData = [];
8766
9398
  const firstPathStr = front.slice(1);
9399
+ const dictionaryCheckStartTime = Date.now();
8767
9400
  const firstTargets = this._rawSets.get(firstPathStr);
8768
9401
  const firstTargetDictionary = [];
8769
9402
  firstTargets?.forEach((it) => {
@@ -8781,10 +9414,19 @@ var DomRenderProxy = class _DomRenderProxy {
8781
9414
  if (value === void 0) {
8782
9415
  const rawSet = it.getHasRawSet(lastPropertyName);
8783
9416
  rawSet?.remove();
8784
- startElement.setAttribute(RawSet.DR_HAS_KEYS_OPTIONNAME, keys.filter((it2) => it2 !== lastPropertyName).join(","));
9417
+ startElement.setAttribute(
9418
+ RawSet.DR_HAS_KEYS_OPTIONNAME,
9419
+ keys.filter((it2) => it2 !== lastPropertyName).join(",")
9420
+ );
8785
9421
  }
8786
9422
  if (!keys.includes(lastPropertyName)) {
8787
- const raws = DrThisProperty.append(this._domRender_proxy, fullPathStr, lastPropertyName, it, this._domRender_config);
9423
+ const raws = DrThisProperty.append(
9424
+ this._domRender_proxy,
9425
+ fullPathStr,
9426
+ lastPropertyName,
9427
+ it,
9428
+ this._domRender_config
9429
+ );
8788
9430
  if (raws) {
8789
9431
  rawSets.push(...raws);
8790
9432
  }
@@ -8796,6 +9438,7 @@ var DomRenderProxy = class _DomRenderProxy {
8796
9438
  rData = await this.render(rawSets);
8797
9439
  }
8798
9440
  }
9441
+ const renderStartTime = Date.now();
8799
9442
  if (lastPropertyName === "length" && Array.isArray(data)) {
8800
9443
  const aIterable = this._rawSets.get(firstPathStr);
8801
9444
  if (aIterable) {
@@ -8804,14 +9447,27 @@ var DomRenderProxy = class _DomRenderProxy {
8804
9447
  } else if (iterable) {
8805
9448
  rData = await this.render(Array.from(iterable), fullPathStr);
8806
9449
  }
9450
+ const eventProcessStartTime = Date.now();
9451
+ const Node2 = this._domRender_config.window.Node;
8807
9452
  this._targets.forEach((it) => {
8808
- if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
8809
- const targets = this._domRender_config.eventManager.findAttrElements(it, this._domRender_config);
8810
- this._domRender_config.eventManager.changeVar(this._domRender_proxy, targets, `this.${fullPathStr}`, this._domRender_config);
9453
+ if (it.nodeType === Node2.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node2.ELEMENT_NODE) {
9454
+ const findAttrStartTime = Date.now();
9455
+ const targets = this._domRender_config.eventManager.findAttrElements(
9456
+ it,
9457
+ this._domRender_config
9458
+ );
9459
+ const targetCount = targets?.size || targets?.length || 0;
9460
+ const changeVarStartTime = Date.now();
9461
+ this._domRender_config.eventManager.changeVar(
9462
+ this._domRender_proxy,
9463
+ targets,
9464
+ `this.${fullPathStr}`,
9465
+ this._domRender_config
9466
+ );
8811
9467
  }
8812
9468
  });
8813
9469
  if (rData?.length > 0 && isOnChildRenderedByProperty(data)) {
8814
- const propertyValue = ScriptUtils.evaluateReturn(`this.${lastPropertyName}`, data);
9470
+ const propertyValue = ObjectUtils.Script.evaluateReturn(`this.${lastPropertyName}`, data);
8815
9471
  data.onChildRenderedByProperty(lastPropertyName, propertyValue);
8816
9472
  }
8817
9473
  resolve(rData);
@@ -8827,6 +9483,7 @@ var DomRenderProxy = class _DomRenderProxy {
8827
9483
  target[p] = value;
8828
9484
  return true;
8829
9485
  }
9486
+ let start = performance.now();
8830
9487
  if (typeof p === "string") {
8831
9488
  value = this.proxy(receiver, value, p);
8832
9489
  }
@@ -8839,49 +9496,73 @@ var DomRenderProxy = class _DomRenderProxy {
8839
9496
  fullPathInfo = this.root([[{ path: p, obj: this._domRender_proxy }]], value);
8840
9497
  }
8841
9498
  const rootElement = this._domRender_config.rootElement ?? this._domRender_config.window.document;
8842
- DocumentUtils.querySelectorAllByAttributeName(rootElement, EventManager.normalAttrMapAttrName)?.forEach((elementInfo) => {
8843
- const targets = new Map(ScriptUtils.evaluateReturn(elementInfo.value));
8844
- Array.from(targets.entries()).filter(([key, value2]) => value2.trim()).filter(isDefined).flatMap(([key, valueScript]) => {
8845
- return fullPathInfo.flat().filter((it) => valueScript.includes(`this.${it.path}`)).flatMap((it) => ({ key, valueScript, pathInfo: it }));
8846
- }).forEach((it) => {
8847
- const optionalPath = ObjectUtils.Path.toOptionalChainPath(it.valueScript);
8848
- const value1 = ScriptUtils.evaluateReturn(optionalPath, it.pathInfo.obj);
8849
- if (value1 === null) {
8850
- elementInfo.element.removeAttribute(it.key);
8851
- elementInfo.element[it.key] = null;
8852
- } else {
8853
- elementInfo.element.setAttribute(it.key, value1);
8854
- elementInfo.element[it.key] = value1;
8855
- }
8856
- });
8857
- });
8858
- DocumentUtils.querySelectorAllByAttributeName(rootElement, EventManager.linkTargetMapAttrName)?.forEach((elementInfo) => {
8859
- const targets = new Map(ScriptUtils.evaluateReturn(elementInfo.value));
8860
- Array.from(targets.entries()).filter(([key, value2]) => value2.trim()).filter(isDefined).flatMap(([key, valueScript]) => {
8861
- return fullPathInfo.flat().filter((it) => valueScript.includes(`this.${it.path}`)).flatMap((it) => ({ key, valueScript, pathInfo: it }));
8862
- }).forEach((info) => {
8863
- const value1 = ScriptUtils.evaluateReturn(info.valueScript, info.pathInfo.obj);
8864
- const applyAttributeName = EventManager.linkAttrs.find((it) => it.name === info.key);
8865
- if (applyAttributeName) {
8866
- if (value1 === null) {
8867
- elementInfo.element.removeAttribute(applyAttributeName.property);
9499
+ DocumentUtils.querySelectorAllByAttributeName(rootElement, EventManager.normalAttrMapAttrName)?.forEach(
9500
+ (elementInfo) => {
9501
+ const targets = new Map(
9502
+ ObjectUtils.Script.evaluateReturn(elementInfo.value)
9503
+ );
9504
+ Array.from(targets.entries()).filter(isDefined).flatMap(([key, valueScript]) => {
9505
+ return fullPathInfo.flat().filter((it) => valueScript.variablePaths?.some((vit) => vit.inner.includes(`this.${it.path}`))).flatMap((it) => ({ key, valueScript, pathInfo: it }));
9506
+ }).forEach((it) => {
9507
+ const variablePaths = it.valueScript.variablePaths;
9508
+ let targetScript = it.valueScript.originalAttrValue;
9509
+ let script;
9510
+ if (it.valueScript.isStringTemplate) {
9511
+ variablePaths.forEach((it2) => {
9512
+ let r = ObjectUtils.Path.toOptionalChainPath(it2.inner);
9513
+ targetScript = targetScript.replaceAll(it2.origin, `\${${r}}`);
9514
+ });
9515
+ script = "`" + targetScript + "`";
8868
9516
  } else {
8869
- elementInfo.element.setAttribute(applyAttributeName.property, value1);
9517
+ variablePaths.forEach((it2) => {
9518
+ let r = ObjectUtils.Path.toOptionalChainPath(it2.inner);
9519
+ targetScript = targetScript.replaceAll(it2.origin, `${r}`);
9520
+ });
9521
+ script = targetScript;
8870
9522
  }
8871
- }
8872
- });
8873
- Array.from(targets.entries()).filter(([key, value2]) => value2.trim()).filter(isDefined).flatMap(([key, valueScript]) => {
8874
- return fullPathInfo.flat().filter((it) => valueScript.includes(`this.${it.path}`)).flatMap((it) => ({ key, valueScript, pathInfo: it }));
8875
- }).forEach((info) => {
8876
- const linkInfo = EventManager.linkAttrs.find((it) => it.name === info.key);
8877
- if (linkInfo) {
8878
- elementInfo.element[linkInfo.property] = value;
8879
- }
8880
- });
8881
- });
9523
+ const value1 = ObjectUtils.Script.evaluateReturn(script, it.pathInfo.obj);
9524
+ if (value1 === null || value1 === void 0) {
9525
+ elementInfo.element.removeAttribute(it.key);
9526
+ } else {
9527
+ elementInfo.element.setAttribute(it.key, value1);
9528
+ elementInfo.element[it.key] = value1;
9529
+ }
9530
+ });
9531
+ }
9532
+ );
9533
+ DocumentUtils.querySelectorAllByAttributeName(rootElement, EventManager.linkTargetMapAttrName)?.forEach(
9534
+ (elementInfo) => {
9535
+ const targets = new Map(ObjectUtils.Script.evaluateReturn(elementInfo.value));
9536
+ Array.from(targets.entries()).filter(([key, value2]) => value2.trim()).filter(isDefined).flatMap(([key, valueScript]) => {
9537
+ return fullPathInfo.flat().filter((it) => valueScript.includes(`this.${it.path}`)).flatMap((it) => ({ key, valueScript, pathInfo: it }));
9538
+ }).forEach((info) => {
9539
+ const value1 = ObjectUtils.Script.evaluateReturn(info.valueScript, info.pathInfo.obj);
9540
+ const applyAttributeName = EventManager.linkAttrs.find((it) => it.name === info.key);
9541
+ if (applyAttributeName) {
9542
+ if (value1 === null) {
9543
+ elementInfo.element.removeAttribute(applyAttributeName.property);
9544
+ } else {
9545
+ elementInfo.element.setAttribute(applyAttributeName.property, value1);
9546
+ }
9547
+ }
9548
+ });
9549
+ Array.from(targets.entries()).filter(([key, value2]) => value2.trim()).filter(isDefined).flatMap(([key, valueScript]) => {
9550
+ return fullPathInfo.flat().filter((it) => valueScript.includes(`this.${it.path}`)).flatMap((it) => ({ key, valueScript, pathInfo: it }));
9551
+ }).forEach((info) => {
9552
+ const linkInfo = EventManager.linkAttrs.find((it) => it.name === info.key);
9553
+ if (linkInfo) {
9554
+ elementInfo.element[linkInfo.property] = value;
9555
+ }
9556
+ });
9557
+ }
9558
+ );
8882
9559
  if ("onBeforeReturnSet" in receiver && typeof p === "string" && !(this._domRender_config.proxyExcludeOnBeforeReturnSets ?? []).concat(excludeGetSetPropertys).includes(p)) {
8883
9560
  if (isOnBeforeReturnSet(receiver)) {
8884
- receiver.onBeforeReturnSet?.(p, value, fullPathInfo.map((it) => it.map((it2) => it2.path).join()));
9561
+ receiver.onBeforeReturnSet?.(
9562
+ p,
9563
+ value,
9564
+ fullPathInfo.map((it) => it.map((it2) => it2.path).join())
9565
+ );
8885
9566
  }
8886
9567
  }
8887
9568
  return true;
@@ -8901,7 +9582,11 @@ var DomRenderProxy = class _DomRenderProxy {
8901
9582
  it = it._DomRender_origin;
8902
9583
  }
8903
9584
  if ("onBeforeReturnGet" in receiver && typeof p === "string" && !(this._domRender_config.proxyExcludeOnBeforeReturnGets ?? []).concat(excludeGetSetPropertys).includes(p)) {
8904
- receiver?.onBeforeReturnGet?.(p, it, this.root([[{ path: p, obj: this._domRender_proxy }]], it, false));
9585
+ receiver?.onBeforeReturnGet?.(
9586
+ p,
9587
+ it,
9588
+ this.root([[{ path: p, obj: this._domRender_proxy }]], it, false)
9589
+ );
8905
9590
  }
8906
9591
  return it;
8907
9592
  }
@@ -9029,46 +9714,47 @@ function filter(predicate) {
9029
9714
  }
9030
9715
 
9031
9716
  // ../core/dist/esm/message/operators/first.js
9032
- var EmptyError = class extends Error {
9033
- constructor() {
9034
- super("no elements in sequence");
9035
- this.name = "EmptyError";
9036
- }
9037
- };
9038
- function first(predicate) {
9717
+ function first(predicate, defaultValue) {
9039
9718
  return (source) => {
9040
9719
  return new Observable((subscriber) => {
9041
9720
  let index = 0;
9042
- let found = false;
9043
- const sourceSubscription = source.subscribe({
9721
+ let hasValue = false;
9722
+ const subscription = source.subscribe({
9044
9723
  next: (value) => {
9045
- if (found) return;
9046
- const passed = predicate ? predicate(value, index++) : true;
9047
- if (passed) {
9048
- found = true;
9724
+ if (hasValue) {
9725
+ return;
9726
+ }
9727
+ const shouldEmit = predicate ? predicate(value, index++) : true;
9728
+ if (shouldEmit) {
9729
+ hasValue = true;
9049
9730
  subscriber.next(value);
9050
9731
  subscriber.complete();
9051
- sourceSubscription.unsubscribe();
9732
+ subscription.unsubscribe();
9052
9733
  }
9053
9734
  },
9054
9735
  error: (err) => {
9055
- subscriber.error(err);
9736
+ if (!hasValue) {
9737
+ subscriber.error(err);
9738
+ }
9056
9739
  },
9057
9740
  complete: () => {
9058
- if (!found) {
9059
- subscriber.error(new EmptyError());
9741
+ if (!hasValue) {
9742
+ if (defaultValue !== void 0) {
9743
+ subscriber.next(defaultValue);
9744
+ subscriber.complete();
9745
+ } else {
9746
+ subscriber.error(new Error("no elements in sequence"));
9747
+ }
9060
9748
  }
9061
9749
  }
9062
9750
  });
9063
- return () => {
9064
- sourceSubscription.unsubscribe();
9065
- };
9751
+ return subscription;
9066
9752
  });
9067
9753
  };
9068
9754
  }
9069
9755
 
9070
9756
  // ../core/dist/esm/message/internal/lastValueFrom.js
9071
- var EmptyError2 = class extends Error {
9757
+ var EmptyError = class extends Error {
9072
9758
  constructor(message = "No elements in sequence") {
9073
9759
  super(message);
9074
9760
  this.name = "EmptyError";
@@ -9088,7 +9774,7 @@ function firstValueFrom(source) {
9088
9774
  error: reject,
9089
9775
  complete: () => {
9090
9776
  if (!_hasValue) {
9091
- reject(new EmptyError2());
9777
+ reject(new EmptyError());
9092
9778
  }
9093
9779
  }
9094
9780
  });
@@ -9193,7 +9879,7 @@ var SSRFilter = class {
9193
9879
  simpleBootFront.routingSubjectObservable.pipe(
9194
9880
  // @ts-ignore
9195
9881
  filter(
9196
- (it) => it.state === "end" && typeof it.routerModule.intent.uri === "string" && targetUrl.endsWith(it.routerModule.intent.uri)
9882
+ (it) => it.triggerPoint === "end" && typeof it.routerModule.intent.uri === "string" && targetUrl.endsWith(it.routerModule.intent.uri)
9197
9883
  ),
9198
9884
  // delay(1000),
9199
9885
  first()
@@ -9471,10 +10157,10 @@ var Alert = class {
9471
10157
  this.alertService = alertService;
9472
10158
  this.config = config;
9473
10159
  this.isActive = false;
9474
- this.activeBefore = [];
9475
- this.activeAfter = [];
9476
- this.deActiveBefore = [];
9477
- this.deActiveAfter = [];
10160
+ this.activateBefore = [];
10161
+ this.activateAfter = [];
10162
+ this.deActivateBefore = [];
10163
+ this.deActivateAfter = [];
9478
10164
  this.data = /* @__PURE__ */ new Map();
9479
10165
  if (config?.uuid) {
9480
10166
  this.uuid = config.uuid;
@@ -9483,16 +10169,16 @@ var Alert = class {
9483
10169
  }
9484
10170
  }
9485
10171
  addOpenBefore(fn) {
9486
- this.activeBefore.push(fn);
10172
+ this.activateBefore.push(fn);
9487
10173
  }
9488
10174
  addOpenAfter(fn) {
9489
- this.activeAfter.push(fn);
10175
+ this.activateAfter.push(fn);
9490
10176
  }
9491
10177
  addCloseBefore(fn) {
9492
- this.deActiveBefore.push(fn);
10178
+ this.deActivateBefore.push(fn);
9493
10179
  }
9494
10180
  addCloseAfter(fn) {
9495
- this.deActiveAfter.push(fn);
10181
+ this.deActivateAfter.push(fn);
9496
10182
  }
9497
10183
  setData(key, value) {
9498
10184
  this.data.set(key, value);
@@ -9500,35 +10186,35 @@ var Alert = class {
9500
10186
  getData(key) {
9501
10187
  return this.data.get(key);
9502
10188
  }
9503
- async active() {
10189
+ async activate() {
9504
10190
  try {
9505
- await Promise.allSettled(this.activeBefore.map((it) => it())).then((it) => {
10191
+ await Promise.allSettled(this.activateBefore.map((it) => it())).then((it) => {
9506
10192
  this.result = this.make();
9507
10193
  this.alertService?.publish({ action: AlertAction.ACTIVE, alert: this });
9508
10194
  this.isActive = true;
9509
10195
  if (this.config?.closeTime !== void 0 && this.config?.closeTime > 0) {
9510
10196
  setTimeout(() => {
9511
- this.inActive();
10197
+ this.deActivate();
9512
10198
  }, this.config.closeTime);
9513
10199
  }
9514
- this.config?.active?.(this.result, this);
10200
+ this.config?.activate?.(this.result, this);
9515
10201
  });
9516
10202
  } catch (e) {
9517
10203
  } finally {
9518
- await Promise.allSettled(this.activeAfter.map((it) => it())).then((it) => {
10204
+ await Promise.allSettled(this.activateAfter.map((it) => it())).then((it) => {
9519
10205
  });
9520
10206
  }
9521
10207
  }
9522
- async inActive() {
10208
+ async deActivate() {
9523
10209
  try {
9524
- await Promise.allSettled(this.deActiveBefore.map((it) => it())).then((it) => {
10210
+ await Promise.allSettled(this.deActivateBefore.map((it) => it())).then((it) => {
9525
10211
  this.alertService?.publish({ action: AlertAction.IN_ACTIVE, alert: this });
9526
10212
  this.isActive = false;
9527
- this.config?.deActive?.(this.result, this);
10213
+ this.config?.deActivate?.(this.result, this);
9528
10214
  });
9529
10215
  } catch (e) {
9530
10216
  } finally {
9531
- await Promise.allSettled(this.deActiveAfter.map((it) => it())).then((it) => {
10217
+ await Promise.allSettled(this.deActivateAfter.map((it) => it())).then((it) => {
9532
10218
  });
9533
10219
  }
9534
10220
  }
@@ -10031,7 +10717,7 @@ var ApiService = class ApiService2 extends HttpJsonFetcher {
10031
10717
  const alert = this.alertService?.progress({ title: config.config.config.title });
10032
10718
  if (alert) {
10033
10719
  pipe.progress = alert;
10034
- alert.active();
10720
+ alert.activate();
10035
10721
  }
10036
10722
  }
10037
10723
  }
@@ -10039,7 +10725,7 @@ var ApiService = class ApiService2 extends HttpJsonFetcher {
10039
10725
  this.subject.next({ type: "success", config, pipe });
10040
10726
  config.config?.config?.callBackSuccess?.(config, pipe);
10041
10727
  if (config.config?.config?.alertSuccessMsg) {
10042
- this.alertService?.success({ title: config.config.config.title })?.active();
10728
+ this.alertService?.success({ title: config.config.config.title })?.activate();
10043
10729
  }
10044
10730
  }
10045
10731
  afterSuccessTransform(config, pipe) {
@@ -10047,7 +10733,7 @@ var ApiService = class ApiService2 extends HttpJsonFetcher {
10047
10733
  finally(config, pipe) {
10048
10734
  this.subject.next({ type: "final", config, pipe });
10049
10735
  config.config?.config?.callBackFinal?.(config, pipe);
10050
- pipe.progress?.inActive();
10736
+ pipe.progress?.deActivate();
10051
10737
  }
10052
10738
  error(config, pipe, e) {
10053
10739
  console.log("error", e);
@@ -10056,7 +10742,7 @@ var ApiService = class ApiService2 extends HttpJsonFetcher {
10056
10742
  if (config.config?.config?.alertErrorMsg) {
10057
10743
  this.alertService?.danger({
10058
10744
  title: `${config.config.config.title ? config.config.config.title : ""}${e.message ? `(${e.message})` : ""}`
10059
- })?.active();
10745
+ })?.activate();
10060
10746
  }
10061
10747
  if (config.config?.config?.enableErrorConsole) {
10062
10748
  console.error(`apiService Error ${config?.config?.config?.title}`, e);
@@ -10090,97 +10776,14 @@ var __decorate9 = function(decorators, target, key, desc) {
10090
10776
  var __metadata6 = function(k, v) {
10091
10777
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10092
10778
  };
10779
+ var SymbolIntentApiServiceProxy_1;
10093
10780
  var _a6;
10094
- var SymbolIntentApiServiceProxy = class SymbolIntentApiServiceProxy2 {
10781
+ var SymbolIntentApiServiceProxy = SymbolIntentApiServiceProxy_1 = class SymbolIntentApiServiceProxy2 {
10095
10782
  constructor(apiService) {
10096
10783
  this.apiService = apiService;
10097
- console.log("-------apiService", apiService);
10098
- }
10099
- get(target, prop, receiver) {
10100
- const simConfig = getSim(target);
10101
- const apiService = this.apiService;
10102
- const value = Reflect.get(target, prop, receiver);
10103
- if (typeof value === "function" && simConfig?.symbol) {
10104
- return function(...args) {
10105
- const f = value;
10106
- const p = (userConfig) => {
10107
- const headers = { ...userConfig?.headers ?? {}, ...makeIntentHeaderBySymbol(simConfig.symbol) };
10108
- const method = userConfig?.method ?? "post";
10109
- if (method === "post" && userConfig?.multipartFormData) {
10110
- return apiService.post({
10111
- target: `/${String(prop)}`,
10112
- config: {
10113
- bypassTransform: userConfig?.bypassTransform,
10114
- transformText: userConfig?.transformText,
10115
- fetch: {
10116
- credentials: "include",
10117
- headers,
10118
- body: ConvertUtils.toFormData(userConfig?.body)
10119
- }
10120
- }
10121
- });
10122
- } else if (method === "post") {
10123
- return apiService.postJson({
10124
- target: `/${String(prop)}`,
10125
- config: {
10126
- bypassTransform: userConfig?.bypassTransform,
10127
- transformText: userConfig?.transformText,
10128
- fetch: {
10129
- credentials: "include",
10130
- headers,
10131
- body: userConfig?.body
10132
- }
10133
- }
10134
- });
10135
- } else if (method === "petch") {
10136
- return apiService.patchJson({
10137
- target: `/${String(prop)}`,
10138
- config: {
10139
- bypassTransform: userConfig?.bypassTransform,
10140
- transformText: userConfig?.transformText,
10141
- fetch: {
10142
- credentials: "include",
10143
- headers,
10144
- body: userConfig?.body
10145
- }
10146
- }
10147
- });
10148
- } else {
10149
- return apiService[method]({
10150
- // return apiService.head({
10151
- target: { url: `/${String(prop)}`, searchParams: userConfig?.body },
10152
- config: {
10153
- bypassTransform: userConfig?.bypassTransform,
10154
- transformText: userConfig?.transformText,
10155
- fetch: {
10156
- credentials: "include",
10157
- headers
10158
- }
10159
- }
10160
- });
10161
- }
10162
- };
10163
- args.push(p);
10164
- return Reflect.apply(f, target, args);
10165
- };
10166
- }
10167
- return Reflect.get(target, prop, receiver);
10168
- }
10169
- apply(target, thisArg, argArray) {
10170
- console.log("SymbolIntentApiServiceProxy apply");
10171
- return Reflect.apply(target, thisArg, argArray);
10172
10784
  }
10173
- };
10174
- SymbolIntentApiServiceProxy = __decorate9([
10175
- Sim,
10176
- __metadata6("design:paramtypes", [typeof (_a6 = typeof ApiService !== "undefined" && ApiService) === "function" ? _a6 : Object])
10177
- ], SymbolIntentApiServiceProxy);
10178
-
10179
- // src/proxy/SymbolIntentApiServiceProxyBase.ts
10180
- var SymbolIntentApiServiceProxyBase = class {
10181
- // 생성자는 프록시될 대상 객체(target)와 의존성을 주입받습니다.
10182
- constructor(apiService) {
10183
- const handler = {
10785
+ static createHandler(apiService) {
10786
+ return {
10184
10787
  get(target, prop, receiver) {
10185
10788
  const simConfig = getSim(target);
10186
10789
  const value = Reflect.get(target, prop, receiver);
@@ -10196,6 +10799,7 @@ var SymbolIntentApiServiceProxyBase = class {
10196
10799
  config: {
10197
10800
  bypassTransform: userConfig?.bypassTransform,
10198
10801
  transformText: userConfig?.transformText,
10802
+ config: userConfig?.config,
10199
10803
  fetch: {
10200
10804
  credentials: "include",
10201
10805
  headers,
@@ -10209,6 +10813,7 @@ var SymbolIntentApiServiceProxyBase = class {
10209
10813
  config: {
10210
10814
  bypassTransform: userConfig?.bypassTransform,
10211
10815
  transformText: userConfig?.transformText,
10816
+ config: userConfig?.config,
10212
10817
  fetch: {
10213
10818
  credentials: "include",
10214
10819
  headers,
@@ -10222,6 +10827,7 @@ var SymbolIntentApiServiceProxyBase = class {
10222
10827
  config: {
10223
10828
  bypassTransform: userConfig?.bypassTransform,
10224
10829
  transformText: userConfig?.transformText,
10830
+ config: userConfig?.config,
10225
10831
  fetch: {
10226
10832
  credentials: "include",
10227
10833
  headers,
@@ -10235,6 +10841,7 @@ var SymbolIntentApiServiceProxyBase = class {
10235
10841
  config: {
10236
10842
  bypassTransform: userConfig?.bypassTransform,
10237
10843
  transformText: userConfig?.transformText,
10844
+ config: userConfig?.config,
10238
10845
  fetch: {
10239
10846
  credentials: "include",
10240
10847
  headers
@@ -10250,10 +10857,28 @@ var SymbolIntentApiServiceProxyBase = class {
10250
10857
  return Reflect.get(target, prop, receiver);
10251
10858
  },
10252
10859
  apply(target, thisArg, argArray) {
10253
- console.log("SymbolIntentApiServiceProxyBase apply (from handler)");
10860
+ console.log("SymbolIntentApiServiceProxy apply");
10254
10861
  return Reflect.apply(target, thisArg, argArray);
10255
10862
  }
10256
10863
  };
10864
+ }
10865
+ get(target, prop, receiver) {
10866
+ return SymbolIntentApiServiceProxy_1.createHandler(this.apiService).get(target, prop, receiver);
10867
+ }
10868
+ apply(target, thisArg, argArray) {
10869
+ return SymbolIntentApiServiceProxy_1.createHandler(this.apiService).apply(target, thisArg, argArray);
10870
+ }
10871
+ };
10872
+ SymbolIntentApiServiceProxy = SymbolIntentApiServiceProxy_1 = __decorate9([
10873
+ Sim,
10874
+ __metadata6("design:paramtypes", [typeof (_a6 = typeof ApiService !== "undefined" && ApiService) === "function" ? _a6 : Object])
10875
+ ], SymbolIntentApiServiceProxy);
10876
+
10877
+ // src/proxy/SymbolIntentApiServiceProxyBase.ts
10878
+ var SymbolIntentApiServiceProxyBase = class {
10879
+ // 생성자는 프록시될 대상 객체(target)와 의존성을 주입받습니다.
10880
+ constructor(apiService) {
10881
+ const handler = SymbolIntentApiServiceProxy.createHandler(apiService);
10257
10882
  return new Proxy(this, handler);
10258
10883
  }
10259
10884
  };
@@ -10288,6 +10913,7 @@ var ReqHeader = class {
10288
10913
 
10289
10914
  // ../simple-boot-http-server/dist/esm/models/RequestResponse.js
10290
10915
  var import_node_gzip = __toESM(require_dist(), 1);
10916
+ import { Blob } from "node:buffer";
10291
10917
 
10292
10918
  // ../core-node/dist/esm/file/FileUtils.js
10293
10919
  import * as node_os from "node:os";
@@ -10299,6 +10925,7 @@ var FileUtils;
10299
10925
  constructor(_data) {
10300
10926
  this._data = _data;
10301
10927
  this.updateStats();
10928
+ this.etcData = _data.etcData;
10302
10929
  }
10303
10930
  get originalName() {
10304
10931
  return this._data.originalName;
@@ -10348,10 +10975,11 @@ var FileUtils;
10348
10975
  }
10349
10976
  FileUtils2.File = File;
10350
10977
  FileUtils2.writeFile = async (buffer, config) => {
10978
+ config ?? (config = {});
10351
10979
  config.path ?? (config.path = `${node_os.tmpdir()}/${RandomUtils.uuid4()}_${Date.now()}`);
10352
10980
  await node_fs.promises.mkdir(config.path.substring(0, config.path.lastIndexOf("/")), { recursive: true });
10353
10981
  await node_fs.promises.writeFile(config.path, buffer);
10354
- return new File({ path: config.path, originalName: config.originalName });
10982
+ return new File({ path: config.path, originalName: config.originalName, etcData: config.etcData });
10355
10983
  };
10356
10984
  FileUtils2.path = (path2) => {
10357
10985
  return Array.isArray(path2) ? node_path.join(...path2) : path2;
@@ -10397,6 +11025,26 @@ var FileUtils;
10397
11025
  const buffer = config?.option ? node_fs.readFileSync(p, config.option) : node_fs.readFileSync(p);
10398
11026
  return buffer;
10399
11027
  };
11028
+ FileUtils2.readAsync = async (path2, config) => {
11029
+ const p = FileUtils2.path(path2);
11030
+ return node_fs.promises.readFile(p, config?.option);
11031
+ };
11032
+ FileUtils2.readJsonSync = (path2) => {
11033
+ const json = FileUtils2.readStringSync(path2);
11034
+ return JSON.parse(json);
11035
+ };
11036
+ FileUtils2.readJsonAsync = async (path2) => {
11037
+ const json = await FileUtils2.readStringAsync(path2);
11038
+ return JSON.parse(json);
11039
+ };
11040
+ FileUtils2.readStringSync = (path2) => {
11041
+ const p = FileUtils2.path(path2);
11042
+ return node_fs.readFileSync(p, "utf-8");
11043
+ };
11044
+ FileUtils2.readStringAsync = async (path2) => {
11045
+ const p = FileUtils2.path(path2);
11046
+ return node_fs.promises.readFile(p, "utf-8");
11047
+ };
10400
11048
  FileUtils2.read = async (path2, config) => {
10401
11049
  const p = FileUtils2.path(path2);
10402
11050
  return node_fs.readFile(p, config.option);
@@ -10577,7 +11225,7 @@ var RequestResponse = class _RequestResponse {
10577
11225
  const formData = {};
10578
11226
  for (const it of m) {
10579
11227
  if (it.isFile) {
10580
- formData[it.name] = await FileUtils.writeFile(it.value, { originalName: it.filename });
11228
+ formData[it.name] = await FileUtils.writeFile(it.value, { originalName: it.filename, etcData: it });
10581
11229
  } else {
10582
11230
  const target = formData[it.name];
10583
11231
  if (Array.isArray(target)) {
@@ -10855,7 +11503,28 @@ var RequestResponse = class _RequestResponse {
10855
11503
  this.res.end(data);
10856
11504
  }
10857
11505
  async resEnd(chunk) {
10858
- this.resWriteChunk = chunk ?? this.resWriteChunk;
11506
+ if (chunk instanceof Response) {
11507
+ chunk.headers.forEach((value, key) => {
11508
+ this.res.setHeader(`ORIGIN-${key}`, value);
11509
+ });
11510
+ if (!this.resHeader(HttpHeaders.ContentType)) {
11511
+ const contentType = chunk.headers.get(HttpHeaders.ContentType);
11512
+ if (contentType) {
11513
+ this.res.setHeader(HttpHeaders.ContentType, contentType);
11514
+ }
11515
+ }
11516
+ this.res.statusCode = chunk.status;
11517
+ this.resWriteChunk = Buffer2.from(await chunk.arrayBuffer());
11518
+ } else if (chunk instanceof Blob) {
11519
+ this.resWriteChunk = Buffer2.from(await chunk.arrayBuffer());
11520
+ if (!this.resHeader(HttpHeaders.ContentType)) {
11521
+ this.res.setHeader(HttpHeaders.ContentType, chunk.type);
11522
+ }
11523
+ } else if (chunk instanceof ArrayBuffer) {
11524
+ this.resWriteChunk = Buffer2.from(chunk);
11525
+ } else {
11526
+ this.resWriteChunk = chunk ?? this.resWriteChunk;
11527
+ }
10859
11528
  if (this.req.readable) {
10860
11529
  await this.reqBodyData();
10861
11530
  await this.resEndChunk();
@@ -10872,6 +11541,11 @@ var RequestResponse = class _RequestResponse {
10872
11541
  // // this.res.write(chunk);
10873
11542
  // return this.createRequestResponseChain();
10874
11543
  // }
11544
+ resRedirect(statusCode, location) {
11545
+ this.res.statusCode = statusCode;
11546
+ this.res.setHeader(HttpHeaders.Location, location);
11547
+ this.res.end();
11548
+ }
10875
11549
  resWriteHead(statusCode, headers) {
10876
11550
  return this.createRequestResponseChain(this.res.writeHead(statusCode, headers));
10877
11551
  }
@@ -10926,6 +11600,7 @@ var HttpMethod = /* @__PURE__ */ ((HttpMethod2) => {
10926
11600
  // ../simple-boot-http-server/dist/esm/decorators/MethodMapping.js
10927
11601
  var UrlMappingSituationType = /* @__PURE__ */ ((UrlMappingSituationType2) => {
10928
11602
  UrlMappingSituationType2["REQ_JSON_BODY"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_JSON_BODY";
11603
+ UrlMappingSituationType2["REQ_URL_SEARCH_PARAMS_OBJ"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_URL_SEARCH_PARAMS_OBJ";
10929
11604
  UrlMappingSituationType2["REQ_FORM_URL_BODY"] = "SIMPLE_BOOT_HTTP_SERVER://URLMAPPING/REQ_FORM_URL_BODY";
10930
11605
  return UrlMappingSituationType2;
10931
11606
  })(UrlMappingSituationType || {});
@@ -10947,42 +11622,6 @@ var ReqMultipartFormBody = class {
10947
11622
  }
10948
11623
  };
10949
11624
 
10950
- // ../simple-boot/dist/esm/decorators/validate/Validation.js
10951
- var ValidMetadataKey = Symbol("ValidMetadataKey");
10952
- var getValidIndex = (target, propertyKey) => {
10953
- if (target !== null && void 0 !== target && typeof target === "object") {
10954
- target = target.constructor;
10955
- }
10956
- if (propertyKey) {
10957
- const parameters = Reflect.getOwnMetadata(ValidMetadataKey, target, propertyKey);
10958
- return parameters ?? [];
10959
- } else {
10960
- return ReflectUtils.getMetadata(ValidMetadataKey, target) ?? [];
10961
- }
10962
- };
10963
- var ValidationMetadataKey = Symbol("ValidationMetadataKey");
10964
- var getValidators = (target) => {
10965
- if (target !== null && void 0 !== target && typeof target === "object") {
10966
- target = target.constructor;
10967
- }
10968
- return ReflectUtils.getMetadata(ValidationMetadataKey, target) ?? [];
10969
- };
10970
- var execValidationInValid = (obj) => {
10971
- return execValidation(obj).filter((it) => !it.valid);
10972
- };
10973
- var execValidation = (obj) => {
10974
- const validators = getValidators(obj);
10975
- const reesults = [];
10976
- validators.forEach((it) => {
10977
- reesults.push({
10978
- name: it.propertyKey,
10979
- valid: it.validator(it.propertyKey, it),
10980
- message: ""
10981
- });
10982
- });
10983
- return reesults;
10984
- };
10985
-
10986
11625
  // ../simple-boot/dist/esm/errors/ValidException.js
10987
11626
  var ValidException = class {
10988
11627
  constructor(result) {
@@ -11081,6 +11720,10 @@ var InjectSituationType;
11081
11720
  InjectSituationType2.TransactionManager = Symbol("TransactionManager");
11082
11721
  })(InjectSituationType || (InjectSituationType = {}));
11083
11722
 
11723
+ // ../simple-boot-http-server/dist/esm/models/datas/search/ReqSearchParamsObj.js
11724
+ var ReqSearchParamsObj = class {
11725
+ };
11726
+
11084
11727
  // ../simple-boot-http-server/dist/esm/SimpleBootHttpServer.js
11085
11728
  var SimpleBootHttpServer = class extends SimpleApplication {
11086
11729
  constructor(option = new HttpServerOption()) {
@@ -11216,6 +11859,7 @@ var SimpleBootHttpServer = class extends SimpleApplication {
11216
11859
  const validIndexs = getValidIndex(moduleInstance, it.propertyKey);
11217
11860
  if (injects) {
11218
11861
  const isJson = injects.find((it2) => it2.config?.situationType === UrlMappingSituationType.REQ_JSON_BODY);
11862
+ const isSearchParamsObj = injects.find((it2) => it2.config?.situationType === UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ);
11219
11863
  const isFormUrl = injects.find((it2) => it2.config?.situationType === UrlMappingSituationType.REQ_FORM_URL_BODY);
11220
11864
  const isTransactionManager = injects.find((it2) => it2.config?.situationType === InjectSituationType.TransactionManager);
11221
11865
  const siturationContainers = new SituationTypeContainers();
@@ -11235,6 +11879,19 @@ var SimpleBootHttpServer = class extends SimpleApplication {
11235
11879
  data: data2
11236
11880
  }));
11237
11881
  }
11882
+ if (isSearchParamsObj) {
11883
+ let data2 = rr.reqUrlSearchParamsObj;
11884
+ if (validIndexs.includes(isSearchParamsObj.index)) {
11885
+ const inValid = execValidationInValid(data2);
11886
+ if ((inValid?.length ?? 0) > 0) {
11887
+ throw new ValidException(inValid);
11888
+ }
11889
+ }
11890
+ siturationContainers.push(new SituationTypeContainer({
11891
+ situationType: UrlMappingSituationType.REQ_URL_SEARCH_PARAMS_OBJ,
11892
+ data: data2
11893
+ }));
11894
+ }
11238
11895
  if (isFormUrl) {
11239
11896
  let data2 = await rr.reqBodyFormUrlData();
11240
11897
  if (isFormUrl.type) {
@@ -11264,6 +11921,8 @@ var SimpleBootHttpServer = class extends SimpleApplication {
11264
11921
  otherStorage.set(ReqFormUrlBody, await rr.reqBodyReqFormUrlBody());
11265
11922
  } else if (paramType === ReqJsonBody) {
11266
11923
  otherStorage.set(ReqJsonBody, await rr.reqBodyReqJsonBody());
11924
+ } else if (paramType === ReqSearchParamsObj) {
11925
+ otherStorage.set(ReqSearchParamsObj, rr.reqUrlSearchParamsObj);
11267
11926
  } else if (paramType === URLSearchParams3) {
11268
11927
  otherStorage.set(URLSearchParams3, rr.reqUrlSearchParams);
11269
11928
  } else if (paramType === ReqMultipartFormBody) {