@dooboostore/simple-boot-http-server 1.0.17 → 1.0.18

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 (328) hide show
  1. package/dist/cjs/SimpleBootHttpServer.js +930 -2
  2. package/dist/cjs/SimpleBootHttpServer.js.map +7 -0
  3. package/dist/cjs/codes/HttpHeaders.js +71 -1
  4. package/dist/cjs/codes/HttpHeaders.js.map +7 -0
  5. package/dist/cjs/codes/HttpMethod.js +41 -1
  6. package/dist/cjs/codes/HttpMethod.js.map +7 -0
  7. package/dist/cjs/codes/HttpStatus.js +49 -1
  8. package/dist/cjs/codes/HttpStatus.js.map +7 -0
  9. package/dist/cjs/codes/Mimes.js +57 -1
  10. package/dist/cjs/codes/Mimes.js.map +7 -0
  11. package/dist/cjs/codes/index.js +145 -1
  12. package/dist/cjs/codes/index.js.map +7 -0
  13. package/dist/cjs/decorators/MethodMapping.js +265 -2
  14. package/dist/cjs/decorators/MethodMapping.js.map +7 -0
  15. package/dist/cjs/decorators/index.js +267 -2
  16. package/dist/cjs/decorators/index.js.map +7 -0
  17. package/dist/cjs/endpoints/CrossDomainHeaderEndPoint.js +55 -1
  18. package/dist/cjs/endpoints/CrossDomainHeaderEndPoint.js.map +7 -0
  19. package/dist/cjs/endpoints/EndPoint.js +18 -1
  20. package/dist/cjs/endpoints/EndPoint.js.map +7 -0
  21. package/dist/cjs/endpoints/HeaderEndPoint.js +41 -1
  22. package/dist/cjs/endpoints/HeaderEndPoint.js.map +7 -0
  23. package/dist/cjs/endpoints/index.js +73 -1
  24. package/dist/cjs/endpoints/index.js.map +7 -0
  25. package/dist/cjs/errors/BadRequestError.js +45 -1
  26. package/dist/cjs/errors/BadRequestError.js.map +7 -0
  27. package/dist/cjs/errors/ForbiddenError.js +45 -1
  28. package/dist/cjs/errors/ForbiddenError.js.map +7 -0
  29. package/dist/cjs/errors/HttpError.js +36 -1
  30. package/dist/cjs/errors/HttpError.js.map +7 -0
  31. package/dist/cjs/errors/InternalServerError.js +45 -1
  32. package/dist/cjs/errors/InternalServerError.js.map +7 -0
  33. package/dist/cjs/errors/NotFoundError.js +45 -1
  34. package/dist/cjs/errors/NotFoundError.js.map +7 -0
  35. package/dist/cjs/errors/UnauthorizedError.js +45 -1
  36. package/dist/cjs/errors/UnauthorizedError.js.map +7 -0
  37. package/dist/cjs/errors/index.js +83 -1
  38. package/dist/cjs/errors/index.js.map +7 -0
  39. package/dist/cjs/filters/CacheFilter.js +153 -1
  40. package/dist/cjs/filters/CacheFilter.js.map +7 -0
  41. package/dist/cjs/filters/Filter.js +18 -1
  42. package/dist/cjs/filters/Filter.js.map +7 -0
  43. package/dist/cjs/filters/HttpStatusFilter.js +44 -1
  44. package/dist/cjs/filters/HttpStatusFilter.js.map +7 -0
  45. package/dist/cjs/filters/OpenApi3Filter.js +83 -2
  46. package/dist/cjs/filters/OpenApi3Filter.js.map +7 -0
  47. package/dist/cjs/filters/ResourceFilter.js +91 -2
  48. package/dist/cjs/filters/ResourceFilter.js.map +7 -0
  49. package/dist/cjs/filters/ThrowFilter.js +47 -1
  50. package/dist/cjs/filters/ThrowFilter.js.map +7 -0
  51. package/dist/cjs/filters/index.js +318 -2
  52. package/dist/cjs/filters/index.js.map +7 -0
  53. package/dist/cjs/index.js +1756 -2
  54. package/dist/cjs/index.js.map +7 -0
  55. package/dist/cjs/inject/InjectSituationType.js +33 -1
  56. package/dist/cjs/inject/InjectSituationType.js.map +7 -0
  57. package/dist/cjs/inject/index.js +35 -1
  58. package/dist/cjs/inject/index.js.map +7 -0
  59. package/dist/cjs/lifecycle/OnInit.js +18 -1
  60. package/dist/cjs/lifecycle/OnInit.js.map +7 -0
  61. package/dist/cjs/lifecycle/index.js +18 -1
  62. package/dist/cjs/lifecycle/index.js.map +7 -0
  63. package/dist/cjs/models/RequestResponse.js +500 -1
  64. package/dist/cjs/models/RequestResponse.js.map +7 -0
  65. package/dist/cjs/models/datas/HeaderData.js +35 -1
  66. package/dist/cjs/models/datas/HeaderData.js.map +7 -0
  67. package/dist/cjs/models/datas/MultipartData.js +18 -1
  68. package/dist/cjs/models/datas/MultipartData.js.map +7 -0
  69. package/dist/cjs/models/datas/ReqHeader.js +31 -1
  70. package/dist/cjs/models/datas/ReqHeader.js.map +7 -0
  71. package/dist/cjs/models/datas/Resource.js +550 -2
  72. package/dist/cjs/models/datas/Resource.js.map +7 -0
  73. package/dist/cjs/models/datas/body/ReqFormUrlBody.js +31 -1
  74. package/dist/cjs/models/datas/body/ReqFormUrlBody.js.map +7 -0
  75. package/dist/cjs/models/datas/body/ReqJsonBody.js +31 -1
  76. package/dist/cjs/models/datas/body/ReqJsonBody.js.map +7 -0
  77. package/dist/cjs/models/datas/body/ReqMultipartFormBody.js +34 -1
  78. package/dist/cjs/models/datas/body/ReqMultipartFormBody.js.map +7 -0
  79. package/dist/cjs/models/index.js +593 -2
  80. package/dist/cjs/models/index.js.map +7 -0
  81. package/dist/cjs/models/method/patch/PatchJson.js +49 -2
  82. package/dist/cjs/models/method/patch/PatchJson.js.map +7 -0
  83. package/dist/cjs/option/HttpServerOption.js +67 -1
  84. package/dist/cjs/option/HttpServerOption.js.map +7 -0
  85. package/dist/cjs/option/index.js +69 -1
  86. package/dist/cjs/option/index.js.map +7 -0
  87. package/dist/cjs/resolvers/Resolver.js +18 -1
  88. package/dist/cjs/resolvers/Resolver.js.map +7 -0
  89. package/dist/cjs/resolvers/{ResourceResorver.d.ts → ResourceResolver.d.ts} +2 -2
  90. package/dist/cjs/resolvers/{ResourceResorver.d.ts.map → ResourceResolver.d.ts.map} +1 -1
  91. package/dist/cjs/resolvers/ResourceResolver.js +571 -0
  92. package/dist/cjs/resolvers/ResourceResolver.js.map +7 -0
  93. package/dist/cjs/resolvers/index.d.ts +1 -1
  94. package/dist/cjs/resolvers/index.js +571 -2
  95. package/dist/cjs/resolvers/index.js.map +7 -0
  96. package/dist/cjs/session/SessionManager.js +577 -1
  97. package/dist/cjs/session/SessionManager.js.map +7 -0
  98. package/dist/cjs/session/index.js +579 -1
  99. package/dist/cjs/session/index.js.map +7 -0
  100. package/dist/esm/SimpleBootHttpServer.js +906 -2
  101. package/dist/esm/SimpleBootHttpServer.js.map +7 -0
  102. package/dist/esm/codes/HttpHeaders.js +47 -1
  103. package/dist/esm/codes/HttpHeaders.js.map +7 -0
  104. package/dist/esm/codes/HttpMethod.js +17 -1
  105. package/dist/esm/codes/HttpMethod.js.map +7 -0
  106. package/dist/esm/codes/HttpStatus.js +25 -1
  107. package/dist/esm/codes/HttpStatus.js.map +7 -0
  108. package/dist/esm/codes/Mimes.js +33 -1
  109. package/dist/esm/codes/Mimes.js.map +7 -0
  110. package/dist/esm/codes/index.js +116 -1
  111. package/dist/esm/codes/index.js.map +7 -0
  112. package/dist/esm/decorators/MethodMapping.js +211 -2
  113. package/dist/esm/decorators/MethodMapping.js.map +7 -0
  114. package/dist/esm/decorators/index.js +211 -2
  115. package/dist/esm/decorators/index.js.map +7 -0
  116. package/dist/esm/endpoints/CrossDomainHeaderEndPoint.js +31 -1
  117. package/dist/esm/endpoints/CrossDomainHeaderEndPoint.js.map +7 -0
  118. package/dist/esm/endpoints/EndPoint.js +1 -0
  119. package/dist/esm/endpoints/EndPoint.js.map +7 -0
  120. package/dist/esm/endpoints/HeaderEndPoint.js +17 -1
  121. package/dist/esm/endpoints/HeaderEndPoint.js.map +7 -0
  122. package/dist/esm/endpoints/index.js +46 -1
  123. package/dist/esm/endpoints/index.js.map +7 -0
  124. package/dist/esm/errors/BadRequestError.js +19 -1
  125. package/dist/esm/errors/BadRequestError.js.map +7 -0
  126. package/dist/esm/errors/ForbiddenError.js +19 -1
  127. package/dist/esm/errors/ForbiddenError.js.map +7 -0
  128. package/dist/esm/errors/HttpError.js +12 -1
  129. package/dist/esm/errors/HttpError.js.map +7 -0
  130. package/dist/esm/errors/InternalServerError.js +19 -1
  131. package/dist/esm/errors/InternalServerError.js.map +7 -0
  132. package/dist/esm/errors/NotFoundError.js +19 -1
  133. package/dist/esm/errors/NotFoundError.js.map +7 -0
  134. package/dist/esm/errors/UnauthorizedError.js +19 -1
  135. package/dist/esm/errors/UnauthorizedError.js.map +7 -0
  136. package/dist/esm/errors/index.js +52 -1
  137. package/dist/esm/errors/index.js.map +7 -0
  138. package/dist/esm/filters/CacheFilter.js +129 -1
  139. package/dist/esm/filters/CacheFilter.js.map +7 -0
  140. package/dist/esm/filters/Filter.js +1 -0
  141. package/dist/esm/filters/Filter.js.map +7 -0
  142. package/dist/esm/filters/HttpStatusFilter.js +20 -1
  143. package/dist/esm/filters/HttpStatusFilter.js.map +7 -0
  144. package/dist/esm/filters/OpenApi3Filter.js +57 -2
  145. package/dist/esm/filters/OpenApi3Filter.js.map +7 -0
  146. package/dist/esm/filters/ResourceFilter.js +57 -2
  147. package/dist/esm/filters/ResourceFilter.js.map +7 -0
  148. package/dist/esm/filters/ThrowFilter.js +23 -1
  149. package/dist/esm/filters/ThrowFilter.js.map +7 -0
  150. package/dist/esm/filters/index.js +278 -2
  151. package/dist/esm/filters/index.js.map +7 -0
  152. package/dist/esm/index.js +1662 -2
  153. package/dist/esm/index.js.map +7 -0
  154. package/dist/esm/inject/InjectSituationType.js +9 -1
  155. package/dist/esm/inject/InjectSituationType.js.map +7 -0
  156. package/dist/esm/inject/index.js +9 -1
  157. package/dist/esm/inject/index.js.map +7 -0
  158. package/dist/esm/lifecycle/OnInit.js +1 -0
  159. package/dist/esm/lifecycle/OnInit.js.map +7 -0
  160. package/dist/esm/lifecycle/index.js +1 -0
  161. package/dist/esm/lifecycle/index.js.map +7 -0
  162. package/dist/esm/models/RequestResponse.js +475 -1
  163. package/dist/esm/models/RequestResponse.js.map +7 -0
  164. package/dist/esm/models/datas/HeaderData.js +11 -1
  165. package/dist/esm/models/datas/HeaderData.js.map +7 -0
  166. package/dist/esm/models/datas/MultipartData.js +1 -0
  167. package/dist/esm/models/datas/MultipartData.js.map +7 -0
  168. package/dist/esm/models/datas/ReqHeader.js +7 -1
  169. package/dist/esm/models/datas/ReqHeader.js.map +7 -0
  170. package/dist/esm/models/datas/Resource.js +516 -2
  171. package/dist/esm/models/datas/Resource.js.map +7 -0
  172. package/dist/esm/models/datas/body/ReqFormUrlBody.js +7 -1
  173. package/dist/esm/models/datas/body/ReqFormUrlBody.js.map +7 -0
  174. package/dist/esm/models/datas/body/ReqJsonBody.js +7 -1
  175. package/dist/esm/models/datas/body/ReqJsonBody.js.map +7 -0
  176. package/dist/esm/models/datas/body/ReqMultipartFormBody.js +10 -1
  177. package/dist/esm/models/datas/body/ReqMultipartFormBody.js.map +7 -0
  178. package/dist/esm/models/index.js +549 -2
  179. package/dist/esm/models/index.js.map +7 -0
  180. package/dist/esm/models/method/patch/PatchJson.js +15 -2
  181. package/dist/esm/models/method/patch/PatchJson.js.map +7 -0
  182. package/dist/esm/option/HttpServerOption.d.ts +1 -1
  183. package/dist/esm/option/HttpServerOption.js +43 -1
  184. package/dist/esm/option/HttpServerOption.js.map +7 -0
  185. package/dist/esm/option/index.js +43 -1
  186. package/dist/esm/option/index.js.map +7 -0
  187. package/dist/esm/resolvers/Resolver.js +1 -0
  188. package/dist/esm/resolvers/Resolver.js.map +7 -0
  189. package/dist/esm/resolvers/{ResourceResorver.d.ts → ResourceResolver.d.ts} +2 -2
  190. package/dist/esm/resolvers/{ResourceResorver.d.ts.map → ResourceResolver.d.ts.map} +1 -1
  191. package/dist/esm/resolvers/ResourceResolver.js +538 -0
  192. package/dist/esm/resolvers/ResourceResolver.js.map +7 -0
  193. package/dist/esm/resolvers/index.d.ts +1 -1
  194. package/dist/esm/resolvers/index.js +538 -2
  195. package/dist/esm/resolvers/index.js.map +7 -0
  196. package/dist/esm/session/SessionManager.js +553 -1
  197. package/dist/esm/session/SessionManager.js.map +7 -0
  198. package/dist/esm/session/index.js +553 -1
  199. package/dist/esm/session/index.js.map +7 -0
  200. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +1662 -2
  201. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +7 -0
  202. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +1699 -2
  203. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +7 -0
  204. package/package.json +24 -21
  205. package/dist/cjs/SimpleBootHttpServer.js.LICENSE.txt +0 -20
  206. package/dist/cjs/decorators/MethodMapping.js.LICENSE.txt +0 -16
  207. package/dist/cjs/decorators/index.js.LICENSE.txt +0 -16
  208. package/dist/cjs/filters/OpenApi3Filter.js.LICENSE.txt +0 -16
  209. package/dist/cjs/filters/ResourceFilter.js.LICENSE.txt +0 -13
  210. package/dist/cjs/filters/index.js.LICENSE.txt +0 -30
  211. package/dist/cjs/index.js.LICENSE.txt +0 -46
  212. package/dist/cjs/models/datas/Resource.js.LICENSE.txt +0 -13
  213. package/dist/cjs/models/index.js.LICENSE.txt +0 -25
  214. package/dist/cjs/models/method/patch/PatchJson.js.LICENSE.txt +0 -11
  215. package/dist/cjs/resolvers/ResourceResorver.js +0 -2
  216. package/dist/cjs/resolvers/ResourceResorver.js.LICENSE.txt +0 -13
  217. package/dist/cjs/resolvers/index.js.LICENSE.txt +0 -13
  218. package/dist/esm/SimpleBootHttpServer.js.LICENSE.txt +0 -20
  219. package/dist/esm/decorators/MethodMapping.js.LICENSE.txt +0 -16
  220. package/dist/esm/decorators/index.js.LICENSE.txt +0 -16
  221. package/dist/esm/filters/OpenApi3Filter.js.LICENSE.txt +0 -16
  222. package/dist/esm/filters/ResourceFilter.js.LICENSE.txt +0 -13
  223. package/dist/esm/filters/index.js.LICENSE.txt +0 -30
  224. package/dist/esm/index.js.LICENSE.txt +0 -46
  225. package/dist/esm/models/datas/Resource.js.LICENSE.txt +0 -13
  226. package/dist/esm/models/index.js.LICENSE.txt +0 -25
  227. package/dist/esm/models/method/patch/PatchJson.js.LICENSE.txt +0 -11
  228. package/dist/esm/resolvers/ResourceResorver.js +0 -2
  229. package/dist/esm/resolvers/ResourceResorver.js.LICENSE.txt +0 -13
  230. package/dist/esm/resolvers/index.js.LICENSE.txt +0 -13
  231. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.LICENSE.txt +0 -54
  232. package/dist/umd-bundle/SimpleBootHttpServer.d.ts +0 -14
  233. package/dist/umd-bundle/SimpleBootHttpServer.d.ts.map +0 -1
  234. package/dist/umd-bundle/codes/HttpHeaders.d.ts +0 -42
  235. package/dist/umd-bundle/codes/HttpHeaders.d.ts.map +0 -1
  236. package/dist/umd-bundle/codes/HttpMethod.d.ts +0 -12
  237. package/dist/umd-bundle/codes/HttpMethod.d.ts.map +0 -1
  238. package/dist/umd-bundle/codes/HttpStatus.d.ts +0 -45
  239. package/dist/umd-bundle/codes/HttpStatus.d.ts.map +0 -1
  240. package/dist/umd-bundle/codes/Mimes.d.ts +0 -28
  241. package/dist/umd-bundle/codes/Mimes.d.ts.map +0 -1
  242. package/dist/umd-bundle/codes/index.d.ts +0 -5
  243. package/dist/umd-bundle/codes/index.d.ts.map +0 -1
  244. package/dist/umd-bundle/decorators/MethodMapping.d.ts +0 -74
  245. package/dist/umd-bundle/decorators/MethodMapping.d.ts.map +0 -1
  246. package/dist/umd-bundle/decorators/index.d.ts +0 -2
  247. package/dist/umd-bundle/decorators/index.d.ts.map +0 -1
  248. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.LICENSE.txt +0 -54
  249. package/dist/umd-bundle/endpoints/CrossDomainHeaderEndPoint.d.ts +0 -16
  250. package/dist/umd-bundle/endpoints/CrossDomainHeaderEndPoint.d.ts.map +0 -1
  251. package/dist/umd-bundle/endpoints/EndPoint.d.ts +0 -7
  252. package/dist/umd-bundle/endpoints/EndPoint.d.ts.map +0 -1
  253. package/dist/umd-bundle/endpoints/HeaderEndPoint.d.ts +0 -12
  254. package/dist/umd-bundle/endpoints/HeaderEndPoint.d.ts.map +0 -1
  255. package/dist/umd-bundle/endpoints/index.d.ts +0 -4
  256. package/dist/umd-bundle/endpoints/index.d.ts.map +0 -1
  257. package/dist/umd-bundle/errors/BadRequestError.d.ts +0 -8
  258. package/dist/umd-bundle/errors/BadRequestError.d.ts.map +0 -1
  259. package/dist/umd-bundle/errors/ForbiddenError.d.ts +0 -8
  260. package/dist/umd-bundle/errors/ForbiddenError.d.ts.map +0 -1
  261. package/dist/umd-bundle/errors/HttpError.d.ts +0 -12
  262. package/dist/umd-bundle/errors/HttpError.d.ts.map +0 -1
  263. package/dist/umd-bundle/errors/InternalServerError.d.ts +0 -8
  264. package/dist/umd-bundle/errors/InternalServerError.d.ts.map +0 -1
  265. package/dist/umd-bundle/errors/NotFoundError.d.ts +0 -8
  266. package/dist/umd-bundle/errors/NotFoundError.d.ts.map +0 -1
  267. package/dist/umd-bundle/errors/UnauthorizedError.d.ts +0 -8
  268. package/dist/umd-bundle/errors/UnauthorizedError.d.ts.map +0 -1
  269. package/dist/umd-bundle/errors/index.d.ts +0 -7
  270. package/dist/umd-bundle/errors/index.d.ts.map +0 -1
  271. package/dist/umd-bundle/filters/CacheFilter.d.ts +0 -45
  272. package/dist/umd-bundle/filters/CacheFilter.d.ts.map +0 -1
  273. package/dist/umd-bundle/filters/Filter.d.ts +0 -17
  274. package/dist/umd-bundle/filters/Filter.d.ts.map +0 -1
  275. package/dist/umd-bundle/filters/HttpStatusFilter.d.ts +0 -20
  276. package/dist/umd-bundle/filters/HttpStatusFilter.d.ts.map +0 -1
  277. package/dist/umd-bundle/filters/OpenApi3Filter.d.ts +0 -142
  278. package/dist/umd-bundle/filters/OpenApi3Filter.d.ts.map +0 -1
  279. package/dist/umd-bundle/filters/ResourceFilter.d.ts +0 -24
  280. package/dist/umd-bundle/filters/ResourceFilter.d.ts.map +0 -1
  281. package/dist/umd-bundle/filters/ThrowFilter.d.ts +0 -19
  282. package/dist/umd-bundle/filters/ThrowFilter.d.ts.map +0 -1
  283. package/dist/umd-bundle/filters/index.d.ts +0 -7
  284. package/dist/umd-bundle/filters/index.d.ts.map +0 -1
  285. package/dist/umd-bundle/index.d.ts +0 -13
  286. package/dist/umd-bundle/index.d.ts.map +0 -1
  287. package/dist/umd-bundle/inject/InjectSituationType.d.ts +0 -4
  288. package/dist/umd-bundle/inject/InjectSituationType.d.ts.map +0 -1
  289. package/dist/umd-bundle/inject/index.d.ts +0 -2
  290. package/dist/umd-bundle/inject/index.d.ts.map +0 -1
  291. package/dist/umd-bundle/lifecycle/OnInit.d.ts +0 -5
  292. package/dist/umd-bundle/lifecycle/OnInit.d.ts.map +0 -1
  293. package/dist/umd-bundle/lifecycle/index.d.ts +0 -2
  294. package/dist/umd-bundle/lifecycle/index.d.ts.map +0 -1
  295. package/dist/umd-bundle/models/RequestResponse.d.ts +0 -100
  296. package/dist/umd-bundle/models/RequestResponse.d.ts.map +0 -1
  297. package/dist/umd-bundle/models/datas/HeaderData.d.ts +0 -10
  298. package/dist/umd-bundle/models/datas/HeaderData.d.ts.map +0 -1
  299. package/dist/umd-bundle/models/datas/MultipartData.d.ts +0 -12
  300. package/dist/umd-bundle/models/datas/MultipartData.d.ts.map +0 -1
  301. package/dist/umd-bundle/models/datas/ReqHeader.d.ts +0 -68
  302. package/dist/umd-bundle/models/datas/ReqHeader.d.ts.map +0 -1
  303. package/dist/umd-bundle/models/datas/Resource.d.ts +0 -11
  304. package/dist/umd-bundle/models/datas/Resource.d.ts.map +0 -1
  305. package/dist/umd-bundle/models/datas/body/ReqFormUrlBody.d.ts +0 -4
  306. package/dist/umd-bundle/models/datas/body/ReqFormUrlBody.d.ts.map +0 -1
  307. package/dist/umd-bundle/models/datas/body/ReqJsonBody.d.ts +0 -4
  308. package/dist/umd-bundle/models/datas/body/ReqJsonBody.d.ts.map +0 -1
  309. package/dist/umd-bundle/models/datas/body/ReqMultipartFormBody.d.ts +0 -6
  310. package/dist/umd-bundle/models/datas/body/ReqMultipartFormBody.d.ts.map +0 -1
  311. package/dist/umd-bundle/models/index.d.ts +0 -10
  312. package/dist/umd-bundle/models/index.d.ts.map +0 -1
  313. package/dist/umd-bundle/models/method/patch/PatchJson.d.ts +0 -8
  314. package/dist/umd-bundle/models/method/patch/PatchJson.d.ts.map +0 -1
  315. package/dist/umd-bundle/option/HttpServerOption.d.ts +0 -83
  316. package/dist/umd-bundle/option/HttpServerOption.d.ts.map +0 -1
  317. package/dist/umd-bundle/option/index.d.ts +0 -2
  318. package/dist/umd-bundle/option/index.d.ts.map +0 -1
  319. package/dist/umd-bundle/resolvers/Resolver.d.ts +0 -5
  320. package/dist/umd-bundle/resolvers/Resolver.d.ts.map +0 -1
  321. package/dist/umd-bundle/resolvers/ResourceResorver.d.ts +0 -6
  322. package/dist/umd-bundle/resolvers/ResourceResorver.d.ts.map +0 -1
  323. package/dist/umd-bundle/resolvers/index.d.ts +0 -3
  324. package/dist/umd-bundle/resolvers/index.d.ts.map +0 -1
  325. package/dist/umd-bundle/session/SessionManager.d.ts +0 -57
  326. package/dist/umd-bundle/session/SessionManager.d.ts.map +0 -1
  327. package/dist/umd-bundle/session/index.d.ts +0 -2
  328. package/dist/umd-bundle/session/index.d.ts.map +0 -1
@@ -1 +1,475 @@
1
- import{createRequire as t}from"node:module";var e={426:(t,e,r)=>{r.d(e,{T:()=>o});var i,n={d:(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},s={};n.d(s,{T:()=>i}),function(t){t.toString=function(t,e){return null==t?"":"string"==typeof t?t:t.toString(e?.encoding??"utf-8",e?.start,e?.end)},t.toBuffer=(t,e)=>"base64"===e?.encoding?(t=t.split(";base64,").pop()||"",Buffer.from(t,"base64")):Buffer.from(t)}(i||(i={}));const o=s.T},1022:(t,e,r)=>{r.d(e,{D:()=>i});class i{}},3055:(e,r,i)=>{i.d(r,{i:()=>g});const n=t(import.meta.url)("node:module"),s=(0,n.createRequire)("file:///Users/hyunhakim/workspace/dooboostore/source/dooboostore-develop/dooboostore-develop.github.io/source/packages/@dooboostore/core-node/dist/esm/file/FileUtils.js")("node:os"),o=(0,n.createRequire)("file:///Users/hyunhakim/workspace/dooboostore/source/dooboostore-develop/dooboostore-develop.github.io/source/packages/@dooboostore/core-node/dist/esm/file/FileUtils.js")("node:fs"),a=(0,n.createRequire)("file:///Users/hyunhakim/workspace/dooboostore/source/dooboostore-develop/dooboostore-develop.github.io/source/packages/@dooboostore/core-node/dist/esm/file/FileUtils.js")("node:path");var h={9284:(t,e,r)=>{var i;r.d(e,{U:()=>i}),function(t){t.isArrowFunction=t=>"function"==typeof t&&void 0===t.prototype&&!t.toString().startsWith("class"),t.isPlainObject=t=>null!==t&&"object"==typeof t&&t.constructor===Object,t.isFrozen=t=>Object.isFrozen(t),t.isSealed=t=>Object.isSealed(t),t.isFrozenOrSealed=e=>t.isFrozen(e)||t.isSealed(e),t.isFrozenAndSealed=e=>t.isFrozen(e)&&t.isSealed(e),t.isNotFrozen=t=>!Object.isFrozen(t),t.isNotSealed=t=>!Object.isSealed(t),t.isNotFrozenOrSealed=e=>!t.isFrozen(e)&&!t.isSealed(e),t.isNotFrozenAndSealed=e=>!t.isFrozen(e)||!t.isSealed(e),t.isNullOrUndefined=t=>null==t||void 0===t,t.isConstructor=t=>"function"==typeof t&&void 0!==t.prototype&&t.prototype.constructor===t,t.isFunction=e=>"function"==typeof e&&!t.isConstructor(e),t.isNullish=e=>t.isNotNullish(e),t.isNotNullish=e=>Array.isArray(e)||t.isString(e)?e.length>0:e instanceof Set||e instanceof Map?e.size>0:"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e,t.isNotNullUndefined=t=>null!=t,t.isNull=t=>null===t,t.isUndefined=t=>void 0===t,t.isArray=e=>!t.isNullOrUndefined(e)&&"[object Array]"===Object.prototype.toString.call(e).trim(),t.isStringNumber=t=>"number"==typeof t?!isNaN(t):"string"==typeof t&&""!==t.trim()&&!isNaN(Number(t)),t.isNumber=e=>!t.isNullOrUndefined(e)&&"[object Number]"===Object.prototype.toString.call(e).trim(),t.isIterator=t=>null!=t&&"function"==typeof t[Symbol.iterator],t.isString=e=>!t.isNullOrUndefined(e)&&"[object String]"===Object.prototype.toString.call(e).trim(),t.isObject=e=>!t.isNullOrUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e).trim(),t.isMap=e=>!t.isNullOrUndefined(e)&&"[object Map]"===Object.prototype.toString.call(e).trim(),t.isEmpty=e=>!!t.isNullOrUndefined(e)||(t.isArray(e)?0===e.length:t.isString(e)?0===e.trim().length:t.isMap(e)?0===e.size:!!t.isObject(e)&&0===Object.keys(e).length),t.isSet=t=>t instanceof Set,t.isNullishFiltered=t=>Array.isArray(t)?t.every(t=>null!=t):null!=t,t.isFalsyFiltered=t=>Array.isArray(t)?t.every(t=>t):!!t,t.includeValue=(t,e)=>Object.values(t).includes(e),t.includeKey=(t,e)=>Object.keys(t).includes(e),t.lastConsonantLetter=t=>(t.charCodeAt(t.length-1)-44032)%28>0,t.inRange=(t,e,r)=>e<=t&&t<=r,t.isBase64=t=>{let e=t;const r=t.split(";base64,");if(r.length>1)e=r[1];else if(t.startsWith("data:")){const r=t.indexOf(",");r>-1&&(e=t.substring(r+1))}return""===e||e.length,/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(i||(i={}))}},l={};function c(t){var e=l[t];if(void 0!==e)return e.exports;var r=l[t]={exports:{}};return h[t](r,r.exports,c),r.exports}c.d=(t,e)=>{for(var r in e)c.o(e,r)&&!c.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},c.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var u={};c.d(u,{n:()=>d});var d,y=c(9284);!function(t){t.uniqueInts=(e,r,i)=>{const n=[];if(i>r-e)throw new Error("Count is greater than the range of unique integers");for(;n.length<i;){const i=t.int(e,r);n.includes(i)||n.push(i)}return n},t.chance=t=>{if(t<0||t>1)throw new Error("Percentage must be between 0 and 1");return Math.random()<t},t.int=(e,r)=>Math.floor(t.float(e,r)),t.float=(t,e)=>y.U.isNullOrUndefined(t)?Math.random():!y.U.isNullOrUndefined(t)&&y.U.isNullOrUndefined(e)?Math.random()*(t||0):Math.random()*((e||0)-(t||0))+(t||0),t.uuid=(t="xxxx-xxxx-xxxx-xxxx")=>t.replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}),t.uuid4=()=>{let t,e="";for(t=0;t<32;t+=1)switch(t){case 8:case 20:e+="-",e+=(16*Math.random()|0).toString(16);break;case 12:e+="-",e+="4";break;case 16:e+="-",e+=(4*Math.random()|8).toString(16);break;default:e+=(16*Math.random()|0).toString(16)}return e},t.hex=()=>{const t="0123456789ABCDEF".split("");let e="";for(let r=0;r<6;r++)e+=t[Math.floor(16*Math.random())];return e},t.rgb=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let r=0;r<6;r++)e+=t[Math.floor(16*Math.random())];return e},t.rgba=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let r=0;r<8;r++)e+=t[Math.floor(16*Math.random())];return e},t.alphabet=t=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}}(d||(d={}));const p=u.n;var g;!function(t){class e{constructor(t){this._data=t,this.updateStats()}get originalName(){return this._data.originalName}get directory(){return this._data.path.substring(0,this._data.path.lastIndexOf("/"))}get fileName(){return this._data.path.substring(this._data.path.lastIndexOf("/")+1)}get path(){return this._data.path}get extension(){const t=this._data.path.substring(this._data.path.lastIndexOf(".")+1);return t.length>0?t:void 0}async updateStats(){const t=await o.promises.stat(this._data.path);this.size=t.size}async delete(){await o.promises.unlink(this._data.path),this._data.path="",this.size=void 0}async copy(t){await o.promises.copyFile(this._data.path,t),this._data.path=t,this.size=(await o.promises.stat(t)).size}async move(t){const e=t.substring(0,t.lastIndexOf("/"));await o.promises.mkdir(e,{recursive:!0}),await o.promises.rename(this._data.path,t),this._data.path=t,this.size=(await o.promises.stat(t)).size}async rename(t){const e=`${this.directory}/${t}`;await o.promises.rename(this._data.path,e),this.size=(await o.promises.stat(e)).size,this._data.path=e}}t.File=e,t.writeFile=async(t,r)=>(r.path??(r.path=`${s.tmpdir()}/${p.uuid4()}_${Date.now()}`),await o.promises.mkdir(r.path.substring(0,r.path.lastIndexOf("/")),{recursive:!0}),await o.promises.writeFile(r.path,t),new e({path:r.path,originalName:r.originalName})),t.path=t=>Array.isArray(t)?a.join(...t):t,t.existsSync=(e,r)=>{const i=t.path(e);return o.existsSync(i)?(r?.existes?.(i),!0):(r?.noExistes?.(i),!1)},t.mkdirSync=(e,r)=>{t.existsSync(e,{noExistes:t=>{o.mkdirSync(t,r)}})},t.mkdir=async(e,r)=>new Promise((i,n)=>{t.existsSync(e,{noExistes:t=>{o.mkdirSync(t,r),i(t)},existes:t=>{i(t)}})}),t.readSync=(e,r)=>{const i=t.path(e);return r?.option?o.readFileSync(i,r.option):o.readFileSync(i)},t.read=async(e,r)=>{const i=t.path(e);return o.readFile(i,r.option)},t.write=(e,r)=>{const i=t.path(r.path);return r.options?o.writeFileSync(i,e,r.options):o.writeFileSync(i,e),i},t.writeAppend=(e,r)=>{const i=t.path(r.path);return r.options?o.appendFileSync(i,e,r.options):o.appendFileSync(i,e),i},t.deleteSync=(e,r)=>{const i=t.path(e);t.existsSync(i)&&(r?.options?o.rmSync(i,r?.options):o.rmSync(i))},t.deleteDirSync=(e,r)=>{const i=t.path(e);t.existsSync(i)&&(r?.options?o.rmdirSync(i,r?.options):o.rmdirSync(i))},t.deleteFileSync=e=>{const r=t.path(e);t.existsSync(r)&&o.unlinkSync(r)},t.copySync=(e,r,i)=>{const n=t.path(e),s=t.path(r);o.cpSync(n,s,i)}}(g||(g={}))},3106:e=>{e.exports=t(import.meta.url)("zlib")},5884:(t,e,r)=>{var i=r(3106);t.exports={gzip:function(t,e){return new Promise(function(r,n){i.gzip(t,e,function(t,e){t?n(Error(t)):r(e)})})},ungzip:function(t,e){return new Promise(function(r,n){i.gunzip(t,e,function(t,e){t?n(Error(t)):r(e)})})}}},6377:(t,e,r)=>{r.d(e,{s:()=>i});class i{}},7016:e=>{e.exports=t(import.meta.url)("url")},7953:(t,e,r)=>{var i;r.d(e,{L:()=>i}),function(t){t.ContentLength="Content-Length",t.ContentType="Content-Type",t.ContentEncoding="Content-Encoding",t.Accept="Accept",t.Authorization="Authorization",t.CacheControl="Cache-Control",t.Connection="Connection",t.Date="Date",t.Host="Host",t.Pragma="Pragma",t.Trailer="Trailer",t.TransferEncoding="Transfer-Encoding",t.Upgrade="Upgrade",t.Via="Via",t.Warning="Warning",t.AcceptCharset="Accept-Charset",t.AcceptEncoding="Accept-Encoding",t.AcceptLanguage="Accept-Language",t.AccessControlAllowOrigin="Access-Control-Allow-Origin",t.AccessControlAllowMethods="Access-Control-Allow-Methods",t.AccessControlAllowHeaders="Access-Control-Allow-Headers",t.AccessControlExposeHeaders="Access-Control-Expose-Headers",t.Expect="Expect",t.From="From",t.MaxForwards="Max-Forwards",t.Referer="Referer",t.UserAgent="User-Agent",t.Cookie="Cookie",t.SetCookie="Set-Cookie",t.Cookie2="Cookie2",t.SetCookie2="Set-Cookie2",t.Location="Location",t.IfModifiedSince="If-Modified-Since",t.IfUnmodifiedSince="If-Unmodified-Since",t.IfMatch="If-Match",t.IfNoneMatch="If-None-Match",t.IfRange="If-Range",t.Allow="Allow",t.Server="Server"}(i||(i={}))},9434:(t,e,r)=>{r.d(e,{E:()=>i});class i{}}},r={};function i(t){var n=r[t];if(void 0!==n)return n.exports;var s=r[t]={exports:{}};return e[t](s,s.exports,i),s.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n=i(7953),s={532:(t,e,r)=>{r.d(e,{r:()=>l});var i={3056:(t,e,r)=>{r.d(e,{$:()=>i});var i,n=r(9284);!function(t){t.deleteEnter=t=>t.replace(/\r?\n/g,""),t.pickEmoji=t=>t.match(/[\p{Emoji}]/gu)??[],t.regexExec=(t,e)=>{let r=t.exec(e);const i=[];for(;r;)i.push(r),r=t.exec(r.input);return i},t.regexExecArrayReplace=(e,r,i)=>((Array.isArray(r)?r:t.regexExec(r,e)).reverse().forEach(t=>{const r="string"==typeof i?i:i(t);e=e.substr(0,t.index)+e.substr(t.index).replace(t[0],r)}),e),t.escapeSpecialCharacterRegExp=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.trim=t=>t.trim(),t.rsubString=(t,e)=>t.substring(t.length-e,t.length),t.lsubString=(t,e)=>t.substring(0,e),t.lpad=(e,r,i)=>{for(;r>i.length;)i=e+i;return t.rsubString(i,r)},t.rpad=(e,r,i)=>{for(;r>i.length;)i+=e;return t.lsubString(i,r)},t.lappend=(t,e)=>{let r="",i=0;for(;i++<t;)r+=e;return r},t.unescape=t=>{if(!t)return"";const e={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿","#x27":"'"};return t.replace(/&((?:(?:[a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?)+);/gi,(t,r)=>r.toLowerCase().split(";").map(r=>r in e?e[r]:t).join(""))},t.executeExpression=(t,e)=>t.replace(/\${([^{}]*)}/g,(t,r)=>String(e[r]??t)),t.ellipsis=(t,e)=>t.length>e?`${t.slice(0,e)}...`:t,t.appendPostposition=(t,{vowel:e,consonant:r})=>`${t}${n.U.lastConsonantLetter(t)?r:e}`}(i||(i={}))},9284:(t,e,r)=>{var i;r.d(e,{U:()=>i}),function(t){t.isArrowFunction=t=>"function"==typeof t&&void 0===t.prototype&&!t.toString().startsWith("class"),t.isPlainObject=t=>null!==t&&"object"==typeof t&&t.constructor===Object,t.isFrozen=t=>Object.isFrozen(t),t.isSealed=t=>Object.isSealed(t),t.isFrozenOrSealed=e=>t.isFrozen(e)||t.isSealed(e),t.isFrozenAndSealed=e=>t.isFrozen(e)&&t.isSealed(e),t.isNotFrozen=t=>!Object.isFrozen(t),t.isNotSealed=t=>!Object.isSealed(t),t.isNotFrozenOrSealed=e=>!t.isFrozen(e)&&!t.isSealed(e),t.isNotFrozenAndSealed=e=>!t.isFrozen(e)||!t.isSealed(e),t.isNullOrUndefined=t=>null==t||void 0===t,t.isConstructor=t=>"function"==typeof t&&void 0!==t.prototype&&t.prototype.constructor===t,t.isFunction=e=>"function"==typeof e&&!t.isConstructor(e),t.isNullish=e=>t.isNotNullish(e),t.isNotNullish=e=>Array.isArray(e)||t.isString(e)?e.length>0:e instanceof Set||e instanceof Map?e.size>0:"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e,t.isNotNullUndefined=t=>null!=t,t.isNull=t=>null===t,t.isUndefined=t=>void 0===t,t.isArray=e=>!t.isNullOrUndefined(e)&&"[object Array]"===Object.prototype.toString.call(e).trim(),t.isStringNumber=t=>"number"==typeof t?!isNaN(t):"string"==typeof t&&""!==t.trim()&&!isNaN(Number(t)),t.isNumber=e=>!t.isNullOrUndefined(e)&&"[object Number]"===Object.prototype.toString.call(e).trim(),t.isIterator=t=>null!=t&&"function"==typeof t[Symbol.iterator],t.isString=e=>!t.isNullOrUndefined(e)&&"[object String]"===Object.prototype.toString.call(e).trim(),t.isObject=e=>!t.isNullOrUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e).trim(),t.isMap=e=>!t.isNullOrUndefined(e)&&"[object Map]"===Object.prototype.toString.call(e).trim(),t.isEmpty=e=>!!t.isNullOrUndefined(e)||(t.isArray(e)?0===e.length:t.isString(e)?0===e.trim().length:t.isMap(e)?0===e.size:!!t.isObject(e)&&0===Object.keys(e).length),t.isSet=t=>t instanceof Set,t.isNullishFiltered=t=>Array.isArray(t)?t.every(t=>null!=t):null!=t,t.isFalsyFiltered=t=>Array.isArray(t)?t.every(t=>t):!!t,t.includeValue=(t,e)=>Object.values(t).includes(e),t.includeKey=(t,e)=>Object.keys(t).includes(e),t.lastConsonantLetter=t=>(t.charCodeAt(t.length-1)-44032)%28>0,t.inRange=(t,e,r)=>e<=t&&t<=r,t.isBase64=t=>{let e=t;const r=t.split(";base64,");if(r.length>1)e=r[1];else if(t.startsWith("data:")){const r=t.indexOf(",");r>-1&&(e=t.substring(r+1))}return""===e||e.length,/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(i||(i={}))}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}};return i[t](r,r.exports,s),r.exports}s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};s.d(o,{r:()=>a});var a,h=s(3056);!function(t){let e,r;t.bindExpression=(t,e)=>(t??"").replace(/\$\{([\s\S.]*?)\}/g,(t,r)=>{const[i,n]=r.split(":"),s=e[i];return s?"function"==typeof s?s(e[n]):s:""}),function(t){t.isExpression=t=>/[$#]\{([\s\S.]*?)\}[$#]/g.test(t??""),t.expressionGroups=t=>h.$.regexExec(/[$#]\{([\s\S.]*?)\}[$#]/g,t??"")}(e=t.Group||(t.Group={})),function(t){t.pathNameData=(t,e)=>{const r=t.split("/"),i=e.split("/");if(r.length!==i.length)return;const n={};for(let t=0;t<i.length;t++){const e=i[t],s=r[t],o=/^\{(.+)\}$/g.exec(e);if(!o){if(e!==s)return;continue}const[a,h]=o[1].split(":");if(h&&!new RegExp(h).test(s))return;n[a]=s}return n}}(r=t.Path||(t.Path={}))}(a||(a={}));const l=o.r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return s[t](r,r.exports,a),r.exports}a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var h={};a.d(h,{J:()=>u,M:()=>l});var l,c=a(532);!function(t){t.DATA_PARAMETERS="DATA_PARAMETERS",t.INLINE_DATA_PARAMETERS="INLINE_DATA_PARAMETERS"}(l||(l={}));class u{constructor(t,e,r){if(this.uri=t,this.data=e,this.event=r,this.sessionData=new Map,"string"==typeof t){const e=t.match(/^Symbol\.for\((.+)\):\/(.*)$/);if(e){const t=Symbol.for(e[1]);this.uri={symbol:t,uri:e[2]}}}}get symbols(){if("object"==typeof this.uri)return Array.isArray(this.uri.symbol)?this.uri.symbol:[this.uri.symbol]}get scheme(){if("string"==typeof this.uri){const t=this.uri.split("://");return t.length>1?t[0]:void 0}}get paths(){return this.pathname.split("/")??[]}get fullPath(){const t=("string"==typeof this.uri?this.uri:this.uri.uri).split("://");return t[t.length>=2?1:0]??""}get pathname(){return this.fullPath.split("?")[0]}get query(){return this.fullPath.split("?")[1]??""}get queryParams(){const t={};return this.query.split("&")?.forEach(e=>{const r=e.split("=");t[r[0]]=r[1]}),t}get queryParamsAfterDecodeURI(){const t=this.queryParams;for(const e in t)t.hasOwnProperty(e)&&(t[e]=decodeURIComponent(t[e]));return t}getPathnameData(t){return c.r.Path.pathNameData(this.pathname,t)}get isSymbolScheme(){return void 0!==this.symbols}}const d=h.J;var y=i(7016);const p=t(import.meta.url)("buffer");var g=i(6377),f=i(1022),m=i(9434),b=i(5884),x=i(3055),S={2676:(t,e,r)=>{r.d(e,{B:()=>i});var i,n=r(7855),s=r(9284);!function(t){let e,r;t.constructorName=t=>t&&t.constructor&&t.constructor.name?t.constructor.name:t&&t.name?t.name:void 0,t.deepCopy=t=>t instanceof Map?new Map(JSON.parse(JSON.stringify(Array.from(t.entries())))):t instanceof Set?new Set(JSON.parse(JSON.stringify(Array.from(t.values())))):s.U.isNullOrUndefined(t)?t:JSON.parse(JSON.stringify(t)),t.allProtoTypeName=(e,r)=>{let i=[];if(e){const n=Object.getPrototypeOf(e);n&&(i=Object.keys(n)||[]).length>0&&(i=i.concat(t.allProtoTypeName(n,r)))}let n=i.filter(t=>"constructor"!==t);if(r&&e){const t=Object.getPrototypeOf(e);n=n.filter(e=>r(e,t?.[e]))}return n},t.uniqueKeys=t=>Array.from(new Set((Array.isArray(t)?t:[t]).flatMap(t=>Object.keys(t)))),t.ownPropertyNames=t=>{const e=[];if(t)if(t.prototype)e.push(...Object.getOwnPropertyNames(Object.getPrototypeOf(t)));else{const r=Object.getPrototypeOf(t);e.push(...Object.getOwnPropertyNames(r))}return e.filter(t=>"constructor"!==t)},t.protoTypeName=t=>{let e=[];if(t){const r=Object.getPrototypeOf(t);e=Object.keys(r)||[]}return e.filter(t=>"constructor"!==t)},t.protoTypes=t=>{const e=[];if(t){const r=Object.getPrototypeOf(t);(Object.keys(r)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.push(r[t])})}return e},t.seal=t=>Object.seal(t),t.isPrototypeOfTarget=(t,e)=>!(!t||!e)&&Object.prototype.isPrototypeOf.call(t.prototype,e),t.prototypeOfDepth=(t,e)=>{let r=t;const i=[];if(e)do{if(r=Object.getPrototypeOf(r),r?.constructor===e)break;i.push(r)}while(r);return i},t.allProtoType=t=>{const e=(t,r=[])=>(t.prototype&&(r.push(t),e(Object.getPrototypeOf(t),r)),r);return e(t)},t.prototypeOf=t=>Object.getPrototypeOf(t),t.prototypeKeyMap=t=>{const e=new Map;if(t){const r=Object.getPrototypeOf(t);(Object.keys(r)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.set(r[t],t)})}return e},t.prototypeName=(e,r)=>t.prototypeKeyMap(e).get(r),t.pickRandomKey=t=>{const e=Object.keys(t);return e[Math.floor(Math.random()*e.length)]},t.pickRandomValue=t=>{const e=Object.keys(t);return t[e[Math.floor(Math.random()*e.length)]]},t.pickRandomKeyValue=t=>{const e=Object.keys(t),r=e[Math.floor(Math.random()*e.length)];return{key:r,value:t[r]}},t.keyValues=t=>Object.keys(t).map(e=>({key:e,value:t[e]})),t.entries=t=>Object.entries(t),t.values=t=>Object.values(t),t.keys=t=>Object.keys(t),t.keyLength=e=>t.keys(e).length,t.toDeleteUndefinedAndNull=(t,e)=>{const r=t=>Array.isArray(t)?t.filter(t=>null!=t).map(r):t&&"object"==typeof t?e?.deep?Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e).map(([t,e])=>[t,r(e)])):Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e)):t;return r(t)},function(t){t.isFunctionScript=t=>t.trim().startsWith("function"),t.isArrowFunctionScript=t=>/^\s*\([^)]*\)\s*=>/.test(t),t.toOptionalChainPath=e=>{if(!e)return"";if(e.trim().startsWith("{")&&e.trim().endsWith("}"))return e;if(t.isFunctionScript(e)||t.isArrowFunctionScript(e))return e;if(e.includes(" ? ")&&e.includes(" : ")){const t=e.split(/(\s+\?\s+|\s+:\s+)/).map((t,e)=>{if(0===e){const e=t.match(/[^?.[\]]+|\[[^\]]*\]/g);if(e&&e.length>1)return e.join("?.")}return t});return t.join("")}if(e.includes("(")){const r=[];let i=e,n=0;const s=/(\w+)\(([^()]*(?:\([^()]*\)[^()]*)*)\)/g;let o;for(;null!==(o=s.exec(e));){const e=o[0],s=o[1],a=o[2],h=`__FUNC_CALL_${n}__`,l=`${s}?.(${a?t.toOptionalChainPath(a):""})`;r.push({original:e,processed:l,placeholder:h}),i=i.replace(e,h),n++}const a=i.match(/[^?.[\]]+|\[[^\]]*\]/g);let h="";h=a&&a.length>1?a.join("?."):i;for(const t of r)h=h.replace(t.placeholder,t.processed);return h}const r=e.match(/[^?.[\]]+|\[[^\]]*\]/g);return r?r.join("?."):e},t.removeOptionalChainOperator=t=>t?t.replace(/\?\./g,".").replace(/\.\[/g,"["):"";const e=t=>{const e=[],r=/\.([^.\[]+)|\[(\d+)\]|\[(['"])(.*?)\3\]/g;let i,n=0;const s=t.match(r);if(s&&(s?.index??0)>0)e.push(t.substring(0,s.index)),n=s.index;else if(!s&&t.length>0)return e.push(t),e;for(;null!==(i=r.exec(t));){if(i.index>n){const r=t.substring(n,i.index);r.startsWith(".")?e.push(r.substring(1)):e.push(r)}i[1]?e.push(i[1]):i[2]?e.push(parseInt(i[2],10)):i[4]&&e.push(i[4]),n=r.lastIndex}if(n<t.length){const r=t.substring(n);r.startsWith(".")?e.push(r.substring(1)):e.push(r)}return e};t.to=e=>{const r={};return Object.entries(e).forEach(([e,i])=>{t.set(r,e,i)}),r},t.set=(t,r,i)=>{const n=e(r);let s=t;for(let t=0;t<n.length;t++){const e=n[t];if(t===n.length-1)s[e]=i;else{const r=n[t+1];if("number"==typeof r){if(Array.isArray(s[e])||(s[e]=[]),Array.isArray(s[e]))for(;s[e].length<=r;)s[e].push({})}else"object"==typeof s[e]&&null!==s[e]||(s[e]={});s=s[e]}}},t.get=(t,r,i)=>{const n=e(r);let s=t;for(let t=0;t<n.length;t++){const e=n[t];if(null==s)return i;if("object"!=typeof s||null===s||!(e in s))return i;s=s[e]}return s},t.deletePath=(t,r)=>{const i=e(r);if(0===i.length)return!1;let n=t;for(let t=0;t<i.length-1;t++){const e=i[t];if(null==n)return!1;if("object"!=typeof n||null===n||!(e in n))return!1;n=n[e]}const s=i[i.length-1];return null!==n&&"object"==typeof n&&s in n&&(Array.isArray(n)&&"number"==typeof s?n.splice(s,1):delete n[s],!0)},t.availablePath=(t,e)=>{const r=[],i=t=>"number"==typeof t?"["+t+"]":/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:"['"+t+"']",n=(t,s,o)=>{null!==t&&"object"==typeof t&&(o.has(t)||(o.add(t),Array.isArray(t)?t.forEach((t,a)=>{const h=i(a),l=s?`${s}${h}`:h;e&&!e(l,t)||r.push(l),n(t,l,o)}):Object.keys(t).forEach(a=>{const h=i(a);let l;l=h.startsWith("[")?s?`${s}${h}`:h:s?`${s}.${h}`:h,e&&!e(l,t[a])||r.push(l),n(t[a],l,o)})))};return n(t,"",new Set),r},t.detectPathFromScript=(t,e)=>{const r=new Set;class i{constructor(t){this.prefix=t,this.usingVars=r}set(t,e,r,i){return!0}get(t,e,r){if("symbol"==typeof e)return this.createSafeProxy(this.prefix);let i;const n=String(e);return i=isNaN(Number(n))?this.prefix?`${this.prefix}.${n}`:n:this.prefix?`${this.prefix}[${n}]`:n,i&&this.usingVars.add(i),this.createSafeProxy(i)}apply(t,e,r){return this.createSafeProxy(this.prefix)}createSafeProxy(t){const e=new i(t);return new Proxy(()=>{},{get:(r,i,n)=>i===Symbol.toPrimitive?()=>"":"valueOf"===i?()=>e.createSafeProxy(t):"toString"===i?()=>"":e.get(r,i,n),set:e.set.bind(e),apply:e.apply.bind(e)})}}const n={window:new Proxy(()=>{},new i("window")),document:new Proxy(()=>{},new i("document")),console:new Proxy(()=>{},new i("console"))},s=new Proxy(()=>{},new i("this"));try{new Function("window","document","console",`"use strict"; ${t}; `).call(s,n.window,n.document,n.console)}catch(t){console.error("detectPathFromScript error:",t)}if(e?.excludeThis){const t=new Set;return r.forEach(e=>{"this"!==e&&(e.startsWith("this.")?t.add(e.substring(5)):t.add(e))}),t}return r}}(e=t.Path||(t.Path={})),t.toDeleteKey=(e,r)=>{const i={...e};return t.deleteKey(i,r),i},t.deleteKey=(t,e)=>{e.filter(t=>(0,n.O)(t)).forEach(e=>{delete t[e]})},function(t){t.evalReturn=(e,r={})=>{let i="",n="";return"object"==typeof e?(i=e.bodyScript,n=e.returnScript):n=e,t.eval(`${i}; return ${n} `,r)},t.eval=(t,e={})=>{try{return Function(`"use strict"; ${t} `).bind(e)()}catch(e){return console.error("eval error",e),void console.error(t)}}}(r=t.Script||(t.Script={}))}(i||(i={}))},3205:(t,e,r)=>{r.d(e,{O:()=>s});var i=r(7553),n=r(9244);class s extends i.M{constructor(t){super(),this.volume=0,this.mass=0,this.e=0,this.rotate=0,this.width=0,this.height=0,this.transform=[1,0,0,1,0,0],this.color={r:0,g:0,b:0,a:255},this.updateObjWithDefaults(t)}copyObj(){return new s({x:this.x,y:this.y,z:this.z,volume:this.volume,mass:this.mass,e:this.e,rotate:this.rotate,width:this.width,height:this.height,transform:[...this.transform],color:{...this.color},data:{...this.data}})}updateObjWithDefaults(t){if(t){this.x=t.x??this.x,this.y=t.y??this.y,this.z=t.z??this.z,this.volume=t.volume??this.volume,this.mass=t.mass??this.mass,this.e=t.e??this.e,this.rotate=t.rotate??this.rotate,this.width=t.width??this.width,this.height=t.height??this.height,this.transform=[...t.transform??this.transform],this.color={...t.color??this.color};const e=t.data??this.data;this.data=e?{...e}:void 0}}setObj(t){if(t){this.x=t.x??0,this.y=t.y??0,this.z=t.z??0,this.volume=t.volume??0,this.mass=t.mass??0,this.e=t.e??0,this.rotate=t.rotate??0,this.width=t.width??0,this.height=t.height??0,this.transform=[...t.transform??[1,0,0,1,0,0]],this.color={...t.color??{r:0,g:0,b:0,a:255}};const e=t.data;this.data=e?{...e}:void 0}}toRect(){return new n.r(this.x,this.y,this.width,this.height)}}},3599:(t,e,r)=>{r.d(e,{z:()=>i});var i,n=r(8741),s=r(7553),o=r(3205),a=r(4068);!function(t){t.getMinByObjectArray=(t,e)=>{let r;if(e&&t&&t.length>0){r=t[0][e];for(let i=1;i<t.length;i++)r=Math.min(r,t[i][e])}return r},t.hypot=(...t)=>Math.hypot(...t),t.pythagorean=(t,e)=>Math.sqrt(t*t+e*e),t.getMaxByObjectArray=(t,e)=>{let r;if(e&&t&&t.length>0){r=t[0][e];for(let i=1;i<t.length;i++)r=Math.max(r,t[i][e])}return r},t.sum=t=>t.reduce((t,e)=>t+e,0),t.avg=e=>e.length>0?t.sum(e)/e.length:0,t.minMax=(t,e)=>Math.min(Math.max(t,e.min),e.max),t.max=t=>t.length>0?Math.max(...t):void 0,t.min=t=>t.length>0?Math.min(...t):void 0,t.getSumByObjectArray=(t,e)=>{let r=0;if(e&&t&&t.length>0)for(let i=0;i<t.length;i++)r+=t[i][e];return r},t.radians=(t,{type:e="degreeAngle"})=>"ratio"===e?2*t*Math.PI:"percent"===e?t/100*2*Math.PI:t/180*Math.PI,t.degrees=(t,{type:e="degreeAngle"})=>"ratio"===e?360*t:"percent"===e?t/100*360:180*t/Math.PI,t.ratio=(t,e,r=1)=>r*(e/t),t.getBetweenLength=(t,e)=>e-t,t.getPercentByTotal=(t,e)=>e/t*100,t.getRatioByTotal=(t,e)=>e/t,t.getValueByTotalInPercent=(t,e)=>t*e/100,t.getValueByTotalInRatio=(t,e)=>t*e,t.getValuePercentUp=(t,e)=>t*(1+e/100),t.getValueRatioUp=(t,e)=>t*(1+e),t.getValuePercentDown=(t,e)=>t*(1-e/100),t.getValueRatioDown=(t,e)=>t*(1-e),t.beziers=(e,r)=>{const i=new Array(r).fill(void 0);for(let n=0;n<i.length;n++)i[n]=t.bezier(e,r,n);return i},t.bezier=(e,r,i)=>{if(e&&e.length>0){const o=e.map(t=>new s.M(t.x,t.y,t.z)),a=[];return o.reduce((t,e)=>{const n=t.toSub(e).div(r).mult(i+1);return a.push(t.toSub(n)),e}),a.length<=1?a[0]:t.bezier(a.map(t=>new n.M(t)),r,i)}return new s.M},t.cubicBezier=function(e,r,i){if(e.start instanceof o.O&&e.end instanceof o.O){const n=t.cubicBezier({start:e.start.x,end:e.end.x},r,i),s=t.cubicBezier({start:e.start.y,end:e.end.y},r,i),a=t.cubicBezier({start:e.start.z,end:e.end.z},r,i),h=t.cubicBezier({start:e.start.volume,end:e.end.volume},r,i),l=t.cubicBezier({start:e.start.mass,end:e.end.mass},r,i),c=t.cubicBezier({start:e.start.e,end:e.end.e},r,i),u=t.cubicBezier({start:e.start.rotate,end:e.end.rotate},r,i),d=t.cubicBezier({start:e.start.width,end:e.end.width},r,i),y=t.cubicBezier({start:e.start.height,end:e.end.height},r,i),p=t.cubicBezier({start:e.start.transform[0],end:e.end.transform[0]},r,i),g=t.cubicBezier({start:e.start.transform[1],end:e.end.transform[1]},r,i),f=t.cubicBezier({start:e.start.transform[2],end:e.end.transform[2]},r,i),m=t.cubicBezier({start:e.start.transform[3],end:e.end.transform[3]},r,i),b=t.cubicBezier({start:e.start.transform[4],end:e.end.transform[4]},r,i),x=t.cubicBezier({start:e.start.transform[5],end:e.end.transform[5]},r,i),S=t.cubicBezier({start:e.start.color.r??0,end:e.end.color.r??0},r,i),w=t.cubicBezier({start:e.start.color.g??0,end:e.end.color.g??0},r,i),v=t.cubicBezier({start:e.start.color.b??0,end:e.end.color.b??0},r,i),k=t.cubicBezier({start:e.start.color.a??255,end:e.end.color.a??255},r,i);return n.map((t,e)=>{const r=new o.O({x:t,y:s[e],z:a[e]});return r.volume=h[e],r.mass=l[e],r.e=c[e],r.rotate=u[e],r.width=d[e],r.height=y[e],r.transform=[p[e],g[e],f[e],m[e],b[e],x[e]],r.color={r:S[e],g:w[e],b:v[e],a:k[e]},r})}if(e.start instanceof n.M&&e.end instanceof n.M){const s=t.cubicBezier({start:e.start.x,end:e.end.x},r,i),o=t.cubicBezier({start:e.start.y,end:e.end.y},r,i),a=t.cubicBezier({start:e.start.z,end:e.end.z},r,i);return s.map((t,e)=>new n.M(t,o[e],a[e]))}const{start:s,end:a}=e,{frame:h}=r;let{p1x:l,p1y:c,p2x:u,p2y:d}=Array.isArray(i)?{p1x:i[0],p1y:i[1],p2x:i[2],p2y:i[3]}:i;l="random"===l?Math.random():l,c="random"===c?Math.random():c,u="random"===u?Math.random():u,d="random"===d?Math.random():d;const y=[],p=a-s,g=t=>{const e=Number(t*t),r=Number(e*t),i=Number(1-t),n=Number(i*i);return 0*Number(n*i)+3*n*t*Number(c)+3*i*e*Number(d)+1*r},f=h+1;for(let t=1;t<f;t++){const e=s+p*g(t/f);y.push(e)}return y},t.diff=(t,e)=>Math.abs(t-e),t.distSqToLineSegment=(t,e,r)=>{const i=(e.x-r.x)**2+(e.y-r.y)**2;if(0===i)return(t.x-e.x)**2+(t.y-e.y)**2;let n=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i;n=Math.max(0,Math.min(1,n));const s=e.x+n*(r.x-e.x),o=e.y+n*(r.y-e.y);return(t.x-s)**2+(t.y-o)**2},t.rotatePoint=(t,e,r)=>{const i=t.x-e.x,n=t.y-e.y,s=i*Math.cos(r)-n*Math.sin(r),o=i*Math.sin(r)+n*Math.cos(r);return new a.P(s+e.x,o+e.y)}}(i||(i={}))},4068:(t,e,r)=>{r.d(e,{P:()=>i});class i{constructor(t,e){"object"==typeof t?(this.x=t.x??0,this.y=t.y??0):(this.x=t??0,this.y=e??0)}copy(){return new i(this.x,this.y)}}},5275:(t,e,r)=>{r.d(e,{s:()=>i});const i=t=>!!t&&"number"==typeof t.width&&"number"==typeof t.height},7553:(t,e,r)=>{r.d(e,{M:()=>s});var i=r(8741),n=r(4068);class s{constructor(t,e,r){t instanceof i.M?(this.x=t.x,this.y=t.y,this.z=t.z):"object"==typeof t?(this.x=t.x??0,this.y=t.y??0,this.z=t.z??0):(this.x=t??0,this.y=e??0,this.z=r??0)}set(t,e=0,r=0){return t instanceof s||t instanceof i.M?this.set(t.x||0,t.y||0,t.z||0):(this.x=t,this.y=e,this.z=r),this}get(){return new s(this.x,this.y,this.z)}mag(){const t=this.x,e=this.y,r=this.z;return Math.sqrt(t*t+e*e+r*r)}add(t,e=0,r=0){t instanceof s||t instanceof i.M?(this.x+=t.x,this.y+=t.y,this.z+=t.z):(this.x+=t,this.y+=e,this.z+=r)}toAdd(t,e){return new s(t.x+e.x,t.y+e.y,t.x+e.y)}sub(t,e=0,r=0){t instanceof s||t instanceof i.M?(this.x-=t.x,this.y-=t.y,this.z-=t.z):(this.x-=t,this.y-=e,this.z-=r)}toSub(t){const e=this;return new s(e.x-t.x,e.y-t.y,e.z-t.z)}mult(t){return t instanceof s||t instanceof i.M?(this.x*=t.x,this.y*=t.y,this.z*=t.z):(this.x*=t,this.y*=t,this.z*=t),this}toMult(t){const e=this;return new s(e.x*=t.x,e.y*=t.y,e.z*=t.z)}div(t){return t instanceof s||t instanceof i.M?(this.x/=t.x,this.y/=t.y,this.z/=t.z):(this.x/=t,this.y/=t,this.z/=t),this}toDiv(t){const e=this.get();return e.x/=t,e.y/=t,e.z/=t,e}dist(t){const e=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+r*r+i*i)}toDist(t){const e=this,r=e.x-t.x,i=e.y-t.y,n=e.z-t.z;return Math.sqrt(r*r+i*i+n*n)}dot(t,e,r){return t instanceof s||t instanceof i.M?this.x*t.x+this.y*t.y+this.z*t.z:this.x*t+this.y*e+this.z*r}cross(t){const e=this.x,r=this.y,i=this.z;return new s(r*t.z-t.y*i,i*t.x-t.z*e,e*t.y-t.x*r)}normalize(){const t=this.mag();t>0&&this.div(t)}limit(t){this.mag()>t&&(this.normalize(),this.mult(t))}heading2D(){return-Math.atan2(-this.y,this.x)}random2D(){return this.fromAngle(Math.random()*(2*Math.PI))}fromAngle(t,e=1){return new s(e*Math.cos(t),e*Math.sin(t),0)}fromAngles(t,e,r=1){const i=Math.cos(e),n=Math.sin(e),o=Math.cos(t),a=Math.sin(t);return new s(r*a*n,-r*o,r*a*i)}array(){return[this.x,this.y,this.z]}toPoint3D(){return new i.M(this.x,this.y,this.z)}toPoint2D(){return new n.P(this.x,this.y)}copy(){return new s(this.x,this.y,this.z)}toString(){return"["+this.x+", "+this.y+", "+this.z+"]"}}},7855:(t,e,r)=>{r.d(e,{O:()=>i});const i=t=>null!=t},8741:(t,e,r)=>{r.d(e,{M:()=>s});var i=r(7553),n=r(4068);class s extends n.P{constructor(t,e,r){t instanceof i.M?(super(t.x,t.y),this.z=t.z):"object"==typeof t?(super({x:t.x??0,y:t.y??0}),this.z=t.z??0):(super(t,e),this.z=r??0)}copy(){return new s(this.x,this.y,this.z)}}},9244:(t,e,r)=>{r.d(e,{r:()=>o});var i=r(4068),n=r(3599),s=r(5275);class o{constructor(t,e,r=0,n=0){(0,s.s)(t)?(this._start=new i.P(0,0),this._width=t.width,this._height=t.height):"object"==typeof t&&"object"==typeof e?(this._start=t instanceof i.P?t:new i.P(t.x,t.y),this.end=e instanceof i.P?e:new i.P(e.x,e.y)):"object"==typeof t&&"number"==typeof e?(this._start=t instanceof i.P?t:new i.P(t.x,t.y),this._width=e,this._height=r):"number"==typeof t&&"number"==typeof e&&(this._start=new i.P(t,e),this._width=r,this._height=n)}valueLinkControl(t){let e,r=!1;var i;return"object"==typeof(i=t)&&"value"in i&&"noLink"in i?(e=t.value,r=t.noLink):e=t,{value:e,noLink:r}}get width(){return this._width}get height(){return this._height}get start(){return this._start.copy()}set width(t){this.setWidth(t)}setWidth(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=n.z.getPercentByTotal(this._width,e);this._width=e,this.applyWidthPercentLinks({value:i,noLink:r})}set height(t){this.setHeight(t)}setHeight(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=n.z.getPercentByTotal(this._height,e);this._height=e,this.applyHeightPercentLinks({value:i,noLink:r})}set start(t){let{value:e,noLink:r}=this.valueLinkControl(t);const s=new i.P({x:n.z.getPercentByTotal(this._start.x,e.x),y:n.z.getPercentByTotal(this._start.y,e.y)});this._start=e,this.applyStartPercentLinks({value:s,noLink:r})}setWidthFromEnd(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=n.z.getPercentByTotal(this.start.x,e);this._start.x=this.end.x-e,this.applyStartXPercentLinks({value:i,noLink:r})}set widthFromEnd(t){this.setWidthFromEnd(t)}setHeightFromEnd(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=this.end.y-e,s=n.z.getPercentByTotal(this.start.y,i);this._start.y=i,this.applyStartYPercentLinks({value:s,noLink:r})}set heightFromEnd(t){this.setHeightFromEnd(t)}setWidthFromCenter(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=this.center.x-e/2,s=n.z.getPercentByTotal(this.start.x,i);this._start.x=i,this.applyStartXPercentLinks(s)}set widthFromCenter(t){this.setWidthFromCenter(t)}setHeightFromCenter(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=this.center.y-e/2,s=n.z.getPercentByTotal(this.start.y,i);this._start.y=i,this.applyStartYPercentLinks(s)}set heightFromCenter(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=this.center.y-e/2,s=n.z.getPercentByTotal(this.start.y,i);this._start.y=i,this.applyStartYPercentLinks(s)}set x(t){this.setX(t)}setX(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=e-this._start.x,s=n.z.getPercentByTotal(this.width,i);this._start.x=e,this.applyStartXPercentLinks({value:s,noLink:r})}set y(t){this.setY(t)}setY(t){let{value:e,noLink:r}=this.valueLinkControl(t);const i=e-this._start.y,s=n.z.getPercentByTotal(this.height,i);this._start.y=e,this.applyStartYPercentLinks({value:s,noLink:r})}applyWidthPercentLinks(t){let{value:e,noLink:r}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof r&&r||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof r||t!==r).forEach(t=>{t.setWidthByWidthPercent({value:e,noLink:this})})}applyHeightPercentLinks(t){let{value:e,noLink:r}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof r&&r||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof r||t!==r).forEach(t=>{t.setHeightByHeightPercent({value:e,noLink:this})})}applyStartPercentLinks(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.applyStartXPercentLinks({value:e.x,noLink:r}),this.applyStartYPercentLinks({value:e.y,noLink:r})}applyStartXPercentLinks(t){let{value:e,noLink:r}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof r&&r||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof r||t!==r).forEach(t=>{t.addXByWidthPercent({value:e,noLink:this})})}applyStartYPercentLinks(t){let{value:e,noLink:r}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof r&&r||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof r||t!==r).forEach(t=>{t.addYByHeightPercent({value:e,noLink:this})})}hasLink(t){return this.linkRects?.has(t)}isLinked(){return!!this.linkRects?.size}addLink(...t){this.linkRects??(this.linkRects=new Set),t.filter(t=>!this.linkRects?.has(t)).forEach(t=>{this.linkRects?.add(t),t.addLink(this)})}setLinks(t){this.unLinkAll(),this.addLink(...t)}unLinkAll(){this.linkRects&&(Array.from(this.linkRects.values()).forEach(t=>{this.unLink(t)}),this.linkRects.clear())}unLink(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.linkRects&&this.linkRects.delete(e),r||e.unLink({value:this,noLink:this})}addWidthPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setWidth({value:this.width+n.z.getValueByTotalInPercent(this.width,e),noLink:r})}addHeightPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setHeight({value:this.height+n.z.getValueByTotalInPercent(this.height,e),noLink:r})}addWidthRatio(t){this.width=this.width+n.z.getValueByTotalInRatio(this.width,t)}addHeightRatio(t){this.height=this.height+n.z.getValueByTotalInRatio(this.height,t)}addXPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:this.x+n.z.getValueByTotalInPercent(this.width,e),noLink:r})}addYPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:this.y+n.z.getValueByTotalInPercent(this.height,e),noLink:r})}addXRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:this.x+n.z.getValueByTotalInRatio(this.width,e),noLink:r})}addYRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:this.y+n.z.getValueByTotalInRatio(this.height,e),noLink:r})}set endX(t){const e=t-this.x;this.width=e}set endXPercent(t){this.endX=n.z.getValueByTotalInPercent(this.width,t)}set endYPercent(t){this.endY=n.z.getValueByTotalInPercent(this.height,t)}set endY(t){this.height=t-this.y}set end(t){this.width=t.x-this.x,this.height=t.y-this.y}get x(){return this.start.x}get y(){return this.start.y}get endX(){return this.end.x}get endY(){return this.end.y}to(t){const e=this.copy();return e.start=t,e}toRotate(t,{rotatePoint:e=this.center,type:r="degreeAngle"}){const s=n.z.radians(t,{type:r}),o=e instanceof i.P?e:new i.P(e.x,e.y);return[this.leftTop,this.rightTop,this.rightBottom,this.leftBottom].map(t=>n.z.rotatePoint(t,o,s))}get center(){return new i.P(this.start.x+this.width/2,this.start.y+this.height/2)}get end(){return new i.P(this.start.x+this.width,this.start.y+this.height)}get leftTop(){return this.start.copy()}get leftBottom(){return new i.P(this.start.x,this.end.y)}get rightTop(){return new i.P(this.end.x,this.start.y)}get rightBottom(){return this.end}copy(){return new o(this.x,this.y,this.width,this.height)}getWidthPercent(t){return n.z.getPercentByTotal(this.width,t)}getWidthRatio(t){return n.z.getRatioByTotal(this.width,t)}getWidthByPercent(t){return n.z.getValueByTotalInPercent(this.width,t)}getWidthByRatio(t){return n.z.getValueByTotalInRatio(this.width,t)}getHeightPercent(t){return n.z.getPercentByTotal(this.height,t)}getHeightRatio(t){return n.z.getRatioByTotal(this.height,t)}getHeightByPercent(t){return n.z.getValueByTotalInPercent(this.height,t)}getHeightByRatio(t){return n.z.getValueByTotalInRatio(this.height,t)}getXPercent(t){return n.z.getPercentByTotal(this.width,t-this.x)}getXRatio(t){return n.z.getRatioByTotal(this.width,t-this.x)}getXByPercent(t){return this.x+n.z.getValueByTotalInPercent(this.width,t)}getXByRatio(t){return this.x+n.z.getValueByTotalInRatio(this.width,t)}getYPercent(t){return n.z.getPercentByTotal(this.height,t-this.y)}getYRatio(t){return n.z.getRatioByTotal(this.height,t-this.y)}getYByPercent(t){return this.y+n.z.getValueByTotalInPercent(this.height,t)}getYByRatio(t){return this.y+n.z.getValueByTotalInRatio(this.height,t)}getPercent(t){return new i.P(this.getXPercent(t.x),this.getYPercent(t.y))}toScaleByWidth(t){const e=this.height/this.width;return new o(this.x,this.y,t,t*e)}toScaleByHeight(t){const e=this.width/this.height;return new o(this.x,this.y,t*e,t)}toRatio(t){return new o(this.getXRatio(t.x),this.getYRatio(t.y),this.getWidthRatio(t instanceof o?t.width:t.w),this.getHeightRatio(t instanceof o?t.height:t.h))}getRatio(t){return new i.P(this.getXRatio(t.x),this.getYRatio(t.y))}getByPercent(t){return new i.P(this.getXByPercent(t.x),this.getYByPercent(t.y))}getByRatio(t){return new i.P(this.getXByRatio(t.x),this.getYByRatio(t.y))}getDiffX(t){return t-this.x}getDiffY(t){return t-this.y}getDiffLeft(t){this.getDiffX(t)}getDiffTop(t){this.getDiffY(t)}getDiffRight(t){return t-this.end.x}getDiffBottom(t){return t-this.end.y}getDiffWidth(t){return t-this.width}getDiffHeight(t){return t-this.height}toDiff(t){return new o(t.x-this.x,t.y-this.y,t.width-this.width,t.height-this.height)}setXByWidthPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:n.z.getValueByTotalInPercent(this.width,e),noLink:r})}set xByWidthPercent(t){this.setXByWidthPercent(t)}setXByWidthRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:n.z.getValueByTotalInRatio(this.width,e),noLink:r})}set xByWidthRatio(t){this.setXByWidthRatio(t)}setYByHeightPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:n.z.getValueByTotalInPercent(this.height,e),noLink:r})}set yByHeightPercent(t){this.setYByHeightPercent(t)}setYByHeightRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:n.z.getValueByTotalInRatio(this.height,e),noLink:r})}set yByHeightRatio(t){this.setYByHeightRatio(t)}addXByWidthPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:this.x+n.z.getValueByTotalInPercent(this.width,e),noLink:r})}addXByWidthRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setX({value:this.x+n.z.getValueByTotalInRatio(this.width,e),noLink:r})}addYByHeightPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:this.y+n.z.getValueByTotalInPercent(this.height,e),noLink:r})}addYByHeightRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setY({value:this.y+n.z.getValueByTotalInRatio(this.height,e),noLink:r})}setWidthByWidthPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setWidth({value:n.z.getValueByTotalInPercent(this.width,e),noLink:r})}set widthByWidthPercent(t){this.setWidthByWidthPercent(t)}setWidthByWidthRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setWidth({value:n.z.getValueByTotalInRatio(this.width,e),noLink:r})}set widthByWidthRatio(t){this.setWidthByWidthRatio(t)}setHeightByHeightPercent(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setHeight({value:n.z.getValueByTotalInPercent(this.height,e),noLink:r})}set heightByHeightPercent(t){this.setHeightByHeightPercent(t)}setHeightByHeightRatio(t){let{value:e,noLink:r}=this.valueLinkControl(t);this.setHeight({value:n.z.getValueByTotalInRatio(this.height,e),noLink:r})}set heightByHeightRatio(t){this.setHeightByHeightRatio(t)}copyByPercent(t,e){return new o(this.x,this.y,n.z.getValueByTotalInPercent(this.width,t),n.z.getValueByTotalInPercent(this.height,e??t))}copyByRatio(t,e){return new o(this.x,this.y,n.z.getValueByTotalInRatio(this.width,t),n.z.getValueByTotalInRatio(this.height,e??t))}isIn(t){return t instanceof o?this.isIn(t.start)&&this.isIn(t.end):t.x>=this.start.x&&t.x<=this.end.x&&t.y>=this.start.y&&t.y<=this.end.y}isOut(t){return t instanceof o?!this.isOverlap(t):!this.isIn(t)}isOverlap(t){return t instanceof o?!(this.endX<t.x||this.x>t.endX||this.endY<t.y||this.y>t.endY):this.isIn(t)}toString(){return`x:${this.x}, y:${this.y}, width: ${this.width}, height: ${this.height}`}}},9284:(t,e,r)=>{var i;r.d(e,{U:()=>i}),function(t){t.isArrowFunction=t=>"function"==typeof t&&void 0===t.prototype&&!t.toString().startsWith("class"),t.isPlainObject=t=>null!==t&&"object"==typeof t&&t.constructor===Object,t.isFrozen=t=>Object.isFrozen(t),t.isSealed=t=>Object.isSealed(t),t.isFrozenOrSealed=e=>t.isFrozen(e)||t.isSealed(e),t.isFrozenAndSealed=e=>t.isFrozen(e)&&t.isSealed(e),t.isNotFrozen=t=>!Object.isFrozen(t),t.isNotSealed=t=>!Object.isSealed(t),t.isNotFrozenOrSealed=e=>!t.isFrozen(e)&&!t.isSealed(e),t.isNotFrozenAndSealed=e=>!t.isFrozen(e)||!t.isSealed(e),t.isNullOrUndefined=t=>null==t||void 0===t,t.isConstructor=t=>"function"==typeof t&&void 0!==t.prototype&&t.prototype.constructor===t,t.isFunction=e=>"function"==typeof e&&!t.isConstructor(e),t.isNullish=e=>t.isNotNullish(e),t.isNotNullish=e=>Array.isArray(e)||t.isString(e)?e.length>0:e instanceof Set||e instanceof Map?e.size>0:"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e,t.isNotNullUndefined=t=>null!=t,t.isNull=t=>null===t,t.isUndefined=t=>void 0===t,t.isArray=e=>!t.isNullOrUndefined(e)&&"[object Array]"===Object.prototype.toString.call(e).trim(),t.isStringNumber=t=>"number"==typeof t?!isNaN(t):"string"==typeof t&&""!==t.trim()&&!isNaN(Number(t)),t.isNumber=e=>!t.isNullOrUndefined(e)&&"[object Number]"===Object.prototype.toString.call(e).trim(),t.isIterator=t=>null!=t&&"function"==typeof t[Symbol.iterator],t.isString=e=>!t.isNullOrUndefined(e)&&"[object String]"===Object.prototype.toString.call(e).trim(),t.isObject=e=>!t.isNullOrUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e).trim(),t.isMap=e=>!t.isNullOrUndefined(e)&&"[object Map]"===Object.prototype.toString.call(e).trim(),t.isEmpty=e=>!!t.isNullOrUndefined(e)||(t.isArray(e)?0===e.length:t.isString(e)?0===e.trim().length:t.isMap(e)?0===e.size:!!t.isObject(e)&&0===Object.keys(e).length),t.isSet=t=>t instanceof Set,t.isNullishFiltered=t=>Array.isArray(t)?t.every(t=>null!=t):null!=t,t.isFalsyFiltered=t=>Array.isArray(t)?t.every(t=>t):!!t,t.includeValue=(t,e)=>Object.values(t).includes(e),t.includeKey=(t,e)=>Object.keys(t).includes(e),t.lastConsonantLetter=t=>(t.charCodeAt(t.length-1)-44032)%28>0,t.inRange=(t,e,r)=>e<=t&&t<=r,t.isBase64=t=>{let e=t;const r=t.split(";base64,");if(r.length>1)e=r[1];else if(t.startsWith("data:")){const r=t.indexOf(",");r>-1&&(e=t.substring(r+1))}return""===e||e.length,/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(i||(i={}))}},w={};function v(t){var e=w[t];if(void 0!==e)return e.exports;var r=w[t]={exports:{}};return S[t](r,r.exports,v),r.exports}v.d=(t,e)=>{for(var r in e)v.o(e,r)&&!v.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},v.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var k={};v.d(k,{T:()=>O});var O,z=v(9284),P=v(4068),A=v(8741),j=v(9244),L=v(2676);!function(t){t.objToGetURL=t=>Object.keys(t).reduce((e,r,i)=>`${e}${0!==i?"&":""}${r}=${t[r]}`,""),t.mapToJson=t=>JSON.stringify(Array.from(t.entries()).reduce((t,[e,r])=>(t[e]=r,t),{})),t.jsonToMap=t=>new Map(JSON.parse(t)),t.decodeURIString=t=>decodeURIComponent(t),t.objToStrMap=t=>{const e=new Map;for(const r of Object.keys(t))e.set(r,t[r]);return e},t.jsonToStrMap=e=>t.objToStrMap(JSON.parse(e)),t.strToObject=t=>JSON.parse(t),t.objToJson=t=>JSON.stringify(t),t.objToMap=t=>{const e=new Map;return Object.keys(t).forEach(r=>{e.set(r,t[r])}),e},t.mapToObj=t=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e},t.snakeToCamelCase=t=>t.replace(/_([a-z])/g,(t,e)=>e.toUpperCase()),t.camelToSnakeCase=t=>t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),t.toFormData=function(t){const e=new FormData;for(const r in t)e.append(r,t[r]);return e},t.toObject=function(e,r){if(e instanceof URLSearchParams){const t={};return e.forEach((e,i)=>{r?.firstValue&&void 0===t[i]?t[i]=e:r?.firstValue||(t[i]?Array.isArray(t[i])?t[i].push(e):t[i]=[t[i],e]:t[i]=e)}),t}if(e instanceof FormData){const t=t=>{const e={};for(const r of t.keys()){const i=t.getAll(r);e[r]=i.length>1?i:i[0]}return e};return t(e)}if(e&&"function"==typeof e[Symbol.iterator])return Object.fromEntries(e);if(Array.isArray(e))return Object.fromEntries(e);if(z.U.isMap(e)){const r=e;e=t.mapToObj(r)}if(z.U.isArray(e)){const r=e;for(let e=0;e<r.length;e++)r[e]=t.toObject(r[e])}if(z.U.isObject(e))for(const r in e)e[r]=t.toObject(e[r]);return e},t.toArray=t=>t instanceof Set?Array.from(t.values()):Array.isArray(t)?t:t?[t]:[],t.flatArray=(...t)=>t.flatMap(t=>t instanceof Object&&Symbol.iterator in t?Array.from(t):[t]),t.iteratorToArray=t=>Array.from(t),t.toJson=e=>{const r=t.toObject(e);return JSON.stringify(r)},t.concatenateToAttribute=e=>t.concatenateToString(e,"="," ","'"),t.concatenateToParameter=e=>t.concatenateToString(e,"=","&",""),t.concatenateToString=(t,e="=",r=" ",i="")=>{const n=[];for(const r in t){const s=t[r];s&&n.push(r.toString()+e+i+s+i)}return n.join(r)},t.specialCharsToEscape=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.decodeHTMLEscape=t=>t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x2F;/g,"/"),t.copyObject=(t,e={})=>({...t,...e}),t.copyArrayWithAddition=(t,e)=>[...t,...e||[]],t.hexToInt=t=>(t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t.split("").map(t=>t+t).join("")),parseInt(t,16)),t.toHex=t=>(t<0&&(t=4294967295+t+1),(t=Number(t.toFixed(0))).toString(16).padStart(2,"0").toUpperCase()),t.toHexColor=e=>`#${t.toHex(e.r??0)}${t.toHex(e.g??0)}${t.toHex(e.b??0)}${t.toHex(e.a??255)}`,t.avgColor=t=>{const e=t.reduce((t,e)=>(t.r+=e.r??0,t.g+=e.g??0,t.b+=e.b??0,t.a+=e.a??0,t),{r:0,g:0,b:0,a:0});return{r:Math.floor(e.r/t.length),g:Math.floor(e.g/t.length),b:Math.floor(e.b/t.length),a:Math.floor(e.a/t.length)}},t.toRGBA=t=>{t??(t="#000000FF");const e=t.replace("#","");return{r:parseInt(e.slice(0,2)||"0",16),g:parseInt(e.slice(2,4)||"0",16),b:parseInt(e.slice(4,6)||"0",16),a:e.length>6?parseInt(e.slice(6,8)||"0",16):255}},t.minMaxCenterAvg=t=>{const e={},r=L.B.uniqueKeys(t);for(const i of r){const r=t.map(t=>t[i]),n=Math.min(...r),s=Math.max(...r),o=(n+s)/2,a=r.reduce((t,e)=>t+e,0)/r.length;e[i]={min:n,max:s,center:o,avg:a,diff:s-n}}return e},t.minMaxCenterRectAvg2D=t=>{const e=new P.P(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),r=new P.P(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);let i=new P.P(0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),r.x=Math.max(r.x,t.x),r.y=Math.max(r.y,t.y),i.x+=t.x,i.y+=t.y});const n=new P.P((e.x+r.x)/2,(e.y+r.y)/2),s=new P.P(i.x/t.length,i.y/t.length),o=new j.r(e.x,e.y,r.x-e.x,r.y-e.y);return{min:e,max:r,center:n,avg:s,minMaxRect:o}},t.minMaxCenterAvg3D=t=>{const e=new A.M(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new A.M(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);let i=new A.M(0,0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),e.z=Math.max(e.z,t.z),r.x=Math.max(r.x,t.x),r.y=Math.max(r.y,t.y),r.z=Math.max(r.z,t.y),i.x+=t.x,i.y+=t.y,i.z+=t.z});const n=new A.M((e.x+r.x)/2,(e.y+r.y)/2,(e.z+r.z)/2),s=new A.M(i.x/t.length,i.y/t.length,i.z/t.length);return{min:e,max:r,center:n,avg:s}},t.roundRectRadiiToFullRadii=t=>t?1===t.length?[t[0]??0,t[0]??0,t[0]??0,t[0]??0]:2===t.length?[t[0]??0,t[1]??0,t[0]??0,t[1]??0]:3===t.length?[t[0]??0,t[1]??0,t[2]??0,t[1]??0]:t:[0,0,0,0],t.toArrayDirectionChange=t=>{if(!t||0===t.length||!t[0]||0===t[0].length)return[];const e=[],r=t[0].length,i=t.length;for(let n=0;n<r;n++){const r=[];for(let e=0;e<i;e++)r.push(t[e][n]);e.push(r)}return e},t.groupByMap=(t,e)=>t.reduce((t,r)=>{const i=e(r),n=t.get(i)||[];return n.push(r),t.set(i,n),t},new Map),t.groupByObject=(e,r)=>{const i=t.groupByMap(e,r);return Object.fromEntries(i)},t.toURLSearchParams=t=>{const e=new URLSearchParams;if("string"==typeof t)new URLSearchParams(t).forEach((t,r)=>{e.append(r,t)});else if("object"==typeof t){const r=t instanceof URLSearchParams?t.entries():Array.isArray(t)?t:Object.entries(t);for(const[t,i]of Array.from(r))Array.isArray(i)?i.forEach(r=>e.append(t,r)):e.append(t,i)}return e},t.stringJsonToKeyPairs=t=>Array.from(t.matchAll(/(\w+):\s*([^,}]+)/g)).map(t=>({key:t[1],value:t[2]}))}(O||(O={}));const B=k.T;var M=i(426);class C{constructor(t,e,r){t instanceof C?(this.req=t.req,this.res=t.res,this.config=r):(this.req=t,this.res=e,this.config=r)}get reqSocket(){return this.req.socket}get reqCookieMap(){let t=this.reqHeader(n.L.Cookie)??"";Array.isArray(t)&&(t=t.join(";"));const e=new Map;return t.split(";").map(t=>t.trim().split("=")).forEach(t=>{e.set(t[0],t[1])}),e}reqCookieGet(t){return this.reqCookieMap.get(t)}get reqRemoteAddress(){const t=this.req.headers["x-forwarded-for"];let e=this.req.socket.remoteAddress;return Array.isArray(t)?e=t.join(",").split(",").shift():"string"==typeof t&&(e=t.split(",").shift()),e}get reqUrlObject(){return new y.URL(this.reqUrl,`${this.reqSocket?"https://":"http"}${this.reqHost??"localhost"}`)}get reqUrlPathName(){return this.reqUrlObj().pathname??""}get reqUrl(){return this.req.url??""}reqUrlObj(t){return new y.URL(`${t?.scheme??"http"}://${t?.host?t?.host:this.reqHeaderFirst(n.L.Host)??"localhost"}${this.req.url??""}`)}get reqUrlSearchParamTuples(){return Array.from(this.reqUrlObj().searchParams)}get reqUrlSearchParams(){return this.reqUrlObj().searchParams}get reqUrlSearchParamsObj(){const t=this.reqUrlObj().searchParams;return B.toObject(t)}get reqPathSearchParamUrl(){const t=this.reqUrlObj();return t.pathname+(t.searchParams.toString()?"?"+t.searchParams.toString():"")}get reqReadable(){return this.req.readable}get reqIntent(){return new d(this.reqPathSearchParamUrl)}reqHasContentTypeHeader(t){return(this.reqHeaderFirst(n.L.ContentType)??"").toLowerCase().indexOf(t.toLocaleLowerCase())>-1}reqHasAcceptHeader(t){return(this.reqHeaderFirst(n.L.Accept)??"").toLowerCase().indexOf(t.toLocaleLowerCase())>-1}reqBodyData(){return new Promise((t,e)=>{if(this.reqReadable){const r=[];this.req.on("data",t=>r.push(t)),this.req.on("error",t=>e(t)),this.req.on("end",()=>{this.reqBodyChunk=p.Buffer.concat(r),t(this.reqBodyChunk)})}else t(this.reqBodyChunk??p.Buffer.alloc(0))})}resBodyData(){return this.resWriteChunk}async reqBodyMultipartFormDataObject(){const t=await this.reqBodyMultipartFormData(),e={};for(const r of t)if(r.isFile)e[r.name]=await x.i.writeFile(r.value,{originalName:r.filename});else{const t=e[r.name];Array.isArray(t)?t.push(r.value):e[r.name]="string"==typeof t?[t,r.value]:r.value}return e}reqBodyMultipartFormData(){return new Promise((t,e)=>{const r=this.req.headers["content-type"];if(!r||!r.startsWith("multipart/form-data"))return e(new Error("Invalid Content-Type. Expected multipart/form-data."));const i=r.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!i)return e(new Error("Boundary not found in Content-Type header."));const n=i[1]||i[2];if(!n)return e(new Error("Failed to extract boundary."));const s=p.Buffer.from(`--${n}`),o=p.Buffer.from("\r\n"),a=p.Buffer.from("\r\n\r\n"),h=[];let l=0;this.req.on("data",t=>{h.push(t),l+=t.length}),this.req.on("error",t=>{e(t)}),this.req.on("end",()=>{if(0===l)return t([]);const r=p.Buffer.concat(h,l),i=[];let n=0,c=r.indexOf(s,n);if(-1===c)return e(new Error("Initial boundary not found."));for(n=c+s.length,r.slice(n,n+o.length).equals(o)&&(n+=o.length);n<r.length;){const t=r.indexOf(s,n);if(-1===t)break;let e=t;e>o.length&&r.slice(e-o.length,e).equals(o)&&(e-=o.length);const h=r.slice(n,e),l=h.indexOf(a);if(-1===l){if(console.warn("Skipping malformed part: no header/body separator found."),n=t+s.length,r.slice(n,n+o.length).equals(o)&&(n+=o.length),"--"===r.slice(n,n+2).toString())break;continue}const c=h.slice(0,l),u=h.slice(l+a.length),d=c.toString("utf-8"),y={};d.split("\r\n").forEach(t=>{const e=t.indexOf(":");if(e>0){const r=t.substring(0,e).trim().toLowerCase(),i=t.substring(e+1).trim();y[r]=i}});const p=y["content-disposition"];if(!p){if(console.warn("Skipping part: no Content-Disposition header."),n=t+s.length,r.slice(n,n+o.length).equals(o)&&(n+=o.length),"--"===r.slice(n,n+2).toString())break;continue}const g=p.match(/name="([^"]+)"/i),f=p.match(/filename="([^"]+)"/i),m=g?g[1]:null,b=f?f[1]:null,x=y["content-type"]||null;if(m){const t=!!b,e={name:m,isFile:t,filename:b,contentType:x,value:t?u:u.toString("utf-8")};i.push(e)}else console.warn("Skipping part: 'name' not found in Content-Disposition.");if(n=t+s.length,r.slice(n,n+o.length).equals(o)&&(n+=o.length),"--"===r.slice(n,n+2).toString())break}t(i)})})}async reqBodyStringData(){return(await this.reqBodyData()).toString()}async reqBodyJsonData(){return JSON.parse(await this.reqBodyStringData())}async reqBodyFormUrlData(){const t=await this.reqBodyStringData(),e={};return Array.from(new y.URLSearchParams(t).entries()).forEach(([t,r])=>{const i=e[t];Array.isArray(i)?i.push(r):e[t]="string"==typeof i?[i,r]:r}),e}async reqBodyReqFormUrlBody(){const t=await this.reqBodyFormUrlData();return Object.assign(new g.s,t)}async reqBodyReqJsonBody(){const t=await this.reqBodyStringData();return Object.assign(new f.D,t?JSON.parse(t):{})}resBodyJsonData(){const t=M.T.toString(this.resBodyData());return t?JSON.parse(t):null}resBodyStringData(){return M.T.toString(this.resBodyData())}reqMethod(){return this.req.method?.toUpperCase()}reqHeader(t){return this.req.headers[t.toLowerCase()]}get reqHost(){return this.reqHeaderFirst(n.L.Host)}get reqHeaderObj(){const t=new m.E;return Object.entries(this.req.headers).forEach(([e,r])=>{t[e]=r}),t}reqHeaderFirst(t,e){const r=this.req.headers[t.toLowerCase()];return r&&Array.isArray(r)?r[0]??e:r??e}reqAuthorizationHeader(){return this.reqHeaderFirst(n.L.Authorization)}reqRefreshTokenHeader(){return this.reqHeaderFirst(n.L.Authorization)}resStatusCode(t){return t?(this.res.statusCode=t,new N(this.req,this.res,this.config,this.res.statusCode)):this.res.statusCode}resHeader(t){return this.res.getHeader(t.toLowerCase())}resHeaderFirst(t,e){const r=this.res.getHeader(t.toLowerCase());return r&&Array.isArray(r)?r[0]??e:r??e}async reqSession(){return this.config.sessionManager?(await this.config.sessionManager.session(this)).dataSet.data:Promise.reject(new Error("Not SessionManager"))}reqSessionSet(t,e){this.reqSession[t]=e}reqSessionGet(t){const e=this.reqSession;if(e)return e[t]}resSetStatusCode(t){return this.res.statusCode=t,this.createRequestResponseChain(this.res.statusCode)}resWrite(t,e="utf8"){return this.resWriteChunk=t,this.createRequestResponseChain(this.resWriteChunk)}resWriteJson(t,e="utf8"){return this.resWrite(JSON.stringify(t),e)}resSetHeader(t,e){return this.createRequestResponseChain(this.res.setHeader(t.toLowerCase(),e))}resAddHeader(t,e){const r=this.res.getHeader(t.toLowerCase()),i=Array.isArray(r)?r.concat(e):r?[r.toString(),...[].concat(e)]:e;return this.createRequestResponseChain(this.res.setHeader(t.toLowerCase(),i))}resSetHeaders(t){return Object.entries(t).forEach(([t,e])=>this.resSetHeader(t,e)),this.createRequestResponseChain()}resAddHeaders(t){return Object.entries(t).forEach(([t,e])=>this.resAddHeader(t,e)),this.createRequestResponseChain()}async resEndChunk(){const t=this.reqHeaderFirst(n.L.AcceptEncoding);let e=this.resWriteChunk;t?.includes("gzip")&&(e=await(0,b.gzip)(e),this.resSetHeader(n.L.ContentEncoding,"gzip")),this.res.end(e)}async resEnd(t){this.resWriteChunk=t??this.resWriteChunk,this.req.readable?(await this.reqBodyData(),await this.resEndChunk()):await this.resEndChunk()}resWriteHead(t,e){return this.createRequestResponseChain(this.res.writeHead(t,e))}resWriteHeadEnd(t,e){this.createRequestResponseChain(this.res.writeHead(t,e)),this.res.end()}resIsDone(){return this.res.finished||this.res.writableEnded||this.res.headersSent}createRequestResponseChain(t){const e=new N(this.req,this.res,this.config,t);return e.resWriteChunk=this.resWriteChunk,e.reqBodyChunk=this.reqBodyChunk,e}}class N extends C{constructor(t,e,r,i){super(t,e,r),this.result=i}}export{C as RequestResponse,N as RequestResponseChain};
1
+ // src/models/RequestResponse.ts
2
+ import { Intent } from "@dooboostore/simple-boot/intent/Intent";
3
+ import { URL, URLSearchParams } from "url";
4
+ import { Buffer } from "buffer";
5
+
6
+ // src/models/datas/body/ReqFormUrlBody.ts
7
+ var ReqFormUrlBody = class {
8
+ };
9
+
10
+ // src/models/datas/body/ReqJsonBody.ts
11
+ var ReqJsonBody = class {
12
+ };
13
+
14
+ // src/models/datas/ReqHeader.ts
15
+ var ReqHeader = class {
16
+ };
17
+
18
+ // src/models/RequestResponse.ts
19
+ import { gzip } from "node-gzip";
20
+ import { FileUtils } from "@dooboostore/core-node/file/FileUtils";
21
+ import { ConvertUtils as CoreConvertUtils } from "@dooboostore/core/convert/ConvertUtils";
22
+ import { ConvertUtils } from "@dooboostore/core-node/convert/ConvertUtils";
23
+ var RequestResponse = class _RequestResponse {
24
+ // protected sessionManager?: SessionManager;
25
+ // constructor(req: IncomingMessage, res: ServerResponse);
26
+ // constructor(req: RequestResponse);
27
+ // constructor(req: IncomingMessage, res: ServerResponse, sessionManager?: SessionManager);
28
+ // constructor(req: IncomingMessage | RequestResponse, res?: ServerResponse, sessionManager?: SessionManager) {
29
+ // // this.req = req;
30
+ // // this.res = res;
31
+ // if (req instanceof RequestResponse) {
32
+ // this.req = req.req;
33
+ // this.res = req.res;
34
+ // this.sessionManager = req.sessionManager;
35
+ // } else {
36
+ // this.req = req;
37
+ // this.res = res!;
38
+ // this.sessionManager = sessionManager;
39
+ // }
40
+ // }
41
+ constructor(req, res, config) {
42
+ if (req instanceof _RequestResponse) {
43
+ this.req = req.req;
44
+ this.res = req.res;
45
+ this.config = config;
46
+ } else {
47
+ this.req = req;
48
+ this.res = res;
49
+ this.config = config;
50
+ }
51
+ }
52
+ get reqSocket() {
53
+ return this.req.socket;
54
+ }
55
+ get reqCookieMap() {
56
+ let cookies = this.reqHeader("Cookie" /* Cookie */) ?? "";
57
+ if (Array.isArray(cookies)) {
58
+ cookies = cookies.join(";");
59
+ }
60
+ const map = /* @__PURE__ */ new Map();
61
+ cookies.split(";").map((it) => it.trim().split("=")).forEach((it) => {
62
+ map.set(it[0], it[1]);
63
+ });
64
+ return map;
65
+ }
66
+ reqCookieGet(key) {
67
+ return this.reqCookieMap.get(key);
68
+ }
69
+ get reqRemoteAddress() {
70
+ const ipHeader = this.req.headers["x-forwarded-for"];
71
+ let ip = this.req.socket.remoteAddress;
72
+ if (Array.isArray(ipHeader)) {
73
+ ip = ipHeader.join(",").split(",").shift();
74
+ } else if (typeof ipHeader === "string") {
75
+ ip = ipHeader.split(",").shift();
76
+ }
77
+ return ip;
78
+ }
79
+ get reqUrlObject() {
80
+ return new URL(this.reqUrl, `${this.reqSocket ? "https://" : "http"}${this.reqHost ?? "localhost"}`);
81
+ }
82
+ get reqUrlPathName() {
83
+ return this.reqUrlObj().pathname ?? "";
84
+ }
85
+ get reqUrl() {
86
+ return this.req.url ?? "";
87
+ }
88
+ reqUrlObj(config) {
89
+ return new URL(`${config?.scheme ?? "http"}://${config?.host ? config?.host : this.reqHeaderFirst("Host" /* Host */) ?? "localhost"}${this.req.url ?? ""}`);
90
+ }
91
+ get reqUrlSearchParamTuples() {
92
+ return Array.from(this.reqUrlObj().searchParams);
93
+ }
94
+ get reqUrlSearchParams() {
95
+ return this.reqUrlObj().searchParams;
96
+ }
97
+ get reqUrlSearchParamsObj() {
98
+ const entries = this.reqUrlObj().searchParams;
99
+ return CoreConvertUtils.toObject(entries);
100
+ }
101
+ get reqPathSearchParamUrl() {
102
+ const reqUrlObj = this.reqUrlObj();
103
+ return reqUrlObj.pathname + (reqUrlObj.searchParams.toString() ? "?" + reqUrlObj.searchParams.toString() : "");
104
+ }
105
+ get reqReadable() {
106
+ return this.req.readable;
107
+ }
108
+ get reqIntent() {
109
+ return new Intent(this.reqPathSearchParamUrl);
110
+ }
111
+ reqHasContentTypeHeader(mime) {
112
+ return (this.reqHeaderFirst("Content-Type" /* ContentType */) ?? "").toLowerCase().indexOf(mime.toLocaleLowerCase()) > -1;
113
+ }
114
+ reqHasAcceptHeader(mime) {
115
+ return (this.reqHeaderFirst("Accept" /* Accept */) ?? "").toLowerCase().indexOf(mime.toLocaleLowerCase()) > -1;
116
+ }
117
+ reqBodyData() {
118
+ return new Promise((resolve, reject) => {
119
+ if (this.reqReadable) {
120
+ const data = [];
121
+ this.req.on("data", (chunk) => data.push(chunk));
122
+ this.req.on("error", (err) => reject(err));
123
+ this.req.on("end", () => {
124
+ this.reqBodyChunk = Buffer.concat(data);
125
+ resolve(this.reqBodyChunk);
126
+ });
127
+ } else {
128
+ resolve(this.reqBodyChunk ?? Buffer.alloc(0));
129
+ }
130
+ });
131
+ }
132
+ resBodyData() {
133
+ return this.resWriteChunk;
134
+ }
135
+ async reqBodyMultipartFormDataObject() {
136
+ const m = await this.reqBodyMultipartFormData();
137
+ const formData = {};
138
+ for (const it of m) {
139
+ if (it.isFile) {
140
+ formData[it.name] = await FileUtils.writeFile(it.value, { originalName: it.filename });
141
+ } else {
142
+ const target = formData[it.name];
143
+ if (Array.isArray(target)) {
144
+ target.push(it.value);
145
+ } else if (typeof target === "string") {
146
+ formData[it.name] = [target, it.value];
147
+ } else {
148
+ formData[it.name] = it.value;
149
+ }
150
+ }
151
+ }
152
+ ;
153
+ return formData;
154
+ }
155
+ reqBodyMultipartFormData() {
156
+ return new Promise((resolve, reject) => {
157
+ const contentTypeHeader = this.req.headers["content-type"];
158
+ if (!contentTypeHeader || !contentTypeHeader.startsWith("multipart/form-data")) {
159
+ return reject(new Error("Invalid Content-Type. Expected multipart/form-data."));
160
+ }
161
+ const boundaryMatch = contentTypeHeader.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
162
+ if (!boundaryMatch) {
163
+ return reject(new Error("Boundary not found in Content-Type header."));
164
+ }
165
+ const boundary = boundaryMatch[1] || boundaryMatch[2];
166
+ if (!boundary) {
167
+ return reject(new Error("Failed to extract boundary."));
168
+ }
169
+ const boundaryBuffer = Buffer.from(`--${boundary}`);
170
+ const crlfBuffer = Buffer.from("\r\n");
171
+ const doubleCrlfBuffer = Buffer.from("\r\n\r\n");
172
+ const chunks = [];
173
+ let totalLength = 0;
174
+ this.req.on("data", (chunk) => {
175
+ chunks.push(chunk);
176
+ totalLength += chunk.length;
177
+ });
178
+ this.req.on("error", (err) => {
179
+ reject(err);
180
+ });
181
+ this.req.on("end", () => {
182
+ if (totalLength === 0) {
183
+ return resolve([]);
184
+ }
185
+ const fullBuffer = Buffer.concat(chunks, totalLength);
186
+ const parsedParts = [];
187
+ let currentPosition = 0;
188
+ let boundaryStartIndex = fullBuffer.indexOf(boundaryBuffer, currentPosition);
189
+ if (boundaryStartIndex === -1) {
190
+ return reject(new Error("Initial boundary not found."));
191
+ }
192
+ currentPosition = boundaryStartIndex + boundaryBuffer.length;
193
+ if (fullBuffer.slice(currentPosition, currentPosition + crlfBuffer.length).equals(crlfBuffer)) {
194
+ currentPosition += crlfBuffer.length;
195
+ }
196
+ while (currentPosition < fullBuffer.length) {
197
+ const nextBoundaryIndex = fullBuffer.indexOf(boundaryBuffer, currentPosition);
198
+ if (nextBoundaryIndex === -1) {
199
+ break;
200
+ }
201
+ let partEndIndex = nextBoundaryIndex;
202
+ if (partEndIndex > crlfBuffer.length && fullBuffer.slice(partEndIndex - crlfBuffer.length, partEndIndex).equals(crlfBuffer)) {
203
+ partEndIndex -= crlfBuffer.length;
204
+ }
205
+ const partBuffer = fullBuffer.slice(currentPosition, partEndIndex);
206
+ const headerBodySeparatorIndex = partBuffer.indexOf(doubleCrlfBuffer);
207
+ if (headerBodySeparatorIndex === -1) {
208
+ console.warn("Skipping malformed part: no header/body separator found.");
209
+ currentPosition = nextBoundaryIndex + boundaryBuffer.length;
210
+ if (fullBuffer.slice(currentPosition, currentPosition + crlfBuffer.length).equals(crlfBuffer)) {
211
+ currentPosition += crlfBuffer.length;
212
+ }
213
+ if (fullBuffer.slice(currentPosition, currentPosition + 2).toString() === "--") break;
214
+ continue;
215
+ }
216
+ const headerBuffer = partBuffer.slice(0, headerBodySeparatorIndex);
217
+ const bodyBuffer = partBuffer.slice(headerBodySeparatorIndex + doubleCrlfBuffer.length);
218
+ const headersStr = headerBuffer.toString("utf-8");
219
+ const headers = {};
220
+ headersStr.split("\r\n").forEach((line) => {
221
+ const colonIndex = line.indexOf(":");
222
+ if (colonIndex > 0) {
223
+ const key = line.substring(0, colonIndex).trim().toLowerCase();
224
+ const value = line.substring(colonIndex + 1).trim();
225
+ headers[key] = value;
226
+ }
227
+ });
228
+ const contentDisposition = headers["content-disposition"];
229
+ if (!contentDisposition) {
230
+ console.warn("Skipping part: no Content-Disposition header.");
231
+ currentPosition = nextBoundaryIndex + boundaryBuffer.length;
232
+ if (fullBuffer.slice(currentPosition, currentPosition + crlfBuffer.length).equals(crlfBuffer)) {
233
+ currentPosition += crlfBuffer.length;
234
+ }
235
+ if (fullBuffer.slice(currentPosition, currentPosition + 2).toString() === "--") break;
236
+ continue;
237
+ }
238
+ const nameMatch = contentDisposition.match(/name="([^"]+)"/i);
239
+ const filenameMatch = contentDisposition.match(/filename="([^"]+)"/i);
240
+ const name = nameMatch ? nameMatch[1] : null;
241
+ const filename = filenameMatch ? filenameMatch[1] : null;
242
+ const contentType = headers["content-type"] || null;
243
+ if (name) {
244
+ const isFile = !!filename;
245
+ const multipartData = {
246
+ name,
247
+ isFile,
248
+ // filename이 있으면 파일로 간주
249
+ filename,
250
+ contentType,
251
+ value: isFile ? bodyBuffer : bodyBuffer.toString("utf-8")
252
+ };
253
+ parsedParts.push(multipartData);
254
+ } else {
255
+ console.warn("Skipping part: 'name' not found in Content-Disposition.");
256
+ }
257
+ currentPosition = nextBoundaryIndex + boundaryBuffer.length;
258
+ if (fullBuffer.slice(currentPosition, currentPosition + crlfBuffer.length).equals(crlfBuffer)) {
259
+ currentPosition += crlfBuffer.length;
260
+ }
261
+ if (fullBuffer.slice(currentPosition, currentPosition + 2).toString() === "--") {
262
+ break;
263
+ }
264
+ }
265
+ resolve(parsedParts);
266
+ });
267
+ });
268
+ }
269
+ async reqBodyStringData() {
270
+ const data = (await this.reqBodyData()).toString();
271
+ return data;
272
+ }
273
+ async reqBodyJsonData() {
274
+ return JSON.parse(await this.reqBodyStringData());
275
+ }
276
+ async reqBodyFormUrlData() {
277
+ const data = await this.reqBodyStringData();
278
+ const formData = {};
279
+ Array.from(new URLSearchParams(data).entries()).forEach(([k, v]) => {
280
+ const target = formData[k];
281
+ if (Array.isArray(target)) {
282
+ target.push(v);
283
+ } else if (typeof target === "string") {
284
+ formData[k] = [target, v];
285
+ } else {
286
+ formData[k] = v;
287
+ }
288
+ });
289
+ return formData;
290
+ }
291
+ async reqBodyReqFormUrlBody() {
292
+ const data = await this.reqBodyFormUrlData();
293
+ return Object.assign(new ReqFormUrlBody(), data);
294
+ }
295
+ async reqBodyReqJsonBody() {
296
+ const data = await this.reqBodyStringData();
297
+ return Object.assign(new ReqJsonBody(), data ? JSON.parse(data) : {});
298
+ }
299
+ // reqBodyReqMultipartFormBody(): Promise<ReqMultipartFormBody> {
300
+ // return this.reqBodyMultipartFormData().then(it => new ReqMultipartFormBody(it))
301
+ // }
302
+ resBodyJsonData() {
303
+ const data = ConvertUtils.toString(this.resBodyData());
304
+ return data ? JSON.parse(data) : null;
305
+ }
306
+ resBodyStringData() {
307
+ return ConvertUtils.toString(this.resBodyData());
308
+ }
309
+ reqMethod() {
310
+ return this.req.method?.toUpperCase();
311
+ }
312
+ reqHeader(key) {
313
+ return this.req.headers[key.toLowerCase()];
314
+ }
315
+ get reqHost() {
316
+ return this.reqHeaderFirst("Host" /* Host */);
317
+ }
318
+ get reqHeaderObj() {
319
+ const h = new ReqHeader();
320
+ Object.entries(this.req.headers).forEach(([k, v]) => {
321
+ h[k] = v;
322
+ });
323
+ return h;
324
+ }
325
+ reqHeaderFirst(key, defaultValue) {
326
+ const header = this.req.headers[key.toLowerCase()];
327
+ if (header && Array.isArray(header)) {
328
+ return header[0] ?? defaultValue;
329
+ } else {
330
+ return header ?? defaultValue;
331
+ }
332
+ }
333
+ reqAuthorizationHeader() {
334
+ return this.reqHeaderFirst("Authorization" /* Authorization */);
335
+ }
336
+ reqRefreshTokenHeader() {
337
+ return this.reqHeaderFirst("Authorization" /* Authorization */);
338
+ }
339
+ // eslint-disable-next-line no-dupe-class-members
340
+ resStatusCode(code) {
341
+ if (code) {
342
+ this.res.statusCode = code;
343
+ return new RequestResponseChain(this.req, this.res, this.config, this.res.statusCode);
344
+ } else {
345
+ return this.res.statusCode;
346
+ }
347
+ }
348
+ resHeader(key) {
349
+ return this.res.getHeader(key.toLowerCase());
350
+ }
351
+ resHeaderFirst(key, defaultValue) {
352
+ const header = this.res.getHeader(key.toLowerCase());
353
+ if (header && Array.isArray(header)) {
354
+ return header[0] ?? defaultValue;
355
+ } else {
356
+ return header ?? defaultValue;
357
+ }
358
+ }
359
+ async reqSession() {
360
+ if (this.config.sessionManager) {
361
+ return (await this.config.sessionManager.session(this)).dataSet.data;
362
+ } else {
363
+ return Promise.reject(new Error("Not SessionManager"));
364
+ }
365
+ }
366
+ reqSessionSet(key, value) {
367
+ this.reqSession[key] = value;
368
+ }
369
+ reqSessionGet(key) {
370
+ const session = this.reqSession;
371
+ if (session) {
372
+ return session[key];
373
+ }
374
+ }
375
+ resSetStatusCode(statusCode) {
376
+ this.res.statusCode = statusCode;
377
+ return this.createRequestResponseChain(this.res.statusCode);
378
+ }
379
+ // resEnd() {
380
+ // this.res.end();
381
+ // }
382
+ // eslint-disable-next-line no-undef
383
+ resWrite(chunk, encoding = "utf8") {
384
+ this.resWriteChunk = chunk;
385
+ return this.createRequestResponseChain(this.resWriteChunk);
386
+ }
387
+ // eslint-disable-next-line no-undef
388
+ resWriteJson(chunk, encoding = "utf8") {
389
+ return this.resWrite(JSON.stringify(chunk), encoding);
390
+ }
391
+ resSetHeader(key, value) {
392
+ return this.createRequestResponseChain(this.res.setHeader(key.toLowerCase(), value));
393
+ }
394
+ resAddHeader(key, value) {
395
+ const existingValue = this.res.getHeader(key.toLowerCase());
396
+ const newValue = Array.isArray(existingValue) ? existingValue.concat(value) : existingValue ? [existingValue.toString(), ...[].concat(value)] : value;
397
+ return this.createRequestResponseChain(this.res.setHeader(key.toLowerCase(), newValue));
398
+ }
399
+ resSetHeaders(headers) {
400
+ Object.entries(headers).forEach(([key, value]) => this.resSetHeader(key, value));
401
+ return this.createRequestResponseChain();
402
+ }
403
+ resAddHeaders(headers) {
404
+ Object.entries(headers).forEach(([key, value]) => this.resAddHeader(key, value));
405
+ return this.createRequestResponseChain();
406
+ }
407
+ // 마지막 종료될때 타는거.
408
+ async resEndChunk() {
409
+ const encoding = this.reqHeaderFirst("Accept-Encoding" /* AcceptEncoding */);
410
+ let data = this.resWriteChunk;
411
+ if (encoding?.includes("gzip")) {
412
+ data = await gzip(data);
413
+ this.resSetHeader("Content-Encoding" /* ContentEncoding */, "gzip");
414
+ }
415
+ this.res.end(data);
416
+ }
417
+ async resEnd(chunk) {
418
+ this.resWriteChunk = chunk ?? this.resWriteChunk;
419
+ if (this.req.readable) {
420
+ await this.reqBodyData();
421
+ await this.resEndChunk();
422
+ } else {
423
+ await this.resEndChunk();
424
+ }
425
+ }
426
+ // writeContinue(callback?: () => void) {
427
+ // this.res.writeContinue(callback);
428
+ // return new RequestResponseChain(this.req, this.res);
429
+ // }
430
+ // reqWrite(chunk?: any) {
431
+ // this.resWriteChunk = chunk;
432
+ // // this.res.write(chunk);
433
+ // return this.createRequestResponseChain();
434
+ // }
435
+ resWriteHead(statusCode, headers) {
436
+ return this.createRequestResponseChain(this.res.writeHead(statusCode, headers));
437
+ }
438
+ resWriteHeadEnd(statusCode, headers) {
439
+ this.createRequestResponseChain(this.res.writeHead(statusCode, headers));
440
+ this.res.end();
441
+ }
442
+ resIsDone() {
443
+ return this.res.finished || this.res.writableEnded || this.res.headersSent;
444
+ }
445
+ createRequestResponseChain(data) {
446
+ const requestResponseChain = new RequestResponseChain(this.req, this.res, this.config, data);
447
+ requestResponseChain.resWriteChunk = this.resWriteChunk;
448
+ requestResponseChain.reqBodyChunk = this.reqBodyChunk;
449
+ return requestResponseChain;
450
+ }
451
+ // res.on("readable", () => {
452
+ // console.log('readable???')
453
+ // });
454
+ // res.on('complete', function (details) {
455
+ // var size = details.req.bytes;
456
+ // console.log('complete-->', size)
457
+ // });
458
+ // res.on('finish', function() {
459
+ // console.log('finish??');
460
+ // });
461
+ // res.on('end', () => {
462
+ // console.log('end--?')
463
+ // });
464
+ };
465
+ var RequestResponseChain = class extends RequestResponse {
466
+ constructor(req, res, config, result) {
467
+ super(req, res, config);
468
+ this.result = result;
469
+ }
470
+ };
471
+ export {
472
+ RequestResponse,
473
+ RequestResponseChain
474
+ };
475
+ //# sourceMappingURL=RequestResponse.js.map