@powerhousedao/connect 6.0.0-dev.53 → 6.0.0-dev.54

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 (226) hide show
  1. package/dist/assets/AddDriveModal-CUlc2LVq.js +2 -0
  2. package/dist/assets/AddDriveModal-CUlc2LVq.js.map +1 -0
  3. package/dist/assets/AnalyticsSubscriptionManager-B5G_L5RP.js +3 -0
  4. package/dist/assets/AnalyticsSubscriptionManager-B5G_L5RP.js.map +1 -0
  5. package/dist/assets/ClearStorageModal-xiZInXK_.js +2 -0
  6. package/dist/assets/ClearStorageModal-xiZInXK_.js.map +1 -0
  7. package/dist/assets/CookiesPolicyModal-DVXJp787.js +2 -0
  8. package/dist/assets/CookiesPolicyModal-DVXJp787.js.map +1 -0
  9. package/dist/assets/CreateDocumentModal-Cjpq1PBD.js +2 -0
  10. package/dist/assets/CreateDocumentModal-Cjpq1PBD.js.map +1 -0
  11. package/dist/assets/DebugSettingsModal-BvEPWw2E.js +7 -0
  12. package/dist/assets/DebugSettingsModal-BvEPWw2E.js.map +1 -0
  13. package/dist/assets/DeleteDriveModal-BEq8v3-E.js +2 -0
  14. package/dist/assets/DeleteDriveModal-BEq8v3-E.js.map +1 -0
  15. package/dist/assets/DeleteItemModal-B3ziER8J.js +2 -0
  16. package/dist/assets/DeleteItemModal-B3ziER8J.js.map +1 -0
  17. package/dist/assets/DisclaimerModal-CFnBcICu.js +2 -0
  18. package/dist/assets/DisclaimerModal-CFnBcICu.js.map +1 -0
  19. package/dist/assets/DriveSettingsModal-BOdnkWJn.js +2 -0
  20. package/dist/assets/DriveSettingsModal-BOdnkWJn.js.map +1 -0
  21. package/dist/assets/ExportDocumentWithErrorsModal--uHwELhU.js +2 -0
  22. package/dist/assets/ExportDocumentWithErrorsModal--uHwELhU.js.map +1 -0
  23. package/dist/assets/SettingsModal-BntFjuQb.js +2 -0
  24. package/dist/assets/SettingsModal-BntFjuQb.js.map +1 -0
  25. package/dist/assets/UpgradeDriveModal-DmbwNsbG.js +2 -0
  26. package/dist/assets/UpgradeDriveModal-DmbwNsbG.js.map +1 -0
  27. package/dist/assets/__vite-browser-external-D7Ct-6yo.js +2 -0
  28. package/dist/assets/__vite-browser-external-D7Ct-6yo.js.map +1 -0
  29. package/dist/assets/_virtual_ph_external-packages-CM1tCR4L.js +1 -0
  30. package/dist/assets/_virtual_ph_external-packages-CM1tCR4L.js.map +1 -0
  31. package/dist/assets/analytics-2CJbiDed.js +3 -0
  32. package/dist/assets/analytics-2CJbiDed.js.map +1 -0
  33. package/dist/assets/ccip-BEAjQRKG.js +2 -0
  34. package/dist/assets/ccip-BEAjQRKG.js.map +1 -0
  35. package/dist/assets/confirmation-modal-BOwR5ZQq.js +2 -0
  36. package/dist/assets/confirmation-modal-BOwR5ZQq.js.map +1 -0
  37. package/dist/assets/core-BmuZEe8D.js +2 -0
  38. package/dist/assets/core-BmuZEe8D.js.map +1 -0
  39. package/dist/assets/disclosure-BhnV_XS1.js +2 -0
  40. package/dist/assets/disclosure-BhnV_XS1.js.map +1 -0
  41. package/dist/assets/drive-by-id-DvdlB_kB.js +2 -0
  42. package/dist/assets/drive-by-id-DvdlB_kB.js.map +1 -0
  43. package/dist/assets/drives-DjHuIXXn.js +2 -0
  44. package/dist/assets/drives-DjHuIXXn.js.map +1 -0
  45. package/dist/assets/dropdown-menu-BzZBDp_E.js +2 -0
  46. package/dist/assets/dropdown-menu-BzZBDp_E.js.map +1 -0
  47. package/dist/assets/editor-DBekHIfI.js +2 -0
  48. package/dist/assets/editor-DBekHIfI.js.map +1 -0
  49. package/dist/assets/editor-DV2TvDV5.js +46 -0
  50. package/dist/assets/editor-DV2TvDV5.js.map +1 -0
  51. package/dist/assets/exports-CQVZRuji.js +3 -0
  52. package/dist/assets/exports-CQVZRuji.js.map +1 -0
  53. package/dist/assets/form-input-CPs_z-6y.js +2 -0
  54. package/dist/assets/form-input-CPs_z-6y.js.map +1 -0
  55. package/dist/assets/graphql-editor-CcDLLpoK.js +74 -0
  56. package/dist/assets/graphql-editor-CcDLLpoK.js.map +1 -0
  57. package/dist/assets/hmr-BfH10IPs.js +2 -0
  58. package/dist/assets/hmr-BfH10IPs.js.map +1 -0
  59. package/dist/assets/hmr-LMNkvzP7.js +1 -0
  60. package/dist/assets/hmr-LMNkvzP7.js.map +1 -0
  61. package/dist/assets/{hooks-53pCkdY-.js → hooks--iZen3H-.js} +13 -12
  62. package/dist/assets/hooks--iZen3H-.js.map +1 -0
  63. package/dist/assets/index-BDI8rK1R.js +2 -0
  64. package/dist/assets/index-BDI8rK1R.js.map +1 -0
  65. package/dist/assets/index-BWgPOeS2.js +500 -0
  66. package/dist/assets/index-BWgPOeS2.js.map +1 -0
  67. package/dist/assets/index-BeyYTlkr.js +2 -0
  68. package/dist/assets/index-BeyYTlkr.js.map +1 -0
  69. package/dist/assets/index-CUlo2oTb.js +199 -0
  70. package/dist/assets/index-CUlo2oTb.js.map +1 -0
  71. package/dist/assets/index-DN20Z-2K.js +222 -0
  72. package/dist/assets/index-DN20Z-2K.js.map +1 -0
  73. package/dist/assets/index-DPCEN2cB.js +2 -0
  74. package/dist/assets/index-DPCEN2cB.js.map +1 -0
  75. package/dist/assets/index-DcvFnjR9.css +1 -0
  76. package/dist/assets/index-RTtoSfzq.js +2 -0
  77. package/dist/assets/index-RTtoSfzq.js.map +1 -0
  78. package/dist/assets/index-WdPlK4TH.js +32 -0
  79. package/dist/assets/index-WdPlK4TH.js.map +1 -0
  80. package/dist/assets/index.esm-BeYGM8vk.js +2 -0
  81. package/dist/assets/index.esm-BeYGM8vk.js.map +1 -0
  82. package/dist/assets/index.modern-BKQ3hpRq.js +2 -0
  83. package/dist/assets/index.modern-BKQ3hpRq.js.map +1 -0
  84. package/dist/assets/json-editor-CfHUc1UK.js +2 -0
  85. package/dist/assets/json-editor-CfHUc1UK.js.map +1 -0
  86. package/dist/assets/load-D23NmM_n.js +4 -0
  87. package/dist/assets/load-D23NmM_n.js.map +1 -0
  88. package/dist/assets/location-info-N8RPWokW.js +2 -0
  89. package/dist/assets/location-info-N8RPWokW.js.map +1 -0
  90. package/dist/assets/message-list-0i5gk_8j.js +2 -0
  91. package/dist/assets/message-list-0i5gk_8j.js.map +1 -0
  92. package/dist/assets/migrator-CmQyl4ZK.js +78 -0
  93. package/dist/assets/migrator-CmQyl4ZK.js.map +1 -0
  94. package/dist/assets/node-input-DnUl9CxT.js +2 -0
  95. package/dist/assets/node-input-DnUl9CxT.js.map +1 -0
  96. package/dist/assets/nodefs-BP-sxN1O.js +2 -0
  97. package/dist/assets/nodefs-BP-sxN1O.js.map +1 -0
  98. package/dist/assets/nodefs-_NvywCGz.js +1 -0
  99. package/dist/assets/nodefs-_NvywCGz.js.map +1 -0
  100. package/dist/assets/opfs-ahp-DN9nZuJs.js +1 -0
  101. package/dist/assets/opfs-ahp-DN9nZuJs.js.map +1 -0
  102. package/dist/assets/opfs-ahp-DtmzPaVs.js +4 -0
  103. package/dist/assets/opfs-ahp-DtmzPaVs.js.map +1 -0
  104. package/dist/assets/options-CBc6-sTL.js +2 -0
  105. package/dist/assets/options-CBc6-sTL.js.map +1 -0
  106. package/dist/assets/pglite.db-B2bT8QML.js +133 -0
  107. package/dist/assets/pglite.db-B2bT8QML.js.map +1 -0
  108. package/dist/assets/pglite.worker-Ca6pWokV.js +1 -0
  109. package/dist/assets/pglite.worker-Ca6pWokV.js.map +1 -0
  110. package/dist/assets/processor-host-module-B89Dt9nZ.js +3 -0
  111. package/dist/assets/processor-host-module-B89Dt9nZ.js.map +1 -0
  112. package/dist/assets/queue-CxFgA-r3.js +2 -0
  113. package/dist/assets/queue-CxFgA-r3.js.map +1 -0
  114. package/dist/assets/reactor-7tK-WVaY.js +16 -0
  115. package/dist/assets/reactor-7tK-WVaY.js.map +1 -0
  116. package/dist/assets/reactor-Bsjwm88i.js +193 -0
  117. package/dist/assets/reactor-Bsjwm88i.js.map +1 -0
  118. package/dist/assets/reactor-CRqBKYEo.css +1 -0
  119. package/dist/assets/read-required-modal-BKEkfucI.js +2 -0
  120. package/dist/assets/read-required-modal-BKEkfucI.js.map +1 -0
  121. package/dist/assets/renown-CgfQ6oBU.js +2 -0
  122. package/dist/assets/renown-CgfQ6oBU.js.map +1 -0
  123. package/dist/assets/state-schemas-DK8TnzfC.js +3 -0
  124. package/dist/assets/state-schemas-DK8TnzfC.js.map +1 -0
  125. package/dist/assets/tabs-DY_DEdtI.js +2 -0
  126. package/dist/assets/tabs-DY_DEdtI.js.map +1 -0
  127. package/dist/assets/use-get-switchboard-link-B47eB8lt.js +12 -0
  128. package/dist/assets/use-get-switchboard-link-B47eB8lt.js.map +1 -0
  129. package/dist/assets/user-permissions-BJ8c2UOP.js +2 -0
  130. package/dist/assets/user-permissions-BJ8c2UOP.js.map +1 -0
  131. package/dist/assets/vetra-Bu3fuZWc.js +221 -0
  132. package/dist/assets/vetra-Bu3fuZWc.js.map +1 -0
  133. package/dist/index.html +2 -20
  134. package/lib/package.copy.json +3 -4
  135. package/lib/src/components/app-loader.d.ts.map +1 -1
  136. package/lib/src/components/app-loader.js +5 -16
  137. package/lib/src/components/app-loader.js.map +1 -1
  138. package/lib/src/components/index.d.ts +0 -1
  139. package/lib/src/components/index.d.ts.map +1 -1
  140. package/lib/src/components/index.js +0 -1
  141. package/lib/src/components/index.js.map +1 -1
  142. package/lib/src/components/load.d.ts +8 -0
  143. package/lib/src/components/load.d.ts.map +1 -0
  144. package/lib/src/components/load.js +17 -0
  145. package/lib/src/components/load.js.map +1 -0
  146. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +1 -1
  147. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +2 -1
  148. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +1 -1
  149. package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts +1 -0
  150. package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts.map +1 -1
  151. package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js +2 -0
  152. package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js.map +1 -1
  153. package/lib/src/components/modal/modals/SettingsModal.d.ts.map +1 -1
  154. package/lib/src/components/modal/modals/SettingsModal.js +4 -1
  155. package/lib/src/components/modal/modals/SettingsModal.js.map +1 -1
  156. package/lib/src/components/modal/modals-container.d.ts +1 -1
  157. package/lib/src/components/modal/modals-container.d.ts.map +1 -1
  158. package/lib/src/components/modal/modals-container.js +12 -8
  159. package/lib/src/components/modal/modals-container.js.map +1 -1
  160. package/lib/src/main.js +3 -0
  161. package/lib/src/main.js.map +1 -1
  162. package/lib/src/services/storage/base-storage.d.ts.map +1 -1
  163. package/lib/src/services/storage/base-storage.js.map +1 -1
  164. package/lib/src/store/processor-host-module.d.ts.map +1 -1
  165. package/lib/src/store/processor-host-module.js +2 -2
  166. package/lib/src/store/processor-host-module.js.map +1 -1
  167. package/lib/src/store/reactor.d.ts.map +1 -1
  168. package/lib/src/store/reactor.js +1 -1
  169. package/lib/src/store/reactor.js.map +1 -1
  170. package/lib/style.css +15 -0
  171. package/lib/tsconfig.tsbuildinfo +1 -1
  172. package/lib/vite.config.d.ts.map +1 -1
  173. package/lib/vite.config.js +1 -29
  174. package/lib/vite.config.js.map +1 -1
  175. package/package.copy.json +3 -4
  176. package/package.json +12 -13
  177. package/dist/assets/AddDriveModal-BZ11MHBB.js +0 -1
  178. package/dist/assets/ClearStorageModal-BC3gq6BT.js +0 -1
  179. package/dist/assets/CookiesPolicyModal-Bdf-jIqf.js +0 -1
  180. package/dist/assets/CreateDocumentModal-CExWso4S.js +0 -1
  181. package/dist/assets/DebugSettingsModal-MIi3iDrt.js +0 -1
  182. package/dist/assets/DeleteDriveModal-Cj_y-Bmk.js +0 -1
  183. package/dist/assets/DeleteItemModal-DLPEfn21.js +0 -1
  184. package/dist/assets/DisclaimerModal-uqaE0dfB.js +0 -1
  185. package/dist/assets/DriveSettingsModal-0o6Em8ZV.js +0 -1
  186. package/dist/assets/ExportDocumentWithErrorsModal-BWd92B7i.js +0 -1
  187. package/dist/assets/SettingsModal-Ca4V2Rxs.js +0 -1
  188. package/dist/assets/UpgradeDriveModal-ByNuxxET.js +0 -1
  189. package/dist/assets/config-0mYxXHFp.js +0 -1
  190. package/dist/assets/design_system-Q9KmzSmh.js +0 -45
  191. package/dist/assets/design_system_connect-MVhUhmHT.js +0 -47
  192. package/dist/assets/design_system_ui-BQ-CYVFb.js +0 -1
  193. package/dist/assets/document_drive-DiwReQ7A.js +0 -154
  194. package/dist/assets/document_engineering-BMBT2RYA.js +0 -1
  195. package/dist/assets/document_model-ly1Z8uco.js +0 -241
  196. package/dist/assets/document_model_editor-D_cNq26d.js +0 -25
  197. package/dist/assets/drive_explorer-508O2XxT.js +0 -2
  198. package/dist/assets/editor-DAyyI5MD.js +0 -1
  199. package/dist/assets/graphql-BXSeDpaV.js +0 -75
  200. package/dist/assets/graphql-editor-Buhxp36K.js +0 -73
  201. package/dist/assets/graphql_request-BHyPFzlZ.js +0 -3
  202. package/dist/assets/index-B6A7sjLB.css +0 -1
  203. package/dist/assets/index-D0gnc_IY.js +0 -208
  204. package/dist/assets/index-DQyPoyxC.js +0 -149
  205. package/dist/assets/index-DnR9iRBe.js +0 -29
  206. package/dist/assets/json-editor-dXLfmMol.js +0 -1
  207. package/dist/assets/nodefs-2HQmaeC9.js +0 -1
  208. package/dist/assets/nodefs-DzAAA-1u.js +0 -1
  209. package/dist/assets/opfs-ahp-CwNbpJAw.js +0 -3
  210. package/dist/assets/opfs-ahp-xYZANhiQ.js +0 -3
  211. package/dist/assets/postgres-CkP7QCDB.data +0 -0
  212. package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
  213. package/dist/assets/react/jsx-runtime-DldvXD6N.js +0 -1
  214. package/dist/assets/react-D_vzfE_e.js +0 -1
  215. package/dist/assets/react-dom/client-SoBEzBdt.js +0 -9
  216. package/dist/assets/react-dom-Cz_KAjfm.js +0 -1
  217. package/dist/assets/reactor_browser-D2taHyRs.js +0 -136
  218. package/dist/assets/sentry_browser-TIBDlywD.js +0 -498
  219. package/dist/assets/sentry_react-CVx4Qq7f.js +0 -3
  220. package/dist/assets/state-schemas-C876MuV7.js +0 -2
  221. package/dist/assets/tailwind_merge-CXl88Wxt.js +0 -1
  222. package/dist/assets/zod-Cc38s6JG.js +0 -39
  223. package/lib/src/components/modal/index.d.ts +0 -18
  224. package/lib/src/components/modal/index.d.ts.map +0 -1
  225. package/lib/src/components/modal/index.js +0 -18
  226. package/lib/src/components/modal/index.js.map +0 -1
@@ -0,0 +1,199 @@
1
+ import{fn as Dw,gb as Ze,c1 as pe,cr as Fw}from"./index-DN20Z-2K.js";import{_ as Uw}from"./__vite-browser-external-D7Ct-6yo.js";import{W as w_,G as Qw}from"./reactor-Bsjwm88i.js";import{c as Hw,D as eh,A as th,P as Vw}from"./AnalyticsSubscriptionManager-B5G_L5RP.js";import"./vetra-Bu3fuZWc.js";import"./renown-CgfQ6oBU.js";import"./reactor-7tK-WVaY.js";import"./migrator-CmQyl4ZK.js";import"./queue-CxFgA-r3.js";import"./drives-DjHuIXXn.js";const ve=Dw(Uw);function Ww(a){return a.replace(/\w+/g,function(s){return s[0].toUpperCase()+s.slice(1)}).replace(/\s+/g,"")}class Gw{_executor;_knex;_subscriptionManager=new Hw;constructor({executor:s,knex:i}){this._executor=s,this._knex=i}destroy(){this._knex.destroy()}async clearSeriesBySource(s,i=!1){const n=this._knex("AnalyticsSeries").whereLike("source",s.toString("/%")).delete();let t=await this._executor.execute(n);return i&&(t+=await this.clearEmptyAnalyticsDimensions()),this._subscriptionManager.notifySubscribers([s]),t}async clearEmptyAnalyticsDimensions(){const s=this._knex("AnalyticsDimension AS AD").whereNotExists(i=>i.select("*").from("AnalyticsSeries_AnalyticsDimension AS ASAD").where("ASAD.dimensionId",this._knex.ref("AD.id"))).delete();return await this._executor.execute(s)}async getMatchingSeries(s){const i=s.currency?s.currency.firstSegment().filters:null,n=this._buildViewQuery("AV",Object.keys(s.select),s.metrics.map(r=>r),i,s.end),t=this._knex(this._knex.raw(n)).select("AV.*");for(const[r,e]of Object.entries(s.select))t.leftJoin(`AnalyticsDimension as ${r}`,c=>{c.on(`${r}.path`,`dim_${r}`)}),t.select(`${r}.icon as dim_icon`),t.select(`${r}.description as dim_description`),t.select(`${r}.label as dim_label`),e.length==1?t.andWhereLike(`dim_${r}`,e[0].toString("/%")):e.length>1&&t.andWhere(c=>(e.forEach(u=>c.orWhereLike(`dim_${r}`,u.toString("/%"))),c));t.orderBy("start");const o=await this._executor.execute(t);return this._formatQueryRecords(o,Object.keys(s.select))}async addSeriesValue(s){return this.addSeriesValues([s])}async addSeriesValues(s){const i={};for(let t=0;t<s.length;t++){const o=s[t],r=this._knex("AnalyticsSeries").insert({start:o.start.toJSDate(),end:o.end?o.end.toJSDate():null,source:o.source.toString("/"),metric:Ww(o.metric),value:o.value,unit:o.unit||null,fn:o.fn||"Single",params:o.params||null},"id"),e=await this._executor.execute(r);for(const[c,u]of Object.entries(s[t].dimensions||{})){i[c]||(i[c]={});const h=u.toString("/");i[c][h]||(i[c][h]=[]),i[c][h].push(e[0].id)}}for(const[t,o]of Object.entries(i))await this._linkDimensions(t,o);for(let t=0;t<s.length;t++){const o=s[t].dimensionMetadata;o&&await this.addDimensionMetadata(o.path,o.icon,o.label,o.description)}const n=s.map(t=>t.source);this._subscriptionManager.notifySubscribers(n)}_formatQueryRecords(s,i){return s.map(t=>{const o={id:t.id,source:th.fromString(t.source.slice(0,-1)),start:eh.fromJSDate(t.start),end:t.end?eh.fromJSDate(t.end):null,metric:t.metric,value:t.value,unit:t.unit,fn:t.fn,params:t.params,dimensions:{}};return i.forEach(r=>o.dimensions[r]={path:th.fromString(t[`dim_${r}`]?t[`dim_${r}`].slice(0,-1):"?"),icon:t.dim_icon?t.dim_icon:"",label:t.dim_label?t.dim_label:"",description:t.dim_description?t.dim_description:""}),o}).sort((t,o)=>t.id-o.id)}_buildViewQuery(s,i,n,t,o){const r=this._knex("AnalyticsSeries as AS_inner").select("*").whereIn("metric",n);for(const e of i)r.select(this._buildDimensionQuery(e));return t&&t.length>0&&t[0]!==""&&r.whereIn("unit",t),o&&r.where("start","<",o.toISO()),`(${r.toString()}) AS "${s}"`}_buildDimensionQuery(s){const i=this._knex.ref("AS_inner.id");return this._knex("AnalyticsSeries_AnalyticsDimension as ASAD").leftJoin("AnalyticsDimension as AD","AD.id","ASAD.dimensionId").where("ASAD.seriesId",i).where("AD.dimension",s).select("path").as(`dim_${s}`)}async _linkDimensions(s,i){const n=this._knex("AnalyticsDimension").select("path","id").where("dimension",s).whereIn("path",Object.keys(i)),t=await this._executor.execute(n);for(const[o,r]of Object.entries(i)){const e=t.findIndex(u=>u.path==o),c=e<0?await this._createDimensionPath(s,o):t[e].id;for(let u=0;u<r.length;u++){const h=this._knex("AnalyticsSeries_AnalyticsDimension").insert({seriesId:r[u],dimensionId:c});await this._executor.execute(h)}}}async _createDimensionPath(s,i){const n=this._knex("AnalyticsDimension").insert({dimension:s,path:i},"id");return(await this._executor.execute(n))[0].id}async addDimensionMetadata(s,i,n,t){if(!i&&!n&&!t)return;const o=this._knex("AnalyticsDimension").where("path",`${s.toString()}/`).update({icon:i||"",label:n||"",description:t||""});await this._executor.execute(o)}async getDimensions(){const s=this._knex.select("dimension","path","icon","label","description").from("AnalyticsDimension").whereNotNull("path").whereNot("path","").whereNot("path","/"),n=(await this._executor.execute(s)).reduce((o,r)=>(o[r.dimension]||(o[r.dimension]={name:r.dimension,values:[]}),o[r.dimension].values.push({path:r.path,icon:r.icon,label:r.label,description:r.description}),o),{});return Object.values(n)}async getMetrics(){const s=this._knex("AnalyticsSeries").select("metric").distinct().whereNotNull("metric"),n=(await this._executor.execute(s)).map(o=>o.metric);return["Budget","Forecast","Actuals","PaymentsOnChain","PaymentsOffChainIncluded"].forEach(o=>{n.includes(o)||n.push(o)}),n}async getCurrencies(){const s=this._knex("AnalyticsSeries").select("unit").distinct().whereNotNull("unit");return(await this._executor.execute(s)).map(n=>n.unit)}subscribeToSource(s,i){return this._subscriptionManager.subscribeToPath(s,i)}}var Ot={exports:{}},Nt={},It={},$t={},rh;function v_(){if(rh)return $t;rh=1,Object.defineProperty($t,"__esModule",{value:!0});let a=class extends Error{};return $t.TimeoutError=a,$t}var Se={},xt={},nh;function zw(){if(nh)return xt;nh=1,Object.defineProperty(xt,"__esModule",{value:!0});let a=class{constructor(i){this._value=i.value,this._error=i.error}value(){return this._value}reason(){return this._error}isRejected(){return!!this._error}isFulfilled(){return!!this._value}};return xt.PromiseInspection=a,xt}var ih;function yc(){if(ih)return Se;ih=1,Object.defineProperty(Se,"__esModule",{value:!0});const a=zw();function s(){let u=null,h=null;return{promise:new Promise((f,p)=>{u=f,h=p}),resolve:u,reject:h}}Se.defer=s;function i(){return Date.now()}Se.now=i;function n(u,h){return Math.abs(h-u)}Se.duration=n;function t(u){return typeof u>"u"?!0:o(u)}Se.checkOptionalTime=t;function o(u){return typeof u=="number"&&u===Math.round(u)&&u>0}Se.checkRequiredTime=o;function r(u){return new Promise(h=>setTimeout(h,u))}Se.delay=r;function e(u){return u.then(h=>new a.PromiseInspection({value:h})).catch(h=>new a.PromiseInspection({error:h}))}Se.reflect=e;function c(u){try{const h=u();return Promise.resolve(h)}catch(h){return Promise.reject(h)}}return Se.tryPromise=c,Se}var sh;function Kw(){if(sh)return It;sh=1,Object.defineProperty(It,"__esModule",{value:!0});const a=v_(),s=yc();let i=class{constructor(o){this.timeoutMillis=o,this.deferred=s.defer(),this.possibleTimeoutCause=null,this.isRejected=!1,this.promise=n(this.deferred.promise,o).catch(r=>(r instanceof a.TimeoutError&&(this.possibleTimeoutCause?r=new a.TimeoutError(this.possibleTimeoutCause.message):r=new a.TimeoutError("operation timed out for an unknown reason")),this.isRejected=!0,Promise.reject(r)))}abort(){this.reject(new Error("aborted"))}reject(o){this.deferred.reject(o)}resolve(o){this.deferred.resolve(o)}};It.PendingOperation=i;function n(t,o){return new Promise((r,e)=>{const c=setTimeout(()=>e(new a.TimeoutError),o);t.then(u=>{clearTimeout(c),r(u)}).catch(u=>{clearTimeout(c),e(u)})})}return It}var Pt={},oh;function Jw(){if(oh)return Pt;oh=1,Object.defineProperty(Pt,"__esModule",{value:!0});const a=yc();let s=class C_{constructor(n){this.resource=n,this.resource=n,this.timestamp=a.now(),this.deferred=a.defer()}get promise(){return this.deferred.promise}resolve(){return this.deferred.resolve(void 0),new C_(this.resource)}};return Pt.Resource=s,Pt}var jt={exports:{}},ah;function ke(){if(ah)return jt.exports;ah=1;var a=typeof Reflect=="object"?Reflect:null,s=a&&typeof a.apply=="function"?a.apply:function(q,E,R){return Function.prototype.apply.call(q,E,R)},i;a&&typeof a.ownKeys=="function"?i=a.ownKeys:Object.getOwnPropertySymbols?i=function(q){return Object.getOwnPropertyNames(q).concat(Object.getOwnPropertySymbols(q))}:i=function(q){return Object.getOwnPropertyNames(q)};function n(_){console&&console.warn&&console.warn(_)}var t=Number.isNaN||function(q){return q!==q};function o(){o.init.call(this)}jt.exports=o,jt.exports.once=g,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var r=10;function e(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(_){if(typeof _!="number"||_<0||t(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");r=_}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(q){if(typeof q!="number"||q<0||t(q))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+q+".");return this._maxListeners=q,this};function c(_){return _._maxListeners===void 0?o.defaultMaxListeners:_._maxListeners}o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(q){for(var E=[],R=1;R<arguments.length;R++)E.push(arguments[R]);var $=q==="error",M=this._events;if(M!==void 0)$=$&&M.error===void 0;else if(!$)return!1;if($){var v;if(E.length>0&&(v=E[0]),v instanceof Error)throw v;var T=new Error("Unhandled error."+(v?" ("+v.message+")":""));throw T.context=v,T}var B=M[q];if(B===void 0)return!1;if(typeof B=="function")s(B,this,E);else for(var F=B.length,y=w(B,F),R=0;R<F;++R)s(y[R],this,E);return!0};function u(_,q,E,R){var $,M,v;if(e(E),M=_._events,M===void 0?(M=_._events=Object.create(null),_._eventsCount=0):(M.newListener!==void 0&&(_.emit("newListener",q,E.listener?E.listener:E),M=_._events),v=M[q]),v===void 0)v=M[q]=E,++_._eventsCount;else if(typeof v=="function"?v=M[q]=R?[E,v]:[v,E]:R?v.unshift(E):v.push(E),$=c(_),$>0&&v.length>$&&!v.warned){v.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(q)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=_,T.type=q,T.count=v.length,n(T)}return _}o.prototype.addListener=function(q,E){return u(this,q,E,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(q,E){return u(this,q,E,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(_,q,E){var R={fired:!1,wrapFn:void 0,target:_,type:q,listener:E},$=h.bind(R);return $.listener=E,R.wrapFn=$,$}o.prototype.once=function(q,E){return e(E),this.on(q,l(this,q,E)),this},o.prototype.prependOnceListener=function(q,E){return e(E),this.prependListener(q,l(this,q,E)),this},o.prototype.removeListener=function(q,E){var R,$,M,v,T;if(e(E),$=this._events,$===void 0)return this;if(R=$[q],R===void 0)return this;if(R===E||R.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete $[q],$.removeListener&&this.emit("removeListener",q,R.listener||E));else if(typeof R!="function"){for(M=-1,v=R.length-1;v>=0;v--)if(R[v]===E||R[v].listener===E){T=R[v].listener,M=v;break}if(M<0)return this;M===0?R.shift():C(R,M),R.length===1&&($[q]=R[0]),$.removeListener!==void 0&&this.emit("removeListener",q,T||E)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(q){var E,R,$;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[q]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[q]),this;if(arguments.length===0){var M=Object.keys(R),v;for($=0;$<M.length;++$)v=M[$],v!=="removeListener"&&this.removeAllListeners(v);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=R[q],typeof E=="function")this.removeListener(q,E);else if(E!==void 0)for($=E.length-1;$>=0;$--)this.removeListener(q,E[$]);return this};function f(_,q,E){var R=_._events;if(R===void 0)return[];var $=R[q];return $===void 0?[]:typeof $=="function"?E?[$.listener||$]:[$]:E?m($):w($,$.length)}o.prototype.listeners=function(q){return f(this,q,!0)},o.prototype.rawListeners=function(q){return f(this,q,!1)},o.listenerCount=function(_,q){return typeof _.listenerCount=="function"?_.listenerCount(q):p.call(_,q)},o.prototype.listenerCount=p;function p(_){var q=this._events;if(q!==void 0){var E=q[_];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function w(_,q){for(var E=new Array(q),R=0;R<q;++R)E[R]=_[R];return E}function C(_,q){for(;q+1<_.length;q++)_[q]=_[q+1];_.pop()}function m(_){for(var q=new Array(_.length),E=0;E<q.length;++E)q[E]=_[E].listener||_[E];return q}function g(_,q){return new Promise(function(E,R){function $(v){_.removeListener(q,M),R(v)}function M(){typeof _.removeListener=="function"&&_.removeListener("error",$),E([].slice.call(arguments))}b(_,q,M,{once:!0}),q!=="error"&&d(_,$,{once:!0})})}function d(_,q,E){typeof _.on=="function"&&b(_,"error",q,E)}function b(_,q,E,R){if(typeof _.on=="function")R.once?_.once(q,E):_.on(q,E);else if(typeof _.addEventListener=="function")_.addEventListener(q,function $(M){R.once&&_.removeEventListener(q,$),E(M)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return jt.exports}var uh;function Yw(){if(uh)return Nt;uh=1,Object.defineProperty(Nt,"__esModule",{value:!0});const a=Kw(),s=Jw(),i=yc(),n=ke(),t=ve;let o=class{constructor(u){if(this.destroyed=!1,this.emitter=new n.EventEmitter,u=u||{},!u.create)throw new Error("Tarn: opt.create function most be provided");if(!u.destroy)throw new Error("Tarn: opt.destroy function most be provided");if(typeof u.min!="number"||u.min<0||u.min!==Math.round(u.min))throw new Error("Tarn: opt.min must be an integer >= 0");if(typeof u.max!="number"||u.max<=0||u.max!==Math.round(u.max))throw new Error("Tarn: opt.max must be an integer > 0");if(u.min>u.max)throw new Error("Tarn: opt.max is smaller than opt.min");if(!i.checkOptionalTime(u.acquireTimeoutMillis))throw new Error("Tarn: invalid opt.acquireTimeoutMillis "+JSON.stringify(u.acquireTimeoutMillis));if(!i.checkOptionalTime(u.createTimeoutMillis))throw new Error("Tarn: invalid opt.createTimeoutMillis "+JSON.stringify(u.createTimeoutMillis));if(!i.checkOptionalTime(u.destroyTimeoutMillis))throw new Error("Tarn: invalid opt.destroyTimeoutMillis "+JSON.stringify(u.destroyTimeoutMillis));if(!i.checkOptionalTime(u.idleTimeoutMillis))throw new Error("Tarn: invalid opt.idleTimeoutMillis "+JSON.stringify(u.idleTimeoutMillis));if(!i.checkOptionalTime(u.reapIntervalMillis))throw new Error("Tarn: invalid opt.reapIntervalMillis "+JSON.stringify(u.reapIntervalMillis));if(!i.checkOptionalTime(u.createRetryIntervalMillis))throw new Error("Tarn: invalid opt.createRetryIntervalMillis "+JSON.stringify(u.createRetryIntervalMillis));const h={create:!0,validate:!0,destroy:!0,log:!0,min:!0,max:!0,acquireTimeoutMillis:!0,createTimeoutMillis:!0,destroyTimeoutMillis:!0,idleTimeoutMillis:!0,reapIntervalMillis:!0,createRetryIntervalMillis:!0,propagateCreateError:!0};for(const l of Object.keys(u))if(!h[l])throw new Error(`Tarn: unsupported option opt.${l}`);this.creator=u.create,this.destroyer=u.destroy,this.validate=typeof u.validate=="function"?u.validate:()=>!0,this.log=u.log||(()=>{}),this.acquireTimeoutMillis=u.acquireTimeoutMillis||3e4,this.createTimeoutMillis=u.createTimeoutMillis||3e4,this.destroyTimeoutMillis=u.destroyTimeoutMillis||5e3,this.idleTimeoutMillis=u.idleTimeoutMillis||3e4,this.reapIntervalMillis=u.reapIntervalMillis||1e3,this.createRetryIntervalMillis=u.createRetryIntervalMillis||200,this.propagateCreateError=!!u.propagateCreateError,this.min=u.min,this.max=u.max,this.used=[],this.free=[],this.pendingCreates=[],this.pendingAcquires=[],this.pendingDestroys=[],this.pendingValidations=[],this.destroyed=!1,this.interval=null,this.eventId=1}numUsed(){return this.used.length}numFree(){return this.free.length}numPendingAcquires(){return this.pendingAcquires.length}numPendingValidations(){return this.pendingValidations.length}numPendingCreates(){return this.pendingCreates.length}acquire(){const u=this.eventId++;this._executeEventHandlers("acquireRequest",u);const h=new a.PendingOperation(this.acquireTimeoutMillis);return this.pendingAcquires.push(h),h.promise=h.promise.then(l=>(this._executeEventHandlers("acquireSuccess",u,l),l)).catch(l=>(this._executeEventHandlers("acquireFail",u,l),r(this.pendingAcquires,h),Promise.reject(l))),this._tryAcquireOrCreate(),h}release(u){this._executeEventHandlers("release",u);for(let h=0,l=this.used.length;h<l;++h){const f=this.used[h];if(f.resource===u)return this.used.splice(h,1),this.free.push(f.resolve()),this._tryAcquireOrCreate(),!0}return!1}isEmpty(){return[this.numFree(),this.numUsed(),this.numPendingAcquires(),this.numPendingValidations(),this.numPendingCreates()].reduce((u,h)=>u+h)===0}check(){const u=i.now(),h=[],l=this.min-this.used.length,f=this.free.length-l;let p=0;this.free.forEach(w=>{i.duration(u,w.timestamp)>=this.idleTimeoutMillis&&p<f?(p++,this._destroy(w.resource)):h.push(w)}),this.free=h,this.isEmpty()&&this._stopReaping()}destroy(){const u=this.eventId++;return this._executeEventHandlers("poolDestroyRequest",u),this._stopReaping(),this.destroyed=!0,i.reflect(Promise.all(this.pendingCreates.map(h=>i.reflect(h.promise))).then(()=>new Promise((h,l)=>{if(this.numPendingValidations()===0){h();return}const f=setInterval(()=>{this.numPendingValidations()===0&&(t.clearInterval(f),h())},100)})).then(()=>Promise.all(this.used.map(h=>i.reflect(h.promise)))).then(()=>Promise.all(this.pendingAcquires.map(h=>(h.abort(),i.reflect(h.promise))))).then(()=>Promise.all(this.free.map(h=>i.reflect(this._destroy(h.resource))))).then(()=>Promise.all(this.pendingDestroys.map(h=>h.promise))).then(()=>{this.free=[],this.pendingAcquires=[]})).then(h=>(this._executeEventHandlers("poolDestroySuccess",u),this.emitter.removeAllListeners(),h))}on(u,h){this.emitter.on(u,h)}removeListener(u,h){this.emitter.removeListener(u,h)}removeAllListeners(u){this.emitter.removeAllListeners(u)}_tryAcquireOrCreate(){this.destroyed||(this._hasFreeResources()?this._doAcquire():this._shouldCreateMoreResources()&&this._doCreate())}_hasFreeResources(){return this.free.length>0}_doAcquire(){for(;this._canAcquire();){const u=this.pendingAcquires.shift(),h=this.free.pop();if(h===void 0||u===void 0){const f="this.free was empty while trying to acquire resource";throw this.log(`Tarn: ${f}`,"warn"),new Error(`Internal error, should never happen. ${f}`)}this.pendingValidations.push(u),this.used.push(h);const l=new a.PendingOperation(this.acquireTimeoutMillis);u.promise.catch(f=>{l.abort()}),l.promise.catch(f=>(this.log("Tarn: resource validator threw an exception "+f.stack,"warn"),!1)).then(f=>{try{f&&!u.isRejected?(this._startReaping(),u.resolve(h.resource)):(r(this.used,h),f?this.free.push(h):(this._destroy(h.resource),setTimeout(()=>{this._tryAcquireOrCreate()},0)),u.isRejected||this.pendingAcquires.unshift(u))}finally{r(this.pendingValidations,u)}}),this._validateResource(h.resource).then(f=>{l.resolve(f)}).catch(f=>{l.reject(f)})}}_canAcquire(){return this.free.length>0&&this.pendingAcquires.length>0}_validateResource(u){try{return Promise.resolve(this.validate(u))}catch(h){return Promise.reject(h)}}_shouldCreateMoreResources(){return this.used.length+this.pendingCreates.length<this.max&&this.pendingCreates.length<this.pendingAcquires.length}_doCreate(){const u=this.pendingAcquires.slice();this._create().promise.then(()=>(this._tryAcquireOrCreate(),null)).catch(l=>{this.propagateCreateError&&this.pendingAcquires.length!==0&&this.pendingAcquires[0].reject(l),u.forEach(f=>{f.possibleTimeoutCause=l}),i.delay(this.createRetryIntervalMillis).then(()=>this._tryAcquireOrCreate())})}_create(){const u=this.eventId++;this._executeEventHandlers("createRequest",u);const h=new a.PendingOperation(this.createTimeoutMillis);return h.promise=h.promise.catch(l=>{throw r(this.pendingCreates,h)&&this._executeEventHandlers("createFail",u,l),l}),this.pendingCreates.push(h),e(this.creator).then(l=>h.isRejected?(this.destroyer(l),null):(r(this.pendingCreates,h),this.free.push(new s.Resource(l)),h.resolve(l),this._executeEventHandlers("createSuccess",u,l),null)).catch(l=>(h.isRejected||(r(this.pendingCreates,h)&&this._executeEventHandlers("createFail",u,l),h.reject(l)),null)),h}_destroy(u){const h=this.eventId++;this._executeEventHandlers("destroyRequest",h,u);const l=new a.PendingOperation(this.destroyTimeoutMillis);return Promise.resolve().then(()=>this.destroyer(u)).then(()=>{l.resolve(u)}).catch(p=>{l.reject(p)}),this.pendingDestroys.push(l),l.promise.then(p=>(this._executeEventHandlers("destroySuccess",h,u),p)).catch(p=>this._logDestroyerError(h,u,p)).then(p=>{const w=this.pendingDestroys.findIndex(C=>C===l);return this.pendingDestroys.splice(w,1),p})}_logDestroyerError(u,h,l){this._executeEventHandlers("destroyFail",u,h,l),this.log("Tarn: resource destroyer threw an exception "+l.stack,"warn")}_startReaping(){this.interval||(this._executeEventHandlers("startReaping"),this.interval=setInterval(()=>this.check(),this.reapIntervalMillis))}_stopReaping(){this.interval!==null&&(this._executeEventHandlers("stopReaping"),t.clearInterval(this.interval)),this.interval=null}_executeEventHandlers(u,...h){this.emitter.listeners(u).forEach(f=>{try{f(...h)}catch(p){this.log(`Tarn: event handler "${u}" threw an exception ${p.stack}`,"warn")}})}};Nt.Pool=o;function r(c,u){const h=c.indexOf(u);return h===-1?!1:(c.splice(h,1),!0)}function e(c){return new Promise((u,h)=>{const l=(f,p)=>{f?h(f):u(p)};i.tryPromise(()=>c(l)).then(f=>{f&&u(f)}).catch(f=>{h(f)})})}return Nt}var lh;function Xw(){return lh||(lh=1,(function(a,s){Object.defineProperty(s,"__esModule",{value:!0});const i=Yw();s.Pool=i.Pool;const n=v_();s.TimeoutError=n.TimeoutError,a.exports={Pool:i.Pool,TimeoutError:n.TimeoutError}})(Ot,Ot.exports)),Ot.exports}var dr={},pr={},mr,ch;function bc(){return ch||(ch=1,mr=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var s={},i=Symbol("test"),n=Object(i);if(typeof i=="string"||Object.prototype.toString.call(i)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var t=42;s[i]=t;for(var o in s)return!1;if(typeof Object.keys=="function"&&Object.keys(s).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(s).length!==0)return!1;var r=Object.getOwnPropertySymbols(s);if(r.length!==1||r[0]!==i||!Object.prototype.propertyIsEnumerable.call(s,i))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var e=Object.getOwnPropertyDescriptor(s,i);if(e.value!==t||e.enumerable!==!0)return!1}return!0}),mr}var gr,hh;function Dt(){if(hh)return gr;hh=1;var a=bc();return gr=function(){return a()&&!!Symbol.toStringTag},gr}var yr,fh;function _c(){return fh||(fh=1,yr=Object),yr}var br,dh;function Zw(){return dh||(dh=1,br=Error),br}var _r,ph;function ev(){return ph||(ph=1,_r=EvalError),_r}var wr,mh;function tv(){return mh||(mh=1,wr=RangeError),wr}var vr,gh;function rv(){return gh||(gh=1,vr=ReferenceError),vr}var Cr,yh;function q_(){return yh||(yh=1,Cr=SyntaxError),Cr}var qr,bh;function wt(){return bh||(bh=1,qr=TypeError),qr}var Er,_h;function nv(){return _h||(_h=1,Er=URIError),Er}var Ar,wh;function iv(){return wh||(wh=1,Ar=Math.abs),Ar}var Rr,vh;function sv(){return vh||(vh=1,Rr=Math.floor),Rr}var Tr,Ch;function ov(){return Ch||(Ch=1,Tr=Math.max),Tr}var Sr,qh;function av(){return qh||(qh=1,Sr=Math.min),Sr}var Or,Eh;function uv(){return Eh||(Eh=1,Or=Math.pow),Or}var Nr,Ah;function lv(){return Ah||(Ah=1,Nr=Math.round),Nr}var Ir,Rh;function cv(){return Rh||(Rh=1,Ir=Number.isNaN||function(s){return s!==s}),Ir}var $r,Th;function hv(){if(Th)return $r;Th=1;var a=cv();return $r=function(i){return a(i)||i===0?i:i<0?-1:1},$r}var xr,Sh;function fv(){return Sh||(Sh=1,xr=Object.getOwnPropertyDescriptor),xr}var Pr,Oh;function rt(){if(Oh)return Pr;Oh=1;var a=fv();if(a)try{a([],"length")}catch{a=null}return Pr=a,Pr}var jr,Nh;function Ft(){if(Nh)return jr;Nh=1;var a=Object.defineProperty||!1;if(a)try{a({},"a",{value:1})}catch{a=!1}return jr=a,jr}var Lr,Ih;function dv(){if(Ih)return Lr;Ih=1;var a=typeof Symbol<"u"&&Symbol,s=bc();return Lr=function(){return typeof a!="function"||typeof Symbol!="function"||typeof a("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:s()},Lr}var Br,$h;function E_(){return $h||($h=1,Br=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Br}var Mr,xh;function A_(){if(xh)return Mr;xh=1;var a=_c();return Mr=a.getPrototypeOf||null,Mr}var kr,Ph;function pv(){if(Ph)return kr;Ph=1;var a="Function.prototype.bind called on incompatible ",s=Object.prototype.toString,i=Math.max,n="[object Function]",t=function(c,u){for(var h=[],l=0;l<c.length;l+=1)h[l]=c[l];for(var f=0;f<u.length;f+=1)h[f+c.length]=u[f];return h},o=function(c,u){for(var h=[],l=u,f=0;l<c.length;l+=1,f+=1)h[f]=c[l];return h},r=function(e,c){for(var u="",h=0;h<e.length;h+=1)u+=e[h],h+1<e.length&&(u+=c);return u};return kr=function(c){var u=this;if(typeof u!="function"||s.apply(u)!==n)throw new TypeError(a+u);for(var h=o(arguments,1),l,f=function(){if(this instanceof l){var g=u.apply(this,t(h,arguments));return Object(g)===g?g:this}return u.apply(c,t(h,arguments))},p=i(0,u.length-h.length),w=[],C=0;C<p;C++)w[C]="$"+C;if(l=Function("binder","return function ("+r(w,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var m=function(){};m.prototype=u.prototype,l.prototype=new m,m.prototype=null}return l},kr}var Dr,jh;function vt(){if(jh)return Dr;jh=1;var a=pv();return Dr=Function.prototype.bind||a,Dr}var Fr,Lh;function wc(){return Lh||(Lh=1,Fr=Function.prototype.call),Fr}var Ur,Bh;function vc(){return Bh||(Bh=1,Ur=Function.prototype.apply),Ur}var Qr,Mh;function mv(){return Mh||(Mh=1,Qr=typeof Reflect<"u"&&Reflect&&Reflect.apply),Qr}var Hr,kh;function R_(){if(kh)return Hr;kh=1;var a=vt(),s=vc(),i=wc(),n=mv();return Hr=n||a.call(i,s),Hr}var Vr,Dh;function Cc(){if(Dh)return Vr;Dh=1;var a=vt(),s=wt(),i=wc(),n=R_();return Vr=function(o){if(o.length<1||typeof o[0]!="function")throw new s("a function is required");return n(a,i,o)},Vr}var Wr,Fh;function gv(){if(Fh)return Wr;Fh=1;var a=Cc(),s=rt(),i;try{i=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var n=!!i&&s&&s(Object.prototype,"__proto__"),t=Object,o=t.getPrototypeOf;return Wr=n&&typeof n.get=="function"?a([n.get]):typeof o=="function"?function(e){return o(e==null?e:t(e))}:!1,Wr}var Gr,Uh;function qc(){if(Uh)return Gr;Uh=1;var a=E_(),s=A_(),i=gv();return Gr=a?function(t){return a(t)}:s?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return s(t)}:i?function(t){return i(t)}:null,Gr}var zr,Qh;function T_(){if(Qh)return zr;Qh=1;var a=Function.prototype.call,s=Object.prototype.hasOwnProperty,i=vt();return zr=i.call(a,s),zr}var Kr,Hh;function Ec(){if(Hh)return Kr;Hh=1;var a,s=_c(),i=Zw(),n=ev(),t=tv(),o=rv(),r=q_(),e=wt(),c=nv(),u=iv(),h=sv(),l=ov(),f=av(),p=uv(),w=lv(),C=hv(),m=Function,g=function(W){try{return m('"use strict"; return ('+W+").constructor;")()}catch{}},d=rt(),b=Ft(),_=function(){throw new e},q=d?(function(){try{return arguments.callee,_}catch{try{return d(arguments,"callee").get}catch{return _}}})():_,E=dv()(),R=qc(),$=A_(),M=E_(),v=vc(),T=wc(),B={},F=typeof Uint8Array>"u"||!R?a:R(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?a:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?a:ArrayBuffer,"%ArrayIteratorPrototype%":E&&R?R([][Symbol.iterator]()):a,"%AsyncFromSyncIteratorPrototype%":a,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?a:Atomics,"%BigInt%":typeof BigInt>"u"?a:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?a:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?a:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?a:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?a:Float16Array,"%Float32Array%":typeof Float32Array>"u"?a:Float32Array,"%Float64Array%":typeof Float64Array>"u"?a:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?a:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?a:Int8Array,"%Int16Array%":typeof Int16Array>"u"?a:Int16Array,"%Int32Array%":typeof Int32Array>"u"?a:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&R?R(R([][Symbol.iterator]())):a,"%JSON%":typeof JSON=="object"?JSON:a,"%Map%":typeof Map>"u"?a:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!R?a:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":s,"%Object.getOwnPropertyDescriptor%":d,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?a:Promise,"%Proxy%":typeof Proxy>"u"?a:Proxy,"%RangeError%":t,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?a:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?a:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!R?a:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?a:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&R?R(""[Symbol.iterator]()):a,"%Symbol%":E?Symbol:a,"%SyntaxError%":r,"%ThrowTypeError%":q,"%TypedArray%":F,"%TypeError%":e,"%Uint8Array%":typeof Uint8Array>"u"?a:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?a:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?a:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?a:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?a:WeakMap,"%WeakRef%":typeof WeakRef>"u"?a:WeakRef,"%WeakSet%":typeof WeakSet>"u"?a:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":v,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":$,"%Math.abs%":u,"%Math.floor%":h,"%Math.max%":l,"%Math.min%":f,"%Math.pow%":p,"%Math.round%":w,"%Math.sign%":C,"%Reflect.getPrototypeOf%":M};if(R)try{null.error}catch(W){var A=R(R(W));y["%Error.prototype%"]=A}var j=function W(J){var re;if(J==="%AsyncFunction%")re=g("async function () {}");else if(J==="%GeneratorFunction%")re=g("function* () {}");else if(J==="%AsyncGeneratorFunction%")re=g("async function* () {}");else if(J==="%AsyncGenerator%"){var ie=W("%AsyncGeneratorFunction%");ie&&(re=ie.prototype)}else if(J==="%AsyncIteratorPrototype%"){var se=W("%AsyncGenerator%");se&&R&&(re=R(se.prototype))}return y[J]=re,re},Y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ee=vt(),H=T_(),N=ee.call(T,Array.prototype.concat),V=ee.call(v,Array.prototype.splice),K=ee.call(T,String.prototype.replace),x=ee.call(T,String.prototype.slice),S=ee.call(T,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,X=function(J){var re=x(J,0,1),ie=x(J,-1);if(re==="%"&&ie!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(ie==="%"&&re!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var se=[];return K(J,I,function(P,Q,ae,oe){se[se.length]=ae?K(oe,k,"$1"):Q||P}),se},z=function(J,re){var ie=J,se;if(H(Y,ie)&&(se=Y[ie],ie="%"+se[0]+"%"),H(y,ie)){var P=y[ie];if(P===B&&(P=j(ie)),typeof P>"u"&&!re)throw new e("intrinsic "+J+" exists, but is not available. Please file an issue!");return{alias:se,name:ie,value:P}}throw new r("intrinsic "+J+" does not exist!")};return Kr=function(J,re){if(typeof J!="string"||J.length===0)throw new e("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof re!="boolean")throw new e('"allowMissing" argument must be a boolean');if(S(/^%?[^%]*%?$/,J)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ie=X(J),se=ie.length>0?ie[0]:"",P=z("%"+se+"%",re),Q=P.name,ae=P.value,oe=!1,de=P.alias;de&&(se=de[0],V(ie,N([0,1],de)));for(var G=1,we=!0;G<ie.length;G+=1){var ce=ie[G],ge=x(ce,0,1),le=x(ce,-1);if((ge==='"'||ge==="'"||ge==="`"||le==='"'||le==="'"||le==="`")&&ge!==le)throw new r("property names with quotes must have matching quotes");if((ce==="constructor"||!we)&&(oe=!0),se+="."+ce,Q="%"+se+"%",H(y,Q))ae=y[Q];else if(ae!=null){if(!(ce in ae)){if(!re)throw new e("base intrinsic for "+J+" exists, but the property is not available.");return}if(d&&G+1>=ie.length){var L=d(ae,ce);we=!!L,we&&"get"in L&&!("originalValue"in L.get)?ae=L.get:ae=ae[ce]}else we=H(ae,ce),ae=ae[ce];we&&!oe&&(y[Q]=ae)}}return ae},Kr}var Jr,Vh;function nt(){if(Vh)return Jr;Vh=1;var a=Ec(),s=Cc(),i=s([a("%String.prototype.indexOf%")]);return Jr=function(t,o){var r=a(t,!!o);return typeof r=="function"&&i(t,".prototype.")>-1?s([r]):r},Jr}var Yr,Wh;function yv(){if(Wh)return Yr;Wh=1;var a=Dt()(),s=nt(),i=s("Object.prototype.toString"),n=function(e){return a&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:i(e)==="[object Arguments]"},t=function(e){return n(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&i(e)!=="[object Array]"&&"callee"in e&&i(e.callee)==="[object Function]"},o=(function(){return n(arguments)})();return n.isLegacyArguments=t,Yr=o?n:t,Yr}var Xr,Gh;function bv(){if(Gh)return Xr;Gh=1;var a=nt(),s=Dt()(),i=T_(),n=rt(),t;if(s){var o=a("RegExp.prototype.exec"),r={},e=function(){throw r},c={toString:e,valueOf:e};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=e),t=function(f){if(!f||typeof f!="object")return!1;var p=n(f,"lastIndex"),w=p&&i(p,"value");if(!w)return!1;try{o(f,c)}catch(C){return C===r}}}else{var u=a("Object.prototype.toString"),h="[object RegExp]";t=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===h}}return Xr=t,Xr}var Zr,zh;function _v(){if(zh)return Zr;zh=1;var a=nt(),s=bv(),i=a("RegExp.prototype.exec"),n=wt();return Zr=function(o){if(!s(o))throw new n("`regex` must be a RegExp");return function(e){return i(o,e)!==null}},Zr}var en,Kh;function wv(){if(Kh)return en;Kh=1;const a=(function*(){}).constructor;return en=()=>a,en}var tn,Jh;function vv(){if(Jh)return tn;Jh=1;var a=nt(),s=_v(),i=s(/^\s*(?:function)?\*/),n=Dt()(),t=qc(),o=a("Object.prototype.toString"),r=a("Function.prototype.toString"),e=wv();return tn=function(u){if(typeof u!="function")return!1;if(i(r(u)))return!0;if(!n){var h=o(u);return h==="[object GeneratorFunction]"}if(!t)return!1;var l=e();return l&&t(u)===l.prototype},tn}var rn,Yh;function Cv(){if(Yh)return rn;Yh=1;var a=Function.prototype.toString,s=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,i,n;if(typeof s=="function"&&typeof Object.defineProperty=="function")try{i=Object.defineProperty({},"length",{get:function(){throw n}}),n={},s(function(){throw 42},null,i)}catch(d){d!==n&&(s=null)}else s=null;var t=/^\s*class\b/,o=function(b){try{var _=a.call(b);return t.test(_)}catch{return!1}},r=function(b){try{return o(b)?!1:(a.call(b),!0)}catch{return!1}},e=Object.prototype.toString,c="[object Object]",u="[object Function]",h="[object GeneratorFunction]",l="[object HTMLAllCollection]",f="[object HTML document.all class]",p="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,C=!(0 in[,]),m=function(){return!1};if(typeof document=="object"){var g=document.all;e.call(g)===e.call(document.all)&&(m=function(b){if((C||!b)&&(typeof b>"u"||typeof b=="object"))try{var _=e.call(b);return(_===l||_===f||_===p||_===c)&&b("")==null}catch{}return!1})}return rn=s?function(b){if(m(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{s(b,null,i)}catch(_){if(_!==n)return!1}return!o(b)&&r(b)}:function(b){if(m(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(w)return r(b);if(o(b))return!1;var _=e.call(b);return _!==u&&_!==h&&!/^\[object HTML/.test(_)?!1:r(b)},rn}var nn,Xh;function qv(){if(Xh)return nn;Xh=1;var a=Cv(),s=Object.prototype.toString,i=Object.prototype.hasOwnProperty,n=function(c,u,h){for(var l=0,f=c.length;l<f;l++)i.call(c,l)&&(h==null?u(c[l],l,c):u.call(h,c[l],l,c))},t=function(c,u,h){for(var l=0,f=c.length;l<f;l++)h==null?u(c.charAt(l),l,c):u.call(h,c.charAt(l),l,c)},o=function(c,u,h){for(var l in c)i.call(c,l)&&(h==null?u(c[l],l,c):u.call(h,c[l],l,c))};function r(e){return s.call(e)==="[object Array]"}return nn=function(c,u,h){if(!a(u))throw new TypeError("iterator must be a function");var l;arguments.length>=3&&(l=h),r(c)?n(c,u,l):typeof c=="string"?t(c,u,l):o(c,u,l)},nn}var sn,Zh;function Ev(){return Zh||(Zh=1,sn=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),sn}var on,ef;function Av(){if(ef)return on;ef=1;var a=Ev(),s=typeof globalThis>"u"?Ze:globalThis;return on=function(){for(var n=[],t=0;t<a.length;t++)typeof s[a[t]]=="function"&&(n[n.length]=a[t]);return n},on}var an={exports:{}},un,tf;function S_(){if(tf)return un;tf=1;var a=Ft(),s=q_(),i=wt(),n=rt();return un=function(o,r,e){if(!o||typeof o!="object"&&typeof o!="function")throw new i("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!n&&n(o,r);if(a)a(o,r,{configurable:h===null&&f?f.configurable:!h,enumerable:c===null&&f?f.enumerable:!c,value:e,writable:u===null&&f?f.writable:!u});else if(l||!c&&!u&&!h)o[r]=e;else throw new s("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},un}var ln,rf;function O_(){if(rf)return ln;rf=1;var a=Ft(),s=function(){return!!a};return s.hasArrayLengthDefineBug=function(){if(!a)return null;try{return a([],"length",{value:1}).length!==1}catch{return!0}},ln=s,ln}var cn,nf;function Rv(){if(nf)return cn;nf=1;var a=Ec(),s=S_(),i=O_()(),n=rt(),t=wt(),o=a("%Math.floor%");return cn=function(e,c){if(typeof e!="function")throw new t("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||o(c)!==c)throw new t("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],h=!0,l=!0;if("length"in e&&n){var f=n(e,"length");f&&!f.configurable&&(h=!1),f&&!f.writable&&(l=!1)}return(h||l||!u)&&(i?s(e,"length",c,!0,!0):s(e,"length",c)),e},cn}var hn,sf;function Tv(){if(sf)return hn;sf=1;var a=vt(),s=vc(),i=R_();return hn=function(){return i(a,s,arguments)},hn}var of;function Ut(){return of||(of=1,(function(a){var s=Rv(),i=Ft(),n=Cc(),t=Tv();a.exports=function(r){var e=n(arguments),c=r.length-(arguments.length-1);return s(e,1+(c>0?c:0),!0)},i?i(a.exports,"apply",{value:t}):a.exports.apply=t})(an)),an.exports}var fn,af;function N_(){if(af)return fn;af=1;var a=qv(),s=Av(),i=Ut(),n=nt(),t=rt(),o=qc(),r=n("Object.prototype.toString"),e=Dt()(),c=typeof globalThis>"u"?Ze:globalThis,u=s(),h=n("String.prototype.slice"),l=n("Array.prototype.indexOf",!0)||function(m,g){for(var d=0;d<m.length;d+=1)if(m[d]===g)return d;return-1},f={__proto__:null};e&&t&&o?a(u,function(C){var m=new c[C];if(Symbol.toStringTag in m&&o){var g=o(m),d=t(g,Symbol.toStringTag);if(!d&&g){var b=o(g);d=t(b,Symbol.toStringTag)}f["$"+C]=i(d.get)}}):a(u,function(C){var m=new c[C],g=m.slice||m.set;g&&(f["$"+C]=i(g))});var p=function(m){var g=!1;return a(f,function(d,b){if(!g)try{"$"+d(m)===b&&(g=h(b,1))}catch{}}),g},w=function(m){var g=!1;return a(f,function(d,b){if(!g)try{d(m),g=h(b,1)}catch{}}),g};return fn=function(m){if(!m||typeof m!="object")return!1;if(!e){var g=h(r(m),8,-1);return l(u,g)>-1?g:g!=="Object"?!1:w(m)}return t?p(m):null},fn}var dn,uf;function Sv(){if(uf)return dn;uf=1;var a=N_();return dn=function(i){return!!a(i)},dn}var lf;function Ov(){return lf||(lf=1,(function(a){var s=yv(),i=vv(),n=N_(),t=Sv();function o(G){return G.call.bind(G)}var r=typeof BigInt<"u",e=typeof Symbol<"u",c=o(Object.prototype.toString),u=o(Number.prototype.valueOf),h=o(String.prototype.valueOf),l=o(Boolean.prototype.valueOf);if(r)var f=o(BigInt.prototype.valueOf);if(e)var p=o(Symbol.prototype.valueOf);function w(G,we){if(typeof G!="object")return!1;try{return we(G),!0}catch{return!1}}a.isArgumentsObject=s,a.isGeneratorFunction=i,a.isTypedArray=t;function C(G){return typeof Promise<"u"&&G instanceof Promise||G!==null&&typeof G=="object"&&typeof G.then=="function"&&typeof G.catch=="function"}a.isPromise=C;function m(G){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(G):t(G)||x(G)}a.isArrayBufferView=m;function g(G){return n(G)==="Uint8Array"}a.isUint8Array=g;function d(G){return n(G)==="Uint8ClampedArray"}a.isUint8ClampedArray=d;function b(G){return n(G)==="Uint16Array"}a.isUint16Array=b;function _(G){return n(G)==="Uint32Array"}a.isUint32Array=_;function q(G){return n(G)==="Int8Array"}a.isInt8Array=q;function E(G){return n(G)==="Int16Array"}a.isInt16Array=E;function R(G){return n(G)==="Int32Array"}a.isInt32Array=R;function $(G){return n(G)==="Float32Array"}a.isFloat32Array=$;function M(G){return n(G)==="Float64Array"}a.isFloat64Array=M;function v(G){return n(G)==="BigInt64Array"}a.isBigInt64Array=v;function T(G){return n(G)==="BigUint64Array"}a.isBigUint64Array=T;function B(G){return c(G)==="[object Map]"}B.working=typeof Map<"u"&&B(new Map);function F(G){return typeof Map>"u"?!1:B.working?B(G):G instanceof Map}a.isMap=F;function y(G){return c(G)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function A(G){return typeof Set>"u"?!1:y.working?y(G):G instanceof Set}a.isSet=A;function j(G){return c(G)==="[object WeakMap]"}j.working=typeof WeakMap<"u"&&j(new WeakMap);function Y(G){return typeof WeakMap>"u"?!1:j.working?j(G):G instanceof WeakMap}a.isWeakMap=Y;function ee(G){return c(G)==="[object WeakSet]"}ee.working=typeof WeakSet<"u"&&ee(new WeakSet);function H(G){return ee(G)}a.isWeakSet=H;function N(G){return c(G)==="[object ArrayBuffer]"}N.working=typeof ArrayBuffer<"u"&&N(new ArrayBuffer);function V(G){return typeof ArrayBuffer>"u"?!1:N.working?N(G):G instanceof ArrayBuffer}a.isArrayBuffer=V;function K(G){return c(G)==="[object DataView]"}K.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&K(new DataView(new ArrayBuffer(1),0,1));function x(G){return typeof DataView>"u"?!1:K.working?K(G):G instanceof DataView}a.isDataView=x;var S=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function I(G){return c(G)==="[object SharedArrayBuffer]"}function k(G){return typeof S>"u"?!1:(typeof I.working>"u"&&(I.working=I(new S)),I.working?I(G):G instanceof S)}a.isSharedArrayBuffer=k;function X(G){return c(G)==="[object AsyncFunction]"}a.isAsyncFunction=X;function z(G){return c(G)==="[object Map Iterator]"}a.isMapIterator=z;function W(G){return c(G)==="[object Set Iterator]"}a.isSetIterator=W;function J(G){return c(G)==="[object Generator]"}a.isGeneratorObject=J;function re(G){return c(G)==="[object WebAssembly.Module]"}a.isWebAssemblyCompiledModule=re;function ie(G){return w(G,u)}a.isNumberObject=ie;function se(G){return w(G,h)}a.isStringObject=se;function P(G){return w(G,l)}a.isBooleanObject=P;function Q(G){return r&&w(G,f)}a.isBigIntObject=Q;function ae(G){return e&&w(G,p)}a.isSymbolObject=ae;function oe(G){return ie(G)||se(G)||P(G)||Q(G)||ae(G)}a.isBoxedPrimitive=oe;function de(G){return typeof Uint8Array<"u"&&(V(G)||k(G))}a.isAnyArrayBuffer=de,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(G){Object.defineProperty(a,G,{enumerable:!1,value:function(){throw new Error(G+" is not supported in userland")}})})})(pr)),pr}var pn,cf;function Nv(){return cf||(cf=1,pn=function(s){return s&&typeof s=="object"&&typeof s.copy=="function"&&typeof s.fill=="function"&&typeof s.readUInt8=="function"}),pn}var Lt={exports:{}},hf;function Iv(){return hf||(hf=1,typeof Object.create=="function"?Lt.exports=function(s,i){i&&(s.super_=i,s.prototype=Object.create(i.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:Lt.exports=function(s,i){if(i){s.super_=i;var n=function(){};n.prototype=i.prototype,s.prototype=new n,s.prototype.constructor=s}}),Lt.exports}var ff;function Ee(){return ff||(ff=1,(function(a){var s={},i=Object.getOwnPropertyDescriptors||function(S){for(var I=Object.keys(S),k={},X=0;X<I.length;X++)k[I[X]]=Object.getOwnPropertyDescriptor(S,I[X]);return k},n=/%[sdj%]/g;a.format=function(x){if(!E(x)){for(var S=[],I=0;I<arguments.length;I++)S.push(e(arguments[I]));return S.join(" ")}for(var I=1,k=arguments,X=k.length,z=String(x).replace(n,function(J){if(J==="%%")return"%";if(I>=X)return J;switch(J){case"%s":return String(k[I++]);case"%d":return Number(k[I++]);case"%j":try{return JSON.stringify(k[I++])}catch{return"[Circular]"}default:return J}}),W=k[I];I<X;W=k[++I])b(W)||!v(W)?z+=" "+W:z+=" "+e(W);return z},a.deprecate=function(x,S){if(typeof pe<"u"&&pe.noDeprecation===!0)return x;if(typeof pe>"u")return function(){return a.deprecate(x,S).apply(this,arguments)};var I=!1;function k(){if(!I){if(pe.throwDeprecation)throw new Error(S);pe.traceDeprecation?console.trace(S):console.error(S),I=!0}return x.apply(this,arguments)}return k};var t={},o=/^$/;if(s.NODE_DEBUG){var r=s.NODE_DEBUG;r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+r+"$","i")}a.debuglog=function(x){if(x=x.toUpperCase(),!t[x])if(o.test(x)){var S=pe.pid;t[x]=function(){var I=a.format.apply(a,arguments);console.error("%s %d: %s",x,S,I)}}else t[x]=function(){};return t[x]};function e(x,S){var I={seen:[],stylize:u};return arguments.length>=3&&(I.depth=arguments[2]),arguments.length>=4&&(I.colors=arguments[3]),d(S)?I.showHidden=S:S&&a._extend(I,S),$(I.showHidden)&&(I.showHidden=!1),$(I.depth)&&(I.depth=2),$(I.colors)&&(I.colors=!1),$(I.customInspect)&&(I.customInspect=!0),I.colors&&(I.stylize=c),l(I,x,I.depth)}a.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(x,S){var I=e.styles[S];return I?"\x1B["+e.colors[I][0]+"m"+x+"\x1B["+e.colors[I][1]+"m":x}function u(x,S){return x}function h(x){var S={};return x.forEach(function(I,k){S[I]=!0}),S}function l(x,S,I){if(x.customInspect&&S&&F(S.inspect)&&S.inspect!==a.inspect&&!(S.constructor&&S.constructor.prototype===S)){var k=S.inspect(I,x);return E(k)||(k=l(x,k,I)),k}var X=f(x,S);if(X)return X;var z=Object.keys(S),W=h(z);if(x.showHidden&&(z=Object.getOwnPropertyNames(S)),B(S)&&(z.indexOf("message")>=0||z.indexOf("description")>=0))return p(S);if(z.length===0){if(F(S)){var J=S.name?": "+S.name:"";return x.stylize("[Function"+J+"]","special")}if(M(S))return x.stylize(RegExp.prototype.toString.call(S),"regexp");if(T(S))return x.stylize(Date.prototype.toString.call(S),"date");if(B(S))return p(S)}var re="",ie=!1,se=["{","}"];if(g(S)&&(ie=!0,se=["[","]"]),F(S)){var P=S.name?": "+S.name:"";re=" [Function"+P+"]"}if(M(S)&&(re=" "+RegExp.prototype.toString.call(S)),T(S)&&(re=" "+Date.prototype.toUTCString.call(S)),B(S)&&(re=" "+p(S)),z.length===0&&(!ie||S.length==0))return se[0]+re+se[1];if(I<0)return M(S)?x.stylize(RegExp.prototype.toString.call(S),"regexp"):x.stylize("[Object]","special");x.seen.push(S);var Q;return ie?Q=w(x,S,I,W,z):Q=z.map(function(ae){return C(x,S,I,W,ae,ie)}),x.seen.pop(),m(Q,re,se)}function f(x,S){if($(S))return x.stylize("undefined","undefined");if(E(S)){var I="'"+JSON.stringify(S).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(I,"string")}if(q(S))return x.stylize(""+S,"number");if(d(S))return x.stylize(""+S,"boolean");if(b(S))return x.stylize("null","null")}function p(x){return"["+Error.prototype.toString.call(x)+"]"}function w(x,S,I,k,X){for(var z=[],W=0,J=S.length;W<J;++W)H(S,String(W))?z.push(C(x,S,I,k,String(W),!0)):z.push("");return X.forEach(function(re){re.match(/^\d+$/)||z.push(C(x,S,I,k,re,!0))}),z}function C(x,S,I,k,X,z){var W,J,re;if(re=Object.getOwnPropertyDescriptor(S,X)||{value:S[X]},re.get?re.set?J=x.stylize("[Getter/Setter]","special"):J=x.stylize("[Getter]","special"):re.set&&(J=x.stylize("[Setter]","special")),H(k,X)||(W="["+X+"]"),J||(x.seen.indexOf(re.value)<0?(b(I)?J=l(x,re.value,null):J=l(x,re.value,I-1),J.indexOf(`
2
+ `)>-1&&(z?J=J.split(`
3
+ `).map(function(ie){return" "+ie}).join(`
4
+ `).slice(2):J=`
5
+ `+J.split(`
6
+ `).map(function(ie){return" "+ie}).join(`
7
+ `))):J=x.stylize("[Circular]","special")),$(W)){if(z&&X.match(/^\d+$/))return J;W=JSON.stringify(""+X),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.slice(1,-1),W=x.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=x.stylize(W,"string"))}return W+": "+J}function m(x,S,I){var k=x.reduce(function(X,z){return z.indexOf(`
8
+ `)>=0,X+z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return k>60?I[0]+(S===""?"":S+`
9
+ `)+" "+x.join(`,
10
+ `)+" "+I[1]:I[0]+S+" "+x.join(", ")+" "+I[1]}a.types=Ov();function g(x){return Array.isArray(x)}a.isArray=g;function d(x){return typeof x=="boolean"}a.isBoolean=d;function b(x){return x===null}a.isNull=b;function _(x){return x==null}a.isNullOrUndefined=_;function q(x){return typeof x=="number"}a.isNumber=q;function E(x){return typeof x=="string"}a.isString=E;function R(x){return typeof x=="symbol"}a.isSymbol=R;function $(x){return x===void 0}a.isUndefined=$;function M(x){return v(x)&&A(x)==="[object RegExp]"}a.isRegExp=M,a.types.isRegExp=M;function v(x){return typeof x=="object"&&x!==null}a.isObject=v;function T(x){return v(x)&&A(x)==="[object Date]"}a.isDate=T,a.types.isDate=T;function B(x){return v(x)&&(A(x)==="[object Error]"||x instanceof Error)}a.isError=B,a.types.isNativeError=B;function F(x){return typeof x=="function"}a.isFunction=F;function y(x){return x===null||typeof x=="boolean"||typeof x=="number"||typeof x=="string"||typeof x=="symbol"||typeof x>"u"}a.isPrimitive=y,a.isBuffer=Nv();function A(x){return Object.prototype.toString.call(x)}function j(x){return x<10?"0"+x.toString(10):x.toString(10)}var Y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ee(){var x=new Date,S=[j(x.getHours()),j(x.getMinutes()),j(x.getSeconds())].join(":");return[x.getDate(),Y[x.getMonth()],S].join(" ")}a.log=function(){console.log("%s - %s",ee(),a.format.apply(a,arguments))},a.inherits=Iv(),a._extend=function(x,S){if(!S||!v(S))return x;for(var I=Object.keys(S),k=I.length;k--;)x[I[k]]=S[I[k]];return x};function H(x,S){return Object.prototype.hasOwnProperty.call(x,S)}var N=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;a.promisify=function(S){if(typeof S!="function")throw new TypeError('The "original" argument must be of type Function');if(N&&S[N]){var I=S[N];if(typeof I!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(I,N,{value:I,enumerable:!1,writable:!1,configurable:!0}),I}function I(){for(var k,X,z=new Promise(function(re,ie){k=re,X=ie}),W=[],J=0;J<arguments.length;J++)W.push(arguments[J]);W.push(function(re,ie){re?X(re):k(ie)});try{S.apply(this,W)}catch(re){X(re)}return z}return Object.setPrototypeOf(I,Object.getPrototypeOf(S)),N&&Object.defineProperty(I,N,{value:I,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(I,i(S))},a.promisify.custom=N;function V(x,S){if(!x){var I=new Error("Promise was rejected with a falsy value");I.reason=x,x=I}return S(x)}function K(x){if(typeof x!="function")throw new TypeError('The "original" argument must be of type Function');function S(){for(var I=[],k=0;k<arguments.length;k++)I.push(arguments[k]);var X=I.pop();if(typeof X!="function")throw new TypeError("The last argument must be of type Function");var z=this,W=function(){return X.apply(z,arguments)};x.apply(this,I).then(function(J){pe.nextTick(W.bind(null,null,J))},function(J){pe.nextTick(V.bind(null,J,W))})}return Object.setPrototypeOf(S,Object.getPrototypeOf(x)),Object.defineProperties(S,i(x)),S}a.callbackify=K})(dr)),dr}var mn,df;function Ac(){if(df)return mn;df=1;const a=/[\0\b\t\n\r\x1a"'\\]/g,s={"\0":"\\0","\b":"\\b"," ":"\\t","\n":"\\n","\r":"\\r","":"\\Z",'"':'\\"',"'":"\\'","\\":"\\\\"};function i(l){return function f(p,w={}){return l(p,f,w)}}function n(l={}){const f=l.escapeDate||c,p=l.escapeArray||o,w=l.escapeBuffer||r,C=l.escapeString||e,m=l.escapeObject||t,g=l.wrap||i;function d(b,_,q){if(b==null)return"NULL";switch(typeof b){case"boolean":return b?"true":"false";case"number":return b+"";case"object":if(b instanceof Date)b=f(b,_,q);else return Array.isArray(b)?p(b,_,q):Buffer.isBuffer(b)?w(b,_,q):m(b,_,q)}return C(b,_,q)}return g?g(d):d}function t(l,f,p){return l&&typeof l.toSQL=="function"?l.toSQL(p):JSON.stringify(l)}function o(l,f,p){let w="";for(let C=0;C<l.length;C++){const m=l[C];Array.isArray(m)?w+=(C===0?"":", ")+"("+o(m,f,p)+")":w+=(C===0?"":", ")+f(m,p)}return w}function r(l){return"X"+e(l.toString("hex"))}function e(l,f,p){let w=a.lastIndex=0,C="",m;for(;m=a.exec(l);)C+=l.slice(w,m.index)+s[m[0]],w=a.lastIndex;return w===0?"'"+l+"'":w<l.length?"'"+C+l.slice(w)+"'":"'"+C+"'"}function c(l,f,p={}){const w=p.timeZone||"local",C=new Date(l);let m,g,d,b,_,q,E;if(w==="local")m=C.getFullYear(),g=C.getMonth()+1,d=C.getDate(),b=C.getHours(),_=C.getMinutes(),q=C.getSeconds(),E=C.getMilliseconds();else{const R=h(w);R!==!1&&R!==0&&C.setTime(C.getTime()+R*6e4),m=C.getUTCFullYear(),g=C.getUTCMonth()+1,d=C.getUTCDate(),b=C.getUTCHours(),_=C.getUTCMinutes(),q=C.getUTCSeconds(),E=C.getUTCMilliseconds()}return u(m,4)+"-"+u(g,2)+"-"+u(d,2)+" "+u(b,2)+":"+u(_,2)+":"+u(q,2)+"."+u(E,3)}function u(l,f){for(l=l.toString();l.length<f;)l="0"+l;return l}function h(l){if(l==="Z")return 0;const f=l.match(/([+\-\s])(\d\d):?(\d\d)?/);return f?(f[1]=="-"?-1:1)*(parseInt(f[2],10)+(f[3]?parseInt(f[3],10):0)/60)*60:!1}return mn={arrayToList:o,bufferToString:r,dateToString:c,escapeString:e,charsRegex:a,charsMap:s,escapeObject:t,makeEscape:n},mn}var gn,pf;function $v(){if(pf)return gn;pf=1;function a(){this.__data__=[],this.size=0}return gn=a,gn}var yn,mf;function it(){if(mf)return yn;mf=1;function a(s,i){return s===i||s!==s&&i!==i}return yn=a,yn}var bn,gf;function Qt(){if(gf)return bn;gf=1;var a=it();function s(i,n){for(var t=i.length;t--;)if(a(i[t][0],n))return t;return-1}return bn=s,bn}var _n,yf;function xv(){if(yf)return _n;yf=1;var a=Qt(),s=Array.prototype,i=s.splice;function n(t){var o=this.__data__,r=a(o,t);if(r<0)return!1;var e=o.length-1;return r==e?o.pop():i.call(o,r,1),--this.size,!0}return _n=n,_n}var wn,bf;function Pv(){if(bf)return wn;bf=1;var a=Qt();function s(i){var n=this.__data__,t=a(n,i);return t<0?void 0:n[t][1]}return wn=s,wn}var vn,_f;function jv(){if(_f)return vn;_f=1;var a=Qt();function s(i){return a(this.__data__,i)>-1}return vn=s,vn}var Cn,wf;function Lv(){if(wf)return Cn;wf=1;var a=Qt();function s(i,n){var t=this.__data__,o=a(t,i);return o<0?(++this.size,t.push([i,n])):t[o][1]=n,this}return Cn=s,Cn}var qn,vf;function Ht(){if(vf)return qn;vf=1;var a=$v(),s=xv(),i=Pv(),n=jv(),t=Lv();function o(r){var e=-1,c=r==null?0:r.length;for(this.clear();++e<c;){var u=r[e];this.set(u[0],u[1])}}return o.prototype.clear=a,o.prototype.delete=s,o.prototype.get=i,o.prototype.has=n,o.prototype.set=t,qn=o,qn}var En,Cf;function Bv(){if(Cf)return En;Cf=1;var a=Ht();function s(){this.__data__=new a,this.size=0}return En=s,En}var An,qf;function Mv(){if(qf)return An;qf=1;function a(s){var i=this.__data__,n=i.delete(s);return this.size=i.size,n}return An=a,An}var Rn,Ef;function kv(){if(Ef)return Rn;Ef=1;function a(s){return this.__data__.get(s)}return Rn=a,Rn}var Tn,Af;function Dv(){if(Af)return Tn;Af=1;function a(s){return this.__data__.has(s)}return Tn=a,Tn}var Sn,Rf;function I_(){if(Rf)return Sn;Rf=1;var a=typeof Ze=="object"&&Ze&&Ze.Object===Object&&Ze;return Sn=a,Sn}var On,Tf;function Ne(){if(Tf)return On;Tf=1;var a=I_(),s=typeof self=="object"&&self&&self.Object===Object&&self,i=a||s||Function("return this")();return On=i,On}var Nn,Sf;function De(){if(Sf)return Nn;Sf=1;var a=Ne(),s=a.Symbol;return Nn=s,Nn}var In,Of;function Fv(){if(Of)return In;Of=1;var a=De(),s=Object.prototype,i=s.hasOwnProperty,n=s.toString,t=a?a.toStringTag:void 0;function o(r){var e=i.call(r,t),c=r[t];try{r[t]=void 0;var u=!0}catch{}var h=n.call(r);return u&&(e?r[t]=c:delete r[t]),h}return In=o,In}var $n,Nf;function Uv(){if(Nf)return $n;Nf=1;var a=Object.prototype,s=a.toString;function i(n){return s.call(n)}return $n=i,$n}var xn,If;function Fe(){if(If)return xn;If=1;var a=De(),s=Fv(),i=Uv(),n="[object Null]",t="[object Undefined]",o=a?a.toStringTag:void 0;function r(e){return e==null?e===void 0?t:n:o&&o in Object(e)?s(e):i(e)}return xn=r,xn}var Pn,$f;function Ae(){if($f)return Pn;$f=1;function a(s){var i=typeof s;return s!=null&&(i=="object"||i=="function")}return Pn=a,Pn}var jn,xf;function Vt(){if(xf)return jn;xf=1;var a=Fe(),s=Ae(),i="[object AsyncFunction]",n="[object Function]",t="[object GeneratorFunction]",o="[object Proxy]";function r(e){if(!s(e))return!1;var c=a(e);return c==n||c==t||c==i||c==o}return jn=r,jn}var Ln,Pf;function Qv(){if(Pf)return Ln;Pf=1;var a=Ne(),s=a["__core-js_shared__"];return Ln=s,Ln}var Bn,jf;function Hv(){if(jf)return Bn;jf=1;var a=Qv(),s=(function(){var n=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function i(n){return!!s&&s in n}return Bn=i,Bn}var Mn,Lf;function $_(){if(Lf)return Mn;Lf=1;var a=Function.prototype,s=a.toString;function i(n){if(n!=null){try{return s.call(n)}catch{}try{return n+""}catch{}}return""}return Mn=i,Mn}var kn,Bf;function Vv(){if(Bf)return kn;Bf=1;var a=Vt(),s=Hv(),i=Ae(),n=$_(),t=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,r=Function.prototype,e=Object.prototype,c=r.toString,u=e.hasOwnProperty,h=RegExp("^"+c.call(u).replace(t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(f){if(!i(f)||s(f))return!1;var p=a(f)?h:o;return p.test(n(f))}return kn=l,kn}var Dn,Mf;function Wv(){if(Mf)return Dn;Mf=1;function a(s,i){return s?.[i]}return Dn=a,Dn}var Fn,kf;function Ue(){if(kf)return Fn;kf=1;var a=Vv(),s=Wv();function i(n,t){var o=s(n,t);return a(o)?o:void 0}return Fn=i,Fn}var Un,Df;function Rc(){if(Df)return Un;Df=1;var a=Ue(),s=Ne(),i=a(s,"Map");return Un=i,Un}var Qn,Ff;function Wt(){if(Ff)return Qn;Ff=1;var a=Ue(),s=a(Object,"create");return Qn=s,Qn}var Hn,Uf;function Gv(){if(Uf)return Hn;Uf=1;var a=Wt();function s(){this.__data__=a?a(null):{},this.size=0}return Hn=s,Hn}var Vn,Qf;function zv(){if(Qf)return Vn;Qf=1;function a(s){var i=this.has(s)&&delete this.__data__[s];return this.size-=i?1:0,i}return Vn=a,Vn}var Wn,Hf;function Kv(){if(Hf)return Wn;Hf=1;var a=Wt(),s="__lodash_hash_undefined__",i=Object.prototype,n=i.hasOwnProperty;function t(o){var r=this.__data__;if(a){var e=r[o];return e===s?void 0:e}return n.call(r,o)?r[o]:void 0}return Wn=t,Wn}var Gn,Vf;function Jv(){if(Vf)return Gn;Vf=1;var a=Wt(),s=Object.prototype,i=s.hasOwnProperty;function n(t){var o=this.__data__;return a?o[t]!==void 0:i.call(o,t)}return Gn=n,Gn}var zn,Wf;function Yv(){if(Wf)return zn;Wf=1;var a=Wt(),s="__lodash_hash_undefined__";function i(n,t){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=a&&t===void 0?s:t,this}return zn=i,zn}var Kn,Gf;function Xv(){if(Gf)return Kn;Gf=1;var a=Gv(),s=zv(),i=Kv(),n=Jv(),t=Yv();function o(r){var e=-1,c=r==null?0:r.length;for(this.clear();++e<c;){var u=r[e];this.set(u[0],u[1])}}return o.prototype.clear=a,o.prototype.delete=s,o.prototype.get=i,o.prototype.has=n,o.prototype.set=t,Kn=o,Kn}var Jn,zf;function Zv(){if(zf)return Jn;zf=1;var a=Xv(),s=Ht(),i=Rc();function n(){this.size=0,this.__data__={hash:new a,map:new(i||s),string:new a}}return Jn=n,Jn}var Yn,Kf;function eC(){if(Kf)return Yn;Kf=1;function a(s){var i=typeof s;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?s!=="__proto__":s===null}return Yn=a,Yn}var Xn,Jf;function Gt(){if(Jf)return Xn;Jf=1;var a=eC();function s(i,n){var t=i.__data__;return a(n)?t[typeof n=="string"?"string":"hash"]:t.map}return Xn=s,Xn}var Zn,Yf;function tC(){if(Yf)return Zn;Yf=1;var a=Gt();function s(i){var n=a(this,i).delete(i);return this.size-=n?1:0,n}return Zn=s,Zn}var ei,Xf;function rC(){if(Xf)return ei;Xf=1;var a=Gt();function s(i){return a(this,i).get(i)}return ei=s,ei}var ti,Zf;function nC(){if(Zf)return ti;Zf=1;var a=Gt();function s(i){return a(this,i).has(i)}return ti=s,ti}var ri,ed;function iC(){if(ed)return ri;ed=1;var a=Gt();function s(i,n){var t=a(this,i),o=t.size;return t.set(i,n),this.size+=t.size==o?0:1,this}return ri=s,ri}var ni,td;function Tc(){if(td)return ni;td=1;var a=Zv(),s=tC(),i=rC(),n=nC(),t=iC();function o(r){var e=-1,c=r==null?0:r.length;for(this.clear();++e<c;){var u=r[e];this.set(u[0],u[1])}}return o.prototype.clear=a,o.prototype.delete=s,o.prototype.get=i,o.prototype.has=n,o.prototype.set=t,ni=o,ni}var ii,rd;function sC(){if(rd)return ii;rd=1;var a=Ht(),s=Rc(),i=Tc(),n=200;function t(o,r){var e=this.__data__;if(e instanceof a){var c=e.__data__;if(!s||c.length<n-1)return c.push([o,r]),this.size=++e.size,this;e=this.__data__=new i(c)}return e.set(o,r),this.size=e.size,this}return ii=t,ii}var si,nd;function zt(){if(nd)return si;nd=1;var a=Ht(),s=Bv(),i=Mv(),n=kv(),t=Dv(),o=sC();function r(e){var c=this.__data__=new a(e);this.size=c.size}return r.prototype.clear=s,r.prototype.delete=i,r.prototype.get=n,r.prototype.has=t,r.prototype.set=o,si=r,si}var oi,id;function Sc(){if(id)return oi;id=1;function a(s,i){for(var n=-1,t=s==null?0:s.length;++n<t&&i(s[n],n,s)!==!1;);return s}return oi=a,oi}var ai,sd;function x_(){if(sd)return ai;sd=1;var a=Ue(),s=(function(){try{var i=a(Object,"defineProperty");return i({},"",{}),i}catch{}})();return ai=s,ai}var ui,od;function Kt(){if(od)return ui;od=1;var a=x_();function s(i,n,t){n=="__proto__"&&a?a(i,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[n]=t}return ui=s,ui}var li,ad;function Jt(){if(ad)return li;ad=1;var a=Kt(),s=it(),i=Object.prototype,n=i.hasOwnProperty;function t(o,r,e){var c=o[r];(!(n.call(o,r)&&s(c,e))||e===void 0&&!(r in o))&&a(o,r,e)}return li=t,li}var ci,ud;function Qe(){if(ud)return ci;ud=1;var a=Jt(),s=Kt();function i(n,t,o,r){var e=!o;o||(o={});for(var c=-1,u=t.length;++c<u;){var h=t[c],l=r?r(o[h],n[h],h,o,n):void 0;l===void 0&&(l=n[h]),e?s(o,h,l):a(o,h,l)}return o}return ci=i,ci}var hi,ld;function oC(){if(ld)return hi;ld=1;function a(s,i){for(var n=-1,t=Array(s);++n<s;)t[n]=i(n);return t}return hi=a,hi}var fi,cd;function Ie(){if(cd)return fi;cd=1;function a(s){return s!=null&&typeof s=="object"}return fi=a,fi}var di,hd;function aC(){if(hd)return di;hd=1;var a=Fe(),s=Ie(),i="[object Arguments]";function n(t){return s(t)&&a(t)==i}return di=n,di}var pi,fd;function Ct(){if(fd)return pi;fd=1;var a=aC(),s=Ie(),i=Object.prototype,n=i.hasOwnProperty,t=i.propertyIsEnumerable,o=a((function(){return arguments})())?a:function(r){return s(r)&&n.call(r,"callee")&&!t.call(r,"callee")};return pi=o,pi}var mi,dd;function _e(){if(dd)return mi;dd=1;var a=Array.isArray;return mi=a,mi}var yt={exports:{}},gi,pd;function uC(){if(pd)return gi;pd=1;function a(){return!1}return gi=a,gi}yt.exports;var md;function st(){return md||(md=1,(function(a,s){var i=Ne(),n=uC(),t=s&&!s.nodeType&&s,o=t&&!0&&a&&!a.nodeType&&a,r=o&&o.exports===t,e=r?i.Buffer:void 0,c=e?e.isBuffer:void 0,u=c||n;a.exports=u})(yt,yt.exports)),yt.exports}var yi,gd;function Yt(){if(gd)return yi;gd=1;var a=9007199254740991,s=/^(?:0|[1-9]\d*)$/;function i(n,t){var o=typeof n;return t=t??a,!!t&&(o=="number"||o!="symbol"&&s.test(n))&&n>-1&&n%1==0&&n<t}return yi=i,yi}var bi,yd;function Oc(){if(yd)return bi;yd=1;var a=9007199254740991;function s(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=a}return bi=s,bi}var _i,bd;function lC(){if(bd)return _i;bd=1;var a=Fe(),s=Oc(),i=Ie(),n="[object Arguments]",t="[object Array]",o="[object Boolean]",r="[object Date]",e="[object Error]",c="[object Function]",u="[object Map]",h="[object Number]",l="[object Object]",f="[object RegExp]",p="[object Set]",w="[object String]",C="[object WeakMap]",m="[object ArrayBuffer]",g="[object DataView]",d="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",q="[object Int16Array]",E="[object Int32Array]",R="[object Uint8Array]",$="[object Uint8ClampedArray]",M="[object Uint16Array]",v="[object Uint32Array]",T={};T[d]=T[b]=T[_]=T[q]=T[E]=T[R]=T[$]=T[M]=T[v]=!0,T[n]=T[t]=T[m]=T[o]=T[g]=T[r]=T[e]=T[c]=T[u]=T[h]=T[l]=T[f]=T[p]=T[w]=T[C]=!1;function B(F){return i(F)&&s(F.length)&&!!T[a(F)]}return _i=B,_i}var wi,_d;function Nc(){if(_d)return wi;_d=1;function a(s){return function(i){return s(i)}}return wi=a,wi}var bt={exports:{}};bt.exports;var wd;function Ic(){return wd||(wd=1,(function(a,s){var i=I_(),n=s&&!s.nodeType&&s,t=n&&!0&&a&&!a.nodeType&&a,o=t&&t.exports===n,r=o&&i.process,e=(function(){try{var c=t&&t.require&&t.require("util").types;return c||r&&r.binding&&r.binding("util")}catch{}})();a.exports=e})(bt,bt.exports)),bt.exports}var vi,vd;function ot(){if(vd)return vi;vd=1;var a=lC(),s=Nc(),i=Ic(),n=i&&i.isTypedArray,t=n?s(n):a;return vi=t,vi}var Ci,Cd;function P_(){if(Cd)return Ci;Cd=1;var a=oC(),s=Ct(),i=_e(),n=st(),t=Yt(),o=ot(),r=Object.prototype,e=r.hasOwnProperty;function c(u,h){var l=i(u),f=!l&&s(u),p=!l&&!f&&n(u),w=!l&&!f&&!p&&o(u),C=l||f||p||w,m=C?a(u.length,String):[],g=m.length;for(var d in u)(h||e.call(u,d))&&!(C&&(d=="length"||p&&(d=="offset"||d=="parent")||w&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||t(d,g)))&&m.push(d);return m}return Ci=c,Ci}var qi,qd;function qt(){if(qd)return qi;qd=1;var a=Object.prototype;function s(i){var n=i&&i.constructor,t=typeof n=="function"&&n.prototype||a;return i===t}return qi=s,qi}var Ei,Ed;function j_(){if(Ed)return Ei;Ed=1;function a(s,i){return function(n){return s(i(n))}}return Ei=a,Ei}var Ai,Ad;function cC(){if(Ad)return Ai;Ad=1;var a=j_(),s=a(Object.keys,Object);return Ai=s,Ai}var Ri,Rd;function L_(){if(Rd)return Ri;Rd=1;var a=qt(),s=cC(),i=Object.prototype,n=i.hasOwnProperty;function t(o){if(!a(o))return s(o);var r=[];for(var e in Object(o))n.call(o,e)&&e!="constructor"&&r.push(e);return r}return Ri=t,Ri}var Ti,Td;function xe(){if(Td)return Ti;Td=1;var a=Vt(),s=Oc();function i(n){return n!=null&&s(n.length)&&!a(n)}return Ti=i,Ti}var Si,Sd;function He(){if(Sd)return Si;Sd=1;var a=P_(),s=L_(),i=xe();function n(t){return i(t)?a(t):s(t)}return Si=n,Si}var Oi,Od;function hC(){if(Od)return Oi;Od=1;var a=Qe(),s=He();function i(n,t){return n&&a(t,s(t),n)}return Oi=i,Oi}var Ni,Nd;function fC(){if(Nd)return Ni;Nd=1;function a(s){var i=[];if(s!=null)for(var n in Object(s))i.push(n);return i}return Ni=a,Ni}var Ii,Id;function dC(){if(Id)return Ii;Id=1;var a=Ae(),s=qt(),i=fC(),n=Object.prototype,t=n.hasOwnProperty;function o(r){if(!a(r))return i(r);var e=s(r),c=[];for(var u in r)u=="constructor"&&(e||!t.call(r,u))||c.push(u);return c}return Ii=o,Ii}var $i,$d;function Ve(){if($d)return $i;$d=1;var a=P_(),s=dC(),i=xe();function n(t){return i(t)?a(t,!0):s(t)}return $i=n,$i}var xi,xd;function pC(){if(xd)return xi;xd=1;var a=Qe(),s=Ve();function i(n,t){return n&&a(t,s(t),n)}return xi=i,xi}var _t={exports:{}};_t.exports;var Pd;function B_(){return Pd||(Pd=1,(function(a,s){var i=Ne(),n=s&&!s.nodeType&&s,t=n&&!0&&a&&!a.nodeType&&a,o=t&&t.exports===n,r=o?i.Buffer:void 0,e=r?r.allocUnsafe:void 0;function c(u,h){if(h)return u.slice();var l=u.length,f=e?e(l):new u.constructor(l);return u.copy(f),f}a.exports=c})(_t,_t.exports)),_t.exports}var Pi,jd;function $c(){if(jd)return Pi;jd=1;function a(s,i){var n=-1,t=s.length;for(i||(i=Array(t));++n<t;)i[n]=s[n];return i}return Pi=a,Pi}var ji,Ld;function xc(){if(Ld)return ji;Ld=1;function a(s,i){for(var n=-1,t=s==null?0:s.length,o=0,r=[];++n<t;){var e=s[n];i(e,n,s)&&(r[o++]=e)}return r}return ji=a,ji}var Li,Bd;function M_(){if(Bd)return Li;Bd=1;function a(){return[]}return Li=a,Li}var Bi,Md;function Pc(){if(Md)return Bi;Md=1;var a=xc(),s=M_(),i=Object.prototype,n=i.propertyIsEnumerable,t=Object.getOwnPropertySymbols,o=t?function(r){return r==null?[]:(r=Object(r),a(t(r),function(e){return n.call(r,e)}))}:s;return Bi=o,Bi}var Mi,kd;function mC(){if(kd)return Mi;kd=1;var a=Qe(),s=Pc();function i(n,t){return a(n,s(n),t)}return Mi=i,Mi}var ki,Dd;function jc(){if(Dd)return ki;Dd=1;function a(s,i){for(var n=-1,t=i.length,o=s.length;++n<t;)s[o+n]=i[n];return s}return ki=a,ki}var Di,Fd;function Xt(){if(Fd)return Di;Fd=1;var a=j_(),s=a(Object.getPrototypeOf,Object);return Di=s,Di}var Fi,Ud;function k_(){if(Ud)return Fi;Ud=1;var a=jc(),s=Xt(),i=Pc(),n=M_(),t=Object.getOwnPropertySymbols,o=t?function(r){for(var e=[];r;)a(e,i(r)),r=s(r);return e}:n;return Fi=o,Fi}var Ui,Qd;function gC(){if(Qd)return Ui;Qd=1;var a=Qe(),s=k_();function i(n,t){return a(n,s(n),t)}return Ui=i,Ui}var Qi,Hd;function D_(){if(Hd)return Qi;Hd=1;var a=jc(),s=_e();function i(n,t,o){var r=t(n);return s(n)?r:a(r,o(n))}return Qi=i,Qi}var Hi,Vd;function F_(){if(Vd)return Hi;Vd=1;var a=D_(),s=Pc(),i=He();function n(t){return a(t,i,s)}return Hi=n,Hi}var Vi,Wd;function U_(){if(Wd)return Vi;Wd=1;var a=D_(),s=k_(),i=Ve();function n(t){return a(t,i,s)}return Vi=n,Vi}var Wi,Gd;function yC(){if(Gd)return Wi;Gd=1;var a=Ue(),s=Ne(),i=a(s,"DataView");return Wi=i,Wi}var Gi,zd;function bC(){if(zd)return Gi;zd=1;var a=Ue(),s=Ne(),i=a(s,"Promise");return Gi=i,Gi}var zi,Kd;function Q_(){if(Kd)return zi;Kd=1;var a=Ue(),s=Ne(),i=a(s,"Set");return zi=i,zi}var Ki,Jd;function _C(){if(Jd)return Ki;Jd=1;var a=Ue(),s=Ne(),i=a(s,"WeakMap");return Ki=i,Ki}var Ji,Yd;function at(){if(Yd)return Ji;Yd=1;var a=yC(),s=Rc(),i=bC(),n=Q_(),t=_C(),o=Fe(),r=$_(),e="[object Map]",c="[object Object]",u="[object Promise]",h="[object Set]",l="[object WeakMap]",f="[object DataView]",p=r(a),w=r(s),C=r(i),m=r(n),g=r(t),d=o;return(a&&d(new a(new ArrayBuffer(1)))!=f||s&&d(new s)!=e||i&&d(i.resolve())!=u||n&&d(new n)!=h||t&&d(new t)!=l)&&(d=function(b){var _=o(b),q=_==c?b.constructor:void 0,E=q?r(q):"";if(E)switch(E){case p:return f;case w:return e;case C:return u;case m:return h;case g:return l}return _}),Ji=d,Ji}var Yi,Xd;function wC(){if(Xd)return Yi;Xd=1;var a=Object.prototype,s=a.hasOwnProperty;function i(n){var t=n.length,o=new n.constructor(t);return t&&typeof n[0]=="string"&&s.call(n,"index")&&(o.index=n.index,o.input=n.input),o}return Yi=i,Yi}var Xi,Zd;function H_(){if(Zd)return Xi;Zd=1;var a=Ne(),s=a.Uint8Array;return Xi=s,Xi}var Zi,ep;function Lc(){if(ep)return Zi;ep=1;var a=H_();function s(i){var n=new i.constructor(i.byteLength);return new a(n).set(new a(i)),n}return Zi=s,Zi}var es,tp;function vC(){if(tp)return es;tp=1;var a=Lc();function s(i,n){var t=n?a(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength)}return es=s,es}var ts,rp;function CC(){if(rp)return ts;rp=1;var a=/\w*$/;function s(i){var n=new i.constructor(i.source,a.exec(i));return n.lastIndex=i.lastIndex,n}return ts=s,ts}var rs,np;function qC(){if(np)return rs;np=1;var a=De(),s=a?a.prototype:void 0,i=s?s.valueOf:void 0;function n(t){return i?Object(i.call(t)):{}}return rs=n,rs}var ns,ip;function V_(){if(ip)return ns;ip=1;var a=Lc();function s(i,n){var t=n?a(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length)}return ns=s,ns}var is,sp;function EC(){if(sp)return is;sp=1;var a=Lc(),s=vC(),i=CC(),n=qC(),t=V_(),o="[object Boolean]",r="[object Date]",e="[object Map]",c="[object Number]",u="[object RegExp]",h="[object Set]",l="[object String]",f="[object Symbol]",p="[object ArrayBuffer]",w="[object DataView]",C="[object Float32Array]",m="[object Float64Array]",g="[object Int8Array]",d="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",q="[object Uint8ClampedArray]",E="[object Uint16Array]",R="[object Uint32Array]";function $(M,v,T){var B=M.constructor;switch(v){case p:return a(M);case o:case r:return new B(+M);case w:return s(M,T);case C:case m:case g:case d:case b:case _:case q:case E:case R:return t(M,T);case e:return new B;case c:case l:return new B(M);case u:return i(M);case h:return new B;case f:return n(M)}}return is=$,is}var ss,op;function W_(){if(op)return ss;op=1;var a=Ae(),s=Object.create,i=(function(){function n(){}return function(t){if(!a(t))return{};if(s)return s(t);n.prototype=t;var o=new n;return n.prototype=void 0,o}})();return ss=i,ss}var os,ap;function G_(){if(ap)return os;ap=1;var a=W_(),s=Xt(),i=qt();function n(t){return typeof t.constructor=="function"&&!i(t)?a(s(t)):{}}return os=n,os}var as,up;function AC(){if(up)return as;up=1;var a=at(),s=Ie(),i="[object Map]";function n(t){return s(t)&&a(t)==i}return as=n,as}var us,lp;function RC(){if(lp)return us;lp=1;var a=AC(),s=Nc(),i=Ic(),n=i&&i.isMap,t=n?s(n):a;return us=t,us}var ls,cp;function TC(){if(cp)return ls;cp=1;var a=at(),s=Ie(),i="[object Set]";function n(t){return s(t)&&a(t)==i}return ls=n,ls}var cs,hp;function SC(){if(hp)return cs;hp=1;var a=TC(),s=Nc(),i=Ic(),n=i&&i.isSet,t=n?s(n):a;return cs=t,cs}var hs,fp;function z_(){if(fp)return hs;fp=1;var a=zt(),s=Sc(),i=Jt(),n=hC(),t=pC(),o=B_(),r=$c(),e=mC(),c=gC(),u=F_(),h=U_(),l=at(),f=wC(),p=EC(),w=G_(),C=_e(),m=st(),g=RC(),d=Ae(),b=SC(),_=He(),q=Ve(),E=1,R=2,$=4,M="[object Arguments]",v="[object Array]",T="[object Boolean]",B="[object Date]",F="[object Error]",y="[object Function]",A="[object GeneratorFunction]",j="[object Map]",Y="[object Number]",ee="[object Object]",H="[object RegExp]",N="[object Set]",V="[object String]",K="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",I="[object DataView]",k="[object Float32Array]",X="[object Float64Array]",z="[object Int8Array]",W="[object Int16Array]",J="[object Int32Array]",re="[object Uint8Array]",ie="[object Uint8ClampedArray]",se="[object Uint16Array]",P="[object Uint32Array]",Q={};Q[M]=Q[v]=Q[S]=Q[I]=Q[T]=Q[B]=Q[k]=Q[X]=Q[z]=Q[W]=Q[J]=Q[j]=Q[Y]=Q[ee]=Q[H]=Q[N]=Q[V]=Q[K]=Q[re]=Q[ie]=Q[se]=Q[P]=!0,Q[F]=Q[y]=Q[x]=!1;function ae(oe,de,G,we,ce,ge){var le,L=de&E,U=de&R,Z=de&$;if(G&&(le=ce?G(oe,we,ce,ge):G(oe)),le!==void 0)return le;if(!d(oe))return oe;var ne=C(oe);if(ne){if(le=f(oe),!L)return r(oe,le)}else{var D=l(oe),O=D==y||D==A;if(m(oe))return o(oe,L);if(D==ee||D==M||O&&!ce){if(le=U||O?{}:w(oe),!L)return U?c(oe,t(le,oe)):e(oe,n(le,oe))}else{if(!Q[D])return ce?oe:{};le=p(oe,D,L)}}ge||(ge=new a);var te=ge.get(oe);if(te)return te;ge.set(oe,le),b(oe)?oe.forEach(function(me){le.add(ae(me,de,G,me,oe,ge))}):g(oe)&&oe.forEach(function(me,be){le.set(be,ae(me,de,G,be,oe,ge))});var he=Z?U?h:u:U?q:_,fe=ne?void 0:he(oe);return s(fe||oe,function(me,be){fe&&(be=me,me=oe[be]),i(le,be,ae(me,de,G,be,oe,ge))}),le}return hs=ae,hs}var fs,dp;function OC(){if(dp)return fs;dp=1;var a=z_(),s=1,i=4;function n(t){return a(t,s|i)}return fs=n,fs}var ds,pp;function Re(){if(pp)return ds;pp=1;function a(s){return s}return ds=a,ds}var ps,mp;function NC(){if(mp)return ps;mp=1;function a(s,i,n){switch(n.length){case 0:return s.call(i);case 1:return s.call(i,n[0]);case 2:return s.call(i,n[0],n[1]);case 3:return s.call(i,n[0],n[1],n[2])}return s.apply(i,n)}return ps=a,ps}var ms,gp;function IC(){if(gp)return ms;gp=1;var a=NC(),s=Math.max;function i(n,t,o){return t=s(t===void 0?n.length-1:t,0),function(){for(var r=arguments,e=-1,c=s(r.length-t,0),u=Array(c);++e<c;)u[e]=r[t+e];e=-1;for(var h=Array(t+1);++e<t;)h[e]=r[e];return h[t]=o(u),a(n,this,h)}}return ms=i,ms}var gs,yp;function K_(){if(yp)return gs;yp=1;function a(s){return function(){return s}}return gs=a,gs}var ys,bp;function $C(){if(bp)return ys;bp=1;var a=K_(),s=x_(),i=Re(),n=s?function(t,o){return s(t,"toString",{configurable:!0,enumerable:!1,value:a(o),writable:!0})}:i;return ys=n,ys}var bs,_p;function xC(){if(_p)return bs;_p=1;var a=800,s=16,i=Date.now;function n(t){var o=0,r=0;return function(){var e=i(),c=s-(e-r);if(r=e,c>0){if(++o>=a)return arguments[0]}else o=0;return t.apply(void 0,arguments)}}return bs=n,bs}var _s,wp;function PC(){if(wp)return _s;wp=1;var a=$C(),s=xC(),i=s(a);return _s=i,_s}var ws,vp;function Bc(){if(vp)return ws;vp=1;var a=Re(),s=IC(),i=PC();function n(t,o){return i(s(t,o,a),t+"")}return ws=n,ws}var vs,Cp;function Zt(){if(Cp)return vs;Cp=1;var a=it(),s=xe(),i=Yt(),n=Ae();function t(o,r,e){if(!n(e))return!1;var c=typeof r;return(c=="number"?s(e)&&i(r,e.length):c=="string"&&r in e)?a(e[r],o):!1}return vs=t,vs}var Cs,qp;function J_(){if(qp)return Cs;qp=1;var a=Bc(),s=it(),i=Zt(),n=Ve(),t=Object.prototype,o=t.hasOwnProperty,r=a(function(e,c){e=Object(e);var u=-1,h=c.length,l=h>2?c[2]:void 0;for(l&&i(c[0],c[1],l)&&(h=1);++u<h;)for(var f=c[u],p=n(f),w=-1,C=p.length;++w<C;){var m=p[w],g=e[m];(g===void 0||s(g,t[m])&&!o.call(e,m))&&(e[m]=f[m])}return e});return Cs=r,Cs}var qs,Ep;function er(){if(Ep)return qs;Ep=1;function a(s,i){for(var n=-1,t=s==null?0:s.length,o=Array(t);++n<t;)o[n]=i(s[n],n,s);return o}return qs=a,qs}var Es,Ap;function tr(){if(Ap)return Es;Ap=1;var a=Fe(),s=Ie(),i="[object Symbol]";function n(t){return typeof t=="symbol"||s(t)&&a(t)==i}return Es=n,Es}var As,Rp;function jC(){if(Rp)return As;Rp=1;var a=De(),s=er(),i=_e(),n=tr(),t=a?a.prototype:void 0,o=t?t.toString:void 0;function r(e){if(typeof e=="string")return e;if(i(e))return s(e,r)+"";if(n(e))return o?o.call(e):"";var c=e+"";return c=="0"&&1/e==-1/0?"-0":c}return As=r,As}var Rs,Tp;function Y_(){if(Tp)return Rs;Tp=1;var a=jC();function s(i){return i==null?"":a(i)}return Rs=s,Rs}var Ts,Sp;function X_(){if(Sp)return Ts;Sp=1;var a=Y_(),s=0;function i(n){var t=++s;return a(n)+t}return Ts=i,Ts}var Bt={},Op;function et(){if(Op)return Bt;Op=1;class a extends Error{constructor(n){super(n),this.name="KnexTimeoutError"}}function s(i,n){return new Promise(function(t,o){const r=setTimeout(function(){o(new a("operation timed out"))},n);function e(u){clearTimeout(r),t(u)}function c(u){clearTimeout(r),o(u)}i.then(e,c)})}return Bt.KnexTimeoutError=a,Bt.timeout=s,Bt}var Ss,Np;function LC(){if(Np)return Ss;Np=1;function a(i){i.client.emit("start",i.builder),i.builder.emit("start",i.builder);const n=i.builder.toSQL();return i.builder._debug&&i.client.logger.debug(n),Array.isArray(n)?i.queryArray(n):i.query(n)}function s(i,n){try{const t=i.builder.toSQL();if(Array.isArray(t)&&n.hasHandler)throw new Error("The stream may only be used with a single query statement.");return i.client.stream(i.connection,t,n.stream,n.options)}catch(t){throw n.stream.emit("error",t),t}}return Ss={ensureConnectionCallback:a,ensureConnectionStreamCallback:s},Ss}var Os,Ip;function BC(){if(Ip)return Os;Ip=1;const{KnexTimeoutError:a}=et(),{timeout:s}=et(),{ensureConnectionCallback:i,ensureConnectionStreamCallback:n}=LC();let t;class o{constructor(e,c){this.client=e,this.builder=c,this.queries=[],this.connection=void 0}async run(){const e=this;try{const c=await this.ensureConnection(i);return e.builder.emit("end"),c}catch(c){throw e.builder._events&&e.builder._events.error&&e.builder.emit("error",c),c}}stream(e,c){const u=typeof e=="function"&&arguments.length===1,h=u?{}:e,l=u?e:c,f=typeof l=="function";t=t||ve.Transform;const p=this.builder.queryContext(),w=new t({objectMode:!0,transform:(m,g,d)=>{d(null,this.client.postProcessResponse(m,p))}});w.on("close",()=>{this.client.releaseConnection(this.connection)}),w.on("pipe",m=>{const g=()=>{m.closed||m.destroy()};w.closed?g():w.on("close",g)});const C=this.ensureConnection(n,{options:h,hasHandler:f,stream:w}).catch(m=>{this.connection||w.emit("error",m)});return f?(l(w),C):w}pipe(e,c){return this.stream(c).pipe(e)}async query(e){const{__knexUid:c,__knexTxId:u}=this.connection;this.builder.emit("query",Object.assign({__knexUid:c,__knexTxId:u},e));const h=this,l=this.builder.queryContext();e!==null&&typeof e=="object"&&(e.queryContext=l);let f=this.client.query(this.connection,e);return e.timeout&&(f=s(f,e.timeout)),f.then(p=>this.client.processResponse(p,h)).then(p=>{const w=this.client.postProcessResponse(p,l);return this.builder.emit("query-response",w,Object.assign({__knexUid:c,__knexTxId:u},e),this.builder),this.client.emit("query-response",w,Object.assign({__knexUid:c,__knexTxId:u},e),this.builder),w}).catch(p=>{if(!(p instanceof a))return Promise.reject(p);const{timeout:w,sql:C,bindings:m}=e;let g;return e.cancelOnTimeout?g=this.client.cancelQuery(this.connection):(this.connection.__knex__disposed=p,g=Promise.resolve()),g.catch(d=>{throw this.connection.__knex__disposed=p,Object.assign(d,{message:`After query timeout of ${w}ms exceeded, cancelling of query failed.`,sql:C,bindings:m,timeout:w})}).then(()=>{throw Object.assign(p,{message:`Defined query timeout of ${w}ms exceeded when running query.`,sql:C,bindings:m,timeout:w})})}).catch(p=>{throw this.builder.emit("query-error",p,Object.assign({__knexUid:c,__knexTxId:u,queryContext:l},e)),p})}async queryArray(e){if(e.length===1){const u=e[0];if(!u.statementsProducer)return this.query(u);const h=await u.statementsProducer(void 0,this.connection),l=h.sql.map(C=>({sql:C,bindings:u.bindings})),f=h.pre.map(C=>({sql:C,bindings:u.bindings})),p=h.post.map(C=>({sql:C,bindings:u.bindings}));let w=[];await this.queryArray(f);try{await this.client.transaction(async C=>{const m=new o(C.client,this.builder);if(m.connection=this.connection,w=await m.queryArray(l),h.check&&(await C.raw(h.check)).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{await this.queryArray(p)}return w}const c=[];for(const u of e)c.push(await this.queryArray([u]));return c}async ensureConnection(e,c){if(this.builder._connection&&(this.connection=this.builder._connection),this.connection)return e(this,c);let u;try{u=await this.client.acquireConnection()}catch(h){if(!(h instanceof a))return Promise.reject(h);throw this.builder&&(h.sql=this.builder.sql,h.bindings=this.builder.bindings),h}try{return this.connection=u,await e(this,c)}finally{await this.client.releaseConnection(u)}}}return Os=o,Os}var Mt={exports:{}},Ns,$p;function MC(){if($p)return Ns;$p=1;var a=1e3,s=a*60,i=s*60,n=i*24,t=n*7,o=n*365.25;Ns=function(h,l){l=l||{};var f=typeof h;if(f==="string"&&h.length>0)return r(h);if(f==="number"&&isFinite(h))return l.long?c(h):e(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function r(h){if(h=String(h),!(h.length>100)){var l=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(l){var f=parseFloat(l[1]),p=(l[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*t;case"days":case"day":case"d":return f*n;case"hours":case"hour":case"hrs":case"hr":case"h":return f*i;case"minutes":case"minute":case"mins":case"min":case"m":return f*s;case"seconds":case"second":case"secs":case"sec":case"s":return f*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function e(h){var l=Math.abs(h);return l>=n?Math.round(h/n)+"d":l>=i?Math.round(h/i)+"h":l>=s?Math.round(h/s)+"m":l>=a?Math.round(h/a)+"s":h+"ms"}function c(h){var l=Math.abs(h);return l>=n?u(h,l,n,"day"):l>=i?u(h,l,i,"hour"):l>=s?u(h,l,s,"minute"):l>=a?u(h,l,a,"second"):h+" ms"}function u(h,l,f,p){var w=l>=f*1.5;return Math.round(h/f)+" "+p+(w?"s":"")}return Ns}var Is,xp;function kC(){if(xp)return Is;xp=1;function a(s){n.debug=n,n.default=n,n.coerce=u,n.disable=r,n.enable=o,n.enabled=e,n.humanize=MC(),n.destroy=h,Object.keys(s).forEach(l=>{n[l]=s[l]}),n.names=[],n.skips=[],n.formatters={};function i(l){let f=0;for(let p=0;p<l.length;p++)f=(f<<5)-f+l.charCodeAt(p),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=i;function n(l){let f,p=null,w,C;function m(...g){if(!m.enabled)return;const d=m,b=Number(new Date),_=b-(f||b);d.diff=_,d.prev=f,d.curr=b,f=b,g[0]=n.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let q=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(R,$)=>{if(R==="%%")return"%";q++;const M=n.formatters[$];if(typeof M=="function"){const v=g[q];R=M.call(d,v),g.splice(q,1),q--}return R}),n.formatArgs.call(d,g),(d.log||n.log).apply(d,g)}return m.namespace=l,m.useColors=n.useColors(),m.color=n.selectColor(l),m.extend=t,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(w!==n.namespaces&&(w=n.namespaces,C=n.enabled(l)),C),set:g=>{p=g}}),typeof n.init=="function"&&n.init(m),m}function t(l,f){const p=n(this.namespace+(typeof f>"u"?":":f)+l);return p.log=this.log,p}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let f;const p=(typeof l=="string"?l:"").split(/[\s,]+/),w=p.length;for(f=0;f<w;f++)p[f]&&(l=p[f].replace(/\*/g,".*?"),l[0]==="-"?n.skips.push(new RegExp("^"+l.slice(1)+"$")):n.names.push(new RegExp("^"+l+"$")))}function r(){const l=[...n.names.map(c),...n.skips.map(c).map(f=>"-"+f)].join(",");return n.enable(""),l}function e(l){if(l[l.length-1]==="*")return!0;let f,p;for(f=0,p=n.skips.length;f<p;f++)if(n.skips[f].test(l))return!1;for(f=0,p=n.names.length;f<p;f++)if(n.names[f].test(l))return!0;return!1}function c(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}return Is=a,Is}var Pp;function Oe(){return Pp||(Pp=1,(function(a,s){var i={};s.formatArgs=t,s.save=o,s.load=r,s.useColors=n,s.storage=e(),s.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),s.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function t(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;u.splice(1,0,h,"color: inherit");let l=0,f=0;u[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(l++,p==="%c"&&(f=l))}),u.splice(f,0,h)}s.log=console.debug||console.log||(()=>{});function o(u){try{u?s.storage.setItem("debug",u):s.storage.removeItem("debug")}catch{}}function r(){let u;try{u=s.storage.getItem("debug")}catch{}return!u&&typeof pe<"u"&&"env"in pe&&(u=i.DEBUG),u}function e(){try{return localStorage}catch{}}a.exports=kC()(s);const{formatters:c}=a.exports;c.j=function(u){try{return JSON.stringify(u)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(Mt,Mt.exports)),Mt.exports}var $s,jp;function kt(){return jp||(jp=1,$s=function(){}),$s}var xs,Lp;function DC(){if(Lp)return xs;Lp=1;class a{constructor(i){this.client=i}now(i){return typeof i=="number"?this.client.raw(`CURRENT_TIMESTAMP(${i})`):this.client.raw("CURRENT_TIMESTAMP")}uuid(){switch(this.client.driverName){case"sqlite3":case"better-sqlite3":return this.client.raw("(lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))))");case"mssql":return this.client.raw("(NEWID())");case"pg":case"pgnative":case"cockroachdb":return this.client.raw("(gen_random_uuid())");case"oracle":case"oracledb":return this.client.raw("(random_uuid())");case"mysql":case"mysql2":return this.client.raw("(UUID())");default:throw new Error(`${this.client.driverName} does not have a uuid function`)}}uuidToBin(i,n=!0){const t=Buffer.from(i.replace(/-/g,""),"hex");return n?Buffer.concat([t.slice(6,8),t.slice(4,6),t.slice(0,4),t.slice(8,16)]):Buffer.concat([t.slice(0,4),t.slice(4,6),t.slice(6,8),t.slice(8,16)])}binToUuid(i,n=!0){const t=Buffer.from(i,"hex");return n?[t.toString("hex",4,8),t.toString("hex",2,4),t.toString("hex",0,2),t.toString("hex",8,10),t.toString("hex",10,16)].join("-"):[t.toString("hex",0,4),t.toString("hex",4,6),t.toString("hex",6,8),t.toString("hex",8,10),t.toString("hex",10,16)].join("-")}}return xs=a,xs}var Ps,Bp;function Z_(){return Bp||(Bp=1,Ps=["with","withRecursive","withMaterialized","withNotMaterialized","select","as","columns","column","from","fromJS","fromRaw","into","withSchema","table","distinct","join","joinRaw","innerJoin","leftJoin","leftOuterJoin","rightJoin","rightOuterJoin","outerJoin","fullOuterJoin","crossJoin","where","andWhere","orWhere","whereNot","orWhereNot","whereLike","andWhereLike","orWhereLike","whereILike","andWhereILike","orWhereILike","whereRaw","whereWrapped","havingWrapped","orWhereRaw","whereExists","orWhereExists","whereNotExists","orWhereNotExists","whereIn","orWhereIn","whereNotIn","orWhereNotIn","whereNull","orWhereNull","whereNotNull","orWhereNotNull","whereBetween","whereNotBetween","andWhereBetween","andWhereNotBetween","orWhereBetween","orWhereNotBetween","groupBy","groupByRaw","orderBy","orderByRaw","union","unionAll","intersect","except","having","havingRaw","orHaving","orHavingRaw","offset","limit","count","countDistinct","min","max","sum","sumDistinct","avg","avgDistinct","increment","decrement","first","debug","pluck","clearSelect","clearWhere","clearGroup","clearOrder","clearHaving","insert","update","returning","del","delete","truncate","transacting","connection","jsonExtract","jsonSet","jsonInsert","jsonRemove","whereJsonObject","orWhereJsonObject","andWhereJsonObject","whereNotJsonObject","orWhereNotJsonObject","andWhereNotJsonObject","whereJsonPath","orWhereJsonPath","andWhereJsonPath","whereJsonSupersetOf","orWhereJsonSupersetOf","andWhereJsonSupersetOf","whereJsonNotSupersetOf","orWhereJsonNotSupersetOf","andWhereJsonNotSupersetOf","whereJsonSubsetOf","orWhereJsonSubsetOf","andWhereJsonSubsetOf","whereJsonNotSubsetOf","orWhereJsonNotSubsetOf","andWhereJsonNotSubsetOf"]),Ps}var js,Mp;function ew(){if(Mp)return js;Mp=1;var a=Kt(),s=it();function i(n,t,o){(o!==void 0&&!s(n[t],o)||o===void 0&&!(t in n))&&a(n,t,o)}return js=i,js}var Ls,kp;function FC(){if(kp)return Ls;kp=1;function a(s){return function(i,n,t){for(var o=-1,r=Object(i),e=t(i),c=e.length;c--;){var u=e[s?c:++o];if(n(r[u],u,r)===!1)break}return i}}return Ls=a,Ls}var Bs,Dp;function tw(){if(Dp)return Bs;Dp=1;var a=FC(),s=a();return Bs=s,Bs}var Ms,Fp;function UC(){if(Fp)return Ms;Fp=1;var a=xe(),s=Ie();function i(n){return s(n)&&a(n)}return Ms=i,Ms}var ks,Up;function Le(){if(Up)return ks;Up=1;var a=Fe(),s=Xt(),i=Ie(),n="[object Object]",t=Function.prototype,o=Object.prototype,r=t.toString,e=o.hasOwnProperty,c=r.call(Object);function u(h){if(!i(h)||a(h)!=n)return!1;var l=s(h);if(l===null)return!0;var f=e.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&r.call(f)==c}return ks=u,ks}var Ds,Qp;function rw(){if(Qp)return Ds;Qp=1;function a(s,i){if(!(i==="constructor"&&typeof s[i]=="function")&&i!="__proto__")return s[i]}return Ds=a,Ds}var Fs,Hp;function QC(){if(Hp)return Fs;Hp=1;var a=Qe(),s=Ve();function i(n){return a(n,s(n))}return Fs=i,Fs}var Us,Vp;function HC(){if(Vp)return Us;Vp=1;var a=ew(),s=B_(),i=V_(),n=$c(),t=G_(),o=Ct(),r=_e(),e=UC(),c=st(),u=Vt(),h=Ae(),l=Le(),f=ot(),p=rw(),w=QC();function C(m,g,d,b,_,q,E){var R=p(m,d),$=p(g,d),M=E.get($);if(M){a(m,d,M);return}var v=q?q(R,$,d+"",m,g,E):void 0,T=v===void 0;if(T){var B=r($),F=!B&&c($),y=!B&&!F&&f($);v=$,B||F||y?r(R)?v=R:e(R)?v=n(R):F?(T=!1,v=s($,!0)):y?(T=!1,v=i($,!0)):v=[]:l($)||o($)?(v=R,o(R)?v=w(R):(!h(R)||u(R))&&(v=t($))):T=!1}T&&(E.set($,v),_(v,$,b,q,E),E.delete($)),a(m,d,v)}return Us=C,Us}var Qs,Wp;function VC(){if(Wp)return Qs;Wp=1;var a=zt(),s=ew(),i=tw(),n=HC(),t=Ae(),o=Ve(),r=rw();function e(c,u,h,l,f){c!==u&&i(u,function(p,w){if(f||(f=new a),t(p))n(c,u,w,h,e,l,f);else{var C=l?l(r(c,w),p,w+"",c,u,f):void 0;C===void 0&&(C=p),s(c,w,C)}},o)}return Qs=e,Qs}var Hs,Gp;function Mc(){if(Gp)return Hs;Gp=1;var a=Bc(),s=Zt();function i(n){return a(function(t,o){var r=-1,e=o.length,c=e>1?o[e-1]:void 0,u=e>2?o[2]:void 0;for(c=n.length>3&&typeof c=="function"?(e--,c):void 0,u&&s(o[0],o[1],u)&&(c=e<3?void 0:c,e=1),t=Object(t);++r<e;){var h=o[r];h&&n(t,h,r,c)}return t})}return Hs=i,Hs}var Vs,zp;function WC(){if(zp)return Vs;zp=1;var a=VC(),s=Mc(),i=s(function(n,t,o){a(n,t,o)});return Vs=i,Vs}var Ws,Kp;function nw(){if(Kp)return Ws;Kp=1;function a(s,i,n){var t=-1,o=s.length;i<0&&(i=-i>o?0:o+i),n=n>o?o:n,n<0&&(n+=o),o=i>n?0:n-i>>>0,i>>>=0;for(var r=Array(o);++t<o;)r[t]=s[t+i];return r}return Ws=a,Ws}var Gs,Jp;function GC(){if(Jp)return Gs;Jp=1;var a=/\s/;function s(i){for(var n=i.length;n--&&a.test(i.charAt(n)););return n}return Gs=s,Gs}var zs,Yp;function zC(){if(Yp)return zs;Yp=1;var a=GC(),s=/^\s+/;function i(n){return n&&n.slice(0,a(n)+1).replace(s,"")}return zs=i,zs}var Ks,Xp;function KC(){if(Xp)return Ks;Xp=1;var a=zC(),s=Ae(),i=tr(),n=NaN,t=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,r=/^0o[0-7]+$/i,e=parseInt;function c(u){if(typeof u=="number")return u;if(i(u))return n;if(s(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=s(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=a(u);var l=o.test(u);return l||r.test(u)?e(u.slice(2),l?2:8):t.test(u)?n:+u}return Ks=c,Ks}var Js,Zp;function JC(){if(Zp)return Js;Zp=1;var a=KC(),s=1/0,i=17976931348623157e292;function n(t){if(!t)return t===0?t:0;if(t=a(t),t===s||t===-s){var o=t<0?-1:1;return o*i}return t===t?t:0}return Js=n,Js}var Ys,em;function iw(){if(em)return Ys;em=1;var a=JC();function s(i){var n=a(i),t=n%1;return n===n?t?n-t:n:0}return Ys=s,Ys}var Xs,tm;function YC(){if(tm)return Xs;tm=1;var a=nw(),s=Zt(),i=iw(),n=Math.ceil,t=Math.max;function o(r,e,c){(c?s(r,e,c):e===void 0)?e=1:e=t(i(e),0);var u=r==null?0:r.length;if(!u||e<1)return[];for(var h=0,l=0,f=Array(n(u/e));h<u;)f[l++]=a(r,h,h+=e);return f}return Xs=o,Xs}var Zs,rm;function XC(){if(rm)return Zs;rm=1;var a=De(),s=Ct(),i=_e(),n=a?a.isConcatSpreadable:void 0;function t(o){return i(o)||s(o)||!!(n&&o&&o[n])}return Zs=t,Zs}var eo,nm;function ZC(){if(nm)return eo;nm=1;var a=jc(),s=XC();function i(n,t,o,r,e){var c=-1,u=n.length;for(o||(o=s),e||(e=[]);++c<u;){var h=n[c];t>0&&o(h)?t>1?i(h,t-1,o,r,e):a(e,h):r||(e[e.length]=h)}return e}return eo=i,eo}var to,im;function sw(){if(im)return to;im=1;var a=ZC();function s(i){var n=i==null?0:i.length;return n?a(i,1):[]}return to=s,to}var ro,sm;function eq(){return sm||(sm=1,ro=a=>new Promise(s=>setTimeout(s,a))),ro}var no,om;function ye(){if(om)return no;om=1;function a(r){return typeof r=="string"}function s(r){return typeof r=="number"}function i(r){return typeof r=="boolean"}function n(r){return typeof r>"u"}function t(r){return typeof r=="object"&&r!==null}function o(r){return typeof r=="function"}return no={isString:a,isNumber:s,isBoolean:i,isUndefined:n,isObject:t,isFunction:o},no}var io,am;function tq(){if(am)return io;am=1;const a=YC(),s=sw(),i=eq(),{isNumber:n}=ye();function t(o,r,e,c=1e3){let u,h=null;if(!n(c)||c<1)throw new TypeError(`Invalid chunkSize: ${c}`);if(!Array.isArray(e))throw new TypeError(`Invalid batch: Expected array, got ${typeof e}`);const l=a(e,c),f=p=>h?p(h):o.transaction(p);return Object.assign(Promise.resolve().then(async()=>(await i(1),f(async p=>{const w=[];for(const C of l)w.push(await p(r).insert(C,u));return s(w)}))),{returning(p){return u=p,this},transacting(p){return h=p,this}})}return io=t,io}var so,um;function kc(){if(um)return so;um=1;function a(s,i,n="password"){i||(i=s),Object.defineProperty(s,n,{enumerable:!1,value:i[n]})}return so={setHiddenProperty:a},so}var oo,lm;function ow(){if(lm)return oo;lm=1;const{EventEmitter:a}=ke(),{Migrator:s}=kt(),i=kt(),n=DC(),t=Z_(),o=WC(),r=tq(),{isObject:e}=ye(),{setHiddenProperty:c}=kc(),u={client:{get(){return this.context.client},set(d){this.context.client=d},configurable:!0},userParams:{get(){return this.context.userParams},set(d){this.context.userParams=d},configurable:!0},schema:{get(){return this.client.schemaBuilder()},configurable:!0},migrate:{get(){return new s(this)},configurable:!0},seed:{get(){return new i(this)},configurable:!0},fn:{get(){return new n(this.client)},configurable:!0}},h=["raw","batchInsert","transaction","transactionProvider","initialize","destroy","ref","withUserParams","queryBuilder","disableProcessing","enableProcessing"];for(const d of h)u[d]={value:function(...b){return this.context[d](...b)},configurable:!0};function l(d){function b(_,q){return m(b.context,_,q)}return w(b,d),b}function f(d){const b=d.context||{};Object.assign(b,{queryBuilder(){return this.client.queryBuilder()},raw(){return this.client.raw.apply(this.client,arguments)},batchInsert(_,q,E=1e3){return r(this,_,q,E)},transaction(_,q){!q&&e(_)&&(q=_,_=null);const E=Object.assign({},q);return E.userParams=this.userParams||{},E.doNotRejectOnRollback===void 0&&(E.doNotRejectOnRollback=!0),this._transaction(_,E)},_transaction(_,q,E=null){return _?this.client.transaction(_,q,E):new Promise((R,$)=>{this.client.transaction(R,q,E).catch($)})},transactionProvider(_){let q;return()=>(q||(q=this.transaction(void 0,_)),q)},initialize(_){return this.client.initializePool(_)},destroy(_){return this.client.destroy(_)},ref(_){return this.client.ref(_)},disableProcessing(){this.userParams.isProcessingDisabled||(this.userParams.wrapIdentifier=this.client.config.wrapIdentifier,this.userParams.postProcessResponse=this.client.config.postProcessResponse,this.client.config.wrapIdentifier=null,this.client.config.postProcessResponse=null,this.userParams.isProcessingDisabled=!0)},enableProcessing(){this.userParams.isProcessingDisabled&&(this.client.config.wrapIdentifier=this.userParams.wrapIdentifier,this.client.config.postProcessResponse=this.userParams.postProcessResponse,this.userParams.isProcessingDisabled=!1)},withUserParams(_){const q=g(d);return this.client&&(q.client=Object.create(this.client.constructor.prototype),o(q.client,this.client),q.client.config=Object.assign({},this.client.config),this.client.config.password&&c(q.client.config,this.client.config)),w(q,q.client),p("query",d,q),p("query-error",d,q),p("query-response",d,q),p("start",d,q),q.userParams=_,q}}),d.context||(d.context=b)}function p(d,b,_){b.listeners(d).forEach(E=>{_.on(d,E)})}function w(d,b){for(let q=0;q<t.length;q++){const E=t[q];d[E]=function(){const R=this.queryBuilder();return R[E].apply(R,arguments)}}Object.defineProperties(d,u),f(d),d.client=b,d.userParams={};const _=new a;for(const q in _)d[q]=_[q];d._internalListeners&&d._internalListeners.forEach(({eventName:q,listener:E})=>{d.client.removeListener(q,E)}),d._internalListeners=[],C(d,"start",q=>{d.emit("start",q)}),C(d,"query",q=>{d.emit("query",q)}),C(d,"query-error",(q,E)=>{d.emit("query-error",q,E)}),C(d,"query-response",(q,E,R)=>{d.emit("query-response",q,E,R)})}function C(d,b,_){d.client.on(b,_),d._internalListeners.push({eventName:b,listener:_})}function m(d,b,_){const q=d.queryBuilder();return b||d.client.logger.warn("calling knex without a tableName is deprecated. Use knex.queryBuilder() instead."),b?q.table(b,_):q}function g(d){const b=Object.create(Object.getPrototypeOf(d),Object.getOwnPropertyDescriptors(d)),_={},E=((R,$)=>m(_,R,$)).bind(b);return Object.assign(E,d),E.context=_,E}return oo=l,oo}var ao,cm;function aw(){if(cm)return ao;cm=1;const a=kt(),s=i=>Object.assign(i,{finally(n){return this.then().finally(n)}});return ao=Promise.prototype.finally?s:a,ao}var uo,hm;function Be(){if(hm)return uo;hm=1;const{EventEmitter:a}=ke(),s=Oe(),i=X_(),{callbackify:n}=Ee(),t=ow(),{timeout:o,KnexTimeoutError:r}=et(),e=aw(),c=s("knex:tx");function u(){return{userParams:{},doNotRejectOnRollback:!0}}const h=["read uncommitted","read committed","snapshot","repeatable read","serializable"];class l extends a{constructor(m,g,d=u(),b=null){super(),this.userParams=d.userParams,this.doNotRejectOnRollback=d.doNotRejectOnRollback;const _=this.txid=i("trx");this.client=m,this.logger=m.logger,this.outerTx=b,this.trxClient=void 0,this._completed=!1,this._debug=m.config&&m.config.debug,this.readOnly=d.readOnly,d.isolationLevel&&this.setIsolationLevel(d.isolationLevel),c("%s: Starting %s transaction",_,b?"nested":"top level"),this._lastChild=Promise.resolve();const E=(b?b._lastChild:Promise.resolve()).then(()=>this._evaluateContainer(d,g));this._promise=E.then(R=>R),b&&(b._lastChild=E.catch(()=>{}))}isCompleted(){return this._completed||this.outerTx&&this.outerTx.isCompleted()||!1}begin(m){const g=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return g.length===0?this.query(m,"BEGIN;"):this.query(m,`SET TRANSACTION ${g};`).then(()=>this.query(m,"BEGIN;"))}savepoint(m){return this.query(m,`SAVEPOINT ${this.txid};`)}commit(m,g){return this.query(m,"COMMIT;",1,g)}release(m,g){return this.query(m,`RELEASE SAVEPOINT ${this.txid};`,1,g)}setIsolationLevel(m){if(!h.includes(m))throw new Error(`Invalid isolationLevel, supported isolation levels are: ${JSON.stringify(h)}`);return this.isolationLevel=m,this}rollback(m,g){return o(this.query(m,"ROLLBACK",2,g),5e3).catch(d=>{if(!(d instanceof r))return Promise.reject(d);this._rejecter(g)})}rollbackTo(m,g){return o(this.query(m,`ROLLBACK TO SAVEPOINT ${this.txid}`,2,g),5e3).catch(d=>{if(!(d instanceof r))return Promise.reject(d);this._rejecter(g)})}query(m,g,d,b){const _=this.trxClient.query(m,g).catch(q=>{d=2,b=q,this._completed=!0,c("%s error running transaction query",this.txid)}).then(q=>{if(d===1&&this._resolver(b),d===2){if(b===void 0){if(this.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(g)){this._resolver();return}b=new Error(`Transaction rejected with non-error: ${b}`)}this._rejecter(b)}return q});return(d===1||d===2)&&(this._completed=!0),_}debug(m){return this._debug=arguments.length?m:!0,this}async _evaluateContainer(m,g){return this.acquireConnection(m,d=>{const b=this.trxClient=p(this,this.client,d),_=this.client.transacting?this.savepoint(d):this.begin(d),q=new Promise((E,R)=>{this._resolver=E,this._rejecter=R});return _.then(()=>f(this,d,b)).then(E=>{this.transactor=E,this.outerTx&&(E.parentTransaction=this.outerTx.transactor),E.executionPromise=q;let R;try{R=g(E)}catch($){R=Promise.reject($)}return R&&R.then&&typeof R.then=="function"&&R.then($=>E.commit($)).catch($=>E.rollback($)),null}).catch(E=>this._rejecter(E)),q})}async acquireConnection(m,g){const d=m&&m.connection,b=d||await this.client.acquireConnection();try{return b.__knexTxId=this.txid,await g(b)}finally{d?c("%s: not releasing external connection",this.txid):(c("%s: releasing connection",this.txid),this.client.releaseConnection(b))}}then(m,g){return this._promise.then(m,g)}catch(...m){return this._promise.catch(...m)}asCallback(m){return n(()=>this._promise)(m),this._promise}}e(l.prototype);function f(C,m,g){const d=t(g);return d.context.withUserParams=()=>{throw new Error("Cannot set user params on a transaction - it can only inherit params from main knex instance")},d.isTransaction=!0,d.userParams=C.userParams||{},d.context.transaction=function(b,_){return _?_.doNotRejectOnRollback===void 0&&(_.doNotRejectOnRollback=!0):_={doNotRejectOnRollback:!0},this._transaction(b,_,C)},d.savepoint=function(b,_){return d.transaction(b,_)},C.client.transacting?(d.commit=b=>C.release(m,b),d.rollback=b=>C.rollbackTo(m,b)):(d.commit=b=>C.commit(m,b),d.rollback=b=>C.rollback(m,b)),d.isCompleted=()=>C.isCompleted(),d}function p(C,m,g){const d=Object.create(m.constructor.prototype);d.version=m.version,d.config=m.config,d.driver=m.driver,d.connectionSettings=m.connectionSettings,d.transacting=!0,d.valueForUndefined=m.valueForUndefined,d.logger=m.logger,d.on("start",function(q){C.emit("start",q),m.emit("start",q)}),d.on("query",function(q){C.emit("query",q),m.emit("query",q)}),d.on("query-error",function(q,E){C.emit("query-error",q,E),m.emit("query-error",q,E)}),d.on("query-response",function(q,E,R){C.emit("query-response",q,E,R),m.emit("query-response",q,E,R)});const b=d.query;d.query=function(q,E){const R=C.isCompleted();return new Promise(function($,M){try{if(q!==g)throw new Error("Invalid connection for transaction query.");R&&w(C,E),$(b.call(d,q,E))}catch(v){M(v)}})};const _=d.stream;return d.stream=function(q,E,R,$){const M=C.isCompleted();return new Promise(function(v,T){try{if(q!==g)throw new Error("Invalid connection for transaction query.");M&&w(C,E),v(_.call(d,q,E,R,$))}catch(B){T(B)}})},d.acquireConnection=function(){return Promise.resolve(g)},d.releaseConnection=function(){return Promise.resolve()},d}function w(C,m){const g=typeof m=="string"?m:m&&m.sql;throw c("%s: Transaction completed: %s",C.txid,g),new Error("Transaction query already complete, run with DEBUG=knex:tx for more info")}return uo=l,uo}var lo,fm;function uw(){if(fm)return lo;fm=1;const a=Oe()("knex:query"),s=Oe()("knex:bindings"),i=(e,c)=>a(e.replace(/%/g,"%%"),c),{isString:n}=ye();function t(e,c,u,h){c=c==null?[]:[].concat(c);let l=0;return e.replace(/\\?\?/g,f=>{if(f==="\\?")return"?";if(l===c.length)return f;const p=c[l++];return h._escapeBinding(p,{timeZone:u})})}function o(e,c,u){const h=n(c)?{sql:c}:c;h.bindings=u.prepBindings(h.bindings),h.sql=u.positionBindings(h.sql);const{__knexUid:l,__knexTxId:f}=e;return u.emit("query",Object.assign({__knexUid:l,__knexTxId:f},h)),i(h.sql,f),s(h.bindings,f),h}function r(e,c,u){return u._query(e,c).catch(h=>{throw u.config&&u.config.compileSqlOnError===!1?h.message=c.sql+" - "+h.message:h.message=t(c.sql,c.bindings,void 0,u)+" - "+h.message,u.emit("query-error",h,Object.assign({__knexUid:e.__knexUid,__knexTxId:e.__knexUid},c)),h})}return lo={enrichQueryObject:o,executeQuery:r,formatQuery:t},lo}var co={exports:{}},ho={},dm;function lw(){if(dm)return ho;dm=1;function a(d){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a(d)}function s(d,b,_){return Object.defineProperty(d,"prototype",{writable:!1}),d}function i(d,b){if(!(d instanceof b))throw new TypeError("Cannot call a class as a function")}function n(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(b&&b.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),b&&t(d,b)}function t(d,b){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(q,E){return q.__proto__=E,q},t(d,b)}function o(d){var b=c();return function(){var q=u(d),E;if(b){var R=u(this).constructor;E=Reflect.construct(q,arguments,R)}else E=q.apply(this,arguments);return r(this,E)}}function r(d,b){if(b&&(a(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e(d)}function e(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u(d){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(_){return _.__proto__||Object.getPrototypeOf(_)},u(d)}var h={},l,f;function p(d,b,_){_||(_=Error);function q(R,$,M){return typeof b=="string"?b:b(R,$,M)}var E=(function(R){n(M,R);var $=o(M);function M(v,T,B){var F;return i(this,M),F=$.call(this,q(v,T,B)),F.code=d,F}return s(M)})(_);h[d]=E}function w(d,b){if(Array.isArray(d)){var _=d.length;return d=d.map(function(q){return String(q)}),_>2?"one of ".concat(b," ").concat(d.slice(0,_-1).join(", "),", or ")+d[_-1]:_===2?"one of ".concat(b," ").concat(d[0]," or ").concat(d[1]):"of ".concat(b," ").concat(d[0])}else return"of ".concat(b," ").concat(String(d))}function C(d,b,_){return d.substr(0,b.length)===b}function m(d,b,_){return(_===void 0||_>d.length)&&(_=d.length),d.substring(_-b.length,_)===b}function g(d,b,_){return typeof _!="number"&&(_=0),_+b.length>d.length?!1:d.indexOf(b,_)!==-1}return p("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),p("ERR_INVALID_ARG_TYPE",function(d,b,_){l===void 0&&(l=tt()),l(typeof d=="string","'name' must be a string");var q;typeof b=="string"&&C(b,"not ")?(q="must not be",b=b.replace(/^not /,"")):q="must be";var E;if(m(d," argument"))E="The ".concat(d," ").concat(q," ").concat(w(b,"type"));else{var R=g(d,".")?"property":"argument";E='The "'.concat(d,'" ').concat(R," ").concat(q," ").concat(w(b,"type"))}return E+=". Received type ".concat(a(_)),E},TypeError),p("ERR_INVALID_ARG_VALUE",function(d,b){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Ee());var q=f.inspect(b);return q.length>128&&(q="".concat(q.slice(0,128),"...")),"The argument '".concat(d,"' ").concat(_,". Received ").concat(q)},TypeError),p("ERR_INVALID_RETURN_VALUE",function(d,b,_){var q;return _&&_.constructor&&_.constructor.name?q="instance of ".concat(_.constructor.name):q="type ".concat(a(_)),"Expected ".concat(d,' to be returned from the "').concat(b,'"')+" function but got ".concat(q,".")},TypeError),p("ERR_MISSING_ARGS",function(){for(var d=arguments.length,b=new Array(d),_=0;_<d;_++)b[_]=arguments[_];l===void 0&&(l=tt()),l(b.length>0,"At least one arg needs to be specified");var q="The ",E=b.length;switch(b=b.map(function(R){return'"'.concat(R,'"')}),E){case 1:q+="".concat(b[0]," argument");break;case 2:q+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:q+=b.slice(0,E-1).join(", "),q+=", and ".concat(b[E-1]," arguments");break}return"".concat(q," must be specified")},TypeError),ho.codes=h,ho}var fo,pm;function rq(){if(pm)return fo;pm=1;function a(H,N){var V=Object.keys(H);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(H);N&&(K=K.filter(function(x){return Object.getOwnPropertyDescriptor(H,x).enumerable})),V.push.apply(V,K)}return V}function s(H){for(var N=1;N<arguments.length;N++){var V=arguments[N]!=null?arguments[N]:{};N%2?a(Object(V),!0).forEach(function(K){i(H,K,V[K])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(V)):a(Object(V)).forEach(function(K){Object.defineProperty(H,K,Object.getOwnPropertyDescriptor(V,K))})}return H}function i(H,N,V){return N=r(N),N in H?Object.defineProperty(H,N,{value:V,enumerable:!0,configurable:!0,writable:!0}):H[N]=V,H}function n(H,N){if(!(H instanceof N))throw new TypeError("Cannot call a class as a function")}function t(H,N){for(var V=0;V<N.length;V++){var K=N[V];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(H,r(K.key),K)}}function o(H,N,V){return N&&t(H.prototype,N),Object.defineProperty(H,"prototype",{writable:!1}),H}function r(H){var N=e(H,"string");return d(N)==="symbol"?N:String(N)}function e(H,N){if(d(H)!=="object"||H===null)return H;var V=H[Symbol.toPrimitive];if(V!==void 0){var K=V.call(H,N);if(d(K)!=="object")return K;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}function c(H,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(N&&N.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),Object.defineProperty(H,"prototype",{writable:!1}),N&&m(H,N)}function u(H){var N=w();return function(){var K=g(H),x;if(N){var S=g(this).constructor;x=Reflect.construct(K,arguments,S)}else x=K.apply(this,arguments);return h(this,x)}}function h(H,N){if(N&&(d(N)==="object"||typeof N=="function"))return N;if(N!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(H)}function l(H){if(H===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H}function f(H){var N=typeof Map=="function"?new Map:void 0;return f=function(K){if(K===null||!C(K))return K;if(typeof K!="function")throw new TypeError("Super expression must either be null or a function");if(typeof N<"u"){if(N.has(K))return N.get(K);N.set(K,x)}function x(){return p(K,arguments,g(this).constructor)}return x.prototype=Object.create(K.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m(x,K)},f(H)}function p(H,N,V){return w()?p=Reflect.construct.bind():p=function(x,S,I){var k=[null];k.push.apply(k,S);var X=Function.bind.apply(x,k),z=new X;return I&&m(z,I.prototype),z},p.apply(null,arguments)}function w(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(H){return Function.toString.call(H).indexOf("[native code]")!==-1}function m(H,N){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(K,x){return K.__proto__=x,K},m(H,N)}function g(H){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(V){return V.__proto__||Object.getPrototypeOf(V)},g(H)}function d(H){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},d(H)}var b=Ee(),_=b.inspect,q=lw(),E=q.codes.ERR_INVALID_ARG_TYPE;function R(H,N,V){return(V===void 0||V>H.length)&&(V=H.length),H.substring(V-N.length,V)===N}function $(H,N){if(N=Math.floor(N),H.length==0||N==0)return"";var V=H.length*N;for(N=Math.floor(Math.log(N)/Math.log(2));N;)H+=H,N--;return H+=H.substring(0,V-H.length),H}var M="",v="",T="",B="",F={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},y=10;function A(H){var N=Object.keys(H),V=Object.create(Object.getPrototypeOf(H));return N.forEach(function(K){V[K]=H[K]}),Object.defineProperty(V,"message",{value:H.message}),V}function j(H){return _(H,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Y(H,N,V){var K="",x="",S=0,I="",k=!1,X=j(H),z=X.split(`
11
+ `),W=j(N).split(`
12
+ `),J=0,re="";if(V==="strictEqual"&&d(H)==="object"&&d(N)==="object"&&H!==null&&N!==null&&(V="strictEqualObject"),z.length===1&&W.length===1&&z[0]!==W[0]){var ie=z[0].length+W[0].length;if(ie<=y){if((d(H)!=="object"||H===null)&&(d(N)!=="object"||N===null)&&(H!==0||N!==0))return"".concat(F[V],`
13
+
14
+ `)+"".concat(z[0]," !== ").concat(W[0],`
15
+ `)}else if(V!=="strictEqualObject"){var se=pe.stderr&&pe.stderr.isTTY?pe.stderr.columns:80;if(ie<se){for(;z[0][J]===W[0][J];)J++;J>2&&(re=`
16
+ `.concat($(" ",J),"^"),J=0)}}}for(var P=z[z.length-1],Q=W[W.length-1];P===Q&&(J++<2?I=`
17
+ `.concat(P).concat(I):K=P,z.pop(),W.pop(),!(z.length===0||W.length===0));)P=z[z.length-1],Q=W[W.length-1];var ae=Math.max(z.length,W.length);if(ae===0){var oe=X.split(`
18
+ `);if(oe.length>30)for(oe[26]="".concat(M,"...").concat(B);oe.length>27;)oe.pop();return"".concat(F.notIdentical,`
19
+
20
+ `).concat(oe.join(`
21
+ `),`
22
+ `)}J>3&&(I=`
23
+ `.concat(M,"...").concat(B).concat(I),k=!0),K!==""&&(I=`
24
+ `.concat(K).concat(I),K="");var de=0,G=F[V]+`
25
+ `.concat(v,"+ actual").concat(B," ").concat(T,"- expected").concat(B),we=" ".concat(M,"...").concat(B," Lines skipped");for(J=0;J<ae;J++){var ce=J-S;if(z.length<J+1)ce>1&&J>2&&(ce>4?(x+=`
26
+ `.concat(M,"...").concat(B),k=!0):ce>3&&(x+=`
27
+ `.concat(W[J-2]),de++),x+=`
28
+ `.concat(W[J-1]),de++),S=J,K+=`
29
+ `.concat(T,"-").concat(B," ").concat(W[J]),de++;else if(W.length<J+1)ce>1&&J>2&&(ce>4?(x+=`
30
+ `.concat(M,"...").concat(B),k=!0):ce>3&&(x+=`
31
+ `.concat(z[J-2]),de++),x+=`
32
+ `.concat(z[J-1]),de++),S=J,x+=`
33
+ `.concat(v,"+").concat(B," ").concat(z[J]),de++;else{var ge=W[J],le=z[J],L=le!==ge&&(!R(le,",")||le.slice(0,-1)!==ge);L&&R(ge,",")&&ge.slice(0,-1)===le&&(L=!1,le+=","),L?(ce>1&&J>2&&(ce>4?(x+=`
34
+ `.concat(M,"...").concat(B),k=!0):ce>3&&(x+=`
35
+ `.concat(z[J-2]),de++),x+=`
36
+ `.concat(z[J-1]),de++),S=J,x+=`
37
+ `.concat(v,"+").concat(B," ").concat(le),K+=`
38
+ `.concat(T,"-").concat(B," ").concat(ge),de+=2):(x+=K,K="",(ce===1||J===0)&&(x+=`
39
+ `.concat(le),de++))}if(de>20&&J<ae-2)return"".concat(G).concat(we,`
40
+ `).concat(x,`
41
+ `).concat(M,"...").concat(B).concat(K,`
42
+ `)+"".concat(M,"...").concat(B)}return"".concat(G).concat(k?we:"",`
43
+ `).concat(x).concat(K).concat(I).concat(re)}var ee=(function(H,N){c(K,H);var V=u(K);function K(x){var S;if(n(this,K),d(x)!=="object"||x===null)throw new E("options","Object",x);var I=x.message,k=x.operator,X=x.stackStartFn,z=x.actual,W=x.expected,J=Error.stackTraceLimit;if(Error.stackTraceLimit=0,I!=null)S=V.call(this,String(I));else if(pe.stderr&&pe.stderr.isTTY&&(pe.stderr&&pe.stderr.getColorDepth&&pe.stderr.getColorDepth()!==1?(M="\x1B[34m",v="\x1B[32m",B="\x1B[39m",T="\x1B[31m"):(M="",v="",B="",T="")),d(z)==="object"&&z!==null&&d(W)==="object"&&W!==null&&"stack"in z&&z instanceof Error&&"stack"in W&&W instanceof Error&&(z=A(z),W=A(W)),k==="deepStrictEqual"||k==="strictEqual")S=V.call(this,Y(z,W,k));else if(k==="notDeepStrictEqual"||k==="notStrictEqual"){var re=F[k],ie=j(z).split(`
44
+ `);if(k==="notStrictEqual"&&d(z)==="object"&&z!==null&&(re=F.notStrictEqualObject),ie.length>30)for(ie[26]="".concat(M,"...").concat(B);ie.length>27;)ie.pop();ie.length===1?S=V.call(this,"".concat(re," ").concat(ie[0])):S=V.call(this,"".concat(re,`
45
+
46
+ `).concat(ie.join(`
47
+ `),`
48
+ `))}else{var se=j(z),P="",Q=F[k];k==="notDeepEqual"||k==="notEqual"?(se="".concat(F[k],`
49
+
50
+ `).concat(se),se.length>1024&&(se="".concat(se.slice(0,1021),"..."))):(P="".concat(j(W)),se.length>512&&(se="".concat(se.slice(0,509),"...")),P.length>512&&(P="".concat(P.slice(0,509),"...")),k==="deepEqual"||k==="equal"?se="".concat(Q,`
51
+
52
+ `).concat(se,`
53
+
54
+ should equal
55
+
56
+ `):P=" ".concat(k," ").concat(P)),S=V.call(this,"".concat(se).concat(P))}return Error.stackTraceLimit=J,S.generatedMessage=!I,Object.defineProperty(l(S),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),S.code="ERR_ASSERTION",S.actual=z,S.expected=W,S.operator=k,Error.captureStackTrace&&Error.captureStackTrace(l(S),X),S.stack,S.name="AssertionError",h(S)}return o(K,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:N,value:function(S,I){return _(this,s(s({},I),{},{customInspect:!1,depth:0}))}}]),K})(f(Error),_.custom);return fo=ee,fo}var po,mm;function cw(){if(mm)return po;mm=1;var a=Object.prototype.toString;return po=function(i){var n=a.call(i),t=n==="[object Arguments]";return t||(t=n!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&a.call(i.callee)==="[object Function]"),t},po}var mo,gm;function nq(){if(gm)return mo;gm=1;var a;if(!Object.keys){var s=Object.prototype.hasOwnProperty,i=Object.prototype.toString,n=cw(),t=Object.prototype.propertyIsEnumerable,o=!t.call({toString:null},"toString"),r=t.call(function(){},"prototype"),e=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var p=f.constructor;return p&&p.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&s.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1})(),l=function(f){if(typeof window>"u"||!h)return c(f);try{return c(f)}catch{return!1}};a=function(p){var w=p!==null&&typeof p=="object",C=i.call(p)==="[object Function]",m=n(p),g=w&&i.call(p)==="[object String]",d=[];if(!w&&!C&&!m)throw new TypeError("Object.keys called on a non-object");var b=r&&C;if(g&&p.length>0&&!s.call(p,0))for(var _=0;_<p.length;++_)d.push(String(_));if(m&&p.length>0)for(var q=0;q<p.length;++q)d.push(String(q));else for(var E in p)!(b&&E==="prototype")&&s.call(p,E)&&d.push(String(E));if(o)for(var R=l(p),$=0;$<e.length;++$)!(R&&e[$]==="constructor")&&s.call(p,e[$])&&d.push(e[$]);return d}}return mo=a,mo}var go,ym;function hw(){if(ym)return go;ym=1;var a=Array.prototype.slice,s=cw(),i=Object.keys,n=i?function(r){return i(r)}:nq(),t=Object.keys;return n.shim=function(){if(Object.keys){var r=(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2);r||(Object.keys=function(c){return s(c)?t(a.call(c)):t(c)})}else Object.keys=n;return Object.keys||n},go=n,go}var yo,bm;function iq(){if(bm)return yo;bm=1;var a=hw(),s=bc()(),i=nt(),n=_c(),t=i("Array.prototype.push"),o=i("Object.prototype.propertyIsEnumerable"),r=s?n.getOwnPropertySymbols:null;return yo=function(c,u){if(c==null)throw new TypeError("target must be an object");var h=n(c);if(arguments.length===1)return h;for(var l=1;l<arguments.length;++l){var f=n(arguments[l]),p=a(f),w=s&&(n.getOwnPropertySymbols||r);if(w)for(var C=w(f),m=0;m<C.length;++m){var g=C[m];o(f,g)&&t(p,g)}for(var d=0;d<p.length;++d){var b=p[d];if(o(f,b)){var _=f[b];h[b]=_}}}return h},yo}var bo,_m;function sq(){if(_m)return bo;_m=1;var a=iq(),s=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",t=n.split(""),o={},r=0;r<t.length;++r)o[t[r]]=t[r];var e=Object.assign({},o),c="";for(var u in e)c+=u;return n!==c},i=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return bo=function(){return!Object.assign||s()||i()?a:Object.assign},bo}var _o,wm;function fw(){if(wm)return _o;wm=1;var a=function(s){return s!==s};return _o=function(i,n){return i===0&&n===0?1/i===1/n:!!(i===n||a(i)&&a(n))},_o}var wo,vm;function Dc(){if(vm)return wo;vm=1;var a=fw();return wo=function(){return typeof Object.is=="function"?Object.is:a},wo}var vo,Cm;function oq(){if(Cm)return vo;Cm=1;var a=Ec(),s=Ut(),i=s(a("String.prototype.indexOf"));return vo=function(t,o){var r=a(t,!!o);return typeof r=="function"&&i(t,".prototype.")>-1?s(r):r},vo}var Co,qm;function rr(){if(qm)return Co;qm=1;var a=hw(),s=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",i=Object.prototype.toString,n=Array.prototype.concat,t=S_(),o=function(u){return typeof u=="function"&&i.call(u)==="[object Function]"},r=O_()(),e=function(u,h,l,f){if(h in u){if(f===!0){if(u[h]===l)return}else if(!o(f)||!f())return}r?t(u,h,l,!0):t(u,h,l)},c=function(u,h){var l=arguments.length>2?arguments[2]:{},f=a(h);s&&(f=n.call(f,Object.getOwnPropertySymbols(h)));for(var p=0;p<f.length;p+=1)e(u,f[p],h[f[p]],l[f[p]])};return c.supportsDescriptors=!!r,Co=c,Co}var qo,Em;function aq(){if(Em)return qo;Em=1;var a=Dc(),s=rr();return qo=function(){var n=a();return s(Object,{is:n},{is:function(){return Object.is!==n}}),n},qo}var Eo,Am;function uq(){if(Am)return Eo;Am=1;var a=rr(),s=Ut(),i=fw(),n=Dc(),t=aq(),o=s(n(),Object);return a(o,{getPolyfill:n,implementation:i,shim:t}),Eo=o,Eo}var Ao,Rm;function dw(){return Rm||(Rm=1,Ao=function(s){return s!==s}),Ao}var Ro,Tm;function pw(){if(Tm)return Ro;Tm=1;var a=dw();return Ro=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:a},Ro}var To,Sm;function lq(){if(Sm)return To;Sm=1;var a=rr(),s=pw();return To=function(){var n=s();return a(Number,{isNaN:n},{isNaN:function(){return Number.isNaN!==n}}),n},To}var So,Om;function cq(){if(Om)return So;Om=1;var a=Ut(),s=rr(),i=dw(),n=pw(),t=lq(),o=a(n(),Number);return s(o,{getPolyfill:n,implementation:i,shim:t}),So=o,So}var Oo,Nm;function hq(){if(Nm)return Oo;Nm=1;function a(L,U){return o(L)||t(L,U)||i(L,U)||s()}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(L,U){if(L){if(typeof L=="string")return n(L,U);var Z=Object.prototype.toString.call(L).slice(8,-1);if(Z==="Object"&&L.constructor&&(Z=L.constructor.name),Z==="Map"||Z==="Set")return Array.from(L);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return n(L,U)}}function n(L,U){(U==null||U>L.length)&&(U=L.length);for(var Z=0,ne=new Array(U);Z<U;Z++)ne[Z]=L[Z];return ne}function t(L,U){var Z=L==null?null:typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(Z!=null){var ne,D,O,te,he=[],fe=!0,me=!1;try{if(O=(Z=Z.call(L)).next,U!==0)for(;!(fe=(ne=O.call(Z)).done)&&(he.push(ne.value),he.length!==U);fe=!0);}catch(be){me=!0,D=be}finally{try{if(!fe&&Z.return!=null&&(te=Z.return(),Object(te)!==te))return}finally{if(me)throw D}}return he}}function o(L){if(Array.isArray(L))return L}function r(L){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},r(L)}var e=/a/g.flags!==void 0,c=function(U){var Z=[];return U.forEach(function(ne){return Z.push(ne)}),Z},u=function(U){var Z=[];return U.forEach(function(ne,D){return Z.push([D,ne])}),Z},h=Object.is?Object.is:uq(),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:cq();function p(L){return L.call.bind(L)}var w=p(Object.prototype.hasOwnProperty),C=p(Object.prototype.propertyIsEnumerable),m=p(Object.prototype.toString),g=Ee().types,d=g.isAnyArrayBuffer,b=g.isArrayBufferView,_=g.isDate,q=g.isMap,E=g.isRegExp,R=g.isSet,$=g.isNativeError,M=g.isBoxedPrimitive,v=g.isNumberObject,T=g.isStringObject,B=g.isBooleanObject,F=g.isBigIntObject,y=g.isSymbolObject,A=g.isFloat32Array,j=g.isFloat64Array;function Y(L){if(L.length===0||L.length>10)return!0;for(var U=0;U<L.length;U++){var Z=L.charCodeAt(U);if(Z<48||Z>57)return!0}return L.length===10&&L>=Math.pow(2,32)}function ee(L){return Object.keys(L).filter(Y).concat(l(L).filter(Object.prototype.propertyIsEnumerable.bind(L)))}function H(L,U){if(L===U)return 0;for(var Z=L.length,ne=U.length,D=0,O=Math.min(Z,ne);D<O;++D)if(L[D]!==U[D]){Z=L[D],ne=U[D];break}return Z<ne?-1:ne<Z?1:0}var N=!0,V=!1,K=0,x=1,S=2,I=3;function k(L,U){return e?L.source===U.source&&L.flags===U.flags:RegExp.prototype.toString.call(L)===RegExp.prototype.toString.call(U)}function X(L,U){if(L.byteLength!==U.byteLength)return!1;for(var Z=0;Z<L.byteLength;Z++)if(L[Z]!==U[Z])return!1;return!0}function z(L,U){return L.byteLength!==U.byteLength?!1:H(new Uint8Array(L.buffer,L.byteOffset,L.byteLength),new Uint8Array(U.buffer,U.byteOffset,U.byteLength))===0}function W(L,U){return L.byteLength===U.byteLength&&H(new Uint8Array(L),new Uint8Array(U))===0}function J(L,U){return v(L)?v(U)&&h(Number.prototype.valueOf.call(L),Number.prototype.valueOf.call(U)):T(L)?T(U)&&String.prototype.valueOf.call(L)===String.prototype.valueOf.call(U):B(L)?B(U)&&Boolean.prototype.valueOf.call(L)===Boolean.prototype.valueOf.call(U):F(L)?F(U)&&BigInt.prototype.valueOf.call(L)===BigInt.prototype.valueOf.call(U):y(U)&&Symbol.prototype.valueOf.call(L)===Symbol.prototype.valueOf.call(U)}function re(L,U,Z,ne){if(L===U)return L!==0?!0:Z?h(L,U):!0;if(Z){if(r(L)!=="object")return typeof L=="number"&&f(L)&&f(U);if(r(U)!=="object"||L===null||U===null||Object.getPrototypeOf(L)!==Object.getPrototypeOf(U))return!1}else{if(L===null||r(L)!=="object")return U===null||r(U)!=="object"?L==U:!1;if(U===null||r(U)!=="object")return!1}var D=m(L),O=m(U);if(D!==O)return!1;if(Array.isArray(L)){if(L.length!==U.length)return!1;var te=ee(L),he=ee(U);return te.length!==he.length?!1:se(L,U,Z,ne,x,te)}if(D==="[object Object]"&&(!q(L)&&q(U)||!R(L)&&R(U)))return!1;if(_(L)){if(!_(U)||Date.prototype.getTime.call(L)!==Date.prototype.getTime.call(U))return!1}else if(E(L)){if(!E(U)||!k(L,U))return!1}else if($(L)||L instanceof Error){if(L.message!==U.message||L.name!==U.name)return!1}else if(b(L)){if(!Z&&(A(L)||j(L))){if(!X(L,U))return!1}else if(!z(L,U))return!1;var fe=ee(L),me=ee(U);return fe.length!==me.length?!1:se(L,U,Z,ne,K,fe)}else{if(R(L))return!R(U)||L.size!==U.size?!1:se(L,U,Z,ne,S);if(q(L))return!q(U)||L.size!==U.size?!1:se(L,U,Z,ne,I);if(d(L)){if(!W(L,U))return!1}else if(M(L)&&!J(L,U))return!1}return se(L,U,Z,ne,K)}function ie(L,U){return U.filter(function(Z){return C(L,Z)})}function se(L,U,Z,ne,D,O){if(arguments.length===5){O=Object.keys(L);var te=Object.keys(U);if(O.length!==te.length)return!1}for(var he=0;he<O.length;he++)if(!w(U,O[he]))return!1;if(Z&&arguments.length===5){var fe=l(L);if(fe.length!==0){var me=0;for(he=0;he<fe.length;he++){var be=fe[he];if(C(L,be)){if(!C(U,be))return!1;O.push(be),me++}else if(C(U,be))return!1}var dt=l(U);if(fe.length!==dt.length&&ie(U,dt).length!==me)return!1}else{var Xe=l(U);if(Xe.length!==0&&ie(U,Xe).length!==0)return!1}}if(O.length===0&&(D===K||D===x&&L.length===0||L.size===0))return!0;if(ne===void 0)ne={val1:new Map,val2:new Map,position:0};else{var pt=ne.val1.get(L);if(pt!==void 0){var $e=ne.val2.get(U);if($e!==void 0)return pt===$e}ne.position++}ne.val1.set(L,ne.position),ne.val2.set(U,ne.position);var mt=ce(L,U,Z,O,ne,D);return ne.val1.delete(L),ne.val2.delete(U),mt}function P(L,U,Z,ne){for(var D=c(L),O=0;O<D.length;O++){var te=D[O];if(re(U,te,Z,ne))return L.delete(te),!0}return!1}function Q(L){switch(r(L)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":L=+L;case"number":if(f(L))return!1}return!0}function ae(L,U,Z){var ne=Q(Z);return ne??(U.has(ne)&&!L.has(ne))}function oe(L,U,Z,ne,D){var O=Q(Z);if(O!=null)return O;var te=U.get(O);return te===void 0&&!U.has(O)||!re(ne,te,!1,D)?!1:!L.has(O)&&re(ne,te,!1,D)}function de(L,U,Z,ne){for(var D=null,O=c(L),te=0;te<O.length;te++){var he=O[te];if(r(he)==="object"&&he!==null)D===null&&(D=new Set),D.add(he);else if(!U.has(he)){if(Z||!ae(L,U,he))return!1;D===null&&(D=new Set),D.add(he)}}if(D!==null){for(var fe=c(U),me=0;me<fe.length;me++){var be=fe[me];if(r(be)==="object"&&be!==null){if(!P(D,be,Z,ne))return!1}else if(!Z&&!L.has(be)&&!P(D,be,Z,ne))return!1}return D.size===0}return!0}function G(L,U,Z,ne,D,O){for(var te=c(L),he=0;he<te.length;he++){var fe=te[he];if(re(Z,fe,D,O)&&re(ne,U.get(fe),D,O))return L.delete(fe),!0}return!1}function we(L,U,Z,ne){for(var D=null,O=u(L),te=0;te<O.length;te++){var he=a(O[te],2),fe=he[0],me=he[1];if(r(fe)==="object"&&fe!==null)D===null&&(D=new Set),D.add(fe);else{var be=U.get(fe);if(be===void 0&&!U.has(fe)||!re(me,be,Z,ne)){if(Z||!oe(L,U,fe,me,ne))return!1;D===null&&(D=new Set),D.add(fe)}}}if(D!==null){for(var dt=u(U),Xe=0;Xe<dt.length;Xe++){var pt=a(dt[Xe],2),$e=pt[0],mt=pt[1];if(r($e)==="object"&&$e!==null){if(!G(D,L,$e,mt,Z,ne))return!1}else if(!Z&&(!L.has($e)||!re(L.get($e),mt,!1,ne))&&!G(D,L,$e,mt,!1,ne))return!1}return D.size===0}return!0}function ce(L,U,Z,ne,D,O){var te=0;if(O===S){if(!de(L,U,Z,D))return!1}else if(O===I){if(!we(L,U,Z,D))return!1}else if(O===x)for(;te<L.length;te++)if(w(L,te)){if(!w(U,te)||!re(L[te],U[te],Z,D))return!1}else{if(w(U,te))return!1;for(var he=Object.keys(L);te<he.length;te++){var fe=he[te];if(!w(U,fe)||!re(L[fe],U[fe],Z,D))return!1}return he.length===Object.keys(U).length}for(te=0;te<ne.length;te++){var me=ne[te];if(!re(L[me],U[me],Z,D))return!1}return!0}function ge(L,U){return re(L,U,V)}function le(L,U){return re(L,U,N)}return Oo={isDeepEqual:ge,isDeepStrictEqual:le},Oo}var Im;function tt(){if(Im)return co.exports;Im=1;function a(S){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},a(S)}function s(S,I,k){return Object.defineProperty(S,"prototype",{writable:!1}),S}function i(S,I){if(!(S instanceof I))throw new TypeError("Cannot call a class as a function")}var n=lw(),t=n.codes,o=t.ERR_AMBIGUOUS_ARGUMENT,r=t.ERR_INVALID_ARG_TYPE,e=t.ERR_INVALID_ARG_VALUE,c=t.ERR_INVALID_RETURN_VALUE,u=t.ERR_MISSING_ARGS,h=rq(),l=Ee(),f=l.inspect,p=Ee().types,w=p.isPromise,C=p.isRegExp,m=sq()(),g=Dc()(),d=oq()("RegExp.prototype.test"),b,_;function q(){var S=hq();b=S.isDeepEqual,_=S.isDeepStrictEqual}var E=!1,R=co.exports=B,$={};function M(S){throw S.message instanceof Error?S.message:new h(S)}function v(S,I,k,X,z){var W=arguments.length,J;if(W===0)J="Failed";else if(W===1)k=S,S=void 0;else{if(E===!1){E=!0;var re=pe.emitWarning?pe.emitWarning:console.warn.bind(console);re("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}W===2&&(X="!=")}if(k instanceof Error)throw k;var ie={actual:S,expected:I,operator:X===void 0?"fail":X,stackStartFn:z||v};k!==void 0&&(ie.message=k);var se=new h(ie);throw J&&(se.message=J,se.generatedMessage=!0),se}R.fail=v,R.AssertionError=h;function T(S,I,k,X){if(!k){var z=!1;if(I===0)z=!0,X="No value argument passed to `assert.ok()`";else if(X instanceof Error)throw X;var W=new h({actual:k,expected:!0,message:X,operator:"==",stackStartFn:S});throw W.generatedMessage=z,W}}function B(){for(var S=arguments.length,I=new Array(S),k=0;k<S;k++)I[k]=arguments[k];T.apply(void 0,[B,I.length].concat(I))}R.ok=B,R.equal=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");I!=k&&M({actual:I,expected:k,message:X,operator:"==",stackStartFn:S})},R.notEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");I==k&&M({actual:I,expected:k,message:X,operator:"!=",stackStartFn:S})},R.deepEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");b===void 0&&q(),b(I,k)||M({actual:I,expected:k,message:X,operator:"deepEqual",stackStartFn:S})},R.notDeepEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");b===void 0&&q(),b(I,k)&&M({actual:I,expected:k,message:X,operator:"notDeepEqual",stackStartFn:S})},R.deepStrictEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");b===void 0&&q(),_(I,k)||M({actual:I,expected:k,message:X,operator:"deepStrictEqual",stackStartFn:S})},R.notDeepStrictEqual=F;function F(S,I,k){if(arguments.length<2)throw new u("actual","expected");b===void 0&&q(),_(S,I)&&M({actual:S,expected:I,message:k,operator:"notDeepStrictEqual",stackStartFn:F})}R.strictEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");g(I,k)||M({actual:I,expected:k,message:X,operator:"strictEqual",stackStartFn:S})},R.notStrictEqual=function S(I,k,X){if(arguments.length<2)throw new u("actual","expected");g(I,k)&&M({actual:I,expected:k,message:X,operator:"notStrictEqual",stackStartFn:S})};var y=s(function S(I,k,X){var z=this;i(this,S),k.forEach(function(W){W in I&&(X!==void 0&&typeof X[W]=="string"&&C(I[W])&&d(I[W],X[W])?z[W]=X[W]:z[W]=I[W])})});function A(S,I,k,X,z,W){if(!(k in S)||!_(S[k],I[k])){if(!X){var J=new y(S,z),re=new y(I,z,S),ie=new h({actual:J,expected:re,operator:"deepStrictEqual",stackStartFn:W});throw ie.actual=S,ie.expected=I,ie.operator=W.name,ie}M({actual:S,expected:I,message:X,operator:W.name,stackStartFn:W})}}function j(S,I,k,X){if(typeof I!="function"){if(C(I))return d(I,S);if(arguments.length===2)throw new r("expected",["Function","RegExp"],I);if(a(S)!=="object"||S===null){var z=new h({actual:S,expected:I,message:k,operator:"deepStrictEqual",stackStartFn:X});throw z.operator=X.name,z}var W=Object.keys(I);if(I instanceof Error)W.push("name","message");else if(W.length===0)throw new e("error",I,"may not be an empty object");return b===void 0&&q(),W.forEach(function(J){typeof S[J]=="string"&&C(I[J])&&d(I[J],S[J])||A(S,I,J,k,W,X)}),!0}return I.prototype!==void 0&&S instanceof I?!0:Error.isPrototypeOf(I)?!1:I.call({},S)===!0}function Y(S){if(typeof S!="function")throw new r("fn","Function",S);try{S()}catch(I){return I}return $}function ee(S){return w(S)||S!==null&&a(S)==="object"&&typeof S.then=="function"&&typeof S.catch=="function"}function H(S){return Promise.resolve().then(function(){var I;if(typeof S=="function"){if(I=S(),!ee(I))throw new c("instance of Promise","promiseFn",I)}else if(ee(S))I=S;else throw new r("promiseFn",["Function","Promise"],S);return Promise.resolve().then(function(){return I}).then(function(){return $}).catch(function(k){return k})})}function N(S,I,k,X){if(typeof k=="string"){if(arguments.length===4)throw new r("error",["Object","Error","Function","RegExp"],k);if(a(I)==="object"&&I!==null){if(I.message===k)throw new o("error/message",'The error message "'.concat(I.message,'" is identical to the message.'))}else if(I===k)throw new o("error/message",'The error "'.concat(I,'" is identical to the message.'));X=k,k=void 0}else if(k!=null&&a(k)!=="object"&&typeof k!="function")throw new r("error",["Object","Error","Function","RegExp"],k);if(I===$){var z="";k&&k.name&&(z+=" (".concat(k.name,")")),z+=X?": ".concat(X):".";var W=S.name==="rejects"?"rejection":"exception";M({actual:void 0,expected:k,operator:S.name,message:"Missing expected ".concat(W).concat(z),stackStartFn:S})}if(k&&!j(I,k,X,S))throw I}function V(S,I,k,X){if(I!==$){if(typeof k=="string"&&(X=k,k=void 0),!k||j(I,k)){var z=X?": ".concat(X):".",W=S.name==="doesNotReject"?"rejection":"exception";M({actual:I,expected:k,operator:S.name,message:"Got unwanted ".concat(W).concat(z,`
58
+ `)+'Actual message: "'.concat(I&&I.message,'"'),stackStartFn:S})}throw I}}R.throws=function S(I){for(var k=arguments.length,X=new Array(k>1?k-1:0),z=1;z<k;z++)X[z-1]=arguments[z];N.apply(void 0,[S,Y(I)].concat(X))},R.rejects=function S(I){for(var k=arguments.length,X=new Array(k>1?k-1:0),z=1;z<k;z++)X[z-1]=arguments[z];return H(I).then(function(W){return N.apply(void 0,[S,W].concat(X))})},R.doesNotThrow=function S(I){for(var k=arguments.length,X=new Array(k>1?k-1:0),z=1;z<k;z++)X[z-1]=arguments[z];V.apply(void 0,[S,Y(I)].concat(X))},R.doesNotReject=function S(I){for(var k=arguments.length,X=new Array(k>1?k-1:0),z=1;z<k;z++)X[z-1]=arguments[z];return H(I).then(function(W){return V.apply(void 0,[S,W].concat(X))})},R.ifError=function S(I){if(I!=null){var k="ifError got unwanted exception: ";a(I)==="object"&&typeof I.message=="string"?I.message.length===0&&I.constructor?k+=I.constructor.name:k+=I.message:k+=f(I);var X=new h({actual:I,expected:null,operator:"ifError",message:k,stackStartFn:S}),z=I.stack;if(typeof z=="string"){var W=z.split(`
59
+ `);W.shift();for(var J=X.stack.split(`
60
+ `),re=0;re<W.length;re++){var ie=J.indexOf(W[re]);if(ie!==-1){J=J.slice(0,ie);break}}X.stack="".concat(J.join(`
61
+ `),`
62
+ `).concat(W.join(`
63
+ `))}throw X}};function K(S,I,k,X,z){if(!C(I))throw new r("regexp","RegExp",I);var W=z==="match";if(typeof S!="string"||d(I,S)!==W){if(k instanceof Error)throw k;var J=!k;k=k||(typeof S!="string"?'The "string" argument must be of type string. Received type '+"".concat(a(S)," (").concat(f(S),")"):(W?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(f(I),`. Input:
64
+
65
+ `).concat(f(S),`
66
+ `));var re=new h({actual:S,expected:I,message:k,operator:z,stackStartFn:X});throw re.generatedMessage=J,re}}R.match=function S(I,k,X){K(I,k,X,S,"match")},R.doesNotMatch=function S(I,k,X){K(I,k,X,S,"doesNotMatch")};function x(){for(var S=arguments.length,I=new Array(S),k=0;k<S;k++)I[k]=arguments[k];T.apply(void 0,[x,I.length].concat(I))}return R.strict=m(x,R,{equal:R.strictEqual,deepEqual:R.deepStrictEqual,notEqual:R.notStrictEqual,notDeepEqual:R.notDeepStrictEqual}),R.strict.strict=R.strict,co.exports}var No,$m;function We(){if($m)return No;$m=1;var a=Jt(),s=Qe(),i=Mc(),n=xe(),t=qt(),o=He(),r=Object.prototype,e=r.hasOwnProperty,c=i(function(u,h){if(t(h)||n(h)){s(h,o(h),u);return}for(var l in h)e.call(h,l)&&a(u,l,h[l])});return No=c,No}var Io,xm;function Fc(){if(xm)return Io;xm=1;var a=z_(),s=4;function i(n){return a(n,s)}return Io=i,Io}var $o,Pm;function mw(){if(Pm)return $o;Pm=1;var a=tw(),s=He();function i(n,t){return n&&a(n,t,s)}return $o=i,$o}var xo,jm;function fq(){if(jm)return xo;jm=1;var a=xe();function s(i,n){return function(t,o){if(t==null)return t;if(!a(t))return i(t,o);for(var r=t.length,e=n?r:-1,c=Object(t);(n?e--:++e<r)&&o(c[e],e,c)!==!1;);return t}}return xo=s,xo}var Po,Lm;function ut(){if(Lm)return Po;Lm=1;var a=mw(),s=fq(),i=s(a);return Po=i,Po}var jo,Bm;function dq(){if(Bm)return jo;Bm=1;var a=Re();function s(i){return typeof i=="function"?i:a}return jo=s,jo}var Lo,Mm;function pq(){if(Mm)return Lo;Mm=1;var a=Sc(),s=ut(),i=dq(),n=_e();function t(o,r){var e=n(o)?a:s;return e(o,i(r))}return Lo=t,Lo}var Bo,km;function Et(){return km||(km=1,Bo=pq()),Bo}var Mo,Dm;function Te(){if(Dm)return Mo;Dm=1;var a=L_(),s=at(),i=Ct(),n=_e(),t=xe(),o=st(),r=qt(),e=ot(),c="[object Map]",u="[object Set]",h=Object.prototype,l=h.hasOwnProperty;function f(p){if(p==null)return!0;if(t(p)&&(n(p)||typeof p=="string"||typeof p.splice=="function"||o(p)||e(p)||i(p)))return!p.length;var w=s(p);if(w==c||w==u)return!p.size;if(r(p))return!a(p).length;for(var C in p)if(l.call(p,C))return!1;return!0}return Mo=f,Mo}var ko,Fm;function mq(){if(Fm)return ko;Fm=1;function a(s){var i=s==null?0:s.length;return i?s[i-1]:void 0}return ko=a,ko}var Do,Um;function gw(){if(Um)return Do;Um=1;var a=ut();function s(i,n){var t=[];return a(i,function(o,r,e){n(o,r,e)&&t.push(o)}),t}return Do=s,Do}var Fo,Qm;function gq(){if(Qm)return Fo;Qm=1;var a="__lodash_hash_undefined__";function s(i){return this.__data__.set(i,a),this}return Fo=s,Fo}var Uo,Hm;function yq(){if(Hm)return Uo;Hm=1;function a(s){return this.__data__.has(s)}return Uo=a,Uo}var Qo,Vm;function yw(){if(Vm)return Qo;Vm=1;var a=Tc(),s=gq(),i=yq();function n(t){var o=-1,r=t==null?0:t.length;for(this.__data__=new a;++o<r;)this.add(t[o])}return n.prototype.add=n.prototype.push=s,n.prototype.has=i,Qo=n,Qo}var Ho,Wm;function bw(){if(Wm)return Ho;Wm=1;function a(s,i){for(var n=-1,t=s==null?0:s.length;++n<t;)if(i(s[n],n,s))return!0;return!1}return Ho=a,Ho}var Vo,Gm;function _w(){if(Gm)return Vo;Gm=1;function a(s,i){return s.has(i)}return Vo=a,Vo}var Wo,zm;function ww(){if(zm)return Wo;zm=1;var a=yw(),s=bw(),i=_w(),n=1,t=2;function o(r,e,c,u,h,l){var f=c&n,p=r.length,w=e.length;if(p!=w&&!(f&&w>p))return!1;var C=l.get(r),m=l.get(e);if(C&&m)return C==e&&m==r;var g=-1,d=!0,b=c&t?new a:void 0;for(l.set(r,e),l.set(e,r);++g<p;){var _=r[g],q=e[g];if(u)var E=f?u(q,_,g,e,r,l):u(_,q,g,r,e,l);if(E!==void 0){if(E)continue;d=!1;break}if(b){if(!s(e,function(R,$){if(!i(b,$)&&(_===R||h(_,R,c,u,l)))return b.push($)})){d=!1;break}}else if(!(_===q||h(_,q,c,u,l))){d=!1;break}}return l.delete(r),l.delete(e),d}return Wo=o,Wo}var Go,Km;function vw(){if(Km)return Go;Km=1;function a(s){var i=-1,n=Array(s.size);return s.forEach(function(t,o){n[++i]=[o,t]}),n}return Go=a,Go}var zo,Jm;function nr(){if(Jm)return zo;Jm=1;function a(s){var i=-1,n=Array(s.size);return s.forEach(function(t){n[++i]=t}),n}return zo=a,zo}var Ko,Ym;function bq(){if(Ym)return Ko;Ym=1;var a=De(),s=H_(),i=it(),n=ww(),t=vw(),o=nr(),r=1,e=2,c="[object Boolean]",u="[object Date]",h="[object Error]",l="[object Map]",f="[object Number]",p="[object RegExp]",w="[object Set]",C="[object String]",m="[object Symbol]",g="[object ArrayBuffer]",d="[object DataView]",b=a?a.prototype:void 0,_=b?b.valueOf:void 0;function q(E,R,$,M,v,T,B){switch($){case d:if(E.byteLength!=R.byteLength||E.byteOffset!=R.byteOffset)return!1;E=E.buffer,R=R.buffer;case g:return!(E.byteLength!=R.byteLength||!T(new s(E),new s(R)));case c:case u:case f:return i(+E,+R);case h:return E.name==R.name&&E.message==R.message;case p:case C:return E==R+"";case l:var F=t;case w:var y=M&r;if(F||(F=o),E.size!=R.size&&!y)return!1;var A=B.get(E);if(A)return A==R;M|=e,B.set(E,R);var j=n(F(E),F(R),M,v,T,B);return B.delete(E),j;case m:if(_)return _.call(E)==_.call(R)}return!1}return Ko=q,Ko}var Jo,Xm;function _q(){if(Xm)return Jo;Xm=1;var a=F_(),s=1,i=Object.prototype,n=i.hasOwnProperty;function t(o,r,e,c,u,h){var l=e&s,f=a(o),p=f.length,w=a(r),C=w.length;if(p!=C&&!l)return!1;for(var m=p;m--;){var g=f[m];if(!(l?g in r:n.call(r,g)))return!1}var d=h.get(o),b=h.get(r);if(d&&b)return d==r&&b==o;var _=!0;h.set(o,r),h.set(r,o);for(var q=l;++m<p;){g=f[m];var E=o[g],R=r[g];if(c)var $=l?c(R,E,g,r,o,h):c(E,R,g,o,r,h);if(!($===void 0?E===R||u(E,R,e,c,h):$)){_=!1;break}q||(q=g=="constructor")}if(_&&!q){var M=o.constructor,v=r.constructor;M!=v&&"constructor"in o&&"constructor"in r&&!(typeof M=="function"&&M instanceof M&&typeof v=="function"&&v instanceof v)&&(_=!1)}return h.delete(o),h.delete(r),_}return Jo=t,Jo}var Yo,Zm;function wq(){if(Zm)return Yo;Zm=1;var a=zt(),s=ww(),i=bq(),n=_q(),t=at(),o=_e(),r=st(),e=ot(),c=1,u="[object Arguments]",h="[object Array]",l="[object Object]",f=Object.prototype,p=f.hasOwnProperty;function w(C,m,g,d,b,_){var q=o(C),E=o(m),R=q?h:t(C),$=E?h:t(m);R=R==u?l:R,$=$==u?l:$;var M=R==l,v=$==l,T=R==$;if(T&&r(C)){if(!r(m))return!1;q=!0,M=!1}if(T&&!M)return _||(_=new a),q||e(C)?s(C,m,g,d,b,_):i(C,m,R,g,d,b,_);if(!(g&c)){var B=M&&p.call(C,"__wrapped__"),F=v&&p.call(m,"__wrapped__");if(B||F){var y=B?C.value():C,A=F?m.value():m;return _||(_=new a),b(y,A,g,d,_)}}return T?(_||(_=new a),n(C,m,g,d,b,_)):!1}return Yo=w,Yo}var Xo,eg;function Cw(){if(eg)return Xo;eg=1;var a=wq(),s=Ie();function i(n,t,o,r,e){return n===t?!0:n==null||t==null||!s(n)&&!s(t)?n!==n&&t!==t:a(n,t,o,r,i,e)}return Xo=i,Xo}var Zo,tg;function vq(){if(tg)return Zo;tg=1;var a=zt(),s=Cw(),i=1,n=2;function t(o,r,e,c){var u=e.length,h=u,l=!c;if(o==null)return!h;for(o=Object(o);u--;){var f=e[u];if(l&&f[2]?f[1]!==o[f[0]]:!(f[0]in o))return!1}for(;++u<h;){f=e[u];var p=f[0],w=o[p],C=f[1];if(l&&f[2]){if(w===void 0&&!(p in o))return!1}else{var m=new a;if(c)var g=c(w,C,p,o,r,m);if(!(g===void 0?s(C,w,i|n,c,m):g))return!1}}return!0}return Zo=t,Zo}var ea,rg;function qw(){if(rg)return ea;rg=1;var a=Ae();function s(i){return i===i&&!a(i)}return ea=s,ea}var ta,ng;function Cq(){if(ng)return ta;ng=1;var a=qw(),s=He();function i(n){for(var t=s(n),o=t.length;o--;){var r=t[o],e=n[r];t[o]=[r,e,a(e)]}return t}return ta=i,ta}var ra,ig;function Ew(){if(ig)return ra;ig=1;function a(s,i){return function(n){return n==null?!1:n[s]===i&&(i!==void 0||s in Object(n))}}return ra=a,ra}var na,sg;function qq(){if(sg)return na;sg=1;var a=vq(),s=Cq(),i=Ew();function n(t){var o=s(t);return o.length==1&&o[0][2]?i(o[0][0],o[0][1]):function(r){return r===t||a(r,t,o)}}return na=n,na}var ia,og;function Uc(){if(og)return ia;og=1;var a=_e(),s=tr(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function t(o,r){if(a(o))return!1;var e=typeof o;return e=="number"||e=="symbol"||e=="boolean"||o==null||s(o)?!0:n.test(o)||!i.test(o)||r!=null&&o in Object(r)}return ia=t,ia}var sa,ag;function Eq(){if(ag)return sa;ag=1;var a=Tc(),s="Expected a function";function i(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError(s);var o=function(){var r=arguments,e=t?t.apply(this,r):r[0],c=o.cache;if(c.has(e))return c.get(e);var u=n.apply(this,r);return o.cache=c.set(e,u)||c,u};return o.cache=new(i.Cache||a),o}return i.Cache=a,sa=i,sa}var oa,ug;function Aq(){if(ug)return oa;ug=1;var a=Eq(),s=500;function i(n){var t=a(n,function(r){return o.size===s&&o.clear(),r}),o=t.cache;return t}return oa=i,oa}var aa,lg;function Rq(){if(lg)return aa;lg=1;var a=Aq(),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,n=a(function(t){var o=[];return t.charCodeAt(0)===46&&o.push(""),t.replace(s,function(r,e,c,u){o.push(c?u.replace(i,"$1"):e||r)}),o});return aa=n,aa}var ua,cg;function ir(){if(cg)return ua;cg=1;var a=_e(),s=Uc(),i=Rq(),n=Y_();function t(o,r){return a(o)?o:s(o,r)?[o]:i(n(o))}return ua=t,ua}var la,hg;function At(){if(hg)return la;hg=1;var a=tr();function s(i){if(typeof i=="string"||a(i))return i;var n=i+"";return n=="0"&&1/i==-1/0?"-0":n}return la=s,la}var ca,fg;function Qc(){if(fg)return ca;fg=1;var a=ir(),s=At();function i(n,t){t=a(t,n);for(var o=0,r=t.length;n!=null&&o<r;)n=n[s(t[o++])];return o&&o==r?n:void 0}return ca=i,ca}var ha,dg;function Tq(){if(dg)return ha;dg=1;var a=Qc();function s(i,n,t){var o=i==null?void 0:a(i,n);return o===void 0?t:o}return ha=s,ha}var fa,pg;function Sq(){if(pg)return fa;pg=1;function a(s,i){return s!=null&&i in Object(s)}return fa=a,fa}var da,mg;function Aw(){if(mg)return da;mg=1;var a=ir(),s=Ct(),i=_e(),n=Yt(),t=Oc(),o=At();function r(e,c,u){c=a(c,e);for(var h=-1,l=c.length,f=!1;++h<l;){var p=o(c[h]);if(!(f=e!=null&&u(e,p)))break;e=e[p]}return f||++h!=l?f:(l=e==null?0:e.length,!!l&&t(l)&&n(p,l)&&(i(e)||s(e)))}return da=r,da}var pa,gg;function Oq(){if(gg)return pa;gg=1;var a=Sq(),s=Aw();function i(n,t){return n!=null&&s(n,t,a)}return pa=i,pa}var ma,yg;function Nq(){if(yg)return ma;yg=1;var a=Cw(),s=Tq(),i=Oq(),n=Uc(),t=qw(),o=Ew(),r=At(),e=1,c=2;function u(h,l){return n(h)&&t(l)?o(r(h),l):function(f){var p=s(f,h);return p===void 0&&p===l?i(f,h):a(l,p,e|c)}}return ma=u,ma}var ga,bg;function Iq(){if(bg)return ga;bg=1;function a(s){return function(i){return i?.[s]}}return ga=a,ga}var ya,_g;function $q(){if(_g)return ya;_g=1;var a=Qc();function s(i){return function(n){return a(n,i)}}return ya=s,ya}var ba,wg;function xq(){if(wg)return ba;wg=1;var a=Iq(),s=$q(),i=Uc(),n=At();function t(o){return i(o)?a(n(o)):s(o)}return ba=t,ba}var _a,vg;function Pe(){if(vg)return _a;vg=1;var a=qq(),s=Nq(),i=Re(),n=_e(),t=xq();function o(r){return typeof r=="function"?r:r==null?i:typeof r=="object"?n(r)?s(r[0],r[1]):a(r):t(r)}return _a=o,_a}var wa,Cg;function Rw(){if(Cg)return wa;Cg=1;var a="Expected a function";function s(i){if(typeof i!="function")throw new TypeError(a);return function(){var n=arguments;switch(n.length){case 0:return!i.call(this);case 1:return!i.call(this,n[0]);case 2:return!i.call(this,n[0],n[1]);case 3:return!i.call(this,n[0],n[1],n[2])}return!i.apply(this,n)}}return wa=s,wa}var va,qg;function Pq(){if(qg)return va;qg=1;var a=xc(),s=gw(),i=Pe(),n=_e(),t=Rw();function o(r,e){var c=n(r)?a:s;return c(r,t(i(e,3)))}return va=o,va}var Ca,Eg;function sr(){if(Eg)return Ca;Eg=1;var a=nw();function s(i){var n=i==null?0:i.length;return n?a(i,1,n):[]}return Ca=s,Ca}var qa,Ag;function jq(){if(Ag)return qa;Ag=1;var a=Fe(),s=_e(),i=Ie(),n="[object String]";function t(o){return typeof o=="string"||!s(o)&&i(o)&&a(o)==n}return qa=t,qa}var Ea,Rg;function Lq(){if(Rg)return Ea;Rg=1;function a(s){for(var i,n=[];!(i=s.next()).done;)n.push(i.value);return n}return Ea=a,Ea}var Aa,Tg;function Bq(){if(Tg)return Aa;Tg=1;function a(s){return s.split("")}return Aa=a,Aa}var Ra,Sg;function Mq(){if(Sg)return Ra;Sg=1;var a="\\ud800-\\udfff",s="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",t=s+i+n,o="\\ufe0e\\ufe0f",r="\\u200d",e=RegExp("["+r+a+t+o+"]");function c(u){return e.test(u)}return Ra=c,Ra}var Ta,Og;function kq(){if(Og)return Ta;Og=1;var a="\\ud800-\\udfff",s="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",t=s+i+n,o="\\ufe0e\\ufe0f",r="["+a+"]",e="["+t+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+e+"|"+c+")",h="[^"+a+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",w=u+"?",C="["+o+"]?",m="(?:"+p+"(?:"+[h,l,f].join("|")+")"+C+w+")*",g=C+w+m,d="(?:"+[h+e+"?",e,l,f,r].join("|")+")",b=RegExp(c+"(?="+c+")|"+d+g,"g");function _(q){return q.match(b)||[]}return Ta=_,Ta}var Sa,Ng;function Dq(){if(Ng)return Sa;Ng=1;var a=Bq(),s=Mq(),i=kq();function n(t){return s(t)?i(t):a(t)}return Sa=n,Sa}var Oa,Ig;function Fq(){if(Ig)return Oa;Ig=1;var a=er();function s(i,n){return a(n,function(t){return i[t]})}return Oa=s,Oa}var Na,$g;function Tw(){if($g)return Na;$g=1;var a=Fq(),s=He();function i(n){return n==null?[]:a(n,s(n))}return Na=i,Na}var Ia,xg;function Rt(){if(xg)return Ia;xg=1;var a=De(),s=$c(),i=at(),n=xe(),t=jq(),o=Lq(),r=vw(),e=nr(),c=Dq(),u=Tw(),h="[object Map]",l="[object Set]",f=a?a.iterator:void 0;function p(w){if(!w)return[];if(n(w))return t(w)?c(w):s(w);if(f&&w[f])return o(w[f]());var C=i(w),m=C==h?r:C==l?e:u;return m(w)}return Ia=p,Ia}var $a,Pg;function Hc(){if(Pg)return $a;Pg=1;const a=Object.freeze({pg:"postgres",postgresql:"postgres",sqlite:"sqlite3"}),s=Object.freeze(["mssql","mysql","mysql2","oracledb","postgres","pgnative","redshift","sqlite3","cockroachdb","better-sqlite3"].concat(Object.keys(a))),i=Object.freeze({MsSQL:"mssql",MySQL:"mysql",MySQL2:"mysql2",Oracle:"oracledb",PostgreSQL:"pg",PgNative:"pgnative",Redshift:"pg-redshift",SQLite:"sqlite3",CockroachDB:"cockroachdb",BetterSQLite3:"better-sqlite3"}),n=Object.freeze(["maxWaitingClients","testOnBorrow","fifo","priorityRange","autostart","evictionRunIntervalMillis","numTestsPerRun","softIdleTimeoutMillis","Promise"]);return $a={CLIENT_ALIASES:a,SUPPORTED_CLIENTS:s,POOL_CONFIG_OPTIONS:n,COMMA_NO_PAREN_REGEX:/,[\s](?![^(]*\))/g,DRIVER_NAMES:i},$a}var xa,jg;function Ce(){if(jg)return xa;jg=1;const a=Le(),s=ot(),{CLIENT_ALIASES:i}=Hc(),{isFunction:n}=ye();function t(...h){return Array.isArray(h[0])?h[0]:h}function o(h){let l=!1;if(s(h))return!1;if(h&&n(h.toSQL))return l;if(Array.isArray(h))for(let f=0;f<h.length&&!l;f++)l=o(h[f]);else a(h)?Object.keys(h).forEach(f=>{l||(l=o(h[f]))}):l=h===void 0;return l}function r(h){const l=[];return Array.isArray(h)?h.forEach((f,p)=>{o(f)&&l.push(p)}):a(h)?Object.keys(h).forEach(f=>{o(h[f])&&l.push(f)}):l.push(0),l}function e(h){h.prototype.queryContext=function(l){return l===void 0?this._queryContext:(this._queryContext=l,this)}}function c(h){return i[h]||h}function u(h,l){if(h==null)return l;const f=parseInt(h,10);return isNaN(f)?l:f}return xa={addQueryContext:e,containsUndefined:o,getUndefinedIndices:r,normalizeArr:t,resolveClientNameWithAliases:c,toNumber:u},xa}var Pa,Lg;function Sw(){if(Lg)return Pa;Lg=1;const a=tt();function s(n,t,o,r,e){if(typeof o=="function")return{type:"onWrapped",value:o,bool:t};switch(arguments.length){case 3:return{type:"onRaw",value:o,bool:t};case 4:return{type:n,column:o,operator:"=",value:r,bool:t};default:return{type:n,column:o,operator:r,value:e,bool:t}}}class i{constructor(t,o,r){this.schema=r,this.table=t,this.joinType=o,this.and=this,this.clauses=[]}get or(){return this._bool("or")}on(t){if(typeof t=="object"&&typeof t.toSQL!="function"){const r=Object.keys(t);let e=-1;const c=this._bool()==="or"?"orOn":"on";for(;++e<r.length;)this[c](r[e],t[r[e]]);return this}const o=s("onBasic",this._bool(),...arguments);return o&&this.clauses.push(o),this}orOn(t,o,r){return this._bool("or").on.apply(this,arguments)}onJsonPathEquals(t,o,r,e){return this.clauses.push({type:"onJsonPathEquals",columnFirst:t,jsonPathFirst:o,columnSecond:r,jsonPathSecond:e,bool:this._bool(),not:this._not()}),this}orOnJsonPathEquals(t,o,r,e){return this._bool("or").onJsonPathEquals.apply(this,arguments)}using(t){return this.clauses.push({type:"onUsing",column:t,bool:this._bool()})}onVal(t){if(typeof t=="object"&&typeof t.toSQL!="function"){const r=Object.keys(t);let e=-1;const c=this._bool()==="or"?"orOnVal":"onVal";for(;++e<r.length;)this[c](r[e],t[r[e]]);return this}const o=s("onVal",this._bool(),...arguments);return o&&this.clauses.push(o),this}andOnVal(){return this.onVal(...arguments)}orOnVal(){return this._bool("or").onVal(...arguments)}onBetween(t,o){return a(Array.isArray(o),"The second argument to onBetween must be an array."),a(o.length===2,"You must specify 2 values for the onBetween clause"),this.clauses.push({type:"onBetween",column:t,value:o,bool:this._bool(),not:this._not()}),this}onNotBetween(t,o){return this._not(!0).onBetween(t,o)}orOnBetween(t,o){return this._bool("or").onBetween(t,o)}orOnNotBetween(t,o){return this._bool("or")._not(!0).onBetween(t,o)}onIn(t,o){return Array.isArray(o)&&o.length===0?this.on(1,"=",0):(this.clauses.push({type:"onIn",column:t,value:o,not:this._not(),bool:this._bool()}),this)}onNotIn(t,o){return this._not(!0).onIn(t,o)}orOnIn(t,o){return this._bool("or").onIn(t,o)}orOnNotIn(t,o){return this._bool("or")._not(!0).onIn(t,o)}onNull(t){return this.clauses.push({type:"onNull",column:t,not:this._not(),bool:this._bool()}),this}orOnNull(t){return this._bool("or").onNull(t)}onNotNull(t){return this._not(!0).onNull(t)}orOnNotNull(t){return this._not(!0)._bool("or").onNull(t)}onExists(t){return this.clauses.push({type:"onExists",value:t,not:this._not(),bool:this._bool()}),this}orOnExists(t){return this._bool("or").onExists(t)}onNotExists(t){return this._not(!0).onExists(t)}orOnNotExists(t){return this._not(!0)._bool("or").onExists(t)}type(t){return this.joinType=t,this}_bool(t){if(arguments.length===1)return this._boolFlag=t,this;const o=this._boolFlag||"and";return this._boolFlag="and",o}_not(t){if(arguments.length===1)return this._notFlag=t,this;const o=this._notFlag;return this._notFlag=!1,o}}return Object.assign(i.prototype,{grouping:"join"}),i.prototype.andOn=i.prototype.on,i.prototype.andOnIn=i.prototype.onIn,i.prototype.andOnNotIn=i.prototype.onNotIn,i.prototype.andOnNull=i.prototype.onNull,i.prototype.andOnNotNull=i.prototype.onNotNull,i.prototype.andOnExists=i.prototype.onExists,i.prototype.andOnNotExists=i.prototype.onNotExists,i.prototype.andOnBetween=i.prototype.onBetween,i.prototype.andOnNotBetween=i.prototype.onNotBetween,i.prototype.andOnJsonPathEquals=i.prototype.onJsonPathEquals,Pa=i,Pa}var ja,Bg;function Uq(){if(Bg)return ja;Bg=1;const a=tt();class s{constructor(n,t,o,r,e){this.schema=t,this.type="analytic",this.method=n,this.order=r||[],this.partitions=e||[],this.alias=o,this.and=this,this.grouping="columns"}partitionBy(n,t){return a(Array.isArray(n)||typeof n=="string",`The argument to an analytic partitionBy function must be either a string
67
+ or an array of string.`),Array.isArray(n)?this.partitions=this.partitions.concat(n):this.partitions.push({column:n,order:t}),this}orderBy(n,t){return a(Array.isArray(n)||typeof n=="string",`The argument to an analytic orderBy function must be either a string
68
+ or an array of string.`),Array.isArray(n)?this.order=this.order.concat(n):this.order.push({column:n,order:t}),this}}return ja=s,ja}var La,Mg;function Vc(){return Mg||(Mg=1,La=function(s,i){s.client.config.asyncStackTraces&&(s._asyncStack={error:new Error,lines:i})}),La}var Ba,kg;function Qq(){return kg||(kg=1,Ba={lockMode:{forShare:"forShare",forUpdate:"forUpdate",forNoKeyUpdate:"forNoKeyUpdate",forKeyShare:"forKeyShare"},waitMode:{skipLocked:"skipLocked",noWait:"noWait"}}),Ba}var Ma,Dg;function Wc(){if(Dg)return Ma;Dg=1;const a=Fc(),s=Te(),{callbackify:i}=Ee(),n=aw(),{formatQuery:t}=uw();function o(r){r.prototype.toQuery=function(e){let c=this.toSQL(this._method,e);return Array.isArray(c)||(c=[c]),c.length?c.map(u=>t(u.sql,u.bindings,e,this.client)).reduce((u,h)=>u.concat(u.endsWith(";")?`
69
+ `:`;
70
+ `,h)):""},r.prototype.then=function(){let e=this.client.runner(this).run();return this.client.config.asyncStackTraces&&(e=e.catch(c=>{c.originalStack=c.stack;const u=c.stack.split(`
71
+ `)[0],{error:h,lines:l}=this._asyncStack,p=h.stack.split(`
72
+ `).slice(l);throw p.unshift(u),c.stack=p.join(`
73
+ `),c})),e.then.apply(e,arguments)},r.prototype.options=function(e){return this._options=this._options||[],this._options.push(a(e)||{}),this},r.prototype.connection=function(e){return this._connection=e,this.client.processPassedConnection(e),this},r.prototype.debug=function(e){return this._debug=arguments.length?e:!0,this},r.prototype.transacting=function(e){if(e&&e.client&&(e.client.transacting?this.client=e.client:e.client.logger.warn(`Invalid transaction value: ${e.client}`)),s(e))throw this.client.logger.error("Invalid value on transacting call, potential bug"),Error("Invalid transacting value (null, undefined or empty object)");return this},r.prototype.stream=function(e){return this.client.runner(this).stream(e)},r.prototype.pipe=function(e,c){return this.client.runner(this).pipe(e,c)},r.prototype.asCallback=function(e){const c=this.then();return i(()=>c)(e),c},r.prototype.catch=function(e){return this.then().catch(e)},Object.defineProperty(r.prototype,Symbol.toStringTag,{get:()=>"object"}),n(r.prototype)}return Ma={augmentWithBuilderInterface:o},Ma}var ka,Fg;function je(){if(Fg)return ka;Fg=1;const a=tt(),{EventEmitter:s}=ke(),i=We(),n=Fc(),t=Et(),o=Te(),r=Le(),e=mq(),c=Pq(),u=sr(),h=Rt(),{addQueryContext:l,normalizeArr:f}=Ce(),p=Sw(),w=Uq(),C=Vc(),{isBoolean:m,isNumber:g,isObject:d,isString:b,isFunction:_}=ye(),{lockMode:q,waitMode:E}=Qq(),{augmentWithBuilderInterface:R}=Wc(),$=new Set(["pluck","first","select"]),M=new Set(["with","select","columns","hintComments","where","union","join","group","order","having","limit","offset","counter","counters"]),v=new Set([q.forShare,q.forUpdate,q.forNoKeyUpdate,q.forKeyShare]);class T extends s{constructor(y){super(),this.client=y,this.and=this,this._single={},this._comments=[],this._statements=[],this._method="select",y.config&&(C(this,5),this._debug=y.config.debug),this._joinFlag="inner",this._boolFlag="and",this._notFlag=!1,this._asColumnFlag=!1}toString(){return this.toQuery()}toSQL(y,A){return this.client.queryCompiler(this).toSQL(y||this._method,A)}clone(){const y=new this.constructor(this.client);return y._method=this._method,y._single=n(this._single),y._comments=n(this._comments),y._statements=n(this._statements),y._debug=this._debug,this._options!==void 0&&(y._options=n(this._options)),this._queryContext!==void 0&&(y._queryContext=n(this._queryContext)),this._connection!==void 0&&(y._connection=this._connection),y}timeout(y,{cancel:A}={}){return g(y)&&y>0&&(this._timeout=y,A&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}isValidStatementArg(y){return typeof y=="function"||y instanceof T||y&&y.isRawInstance}_validateWithArgs(y,A,j,Y){const[ee,H]=typeof j>"u"?[A,void 0]:[j,A];if(typeof y!="string")throw new Error(`${Y}() first argument must be a string`);if(this.isValidStatementArg(ee)&&typeof H>"u")return;if(!(Array.isArray(H)&&H.length>0&&H.every(V=>typeof V=="string")))throw new Error(`${Y}() second argument must be a statement or non-empty column name list.`);if(!this.isValidStatementArg(ee))throw new Error(`${Y}() third argument must be a function / QueryBuilder or a raw when its second argument is a column name list`)}with(y,A,j){return this._validateWithArgs(y,A,j,"with"),this.withWrapped(y,A,j)}withMaterialized(y,A,j){throw new Error("With materialized is not supported by this dialect")}withNotMaterialized(y,A,j){throw new Error("With materialized is not supported by this dialect")}withWrapped(y,A,j,Y){const[ee,H]=typeof j>"u"?[A,void 0]:[j,A],N={grouping:"with",type:"withWrapped",alias:y,columnList:H,value:ee};return Y!==void 0&&(N.materialized=Y),this._statements.push(N),this}withRecursive(y,A,j){return this._validateWithArgs(y,A,j,"withRecursive"),this.withRecursiveWrapped(y,A,j)}withRecursiveWrapped(y,A,j){return this.withWrapped(y,A,j),this._statements[this._statements.length-1].recursive=!0,this}columns(y){return!y&&y!==0?this:(this._statements.push({grouping:"columns",value:f(...arguments)}),this)}comment(y){if(!b(y))throw new Error("Comment must be a string");const A=["/*","*/","?"];if(A.some(j=>y.includes(j)))throw new Error(`Cannot include ${A.join(", ")} in comment`);return this._comments.push({comment:y}),this}as(y){return this._single.as=y,this}hintComment(y){if(y=Array.isArray(y)?y:[y],y.some(A=>!b(A)))throw new Error("Hint comment must be a string");if(y.some(A=>A.includes("/*")||A.includes("*/")))throw new Error('Hint comment cannot include "/*" or "*/"');if(y.some(A=>A.includes("?")))throw new Error('Hint comment cannot include "?"');return this._statements.push({grouping:"hintComments",value:y}),this}withSchema(y){return this._single.schema=y,this}table(y,A={}){return this._single.table=y,this._single.only=A.only===!0,this}distinct(...y){return this._statements.push({grouping:"columns",value:f(...y),distinct:!0}),this}distinctOn(...y){if(o(y))throw new Error("distinctOn requires at least on argument");return this._statements.push({grouping:"columns",value:f(...y),distinctOn:!0}),this}join(y,A,...j){let Y;const ee=y instanceof T||typeof y=="function"?void 0:this._single.schema,H=this._joinType();return typeof A=="function"?(Y=new p(y,H,ee),A.call(Y,Y)):H==="raw"?Y=new p(this.client.raw(y,A),"raw"):(Y=new p(y,H,ee),A&&Y.on(A,...j)),this._statements.push(Y),this}using(y){throw new Error("'using' function is only available in PostgreSQL dialect with Delete statements.")}innerJoin(...y){return this._joinType("inner").join(...y)}leftJoin(...y){return this._joinType("left").join(...y)}leftOuterJoin(...y){return this._joinType("left outer").join(...y)}rightJoin(...y){return this._joinType("right").join(...y)}rightOuterJoin(...y){return this._joinType("right outer").join(...y)}outerJoin(...y){return this._joinType("outer").join(...y)}fullOuterJoin(...y){return this._joinType("full outer").join(...y)}crossJoin(...y){return this._joinType("cross").join(...y)}joinRaw(...y){return this._joinType("raw").join(...y)}get or(){return this._bool("or")}get not(){return this._not(!0)}where(y,A,j){const Y=arguments.length;if(y===!1||y===!0)return this.where(1,"=",y?1:0);if(typeof y=="function")return this.whereWrapped(y);if(d(y)&&!y.isRawInstance)return this._objectWhere(y);if(y&&y.isRawInstance&&Y===1)return this.whereRaw(y);if(Y===2&&(j=A,A="=",j===null))return this.whereNull(y);const ee=`${A}`.toLowerCase().trim();if(Y===3){if(ee==="in"||ee==="not in")return this._not(ee==="not in").whereIn(y,j);if(ee==="between"||ee==="not between")return this._not(ee==="not between").whereBetween(y,j)}return j===null&&(ee==="is"||ee==="is not")?this._not(ee==="is not").whereNull(y):(this._statements.push({grouping:"where",type:"whereBasic",column:y,operator:A,value:j,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this)}whereColumn(...y){return this._asColumnFlag=!0,this.where(...y),this._asColumnFlag=!1,this}orWhere(y,...A){this._bool("or");const j=y;return d(j)&&!j.isRawInstance?this.whereWrapped(function(){for(const Y in j)this.andWhere(Y,j[Y])}):this.where(y,...A)}orWhereColumn(y,...A){this._bool("or");const j=y;return d(j)&&!j.isRawInstance?this.whereWrapped(function(){for(const Y in j)this.andWhereColumn(Y,"=",j[Y])}):this.whereColumn(y,...A)}whereNot(y,...A){return A.length>=2&&(A[0]==="in"||A[0]==="between")&&this.client.logger.warn('whereNot is not suitable for "in" and "between" type subqueries. You should use "not in" and "not between" instead.'),this._not(!0).where(y,...A)}whereNotColumn(...y){return this._not(!0).whereColumn(...y)}orWhereNot(...y){return this._bool("or").whereNot(...y)}orWhereNotColumn(...y){return this._bool("or").whereNotColumn(...y)}_objectWhere(y){const A=this._bool(),j=this._not()?"Not":"";for(const Y in y)this[A+"Where"+j](Y,y[Y]);return this}whereRaw(y,A){const j=y.isRawInstance?y:this.client.raw(y,A);return this._statements.push({grouping:"where",type:"whereRaw",value:j,not:this._not(),bool:this._bool()}),this}orWhereRaw(y,A){return this._bool("or").whereRaw(y,A)}whereWrapped(y){return this._statements.push({grouping:"where",type:"whereWrapped",value:y,not:this._not(),bool:this._bool()}),this}whereExists(y){return this._statements.push({grouping:"where",type:"whereExists",value:y,not:this._not(),bool:this._bool()}),this}orWhereExists(y){return this._bool("or").whereExists(y)}whereNotExists(y){return this._not(!0).whereExists(y)}orWhereNotExists(y){return this._bool("or").whereNotExists(y)}whereIn(y,A){return Array.isArray(A)&&o(A)?this.where(this._not()):(this._statements.push({grouping:"where",type:"whereIn",column:y,value:A,not:this._not(),bool:this._bool()}),this)}orWhereIn(y,A){return this._bool("or").whereIn(y,A)}whereNotIn(y,A){return this._not(!0).whereIn(y,A)}orWhereNotIn(y,A){return this._bool("or")._not(!0).whereIn(y,A)}whereNull(y){return this._statements.push({grouping:"where",type:"whereNull",column:y,not:this._not(),bool:this._bool()}),this}orWhereNull(y){return this._bool("or").whereNull(y)}whereNotNull(y){return this._not(!0).whereNull(y)}orWhereNotNull(y){return this._bool("or").whereNotNull(y)}whereBetween(y,A){return a(Array.isArray(A),"The second argument to whereBetween must be an array."),a(A.length===2,"You must specify 2 values for the whereBetween clause"),this._statements.push({grouping:"where",type:"whereBetween",column:y,value:A,not:this._not(),bool:this._bool()}),this}whereNotBetween(y,A){return this._not(!0).whereBetween(y,A)}orWhereBetween(y,A){return this._bool("or").whereBetween(y,A)}orWhereNotBetween(y,A){return this._bool("or").whereNotBetween(y,A)}_whereLike(y,A,j){return this._statements.push({grouping:"where",type:y,column:A,value:j,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this}whereLike(y,A){return this._whereLike("whereLike",y,A)}orWhereLike(y,A){return this._bool("or")._whereLike("whereLike",y,A)}whereILike(y,A){return this._whereLike("whereILike",y,A)}orWhereILike(y,A){return this._bool("or")._whereLike("whereILike",y,A)}groupBy(y){return y&&y.isRawInstance?this.groupByRaw.apply(this,arguments):(this._statements.push({grouping:"group",type:"groupByBasic",value:f(...arguments)}),this)}groupByRaw(y,A){const j=y.isRawInstance?y:this.client.raw(y,A);return this._statements.push({grouping:"group",type:"groupByRaw",value:j}),this}orderBy(y,A,j=""){return Array.isArray(y)?this._orderByArray(y):(this._statements.push({grouping:"order",type:"orderByBasic",value:y,direction:A,nulls:j}),this)}_orderByArray(y){for(let A=0;A<y.length;A++){const j=y[A];d(j)?this._statements.push({grouping:"order",type:"orderByBasic",value:j.column,direction:j.order,nulls:j.nulls}):(b(j)||g(j))&&this._statements.push({grouping:"order",type:"orderByBasic",value:j})}return this}orderByRaw(y,A){const j=y.isRawInstance?y:this.client.raw(y,A);return this._statements.push({grouping:"order",type:"orderByRaw",value:j}),this}_union(y,A){let j=A[0],Y=A[1];if(A.length===1||A.length===2&&m(Y)){Array.isArray(j)||(j=[j]);for(let ee=0,H=j.length;ee<H;ee++)this._statements.push({grouping:"union",clause:y,value:j[ee],wrap:Y||!1})}else j=h(A).slice(0,A.length-1),Y=A[A.length-1],m(Y)||(j.push(Y),Y=!1),this._union(y,[j,Y]);return this}union(...y){return this._union("union",y)}unionAll(...y){return this._union("union all",y)}intersect(...y){return this._union("intersect",y)}except(...y){return this._union("except",y)}having(y,A,j){return y.isRawInstance&&arguments.length===1?this.havingRaw(y):typeof y=="function"?this.havingWrapped(y):(this._statements.push({grouping:"having",type:"havingBasic",column:y,operator:A,value:j,bool:this._bool(),not:this._not()}),this)}orHaving(y,...A){this._bool("or");const j=y;return d(j)&&!j.isRawInstance?this.havingWrapped(function(){for(const Y in j)this.andHaving(Y,j[Y])}):this.having(y,...A)}havingWrapped(y){return this._statements.push({grouping:"having",type:"havingWrapped",value:y,bool:this._bool(),not:this._not()}),this}havingNull(y){return this._statements.push({grouping:"having",type:"havingNull",column:y,not:this._not(),bool:this._bool()}),this}orHavingNull(y){return this._bool("or").havingNull(y)}havingNotNull(y){return this._not(!0).havingNull(y)}orHavingNotNull(y){return this._not(!0)._bool("or").havingNull(y)}havingExists(y){return this._statements.push({grouping:"having",type:"havingExists",value:y,not:this._not(),bool:this._bool()}),this}orHavingExists(y){return this._bool("or").havingExists(y)}havingNotExists(y){return this._not(!0).havingExists(y)}orHavingNotExists(y){return this._not(!0)._bool("or").havingExists(y)}havingBetween(y,A){return a(Array.isArray(A),"The second argument to havingBetween must be an array."),a(A.length===2,"You must specify 2 values for the havingBetween clause"),this._statements.push({grouping:"having",type:"havingBetween",column:y,value:A,not:this._not(),bool:this._bool()}),this}orHavingBetween(y,A){return this._bool("or").havingBetween(y,A)}havingNotBetween(y,A){return this._not(!0).havingBetween(y,A)}orHavingNotBetween(y,A){return this._not(!0)._bool("or").havingBetween(y,A)}havingIn(y,A){return Array.isArray(A)&&o(A)?this.where(this._not()):(this._statements.push({grouping:"having",type:"havingIn",column:y,value:A,not:this._not(),bool:this._bool()}),this)}orHavingIn(y,A){return this._bool("or").havingIn(y,A)}havingNotIn(y,A){return this._not(!0).havingIn(y,A)}orHavingNotIn(y,A){return this._bool("or")._not(!0).havingIn(y,A)}havingRaw(y,A){const j=y.isRawInstance?y:this.client.raw(y,A);return this._statements.push({grouping:"having",type:"havingRaw",value:j,bool:this._bool(),not:this._not()}),this}orHavingRaw(y,A){return this._bool("or").havingRaw(y,A)}_setSkipBinding(y,A){let j=A;d(A)&&(j=A.skipBinding),this._single.skipBinding=this._single.skipBinding||{},this._single.skipBinding[y]=j}offset(y,A){if(y==null||y.isRawInstance||y instanceof T)this._single.offset=y;else{const j=parseInt(y,10);if(isNaN(j))this.client.logger.warn("A valid integer must be provided to offset");else{if(j<0)throw new Error("A non-negative integer must be provided to offset.");this._single.offset=j}}return this._setSkipBinding("offset",A),this}limit(y,A){const j=parseInt(y,10);return isNaN(j)?this.client.logger.warn("A valid integer must be provided to limit"):(this._single.limit=j,this._setSkipBinding("limit",A)),this}count(y,A){return this._aggregate("count",y||"*",A)}min(y,A){return this._aggregate("min",y,A)}max(y,A){return this._aggregate("max",y,A)}sum(y,A){return this._aggregate("sum",y,A)}avg(y,A){return this._aggregate("avg",y,A)}countDistinct(...y){let A;return y.length>1&&r(e(y))&&([A]=y.splice(y.length-1,1)),y.length?y.length===1&&(y=y[0]):y="*",this._aggregate("count",y,{...A,distinct:!0})}sumDistinct(y,A){return this._aggregate("sum",y,{...A,distinct:!0})}avgDistinct(y,A){return this._aggregate("avg",y,{...A,distinct:!0})}increment(y,A=1){if(d(y)){for(const j in y)this._counter(j,y[j]);return this}return this._counter(y,A)}decrement(y,A=1){if(d(y)){for(const j in y)this._counter(j,-y[j]);return this}return this._counter(y,-A)}clearCounters(){return this._single.counter={},this}first(...y){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .first() on "${this._method}" query`);return this.select(f(...y)),this._method="first",this.limit(1),this}connection(y){return this._connection=y,this.client.processPassedConnection(y),this}pluck(y){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .pluck() on "${this._method}" query`);return this._method="pluck",this._single.pluck=y,this._statements.push({grouping:"columns",type:"pluck",value:y}),this}clearSelect(){return this._clearGrouping("columns"),this}clearWhere(){return this._clearGrouping("where"),this}clearGroup(){return this._clearGrouping("group"),this}clearOrder(){return this._clearGrouping("order"),this}clearHaving(){return this._clearGrouping("having"),this}clear(y){if(!M.has(y))throw new Error(`Knex Error: unknown statement '${y}'`);return y.startsWith("counter")?this.clearCounters():(y==="select"&&(y="columns"),this._clearGrouping(y),this)}insert(y,A,j){return this._method="insert",o(A)||this.returning(A,j),this._single.insert=y,this}update(y,A,j){let Y;const ee=this._single.update||{};if(this._method="update",b(y))r(A)?ee[y]=JSON.stringify(A):ee[y]=A,arguments.length>2&&(Y=arguments[2]);else{const H=Object.keys(y);this._single.update&&this.client.logger.warn("Update called multiple times with objects.");let N=-1;for(;++N<H.length;)ee[H[N]]=y[H[N]];Y=arguments[1]}return o(Y)||this.returning(Y,j),this._single.update=ee,this}returning(y,A){return this._single.returning=y,this._single.options=A,this}onConflict(y){return typeof y=="string"&&(y=[y]),new B(this,y||!0)}delete(y,A){return this._method="del",o(y)||this.returning(y,A),this}truncate(y){return this._method="truncate",y&&(this._single.table=y),this}columnInfo(y){return this._method="columnInfo",this._single.columnInfo=y,this}forUpdate(...y){return this._single.lock=q.forUpdate,y.length===1&&Array.isArray(y[0])?this._single.lockTables=y[0]:this._single.lockTables=y,this}forShare(...y){return this._single.lock=q.forShare,this._single.lockTables=y,this}forNoKeyUpdate(...y){return this._single.lock=q.forNoKeyUpdate,this._single.lockTables=y,this}forKeyShare(...y){return this._single.lock=q.forKeyShare,this._single.lockTables=y,this}skipLocked(){if(!this._isSelectQuery())throw new Error(`Cannot chain .skipLocked() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".skipLocked() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===E.noWait)throw new Error(".skipLocked() cannot be used together with .noWait()!");return this._single.waitMode=E.skipLocked,this}noWait(){if(!this._isSelectQuery())throw new Error(`Cannot chain .noWait() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".noWait() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===E.skipLocked)throw new Error(".noWait() cannot be used together with .skipLocked()!");return this._single.waitMode=E.noWait,this}fromJS(y){return t(y,(A,j)=>{typeof this[j]!="function"&&this.client.logger.warn(`Knex Error: unknown key ${j}`),Array.isArray(A)?this[j].apply(this,A):this[j](A)}),this}fromRaw(y,A){const j=y.isRawInstance?y:this.client.raw(y,A);return this.from(j)}modify(y){return y.apply(this,[this].concat(u(arguments))),this}upsert(y,A,j){throw new Error(`Upsert is not yet supported for dialect ${this.client.dialect}`)}_json(y,A){return this._statements.push({grouping:"columns",type:"json",method:y,params:A}),this}jsonExtract(){const y=arguments[0];let A,j,Y=!0;return arguments.length>=2&&(A=arguments[1]),arguments.length>=3&&(j=arguments[2]),arguments.length===4&&(Y=arguments[3]),arguments.length===2&&Array.isArray(arguments[0])&&m(arguments[1])&&(Y=arguments[1]),this._json("jsonExtract",{column:y,path:A,alias:j,singleValue:Y})}jsonSet(y,A,j,Y){return this._json("jsonSet",{column:y,path:A,value:j,alias:Y})}jsonInsert(y,A,j,Y){return this._json("jsonInsert",{column:y,path:A,value:j,alias:Y})}jsonRemove(y,A,j){return this._json("jsonRemove",{column:y,path:A,alias:j})}_isJsonObject(y){return d(y)&&!(y instanceof T)}_whereJsonWrappedValue(y,A,j){const Y={grouping:"where",type:y,column:A,value:j,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag};arguments[3]&&(Y.operator=arguments[3]),arguments[4]&&(Y.jsonPath=arguments[4]),this._statements.push(Y)}whereJsonObject(y,A){return this._whereJsonWrappedValue("whereJsonObject",y,A),this}orWhereJsonObject(y,A){return this._bool("or").whereJsonObject(y,A)}whereNotJsonObject(y,A){return this._not(!0).whereJsonObject(y,A)}orWhereNotJsonObject(y,A){return this._bool("or").whereNotJsonObject(y,A)}whereJsonPath(y,A,j,Y){return this._whereJsonWrappedValue("whereJsonPath",y,Y,j,A),this}orWhereJsonPath(y,A,j,Y){return this._bool("or").whereJsonPath(y,A,j,Y)}whereJsonSupersetOf(y,A){return this._whereJsonWrappedValue("whereJsonSupersetOf",y,A),this}whereJsonNotSupersetOf(y,A){return this._not(!0).whereJsonSupersetOf(y,A)}orWhereJsonSupersetOf(y,A){return this._bool("or").whereJsonSupersetOf(y,A)}orWhereJsonNotSupersetOf(y,A){return this._bool("or").whereJsonNotSupersetOf(y,A)}whereJsonSubsetOf(y,A){return this._whereJsonWrappedValue("whereJsonSubsetOf",y,A),this}whereJsonNotSubsetOf(y,A){return this._not(!0).whereJsonSubsetOf(y,A)}orWhereJsonSubsetOf(y,A){return this._bool("or").whereJsonSubsetOf(y,A)}orWhereJsonNotSubsetOf(y,A){return this._bool("or").whereJsonNotSubsetOf(y,A)}whereJsonHasNone(y,A){return this._not(!0).whereJsonHasAll(y,A),this}_analytic(y,A,j){let Y;const{schema:ee}=this._single,H=this._analyticMethod();if(y=typeof y=="string"?y:null,a(typeof A=="function"||A.isRawInstance||Array.isArray(A)||typeof A=="string"||typeof A=="object",`The second argument to an analytic function must be either a function, a raw,
74
+ an array of string or object, an object or a single string.`),j&&a(Array.isArray(j)||typeof j=="string"||typeof j=="object","The third argument to an analytic function must be either a string, an array of string or object or an object."),_(A))Y=new w(H,ee,y),A.call(Y,Y);else if(A.isRawInstance)Y={grouping:"columns",type:"analytic",method:H,raw:A,alias:y};else{const N=Array.isArray(A)?A:[A];let V=j||[];V=Array.isArray(V)?V:[V],Y={grouping:"columns",type:"analytic",method:H,order:N,alias:y,partitions:V}}return this._statements.push(Y),this}rank(...y){return this._analyticMethod("rank")._analytic(...y)}denseRank(...y){return this._analyticMethod("dense_rank")._analytic(...y)}rowNumber(...y){return this._analyticMethod("row_number")._analytic(...y)}_counter(y,A){return A=parseFloat(A),this._method="update",this._single.counter=this._single.counter||{},this._single.counter[y]=A,this}_bool(y){if(arguments.length===1)return this._boolFlag=y,this;const A=this._boolFlag;return this._boolFlag="and",A}_not(y){if(arguments.length===1)return this._notFlag=y,this;const A=this._notFlag;return this._notFlag=!1,A}_joinType(y){if(arguments.length===1)return this._joinFlag=y,this;const A=this._joinFlag||"inner";return this._joinFlag="inner",A}_analyticMethod(y){return arguments.length===1?(this._analyticFlag=y,this):this._analyticFlag||"row_number"}_aggregate(y,A,j={}){return this._statements.push({grouping:"columns",type:A.isRawInstance?"aggregateRaw":"aggregate",method:y,value:A,aggregateDistinct:j.distinct||!1,alias:j.as}),this}_clearGrouping(y){y in this._single?this._single[y]=void 0:this._statements=c(this._statements,{grouping:y})}_isSelectQuery(){return $.has(this._method)}_hasLockMode(){return v.has(this._single.lock)}}T.prototype.select=T.prototype.columns,T.prototype.column=T.prototype.columns,T.prototype.andWhereNot=T.prototype.whereNot,T.prototype.andWhereNotColumn=T.prototype.whereNotColumn,T.prototype.andWhere=T.prototype.where,T.prototype.andWhereColumn=T.prototype.whereColumn,T.prototype.andWhereRaw=T.prototype.whereRaw,T.prototype.andWhereBetween=T.prototype.whereBetween,T.prototype.andWhereNotBetween=T.prototype.whereNotBetween,T.prototype.andWhereJsonObject=T.prototype.whereJsonObject,T.prototype.andWhereNotJsonObject=T.prototype.whereNotJsonObject,T.prototype.andWhereJsonPath=T.prototype.whereJsonPath,T.prototype.andWhereLike=T.prototype.whereLike,T.prototype.andWhereILike=T.prototype.whereILike,T.prototype.andHaving=T.prototype.having,T.prototype.andHavingIn=T.prototype.havingIn,T.prototype.andHavingNotIn=T.prototype.havingNotIn,T.prototype.andHavingNull=T.prototype.havingNull,T.prototype.andHavingNotNull=T.prototype.havingNotNull,T.prototype.andHavingExists=T.prototype.havingExists,T.prototype.andHavingNotExists=T.prototype.havingNotExists,T.prototype.andHavingBetween=T.prototype.havingBetween,T.prototype.andHavingNotBetween=T.prototype.havingNotBetween,T.prototype.from=T.prototype.table,T.prototype.into=T.prototype.table,T.prototype.del=T.prototype.delete,R(T),l(T),T.extend=(F,y)=>{if(Object.prototype.hasOwnProperty.call(T.prototype,F))throw new Error(`Can't extend QueryBuilder with existing method ('${F}').`);i(T.prototype,{[F]:y})};class B{constructor(y,A){this.builder=y,this._columns=A}ignore(){return this.builder._single.onConflict=this._columns,this.builder._single.ignore=!0,this.builder}merge(y){return this.builder._single.onConflict=this._columns,this.builder._single.merge={updates:y},this.builder}then(){throw new Error("Incomplete onConflict clause. .onConflict() must be directly followed by either .merge() or .ignore()")}}return ka=T,ka}var Da,Ug;function Hq(){if(Ug)return Da;Ug=1;function a(s,i,n,t){var o=-1,r=s==null?0:s.length;for(t&&r&&(n=s[++o]);++o<r;)n=i(n,s[o],o,s);return n}return Da=a,Da}var Fa,Qg;function Vq(){if(Qg)return Fa;Qg=1;function a(s,i,n,t,o){return o(s,function(r,e,c){n=t?(t=!1,r):i(n,r,e,c)}),n}return Fa=a,Fa}var Ua,Hg;function Tt(){if(Hg)return Ua;Hg=1;var a=Hq(),s=ut(),i=Pe(),n=Vq(),t=_e();function o(r,e,c){var u=t(r)?a:n,h=arguments.length<3;return u(r,i(e,4),c,h,s)}return Ua=o,Ua}var Qa,Vg;function Wq(){if(Vg)return Qa;Vg=1;var a=Sc(),s=W_(),i=mw(),n=Pe(),t=Xt(),o=_e(),r=st(),e=Vt(),c=Ae(),u=ot();function h(l,f,p){var w=o(l),C=w||r(l)||u(l);if(f=n(f,4),p==null){var m=l&&l.constructor;C?p=w?new m:[]:c(l)?p=e(m)?s(t(l)):{}:p={}}return(C?a:i)(l,function(g,d,b){return f(p,g,d,b)}),p}return Qa=h,Qa}var Ha,Wg;function Ge(){if(Wg)return Ha;Wg=1;const{isObject:a}=ye();function s(t,o,r,e){const c=r.queryBuilder();return t.call(c,c),r.queryCompiler(c,e.bindings).toSQL(o||c._method||"select")}function i(t,o,r){const e=o.queryContext();return r.wrapIdentifier((t||"").trim(),e)}function n(t,o,r){return t===void 0?"":t===null?"null":t&&t.isRawInstance?t.toQuery():o==="bool"?(t==="false"&&(t=0),`'${t?1:0}'`):(o==="json"||o==="jsonb")&&a(t)?`'${JSON.stringify(t)}'`:r._escapeBinding(t.toString())}return Ha={compileCallback:s,wrapAsIdentifier:i,formatDefault:n},Ha}var Va,Gg;function qe(){if(Gg)return Va;Gg=1;const a=Wq(),s=je(),{compileCallback:i,wrapAsIdentifier:n}=Ge(),t=["asc","desc"],o=a(["=","<",">","<=",">=","<>","!=","like","not like","between","not between","ilike","not ilike","exists","not exist","rlike","not rlike","regexp","not regexp","match","&","|","^","<<",">>","~","~=","~*","!~","!~*","#","&&","@>","<@","||","&<","&>","-|-","@@","!!",["?","\\?"],["?|","\\?|"],["?&","\\?&"]],(C,m)=>{Array.isArray(m)?C[m[0]]=m[1]:C[m]=m},{});function r(C,m,g,d){const b=Array.isArray(C)?C:[C];let _="",q=-1;for(;++q<b.length;)q>0&&(_+=", "),_+=e(b[q],void 0,m,g,d);return _}function e(C,m,g,d,b){const _=c(C,m,g,d,b);if(_)return _;switch(typeof C){case"function":return f(i(C,void 0,d,b),!0,g,d);case"object":return l(C,g,d,b);case"number":return C;default:return h(C+"",g,d)}}function c(C,m,g,d,b){let _;if(C instanceof s)return _=d.queryCompiler(C).toSQL(),_.bindings&&b.bindings.push(..._.bindings),f(_,m,g,d);if(C&&C.isRawInstance)return C.client=d,g._queryContext&&(C.queryContext=()=>g._queryContext),_=C.toSQL(),_.bindings&&b.bindings.push(..._.bindings),_.sql;m&&b.bindings.push(C)}function u(C,m,g,d){const b=c(C,void 0,m,g,d);if(b)return b;const _=o[(C||"").toLowerCase()];if(!_)throw new TypeError(`The operator "${C}" is not permitted`);return _}function h(C,m,g){const d=C.toLowerCase().indexOf(" as ");if(d!==-1){const E=C.slice(0,d),R=C.slice(d+4);return g.alias(h(E,m,g),n(R,m,g))}const b=[];let _=-1;const q=C.split(".");for(;++_<q.length;)C=q[_],_===0&&q.length>1?b.push(h((C||"").trim(),m,g)):b.push(n(C,m,g));return b.join(".")}function l(C,m,g,d){const b=[];for(const _ in C){const q=C[_];if(typeof q=="function"){const E=i(q,void 0,g,d);E.as=_,b.push(f(E,!0,m,g))}else q instanceof s?b.push(g.alias(`(${e(q,void 0,m,g,d)})`,n(_,m,g))):b.push(g.alias(e(q,void 0,m,g,d),n(_,m,g)))}return b.join(", ")}function f(C,m,g,d){let b=C.sql||"";return b&&(C.method==="select"||C.method==="first")&&(m||C.as)&&(b=`(${b})`,C.as)?d.alias(b,h(C.as,g,d)):b}function p(C,m,g,d,b){return typeof C=="function"?f(i(C,m,d,b),void 0,g,d):c(C,void 0,g,d,b)||""}function w(C,m,g,d){const b=c(C,void 0,m,g,d);return b||(t.indexOf((C||"").toLowerCase())!==-1?C:"asc")}return Va={columnize:r,direction:w,operator:u,outputQuery:f,rawOrFn:p,unwrapRaw:c,wrap:e,wrapString:h},Va}var Wa,zg;function Gq(){if(zg)return Wa;zg=1;const{columnize:a}=qe();function s(n,t){const o={bindings:[]},r=n,e=n.bindings.length,c=n.bindings;let u=0;const h=n.sql.replace(/\\?\?\??/g,function(l){if(l==="\\?")return l;const f=c[u++];return l==="??"?a(f,r,t,o):t.parameter(f,r,o)});if(e!==u)throw new Error(`Expected ${e} bindings, saw ${u}`);return{method:"raw",sql:h,bindings:o.bindings}}function i(n,t){const o={bindings:[]},r=n,e=n.bindings,c=/\\?(:(\w+):(?=::)|:(\w+):(?!:)|:(\w+))/g;return{method:"raw",sql:n.sql.replace(c,function(h,l,f,p,w){if(h!==l)return l;const C=f||p||w,m=h.trim(),g=m[m.length-1]===":",d=e[C];return d===void 0?(Object.prototype.hasOwnProperty.call(e,C)&&o.bindings.push(d),h):g?h.replace(l,a(d,r,t,o)):h.replace(l,t.parameter(d,r,o))}),bindings:o.bindings}}return Wa={replaceKeyBindings:i,replaceRawArrBindings:s},Wa}var Ga,Kg;function Gc(){if(Kg)return Ga;Kg=1;const a="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",s="0123456789";function i(t=21){let o="",r=t;for(;r--;)o+=a[Math.random()*64|0];return o}function n(t=21){let o="",r=t;for(;r--;)o+=s[Math.random()*10|0];return o}return Ga={nanoid:i,nanonum:n},Ga}var za,Jg;function lt(){if(Jg)return za;Jg=1;const{EventEmitter:a}=ke(),s=Oe(),i=We(),n=Le(),t=Tt(),{replaceRawArrBindings:o,replaceKeyBindings:r}=Gq(),e=Ce(),c=Vc(),{nanoid:u}=Gc(),{isNumber:h,isObject:l}=ye(),{augmentWithBuilderInterface:f}=Wc(),p=s("knex:bindings");class w extends a{constructor(m){super(),this.client=m,this.sql="",this.bindings=[],this._wrappedBefore=void 0,this._wrappedAfter=void 0,m&&m.config&&(this._debug=m.config.debug,c(this,4))}set(m,g){return this.sql=m,this.bindings=l(g)&&!g.toSQL||g===void 0?g:[g],this}timeout(m,{cancel:g}={}){return h(m)&&m>0&&(this._timeout=m,g&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}wrap(m,g){return this._wrappedBefore=m,this._wrappedAfter=g,this}toString(){return this.toQuery()}toSQL(m,g){let d;if(Array.isArray(this.bindings)?d=o(this,this.client):this.bindings&&n(this.bindings)?d=r(this,this.client):d={method:"raw",sql:this.sql,bindings:this.bindings===void 0?[]:[this.bindings]},this._wrappedBefore&&(d.sql=this._wrappedBefore+d.sql),this._wrappedAfter&&(d.sql=d.sql+this._wrappedAfter),d.options=t(this._options,i,{}),this._timeout&&(d.timeout=this._timeout,this._cancelOnTimeout&&(d.cancelOnTimeout=this._cancelOnTimeout)),d.bindings=d.bindings||[],e.containsUndefined(d.bindings)){const b=e.getUndefinedIndices(this.bindings);throw p(d.bindings),new Error(`Undefined binding(s) detected for keys [${b}] when compiling RAW query: ${d.sql}`)}return d.__knexQueryUid=u(),Object.defineProperties(d,{toNative:{value:()=>({sql:this.client.positionBindings(d.sql),bindings:this.client.prepBindings(d.bindings)}),enumerable:!1}}),d}}return w.prototype.isRawInstance=!0,f(w),e.addQueryContext(w),za=w,za}var Ka,Yg;function zc(){if(Yg)return Ka;Yg=1;function a(s){for(var i=-1,n=s==null?0:s.length,t=0,o=[];++i<n;){var r=s[i];r&&(o[t++]=r)}return o}return Ka=a,Ka}var Ja,Xg;function zq(){if(Xg)return Ja;Xg=1;function a(s,i,n,t){for(var o=-1,r=s==null?0:s.length;++o<r;){var e=s[o];i(t,e,n(e),s)}return t}return Ja=a,Ja}var Ya,Zg;function Kq(){if(Zg)return Ya;Zg=1;var a=ut();function s(i,n,t,o){return a(i,function(r,e,c){n(o,r,t(r),c)}),o}return Ya=s,Ya}var Xa,ey;function Jq(){if(ey)return Xa;ey=1;var a=zq(),s=Kq(),i=Pe(),n=_e();function t(o,r){return function(e,c){var u=n(e)?a:s,h=r?r():{};return u(e,o,i(c,2),h)}}return Xa=t,Xa}var Za,ty;function or(){if(ty)return Za;ty=1;var a=Kt(),s=Jq(),i=Object.prototype,n=i.hasOwnProperty,t=s(function(o,r,e){n.call(o,e)?o[e].push(r):a(o,e,[r])});return Za=t,Za}var eu,ry;function Yq(){if(ry)return eu;ry=1;var a=Object.prototype,s=a.hasOwnProperty;function i(n,t){return n!=null&&s.call(n,t)}return eu=i,eu}var tu,ny;function ar(){if(ny)return tu;ny=1;var a=Yq(),s=Aw();function i(n,t){return n!=null&&s(n,t,a)}return tu=i,tu}var ru,iy;function Xq(){if(iy)return ru;iy=1;var a=ut(),s=xe();function i(n,t){var o=-1,r=s(n)?Array(n.length):[];return a(n,function(e,c,u){r[++o]=t(e,c,u)}),r}return ru=i,ru}var nu,sy;function ze(){if(sy)return nu;sy=1;var a=er(),s=Pe(),i=Xq(),n=_e();function t(o,r){var e=n(o)?a:i;return e(o,s(r,3))}return nu=t,nu}var iu,oy;function Zq(){if(oy)return iu;oy=1;var a=Jt(),s=ir(),i=Yt(),n=Ae(),t=At();function o(r,e,c,u){if(!n(r))return r;e=s(e,r);for(var h=-1,l=e.length,f=l-1,p=r;p!=null&&++h<l;){var w=t(e[h]),C=c;if(w==="__proto__"||w==="constructor"||w==="prototype")return r;if(h!=f){var m=p[w];C=u?u(m,w,p):void 0,C===void 0&&(C=n(m)?m:i(e[h+1])?[]:{})}a(p,w,C),p=p[w]}return r}return iu=o,iu}var su,ay;function eE(){if(ay)return su;ay=1;var a=Qc(),s=Zq(),i=ir();function n(t,o,r){for(var e=-1,c=o.length,u={};++e<c;){var h=o[e],l=a(t,h);r(l,h)&&s(u,i(h,t),l)}return u}return su=n,su}var ou,uy;function tE(){if(uy)return ou;uy=1;var a=er(),s=Pe(),i=eE(),n=U_();function t(o,r){if(o==null)return{};var e=a(n(o),function(c){return[c]});return r=s(r),i(o,e,function(c,u){return r(c,u[0])})}return ou=t,ou}var au,ly;function rE(){if(ly)return au;ly=1;var a=Pe(),s=Rw(),i=tE();function n(t,o){return i(t,s(a(o)))}return au=n,au}var uu,cy;function Ke(){if(cy)return uu;cy=1;const a=Ce(),s=lt(),i=je(),n=Sw(),t=Oe(),o=We(),r=zc(),e=or(),c=ar(),u=Te(),h=ze(),l=rE(),f=Tt(),{nanoid:p}=Gc(),{isString:w,isUndefined:C}=ye(),{columnize:m,direction:g,operator:d,wrap:b,unwrapRaw:_,rawOrFn:q}=qe(),E=t("knex:bindings"),R=["comments","columns","join","where","union","group","having","order","limit","offset","lock","waitMode"];class ${constructor(v,T,B){this.client=v,this.method=T._method||"select",this.options=T._options,this.single=T._single,this.queryComments=T._comments,this.timeout=T._timeout||!1,this.cancelOnTimeout=T._cancelOnTimeout||!1,this.grouped=e(T._statements,"grouping"),this.formatter=v.formatter(T),this._emptyInsertValue="default values",this.first=this.select,this.bindings=B||[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.builder=this.formatter.builder}toSQL(v,T){this._undefinedInWhereClause=!1,this.undefinedBindingsInfo=[],v=v||this.method;const B=this[v]()||"",F={method:v,options:f(this.options,o,{}),timeout:this.timeout,cancelOnTimeout:this.cancelOnTimeout,bindings:this.bindingsHolder.bindings||[],__knexQueryUid:p()};if(Object.defineProperties(F,{toNative:{value:()=>({sql:this.client.positionBindings(F.sql),bindings:this.client.prepBindings(F.bindings)}),enumerable:!1}}),w(B)?F.sql=B:o(F,B),(v==="select"||v==="first")&&this.single.as&&(F.as=this.single.as),this._undefinedInWhereClause)throw E(F.bindings),new Error(`Undefined binding(s) detected when compiling ${v.toUpperCase()}. Undefined column(s): [${this.undefinedBindingsInfo.join(", ")}] query: ${F.sql}`);return F}select(){let v=this.with(),T="";const B=[],F=[];R.forEach(A=>{const j=this[A](this);switch(A){case"union":T=j;break;case"comments":case"columns":case"join":case"where":B.push(j);break;default:F.push(j);break}});const y=this.grouped.union&&this.grouped.union.map(A=>A.wrap).some(A=>A);if(this.onlyUnions()){const A=r(B.concat(F)).join(" ");v+=T+(A?" "+A:"")}else{const A=(y?"(":"")+r(B).join(" ")+(y?")":""),j=r(F).join(" ");v+=A+(T?" "+T:"")+(j&&" "+j)}return v}pluck(){let v=this.single.pluck;return v.indexOf(".")!==-1&&(v=v.split(".").slice(-1)[0]),{sql:this.select(),pluck:v}}insert(){const v=this.single.insert||[],T=this.with()+`insert into ${this.tableName} `,B=this._insertBody(v);return B===""?"":T+B}_onConflictClause(v){return v instanceof s?this.formatter.wrap(v):`(${this.formatter.columnize(v)})`}_buildInsertValues(v){let T="",B=-1;for(;++B<v.values.length;)B!==0&&(T+="), ("),T+=this.client.parameterize(v.values[B],this.client.valueForUndefined,this.builder,this.bindingsHolder);return T}_insertBody(v){let T="";if(Array.isArray(v)){if(v.length===0)return""}else if(typeof v=="object"&&u(v))return T+this._emptyInsertValue;const B=this._prepInsert(v);return typeof B=="string"?T+=B:B.columns.length?(T+=`(${m(B.columns,this.builder,this.client,this.bindingsHolder)}`,T+=") values ("+this._buildInsertValues(B)+")"):v.length===1&&v[0]?T+=this._emptyInsertValue:T="",T}update(){const v=this.with(),{tableName:T}=this,B=this._prepUpdate(this.single.update),F=this.where();return v+`update ${this.single.only?"only ":""}${T} set `+B.join(", ")+(F?` ${F}`:"")}_hintComments(){let v=this.grouped.hintComments||[];return v=v.map(T=>r(T.value).join(" ")),v=r(v).join(" "),v?`/*+ ${v} */ `:""}columns(){let v="";if(this.onlyUnions())return"";const T=this._hintComments(),B=this.grouped.columns||[];let F=-1,y=[];if(B)for(;++F<B.length;){const j=B[F];if(j.distinct&&(v="distinct "),j.distinctOn){v=this.distinctOn(j.value);continue}j.type==="aggregate"?y.push(...this.aggregate(j)):j.type==="aggregateRaw"?y.push(this.aggregateRaw(j)):j.type==="analytic"?y.push(this.analytic(j)):j.type==="json"?y.push(this.json(j)):j.value&&j.value.length>0&&y.push(m(j.value,this.builder,this.client,this.bindingsHolder))}return y.length===0&&(y=["*"]),`${this.onlyJson()?"":"select "}${T}${v}`+y.join(", ")+(this.tableName?` from ${this.single.only?"only ":""}${this.tableName}`:"")}comments(){return this.queryComments.length?this.queryComments.map(v=>`/* ${v.comment} */`).join(" "):""}_aggregate(v,{aliasSeparator:T=" as ",distinctParentheses:B}={}){const F=v.value,y=v.method,A=v.aggregateDistinct?"distinct ":"",j=x=>b(x,void 0,this.builder,this.client,this.bindingsHolder),Y=(x,S)=>S?x+T+j(S):x,ee=(x,S)=>{let I=x.map(j).join(", ");if(A){const X=B?"(":" ",z=B?")":"";I=A.trim()+X+I+z}const k=`${y}(${I})`;return Y(k,S)},H=(x,S)=>{const I=`${y}(${A+j(x)})`;return Y(I,S)};if(Array.isArray(F))return[ee(F)];if(typeof F=="object"){if(v.alias)throw new Error("When using an object explicit alias can not be used");return Object.entries(F).map(([x,S])=>Array.isArray(S)?ee(S,x):H(S,x))}const N=F.toLowerCase().indexOf(" as ");let V=F,{alias:K}=v;if(N!==-1){if(V=F.slice(0,N),K)throw new Error(`Found multiple aliases for same column: ${V}`);K=F.slice(N+4)}return[H(V,K)]}aggregate(v){return this._aggregate(v)}aggregateRaw(v){const T=v.aggregateDistinct?"distinct ":"";return`${v.method}(${T+_(v.value,void 0,this.builder,this.client,this.bindingsHolder)})`}_joinTable(v){return v.schema&&!(v.table instanceof s)?`${v.schema}.${v.table}`:v.table}join(){let v="",T=-1;const B=this.grouped.join;if(!B)return"";for(;++T<B.length;){const F=B[T],y=this._joinTable(F);if(T>0&&(v+=" "),F.joinType==="raw")v+=_(F.table,void 0,this.builder,this.client,this.bindingsHolder);else{v+=F.joinType+" join "+b(y,void 0,this.builder,this.client,this.bindingsHolder);let A=-1;for(;++A<F.clauses.length;){const j=F.clauses[A];A>0?v+=` ${j.bool} `:v+=` ${j.type==="onUsing"?"using":"on"} `;const Y=this[j.type](j);Y&&(v+=Y)}}}return v}onBetween(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(v,"between")+" "+v.value.map(T=>this.client.parameter(T,this.builder,this.bindingsHolder)).join(" and ")}onNull(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(v,"null")}onExists(v){return this._not(v,"exists")+" ("+q(v.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}onIn(v){if(Array.isArray(v.column))return this.multiOnIn(v);let T;return v.value instanceof s?T=this.client.parameter(v.value,this.builder,this.formatter):T=this.client.parameterize(v.value,void 0,this.builder,this.bindingsHolder),b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(v,"in ")+this.wrap(T)}multiOnIn(v){let T=-1,B=`(${m(v.column,this.builder,this.client,this.bindingsHolder)}) `;for(B+=this._not(v,"in ")+"((";++T<v.value.length;)T!==0&&(B+="),("),B+=this.client.parameterize(v.value[T],void 0,this.builder,this.bindingsHolder);return B+"))"}where(){const v=this.grouped.where;if(!v)return;const T=[];let B=-1;for(;++B<v.length;){const F=v[B];Object.prototype.hasOwnProperty.call(F,"value")&&a.containsUndefined(F.value)&&(this.undefinedBindingsInfo.push(F.column),this._undefinedInWhereClause=!0);const y=this[F.type](F);y&&(T.length===0?T[0]="where":T.push(F.bool),T.push(y))}return T.length>1?T.join(" "):""}group(){return this._groupsOrders("group")}order(){return this._groupsOrders("order")}having(){const v=this.grouped.having;if(!v)return"";const T=["having"];for(let B=0,F=v.length;B<F;B++){const y=v[B],A=this[y.type](y);A&&(T.length===0&&(T[0]="where"),(T.length>1||T.length===1&&T[0]!=="having")&&T.push(y.bool),T.push(A))}return T.length>1?T.join(" "):""}havingRaw(v){return this._not(v,"")+_(v.value,void 0,this.builder,this.client,this.bindingsHolder)}havingWrapped(v){const T=q(v.value,"where",this.builder,this.client,this.bindingsHolder);return T&&this._not(v,"")+"("+T.slice(6)+")"||""}havingBasic(v){return this._not(v,"")+b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+d(v.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(v.value,this.builder,this.bindingsHolder)}havingNull(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(v,"null")}havingExists(v){return this._not(v,"exists")+" ("+q(v.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}havingBetween(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(v,"between")+" "+v.value.map(T=>this.client.parameter(T,this.builder,this.bindingsHolder)).join(" and ")}havingIn(v){return Array.isArray(v.column)?this.multiHavingIn(v):b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(v,"in ")+this.wrap(this.client.parameterize(v.value,void 0,this.builder,this.bindingsHolder))}multiHavingIn(v){return this.multiOnIn(v)}union(){const v=this.onlyUnions(),T=this.grouped.union;if(!T)return"";let B="";for(let F=0,y=T.length;F<y;F++){const A=T[F];F>0&&(B+=" "),(F>0||!v)&&(B+=A.clause+" ");const j=q(A.value,void 0,this.builder,this.client,this.bindingsHolder);if(j){const Y=A.wrap;Y&&(B+="("),B+=j,Y&&(B+=")")}}return B}onlyUnions(){return(!this.grouped.columns||!!this.grouped.columns[0].value)&&this.grouped.union&&!this.tableName}_getValueOrParameterFromAttribute(v,T){return this.single.skipBinding[v]===!0?T??this.single[v]:this.client.parameter(this.single[v],this.builder,this.bindingsHolder)}onlyJson(){return!this.tableName&&this.grouped.columns&&this.grouped.columns.length===1&&this.grouped.columns[0].type==="json"}limit(){return!this.single.limit&&this.single.limit!==0?"":`limit ${this._getValueOrParameterFromAttribute("limit")}`}offset(){return this.single.offset?`offset ${this._getValueOrParameterFromAttribute("offset")}`:""}del(){const{tableName:v}=this,T=this.with(),B=this.where(),F=this.join(),y=F?v+" ":"";return T+`delete ${y}from ${this.single.only?"only ":""}${v}`+(F?` ${F}`:"")+(B?` ${B}`:"")}truncate(){return`truncate ${this.tableName}`}lock(){if(this.single.lock)return this[this.single.lock]()}waitMode(){if(this.single.waitMode)return this[this.single.waitMode]()}skipLocked(){throw new Error(".skipLocked() is currently only supported on MySQL 8.0+ and PostgreSQL 9.5+")}noWait(){throw new Error(".noWait() is currently only supported on MySQL 8.0+, MariaDB 10.3.0+ and PostgreSQL 9.5+")}distinctOn(v){throw new Error(".distinctOn() is currently only supported on PostgreSQL")}onWrapped(v){const T=this,B=new n;v.value.call(B,B);let F="";for(let y=0;y<B.clauses.length;y++){const A=B.clauses[y];y>0&&(F+=` ${A.bool} `);const j=T[A.type](A);j&&(F+=j)}return F.length?`(${F})`:""}onBasic(v){const T=v.value instanceof i;return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+d(v.operator,this.builder,this.client,this.bindingsHolder)+" "+(T?"(":"")+b(v.value,void 0,this.builder,this.client,this.bindingsHolder)+(T?")":"")}onVal(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+d(v.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(v.value,this.builder,this.bindingsHolder)}onRaw(v){return _(v.value,void 0,this.builder,this.client,this.bindingsHolder)}onUsing(v){return"("+m(v.column,this.builder,this.client,this.bindingsHolder)+")"}_valueClause(v){return v.asColumn?b(v.value,void 0,this.builder,this.client,this.bindingsHolder):this.client.parameter(v.value,this.builder,this.bindingsHolder)}_columnClause(v){let T;return Array.isArray(v.column)?T=`(${m(v.column,this.builder,this.client,this.bindingsHolder)})`:T=b(v.column,void 0,this.builder,this.client,this.bindingsHolder),T}whereIn(v){const T=this.client.values(v.value,this.builder,this.bindingsHolder);return`${this._columnClause(v)} ${this._not(v,"in ")}${T}`}whereLike(v){return`${this._columnClause(v)} ${this._not(v,"like ")}${this._valueClause(v)}`}whereILike(v){return`${this._columnClause(v)} ${this._not(v,"ilike ")}${this._valueClause(v)}`}whereNull(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(v,"null")}whereBasic(v){return this._not(v,"")+b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+d(v.operator,this.builder,this.client,this.bindingsHolder)+" "+this._valueClause(v)}whereExists(v){return this._not(v,"exists")+" ("+q(v.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}whereWrapped(v){const T=q(v.value,"where",this.builder,this.client,this.bindingsHolder);return T&&this._not(v,"")+"("+T.slice(6)+")"||""}whereBetween(v){return b(v.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(v,"between")+" "+v.value.map(T=>this.client.parameter(T,this.builder,this.bindingsHolder)).join(" and ")}whereRaw(v){return this._not(v,"")+_(v.value,void 0,this.builder,this.client,this.bindingsHolder)}_jsonWrapValue(v){if(!this.builder._isJsonObject(v))try{return JSON.stringify(JSON.parse(v.replace(/\n|\t/g,"")))}catch{return v}return JSON.stringify(v)}_jsonValueClause(v){return v.value=this._jsonWrapValue(v.value),this._valueClause(v)}whereJsonObject(v){return`${this._columnClause(v)} ${v.not?"!=":"="} ${this._jsonValueClause(v)}`}wrap(v){return v.charAt(0)!=="("?`(${v})`:v}json(v){return this[v.method](v.params)}analytic(v){let T="";const B=this;return T+=v.method+"() over (",v.raw?T+=v.raw:(v.partitions.length&&(T+="partition by ",T+=h(v.partitions,function(F){return w(F)?B.formatter.columnize(F):B.formatter.columnize(F.column)+(F.order?" "+F.order:"")}).join(", ")+" "),T+="order by ",T+=h(v.order,function(F){return w(F)?B.formatter.columnize(F):B.formatter.columnize(F.column)+(F.order?" "+F.order:"")}).join(", ")),T+=")",v.alias&&(T+=" as "+v.alias),T}with(){if(!this.grouped.with||!this.grouped.with.length)return"";const v=this.grouped.with;if(!v)return;const T=[];let B=-1,F=!1;for(;++B<v.length;){const y=v[B];y.recursive&&(F=!0);const A=this[y.type](y);T.push(A)}return`with ${F?"recursive ":""}${T.join(", ")} `}withWrapped(v){const T=q(v.value,void 0,this.builder,this.client,this.bindingsHolder),B=v.columnList?"("+m(v.columnList,this.builder,this.client,this.bindingsHolder)+")":"",F=v.materialized===void 0?"":v.materialized?"materialized ":"not materialized ";return T&&m(v.alias,this.builder,this.client,this.bindingsHolder)+B+" as "+F+"("+T+")"||""}_not(v,T){return v.not?`not ${T}`:T}_prepInsert(v){const T=q(v,void 0,this.builder,this.client,this.bindingsHolder);if(T)return T;let B=[];const F=[];Array.isArray(v)||(v=v?[v]:[]);let y=-1;for(;++y<v.length&&v[y]!=null;){y===0&&(B=Object.keys(v[y]).sort());const A=new Array(B.length),j=Object.keys(v[y]);let Y=-1;for(;++Y<j.length;){const ee=j[Y];let H=B.indexOf(ee);if(H===-1){B=B.concat(ee).sort(),H=B.indexOf(ee);let N=-1;for(;++N<F.length;)F[N].splice(H,0,void 0);A.splice(H,0,void 0)}A[H]=v[y][ee]}F.push(A)}return{columns:B,values:F}}_prepUpdate(v={}){const{counter:T={}}=this.single;for(const A of Object.keys(T)){if(c(v,A)){this.client.logger.warn("increment/decrement called for a column that has already been specified in main .update() call. Ignoring increment/decrement and using value from .update() call.");continue}let j=T[A];const Y=j<0?"-":"+";Y==="-"&&(j=-j),v[A]=this.client.raw(`?? ${Y} ?`,[A,j])}v=l(v,C);const B=[],F=Object.keys(v);let y=-1;for(;++y<F.length;)B.push(b(F[y],void 0,this.builder,this.client,this.bindingsHolder)+" = "+this.client.parameter(v[F[y]],this.builder,this.bindingsHolder));if(u(B))throw new Error(["Empty .update() call detected!","Update data does not contain any values to update.","This will result in a faulty query.",this.single.table?`Table: ${this.single.table}.`:"",this.single.update?`Columns: ${Object.keys(this.single.update)}.`:""].join(" "));return B}_formatGroupsItemValue(v,T){const{formatter:B}=this;let F="";T==="last"?F=" is null":T==="first"&&(F=" is not null");let y;return v instanceof s?y=_(v,void 0,this.builder,this.client,this.bindingsHolder):v instanceof i||T?y="("+B.columnize(v)+F+")":y=B.columnize(v),y}_basicGroupOrder(v,T){const B=this._formatGroupsItemValue(v.value,v.nulls),F=T==="order"&&v.type!=="orderByRaw"?` ${g(v.direction,this.builder,this.client,this.bindingsHolder)}`:"";return B+F}_groupOrder(v,T){return this._basicGroupOrder(v,T)}_groupOrderNulls(v,T){const B=this._formatGroupsItemValue(v.value),F=T==="order"&&v.type!=="orderByRaw"?` ${g(v.direction,this.builder,this.client,this.bindingsHolder)}`:"";return v.nulls&&!(v.value instanceof s)?`${B}${F||""} nulls ${v.nulls}`:B+F}_groupsOrders(v){const T=this.grouped[v];if(!T)return"";const B=T.map(F=>this._groupOrder(F,v));return B.length?v+" by "+B.join(", "):""}get tableName(){if(!this._tableName){let v=this.single.table;const T=this.single.schema;if(v&&T){const B=v instanceof i,F=v instanceof s;!B&&!F&&!(typeof v=="function")&&(v=`${T}.${v}`)}this._tableName=v?b(v,v instanceof i,this.builder,this.client,this.bindingsHolder):""}return this._tableName}_jsonPathWrap(v){return this.client.parameter(v.path||v[1],this.builder,this.bindingsHolder)}_jsonExtract(v,T){let B;return Array.isArray(T.column)?B=T.column:B=[T],Array.isArray(v)||(v=[v]),B.map(F=>{let y=`${m(F.column||F[0],this.builder,this.client,this.bindingsHolder)}, ${this._jsonPathWrap(F)}`;v.forEach(j=>{y=j+"("+y+")"});const A=F.alias||F[2];return A?this.client.alias(y,this.formatter.wrap(A)):y}).join(", ")}_jsonSet(v,T){const B=`${v}(${m(T.column,this.builder,this.client,this.bindingsHolder)}, ${this.client.parameter(T.path,this.builder,this.bindingsHolder)}, ${this.client.parameter(T.value,this.builder,this.bindingsHolder)})`;return T.alias?this.client.alias(B,this.formatter.wrap(T.alias)):B}_whereJsonPath(v,T){return`${v}(${this._columnClause(T)}, ${this._jsonPathWrap({path:T.jsonPath})}) ${d(T.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(T)}`}_onJsonPathEquals(v,T){return v+"("+b(T.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(T.jsonPathFirst,this.builder,this.bindingsHolder)+") = "+v+"("+b(T.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(T.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return uu=$,uu}var lu,hy;function Ow(){if(hy)return lu;hy=1;const{EventEmitter:a}=ke(),s=Rt(),i=We(),{addQueryContext:n}=Ce(),t=Vc(),{augmentWithBuilderInterface:o}=Wc();class r extends a{constructor(c){super(),this.client=c,this._sequence=[],c.config&&(this._debug=c.config.debug,t(this,4))}withSchema(c){return this._schema=c,this}toString(){return this.toQuery()}toSQL(){return this.client.schemaCompiler(this).toSQL()}async generateDdlCommands(){return await this.client.schemaCompiler(this).generateDdlCommands()}}return["createTable","createTableIfNotExists","createTableLike","createView","createViewOrReplace","createMaterializedView","refreshMaterializedView","dropView","dropViewIfExists","dropMaterializedView","dropMaterializedViewIfExists","createSchema","createSchemaIfNotExists","dropSchema","dropSchemaIfExists","createExtension","createExtensionIfNotExists","dropExtension","dropExtensionIfExists","table","alterTable","view","alterView","hasTable","hasColumn","dropTable","renameTable","renameView","dropTableIfExists","raw"].forEach(function(e){r.prototype[e]=function(){return e==="createTableIfNotExists"&&this.client.logger.warn(["Use async .hasTable to check if table exists and then use plain .createTable. Since ",'.createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." ',"query it will not work correctly if there are any alter table queries generated for ","columns afterwards. To not break old migrations this function is left untouched for now",", but it should not be used when writing new code and it is removed from documentation."].join("")),e==="table"&&(e="alterTable"),e==="view"&&(e="alterView"),this._sequence.push({method:e,args:s(arguments)}),this}}),r.extend=(e,c)=>{if(Object.prototype.hasOwnProperty.call(r.prototype,e))throw new Error(`Can't extend SchemaBuilder with existing method ('${e}').`);i(r.prototype,{[e]:c})},o(r),n(r),lu=r,lu}var cu,fy;function ur(){if(fy)return cu;fy=1;const a=sr(),{isString:s}=ye();function i(o){o&&(s(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.push(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}function n(o){const r=new this.constructor(this.client,this.tableCompiler,this.columnBuilder);o.call(r,a(arguments)),this.sequence.additional=(this.sequence.additional||[]).concat(r.sequence)}function t(o){o&&(s(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.unshift(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}return cu={pushAdditional:n,pushQuery:i,unshiftQuery:t},cu}var hu,dy;function ct(){if(dy)return hu;dy=1;const{pushQuery:a,pushAdditional:s,unshiftQuery:i}=ur();class n{constructor(h,l){this.builder=l,this._commonBuilder=this.builder,this.client=h,this.schema=l._schema,this.bindings=[],this.bindingsHolder=this,this.formatter=h.formatter(l),this.formatter.bindings=this.bindings,this.sequence=[]}createSchema(){c("createSchema")}createSchemaIfNotExists(){c("createSchemaIfNotExists")}dropSchema(){c("dropSchema")}dropSchemaIfExists(){c("dropSchemaIfExists")}dropTable(h){this.pushQuery(this.dropTablePrefix+this.formatter.wrap(e(this.schema,h)))}dropTableIfExists(h){this.pushQuery(this.dropTablePrefix+"if exists "+this.formatter.wrap(e(this.schema,h)))}dropView(h){this._dropView(h,!1,!1)}dropViewIfExists(h){this._dropView(h,!0,!1)}dropMaterializedView(h){throw new Error("materialized views are not supported by this dialect.")}dropMaterializedViewIfExists(h){throw new Error("materialized views are not supported by this dialect.")}renameView(h,l){throw new Error("rename view is not supported by this dialect (instead drop then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}_dropView(h,l,f){this.pushQuery((f?this.dropMaterializedViewPrefix:this.dropViewPrefix)+(l?"if exists ":"")+this.formatter.wrap(e(this.schema,h)))}raw(h,l){this.sequence.push(this.client.raw(h,l).toSQL())}toSQL(){const h=this.builder._sequence;for(let l=0,f=h.length;l<f;l++){const p=h[l];this[p.method].apply(this,p.args)}return this.sequence}async generateDdlCommands(){const h=this.toSQL();return{pre:[],sql:Array.isArray(h)?h:[h],check:null,post:[]}}}n.prototype.dropTablePrefix="drop table ",n.prototype.dropViewPrefix="drop view ",n.prototype.dropMaterializedViewPrefix="drop materialized view ",n.prototype.alterViewPrefix="alter view ",n.prototype.alterTable=o("alter"),n.prototype.createTable=o("create"),n.prototype.createTableIfNotExists=o("createIfNot"),n.prototype.createTableLike=o("createLike"),n.prototype.createView=r("create"),n.prototype.createViewOrReplace=r("createOrReplace"),n.prototype.createMaterializedView=r("createMaterializedView"),n.prototype.alterView=r("alter"),n.prototype.pushQuery=a,n.prototype.pushAdditional=s,n.prototype.unshiftQuery=i;function t(u){const h=this.builder.queryContext();h!==void 0&&u.queryContext()===void 0&&u.queryContext(h),u.setSchema(this.schema);const l=u.toSQL();for(let f=0,p=l.length;f<p;f++)this.sequence.push(l[f])}function o(u){return u==="createLike"?function(h,l,f){const p=this.client.tableBuilder(u,h,l,f);t.call(this,p)}:function(h,l){const f=this.client.tableBuilder(u,h,null,l);t.call(this,f)}}function r(u){return function(h,l){const f=this.client.viewBuilder(u,h,l);t.call(this,f)}}function e(u,h){return u?`${u}.${h}`:h}function c(u){throw new Error(`${u} is not supported for this dialect (only PostgreSQL supports it currently).`)}return hu=n,hu}var fu,py;function nE(){if(py)return fu;py=1;var a=Qe(),s=Mc(),i=Ve(),n=s(function(t,o){a(o,i(o),t)});return fu=n,fu}var du,my;function lr(){return my||(my=1,du=nE()),du}var pu,gy;function Nw(){if(gy)return pu;gy=1;const a=Et(),s=lr(),i=We(),n=Rt(),t=Ce(),{isString:o,isFunction:r,isObject:e}=ye();class c{constructor(p,w,C,m,g){if(this.client=p,this._fn=g,this._method=w,this._schemaName=void 0,this._tableName=C,this._tableNameLike=m,this._statements=[],this._single={},!m&&!r(this._fn))throw new TypeError("A callback function must be supplied to calls against `.createTable` and `.table`")}setSchema(p){this._schemaName=p}toSQL(){return this._method==="alter"&&s(this,l),this._fn&&this._fn.call(this,this),this.client.tableCompiler(this).toSQL()}timestamps(p,w,C){e(p)&&({useTimestamps:p,defaultToNow:w,useCamelCase:C}=p);const m=p===!0?"timestamp":"datetime",g=this[m](C?"createdAt":"created_at"),d=this[m](C?"updatedAt":"updated_at");if(w===!0){const b=this.client.raw("CURRENT_TIMESTAMP");g.notNullable().defaultTo(b),d.notNullable().defaultTo(b)}}comment(p){if(typeof p!="string")throw new TypeError("Table comment must be string");this._single.comment=p}foreign(p,w){const C={column:p,keyName:w};this._statements.push({grouping:"alterTable",method:"foreign",args:[C]});let m={references(g){let d;return o(g)&&(d=g.split(".")),!d||d.length===1?(C.references=d?d[0]:g,{on(b){if(typeof b!="string")throw new TypeError(`Expected tableName to be a string, got: ${typeof b}`);return C.inTable=b,m},inTable(){return this.on.apply(this,arguments)}}):(C.inTable=d[0],C.references=d[1],m)},withKeyName(g){return C.keyName=g,m},onUpdate(g){return C.onUpdate=g,m},onDelete(g){return C.onDelete=g,m},deferrable:g=>{if(["mysql","mssql","redshift","mysql2","oracledb"].indexOf(this.client.dialect)!==-1)throw new Error(`${this.client.dialect} does not support deferrable`);return C.deferrable=g,m},_columnBuilder(g){return s(g,m),m=g,g}};return m}check(p,w,C){return this._statements.push({grouping:"checks",args:[p,w,C]}),this}}["index","primary","unique","dropPrimary","dropUnique","dropIndex","dropForeign"].forEach(f=>{c.prototype[f]=function(){return this._statements.push({grouping:"alterTable",method:f,args:n(arguments)}),this}}),a({mysql:["engine","charset","collate"],postgresql:["inherits"]},function(f,p){f.forEach(function(w){c.prototype[w]=function(C){if(this.client.dialect!==p)throw new Error(`Knex only supports ${w} statement with ${p}.`);if(this._method==="alter")throw new Error(`Knex does not support altering the ${w} outside of create table, please use knex.raw statement.`);this._single[w]=C}})}),t.addQueryContext(c),["tinyint","smallint","mediumint","int","bigint","decimal","float","double","real","bit","boolean","serial","date","datetime","timestamp","time","year","geometry","geography","point","char","varchar","tinytext","tinyText","text","mediumtext","mediumText","longtext","longText","binary","varbinary","tinyblob","tinyBlob","mediumblob","mediumBlob","blob","longblob","longBlob","enum","set","bool","dateTime","increments","bigincrements","bigIncrements","integer","biginteger","bigInteger","string","json","jsonb","uuid","enu","specificType"].forEach(f=>{c.prototype[f]=function(){const p=n(arguments),w=this.client.columnBuilder(this,f,p);return this._statements.push({grouping:"columns",builder:w}),w}});const l={renameColumn(f,p){return this._statements.push({grouping:"alterTable",method:"renameColumn",args:[f,p]}),this},dropTimestamps(){return this.dropColumns(arguments[0]===!0?["createdAt","updatedAt"]:["created_at","updated_at"])},setNullable(f){return this._statements.push({grouping:"alterTable",method:"setNullable",args:[f]}),this},check(f,p,w){this._statements.push({grouping:"alterTable",method:"check",args:[f,p,w]})},dropChecks(){this._statements.push({grouping:"alterTable",method:"dropChecks",args:n(arguments)})},dropNullable(f){return this._statements.push({grouping:"alterTable",method:"dropNullable",args:[f]}),this}};return l.dropColumn=l.dropColumns=function(){return this._statements.push({grouping:"alterTable",method:"dropColumn",args:n(arguments)}),this},c.extend=(f,p)=>{if(Object.prototype.hasOwnProperty.call(c.prototype,f))throw new Error(`Can't extend TableBuilder with existing method ('${f}').`);i(c.prototype,{[f]:p})},pu=c,pu}var mu,yy;function iE(){if(yy)return mu;yy=1;function a(s,i,n,t){for(var o=s.length,r=n+(t?1:-1);t?r--:++r<o;)if(i(s[r],r,s))return r;return-1}return mu=a,mu}var gu,by;function sE(){if(by)return gu;by=1;function a(s){return s!==s}return gu=a,gu}var yu,_y;function oE(){if(_y)return yu;_y=1;function a(s,i,n){for(var t=n-1,o=s.length;++t<o;)if(s[t]===i)return t;return-1}return yu=a,yu}var bu,wy;function Iw(){if(wy)return bu;wy=1;var a=iE(),s=sE(),i=oE();function n(t,o,r){return o===o?i(t,o,r):a(t,s,r)}return bu=n,bu}var _u,vy;function aE(){if(vy)return _u;vy=1;var a=Iw(),s=iw(),i=Math.max;function n(t,o,r){var e=t==null?0:t.length;if(!e)return-1;var c=r==null?0:s(r);return c<0&&(c=i(e+c,0)),a(t,o,c)}return _u=n,_u}var wu,Cy;function ht(){if(Cy)return wu;Cy=1;const{pushAdditional:a,pushQuery:s,unshiftQuery:i}=ur(),n=Ce(),t=or(),o=aE(),r=Te(),e=sr(),{normalizeArr:c}=Ce();class u{constructor(l,f){this.client=l,this.tableBuilder=f,this._commonBuilder=this.tableBuilder,this.method=f._method,this.schemaNameRaw=f._schemaName,this.tableNameRaw=f._tableName,this.tableNameLikeRaw=f._tableNameLike,this.single=f._single,this.grouped=t(f._statements,"grouping"),this.formatter=l.formatter(f),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this._formatting=l.config&&l.config.formatting,this.checksCount=0}toSQL(){return this[this.method](),this.sequence}create(l,f){const w=this.getColumns().map(m=>m.toSQL()),C=this.getColumnTypes(w);this.createAlterTableMethods&&this.alterTableForCreate(C),this.createQuery(C,l,f),this.columnQueries(w),delete this.single.comment,this.alterTable()}createIfNot(){this.create(!0)}createLike(){this.create(!1,!0)}createLikeIfNot(){this.create(!0,!0)}alter(){const f=this.getColumns().map(g=>g.toSQL()),p=this.getColumns("alter"),w=p.map(g=>g.toSQL()),C=this.getColumnTypes(f),m=this.getColumnTypes(w);this.addColumns(C),this.alterColumns(m,p),this.columnQueries(f),this.columnQueries(w),this.alterTable()}foreign(l){if(l.inTable&&l.references){const f=l.keyName?this.formatter.wrap(l.keyName):this._indexCommand("foreign",this.tableNameRaw,l.column),p=this.formatter.columnize(l.column),w=this.formatter.columnize(l.references),C=this.formatter.wrap(l.inTable),m=l.onUpdate?(this.lowerCase?" on update ":" ON UPDATE ")+l.onUpdate:"",g=l.onDelete?(this.lowerCase?" on delete ":" ON DELETE ")+l.onDelete:"",d=l.deferrable?this.lowerCase?` deferrable initially ${l.deferrable.toLowerCase()} `:` DEFERRABLE INITIALLY ${l.deferrable.toUpperCase()} `:"";this.lowerCase?this.pushQuery((this.forCreate?"":`alter table ${this.tableName()} add `)+"constraint "+f+" foreign key ("+p+") references "+C+" ("+w+")"+m+g+d):this.pushQuery((this.forCreate?"":`ALTER TABLE ${this.tableName()} ADD `)+"CONSTRAINT "+f+" FOREIGN KEY ("+p+") REFERENCES "+C+" ("+w+")"+m+g+d)}}getColumnTypes(l){return l.reduce(function(f,p){const w=p[0];return f.sql.push(w.sql),f.bindings.concat(w.bindings),f},{sql:[],bindings:[]})}columnQueries(l){const f=l.reduce(function(p,w){const C=e(w);return r(C)?p:p.concat(C)},[]);for(const p of f)this.pushQuery(p)}addColumns(l,f){if(f=f||this.addColumnsPrefix,l.sql.length>0){const p=l.sql.map(w=>f+w);this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+p.join(", "),bindings:l.bindings})}}alterColumns(l,f){l.sql.length>0&&this.addColumns(l,this.alterColumnsPrefix,f)}getColumns(l){const f=this.grouped.columns||[];l=l||"add";const p=this.tableBuilder.queryContext();return f.filter(w=>w.builder._method===l).map(w=>(p!==void 0&&w.builder.queryContext()===void 0&&w.builder.queryContext(p),this.client.columnCompiler(this,w.builder)))}tableName(){const l=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameRaw}`:this.tableNameRaw;return this.formatter.wrap(l)}tableNameLike(){const l=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameLikeRaw}`:this.tableNameLikeRaw;return this.formatter.wrap(l)}alterTable(){const l=this.grouped.alterTable||[];for(let f=0,p=l.length;f<p;f++){const w=l[f];this[w.method]?this[w.method].apply(this,w.args):this.client.logger.error(`Debug: ${w.method} does not exist`)}for(const f in this.single)typeof this[f]=="function"&&this[f](this.single[f])}alterTableForCreate(l){this.forCreate=!0;const f=this.sequence,p=this.grouped.alterTable||[];this.grouped.alterTable=[];for(let w=0,C=p.length;w<C;w++){const m=p[w];if(o(this.createAlterTableMethods,m.method)<0){this.grouped.alterTable.push(m);continue}this[m.method]?(this.sequence=[],this[m.method].apply(this,m.args),l.sql.push(this.sequence[0].sql)):this.client.logger.error(`Debug: ${m.method} does not exist`)}this.sequence=f,this.forCreate=!1}dropIndex(l){this.pushQuery(`drop index${l}`)}dropUnique(){throw new Error("Method implemented in the dialect driver")}dropForeign(){throw new Error("Method implemented in the dialect driver")}dropColumn(){const l=n.normalizeArr.apply(null,arguments),f=(Array.isArray(l)?l:[l]).map(p=>this.dropColumnPrefix+this.formatter.wrap(p));this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+f.join(", "))}_setNullableState(l,f){const p=this.tableName(),w=this.formatter.columnize(l),C=this.alterColumnsPrefix;return this.pushQuery({sql:"SELECT 1",output:()=>this.client.queryBuilder().from(this.tableNameRaw).columnInfo(l).then(m=>{if(r(m))throw new Error(`.setNullable: Column ${w} does not exist in table ${p}.`);const g=f?"null":"not null",d=m.type+(m.maxLength?`(${m.maxLength})`:""),b=m.defaultValue!==null&&m.defaultValue!==void 0?`default '${m.defaultValue}'`:"",_=`alter table ${p} ${C} ${w} ${d} ${g} ${b}`;return this.client.raw(_)})})}setNullable(l){return this._setNullableState(l,!0)}dropNullable(l){return this._setNullableState(l,!1)}dropChecks(l){if(l===void 0)return"";l=c(l);const p=`alter table ${this.tableName()} ${l.map(w=>`drop constraint ${w}`).join(", ")}`;this.pushQuery(p)}check(l,f,p){const w=this.tableName();let C=p;C||(this.checksCount++,C=w+"_"+this.checksCount);const m=`alter table ${w} add constraint ${C} check(${l})`;this.pushQuery(m)}_addChecks(){return this.grouped.checks?", "+this.grouped.checks.map(l=>`${l.args[2]?"constraint "+l.args[2]+" ":""}check (${this.client.raw(l.args[0],l.args[1])})`).join(", "):""}_indexCommand(l,f,p){Array.isArray(p)||(p=p?[p]:[]);const C=(f.replace(/\.|-/g,"_")+"_"+p.join("_")+"_"+l).toLowerCase();return this.formatter.wrap(C)}_getPrimaryKeys(){return(this.grouped.alterTable||[]).filter(l=>l.method==="primary").flatMap(l=>l.args).flat()}_canBeAddPrimaryKey(l){return l.primaryKey&&this._getPrimaryKeys().length===0}_getIncrementsColumnNames(){return this.grouped.columns.filter(l=>l.builder._type==="increments").map(l=>l.builder._args[0])}_getBigIncrementsColumnNames(){return this.grouped.columns.filter(l=>l.builder._type==="bigincrements").map(l=>l.builder._args[0])}}return u.prototype.pushQuery=s,u.prototype.pushAdditional=a,u.prototype.unshiftQuery=i,u.prototype.lowerCase=!0,u.prototype.createAlterTableMethods=null,u.prototype.addColumnsPrefix="add column ",u.prototype.alterColumnsPrefix="alter column ",u.prototype.modifyColumnPrefix="modify column ",u.prototype.dropColumnPrefix="drop column ",wu=u,wu}var vu,qy;function cr(){if(qy)return vu;qy=1;const a=lr(),s=We(),i=Rt(),{addQueryContext:n}=Ce();class t{constructor(h,l,f,p){this.client=h,this._method="add",this._single={},this._modifiers={},this._statements=[],this._type=c[f]||f,this._args=p,this._tableBuilder=l,l._method==="alter"&&a(this,e)}references(h){return this._tableBuilder.foreign.call(this._tableBuilder,this._args[0],void 0,this)._columnBuilder(this).references(h)}}const o=["default","defaultsTo","defaultTo","unsigned","nullable","first","after","comment","collate","check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex"],r={default:"defaultTo",defaultsTo:"defaultTo"};o.forEach(function(u){const h=r[u]||u;t.prototype[u]=function(){return this._modifiers[h]=i(arguments),this}}),n(t),t.prototype.notNull=t.prototype.notNullable=function(){return this.nullable(!1)},["index","primary","unique"].forEach(function(u){t.prototype[u]=function(){return this._type.toLowerCase().indexOf("increments")===-1&&this._tableBuilder[u].apply(this._tableBuilder,[this._args[0]].concat(i(arguments))),this}}),t.extend=(u,h)=>{if(Object.prototype.hasOwnProperty.call(t.prototype,u))throw new Error(`Can't extend ColumnBuilder with existing method ('${u}').`);s(t.prototype,{[u]:h})};const e={};e.drop=function(){return this._single.drop=!0,this},e.alterType=function(u){return this._statements.push({grouping:"alterType",value:u}),this},e.alter=function({alterNullable:u=!0,alterType:h=!0}={}){return this._method="alter",this.alterNullable=u,this.alterType=h,this};const c={float:"floating",enum:"enu",boolean:"bool",string:"varchar",bigint:"bigInteger"};return vu=t,vu}var Cu,Ey;function uE(){if(Ey)return Cu;Ey=1;function a(s){return s&&s.length?s[0]:void 0}return Cu=a,Cu}var qu,Ay;function lE(){return Ay||(Ay=1,qu=uE()),qu}var Eu,Ry;function Je(){if(Ry)return Eu;Ry=1;const a=ur(),s=or(),i=lE(),n=ar(),t=sr(),{toNumber:o}=Ce(),{formatDefault:r}=Ge(),{operator:e}=qe();class c{constructor(h,l,f){this.client=h,this.tableCompiler=l,this.columnBuilder=f,this._commonBuilder=this.columnBuilder,this.args=f._args,this.type=f._type.toLowerCase(),this.grouped=s(f._statements,"grouping"),this.modified=f._modifiers,this.isIncrements=this.type.indexOf("increments")!==-1,this.formatter=h.formatter(f),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this.modifiers=[],this.checksCount=0}_addCheckModifiers(){this.modifiers.push("check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex")}defaults(h){if(Object.prototype.hasOwnProperty.call(this._defaultMap,h))return this._defaultMap[h].bind(this)();throw new Error(`There is no default for the specified identifier ${h}`)}toSQL(){return this.pushQuery(this.compileColumn()),this.sequence.additional&&(this.sequence=this.sequence.concat(this.sequence.additional)),this.sequence}compileColumn(){return this.formatter.wrap(this.getColumnName())+" "+this.getColumnType()+this.getModifiers()}getColumnName(){return i(this.args)||this.defaults("columnName")}getColumnType(){if(!this._columnType){const h=this[this.type];this._columnType=typeof h=="function"?h.apply(this,t(this.args)):h}return this._columnType}getModifiers(){const h=[];for(let l=0,f=this.modifiers.length;l<f;l++){const p=this.modifiers[l];if((!this.isIncrements||this.isIncrements&&p==="comment")&&n(this.modified,p)){const w=this[p].apply(this,this.modified[p]);w&&h.push(w)}}return h.length>0?` ${h.join(" ")}`:""}varchar(h){return`varchar(${o(h,255)})`}floating(h,l){return`float(${o(h,8)}, ${o(l,2)})`}decimal(h,l){if(h===null)throw new Error("Specifying no precision on decimal columns is not supported for that SQL dialect.");return`decimal(${o(h,8)}, ${o(l,2)})`}specifictype(h){return h}nullable(h){return h===!1?"not null":"null"}notNullable(){return this.nullable(!1)}defaultTo(h){return`default ${r(h,this.type,this.client)}`}increments(h={primaryKey:!0}){return"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(h)?" primary key":"")+" autoincrement"}bigincrements(h={primaryKey:!0}){return this.increments(h)}_pushAlterCheckQuery(h,l){let f=l;f||(this.checksCount++,f=this.tableCompiler.tableNameRaw+"_"+this.getColumnName()+"_"+this.checksCount),this.pushAdditional(function(){this.pushQuery(`alter table ${this.tableCompiler.tableName()} add constraint ${f} check(${h})`)})}_checkConstraintName(h){return h?`constraint ${h} `:""}_check(h,l){return this.columnBuilder._method==="alter"?(this._pushAlterCheckQuery(h,l),""):`${this._checkConstraintName(l)}check (${h})`}checkPositive(h){return this._check(`${this.formatter.wrap(this.getColumnName())} ${e(">",this.columnBuilder,this.bindingsHolder)} 0`,h)}checkNegative(h){return this._check(`${this.formatter.wrap(this.getColumnName())} ${e("<",this.columnBuilder,this.bindingsHolder)} 0`,h)}_checkIn(h,l,f){return this._check(`${this.formatter.wrap(this.getColumnName())} ${f?"not ":""}in (${h.map(p=>this.client._escapeBinding(p)).join(",")})`,l)}checkIn(h,l){return this._checkIn(h,l)}checkNotIn(h,l){return this._checkIn(h,l,!0)}checkBetween(h,l){h.length===2&&!Array.isArray(h[0])&&!Array.isArray(h[1])&&(h=[h]);const f=h.map(p=>`${this.formatter.wrap(this.getColumnName())} between ${this.client._escapeBinding(p[0])} and ${this.client._escapeBinding(p[1])}`).join(" or ");return this._check(f,l)}checkLength(h,l,f){return this._check(`length(${this.formatter.wrap(this.getColumnName())}) ${e(h,this.columnBuilder,this.bindingsHolder)} ${o(l)}`,f)}}return c.prototype.binary="blob",c.prototype.bool="boolean",c.prototype.date="date",c.prototype.datetime="datetime",c.prototype.time="time",c.prototype.timestamp="timestamp",c.prototype.geometry="geometry",c.prototype.geography="geography",c.prototype.point="point",c.prototype.enu="varchar",c.prototype.bit=c.prototype.json="text",c.prototype.uuid=({useBinaryUuid:u=!1,primaryKey:h=!1}={})=>u?"binary(16)":"char(36)",c.prototype.integer=c.prototype.smallint=c.prototype.mediumint="integer",c.prototype.biginteger="bigint",c.prototype.text="text",c.prototype.tinyint="tinyint",c.prototype.pushQuery=a.pushQuery,c.prototype.pushAdditional=a.pushAdditional,c.prototype.unshiftQuery=a.unshiftQuery,c.prototype._defaultMap={columnName:function(){if(!this.isIncrements)throw new Error(`You did not specify a column name for the ${this.type} column.`);return"id"}},Eu=c,Eu}var Au,Ty;function cE(){if(Ty)return Au;Ty=1;const a=lt();class s extends a{constructor(n,t){super(n),this.ref=t,this._schema=null,this._alias=null}withSchema(n){return this._schema=n,this}as(n){return this._alias=n,this}toSQL(){const n=this._schema?`${this._schema}.${this.ref}`:this.ref,t=this.client.formatter(this),o=t.columnize(n),r=this._alias?`${o} as ${t.wrap(this._alias)}`:o;return this.set(r,[]),super.toSQL(...arguments)}}return Au=s,Au}var Ru,Sy;function hr(){if(Sy)return Ru;Sy=1;const{columnize:a,wrap:s}=qe();class i{constructor(t,o){this.client=t,this.builder=o,this.bindings=[]}columnize(t){return a(t,this.builder,this.client,this)}wrap(t,o){return s(t,o,this.builder,this.client,this)}}return Ru=i,Ru}var ue={},Oy;function hE(){if(Oy)return ue;Oy=1,Object.defineProperty(ue,"__esModule",{value:!0});var a=ve;function s(L){if(L&&L.__esModule)return L;var U=Object.create(null);return L&&Object.keys(L).forEach(function(Z){if(Z!=="default"){var ne=Object.getOwnPropertyDescriptor(L,Z);Object.defineProperty(U,Z,ne.get?ne:{enumerable:!0,get:function(){return L[Z]}})}}),U.default=L,Object.freeze(U)}var i=s(a);const{env:n={},argv:t=[],platform:o=""}=typeof pe>"u"?{}:pe,r="NO_COLOR"in n||t.includes("--no-color"),e="FORCE_COLOR"in n||t.includes("--color"),c=o==="win32",u=n.TERM==="dumb",h=i&&i.isatty&&i.isatty(1)&&n.TERM&&!u,l="CI"in n&&("GITHUB_ACTIONS"in n||"GITLAB_CI"in n||"CIRCLECI"in n),f=!r&&(e||c&&!u||h||l),p=(L,U,Z,ne,D=U.substring(0,L)+ne,O=U.substring(L+Z.length),te=O.indexOf(Z))=>D+(te<0?O:p(te,O,Z,ne)),w=(L,U,Z,ne,D)=>L<0?Z+U+ne:Z+p(L,U,ne,D)+ne,C=(L,U,Z=L,ne=L.length+1)=>D=>D||!(D===""||D===void 0)?w((""+D).indexOf(U,ne),D,L,U,Z):"",m=(L,U,Z)=>C(`\x1B[${L}m`,`\x1B[${U}m`,Z),g={reset:m(0,0),bold:m(1,22,"\x1B[22m\x1B[1m"),dim:m(2,22,"\x1B[22m\x1B[2m"),italic:m(3,23),underline:m(4,24),inverse:m(7,27),hidden:m(8,28),strikethrough:m(9,29),black:m(30,39),red:m(31,39),green:m(32,39),yellow:m(33,39),blue:m(34,39),magenta:m(35,39),cyan:m(36,39),white:m(37,39),gray:m(90,39),bgBlack:m(40,49),bgRed:m(41,49),bgGreen:m(42,49),bgYellow:m(43,49),bgBlue:m(44,49),bgMagenta:m(45,49),bgCyan:m(46,49),bgWhite:m(47,49),blackBright:m(90,39),redBright:m(91,39),greenBright:m(92,39),yellowBright:m(93,39),blueBright:m(94,39),magentaBright:m(95,39),cyanBright:m(96,39),whiteBright:m(97,39),bgBlackBright:m(100,49),bgRedBright:m(101,49),bgGreenBright:m(102,49),bgYellowBright:m(103,49),bgBlueBright:m(104,49),bgMagentaBright:m(105,49),bgCyanBright:m(106,49),bgWhiteBright:m(107,49)},d=({useColor:L=f}={})=>L?g:Object.keys(g).reduce((U,Z)=>({...U,[Z]:String}),{}),{reset:b,bold:_,dim:q,italic:E,underline:R,inverse:$,hidden:M,strikethrough:v,black:T,red:B,green:F,yellow:y,blue:A,magenta:j,cyan:Y,white:ee,gray:H,bgBlack:N,bgRed:V,bgGreen:K,bgYellow:x,bgBlue:S,bgMagenta:I,bgCyan:k,bgWhite:X,blackBright:z,redBright:W,greenBright:J,yellowBright:re,blueBright:ie,magentaBright:se,cyanBright:P,whiteBright:Q,bgBlackBright:ae,bgRedBright:oe,bgGreenBright:de,bgYellowBright:G,bgBlueBright:we,bgMagentaBright:ce,bgCyanBright:ge,bgWhiteBright:le}=d();return ue.bgBlack=N,ue.bgBlackBright=ae,ue.bgBlue=S,ue.bgBlueBright=we,ue.bgCyan=k,ue.bgCyanBright=ge,ue.bgGreen=K,ue.bgGreenBright=de,ue.bgMagenta=I,ue.bgMagentaBright=ce,ue.bgRed=V,ue.bgRedBright=oe,ue.bgWhite=X,ue.bgWhiteBright=le,ue.bgYellow=x,ue.bgYellowBright=G,ue.black=T,ue.blackBright=z,ue.blue=A,ue.blueBright=ie,ue.bold=_,ue.createColors=d,ue.cyan=Y,ue.cyanBright=P,ue.dim=q,ue.gray=H,ue.green=F,ue.greenBright=J,ue.hidden=M,ue.inverse=$,ue.isColorSupported=f,ue.italic=E,ue.magenta=j,ue.magentaBright=se,ue.red=B,ue.redBright=W,ue.reset=b,ue.strikethrough=v,ue.underline=R,ue.white=ee,ue.whiteBright=Q,ue.yellow=y,ue.yellowBright=re,ue}var Tu,Ny;function fE(){if(Ny)return Tu;Ny=1;const a=hE(),{inspect:s}=Ee(),{isString:i,isFunction:n}=ye();class t{constructor(e={}){const{log:{debug:c,warn:u,error:h,deprecate:l,inspectionDepth:f,enableColors:p}={}}=e;this._inspectionDepth=f||5,this._enableColors=o(p),this._debug=c,this._warn=u,this._error=h,this._deprecate=l}_log(e,c,u){if(c!=null&&!n(c))throw new TypeError("Extensions to knex logger must be functions!");if(n(c)){c(e);return}i(e)||(e=s(e,{depth:this._inspectionDepth,colors:this._enableColors})),console.log(u?u(e):e)}debug(e){this._log(e,this._debug)}warn(e){this._log(e,this._warn,a.yellow)}error(e){this._log(e,this._error,a.red)}deprecate(e,c){const u=`${e} is deprecated, please use ${c}`;this._log(u,this._deprecate,a.yellow)}}function o(r){return r??(pe&&pe.stdout?pe.stdout.isTTY:!1)}return Tu=t,Tu}var Su,Iy;function St(){if(Iy)return Su;Iy=1;const a=Ce(),s=lr(),i=We();class n{constructor(r,e,c,u){this.client=r,this._method=e,this._schemaName=void 0,this._columns=void 0,this._fn=u,this._viewName=c,this._statements=[],this._single={}}setSchema(r){this._schemaName=r}columns(r){this._columns=r}as(r){this._selectQuery=r}checkOption(){throw new Error("check option definition is not supported by this dialect.")}localCheckOption(){throw new Error("check option definition is not supported by this dialect.")}cascadedCheckOption(){throw new Error("check option definition is not supported by this dialect.")}toSQL(){return this._method==="alter"&&s(this,t),this._fn.call(this,this),this.client.viewCompiler(this).toSQL()}}const t={column(o){const r=this;return{rename:function(e){return r._statements.push({grouping:"alterView",method:"renameColumn",args:[o,e]}),this},defaultTo:function(e){return r._statements.push({grouping:"alterView",method:"defaultTo",args:[o,e]}),this}}}};return a.addQueryContext(n),n.extend=(o,r)=>{if(Object.prototype.hasOwnProperty.call(n.prototype,o))throw new Error(`Can't extend ViewBuilder with existing method ('${o}').`);i(n.prototype,{[o]:r})},Su=n,Su}var Ou,$y;function ft(){if($y)return Ou;$y=1;const{pushQuery:a}=ur(),s=or(),{columnize:i}=qe();class n{constructor(o,r){this.client=o,this.viewBuilder=r,this._commonBuilder=this.viewBuilder,this.method=r._method,this.schemaNameRaw=r._schemaName,this.viewNameRaw=r._viewName,this.single=r._single,this.selectQuery=r._selectQuery,this.columns=r._columns,this.grouped=s(r._statements,"grouping"),this.formatter=o.formatter(r),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[]}toSQL(){return this[this.method](),this.sequence}create(){this.createQuery(this.columns,this.selectQuery)}createOrReplace(){throw new Error("replace views is not supported by this dialect.")}createMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}createQuery(o,r,e,c){const u="create "+(e?"materialized ":"")+(c?"or replace ":"")+"view ",h=o?" ("+i(o,this.viewBuilder,this.client,this.bindingsHolder)+")":"";let l=u+this.viewName()+h;switch(l+=" as ",l+=r.toString(),this.single.checkOption){case"default_option":l+=" with check option";break;case"local":l+=" with local check option";break;case"cascaded":l+=" with cascaded check option";break}this.pushQuery({sql:l})}renameView(o,r){throw new Error("rename view is not supported by this dialect (instead drop, then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}alter(){this.alterView()}alterView(){const o=this.grouped.alterView||[];for(let r=0,e=o.length;r<e;r++){const c=o[r];this[c.method]?this[c.method].apply(this,c.args):this.client.logger.error(`Debug: ${c.method} does not exist`)}for(const r in this.single)typeof this[r]=="function"&&this[r](this.single[r])}renameColumn(o,r){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(o,r){throw new Error("change default values of views is not supported by this dialect.")}viewName(){const o=this.schemaNameRaw?`${this.schemaNameRaw}.${this.viewNameRaw}`:this.viewNameRaw;return this.formatter.wrap(o)}}return n.prototype.pushQuery=a,Ou=n,Ou}var Nu,xy;function Ye(){if(xy)return Nu;xy=1;const{Pool:a,TimeoutError:s}=Xw(),{EventEmitter:i}=ke(),{promisify:n}=Ee(),{makeEscape:t}=Ac(),o=OC(),r=J_(),e=X_(),c=BC(),u=Be(),{executeQuery:h,enrichQueryObject:l}=uw(),f=je(),p=Ke(),w=Ow(),C=ct(),m=Nw(),g=ht(),d=cr(),b=Je(),{KnexTimeoutError:_}=et(),{outputQuery:q,unwrapRaw:E}=qe(),{compileCallback:R}=Ge(),$=lt(),M=cE(),v=hr(),T=fE(),{POOL_CONFIG_OPTIONS:B}=Hc(),F=St(),y=ft(),A=Le(),{setHiddenProperty:j}=kc(),Y=Oe()("knex:client");class ee extends i{constructor(N={}){if(super(),this.config=N,this.logger=new T(N),this.config.connection&&this.config.connection.password&&j(this.config.connection),this.dialect&&!this.config.client&&this.logger.warn("Using 'this.dialect' to identify the client is deprecated and support for it will be removed in the future. Please use configuration option 'client' instead."),!(this.config.client||this.dialect))throw new Error("knex: Required configuration option 'client' is missing.");N.version&&(this.version=N.version),N.connection&&N.connection instanceof Function?(this.connectionConfigProvider=N.connection,this.connectionConfigExpirationChecker=()=>!0):(this.connectionSettings=o(N.connection||{}),N.connection&&N.connection.password&&j(this.connectionSettings,N.connection),this.connectionConfigExpirationChecker=null),this.driverName&&N.connection&&(this.initializeDriver(),(!N.pool||N.pool&&N.pool.max!==0)&&this.initializePool(N)),this.valueForUndefined=this.raw("DEFAULT"),N.useNullAsDefault&&(this.valueForUndefined=null)}formatter(N){return new v(this,N)}queryBuilder(){return new f(this)}queryCompiler(N,V){return new p(this,N,V)}schemaBuilder(){return new w(this)}schemaCompiler(N){return new C(this,N)}tableBuilder(N,V,K,x){return new m(this,N,V,K,x)}viewBuilder(N,V,K){return new F(this,N,V,K)}tableCompiler(N){return new g(this,N)}viewCompiler(N){return new y(this,N)}columnBuilder(N,V,K){return new d(this,N,V,K)}columnCompiler(N,V){return new b(this,N,V)}runner(N){return new c(this,N)}transaction(N,V,K){return new u(this,N,V,K)}raw(){return new $(this).set(...arguments)}ref(){return new M(this,...arguments)}query(N,V){const K=l(N,V,this);return h(N,K,this)}stream(N,V,K,x){const S=l(N,V,this);return this._stream(N,S,K,x)}prepBindings(N){return N}positionBindings(N){return N}postProcessResponse(N,V){return this.config.postProcessResponse?this.config.postProcessResponse(N,V):N}wrapIdentifier(N,V){return this.customWrapIdentifier(N,this.wrapIdentifierImpl,V)}customWrapIdentifier(N,V,K){return this.config.wrapIdentifier?this.config.wrapIdentifier(N,V,K):V(N)}wrapIdentifierImpl(N){return N!=="*"?`"${N.replace(/"/g,'""')}"`:"*"}initializeDriver(){try{this.driver=this._driver()}catch(N){const V=`Knex: run
75
+ $ npm install ${this.driverName} --save`;throw this.logger.error(`${V}
76
+ ${N.message}
77
+ ${N.stack}`),new Error(`${V}
78
+ ${N.message}`)}}poolDefaults(){return{min:2,max:10,propagateCreateError:!0}}getPoolSettings(N){N=r({},N,this.poolDefaults()),B.forEach(S=>{S in N&&this.logger.warn([`Pool config option "${S}" is no longer supported.`,"See https://github.com/Vincit/tarn.js for possible pool config options."].join(" "))});const V=6e4,K=[this.config.acquireConnectionTimeout,N.acquireTimeoutMillis].filter(S=>S!==void 0);K.length||K.push(V),N.acquireTimeoutMillis=Math.min(...K);const x=async()=>{if(!this.connectionConfigProvider||!this.connectionConfigExpirationChecker||!this.connectionConfigExpirationChecker())return;const S=await this.connectionConfigProvider();S.expirationChecker?(this.connectionConfigExpirationChecker=S.expirationChecker,delete S.expirationChecker):this.connectionConfigExpirationChecker=null,this.connectionSettings=S};return Object.assign(N,{create:async()=>{await x();const S=await this.acquireRawConnection();return S.__knexUid=e("__knexUid"),N.afterCreate&&await n(N.afterCreate)(S),S},destroy:S=>{if(S!==void 0)return this.destroyRawConnection(S)},validate:S=>S.__knex__disposed?(this.logger.warn(`Connection Error: ${S.__knex__disposed}`),!1):this.validateConnection(S)})}initializePool(N=this.config){if(this.pool){this.logger.warn("The pool has already been initialized");return}const V={...this.getPoolSettings(N.pool)};V.afterCreate&&delete V.afterCreate,this.pool=new a(V)}validateConnection(N){return!0}async acquireConnection(){if(!this.pool)throw new Error("Unable to acquire a connection");try{const N=await this.pool.acquire().promise;return Y("acquired connection from pool: %s",N.__knexUid),N.config&&(N.config.password&&j(N.config),N.config.authentication&&N.config.authentication.options&&N.config.authentication.options.password&&j(N.config.authentication.options)),N}catch(N){let V=N;throw N instanceof s&&(V=new _("Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?")),V}}releaseConnection(N){return Y("releasing connection to pool: %s",N.__knexUid),this.pool.release(N)||Y("pool refused connection: %s",N.__knexUid),Promise.resolve()}async destroy(N){try{this.pool&&this.pool.destroy&&await this.pool.destroy(),this.pool=void 0,typeof N=="function"&&N()}catch(V){if(typeof N=="function")return N(V);throw V}}database(){return this.connectionSettings.database}toString(){return"[object KnexClient]"}assertCanCancelQuery(){if(!this.canCancelQuery)throw new Error("Query cancelling not supported for this dialect")}cancelQuery(){throw new Error("Query cancelling not supported for this dialect")}alias(N,V){return N+" as "+V}parameter(N,V,K){return typeof N=="function"?q(R(N,void 0,this,K),!0,V,this):E(N,!0,V,this,K)||"?"}parameterize(N,V,K,x){if(typeof N=="function")return this.parameter(N,K,x);N=Array.isArray(N)?N:[N];let S="",I=-1;for(;++I<N.length;){I>0&&(S+=", ");let k=N[I];A(k)&&(k=JSON.stringify(k)),S+=this.parameter(k===void 0?V:k,K,x)}return S}values(N,V,K){return Array.isArray(N)?Array.isArray(N[0])?`(${N.map(x=>`(${this.parameterize(x,void 0,V,K)})`).join(", ")})`:`(${this.parameterize(N,void 0,V,K)})`:N&&N.isRawInstance?`(${this.parameter(N,V,K)})`:this.parameter(N,V,K)}processPassedConnection(N){}toPathForJson(N){return N}}return Object.assign(ee.prototype,{_escapeBinding:t({escapeString(H){return`'${H.replace(/'/g,"''")}'`}}),canCancelQuery:!1}),Nu=ee,Nu}var Iu,Py;function dE(){if(Py)return Iu;Py=1;function a(s){if(s.charAt(0)==="/"){const c=s.split(" ");return{host:c[0],database:c[1]}}const i={};let n,t=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(s)&&(s=encodeURI(s).replace(/\%25(\d\d)/g,"%$1"));try{n=new URL(s,"postgres://base")}catch{n=new URL(s.replace("@/","@___DUMMY___/"),"postgres://base"),t=!0}for(const c of n.searchParams.entries())i[c[0]]=c[1];if(i.user=i.user||decodeURIComponent(n.username),i.password=i.password||decodeURIComponent(n.password),n.protocol=="socket:")return i.host=decodeURI(n.pathname),i.database=n.searchParams.get("db"),i.client_encoding=n.searchParams.get("encoding"),i;const o=t?"":n.hostname;i.host?o&&/^%2f/i.test(o)&&(n.pathname=o+n.pathname):i.host=decodeURIComponent(o),i.port||(i.port=n.port);const r=n.pathname.slice(1)||null;i.database=r?decodeURI(r):null,(i.ssl==="true"||i.ssl==="1")&&(i.ssl=!0),i.ssl==="0"&&(i.ssl=!1),(i.sslcert||i.sslkey||i.sslrootcert||i.sslmode)&&(i.ssl={});const e=i.sslcert||i.sslkey||i.sslrootcert?ve:null;switch(i.sslcert&&(i.ssl.cert=e.readFileSync(i.sslcert).toString()),i.sslkey&&(i.ssl.key=e.readFileSync(i.sslkey).toString()),i.sslrootcert&&(i.ssl.ca=e.readFileSync(i.sslrootcert).toString()),i.sslmode){case"disable":{i.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{i.ssl.rejectUnauthorized=!1;break}}return i}return Iu=a,a.parse=a,Iu}var $u,jy;function pE(){if(jy)return $u;jy=1;const{parse:a}=dE(),s=a,i=pe&&pe.platform&&pe.platform==="win32";function n(o){try{return new URL(o)}catch{return null}}$u=function(r){const e=n(r),c=i&&e&&e.protocol.length===2;if(!e||c)return{client:"sqlite3",connection:{filename:r}};let{protocol:u}=e;u.slice(-1)===":"&&(u=u.slice(0,-1));const h=["postgresql","postgres"].includes(u);return{client:u,connection:h?s(r):t(e)}};function t(o){const r={};let e=o.pathname;if(e[0]==="/"&&(e=e.slice(1)),r.database=e,o.hostname&&(o.protocol.indexOf("mssql")===0?r.server=o.hostname:r.host=o.hostname),o.port&&(r.port=o.port),(o.username||o.password)&&(r.user=decodeURIComponent(o.username)),o.password&&(r.password=decodeURIComponent(o.password)),o.searchParams)for(const[c,u]of o.searchParams.entries())if(["mysql:","mariadb:","mssql:"].includes(o.protocol))try{r[c]=JSON.parse(u)}catch{r[c]=u}else r[c]=u;return r}return $u}var gt={},xu,Ly;function mE(){if(Ly)return xu;Ly=1;const a=Be();class s extends a{begin(n){return this.isolationLevel&&this.client.logger.warn("sqlite3 only supports serializable transactions, ignoring the isolation level param"),this.readOnly&&this.client.logger.warn("sqlite3 implicitly handles read vs write transactions"),this.query(n,"BEGIN;")}}return xu=s,xu}var Pu,By;function gE(){if(By)return Pu;By=1;const a=K_(),s=Et(),i=Re(),n=Te(),t=Tt(),o=Ke(),r=kt(),{isString:e}=ye(),{wrapString:c,columnize:u}=qe(),h=a("");class l extends o{constructor(p,w,C){super(p,w,C),this.forShare=h,this.forKeyShare=h,this.forUpdate=h,this.forNoKeyUpdate=h}insert(){const p=this.single.insert||[];let w=this.with()+`insert into ${this.tableName} `;if(Array.isArray(p)){if(p.length===0)return"";if(p.length===1&&p[0]&&n(p[0]))return{sql:w+this._emptyInsertValue}}else if(typeof p=="object"&&n(p))return{sql:w+this._emptyInsertValue};const C=this._prepInsert(p);if(e(C))return{sql:w+C};if(C.columns.length===0)return{sql:""};if(w+=`(${this.formatter.columnize(C.columns)})`,this.client.valueForUndefined!==null&&C.values.forEach(E=>{s(E,R=>{if(R===void 0)throw new TypeError("`sqlite` does not support inserting default values. Specify values explicitly or use the `useNullAsDefault` config flag. (see docs https://knexjs.org/guide/query-builder.html#insert).")})}),C.values.length===1){const E=this.client.parameterize(C.values[0],this.client.valueForUndefined,this.builder,this.bindingsHolder);w+=` values (${E})`;const{onConflict:R,ignore:$,merge:M}=this.single;if(R&&$)w+=this._ignore(R);else if(R&&M){w+=this._merge(M.updates,R,p);const T=this.where();T&&(w+=` ${T}`)}const{returning:v}=this.single;return v&&(w+=this._returning(v)),{sql:w,returning:v}}const m=[];let g=-1;for(;++g<C.values.length;){let E=-1;const R=m[g]=[];let $=C.values[g];for($=$===void 0?this.client.valueForUndefined:$;++E<C.columns.length;)R.push(this.client.alias(this.client.parameter($[E],this.builder,this.bindingsHolder),this.formatter.wrap(C.columns[E])));m[g]=R.join(", ")}w+=" select "+m.join(" union all select ");const{onConflict:d,ignore:b,merge:_}=this.single;d&&b?w+=" where true"+this._ignore(d):d&&_&&(w+=" where true"+this._merge(_.updates,d,p));const{returning:q}=this.single;return q&&(w+=this._returning(q)),{sql:w,returning:q}}update(){const p=this.with(),w=this._prepUpdate(this.single.update),C=this.where(),{returning:m}=this.single;return{sql:p+`update ${this.single.only?"only ":""}${this.tableName} set ${w.join(", ")}`+(C?` ${C}`:"")+this._returning(m),returning:m}}_ignore(p){return p===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(p)} do nothing`}_merge(p,w,C){let m=` on conflict ${this._onConflictClause(w)} do update set `;if(p&&Array.isArray(p))return m+=p.map(g=>c(g.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(g=>`${g} = excluded.${g}`).join(", "),m;if(p&&typeof p=="object"){const g=this._prepUpdate(p);return typeof g=="string"?m+=g:m+=g.join(","),m}else{const g=this._prepInsert(C);if(typeof g=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return m+=g.columns.map(d=>c(d.split(".").pop(),this.builder,this.client)).map(d=>`${d} = excluded.${d}`).join(", "),m}}_returning(p){return p?` returning ${this.formatter.columnize(p)}`:""}truncate(){const{table:p}=this.single;return{sql:`delete from ${this.tableName}`,output(){return this.query({sql:`delete from sqlite_sequence where name = '${p}'`}).catch(r)}}}columnInfo(){const p=this.single.columnInfo;return{sql:`PRAGMA table_info(\`${this.client.customWrapIdentifier(this.single.table,i)}\`)`,output(C){const m=/.*\((\d+)\)/,g=t(C,function(d,b){let{type:_}=b,q=_.match(m);return q&&(q=q[1]),_=q?_.split("(")[0]:_,d[b.name]={type:_.toLowerCase(),maxLength:q,nullable:!b.notnull,defaultValue:b.dflt_value},d},{});return p&&g[p]||g}}}limit(){const p=!this.single.limit&&this.single.limit!==0;return p&&!this.single.offset?"":(this.single.limit=p?-1:this.single.limit,`limit ${this._getValueOrParameterFromAttribute("limit")}`)}jsonExtract(p){return this._jsonExtract("json_extract",p)}jsonSet(p){return this._jsonSet("json_set",p)}jsonInsert(p){return this._jsonSet("json_insert",p)}jsonRemove(p){const w=`json_remove(${u(p.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(p.path,this.builder,this.bindingsHolder)})`;return p.alias?this.client.alias(w,this.formatter.wrap(p.alias)):w}whereJsonPath(p){return this._whereJsonPath("json_extract",p)}whereJsonSupersetOf(p){throw new Error("Json superset where clause not actually supported by SQLite")}whereJsonSubsetOf(p){throw new Error("Json subset where clause not actually supported by SQLite")}onJsonPathEquals(p){return this._onJsonPathEquals("json_extract",p)}}return Pu=l,Pu}var ju,My;function yE(){if(My)return ju;My=1;var a=ut();function s(i,n){var t;return a(i,function(o,r,e){return t=n(o,r,e),!t}),!!t}return ju=s,ju}var Lu,ky;function bE(){if(ky)return Lu;ky=1;var a=bw(),s=Pe(),i=yE(),n=_e(),t=Zt();function o(r,e,c){var u=n(r)?a:i;return c&&t(r,e,c)&&(e=void 0),u(r,s(e,3))}return Lu=o,Lu}var Bu,Dy;function _E(){if(Dy)return Bu;Dy=1;const a=ct(),s=bE();class i extends a{constructor(t,o){super(t,o)}hasTable(t){const o=`select * from sqlite_master where type = 'table' and name = ${this.client.parameter(this.formatter.wrap(t).replace(/`/g,""),this.builder,this.bindingsHolder)}`;this.pushQuery({sql:o,output:r=>r.length>0})}hasColumn(t,o){this.pushQuery({sql:`PRAGMA table_info(${this.formatter.wrap(t)})`,output(r){return s(r,e=>this.client.wrapIdentifier(e.name.toLowerCase())===this.client.wrapIdentifier(o.toLowerCase()))}})}renameTable(t,o){this.pushQuery(`alter table ${this.formatter.wrap(t)} rename to ${this.formatter.wrap(o)}`)}async generateDdlCommands(){const t=this.builder._sequence;for(let r=0,e=t.length;r<e;r++){const c=t[r];this[c.method].apply(this,c.args)}const o=this.sequence;if(o.length===1&&o[0].statementsProducer)return o[0].statementsProducer();{const r=[];for(const e of o){const c=e.sql;Array.isArray(c)?r.push(...c):r.push(c)}return{pre:[],sql:r,check:null,post:[]}}}}return Bu=i,Bu}var Mu,Fy;function wE(){if(Fy)return Mu;Fy=1;const a=Je();class s extends a{constructor(){super(...arguments),this.modifiers=["nullable","defaultTo"],this._addCheckModifiers()}enu(n){return`text check (${this.formatter.wrap(this.args[0])} in ('${n.join("', '")}'))`}_pushAlterCheckQuery(n,t){throw new Error("Alter table with to add constraints is not permitted in SQLite")}checkRegex(n,t){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(n)}`,t)}}return s.prototype.json="json",s.prototype.jsonb="json",s.prototype.double=s.prototype.decimal=s.prototype.floating="float",s.prototype.timestamp="datetime",s.prototype.increments=s.prototype.bigincrements="integer not null primary key autoincrement",Mu=s,Mu}var ku,Uy;function vE(){if(Uy)return ku;Uy=1;var a=xc(),s=gw(),i=Pe(),n=_e();function t(o,r){var e=n(o)?a:s;return e(o,i(r,3))}return ku=t,ku}var Du,Qy;function CE(){if(Qy)return Du;Qy=1;const a=vE(),s=Tw(),i=Re(),{isObject:n}=ye(),t=ht(),{formatDefault:o}=Ge();class r extends t{constructor(){super(...arguments)}createQuery(c,u,h){let f=(u?"create table if not exists ":"create table ")+this.tableName();h&&this.tableNameLike()?f+=" as select * from "+this.tableNameLike()+" where 0=1":(f+=" ("+c.sql.join(", "),f+=this.foreignKeys()||"",f+=this.primaryKeys()||"",f+=this._addChecks(),f+=")"),this.pushQuery(f),h&&this.addColumns(c,this.addColumnsPrefix)}addColumns(c,u,h){if(u===this.alterColumnsPrefix){const l=this,f=h.map(p=>{const w=this.client.customWrapIdentifier(p.getColumnName(),i,p.columnBuilder.queryContext()),C=p.getColumnType(),m=p.modified.defaultTo?o(p.modified.defaultTo[0],p.type,this.client):null,g=p.modified.nullable&&p.modified.nullable[0]===!1;return{name:w,type:C,defaultTo:m,notNull:g}});this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(p,w){return l.client.ddl(l,p,w).alterColumn(f)}})}else for(let l=0,f=c.sql.length;l<f;l++)this.pushQuery({sql:`alter table ${this.tableName()} add column ${c.sql[l]}`,bindings:c.bindings[l]})}dropUnique(c,u){u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,c),this.pushQuery(`drop index ${u}`)}dropForeign(c,u){const h=this;c=Array.isArray(c)?c:[c],c=c.map(l=>this.client.customWrapIdentifier(l,i)),u=this.client.customWrapIdentifier(u,i),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(l){return h.client.ddl(h,l,this.connection).dropForeign(c,u)}})}dropPrimary(c){const u=this;c=this.client.customWrapIdentifier(c,i),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(h){return u.client.ddl(u,h,this.connection).dropPrimary(c)}})}dropIndex(c,u){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,c),this.pushQuery(`drop index ${u}`)}unique(c,u){let h,l;n(u)&&({indexName:u,deferrable:h,predicate:l}=u),h&&h!=="not deferrable"&&this.client.logger.warn(`sqlite3: unique index \`${u}\` will not be deferrable ${h} because sqlite3 does not support deferred constraints.`),u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,c),c=this.formatter.columnize(c);const f=l?" "+this.client.queryCompiler(l).where():"";this.pushQuery(`create unique index ${u} on ${this.tableName()} (${c})${f}`)}index(c,u,h){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,c),c=this.formatter.columnize(c);let l;n(h)&&({predicate:l}=h);const f=l?" "+this.client.queryCompiler(l).where():"";this.pushQuery(`create index ${u} on ${this.tableName()} (${c})${f}`)}primary(c,u){const h=this;c=Array.isArray(c)?c:[c],c=c.map(f=>this.client.customWrapIdentifier(f,i));let l;n(u)&&({constraintName:u,deferrable:l}=u),l&&l!=="not deferrable"&&this.client.logger.warn(`sqlite3: primary key constraint \`${u}\` will not be deferrable ${l} because sqlite3 does not support deferred constraints.`),u=this.client.customWrapIdentifier(u,i),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(f){return h.client.ddl(h,f,this.connection).primary(c,u)}})}foreign(c){const u=this;this.method!=="create"&&this.method!=="createIfNot"&&(c.column=Array.isArray(c.column)?c.column:[c.column],c.column=c.column.map(h=>this.client.customWrapIdentifier(h,i)),c.inTable=this.client.customWrapIdentifier(c.inTable,i),c.references=Array.isArray(c.references)?c.references:[c.references],c.references=c.references.map(h=>this.client.customWrapIdentifier(h,i)),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(h,l){return u.client.ddl(u,h,l).foreign(c)}}))}primaryKeys(){const c=a(this.grouped.alterTable||[],{method:"primary"});if(c.length>0&&c[0].args.length>0){const u=c[0].args[0];let h=c[0].args[1]||"";h&&(h=" constraint "+this.formatter.wrap(h));const l=this.grouped.columns.filter(f=>f.builder._type==="increments").length>0;return`,${h} ${l?"unique":"primary key"} (${this.formatter.columnize(u)})`}}foreignKeys(){let c="";const u=a(this.grouped.alterTable||[],{method:"foreign"});for(let h=0,l=u.length;h<l;h++){const f=u[h].args[0],p=this.formatter.columnize(f.column),w=this.formatter.columnize(f.references),C=this.formatter.wrap(f.inTable);let m=f.keyName||"";m&&(m=" constraint "+this.formatter.wrap(m)),c+=`,${m} foreign key(${p}) references ${C}(${w})`,f.onDelete&&(c+=` on delete ${f.onDelete}`),f.onUpdate&&(c+=` on update ${f.onUpdate}`)}return c}createTableBlock(){return this.getColumns().concat().join(",")}renameColumn(c,u){this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(c)} to ${this.formatter.wrap(u)}`})}_setNullableState(c,u){const h=this;this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(l,f){return h.client.ddl(h,l,f).setNullable(c,u)}})}dropColumn(){const c=this,h=s(arguments).map(l=>this.client.customWrapIdentifier(l,i));this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(l){return c.client.ddl(c,l,this.connection).dropColumn(h)}})}}return Du=r,Du}var Fu,Hy;function qE(){if(Hy)return Fu;Hy=1;const a=ft(),{columnize:s}=qe();class i extends a{constructor(t,o){super(t,o)}createOrReplace(){const t=this.columns,o=this.selectQuery.toString(),r=this.viewName(),e=t?" ("+s(t,this.viewBuilder,this.client,this.bindingsHolder)+")":"",c=`drop view if exists ${r}`,u=`create view ${r}${e} as ${o}`;this.pushQuery({sql:c}),this.pushQuery({sql:u})}}return Fu=i,Fu}var Uu,Vy;function EE(){if(Vy)return Uu;Vy=1;function a(e,c,u){return`INSERT INTO "${c}" SELECT ${u===void 0?"*":u.map(h=>`"${h}"`).join(", ")} FROM "${e}";`}function s(e){return`DROP TABLE "${e}"`}function i(e,c){return`ALTER TABLE "${e}" RENAME TO "${c}"`}function n(e){return`SELECT type, sql FROM sqlite_master WHERE (type='table' OR (type='index' AND sql IS NOT NULL)) AND lower(tbl_name)='${e.toLowerCase()}'`}function t(){return"PRAGMA foreign_keys"}function o(e){return`PRAGMA foreign_keys = ${e?"ON":"OFF"}`}function r(){return"PRAGMA foreign_key_check"}return Uu={copyData:a,dropOriginal:s,renameTable:i,getTableSql:n,isForeignCheckEnabled:t,setForeignCheck:o,executeForeignCheck:r},Uu}var Qu,Wy;function AE(){if(Wy)return Qu;Wy=1;function a(s,i){const n=new RegExp(Object.entries(i).map(([r,e])=>`(?<${r}>${e.source})`).join("|"),"yi");let t=0;const o=[];for(;t<s.length;){n.lastIndex=t;const r=s.match(n);if(r!==null){const[e,c]=Object.entries(r.groups).find(([u,h])=>h!==void 0);t+=c.length,e.startsWith("_")||o.push({type:e,text:c})}else throw new Error(`No matching tokenizer rule found at: [${s.substring(t)}]`)}return o}return Qu={tokenize:a},Qu}var Hu,Gy;function RE(){if(Gy)return Hu;Gy=1;function a(u,h=l=>l){return function({index:l=0,input:f}){let p=l;const w=[];for(const C of u){const m=C({index:p,input:f});if(m.success)p=m.index,w.push(m.ast);else return m}return{success:!0,ast:h(w),index:p,input:f}}}function s(u,h=l=>l){return function({index:l=0,input:f}){for(const p of u){const w=p({index:l,input:f});if(w.success)return{success:!0,ast:h(w.ast),index:w.index,input:f}}return{success:!1,ast:null,index:l,input:f}}}function i(u,h=l=>l){return function({index:l=0,input:f}){let p={},w=l;const C=[];do p=u({index:w,input:f}),p.success&&(w=p.index,C.push(p.ast));while(p.success);return C.length>0?{success:!0,ast:h(C),index:w,input:f}:{success:!1,ast:null,index:w,input:f}}}function n(u,h=l=>l){return function({index:l=0,input:f}){const p=u({index:l,input:f});return p.success?{success:!0,ast:h(p.ast),index:p.index,input:f}:{success:!0,ast:h(null),index:l,input:f}}}function t(u,h=l=>l){return function({index:l=0,input:f}){const p=u.do({index:l,input:f});return p.success&&u.next({index:p.index,input:f}).success?{success:!0,ast:h(p.ast),index:p.index,input:f}:{success:!1,ast:null,index:l,input:f}}}function o(u,h=l=>l){return function({index:l=0,input:f}){const p=u.do({index:l,input:f});return p.success&&!u.not({index:l,input:f}).success?{success:!0,ast:h(p.ast),index:p.index,input:f}:{success:!1,ast:null,index:l,input:f}}}function r(u,h=l=>l.text){return function({index:l=0,input:f}){const p=f[l];return p!==void 0&&(u.type===void 0||u.type===p.type)&&(u.text===void 0||u.text.toUpperCase()===p.text.toUpperCase())?{success:!0,ast:h(p),index:l+1,input:f}:{success:!1,ast:null,index:l,input:f}}}return Hu={s:a,a:s,m:i,o:n,l:t,n:o,t:r,e:function({index:u=0,input:h}){return{success:!0,ast:null,index:u,input:h}},f:function({index:u=0,input:h}){return{success:u===h.length,ast:null,index:u,input:h}}},Hu}var Vu,zy;function TE(){if(zy)return Vu;zy=1;const{tokenize:a}=AE(),{s,a:i,m:n,o:t,l:o,n:r,t:e,e:c,f:u}=RE(),h={keyword:/(?:ABORT|ACTION|ADD|AFTER|ALL|ALTER|ALWAYS|ANALYZE|AND|AS|ASC|ATTACH|AUTOINCREMENT|BEFORE|BEGIN|BETWEEN|BY|CASCADE|CASE|CAST|CHECK|COLLATE|COLUMN|COMMIT|CONFLICT|CONSTRAINT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|DATABASE|DEFAULT|DEFERRED|DEFERRABLE|DELETE|DESC|DETACH|DISTINCT|DO|DROP|END|EACH|ELSE|ESCAPE|EXCEPT|EXCLUSIVE|EXCLUDE|EXISTS|EXPLAIN|FAIL|FILTER|FIRST|FOLLOWING|FOR|FOREIGN|FROM|FULL|GENERATED|GLOB|GROUP|GROUPS|HAVING|IF|IGNORE|IMMEDIATE|IN|INDEX|INDEXED|INITIALLY|INNER|INSERT|INSTEAD|INTERSECT|INTO|IS|ISNULL|JOIN|KEY|LAST|LEFT|LIKE|LIMIT|MATCH|MATERIALIZED|NATURAL|NO|NOT|NOTHING|NOTNULL|NULL|NULLS|OF|OFFSET|ON|OR|ORDER|OTHERS|OUTER|OVER|PARTITION|PLAN|PRAGMA|PRECEDING|PRIMARY|QUERY|RAISE|RANGE|RECURSIVE|REFERENCES|REGEXP|REINDEX|RELEASE|RENAME|REPLACE|RESTRICT|RETURNING|RIGHT|ROLLBACK|ROW|ROWS|SAVEPOINT|SELECT|SET|TABLE|TEMP|TEMPORARY|THEN|TIES|TO|TRANSACTION|TRIGGER|UNBOUNDED|UNION|UNIQUE|UPDATE|USING|VACUUM|VALUES|VIEW|VIRTUAL|WHEN|WHERE|WINDOW|WITH|WITHOUT)(?=\s+|-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\.)/,id:/"[^"]*(?:""[^"]*)*"|`[^`]*(?:``[^`]*)*`|\[[^[\]]*\]|[a-z_][a-z0-9_$]*/,string:/'[^']*(?:''[^']*)*'/,blob:/x'(?:[0-9a-f][0-9a-f])+'/,numeric:/(?:\d+(?:\.\d*)?|\.\d+)(?:e(?:\+|-)?\d+)?|0x[0-9a-f]+/,variable:/\?\d*|[@$:][a-z0-9_$]+/,operator:/-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\./,_ws:/\s+/};function l(D){const O=p({input:a(D,h)});if(!O.success)throw new Error(`Parsing CREATE TABLE failed at [${O.input.slice(O.index).map(te=>te.text).join(" ")}] of "${D}"`);return O.ast}function f(D){const O=J({input:a(D,h)});if(!O.success)throw new Error(`Parsing CREATE INDEX failed at [${O.input.slice(O.index).map(te=>te.text).join(" ")}] of "${D}"`);return O.ast}function p(D){return s([e({text:"CREATE"},O=>null),w,e({text:"TABLE"},O=>null),ie,se,Q,e({text:"("},O=>null),m,A,e({text:")"},O=>null),C,u],O=>Object.assign({},...O.filter(te=>te!==null)))(D)}function w(D){return i([e({text:"TEMP"}),e({text:"TEMPORARY"}),c],O=>({temporary:O!==null}))(D)}function C(D){return t(s([e({text:"WITHOUT"}),e({text:"ROWID"})]),O=>({rowid:O!==null}))(D)}function m(D){return i([s([g,e({text:","}),m],O=>({columns:[O[0]].concat(O[2].columns)})),s([g],O=>({columns:[O[0]]}))])(D)}function g(D){return s([s([L],O=>({name:O[0]})),d,b],O=>Object.assign({},...O))(D)}function d(D){return t(s([n(e({type:"id"})),i([s([e({text:"("}),ne,e({text:","}),ne,e({text:")"})],O=>`(${O[1]}, ${O[3]})`),s([e({text:"("}),ne,e({text:")"})],O=>`(${O[1]})`),c])],O=>`${O[0].join(" ")}${O[1]||""}`),O=>({type:O}))(D)}function b(D){return t(n(_),O=>({constraints:Object.assign({primary:null,notnull:null,null:null,unique:null,check:null,default:null,collate:null,references:null,as:null},...O||[])}))(D)}function _(D){return i([q,R,$,M,v,T,B,F,y])(D)}function q(D){return s([W,e({text:"PRIMARY"},O=>null),e({text:"KEY"},O=>null),ce,H,E],O=>({primary:Object.assign({},...O.filter(te=>te!==null))}))(D)}function E(D){return t(e({text:"AUTOINCREMENT"}),O=>({autoincrement:O!==null}))(D)}function R(D){return s([W,e({text:"NOT"},O=>null),e({text:"NULL"},O=>null),H],O=>({notnull:Object.assign({},...O.filter(te=>te!==null))}))(D)}function $(D){return s([W,e({text:"NULL"},O=>null),H],O=>({null:Object.assign({},...O.filter(te=>te!==null))}))(D)}function M(D){return s([W,e({text:"UNIQUE"},O=>null),H],O=>({unique:Object.assign({},...O.filter(te=>te!==null))}))(D)}function v(D){return s([W,e({text:"CHECK"},O=>null),e({text:"("},O=>null),s([le],O=>({expression:O[0]})),e({text:")"},O=>null)],O=>({check:Object.assign({},...O.filter(te=>te!==null))}))(D)}function T(D){return s([W,e({text:"DEFAULT"},O=>null),i([s([e({text:"("}),le,e({text:")"})],O=>({value:O[1],expression:!0})),s([Z],O=>({value:O[0],expression:!1})),s([ne],O=>({value:O[0],expression:!1}))])],O=>({default:Object.assign({},...O.filter(te=>te!==null))}))(D)}function B(D){return s([W,e({text:"COLLATE"},O=>null),e({type:"id"},O=>({collation:O.text}))],O=>({collate:Object.assign({},...O.filter(te=>te!==null))}))(D)}function F(D){return s([W,s([K],O=>O[0].references)],O=>({references:Object.assign({},...O.filter(te=>te!==null))}))(D)}function y(D){return s([W,t(s([e({text:"GENERATED"}),e({text:"ALWAYS"})]),O=>({generated:O!==null})),e({text:"AS"},O=>null),e({text:"("},O=>null),s([le],O=>({expression:O[0]})),e({text:")"},O=>null),i([e({text:"STORED"}),e({text:"VIRTUAL"}),c],O=>({mode:O?O.toUpperCase():null}))],O=>({as:Object.assign({},...O.filter(te=>te!==null))}))(D)}function A(D){return t(n(s([e({text:","}),j],O=>O[1])),O=>({constraints:O||[]}))(D)}function j(D){return i([Y,ee,N,V])(D)}function Y(D){return s([W,e({text:"PRIMARY"},O=>null),e({text:"KEY"},O=>null),e({text:"("},O=>null),oe,e({text:")"},O=>null),H],O=>Object.assign({type:"PRIMARY KEY"},...O.filter(te=>te!==null)))(D)}function ee(D){return s([W,e({text:"UNIQUE"},O=>null),e({text:"("},O=>null),oe,e({text:")"},O=>null),H],O=>Object.assign({type:"UNIQUE"},...O.filter(te=>te!==null)))(D)}function H(D){return t(s([e({text:"ON"}),e({text:"CONFLICT"}),i([e({text:"ROLLBACK"}),e({text:"ABORT"}),e({text:"FAIL"}),e({text:"IGNORE"}),e({text:"REPLACE"})])],O=>O[2]),O=>({conflict:O?O.toUpperCase():null}))(D)}function N(D){return s([W,e({text:"CHECK"},O=>null),e({text:"("},O=>null),s([le],O=>({expression:O[0]})),e({text:")"},O=>null)],O=>Object.assign({type:"CHECK"},...O.filter(te=>te!==null)))(D)}function V(D){return s([W,e({text:"FOREIGN"},O=>null),e({text:"KEY"},O=>null),e({text:"("},O=>null),S,e({text:")"},O=>null),K],O=>Object.assign({type:"FOREIGN KEY"},...O.filter(te=>te!==null)))(D)}function K(D){return s([e({text:"REFERENCES"},O=>null),Q,x,t(n(i([I,k,X])),O=>Object.assign({delete:null,update:null,match:null},...O||[])),z],O=>({references:Object.assign({},...O.filter(te=>te!==null))}))(D)}function x(D){return t(s([e({text:"("}),S,e({text:")"})],O=>O[1]),O=>({columns:O?O.columns:[]}))(D)}function S(D){return s([t(n(s([L,e({text:","})],O=>O[0])),O=>O!==null?O:[]),L],O=>({columns:O[0].concat([O[1]])}))(D)}function I(D){return s([e({text:"ON"}),e({text:"DELETE"}),U],O=>({delete:O[2]}))(D)}function k(D){return s([e({text:"ON"}),e({text:"UPDATE"}),U],O=>({update:O[2]}))(D)}function X(D){return s([e({text:"MATCH"}),i([e({type:"keyword"}),e({type:"id"})])],O=>({match:O[1]}))(D)}function z(D){return t(s([t(e({text:"NOT"})),e({text:"DEFERRABLE"}),t(s([e({text:"INITIALLY"}),i([e({text:"DEFERRED"}),e({text:"IMMEDIATE"})])],O=>O[1].toUpperCase()))]),O=>({deferrable:O?{not:O[0]!==null,initially:O[2]}:null}))(D)}function W(D){return t(s([e({text:"CONSTRAINT"}),L],O=>O[1]),O=>({name:O}))(D)}function J(D){return s([e({text:"CREATE"},O=>null),re,e({text:"INDEX"},O=>null),ie,se,P,e({text:"ON"},O=>null),Q,e({text:"("},O=>null),oe,e({text:")"},O=>null),ae,u],O=>Object.assign({},...O.filter(te=>te!==null)))(D)}function re(D){return t(e({text:"UNIQUE"}),O=>({unique:O!==null}))(D)}function ie(D){return t(s([e({text:"IF"}),e({text:"NOT"}),e({text:"EXISTS"})]),O=>({exists:O!==null}))(D)}function se(D){return t(s([L,e({text:"."})],O=>O[0]),O=>({schema:O}))(D)}function P(D){return s([L],O=>({index:O[0]}))(D)}function Q(D){return s([L],O=>({table:O[0]}))(D)}function ae(D){return t(s([e({text:"WHERE"}),le],O=>O[1]),O=>({where:O}))(D)}function oe(D){return i([s([de,e({text:","}),oe],O=>({columns:[O[0]].concat(O[2].columns)})),s([G,e({text:","}),oe],O=>({columns:[O[0]].concat(O[2].columns)})),o({do:de,next:e({text:")"})},O=>({columns:[O]})),o({do:G,next:e({text:")"})},O=>({columns:[O]}))])(D)}function de(D){return s([s([L],O=>({name:O[0],expression:!1})),we,ce],O=>Object.assign({},...O.filter(te=>te!==null)))(D)}function G(D){return s([s([ge],O=>({name:O[0],expression:!0})),we,ce],O=>Object.assign({},...O.filter(te=>te!==null)))(D)}function we(D){return t(s([e({text:"COLLATE"}),e({type:"id"})],O=>O[1]),O=>({collation:O}))(D)}function ce(D){return i([e({text:"ASC"}),e({text:"DESC"}),c],O=>({order:O?O.toUpperCase():null}))(D)}function ge(D){return n(i([r({do:e({type:"keyword"}),not:i([e({text:"COLLATE"}),e({text:"ASC"}),e({text:"DESC"})])}),e({type:"id"}),e({type:"string"}),e({type:"blob"}),e({type:"numeric"}),e({type:"variable"}),r({do:e({type:"operator"}),not:i([e({text:"("}),e({text:")"}),e({text:","})])}),s([e({text:"("}),t(le),e({text:")"})],O=>O[1]||[])]))(D)}function le(D){return n(i([e({type:"keyword"}),e({type:"id"}),e({type:"string"}),e({type:"blob"}),e({type:"numeric"}),e({type:"variable"}),r({do:e({type:"operator"}),not:i([e({text:"("}),e({text:")"})])}),s([e({text:"("}),t(le),e({text:")"})],O=>O[1]||[])]))(D)}function L(D){return i([e({type:"id"}),e({type:"string"})],O=>/^["`['][^]*["`\]']$/.test(O)?O.substring(1,O.length-1):O)(D)}function U(D){return i([s([e({text:"SET"}),e({text:"NULL"})],O=>`${O[0]} ${O[1]}`),s([e({text:"SET"}),e({text:"DEFAULT"})],O=>`${O[0]} ${O[1]}`),e({text:"CASCADE"}),e({text:"RESTRICT"}),s([e({text:"NO"}),e({text:"ACTION"})],O=>`${O[0]} ${O[1]}`)],O=>O.toUpperCase())(D)}function Z(D){return i([e({type:"numeric"}),e({type:"string"}),e({type:"id"}),e({type:"blob"}),e({text:"NULL"}),e({text:"TRUE"}),e({text:"FALSE"}),e({text:"CURRENT_TIME"}),e({text:"CURRENT_DATE"}),e({text:"CURRENT_TIMESTAMP"})])(D)}function ne(D){return s([i([e({text:"+"}),e({text:"-"}),c]),e({type:"numeric"})],O=>`${O[0]||""}${O[1]}`)(D)}return Vu={parseCreateTable:l,parseCreateIndex:f},Vu}var Wu,Ky;function SE(){if(Ky)return Wu;Ky=1;function a(P,Q=ae=>ae){return i(P,Q)}function s(P,Q=ae=>ae){return H(P,Q)}function i(P,Q){return`CREATE${n(P)} TABLE${V(P)} ${K(P,Q)}${S(P,Q)} (${o(P,Q)}${b(P,Q)})${t(P)}`}function n(P,Q){return P.temporary?" TEMP":""}function t(P,Q){return P.rowid?" WITHOUT ROWID":""}function o(P,Q){return P.columns.map(ae=>r(ae,Q)).join(", ")}function r(P,Q){return`${se(P.name,Q)}${e(P)}${c(P.constraints,Q)}`}function e(P,Q){return P.type!==null?` ${P.type}`:""}function c(P,Q){return`${u(P,Q)}${l(P,Q)}${f(P,Q)}${p(P,Q)}${w(P,Q)}${C(P,Q)}${m(P,Q)}${g(P,Q)}${d(P,Q)}`}function u(P,Q){return P.primary!==null?` ${ee(P.primary,Q)}PRIMARY KEY${J(P.primary)}${R(P.primary)}${h(P.primary)}`:""}function h(P,Q){return P.autoincrement?" AUTOINCREMENT":""}function l(P,Q){return P.notnull!==null?` ${ee(P.notnull,Q)}NOT NULL${R(P.notnull)}`:""}function f(P,Q){return P.null!==null?` ${ee(P.null,Q)}NULL${R(P.null)}`:""}function p(P,Q){return P.unique!==null?` ${ee(P.unique,Q)}UNIQUE${R(P.unique)}`:""}function w(P,Q){return P.check!==null?` ${ee(P.check,Q)}CHECK (${ie(P.check.expression)})`:""}function C(P,Q){return P.default!==null?` ${ee(P.default,Q)}DEFAULT ${P.default.expression?`(${ie(P.default.value)})`:P.default.value}`:""}function m(P,Q){return P.collate!==null?` ${ee(P.collate,Q)}COLLATE ${P.collate.collation}`:""}function g(P,Q){return P.references!==null?` ${ee(P.references,Q)}${v(P.references,Q)}`:""}function d(P,Q){return P.as!==null?` ${ee(P.as,Q)}${P.as.generated?"GENERATED ALWAYS ":""}AS (${ie(P.as.expression)})${P.as.mode!==null?` ${P.as.mode}`:""}`:""}function b(P,Q){return P.constraints.reduce((ae,oe)=>`${ae}, ${_(oe,Q)}`,"")}function _(P,Q){switch(P.type){case"PRIMARY KEY":return q(P,Q);case"UNIQUE":return E(P,Q);case"CHECK":return $(P,Q);case"FOREIGN KEY":return M(P,Q)}}function q(P,Q){return`${ee(P,Q)}PRIMARY KEY (${k(P,Q)})${R(P)}`}function E(P,Q){return`${ee(P,Q)}UNIQUE (${k(P,Q)})${R(P)}`}function R(P,Q){return P.conflict!==null?` ON CONFLICT ${P.conflict}`:""}function $(P,Q){return`${ee(P,Q)}CHECK (${ie(P.expression)})`}function M(P,Q){return`${ee(P,Q)}FOREIGN KEY (${B(P,Q)}) ${v(P.references,Q)}`}function v(P,Q){return`REFERENCES ${S(P,Q)}${T(P,Q)}${F(P)}${Y(P.deferrable)}`}function T(P,Q){return P.columns.length>0?` (${B(P,Q)})`:""}function B(P,Q){return P.columns.map(ae=>se(ae,Q)).join(", ")}function F(P,Q){return`${y(P)}${A(P)}${j(P)}`}function y(P,Q){return P.delete!==null?` ON DELETE ${P.delete}`:""}function A(P,Q){return P.update!==null?` ON UPDATE ${P.update}`:""}function j(P,Q){return P.match!==null?` MATCH ${P.match}`:""}function Y(P,Q){return P!==null?` ${P.not?"NOT ":""}DEFERRABLE${P.initially!==null?` INITIALLY ${P.initially}`:""}`:""}function ee(P,Q){return P.name!==null?`CONSTRAINT ${se(P.name,Q)} `:""}function H(P,Q){return`CREATE${N(P)} INDEX${V(P)} ${K(P,Q)}${x(P,Q)} on ${S(P,Q)} (${k(P,Q)})${I(P)}`}function N(P,Q){return P.unique?" UNIQUE":""}function V(P,Q){return P.exists?" IF NOT EXISTS":""}function K(P,Q){return P.schema!==null?`${se(P.schema,Q)}.`:""}function x(P,Q){return se(P.index,Q)}function S(P,Q){return se(P.table,Q)}function I(P,Q){return P.where!==null?` where ${ie(P.where)}`:""}function k(P,Q){return P.columns.map(ae=>ae.expression?z(ae):X(ae,Q)).join(", ")}function X(P,Q){return`${se(P.name,Q)}${W(P)}${J(P)}`}function z(P,Q){return`${re(P.name)}${W(P)}${J(P)}`}function W(P,Q){return P.collation!==null?` COLLATE ${P.collation}`:""}function J(P,Q){return P.order!==null?` ${P.order}`:""}function re(P,Q){return ie(P)}function ie(P,Q){return P.reduce((ae,oe)=>Array.isArray(oe)?`${ae}(${ie(oe)})`:ae?`${ae} ${oe}`:oe,"")}function se(P,Q){return Q(P)}return Wu={compileCreateTable:a,compileCreateIndex:s},Wu}var Gu,Jy;function OE(){if(Jy)return Gu;Jy=1;function a(i,n){return i.toLowerCase()===n.toLowerCase()}function s(i,n){return i.some(t=>a(t,n))}return Gu={isEqualId:a,includesId:s},Gu}var zu,Yy;function NE(){if(Yy)return zu;Yy=1;const a=Re(),{nanonum:s}=Gc(),{copyData:i,dropOriginal:n,renameTable:t,getTableSql:o,isForeignCheckEnabled:r,setForeignCheck:e,executeForeignCheck:c}=EE(),{parseCreateTable:u,parseCreateIndex:h}=TE(),{compileCreateTable:l,compileCreateIndex:f}=SE(),{isEqualId:p,includesId:w}=OE();class C{constructor(g,d,b,_){this.client=g,this.tableCompiler=d,this.pragma=b,this.tableNameRaw=this.tableCompiler.tableNameRaw,this.alteredName=`_knex_temp_alter${s(3)}`,this.connection=_,this.formatter=q=>this.client.customWrapIdentifier(q,a),this.wrap=q=>this.client.wrapIdentifierImpl(q)}tableName(){return this.formatter(this.tableNameRaw)}getTableSql(){const g=this.tableName();return this.client.transaction(async d=>{d.disableProcessing();const b=await d.raw(o(g));return d.enableProcessing(),{createTable:b.filter(_=>_.type==="table")[0].sql,createIndices:b.filter(_=>_.type==="index").map(_=>_.sql)}},{connection:this.connection})}async isForeignCheckEnabled(){return(await this.client.raw(r()).connection(this.connection))[0].foreign_keys===1}async setForeignCheck(g){await this.client.raw(e(g)).connection(this.connection)}renameTable(g){return g.raw(t(this.alteredName,this.tableName()))}dropOriginal(g){return g.raw(n(this.tableName()))}copyData(g,d){return g.raw(i(this.tableName(),this.alteredName,d))}async alterColumn(g){const{createTable:d,createIndices:b}=await this.getTableSql(),_=u(d);_.table=this.alteredName,_.columns=_.columns.map(E=>{const R=g.find($=>p($.name,E.name));return R&&(E.type=R.type,E.constraints.default=R.defaultTo!==null?{name:null,value:R.defaultTo,expression:!1}:null,E.constraints.notnull=R.notNull?{name:null,conflict:null}:null,E.constraints.null=R.notNull?null:E.constraints.null),E});const q=l(_,this.wrap);return this.generateAlterCommands(q,b)}async dropColumn(g){const{createTable:d,createIndices:b}=await this.getTableSql(),_=u(d);if(_.table=this.alteredName,_.columns=_.columns.filter($=>$.expression||!w(g,$.name)),_.columns.length===0)throw new Error("Unable to drop last column from table");_.constraints=_.constraints.filter($=>$.type==="PRIMARY KEY"||$.type==="UNIQUE"?$.columns.every(M=>M.expression||!w(g,M.name)):$.type==="FOREIGN KEY"?$.columns.every(M=>!w(g,M))&&($.references.table!==_.table||$.references.columns.every(M=>!w(g,M))):!0);const q=_.columns.map($=>$.name),E=l(_,this.wrap),R=[];for(const $ of b){const M=h($);M.columns=M.columns.filter(v=>v.expression||!w(g,v.name)),M.columns.length>0&&R.push(f(M,this.wrap))}return this.alter(E,R,q)}async dropForeign(g,d){const{createTable:b,createIndices:_}=await this.getTableSql(),q=u(b);q.table=this.alteredName,d||(q.columns=q.columns.map(R=>({...R,references:w(g,R.name)?null:R.references}))),q.constraints=q.constraints.filter(R=>R.type==="FOREIGN KEY"?d?!R.name||!p(R.name,d):R.columns.every($=>!w(g,$)):!0);const E=l(q,this.wrap);return this.alter(E,_)}async dropPrimary(g){const{createTable:d,createIndices:b}=await this.getTableSql(),_=u(d);_.table=this.alteredName,_.columns=_.columns.map(E=>({...E,primary:null})),_.constraints=_.constraints.filter(E=>E.type==="PRIMARY KEY"?g?!E.name||!p(E.name,g):!1:!0);const q=l(_,this.wrap);return this.alter(q,b)}async primary(g,d){const{createTable:b,createIndices:_}=await this.getTableSql(),q=u(b);q.table=this.alteredName,q.columns=q.columns.map(R=>({...R,primary:null})),q.constraints=q.constraints.filter(R=>R.type!=="PRIMARY KEY"),q.constraints.push({type:"PRIMARY KEY",name:d||null,columns:g.map(R=>({name:R,expression:!1,collation:null,order:null})),conflict:null});const E=l(q,this.wrap);return this.alter(E,_)}async foreign(g){const{createTable:d,createIndices:b}=await this.getTableSql(),_=u(d);_.table=this.alteredName,_.constraints.push({type:"FOREIGN KEY",name:g.keyName||null,columns:g.column,references:{table:g.inTable,columns:g.references,delete:g.onDelete||null,update:g.onUpdate||null,match:null,deferrable:null}});const q=l(_,this.wrap);return this.generateAlterCommands(q,b)}async setNullable(g,d){const{createTable:b,createIndices:_}=await this.getTableSql(),q=u(b);q.table=this.alteredName;const E=q.columns.find($=>p(g,$.name));if(!E)throw new Error(`.setNullable: Column ${g} does not exist in table ${this.tableName()}.`);E.constraints.notnull=d?null:{name:null,conflict:null},E.constraints.null=d?E.constraints.null:null;const R=l(q,this.wrap);return this.generateAlterCommands(R,_)}async alter(g,d,b){const _=await this.isForeignCheckEnabled();_&&await this.setForeignCheck(!1);try{await this.client.transaction(async q=>{await q.raw(g),await this.copyData(q,b),await this.dropOriginal(q),await this.renameTable(q);for(const E of d)await q.raw(E);if(_&&(await q.raw(c())).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{_&&await this.setForeignCheck(!0)}}async generateAlterCommands(g,d,b){const _=[],q=[],E=[];let R=null;_.push(g),_.push(i(this.tableName(),this.alteredName,b)),_.push(n(this.tableName())),_.push(t(this.alteredName,this.tableName()));for(const M of d)_.push(M);return await this.isForeignCheckEnabled()&&(q.push(e(!1)),E.push(e(!0)),R=c()),{pre:q,sql:_,check:R,post:E}}}return zu=C,zu}var Ku,Xy;function IE(){if(Xy)return Ku;Xy=1;const a=je();return Ku=class extends a{withMaterialized(i,n,t){return this._validateWithArgs(i,n,t,"with"),this.withWrapped(i,n,t,!0)}withNotMaterialized(i,n,t){return this._validateWithArgs(i,n,t,"with"),this.withWrapped(i,n,t,!1)}},Ku}var Ju,Zy;function $w(){if(Zy)return Ju;Zy=1;const a=J_(),s=ze(),{promisify:i}=Ee(),n=Ye(),t=lt(),o=mE(),r=gE(),e=_E(),c=wE(),u=CE(),h=qE(),l=NE(),f=hr(),p=IE();class w extends n{constructor(m){super(m),m.connection&&m.connection.filename===void 0&&this.logger.warn("Could not find `connection.filename` in config. Please specify the database path and name to avoid errors. (see docs https://knexjs.org/guide/#configuration-options)"),m.useNullAsDefault===void 0&&this.logger.warn("sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs https://knexjs.org/guide/query-builder.html#insert).")}_driver(){return ve}schemaCompiler(){return new e(this,...arguments)}transaction(){return new o(this,...arguments)}queryCompiler(m,g){return new r(this,m,g)}queryBuilder(){return new p(this)}viewCompiler(m,g){return new h(this,m,g)}columnCompiler(){return new c(this,...arguments)}tableCompiler(){return new u(this,...arguments)}ddl(m,g,d){return new l(this,m,g,d)}wrapIdentifierImpl(m){return m!=="*"?`\`${m.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((m,g)=>{let d=this.driver.OPEN_READWRITE|this.driver.OPEN_CREATE;if(this.connectionSettings.flags){if(!Array.isArray(this.connectionSettings.flags))throw new Error("flags must be an array of strings");this.connectionSettings.flags.forEach(_=>{if(!_.startsWith("OPEN_")||!this.driver[_])throw new Error(`flag ${_} not supported by node-sqlite3`);d=d|this.driver[_]})}const b=new this.driver.Database(this.connectionSettings.filename,d,_=>{if(_)return g(_);m(b)})})}async destroyRawConnection(m){return i(d=>m.close(d))()}_query(m,g){if(!g.sql)throw new Error("The query is empty");const{method:d}=g;let b;switch(d){case"insert":case"update":b=g.returning?"all":"run";break;case"counter":case"del":b="run";break;default:b="all"}return new Promise(function(_,q){if(!m||!m[b])return q(new Error(`Error calling ${b} on connection.`));m[b](g.sql,g.bindings,function(E,R){return E?q(E):(g.response=R,g.context=this,_(g))})})}_stream(m,g,d){if(!g.sql)throw new Error("The query is empty");const b=this;return new Promise(function(_,q){return d.on("error",q),d.on("end",_),b._query(m,g).then(E=>E.response).then(E=>E.forEach(R=>d.write(R))).catch(function(E){d.emit("error",E)}).then(function(){d.end()})})}processResponse(m,g){const d=m.context,{response:b,returning:_}=m;if(m.output)return m.output.call(g,b);switch(m.method){case"select":return b;case"first":return b[0];case"pluck":return s(b,m.pluck);case"insert":return _&&b?b:[d.lastID];case"update":return _&&b?b:d.changes;case"del":case"counter":return d.changes;default:return b}}poolDefaults(){return a({min:1,max:1},super.poolDefaults())}formatter(m){return new f(this,m)}values(m,g,d){return Array.isArray(m)?Array.isArray(m[0])?`( values ${m.map(b=>`(${this.parameterize(b,void 0,g,d)})`).join(", ")})`:`(${this.parameterize(m,void 0,g,d)})`:m instanceof t?`(${this.parameter(m,g,d)})`:this.parameter(m,g,d)}}return Object.assign(w.prototype,{dialect:"sqlite3",driverName:"sqlite3"}),Ju=w,Ju}var Yu,eb;function $E(){if(eb)return Yu;eb=1;const a=$w();class s extends a{_driver(){return ve}async acquireRawConnection(){const n=this.connectionSettings.options||{};return new this.driver(this.connectionSettings.filename,{nativeBinding:n.nativeBinding,readonly:!!n.readonly})}async destroyRawConnection(n){return n.close()}async _query(n,t){if(!t.sql)throw new Error("The query is empty");if(!n)throw new Error("No connection provided");const o=n.prepare(t.sql),r=this._formatBindings(t.bindings);if(o.reader){const c=await o.all(r);return t.response=c,t}const e=await o.run(r);return t.response=e,t.context={lastID:e.lastInsertRowid,changes:e.changes},t}_formatBindings(n){return n?n.map(t=>t instanceof Date?t.valueOf():typeof t=="boolean"?Number(t):t):[]}}return Object.assign(s.prototype,{driverName:"better-sqlite3"}),Yu=s,Yu}var Xu,tb;function xw(){if(tb)return Xu;tb=1;const a=Be();class s extends a{begin(n){const t=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return t.length===0?this.query(n,"BEGIN;"):this.query(n,`BEGIN TRANSACTION ${t};`)}}return Xu=s,Xu}var Zu,rb;function Kc(){if(rb)return Zu;rb=1;const a=Re(),s=Tt(),i=Ke(),{wrapString:n,columnize:t,operator:o,wrap:r}=qe();class e extends i{constructor(u,h,l){super(u,h,l),this._defaultInsertValue="default"}truncate(){return`truncate ${this.tableName} restart identity`}insert(){let u=super.insert();if(u==="")return u;const{returning:h,onConflict:l,ignore:f,merge:p,insert:w}=this.single;if(l&&f&&(u+=this._ignore(l)),l&&p){u+=this._merge(p.updates,l,w);const C=this.where();C&&(u+=` ${C}`)}return h&&(u+=this._returning(h)),{sql:u,returning:h}}update(){const u=this.with(),h=this._prepUpdate(this.single.update),l=this.where(),{returning:f,updateFrom:p}=this.single;return{sql:u+`update ${this.single.only?"only ":""}${this.tableName} set ${h.join(", ")}`+this._updateFrom(p)+(l?` ${l}`:"")+this._returning(f),returning:f}}using(){const u=this.single.using;if(!u)return;let h="using ";return Array.isArray(u)?h+=u.map(l=>this.formatter.wrap(l)).join(","):h+=this.formatter.wrap(u),h}del(){const{tableName:u}=this,h=this.with();let l=this.where()||"",f=this.using()||"";const p=this.grouped.join,w=[];if(Array.isArray(p)){for(const g of p){w.push(r(this._joinTable(g),void 0,this.builder,this.client,this.bindingsHolder));const d=[];for(const b of g.clauses)d.push(this.whereBasic({column:b.column,operator:"=",value:b.value,asColumn:!0}));d.length>0&&(l+=(l?" and ":"where ")+d.join(" and "))}w.length>0&&(f+=(f?",":"using ")+w.join(","))}const C=h+`delete from ${this.single.only?"only ":""}${u}`+(f?` ${f}`:"")+(l?` ${l}`:""),{returning:m}=this.single;return{sql:C+this._returning(m),returning:m}}aggregate(u){return this._aggregate(u,{distinctParentheses:!0})}_returning(u){return u?` returning ${this.formatter.columnize(u)}`:""}_updateFrom(u){return u?` from ${this.formatter.wrap(u)}`:""}_ignore(u){return u===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(u)} do nothing`}_merge(u,h,l){let f=` on conflict ${this._onConflictClause(h)} do update set `;if(u&&Array.isArray(u))return f+=u.map(p=>n(p.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(p=>`${p} = excluded.${p}`).join(", "),f;if(u&&typeof u=="object"){const p=this._prepUpdate(u);return typeof p=="string"?f+=p:f+=p.join(","),f}else{const p=this._prepInsert(l);if(typeof p=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return f+=p.columns.map(w=>n(w.split(".").pop(),this.builder,this.client)).map(w=>`${w} = excluded.${w}`).join(", "),f}}_tableNames(u){const h=this.single.schema,l=[];for(let f=0;f<u.length;f++){let p=u[f];p&&(h&&(p=`${h}.${p}`),l.push(this.formatter.wrap(p)))}return l.join(", ")}_lockingClause(u){const h=this.single.lockTables||[];return u+(h.length?" of "+this._tableNames(h):"")}_groupOrder(u,h){return super._groupOrderNulls(u,h)}forUpdate(){return this._lockingClause("for update")}forShare(){return this._lockingClause("for share")}forNoKeyUpdate(){return this._lockingClause("for no key update")}forKeyShare(){return this._lockingClause("for key share")}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const u=this.single.columnInfo;let h=this.single.schema;const l=this.client.customWrapIdentifier(this.single.table,a);h&&(h=this.client.customWrapIdentifier(h,a));const f="select * from information_schema.columns where table_name = ? and table_catalog = current_database()",p=[l];return this._buildColumnInfoQuery(h,f,p,u)}_buildColumnInfoQuery(u,h,l,f){return u?(h+=" and table_schema = ?",l.push(u)):h+=" and table_schema = current_schema()",{sql:h,bindings:l,output(p){const w=s(p.rows,function(C,m){return C[m.column_name]={type:m.data_type,maxLength:m.character_maximum_length,nullable:m.is_nullable==="YES",defaultValue:m.column_default},C},{});return f&&w[f]||w}}}distinctOn(u){return"distinct on ("+this.formatter.columnize(u)+") "}jsonExtract(u){return this._jsonExtract("jsonb_path_query",u)}jsonSet(u){return this._jsonSet("jsonb_set",Object.assign({},u,{path:this.client.toPathForJson(u.path)}))}jsonInsert(u){return this._jsonSet("jsonb_insert",Object.assign({},u,{path:this.client.toPathForJson(u.path)}))}jsonRemove(u){const h=`${t(u.column,this.builder,this.client,this.bindingsHolder)} #- ${this.client.parameter(this.client.toPathForJson(u.path),this.builder,this.bindingsHolder)}`;return u.alias?this.client.alias(h,this.formatter.wrap(u.alias)):h}whereJsonPath(u){let h="";return!isNaN(u.value)&&parseInt(u.value)?h="::int":!isNaN(u.value)&&parseFloat(u.value)?h="::float":h=" #>> '{}'",`jsonb_path_query_first(${this._columnClause(u)}, ${this.client.parameter(u.jsonPath,this.builder,this.bindingsHolder)})${h} ${o(u.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(u)}`}whereJsonSupersetOf(u){return this._not(u,`${r(u.column,void 0,this.builder,this.client,this.bindingsHolder)} @> ${this._jsonValueClause(u)}`)}whereJsonSubsetOf(u){return this._not(u,`${t(u.column,this.builder,this.client,this.bindingsHolder)} <@ ${this._jsonValueClause(u)}`)}onJsonPathEquals(u){return this._onJsonPathEquals("jsonb_path_query_first",u)}}return Zu=e,Zu}var el,nb;function xE(){if(nb)return el;nb=1;const a=je();return el=class extends a{updateFrom(i){return this._single.updateFrom=i,this}using(i){return this._single.using=i,this}withMaterialized(i,n,t){return this._validateWithArgs(i,n,t,"with"),this.withWrapped(i,n,t,!0)}withNotMaterialized(i,n,t){return this._validateWithArgs(i,n,t,"with"),this.withWrapped(i,n,t,!1)}},el}var tl,ib;function Jc(){if(ib)return tl;ib=1;const a=Je(),{isObject:s}=ye(),{toNumber:i}=Ce(),n=new RegExp("(?<!')'(?!')","g");class t extends a{constructor(e,c,u){super(e,c,u),this.modifiers=["nullable","defaultTo","comment"],this._addCheckModifiers()}bit(e){return e.length!==!1?`bit(${e.length})`:"bit"}enu(e,c){c=c||{};const u=c.useNative&&c.existingType?void 0:e.join("', '");if(c.useNative){let h="";const l=c.schemaName||this.tableCompiler.schemaNameRaw;return l&&(h+=`"${l}".`),h+=`"${c.enumName}"`,c.existingType||this.tableCompiler.unshiftQuery(`create type ${h} as enum ('${u}')`),h}return`text check (${this.formatter.wrap(this.args[0])} in ('${u}'))`}decimal(e,c){return e===null?"decimal":`decimal(${i(e,8)}, ${i(c,2)})`}json(e){return e&&this.client.logger.deprecate("json(true)","jsonb()"),o(this.client,e)}jsonb(){return o(this.client,!0)}checkRegex(e,c){return this._check(`${this.formatter.wrap(this.getColumnName())} ~ ${this.client._escapeBinding(e)}`,c)}datetime(e=!1,c){let u;return s(e)?{useTz:u,precision:c}=e:u=!e,u=typeof u=="boolean"?u:!0,c=c!=null?"("+c+")":"",`${u?"timestamptz":"timestamp"}${c}`}timestamp(e=!1,c){return this.datetime(e,c)}comment(e){const c=this.args[0]||this.defaults("columnName"),u=e?`'${e.replace(n,"''")}'`:"NULL";this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(c)+` is ${u}`)},e)}increments(e={primaryKey:!0}){return"serial"+(this.tableCompiler._canBeAddPrimaryKey(e)?" primary key":"")}bigincrements(e={primaryKey:!0}){return"bigserial"+(this.tableCompiler._canBeAddPrimaryKey(e)?" primary key":"")}uuid(e={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(e)?" primary key":"")}}t.prototype.bigint="bigint",t.prototype.binary="bytea",t.prototype.bool="boolean",t.prototype.double="double precision",t.prototype.floating="real",t.prototype.smallint="smallint",t.prototype.tinyint="smallint";function o(r,e){return!r.version||r.config.client==="cockroachdb"||r.config.jsonbSupport===!0||parseFloat(r.version)>=9.2?e?"jsonb":"json":"text"}return tl=t,tl}var rl,sb;function Yc(){if(sb)return rl;sb=1;const a=ar(),s=ht(),{isObject:i,isString:n}=ye();class t extends s{constructor(r,e){super(r,e)}renameColumn(r,e){return this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(r)} to ${this.formatter.wrap(e)}`})}_setNullableState(r,e){const c=e?"drop not null":"set not null",u=`alter table ${this.tableName()} alter column ${this.formatter.wrap(r)} ${c}`;return this.pushQuery({sql:u})}compileAdd(r){const e=this.formatter.wrap(r),c=this.prefixArray("add column",this.getColumns(r));return this.pushQuery({sql:`alter table ${e} ${c.join(", ")}`})}createQuery(r,e,c){const u=e?"create table if not exists ":"create table ",h=` (${r.sql.join(", ")}${this.primaryKeys()||""}${this._addChecks()})`;let l=u+this.tableName()+(c&&this.tableNameLike()?" (like "+this.tableNameLike()+" including all"+(r.sql.length?", "+r.sql.join(", "):"")+")":h);this.single.inherits&&(l+=` inherits (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:l,bindings:r.bindings}),a(this.single,"comment")&&this.comment(this.single.comment)}primaryKeys(){const r=(this.grouped.alterTable||[]).filter(e=>e.method==="primary");if(r.length>0&&r[0].args.length>0){const e=r[0].args[0];let c=r[0].args[1]||"",u;return i(c)&&({constraintName:c,deferrable:u}=c),u=u?` deferrable initially ${u}`:"",c=c?this.formatter.wrap(c):this.formatter.wrap(`${this.tableNameRaw}_pkey`),`, constraint ${c} primary key (${this.formatter.columnize(e)})${u}`}}addColumns(r,e,c){if(e===this.alterColumnsPrefix)for(const u of c)this._addColumn(u);else super.addColumns(r,e)}_addColumn(r){const e=this.tableName(),c=r.getColumnType(),u=this.client.wrapIdentifier(r.getColumnName(),r.columnBuilder.queryContext()),h=r.type==="enu";this.pushQuery({sql:`alter table ${e} alter column ${u} drop default`,bindings:[]});const l=r.columnBuilder.alterNullable;l&&this.pushQuery({sql:`alter table ${e} alter column ${u} drop not null`,bindings:[]}),r.columnBuilder.alterType&&this.pushQuery({sql:`alter table ${e} alter column ${u} type ${c} using (${u}${h?"::text::":"::"}${c})`,bindings:[]});const p=r.modified.defaultTo;if(p){const w=r.defaultTo.apply(r,p);this.pushQuery({sql:`alter table ${e} alter column ${u} set ${w}`,bindings:[]})}if(l){const w=r.modified.nullable;w&&w[0]===!1&&this.pushQuery({sql:`alter table ${e} alter column ${u} set not null`,bindings:[]})}}comment(r){this.pushQuery(`comment on table ${this.tableName()} is '${this.single.comment}'`)}primary(r,e){let c;i(e)&&({constraintName:e,deferrable:c}=e),c=c?` deferrable initially ${c}`:"",e=e?this.formatter.wrap(e):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add constraint ${e} primary key (${this.formatter.columnize(r)})${c}`)}unique(r,e){let c,u=!0,h;if(i(e)&&({indexName:e,deferrable:c,useConstraint:u,predicate:h}=e,u===void 0&&(u=!!c||!h)),!u&&c&&c!=="not deferrable")throw new Error("postgres cannot create deferrable index");if(u&&h)throw new Error("postgres cannot create constraint with predicate");if(c=c?` deferrable initially ${c}`:"",e=e?this.formatter.wrap(e):this._indexCommand("unique",this.tableNameRaw,r),u)this.pushQuery(`alter table ${this.tableName()} add constraint ${e} unique (`+this.formatter.columnize(r)+")"+c);else{const l=h?" "+this.client.queryCompiler(h).where():"";this.pushQuery(`create unique index ${e} on ${this.tableName()} (${this.formatter.columnize(r)})${l}`)}}index(r,e,c){e=e?this.formatter.wrap(e):this._indexCommand("index",this.tableNameRaw,r);let u,h,l;n(c)?h=c:i(c)&&({indexType:l,storageEngineIndexType:h,predicate:u}=c);const f=u?" "+this.client.queryCompiler(u).where():"";this.pushQuery(`create${typeof l=="string"&&l.toLowerCase()==="unique"?" unique":""} index ${e} on ${this.tableName()}${h&&` using ${h}`||""} (`+this.formatter.columnize(r)+`)${f}`)}dropPrimary(r){r=r?this.formatter.wrap(r):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${r}`)}dropIndex(r,e){e=e?this.formatter.wrap(e):this._indexCommand("index",this.tableNameRaw,r),e=this.schemaNameRaw?`${this.formatter.wrap(this.schemaNameRaw)}.${e}`:e,this.pushQuery(`drop index ${e}`)}dropUnique(r,e){e=e?this.formatter.wrap(e):this._indexCommand("unique",this.tableNameRaw,r),this.pushQuery(`alter table ${this.tableName()} drop constraint ${e}`)}dropForeign(r,e){e=e?this.formatter.wrap(e):this._indexCommand("foreign",this.tableNameRaw,r),this.pushQuery(`alter table ${this.tableName()} drop constraint ${e}`)}}return rl=t,rl}var nl,ob;function Xc(){if(ob)return nl;ob=1;const a=ft();class s extends a{constructor(n,t){super(n,t)}renameColumn(n,t){return this.pushQuery({sql:`alter view ${this.viewName()} rename ${this.formatter.wrap(n)} to ${this.formatter.wrap(t)}`})}defaultTo(n,t){return this.pushQuery({sql:`alter view ${this.viewName()} alter ${this.formatter.wrap(n)} set default ${t}`})}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return nl=s,nl}var il,ab;function PE(){if(ab)return il;ab=1;const a=St();class s extends a{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return il=s,il}var sl,ub;function Pw(){if(ub)return sl;ub=1;const a=ct();class s extends a{constructor(n,t){super(n,t)}hasTable(n){let t="select * from information_schema.tables where table_name = ?";const o=[n];this.schema?(t+=" and table_schema = ?",o.push(this.schema)):t+=" and table_schema = current_schema()",this.pushQuery({sql:t,bindings:o,output(r){return r.rows.length>0}})}hasColumn(n,t){let o="select * from information_schema.columns where table_name = ? and column_name = ?";const r=[n,t];this.schema?(o+=" and table_schema = ?",r.push(this.schema)):o+=" and table_schema = current_schema()",this.pushQuery({sql:o,bindings:r,output(e){return e.rows.length>0}})}qualifiedTableName(n){const t=this.schema?`${this.schema}.${n}`:n;return this.formatter.wrap(t)}renameTable(n,t){this.pushQuery(`alter table ${this.qualifiedTableName(n)} rename to ${this.formatter.wrap(t)}`)}createSchema(n){this.pushQuery(`create schema ${this.formatter.wrap(n)}`)}createSchemaIfNotExists(n){this.pushQuery(`create schema if not exists ${this.formatter.wrap(n)}`)}dropSchema(n,t=!1){this.pushQuery(`drop schema ${this.formatter.wrap(n)}${t?" cascade":""}`)}dropSchemaIfExists(n,t=!1){this.pushQuery(`drop schema if exists ${this.formatter.wrap(n)}${t?" cascade":""}`)}dropExtension(n){this.pushQuery(`drop extension ${this.formatter.wrap(n)}`)}dropExtensionIfExists(n){this.pushQuery(`drop extension if exists ${this.formatter.wrap(n)}`)}createExtension(n){this.pushQuery(`create extension ${this.formatter.wrap(n)}`)}createExtensionIfNotExists(n){this.pushQuery(`create extension if not exists ${this.formatter.wrap(n)}`)}renameView(n,t){this.pushQuery(this.alterViewPrefix+`${this.formatter.wrap(n)} rename to ${this.formatter.wrap(t)}`)}refreshMaterializedView(n,t=!1){this.pushQuery({sql:`refresh materialized view${t?" concurrently":""} ${this.formatter.wrap(n)}`})}dropMaterializedView(n){this._dropView(n,!1,!0)}dropMaterializedViewIfExists(n){this._dropView(n,!0,!0)}}return sl=s,sl}var ol,lb;function fr(){if(lb)return ol;lb=1;const a=lr(),s=ze(),{promisify:i}=Ee(),n=Ye(),t=xw(),o=Kc(),r=xE(),e=Jc(),c=Yc(),u=Xc(),h=PE(),l=Pw(),{makeEscape:f}=Ac(),{isString:p}=ye();class w extends n{constructor(g){super(g),g.returning&&(this.defaultReturning=g.returning),g.searchPath&&(this.searchPath=g.searchPath)}transaction(){return new t(this,...arguments)}queryBuilder(){return new r(this)}queryCompiler(g,d){return new o(this,g,d)}columnCompiler(){return new e(this,...arguments)}schemaCompiler(){return new l(this,...arguments)}tableCompiler(){return new c(this,...arguments)}viewCompiler(){return new u(this,...arguments)}viewBuilder(){return new h(this,...arguments)}_driver(){return ve}wrapIdentifierImpl(g){if(g==="*")return g;let d="";const b=g.match(/(.*?)(\[[0-9]+\])/);return b&&(g=b[1],d=b[2]),`"${g.replace(/"/g,'""')}"${d}`}_acquireOnlyConnection(){const g=new this.driver.Client(this.connectionSettings);return g.on("error",d=>{g.__knex__disposed=d}),g.on("end",d=>{g.__knex__disposed=d||"Connection ended unexpectedly"}),g.connect().then(()=>g)}acquireRawConnection(){const g=this;return this._acquireOnlyConnection().then(function(d){return g.version?d:g.checkVersion(d).then(function(b){return g.version=b,d})}).then(async function(b){return await g.setSchemaSearchPath(b),b})}async destroyRawConnection(g){return i(b=>g.end(b))()}checkVersion(g){return new Promise((d,b)=>{g.query("select version();",(_,q)=>{if(_)return b(_);d(this._parseVersion(q.rows[0].version))})})}_parseVersion(g){return/^PostgreSQL (.*?)( |$)/.exec(g)[1]}positionBindings(g){let d=0;return g.replace(/(\\*)(\?)/g,function(b,_){return _.length%2?"?":(d++,`$${d}`)})}setSchemaSearchPath(g,d){let b=d||this.searchPath;if(!b)return Promise.resolve(!0);if(!Array.isArray(b)&&!p(b))throw new TypeError(`knex: Expected searchPath to be Array/String, got: ${typeof b}`);if(p(b)){if(b.includes(",")){const q=`[${b.split(",").map(E=>`'${E}'`).join(", ")}]`;this.logger.warn(`Detected comma in searchPath "${b}".If you are trying to specify multiple schemas, use Array syntax: ${q}`)}b=[b]}return b=b.map(_=>`"${_}"`).join(","),new Promise(function(_,q){g.query(`set search_path to ${b}`,function(E){if(E)return q(E);_(!0)})})}_stream(g,d,b,_){if(!d.sql)throw new Error("The query is empty");const q=pe.browser?void 0:ve,E=d.sql;return new Promise(function(R,$){const M=g.query(new q(E,d.bindings,_),v=>{$(v)});M.on("error",function(v){$(v),b.emit("error",v)}),b.on("end",R),M.pipe(b)})}_query(g,d){if(!d.sql)throw new Error("The query is empty");let b={text:d.sql,values:d.bindings||[]};return d.options&&(b=a(b,d.options)),new Promise(function(_,q){g.query(b,function(E,R){if(E)return q(E);d.response=R,_(d)})})}processResponse(g,d){const b=g.response;if(g.output)return g.output.call(d,b);if(g.method==="raw")return b;const{returning:_}=g;if(b.command==="SELECT")return g.method==="first"?b.rows[0]:g.method==="pluck"?s(b.rows,g.pluck):b.rows;if(_){const q=[];for(let E=0,R=b.rows.length;E<R;E++){const $=b.rows[E];q[E]=$}return q}return b.command==="UPDATE"||b.command==="DELETE"?b.rowCount:b}async cancelQuery(g){const d=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(d,g)}finally{await this.destroyRawConnection(d).catch(b=>{this.logger.warn(`Connection Error: ${b}`)})}}_wrappedCancelQueryCall(g,d){return this._query(g,{sql:"SELECT pg_cancel_backend($1);",bindings:[d.processID],options:{}})}toPathForJson(g){const d=/^{.*}$/;return g.match(d)?g:"{"+g.replace(/^(\$\.)/,"").replace(".",",").replace(/\[([0-9]+)]/,",$1")+"}"}}Object.assign(w.prototype,{dialect:"postgresql",driverName:"pg",canCancelQuery:!0,_escapeBinding:f({escapeArray(m,g){return g(C(m,g))},escapeString(m){let g=!1,d="'";for(let b=0;b<m.length;b++){const _=m[b];_==="'"?d+=_+_:_==="\\"?(d+=_+_,g=!0):d+=_}return d+="'",g===!0&&(d="E"+d),d},escapeObject(m,g,d,b=[]){if(m&&typeof m.toPostgres=="function"){if(b=b||[],b.indexOf(m)!==-1)throw new Error(`circular reference detected while preparing "${m}" for query`);return b.push(m),g(m.toPostgres(g),b)}return JSON.stringify(m)}})});function C(m,g){let d="{";for(let b=0;b<m.length;b++){b>0&&(d+=",");const _=m[b];_===null||typeof _>"u"?d+="NULL":Array.isArray(_)?d+=C(_,g):typeof _=="number"?d+=_:d+=JSON.stringify(typeof _=="string"?_:g(_))}return d+"}"}return ol=w,ol}var al,cb;function jE(){if(cb)return al;cb=1;const a=Kc(),{columnize:s,wrap:i,operator:n}=qe();class t extends a{truncate(){return`truncate ${this.tableName}`}upsert(){let r=this._upsert();if(r==="")return r;const{returning:e}=this.single;return e&&(r+=this._returning(e)),{sql:r,returning:e}}_upsert(){const r=this.single.upsert||[],e=this.with()+`upsert into ${this.tableName} `,c=this._insertBody(r);return c===""?"":e+c}_groupOrder(r,e){return this._basicGroupOrder(r,e)}whereJsonPath(r){let e="";return!isNaN(r.value)&&parseInt(r.value)?e="::int":!isNaN(r.value)&&parseFloat(r.value)?e="::float":e=" #>> '{}'",`json_extract_path(${this._columnClause(r)}, ${this.client.toArrayPathFromJsonPath(r.jsonPath,this.builder,this.bindingsHolder)})${e} ${n(r.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(r)}`}_jsonExtract(r,e){let c;return Array.isArray(e.column)?c=e.column:c=[e],c.map(u=>{const h=`json_extract_path(${s(u.column||u[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toArrayPathFromJsonPath(u.path||u[1],this.builder,this.bindingsHolder)})`,l=u.alias||u[2];return l?this.client.alias(h,this.formatter.wrap(l)):h}).join(", ")}_onJsonPathEquals(r,e){return"json_extract_path("+i(e.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(e.jsonPathFirst,this.builder,this.bindingsHolder)+") = json_extract_path("+i(e.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(e.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return al=t,al}var ul,hb;function LE(){if(hb)return ul;hb=1;const a=Jc();class s extends a{uuid(n={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(n)?" primary key default gen_random_uuid()":"")}}return ul=s,ul}var ll,fb;function BE(){if(fb)return ll;fb=1;const a=Yc();class s extends a{constructor(n,t){super(n,t)}addColumns(n,t,o){if(t===this.alterColumnsPrefix)for(const r of o)this.client.logger.warn("Experimental alter column in use, see issue: https://github.com/cockroachdb/cockroach/issues/49329"),this.pushQuery({sql:"SET enable_experimental_alter_column_type_general = true",bindings:[]}),super._addColumn(r);else super.addColumns(n,t)}dropUnique(n,t){t=t?this.formatter.wrap(t):this._indexCommand("unique",this.tableNameRaw,n),this.pushQuery(`drop index ${this.tableName()}@${t} cascade `)}}return ll=s,ll}var cl,db;function ME(){if(db)return cl;db=1;const a=Xc();class s extends a{renameColumn(n,t){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(n,t){throw new Error("change default values of views is not supported by this dialect.")}}return cl=s,cl}var hl,pb;function kE(){if(pb)return hl;pb=1;const a=je(),s=Te();return hl=class extends a{upsert(n,t,o){return this._method="upsert",s(t)||this.returning(t,o),this._single.upsert=n,this}},hl}var fl,mb;function DE(){if(mb)return fl;mb=1;const a=fr(),s=xw(),i=jE(),n=LE(),t=BE(),o=ME(),r=kE();class e extends a{transaction(){return new s(this,...arguments)}queryCompiler(u,h){return new i(this,u,h)}columnCompiler(){return new n(this,...arguments)}tableCompiler(){return new t(this,...arguments)}viewCompiler(){return new o(this,...arguments)}queryBuilder(){return new r(this)}_parseVersion(u){return u.split(" ")[2]}async cancelQuery(u){try{return await this._wrappedCancelQueryCall(null,u)}catch(h){throw this.logger.warn(`Connection Error: ${h}`),h}}_wrappedCancelQueryCall(u,h){if(!(h.activeQuery.processID===0&&h.activeQuery.secretKey===0))return h.cancel(h,h.activeQuery)}toArrayPathFromJsonPath(u,h,l){return u.replace(/^(\$\.)/,"").replace(/\[([0-9]+)]/,".$1").split(".").map((function(f){return this.parameter(f,h,l)}).bind(this)).join(", ")}}return Object.assign(e.prototype,{driverName:"cockroachdb"}),fl=e,fl}var dl,gb;function FE(){if(gb)return dl;gb=1;function a(s){return s==null}return dl=a,dl}var pl,yb;function UE(){if(yb)return pl;yb=1;const a=hr();class s extends a{columnizeWithPrefix(n,t){const o=typeof t=="string"?[t]:t;let r="",e=-1;for(;++e<o.length;)e>0&&(r+=", "),r+=n+this.wrap(o[e]);return r}escapingStringDelimiters(n){return(n||"").replace(/'/g,"''")}}return pl=s,pl}var ml,bb;function QE(){if(bb)return ml;bb=1;const a=Be(),s=Oe()("knex:tx");class i extends a{begin(e){return s("transaction::begin id=%s",this.txid),new Promise((c,u)=>{e.beginTransaction(h=>{if(h)return s("transaction::begin error id=%s message=%s",this.txid,h.message),u(h);c()},this.outerTx?this.txid:void 0,n(this.isolationLevel))}).then(this._resolver,this._rejecter)}savepoint(e){return s("transaction::savepoint id=%s",this.txid),new Promise((c,u)=>{e.saveTransaction(h=>{if(h)return s("transaction::savepoint id=%s message=%s",this.txid,h.message),u(h);this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:this.outerTx?`SAVE TRANSACTION [${this.txid}]`:"SAVE TRANSACTION"}),c()},this.outerTx?this.txid:void 0)})}commit(e,c){return s("transaction::commit id=%s",this.txid),new Promise((u,h)=>{e.commitTransaction(l=>{if(l)return s("transaction::commit error id=%s message=%s",this.txid,l.message),h(l);this._completed=!0,u(c)},this.outerTx?this.txid:void 0)}).then(()=>this._resolver(c),this._rejecter)}release(e,c){return this._resolver(c)}rollback(e,c){return this._completed=!0,s("transaction::rollback id=%s",this.txid),new Promise((u,h)=>{if(!e.inTransaction)return h(c||new Error("Transaction rejected with non-error: undefined"));if(e.state.name!=="LoggedIn")return h(new Error("Can't rollback transaction. There is a request in progress"));e.rollbackTransaction(l=>{l&&s("transaction::rollback error id=%s message=%s",this.txid,l.message),h(l||c||new Error("Transaction rejected with non-error: undefined"))},this.outerTx?this.txid:void 0)}).catch(u=>{if(!c&&this.doNotRejectOnRollback){this._resolver();return}if(c)try{u.originalError=c}catch{}this._rejecter(u)})}rollbackTo(e,c){return this.rollback(e,c).then(()=>{this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:"ROLLBACK TRANSACTION"})})}}ml=i;function n(r){if(!r)return;r=r.toUpperCase().replace(" ","_");const e=t[r];if(!e)throw new Error(`Unknown Isolation level, was expecting one of: ${JSON.stringify(o)}`);return e}const t={READ_UNCOMMITTED:1,READ_COMMITTED:2,REPEATABLE_READ:3,SERIALIZABLE:4,SNAPSHOT:5},o=Object.keys(t).map(r=>r.toLowerCase().replace("_"," "));return ml}var gl,_b;function HE(){if(_b)return gl;_b=1;const a=Ke(),s=zc(),i=Re(),n=Te(),t=lt(),{columnize:o}=qe(),r=["comments","columns","join","lock","where","union","group","having","order","limit","offset"];class e extends a{constructor(u,h,l){super(u,h,l);const{onConflict:f}=this.single;if(f)throw new Error(".onConflict() is not supported for mssql.");this._emptyInsertValue="default values"}with(){const u=[];if(this.grouped.with)for(const l of this.grouped.with)l.recursive&&(u.push(l),l.recursive=!1);const h=super.with();for(const l of u)l.recursive=!0;return h}select(){const u=this.with(),h=r.map(l=>this[l](this));return u+s(h).join(" ")}insert(){return this.single.options&&this.single.options.includeTriggerModifications?this.insertWithTriggers():this.standardInsert()}insertWithTriggers(){const u=this.single.insert||[],{returning:h}=this.single;let l=this.with()+`${this._buildTempTable(h)}insert into ${this.tableName} `;const f=h?this._returning("insert",h,!0)+" ":"";if(Array.isArray(u)){if(u.length===0)return""}else if(typeof u=="object"&&n(u))return{sql:l+f+this._emptyInsertValue+this._buildReturningSelect(h),returning:h};return l+=this._buildInsertData(u,f),h&&(l+=this._buildReturningSelect(h)),{sql:l,returning:h}}_buildInsertData(u,h){let l="";const f=this._prepInsert(u);if(typeof f=="string")l+=f;else if(f.columns.length)l+=`(${this.formatter.columnize(f.columns)}`,l+=`) ${h}values (`+this._buildInsertValues(f)+")";else if(u.length===1&&u[0])l+=h+this._emptyInsertValue;else return"";return l}standardInsert(){const u=this.single.insert||[];let h=this.with()+`insert into ${this.tableName} `;const{returning:l}=this.single,f=l?this._returning("insert",l)+" ":"";if(Array.isArray(u)){if(u.length===0)return""}else if(typeof u=="object"&&n(u))return{sql:h+f+this._emptyInsertValue,returning:l};return h+=this._buildInsertData(u,f),{sql:h,returning:l}}update(){return this.single.options&&this.single.options.includeTriggerModifications?this.updateWithTriggers():this.standardUpdate()}updateWithTriggers(){const u=this.top(),h=this.with(),l=this._prepUpdate(this.single.update),f=this.join(),p=this.where(),w=this.order(),{returning:C}=this.single,m=this._buildTempTable(C);return{sql:h+m+`update ${u?u+" ":""}${this.tableName} set `+l.join(", ")+(C?` ${this._returning("update",C,!0)}`:"")+(f?` from ${this.tableName} ${f}`:"")+(p?` ${p}`:"")+(w?` ${w}`:"")+(C?this._buildReturningSelect(C):this._returning("rowcount","@@rowcount")),returning:C||"@@rowcount"}}_formatGroupsItemValue(u,h){const l=super._formatGroupsItemValue(u);if(h&&!(u instanceof t)){const f=`IIF(${l} is null,`;if(h==="first")return`${f}0,1)`;if(h==="last")return`${f}1,0)`}return l}standardUpdate(){const u=this.top(),h=this.with(),l=this._prepUpdate(this.single.update),f=this.join(),p=this.where(),w=this.order(),{returning:C}=this.single;return{sql:h+`update ${u?u+" ":""}${this.tableName} set `+l.join(", ")+(C?` ${this._returning("update",C)}`:"")+(f?` from ${this.tableName} ${f}`:"")+(p?` ${p}`:"")+(w?` ${w}`:"")+(C?"":this._returning("rowcount","@@rowcount")),returning:C||"@@rowcount"}}del(){return this.single.options&&this.single.options.includeTriggerModifications?this.deleteWithTriggers():this.standardDelete()}deleteWithTriggers(){const u=this.with(),{tableName:h}=this,l=this.where(),f=this.join(),{returning:p}=this.single,w=p?` ${this._returning("del",p,!0)}`:"",C=f?`${h}${w} `:"";return{sql:u+`${this._buildTempTable(p)}delete ${C}from ${h}`+(f?"":w)+(f?` ${f}`:"")+(l?` ${l}`:"")+(p?this._buildReturningSelect(p):this._returning("rowcount","@@rowcount")),returning:p||"@@rowcount"}}standardDelete(){const u=this.with(),{tableName:h}=this,l=this.where(),f=this.join(),{returning:p}=this.single,w=p?` ${this._returning("del",p)}`:"",C=f?`${h}${w} `:"";return{sql:u+`delete ${C}from ${h}`+(f?"":w)+(f?` ${f}`:"")+(l?` ${l}`:"")+(p?"":this._returning("rowcount","@@rowcount")),returning:p||"@@rowcount"}}columns(){let u="";if(this.onlyUnions())return"";const h=this.top(),l=this._hintComments(),f=this.grouped.columns||[];let p=-1,w=[];if(f)for(;++p<f.length;){const m=f[p];if(m.distinct&&(u="distinct "),m.distinctOn){u=this.distinctOn(m.value);continue}m.type==="aggregate"?w.push(...this.aggregate(m)):m.type==="aggregateRaw"?w.push(this.aggregateRaw(m)):m.type==="analytic"?w.push(this.analytic(m)):m.type==="json"?w.push(this.json(m)):m.value&&m.value.length>0&&w.push(this.formatter.columnize(m.value))}return w.length===0&&(w=["*"]),`${this.onlyJson()?"":"select "}${l}${u}`+(h?h+" ":"")+w.join(", ")+(this.tableName?` from ${this.tableName}`:"")}_returning(u,h,l){switch(u){case"update":case"insert":return h?`output ${this.formatter.columnizeWithPrefix("inserted.",h)}${l?" into #out":""}`:"";case"del":return h?`output ${this.formatter.columnizeWithPrefix("deleted.",h)}${l?" into #out":""}`:"";case"rowcount":return h?";select @@rowcount":""}}_buildTempTable(u){if(u&&u.length>0){let h="";Array.isArray(u)?h=u.map(f=>`[t].${this.formatter.columnize(f)}`).join(","):h=`[t].${this.formatter.columnize(u)}`;let l=`select top(0) ${h} into #out `;return l+=`from ${this.tableName} as t `,l+=`left join ${this.tableName} on 0=1;`,l}return""}_buildReturningSelect(u){if(u&&u.length>0){let h="";Array.isArray(u)?h=u.map(f=>`${this.formatter.columnize(f)}`).join(","):h=this.formatter.columnize(u);let l=`; select ${h} from #out; `;return l+="drop table #out;",l}return""}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"with (UPDLOCK)"}forShare(){return"with (HOLDLOCK)"}columnInfo(){const u=this.single.columnInfo;let h=this.single.schema;const l=this.client.customWrapIdentifier(this.single.table,i);h&&(h=this.client.customWrapIdentifier(h,i));let f="select [COLUMN_NAME], [COLUMN_DEFAULT], [DATA_TYPE], [CHARACTER_MAXIMUM_LENGTH], [IS_NULLABLE] from INFORMATION_SCHEMA.COLUMNS where table_name = ? and table_catalog = ?";const p=[l,this.client.database()];return h?(f+=" and table_schema = ?",p.push(h)):f+=" and table_schema = 'dbo'",{sql:f,bindings:p,output(w){const C=w.reduce((m,g)=>(m[g[0].value]={defaultValue:g[1].value,type:g[2].value,maxLength:g[3].value,nullable:g[4].value==="YES"},m),{});return u&&C[u]||C}}}top(){const u=!this.single.limit&&this.single.limit!==0,h=!this.single.offset;return u||!h?"":`top (${this._getValueOrParameterFromAttribute("limit")})`}limit(){return""}offset(){const u=!this.single.limit&&this.single.limit!==0,h=!this.single.offset;if(h)return"";let l=`offset ${h?"0":this._getValueOrParameterFromAttribute("offset")} rows`;return u||(l+=` fetch next ${this._getValueOrParameterFromAttribute("limit")} rows only`),l}whereLike(u){return`${this._columnClause(u)} collate SQL_Latin1_General_CP1_CS_AS ${this._not(u,"like ")}${this._valueClause(u)}`}whereILike(u){return`${this._columnClause(u)} collate SQL_Latin1_General_CP1_CI_AS ${this._not(u,"like ")}${this._valueClause(u)}`}jsonExtract(u){return this._jsonExtract(u.singleValue?"JSON_VALUE":"JSON_QUERY",u)}jsonSet(u){return this._jsonSet("JSON_MODIFY",u)}jsonInsert(u){return this._jsonSet("JSON_MODIFY",u)}jsonRemove(u){const h=`JSON_MODIFY(${o(u.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(u.path,this.builder,this.bindingsHolder)}, NULL)`;return u.alias?this.client.alias(h,this.formatter.wrap(u.alias)):h}whereJsonPath(u){return this._whereJsonPath("JSON_VALUE",u)}whereJsonSupersetOf(u){throw new Error("Json superset where clause not actually supported by MSSQL")}whereJsonSubsetOf(u){throw new Error("Json subset where clause not actually supported by MSSQL")}_getExtracts(u,h){const l=o(u.column,this.builder,this.client,this.bindingsHolder);return(Array.isArray(u.values)?u.values:[u.values]).map(function(f){return"JSON_VALUE("+l+","+this.client.parameter(f,this.builder,this.bindingsHolder)+")"},this).join(h)}onJsonPathEquals(u){return this._onJsonPathEquals("JSON_VALUE",u)}}return gl=e,gl}var yl,wb;function VE(){if(wb)return yl;wb=1;const a=ct();class s extends a{constructor(t,o){super(t,o)}dropTableIfExists(t){const o=this.formatter.wrap(i(this.schema,t));this.pushQuery(`if object_id('${o}', 'U') is not null DROP TABLE ${o}`)}dropViewIfExists(t){const o=this.formatter.wrap(i(this.schema,t));this.pushQuery(`if object_id('${o}', 'V') is not null DROP VIEW ${o}`)}renameTable(t,o){this.pushQuery(`exec sp_rename ${this.client.parameter(i(this.schema,t),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}renameView(t,o){this.pushQuery(`exec sp_rename ${this.client.parameter(i(this.schema,t),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}hasTable(t){const o=this.client.parameter(i(this.schema,t),this.builder,this.bindingsHolder),r=[t];let e=`SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ${o}`;this.schema&&(e+=" AND TABLE_SCHEMA = ?",r.push(this.schema)),this.pushQuery({sql:e,bindings:r,output:c=>c.length>0})}hasColumn(t,o){const r=this.client.parameter(o,this.builder,this.bindingsHolder),e=this.client.parameter(this.formatter.wrap(i(this.schema,t)),this.builder,this.bindingsHolder),c=`select object_id from sys.columns where name = ${r} and object_id = object_id(${e})`;this.pushQuery({sql:c,output:u=>u.length>0})}}s.prototype.dropTablePrefix="DROP TABLE ";function i(n,t){return n?`${n}.${t}`:t}return yl=s,yl}var bl,vb;function WE(){if(vb)return bl;vb=1;const a=ht(),s=Ce(),{isObject:i}=ye();class n extends a{constructor(o,r){super(o,r)}createQuery(o,r,e){let c=r?`if object_id('${this.tableName()}', 'U') is null `:"";e?c+=`SELECT * INTO ${this.tableName()} FROM ${this.tableNameLike()} WHERE 0=1`:c+="CREATE TABLE "+this.tableName()+(this._formatting?` (
79
+ `:" (")+o.sql.join(this._formatting?`,
80
+ `:", ")+this._addChecks()+")",this.pushQuery(c),this.single.comment&&this.comment(this.single.comment),e&&this.addColumns(o,this.addColumnsPrefix)}comment(o){if(!o)return;o.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const r=this.formatter.escapingStringDelimiters(o),e=this.formatter.escapingStringDelimiters(this.schemaNameRaw||"dbo"),c=this.formatter.escapingStringDelimiters(this.tableNameRaw),u=`N'MS_Description', N'${r}', N'Schema', N'${e}', N'Table', N'${c}'`,h=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${e}', N'Table', N'${c}', NULL, NULL))`;this.pushQuery(`IF ${h}
81
+ EXEC sys.sp_updateextendedproperty ${u}
82
+ ELSE
83
+ EXEC sys.sp_addextendedproperty ${u}`)}addColumns(o,r){r=r||this.addColumnsPrefix,o.sql.length>0&&this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+r+o.sql.join(", "),bindings:o.bindings})}alterColumns(o,r){for(let e=0,c=r.length;e<c;e++){const u=r[e];if(u.modified.defaultTo){const l=`
84
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
85
+ FROM sys.all_columns
86
+ INNER JOIN sys.tables
87
+ ON all_columns.object_id = tables.object_id
88
+ INNER JOIN sys.schemas
89
+ ON tables.schema_id = schemas.schema_id
90
+ INNER JOIN sys.default_constraints
91
+ ON all_columns.default_object_id = default_constraints.object_id
92
+ WHERE schemas.name = '${this.schemaNameRaw||"dbo"}'
93
+ AND tables.name = '${this.tableNameRaw}'
94
+ AND all_columns.name = '${u.getColumnName()}')
95
+
96
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(l)}}o.sql.forEach(e=>{this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+(this.lowerCase?this.alterColumnPrefix.toLowerCase():this.alterColumnPrefix)+e,bindings:o.bindings})})}dropColumn(){const o=this,r=s.normalizeArr.apply(null,arguments),c=(Array.isArray(r)?r:[r]).map(h=>o.formatter.wrap(h)),u=this.schemaNameRaw||"dbo";for(const h of r){const l=`
97
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
98
+ FROM sys.all_columns
99
+ INNER JOIN sys.tables
100
+ ON all_columns.object_id = tables.object_id
101
+ INNER JOIN sys.schemas
102
+ ON tables.schema_id = schemas.schema_id
103
+ INNER JOIN sys.default_constraints
104
+ ON all_columns.default_object_id = default_constraints.object_id
105
+ WHERE schemas.name = '${u}'
106
+ AND tables.name = '${this.tableNameRaw}'
107
+ AND all_columns.name = '${h}')
108
+
109
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(l)}this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+this.dropColumnPrefix+c.join(", "))}changeType(){}renameColumn(o,r){this.pushQuery(`exec sp_rename ${this.client.parameter(this.tableName()+"."+o,this.tableBuilder,this.bindingsHolder)}, ${this.client.parameter(r,this.tableBuilder,this.bindingsHolder)}, 'COLUMN'`)}dropFKRefs(o,r){const e=this.client.formatter(this.tableBuilder);return Promise.all(r.map(function(c){const u=e.wrap(c.CONSTRAINT_NAME),h=e.wrap(c.TABLE_NAME);return o.query({sql:`ALTER TABLE ${h} DROP CONSTRAINT ${u}`})}))}createFKRefs(o,r){const e=this.client.formatter(this.tableBuilder);return Promise.all(r.map(function(c){const u=e.wrap(c.TABLE_NAME),h=e.wrap(c.CONSTRAINT_NAME),l=e.columnize(c.COLUMN_NAME),f=e.columnize(c.REFERENCED_COLUMN_NAME),p=e.wrap(c.REFERENCED_TABLE_NAME),w=` ON UPDATE ${c.UPDATE_RULE}`,C=` ON DELETE ${c.DELETE_RULE}`;return o.query({sql:`ALTER TABLE ${u} ADD CONSTRAINT ${h} FOREIGN KEY (`+l+") REFERENCES "+p+" ("+f+")"+w+C})}))}index(o,r,e){r=r?this.formatter.wrap(r):this._indexCommand("index",this.tableNameRaw,o);let c;i(e)&&({predicate:c}=e);const u=c?" "+this.client.queryCompiler(c).where():"";this.pushQuery(`CREATE INDEX ${r} ON ${this.tableName()} (${this.formatter.columnize(o)})${u}`)}primary(o,r){let e;i(r)&&({constraintName:r,deferrable:e}=r),e&&e!=="not deferrable"&&this.client.logger.warn(`mssql: primary key constraint [${r}] will not be deferrable ${e} because mssql does not support deferred constraints.`),r=r?this.formatter.wrap(r):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.forCreate?this.pushQuery(`CONSTRAINT ${r} PRIMARY KEY (${this.formatter.columnize(o)})`):this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${r} PRIMARY KEY (${this.formatter.columnize(o)})`)}unique(o,r){let e,c=!1,u;if(i(r)&&({indexName:r,deferrable:e,useConstraint:c,predicate:u}=r),e&&e!=="not deferrable"&&this.client.logger.warn(`mssql: unique index [${r}] will not be deferrable ${e} because mssql does not support deferred constraints.`),c&&u)throw new Error("mssql cannot create constraint with predicate");if(r=r?this.formatter.wrap(r):this._indexCommand("unique",this.tableNameRaw,o),Array.isArray(o)||(o=[o]),c)this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${r} UNIQUE (${this.formatter.columnize(o)})`);else{const h=u?" "+this.client.queryCompiler(u).where():" WHERE "+o.map(l=>this.formatter.columnize(l)+" IS NOT NULL").join(" AND ");this.pushQuery(`CREATE UNIQUE INDEX ${r} ON ${this.tableName()} (${this.formatter.columnize(o)})${h}`)}}dropIndex(o,r){r=r?this.formatter.wrap(r):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${r} ON ${this.tableName()}`)}dropForeign(o,r){r=r?this.formatter.wrap(r):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${r}`)}dropPrimary(o){o=o?this.formatter.wrap(o):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${o}`)}dropUnique(o,r){r=r?this.formatter.wrap(r):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${r} ON ${this.tableName()}`)}}return n.prototype.createAlterTableMethods=["foreign","primary"],n.prototype.lowerCase=!1,n.prototype.addColumnsPrefix="ADD ",n.prototype.dropColumnPrefix="DROP COLUMN ",n.prototype.alterColumnPrefix="ALTER COLUMN ",bl=n,bl}var _l,Cb;function GE(){if(Cb)return _l;Cb=1;const a=ft(),{columnize:s}=qe();class i extends a{constructor(t,o){super(t,o)}createQuery(t,o,r,e){let u="CREATE "+(e?"OR ALTER ":"")+"VIEW "+this.viewName();const h=t?" ("+s(t,this.viewBuilder,this.client,this.bindingsHolder)+")":"";u+=h,u+=" AS ",u+=o.toString(),this.pushQuery({sql:u})}renameColumn(t,o){this.pushQuery(`exec sp_rename ${this.client.parameter(this.viewName()+"."+t,this.viewBuilder,this.bindingsHolder)}, ${this.client.parameter(o,this.viewBuilder,this.bindingsHolder)}, 'COLUMN'`)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return _l=i,_l}var wl,qb;function zE(){if(qb)return wl;qb=1;const a=Je(),{toNumber:s}=Ce(),{formatDefault:i}=Ge(),{operator:n}=qe();class t extends a{constructor(r,e,c){super(r,e,c),this.modifiers=["nullable","defaultTo","first","after","comment"],this._addCheckModifiers()}double(r,e){return"float"}floating(r,e){return"float"}integer(){return"int"}tinyint(){return"tinyint"}varchar(r){return`nvarchar(${s(r,255)})`}timestamp({useTz:r=!1}={}){return r?"datetimeoffset":"datetime2"}bit(r){return r>1&&this.client.logger.warn("Bit field is exactly 1 bit length for MSSQL"),"bit"}binary(r){return r?`varbinary(${s(r)})`:"varbinary(max)"}first(){return this.client.logger.warn("Column first modifier not available for MSSQL"),""}after(r){return this.client.logger.warn("Column after modifier not available for MSSQL"),""}defaultTo(r,{constraintName:e}={}){const c=i(r,this.type,this.client);return e=typeof e<"u"?e:`${this.tableCompiler.tableNameRaw}_${this.getColumnName()}_default`.toLowerCase(),this.columnBuilder._method==="alter"?(this.pushAdditional(function(){this.pushQuery(`ALTER TABLE ${this.tableCompiler.tableName()} ADD CONSTRAINT ${this.formatter.wrap(e)} DEFAULT ${c} FOR ${this.formatter.wrap(this.getColumnName())}`)}),""):e?`CONSTRAINT ${this.formatter.wrap(e)} DEFAULT ${c}`:`DEFAULT ${c}`}comment(r){if(!r)return;r&&r.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const e=this.formatter.escapingStringDelimiters(r),c=this.tableCompiler.schemaNameRaw||"dbo",u=this.formatter.escapingStringDelimiters(this.tableCompiler.tableNameRaw),h=this.formatter.escapingStringDelimiters(this.args[0]||this.defaults("columnName")),l=`N'MS_Description', N'${e}', N'Schema', N'${c}', N'Table', N'${u}', N'Column', N'${h}'`;return this.pushAdditional(function(){const f=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${c}', N'Table', N'${u}', N'Column', N'${h}'))`;this.pushQuery(`IF ${f}
110
+ EXEC sys.sp_updateextendedproperty ${l}
111
+ ELSE
112
+ EXEC sys.sp_addextendedproperty ${l}`)}),""}checkLength(r,e,c){return this._check(`LEN(${this.formatter.wrap(this.getColumnName())}) ${n(r,this.columnBuilder,this.bindingsHolder)} ${s(e)}`,c)}checkRegex(r,e){return this._check(`${this.formatter.wrap(this.getColumnName())} LIKE ${this.client._escapeBinding("%"+r+"%")}`,e)}increments(r={primaryKey:!0}){return"int identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(r)?" primary key":"")}bigincrements(r={primaryKey:!0}){return"bigint identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(r)?" primary key":"")}}return t.prototype.bigint="bigint",t.prototype.mediumint="int",t.prototype.smallint="smallint",t.prototype.text="nvarchar(max)",t.prototype.mediumtext="nvarchar(max)",t.prototype.longtext="nvarchar(max)",t.prototype.json=t.prototype.jsonb="nvarchar(max)",t.prototype.enu="nvarchar(100)",t.prototype.uuid=({useBinaryUuid:o=!1}={})=>o?"binary(16)":"uniqueidentifier",t.prototype.datetime="datetime2",t.prototype.bool="bit",wl=t,wl}var vl,Eb;function KE(){if(Eb)return vl;Eb=1;const a=ze(),s=FE(),i=Ye(),n=UE(),t=QE(),o=HE(),r=VE(),e=WE(),c=GE(),u=zE(),h=je(),{setHiddenProperty:l}=kc(),f=Oe()("knex:mssql"),p={MIN:-2147483648,MAX:2147483647},w={MIN:-9007199254740991,MAX:9007199254740991};class C extends i{constructor(g={}){super(g)}_generateConnection(){const g=this.connectionSettings;g.options=g.options||{};const d={authentication:{type:g.type||"default",options:{userName:g.userName||g.user,password:g.password,domain:g.domain,token:g.token,clientId:g.clientId,clientSecret:g.clientSecret,tenantId:g.tenantId,msiEndpoint:g.msiEndpoint}},server:g.server||g.host,options:{database:g.database,encrypt:g.encrypt||!1,port:g.port||1433,connectTimeout:g.connectionTimeout||g.timeout||15e3,requestTimeout:s(g.requestTimeout)?15e3:g.requestTimeout,rowCollectionOnDone:!1,rowCollectionOnRequestCompletion:!1,useColumnNames:!1,tdsVersion:g.options.tdsVersion||"7_4",appName:g.options.appName||"knex",trustServerCertificate:!1,...g.options}};return d.authentication.options.password&&l(d.authentication.options),d.options.instanceName&&delete d.options.port,isNaN(d.options.requestTimeout)&&(d.options.requestTimeout=15e3),d.options.requestTimeout===1/0&&(d.options.requestTimeout=0),d.options.requestTimeout<0&&(d.options.requestTimeout=0),g.debug&&(d.options.debug={packet:!0,token:!0,data:!0,payload:!0}),d}_driver(){return ve}formatter(){return new n(this,...arguments)}transaction(){return new t(this,...arguments)}queryCompiler(){return new o(this,...arguments)}schemaCompiler(){return new r(this,...arguments)}tableCompiler(){return new e(this,...arguments)}viewCompiler(){return new c(this,...arguments)}queryBuilder(){return new h(this)}columnCompiler(){return new u(this,...arguments)}wrapIdentifierImpl(g){return g==="*"?"*":`[${g.replace(/[[\]]+/g,"")}]`}acquireRawConnection(){return new Promise((g,d)=>{f("connection::connection new connection requested");const b=this._driver(),_=Object.assign({},this._generateConnection()),q=new b.Connection(_);q.connect(E=>E?(f("connection::connect error: %s",E.message),d(E)):(f("connection::connect connected to server"),q.connected=!0,q.on("error",R=>{f("connection::error message=%s",R.message),q.__knex__disposed=R,q.connected=!1}),q.once("end",()=>{q.connected=!1,q.__knex__disposed="Connection to server was terminated.",f("connection::end connection ended.")}),g(q)))})}validateConnection(g){return g&&g.connected}destroyRawConnection(g){return f("connection::destroy"),new Promise(d=>{g.once("end",()=>{d()}),g.close()})}positionBindings(g){let d=-1;return g.replace(/\\?\?/g,b=>b==="\\?"?"?":(d+=1,`@p${d}`))}_chomp(g){if(g.state.name==="LoggedIn"){const d=this.requestQueue.pop();d&&(f("connection::query executing query, %d more in queue",this.requestQueue.length),g.execSql(d))}}_enqueueRequest(g,d){this.requestQueue.push(g),this._chomp(d)}_makeRequest(g,d){const b=this._driver(),_=typeof g=="string"?g:g.sql;let q=0;if(!_)throw new Error("The query is empty");f("request::request sql=%s",_);const E=new b.Request(_,(R,$)=>{if(R)return f("request::error message=%s",R.message),d(R);q=$,f("request::callback rowCount=%d",q)});return E.on("prepared",()=>{f("request %s::request prepared",this.id)}),E.on("done",(R,$)=>{f("request::done rowCount=%d more=%s",R,$)}),E.on("doneProc",(R,$)=>{f("request::doneProc id=%s rowCount=%d more=%s",E.id,R,$)}),E.on("doneInProc",(R,$)=>{f("request::doneInProc id=%s rowCount=%d more=%s",E.id,R,$)}),E.once("requestCompleted",()=>(f("request::completed id=%s",E.id),d(null,q))),E.on("error",R=>(f("request::error id=%s message=%s",E.id,R.message),d(R))),E}_stream(g,d,b){return new Promise((_,q)=>{const E=this._makeRequest(d,R=>{if(R)return b.emit("error",R),q(R);_()});E.on("row",R=>{b.write(R.reduce(($,M)=>({...$,[M.metadata.colName]:M.value}),{}))}),E.on("error",R=>{b.emit("error",R),q(R)}),E.once("requestCompleted",()=>{b.end(),_()}),this._assignBindings(E,d.bindings),this._enqueueRequest(E,g)})}_assignBindings(g,d){if(Array.isArray(d))for(let b=0;b<d.length;b++){const _=d[b];this._setReqInput(g,b,_)}}_scaleForBinding(g){if(g%1===0)throw new Error(`The binding value ${g} must be a decimal number.`);return{scale:10}}_typeForBinding(g){const d=this._driver();if(this.connectionSettings.options&&this.connectionSettings.options.mapBinding){const b=this.connectionSettings.options.mapBinding(g);if(b)return[b.value,b.type]}switch(typeof g){case"string":return[g,d.TYPES.NVarChar];case"boolean":return[g,d.TYPES.Bit];case"number":{if(g%1!==0)return[g,d.TYPES.Float];if(g<p.MIN||g>p.MAX){if(g<w.MIN||g>w.MAX)throw new Error(`Bigint must be safe integer or must be passed as string, saw ${g}`);return[g,d.TYPES.BigInt]}return[g,d.TYPES.Int]}default:return g instanceof Date?[g,d.TYPES.DateTime]:g instanceof Buffer?[g,d.TYPES.VarBinary]:[g,d.TYPES.NVarChar]}}_query(g,d){return new Promise((b,_)=>{const q=[],E=this._makeRequest(d,(R,$)=>{if(R)return _(R);d.response=q,pe.nextTick(()=>this._chomp(g)),b(d)});E.on("row",R=>{f("request::row"),q.push(R)}),this._assignBindings(E,d.bindings),this._enqueueRequest(E,g)})}_setReqInput(g,d,b){const[_,q]=this._typeForBinding(b),E="p".concat(d);let R;typeof _=="number"&&_%1!==0&&(R=this._scaleForBinding(_)),f("request::binding pos=%d type=%s value=%s",d,q.name,_),Buffer.isBuffer(_)&&(R={length:"max"}),g.addParameter(E,q,_,R)}processResponse(g,d){if(g==null)return;let{response:b}=g;const{method:_}=g;if(g.output||(b=b.map(q=>q.reduce((E,R)=>{const $=R.metadata.colName;return E[$]?(Array.isArray(E[$])||(E[$]=[E[$]]),E[$].push(R.value)):E[$]=R.value,E},{})),g.output))return g.output.call(d,b);switch(_){case"select":return b;case"first":return b[0];case"pluck":return a(b,g.pluck);case"insert":case"del":case"update":case"counter":return g.returning&&g.returning==="@@rowcount"?b[0][""]:b;default:return b}}}return Object.assign(C.prototype,{requestQueue:[],dialect:"mssql",driverName:"mssql"}),vl=C,vl}var Cl,Ab;function JE(){if(Ab)return Cl;Ab=1;var a="Expected a function";function s(i,n,t){if(typeof i!="function")throw new TypeError(a);return setTimeout(function(){i.apply(void 0,t)},n)}return Cl=s,Cl}var ql,Rb;function YE(){if(Rb)return ql;Rb=1;var a=JE(),s=Bc(),i=s(function(n,t){return a(n,1,t)});return ql=i,ql}var El,Tb;function XE(){if(Tb)return El;Tb=1;const a=Be(),i=Oe()("knex:tx");class n extends a{query(o,r,e,c){const u=this,h=this.trxClient.query(o,r).catch(l=>{if(l.errno===1305){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}e=2,c=l,u._completed=!0,i("%s error running transaction query",u.txid)}).then(function(l){if(e===1&&u._resolver(c),e===2){if(c===void 0){if(u.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(r)){u._resolver();return}c=new Error(`Transaction rejected with non-error: ${c}`)}u._rejecter(c)}return l});return(e===1||e===2)&&(u._completed=!0),h}}return El=n,El}var Al,Sb;function ZE(){if(Sb)return Al;Sb=1;const a=je(),s=Te();return Al=class extends a{upsert(n,t,o){return this._method="upsert",s(t)||this.returning(t,o),this._single.upsert=n,this}},Al}var Rl,Ob;function eA(){if(Ob)return Rl;Ob=1;const a=tt(),s=Re(),i=Le(),n=Te(),t=Ke(),{wrapAsIdentifier:o}=Ge(),{columnize:r,wrap:e}=qe(),c=h=>i(h)||Array.isArray(h);class u extends t{constructor(l,f,p){super(l,f,p);const{returning:w}=this.single;w&&this.client.logger.warn(".returning() is not supported by mysql and will not have any effect."),this._emptyInsertValue="() values ()"}del(){const l=super.del();if(l==="")return l;const f=this.comments();return(f===""?"":f+" ")+l}insert(){let l=super.insert();if(l==="")return l;const f=this.comments();l=(f===""?"":f+" ")+l;const{ignore:p,merge:w,insert:C}=this.single;if(p&&(l=l.replace("insert into","insert ignore into")),w&&(l+=this._merge(w.updates,C),this.where()))throw new Error(".onConflict().merge().where() is not supported for mysql");return l}upsert(){const l=this.single.upsert||[],f=this.with()+`replace into ${this.tableName} `,p=this._insertBody(l);return p===""?"":f+p}_merge(l,f){const p=" on duplicate key update ";if(l&&Array.isArray(l))return p+l.map(w=>o(w,this.formatter.builder,this.client)).map(w=>`${w} = values(${w})`).join(", ");if(l&&typeof l=="object"){const w=this._prepUpdate(l);return p+w.join(",")}else{const w=this._prepInsert(f);if(typeof w=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return p+w.columns.map(C=>o(C,this.builder,this.client)).map(C=>`${C} = values(${C})`).join(", ")}}update(){const l=this.comments(),f=this.with(),p=this.join(),w=this._prepUpdate(this.single.update),C=this.where(),m=this.order(),g=this.limit();return(l===""?"":l+" ")+f+`update ${this.tableName}`+(p?` ${p}`:"")+" set "+w.join(", ")+(C?` ${C}`:"")+(m?` ${m}`:"")+(g?` ${g}`:"")}forUpdate(){return"for update"}forShare(){return"lock in share mode"}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const l=this.single.columnInfo;return{sql:"select * from information_schema.columns where table_name = ? and table_schema = ?",bindings:[this.client.customWrapIdentifier(this.single.table,s),this.client.database()],output(p){const w=p.reduce(function(C,m){return C[m.COLUMN_NAME]={defaultValue:m.COLUMN_DEFAULT==="NULL"?null:m.COLUMN_DEFAULT,type:m.DATA_TYPE,maxLength:m.CHARACTER_MAXIMUM_LENGTH,nullable:m.IS_NULLABLE==="YES"},C},{});return l&&w[l]||w}}}limit(){const l=!this.single.limit&&this.single.limit!==0;return l&&!this.single.offset?"":`limit ${this.single.offset&&l?"18446744073709551615":this._getValueOrParameterFromAttribute("limit")}`}whereBasic(l){return a(!c(l.value),"The values in where clause must not be object or array."),super.whereBasic(l)}whereRaw(l){return a(n(l.value.bindings)||!Object.values(l.value.bindings).some(c),"The values in where clause must not be object or array."),super.whereRaw(l)}whereLike(l){return`${this._columnClause(l)} ${this._not(l,"like ")}${this._valueClause(l)} COLLATE utf8_bin`}whereILike(l){return`${this._columnClause(l)} ${this._not(l,"like ")}${this._valueClause(l)}`}jsonExtract(l){return this._jsonExtract(["json_extract","json_unquote"],l)}jsonSet(l){return this._jsonSet("json_set",l)}jsonInsert(l){return this._jsonSet("json_insert",l)}jsonRemove(l){const f=`json_remove(${r(l.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(l.path,this.builder,this.bindingsHolder)})`;return l.alias?this.client.alias(f,this.formatter.wrap(l.alias)):f}whereJsonObject(l){return this._not(l,`json_contains(${this._columnClause(l)}, ${this._jsonValueClause(l)})`)}whereJsonPath(l){return this._whereJsonPath("json_extract",l)}whereJsonSupersetOf(l){return this._not(l,`json_contains(${e(l.column,void 0,this.builder,this.client,this.bindingsHolder)},${this._jsonValueClause(l)})`)}whereJsonSubsetOf(l){return this._not(l,`json_contains(${this._jsonValueClause(l)},${e(l.column,void 0,this.builder,this.client,this.bindingsHolder)})`)}onJsonPathEquals(l){return this._onJsonPathEquals("json_extract",l)}}return Rl=u,Rl}var Tl,Nb;function tA(){if(Nb)return Tl;Nb=1;const a=ct();class s extends a{constructor(n,t){super(n,t)}renameTable(n,t){this.pushQuery(`rename table ${this.formatter.wrap(n)} to ${this.formatter.wrap(t)}`)}renameView(n,t){this.renameTable(n,t)}hasTable(n){let t="select * from information_schema.tables where table_name = ?";const o=[n];this.schema?(t+=" and table_schema = ?",o.push(this.schema)):t+=" and table_schema = database()",this.pushQuery({sql:t,bindings:o,output:function(e){return e.length>0}})}hasColumn(n,t){this.pushQuery({sql:`show columns from ${this.formatter.wrap(n)}`,output(o){return o.some(r=>this.client.wrapIdentifier(r.Field.toLowerCase())===this.client.wrapIdentifier(t.toLowerCase()))}})}}return Tl=s,Tl}var Sl,Ib;function rA(){if(Ib)return Sl;Ib=1;const a=ht(),{isObject:s,isString:i}=ye();class n extends a{constructor(o,r){super(o,r)}createQuery(o,r,e){const c=r?"create table if not exists ":"create table ",{client:u}=this;let h={},l=" ("+o.sql.join(", ");l+=this.primaryKeys()||"",l+=this._addChecks(),l+=")";let f=c+this.tableName()+(e&&this.tableNameLike()?" like "+this.tableNameLike():l);u.connectionSettings&&(h=u.connectionSettings);const p=this.single.charset||h.charset||"",w=this.single.collate||h.collate||"",C=this.single.engine||"";if(p&&!e&&(f+=` default character set ${p}`),w&&(f+=` collate ${w}`),C&&(f+=` engine = ${C}`),this.single.comment){const m=this.single.comment||"",g=1024;m.length>g&&this.client.logger.warn(`The max length for a table comment is ${g} characters`),f+=` comment = '${m}'`}this.pushQuery(f),e&&this.addColumns(o,this.addColumnsPrefix)}comment(o){this.pushQuery(`alter table ${this.tableName()} comment = '${o}'`)}changeType(){}renameColumn(o,r){const e=this,c=this.tableName(),u=this.formatter.wrap(o)+" "+this.formatter.wrap(r);this.pushQuery({sql:`show full fields from ${c} where field = `+this.client.parameter(o,this.tableBuilder,this.bindingsHolder),output(h){const l=h[0],f=this;return e.getFKRefs(f).then(([p])=>new Promise((w,C)=>{try{p.length||w(),w(e.dropFKRefs(f,p))}catch(m){C(m)}}).then(function(){let w=`alter table ${c} change ${u} ${l.Type}`;return String(l.Null).toUpperCase()!=="YES"?w+=" NOT NULL":w+=" NULL",l.Default!==void 0&&l.Default!==null&&(w+=` DEFAULT '${l.Default}'`),l.Collation!==void 0&&l.Collation!==null&&(w+=` COLLATE '${l.Collation}'`),l.Extra=="auto_increment"&&(w+=" AUTO_INCREMENT"),f.query({sql:w})}).then(function(){if(p.length)return e.createFKRefs(f,p.map(function(w){return w.REFERENCED_COLUMN_NAME===o&&(w.REFERENCED_COLUMN_NAME=r),w.COLUMN_NAME===o&&(w.COLUMN_NAME=r),w}))}))}})}primaryKeys(){const o=(this.grouped.alterTable||[]).filter(r=>r.method==="primary");if(o.length>0&&o[0].args.length>0){const r=o[0].args[0];let e=o[0].args[1]||"";if(e&&(e=" constraint "+this.formatter.wrap(e)),this.grouped.columns){const c=this._getIncrementsColumnNames();c.length&&c.forEach(h=>{r.includes(h)||r.unshift(h)});const u=this._getBigIncrementsColumnNames();u.length&&u.forEach(h=>{r.includes(h)||r.unshift(h)})}return`,${e} primary key (${this.formatter.columnize(r)})`}}getFKRefs(o){const r={bindings:[]},e="SELECT KCU.CONSTRAINT_NAME, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC USING(CONSTRAINT_NAME)WHERE KCU.REFERENCED_TABLE_NAME = "+this.client.parameter(this.tableNameRaw,this.tableBuilder,r)+" AND KCU.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,r)+" AND RC.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,r);return o.query({sql:e,bindings:r.bindings})}dropFKRefs(o,r){const e=this.client.formatter(this.tableBuilder);return Promise.all(r.map(function(c){const u=e.wrap(c.CONSTRAINT_NAME),h=e.wrap(c.TABLE_NAME);return o.query({sql:`alter table ${h} drop foreign key ${u}`})}))}createFKRefs(o,r){const e=this.client.formatter(this.tableBuilder);return Promise.all(r.map(function(c){const u=e.wrap(c.TABLE_NAME),h=e.wrap(c.CONSTRAINT_NAME),l=e.columnize(c.COLUMN_NAME),f=e.columnize(c.REFERENCED_COLUMN_NAME),p=e.wrap(c.REFERENCED_TABLE_NAME),w=` ON UPDATE ${c.UPDATE_RULE}`,C=` ON DELETE ${c.DELETE_RULE}`;return o.query({sql:`alter table ${u} add constraint ${h} foreign key (`+l+") references "+p+" ("+f+")"+w+C})}))}index(o,r,e){let c,u;i(e)?u=e:s(e)&&({indexType:u,storageEngineIndexType:c}=e),r=r?this.formatter.wrap(r):this._indexCommand("index",this.tableNameRaw,o),c=c?` using ${c}`:"",this.pushQuery(`alter table ${this.tableName()} add${u?` ${u}`:""} index ${r}(${this.formatter.columnize(o)})${c}`)}primary(o,r){let e;s(r)&&({constraintName:r,deferrable:e}=r),e&&e!=="not deferrable"&&this.client.logger.warn(`mysql: primary key constraint \`${r}\` will not be deferrable ${e} because mysql does not support deferred constraints.`),r=r?this.formatter.wrap(r):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const c=o;let u=[],h=[];this.grouped.columns&&(u=this._getIncrementsColumnNames(),u&&u.forEach(l=>{c.includes(l)||c.unshift(l)}),h=this._getBigIncrementsColumnNames(),h&&h.forEach(l=>{c.includes(l)||c.unshift(l)})),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add primary key ${r}(${this.formatter.columnize(c)})`),u.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(u)} int unsigned not null auto_increment`),h.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(h)} bigint unsigned not null auto_increment`)}unique(o,r){let e,c;s(r)&&({indexName:r,deferrable:c,storageEngineIndexType:e}=r),c&&c!=="not deferrable"&&this.client.logger.warn(`mysql: unique index \`${r}\` will not be deferrable ${c} because mysql does not support deferred constraints.`),r=r?this.formatter.wrap(r):this._indexCommand("unique",this.tableNameRaw,o),e=e?` using ${e}`:"",this.pushQuery(`alter table ${this.tableName()} add unique ${r}(${this.formatter.columnize(o)})${e}`)}dropIndex(o,r){r=r?this.formatter.wrap(r):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${r}`)}dropForeign(o,r){r=r?this.formatter.wrap(r):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop foreign key ${r}`)}dropPrimary(){this.pushQuery(`alter table ${this.tableName()} drop primary key`)}dropUnique(o,r){r=r?this.formatter.wrap(r):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${r}`)}}return n.prototype.addColumnsPrefix="add ",n.prototype.alterColumnsPrefix="modify ",n.prototype.dropColumnPrefix="drop ",Sl=n,Sl}var Ol,$b;function nA(){if($b)return Ol;$b=1;const a=Je(),{isObject:s}=ye(),{toNumber:i}=Ce(),n=new RegExp("(?<!\\\\)'","g");class t extends a{constructor(r,e,c){super(r,e,c),this.modifiers=["unsigned","nullable","defaultTo","comment","collate","first","after"],this._addCheckModifiers()}double(r,e){return r?`double(${i(r,8)}, ${i(e,2)})`:"double"}integer(r){return r=r?`(${i(r,11)})`:"",`int${r}`}tinyint(r){return r=r?`(${i(r,1)})`:"",`tinyint${r}`}text(r){switch(r){case"medium":case"mediumtext":return"mediumtext";case"long":case"longtext":return"longtext";default:return"text"}}mediumtext(){return this.text("medium")}longtext(){return this.text("long")}enu(r){return`enum('${r.join("', '")}')`}datetime(r){return s(r)&&({precision:r}=r),typeof r=="number"?`datetime(${r})`:"datetime"}timestamp(r){return s(r)&&({precision:r}=r),typeof r=="number"?`timestamp(${r})`:"timestamp"}time(r){return s(r)&&({precision:r}=r),typeof r=="number"?`time(${r})`:"time"}bit(r){return r?`bit(${i(r)})`:"bit"}binary(r){return r?`varbinary(${i(r)})`:"blob"}json(){return"json"}jsonb(){return"json"}defaultTo(r){if(r==null)return;if((this.type==="json"||this.type==="jsonb")&&s(r))return`default ('${JSON.stringify(r)}')`;const e=super.defaultTo.apply(this,arguments);return this.type!=="blob"&&this.type.indexOf("text")===-1?e:""}unsigned(){return"unsigned"}comment(r){return r&&r.length>255&&this.client.logger.warn("Your comment is longer than the max comment length for MySQL"),r&&`comment '${r.replace(n,"\\'")}'`}first(){return"first"}after(r){return`after ${this.formatter.wrap(r)}`}collate(r){return r&&`collate '${r}'`}checkRegex(r,e){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(r)}`,e)}increments(r={primaryKey:!0}){return"int unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(r)?" auto_increment primary key":"")}bigincrements(r={primaryKey:!0}){return"bigint unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(r)?" auto_increment primary key":"")}}return t.prototype.bigint="bigint",t.prototype.mediumint="mediumint",t.prototype.smallint="smallint",Ol=t,Ol}var Nl,xb;function iA(){if(xb)return Nl;xb=1;const a=ft();class s extends a{constructor(n,t){super(n,t)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return Nl=s,Nl}var Il,Pb;function sA(){if(Pb)return Il;Pb=1;const a=St();class s extends a{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return Il=s,Il}var $l,jb;function jw(){if(jb)return $l;jb=1;const a=YE(),s=ze(),{promisify:i}=Ee(),n=Ye(),t=XE(),o=ZE(),r=eA(),e=tA(),c=rA(),u=nA(),{makeEscape:h}=Ac(),l=iA(),f=sA();class p extends n{_driver(){return ve}queryBuilder(){return new o(this)}queryCompiler(C,m){return new r(this,C,m)}schemaCompiler(){return new e(this,...arguments)}tableCompiler(){return new c(this,...arguments)}viewCompiler(){return new l(this,...arguments)}viewBuilder(){return new f(this,...arguments)}columnCompiler(){return new u(this,...arguments)}transaction(){return new t(this,...arguments)}wrapIdentifierImpl(C){return C!=="*"?`\`${C.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((C,m)=>{const g=this.driver.createConnection(this.connectionSettings);g.on("error",d=>{g.__knex__disposed=d}),g.connect(d=>{if(d)return g.removeAllListeners(),m(d);C(g)})})}async destroyRawConnection(C){try{return await i(g=>C.end(g))()}catch(m){C.__knex__disposed=m}finally{a(()=>C.removeAllListeners())}}validateConnection(C){return C.state==="connected"||C.state==="authenticated"}_stream(C,m,g,d){if(!m.sql)throw new Error("The query is empty");d=d||{};const b=Object.assign({sql:m.sql},m.options);return new Promise((_,q)=>{g.on("error",q),g.on("end",_);const E=C.query(b,m.bindings).stream(d);E.on("error",R=>{q(R),g.emit("error",R)}),E.pipe(g)})}_query(C,m){if((!m||typeof m=="string")&&(m={sql:m}),!m.sql)throw new Error("The query is empty");return new Promise(function(g,d){if(!m.sql){g();return}const b=Object.assign({sql:m.sql},m.options);C.query(b,m.bindings,function(_,q,E){if(_)return d(_);m.response=[q,E],g(m)})})}processResponse(C,m){if(C==null)return;const{response:g}=C,{method:d}=C,b=g[0],_=g[1];if(C.output)return C.output.call(m,b,_);switch(d){case"select":return b;case"first":return b[0];case"pluck":return s(b,C.pluck);case"insert":return[b.insertId];case"del":case"update":case"counter":return b.affectedRows;default:return g}}async cancelQuery(C){const m=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(m,C)}finally{await this.destroyRawConnection(m),m.__knex__disposed&&this.logger.warn(`Connection Error: ${m.__knex__disposed}`)}}_wrappedCancelQueryCall(C,m){return this._query(C,{sql:"KILL QUERY ?",bindings:[m.threadId],options:{}})}}return Object.assign(p.prototype,{dialect:"mysql",driverName:"mysql",_escapeBinding:h(),canCancelQuery:!0}),$l=p,$l}var xl,Lb;function oA(){if(Lb)return xl;Lb=1;const a=Be(),s=Oe()("knex:tx");class i extends a{query(t,o,r,e){const c=this,u=this.trxClient.query(t,o).catch(h=>{if(h.code==="ER_SP_DOES_NOT_EXIST"){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}r=2,e=h,c._completed=!0,s("%s error running transaction query",c.txid)}).then(function(h){if(r===1&&c._resolver(e),r===2){if(e===void 0){if(c.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(o)){c._resolver();return}e=new Error(`Transaction rejected with non-error: ${e}`)}return c._rejecter(e),h}});return(r===1||r===2)&&(c._completed=!0),u}}return xl=i,xl}var Pl,Bb;function aA(){if(Bb)return Pl;Bb=1;const a=jw(),s=oA();class i extends a{transaction(){return new s(this,...arguments)}_driver(){return ve}initializeDriver(){try{this.driver=this._driver()}catch(t){let o=`Knex: run
113
+ $ npm install ${this.driverName}`;throw pe.version.replace(/^v/,"").split(".")[0]<=12&&(o+="@3.2.0",this.logger.error("Mysql2 version 3.2.0 is the latest version to support Node.js 12 or lower.")),o+=" --save",this.logger.error(`${o}
114
+ ${t.message}
115
+ ${t.stack}`),new Error(`${o}
116
+ ${t.message}`)}}validateConnection(t){return t&&!t._fatalError&&!t._protocolError&&!t._closing&&!t.stream.destroyed}}return Object.assign(i.prototype,{driverName:"mysql2"}),Pl=i,Pl}var jl,Mb;function Me(){if(Mb)return jl;Mb=1;class a{constructor(o){this.oracleVersion=o;const r=o.split(".").map(e=>parseInt(e));r[0]>12||r[0]===12&&r[1]>=2?this.limit=128:this.limit=30}generateCombinedName(o,r,e,c){const u=ve;Array.isArray(c)||(c=c?[c]:[]);const h=e.replace(/\.|-/g,"_"),l=c.join("_");let f=`${h}_${l.length?l+"_":""}${r}`.toLowerCase();return f.length>this.limit&&(o.warn(`Automatically generated name "${f}" exceeds ${this.limit} character limit for Oracle Database ${this.oracleVersion}. Using base64 encoded sha1 of that name instead.`),f=u.createHash("sha1").update(f).digest("base64").replace("=","")),f}}function s(t,o){return`begin execute immediate '${t.replace(/'/g,"''")}'; exception when others then if sqlcode != ${o} then raise; end if; end;`}function i(t){this.columnName=t}i.prototype.toString=function(){return`[object ReturningHelper:${this.columnName}]`};function n(t){return["DPI-1010","DPI-1080","ORA-03114","ORA-03113","ORA-03135","ORA-12514","ORA-00022","ORA-00028","ORA-00031","ORA-00045","ORA-00378","ORA-00602","ORA-00603","ORA-00609","ORA-01012","ORA-01041","ORA-01043","ORA-01089","ORA-01092","ORA-02396","ORA-03122","ORA-12153","ORA-12537","ORA-12547","ORA-12570","ORA-12583","ORA-27146","ORA-28511","ORA-56600","NJS-024","NJS-003"].some(function(o){return t.message.indexOf(o)===0})}return jl={NameHelper:a,isConnectionError:n,wrapSqlWithCatch:s,ReturningHelper:i},jl}var Ll,kb;function Zc(){if(kb)return Ll;kb=1;const{NameHelper:a}=Me();class s{constructor(n){this.nameHelper=new a(n)}renameColumnTrigger(n,t,o,r){const e=this.nameHelper.generateCombinedName(n,"autoinc_trg",t),c=this.nameHelper.generateCombinedName(n,"seq",t);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('ALTER TABLE "${t}" RENAME COLUMN "${o}" TO "${r}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${e}'; IF (IS_AUTOINC > 0) THEN SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${t}'; IF ('${r}' = PK_NAME) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${e}"'); EXECUTE IMMEDIATE ('create or replace trigger "${e}" BEFORE INSERT on "${t}" for each row declare checking number := 1; begin if (:new."${r}" is null) then while checking >= 1 loop select "${c}".nextval into :new."${r}" from dual; select count("${r}") into checking from "${t}" where "${r}" = :new."${r}"; end loop; end if; end;'); end if; end if;END;`}createAutoIncrementTrigger(n,t,o){const r=`"${t}"`,e=t,c=o?`"${o}".`:"",u=o?`'${o}'`:"cols.owner",h=this.nameHelper.generateCombinedName(n,"autoinc_trg",t),f=`"${this.nameHelper.generateCombinedName(n,"seq",t)}"`;return`DECLARE PK_NAME VARCHAR(200); BEGIN EXECUTE IMMEDIATE ('CREATE SEQUENCE ${c}${f}'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = ${u} AND cols.table_name = '${e}'; execute immediate ('create or replace trigger ${c}"${h}" BEFORE INSERT on ${c}${r} for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select ${c}${f}.nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from ${c}${r} where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); END;`}renameTableAndAutoIncrementTrigger(n,t,o){const r=this.nameHelper.generateCombinedName(n,"autoinc_trg",t),e=this.nameHelper.generateCombinedName(n,"seq",t),c=this.nameHelper.generateCombinedName(n,"autoinc_trg",o),u=this.nameHelper.generateCombinedName(n,"seq",o);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('RENAME "${t}" TO "${o}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${r}'; IF (IS_AUTOINC > 0) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${r}"'); EXECUTE IMMEDIATE ('RENAME "${e}" TO "${u}"'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${o}'; EXECUTE IMMEDIATE ('create or replace trigger "${c}" BEFORE INSERT on "${o}" for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select "${u}".nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from "${o}" where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); end if;END;`}}return Ll=s,Ll}var Bl,Db;function uA(){if(Db)return Bl;Db=1;const a=ct(),s=Me(),i=Zc();class n extends a{constructor(){super(...arguments)}renameTable(o,r){const c=new i(this.client.version).renameTableAndAutoIncrementTrigger(this.client.logger,o,r);this.pushQuery(c)}hasTable(o){this.pushQuery({sql:"select TABLE_NAME from USER_TABLES where TABLE_NAME = "+this.client.parameter(o,this.builder,this.bindingsHolder),output(r){return r.length>0}})}hasColumn(o,r){const e=`select COLUMN_NAME from ALL_TAB_COLUMNS where TABLE_NAME = ${this.client.parameter(o,this.builder,this.bindingsHolder)} and COLUMN_NAME = ${this.client.parameter(r,this.builder,this.bindingsHolder)}`;this.pushQuery({sql:e,output:c=>c.length>0})}dropSequenceIfExists(o){const r=this.schema?`"${this.schema}".`:"";this.pushQuery(s.wrapSqlWithCatch(`drop sequence ${r}${this.formatter.wrap(o)}`,-2289))}_dropRelatedSequenceIfExists(o){const e=new s.NameHelper(this.client.version).generateCombinedName(this.client.logger,"seq",o);this.dropSequenceIfExists(e)}dropTable(o){const r=this.schema?`"${this.schema}".`:"";this.pushQuery(`drop table ${r}${this.formatter.wrap(o)}`),this._dropRelatedSequenceIfExists(o)}dropTableIfExists(o){this.dropObject(o,"table")}dropViewIfExists(o){this.dropObject(o,"view")}dropObject(o,r){const e=this.schema?`"${this.schema}".`:"";let c=-942;r==="materialized view"&&(c=-12003),this.pushQuery(s.wrapSqlWithCatch(`drop ${r} ${e}${this.formatter.wrap(o)}`,c)),this._dropRelatedSequenceIfExists(o)}refreshMaterializedView(o){return this.pushQuery({sql:`BEGIN DBMS_MVIEW.REFRESH('${this.schemaNameRaw?this.schemaNameRaw+".":""}${o}'); END;`})}dropMaterializedView(o){this._dropView(o,!1,!0)}dropMaterializedViewIfExists(o){this.dropObject(o,"materialized view")}}return Bl=n,Bl}var Ml,Fb;function lA(){if(Fb)return Ml;Fb=1;const a=cr(),s=Rt();class i extends a{constructor(){super(...arguments)}checkIn(){return this._modifiers.checkIn=s(arguments),this}}return Ml=i,Ml}var kl,Ub;function cA(){if(Ub)return kl;Ub=1;var a=Iw();function s(i,n){var t=i==null?0:i.length;return!!t&&a(i,n,0)>-1}return kl=s,kl}var Dl,Qb;function hA(){if(Qb)return Dl;Qb=1;function a(s,i,n){for(var t=-1,o=s==null?0:s.length;++t<o;)if(n(i,s[t]))return!0;return!1}return Dl=a,Dl}var Fl,Hb;function fA(){if(Hb)return Fl;Hb=1;function a(){}return Fl=a,Fl}var Ul,Vb;function dA(){if(Vb)return Ul;Vb=1;var a=Q_(),s=fA(),i=nr(),n=1/0,t=a&&1/i(new a([,-0]))[1]==n?function(o){return new a(o)}:s;return Ul=t,Ul}var Ql,Wb;function pA(){if(Wb)return Ql;Wb=1;var a=yw(),s=cA(),i=hA(),n=_w(),t=dA(),o=nr(),r=200;function e(c,u,h){var l=-1,f=s,p=c.length,w=!0,C=[],m=C;if(h)w=!1,f=i;else if(p>=r){var g=u?null:t(c);if(g)return o(g);w=!1,f=n,m=new a}else m=u?[]:C;e:for(;++l<p;){var d=c[l],b=u?u(d):d;if(d=h||d!==0?d:0,w&&b===b){for(var _=m.length;_--;)if(m[_]===b)continue e;u&&m.push(b),C.push(d)}else f(m,b,h)||(m!==C&&m.push(b),C.push(d))}return C}return Ql=e,Ql}var Hl,Gb;function mA(){if(Gb)return Hl;Gb=1;var a=pA();function s(i){return i&&i.length?a(i):[]}return Hl=s,Hl}var Vl,zb;function gA(){if(zb)return Vl;zb=1;const a=Zc();function s(i){const n=new a(i.client.version);i.pushAdditional(function(){const t=this.tableCompiler.tableNameRaw,o=this.tableCompiler.schemaNameRaw,r=n.createAutoIncrementTrigger(this.client.logger,t,o);this.pushQuery(r)})}return Vl={createAutoIncrementTriggerAndSequence:s},Vl}var Wl,Kb;function Lw(){if(Kb)return Wl;Kb=1;const a=mA(),s=lt(),i=Je(),{createAutoIncrementTriggerAndSequence:n}=gA(),{toNumber:t}=Ce();class o extends i{constructor(){super(...arguments),this.modifiers=["defaultTo","checkIn","nullable","comment"]}increments(e={primaryKey:!0}){return n(this),"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(e)?" primary key":"")}bigincrements(e={primaryKey:!0}){return n(this),"number(20, 0) not null"+(this.tableCompiler._canBeAddPrimaryKey(e)?" primary key":"")}floating(e){const c=t(e,0);return`float${c?`(${c})`:""}`}double(e,c){return`number(${t(e,8)}, ${t(c,2)})`}decimal(e,c){return e===null?"decimal":`decimal(${t(e,8)}, ${t(c,2)})`}integer(e){return e?`number(${t(e,11)})`:"integer"}enu(e){e=a(e);const c=(e||[]).reduce((u,h)=>Math.max(u,String(h).length),1);return this.columnBuilder._modifiers.checkIn=[e],`varchar2(${c})`}datetime(e){return e?"timestamp":"timestamp with time zone"}timestamp(e){return e?"timestamp":"timestamp with time zone"}bool(){return this.columnBuilder._modifiers.checkIn=[[0,1]],"number(1, 0)"}varchar(e){return`varchar2(${t(e,255)})`}comment(e){const c=this.args[0]||this.defaults("columnName");this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(c)+" is '"+(e||"")+"'")},e)}checkIn(e){return e===void 0?"":(e instanceof s?e=e.toQuery():Array.isArray(e)?e=e.map(c=>`'${c}'`).join(", "):e=`'${e}'`,`check (${this.formatter.wrap(this.args[0])} in (${e}))`)}}return o.prototype.tinyint="smallint",o.prototype.smallint="smallint",o.prototype.mediumint="integer",o.prototype.biginteger="number(20, 0)",o.prototype.text="clob",o.prototype.time="timestamp with time zone",o.prototype.bit="clob",o.prototype.json="clob",Wl=o,Wl}var Gl,Jb;function Bw(){if(Jb)return Gl;Jb=1;const a=Me(),s=ht(),i=Ce(),n=Zc(),{isObject:t}=ye();class o extends s{constructor(){super(...arguments)}addColumns(e,c){if(e.sql.length>0){c=c||this.addColumnsPrefix;const u=e.sql;let l=`${this.lowerCase?"alter table ":"ALTER TABLE "}${this.tableName()} ${c}`;e.sql.length>1?l+=`(${u.join(", ")})`:l+=u.join(", "),this.pushQuery({sql:l,bindings:e.bindings})}}renameColumn(e,c){const u=this.tableName().slice(1,-1),h=new n(this.client.version);return this.pushQuery(h.renameColumnTrigger(this.client.logger,u,e,c))}compileAdd(e){const c=this.formatter.wrap(e),u=this.prefixArray("add column",this.getColumns(e));return this.pushQuery({sql:`alter table ${c} ${u.join(", ")}`})}createQuery(e,c,u){const h=u&&this.tableNameLike()?" as (select * from "+this.tableNameLike()+" where 0=1)":" ("+e.sql.join(", ")+this._addChecks()+")",l=`create table ${this.tableName()}${h}`;this.pushQuery({sql:c?a.wrapSqlWithCatch(l,-955):l,bindings:e.bindings}),this.single.comment&&this.comment(this.single.comment),u&&this.addColumns(e,this.addColumnsPrefix)}comment(e){this.pushQuery(`comment on table ${this.tableName()} is '${e}'`)}dropColumn(){const e=i.normalizeArr.apply(null,arguments);this.pushQuery(`alter table ${this.tableName()} drop (${this.formatter.columnize(e)})`)}_indexCommand(e,c,u){const h=new a.NameHelper(this.client.version);return this.formatter.wrap(h.generateCombinedName(this.client.logger,e,c,u))}primary(e,c){let u;t(c)&&({constraintName:c,deferrable:u}=c),u=u?` deferrable initially ${u}`:"",c=c?this.formatter.wrap(c):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const h=e;let l=[];this.grouped.columns&&(l=this._getIncrementsColumnNames(),l&&l.forEach(f=>{h.includes(f)||h.unshift(f)})),this.pushQuery(`alter table ${this.tableName()} add constraint ${c} primary key (${this.formatter.columnize(h)})${u}`)}dropPrimary(e){e=e?this.formatter.wrap(e):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${e}`)}index(e,c){c=c?this.formatter.wrap(c):this._indexCommand("index",this.tableNameRaw,e),this.pushQuery(`create index ${c} on ${this.tableName()} (`+this.formatter.columnize(e)+")")}dropIndex(e,c){c=c?this.formatter.wrap(c):this._indexCommand("index",this.tableNameRaw,e),this.pushQuery(`drop index ${c}`)}unique(e,c){let u;t(c)&&({indexName:c,deferrable:u}=c),u=u?` deferrable initially ${u}`:"",c=c?this.formatter.wrap(c):this._indexCommand("unique",this.tableNameRaw,e),this.pushQuery(`alter table ${this.tableName()} add constraint ${c} unique (`+this.formatter.columnize(e)+")"+u)}dropUnique(e,c){c=c?this.formatter.wrap(c):this._indexCommand("unique",this.tableNameRaw,e),this.pushQuery(`alter table ${this.tableName()} drop constraint ${c}`)}dropForeign(e,c){c=c?this.formatter.wrap(c):this._indexCommand("foreign",this.tableNameRaw,e),this.pushQuery(`alter table ${this.tableName()} drop constraint ${c}`)}}return o.prototype.addColumnsPrefix="add ",o.prototype.alterColumnsPrefix="modify ",Gl=o,Gl}var zl,Yb;function Mw(){if(Yb)return zl;Yb=1;const{ReturningHelper:a}=Me(),{isConnectionError:s}=Me(),i=Ye(),n=uA(),t=lA(),o=Lw(),r=Bw();class e extends i{schemaCompiler(){return new n(this,...arguments)}columnBuilder(){return new t(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new r(this,...arguments)}database(){return this.connectionSettings.database}positionBindings(u){let h=0;return u.replace(/\?/g,function(){return h+=1,`:${h}`})}_stream(u,h,l,f){if(!h.sql)throw new Error("The query is empty");return new Promise(function(p,w){l.on("error",m=>{s(m)&&(u.__knex__disposed=m),w(m)}),l.on("end",p);const C=u.queryStream(h.sql,h.bindings,f);C.pipe(l),C.on("error",function(m){w(m),l.emit("error",m)})})}alias(u,h){return u+" "+h}parameter(u,h,l){return u instanceof a&&this.driver?u=new this.driver.OutParam(this.driver.OCCISTRING):typeof u=="boolean"&&(u=u?1:0),super.parameter(u,h,l)}}return Object.assign(e.prototype,{dialect:"oracle",driverName:"oracle"}),zl=e,zl}var Kl,Xb;function yA(){if(Xb)return Kl;Xb=1;const a=zc(),s=Re(),i=Te(),n=Le(),t=Tt(),o=Ke(),{ReturningHelper:r}=Me(),{isString:e}=ye(),c=["comments","columns","join","where","union","group","having","order","lock"];class u extends o{constructor(l,f,p){super(l,f,p);const{onConflict:w}=this.single;if(w)throw new Error(".onConflict() is not supported for oracledb.");this.first=this.select}insert(){let l=this.single.insert||[],{returning:f}=this.single;if(!Array.isArray(l)&&n(this.single.insert)&&(l=[this.single.insert]),f&&!Array.isArray(f)&&(f=[f]),Array.isArray(l)&&l.length===1&&i(l[0]))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.wrap(this.single.returning)}) values (default)`,f,this.tableName);if(i(this.single.insert)&&typeof this.single.insert!="function")return"";const p=this._prepInsert(l),w={};if(e(p))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} ${p}`,f);if(p.values.length===1)return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.columnize(p.columns)}) values (${this.client.parameterize(p.values[0],void 0,this.builder,this.bindingsHolder)})`,f,this.tableName);const C=p.columns.length===0;return w.sql="begin "+p.values.map(m=>{let g;const d=C?"":this.client.parameterize(m,this.client.valueForUndefined,this.builder,this.bindingsHolder),b=Array.isArray(f)?f:[f];let _=`insert into ${this.tableName} `;f&&(g=new r(b.join(":")),w.outParams=(w.outParams||[]).concat(g)),C?_+=`(${this.formatter.wrap(this.single.returning)}) values (default)`:_+=`(${this.formatter.columnize(p.columns)}) values (${d})`,_+=f?` returning ROWID into ${this.client.parameter(g,this.builder,this.bindingsHolder)}`:"",_=this.formatter.client.positionBindings(_);const q=d.replace("DEFAULT, ","").replace(", DEFAULT","");return`execute immediate '${_.replace(/'/g,"''")}`+(q||f?"' using ":"")+q+(q&&f?", ":"")+(f?"out ?":"")+";"}).join(" ")+"end;",f&&(w.returning=f,w.returningSql=`select ${this.formatter.columnize(f)} from `+this.tableName+" where ROWID in ("+w.outParams.map((m,g)=>`:${g+1}`).join(", ")+") order by case ROWID "+w.outParams.map((m,g)=>`when CHARTOROWID(:${g+1}) then ${g}`).join(" ")+" end"),w}update(){const l=this._prepUpdate(this.single.update),f=this.where();let{returning:p}=this.single;const w=`update ${this.tableName} set `+l.join(", ")+(f?` ${f}`:"");return p?(Array.isArray(p)||(p=[p]),this._addReturningToSqlAndConvert(w,p,this.tableName)):w}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"for update"}forShare(){return this.client.logger.warn("lock for share is not supported by oracle dialect"),""}columnInfo(){const l=this.single.columnInfo;return{sql:`select * from xmltable( '/ROWSET/ROW'
117
+ passing dbms_xmlgen.getXMLType('
118
+ select char_col_decl_length, column_name, data_type, data_default, nullable
119
+ from all_tab_columns where table_name = ''${this.client.customWrapIdentifier(this.single.table,s)}'' ')
120
+ columns
121
+ CHAR_COL_DECL_LENGTH number, COLUMN_NAME varchar2(200), DATA_TYPE varchar2(106),
122
+ DATA_DEFAULT clob, NULLABLE varchar2(1))`,output(w){const C=t(w,function(m,g){return m[g.COLUMN_NAME]={type:g.DATA_TYPE,defaultValue:g.DATA_DEFAULT,maxLength:g.CHAR_COL_DECL_LENGTH,nullable:g.NULLABLE==="Y"},m},{});return l&&C[l]||C}}}select(){let l=this.with();const f=c.map(p=>this[p]());return l+=a(f).join(" "),this._surroundQueryWithLimitAndOffset(l)}aggregate(l){return this._aggregate(l,{aliasSeparator:" "})}_addReturningToSqlAndConvert(l,f,p){const w={sql:l};if(!f)return w;const C=Array.isArray(f)?f:[f],m=new r(C.join(":"));return w.sql=l+" returning ROWID into "+this.client.parameter(m,this.builder,this.bindingsHolder),w.returningSql=`select ${this.formatter.columnize(f)} from ${p} where ROWID = :1`,w.outParams=[m],w.returning=f,w}_surroundQueryWithLimitAndOffset(l){let{limit:f}=this.single;const{offset:p}=this.single,w=f||f===0||f==="0";if(f=+f,!w&&!p)return l;if(l=l||"",w&&!p)return`select * from (${l}) where rownum <= ${this._getValueOrParameterFromAttribute("limit",f)}`;const C=+p+(w?f:1e13);return"select * from (select row_.*, ROWNUM rownum_ from ("+l+") row_ where rownum <= "+(this.single.skipBinding.offset?C:this.client.parameter(C,this.builder,this.bindingsHolder))+") where rownum_ > "+this._getValueOrParameterFromAttribute("offset",p)}}return Kl=u,Kl}var Jl,Zb;function gc(){if(Zb)return Jl;Zb=1;const a=Me(),{promisify:s}=Ee(),i=ve;function n(e,c){this.columnName=e,this.value=c,this.returning=!1}n.prototype.toString=function(){return"[object BlobHelper:"+this.columnName+"]"};function t(e,c){return new Promise((u,h)=>{let l=c==="string"?"":Buffer.alloc(0);e.on("error",function(f){h(f)}),e.on("data",function(f){c==="string"?l+=f:l=Buffer.concat([l,f])}),e.on("end",function(){u(l)})})}const o=function(e){const c=ve;let u;if(e.type)e.type===c.BLOB?u="buffer":e.type===c.CLOB&&(u="string");else if(e.iLob)e.iLob.type===c.CLOB?u="string":e.iLob.type===c.BLOB&&(u="buffer");else throw new Error("Unrecognized oracledb lob stream type");return u==="string"&&e.setEncoding("utf-8"),t(e,u)};function r(e,c){if(e.executeAsync)return;e.commitAsync=function(){return new Promise((h,l)=>{this.commit(function(f){if(f)return l(f);h()})})},e.rollbackAsync=function(){return new Promise((h,l)=>{this.rollback(function(f){if(f)return l(f);h()})})};const u=s(function(h,l,f,p){if(f=f||{},f.outFormat=c.driver.OUT_FORMAT_OBJECT||c.driver.OBJECT,!f.outFormat)throw new Error("not found oracledb.outFormat constants");f.resultSet?e.execute(h,l||[],f,function(w,C){if(w)return a.isConnectionError(w)&&(e.close().catch(function(b){}),e.__knex__disposed=w),p(w);const m={rows:[],resultSet:C.resultSet},g=100,d=function(b,_,q){_.getRows(q,function(E,R){if(E)a.isConnectionError(E)&&(b.close().catch(function($){}),b.__knex__disposed=E),_.close(function(){return p(E)});else{if(R.length===0)return p(null,m);if(R.length>0)if(R.length===q)m.rows=m.rows.concat(R),d(b,_,q);else return m.rows=m.rows.concat(R),p(null,m)}})};d(e,C.resultSet,g)}):e.execute(h,l||[],f,function(w,C){return w?(a.isConnectionError(w)&&(e.close().catch(function(m){}),e.__knex__disposed=w),p(w)):p(null,C)})});e.executeAsync=function(h,l,f){return u(h,l,f).then(async p=>{const w=()=>p.resultSet?s(p.resultSet.close).call(p.resultSet):Promise.resolve(),C=[];if(p.rows&&Array.isArray(p.rows))for(let m=0;m<p.rows.length;m++){const g=p.rows[m];for(const d in g)g[d]instanceof i.Readable&&C.push({index:m,key:d,stream:g[d]})}try{for(const m of C)p.rows[m.index][m.key]=await o(m.stream)}catch(m){throw await w().catch(()=>{}),m}return await w(),p})}}return a.BlobHelper=n,a.monkeyPatchConnection=r,Jl=a,Jl}var Yl,e_;function bA(){if(e_)return Yl;e_=1;const a=Fc(),s=Et(),i=Te(),n=Le(),t=yA(),o=gc().ReturningHelper,r=gc().BlobHelper,{isString:e}=ye(),{columnize:c}=qe();class u extends t{insert(){const l=this,f=this._prepOutbindings(this.single.insert,this.single.returning),p=f.outBinding,w=f.returning,C=f.values;if(Array.isArray(C)&&C.length===1&&i(C[0])){const b=this.single.returning?" ("+this.formatter.wrap(this.single.returning)+")":"";return this._addReturningToSqlAndConvert("insert into "+this.tableName+b+" values (default)",p[0],this.tableName,w)}if(i(this.single.insert)&&typeof this.single.insert!="function")return"";const m=this._prepInsert(C),g={};if(e(m))return this._addReturningToSqlAndConvert("insert into "+this.tableName+" "+m,p[0],this.tableName,w);if(m.values.length===1)return this._addReturningToSqlAndConvert("insert into "+this.tableName+" ("+this.formatter.columnize(m.columns)+") values ("+this.client.parameterize(m.values[0],void 0,this.builder,this.bindingsHolder)+")",p[0],this.tableName,w);const d=m.columns.length===0;return g.returning=w,g.sql="begin "+m.values.map(function(b,_){const q=d?"":l.client.parameterize(b,l.client.valueForUndefined,l.builder,l.bindingsHolder);let E="insert into "+l.tableName;d?E+=" ("+l.formatter.wrap(l.single.returning)+") values (default)":E+=" ("+l.formatter.columnize(m.columns)+") values ("+q+")";let R="",$="",M="",v="";s(b,function(B){B instanceof r||(M+=" ?,")}),M=M.slice(0,-1),p[_].forEach(function(B){const F=B.columnName||B;if(R+=l.formatter.wrap(F)+",",$+=" ?,",v+=" out ?,",B instanceof r)return l.formatter.bindings.push(B);l.formatter.bindings.push(new o(F))}),R=R.slice(0,-1),$=$.slice(0,-1),v=v.slice(0,-1),R&&$&&(E+=" returning "+R+" into"+$),E=l.formatter.client.positionBindings(E);const T=q.replace(/DEFAULT, /g,"").replace(/, DEFAULT/g,"").replace("EMPTY_BLOB(), ","").replace(", EMPTY_BLOB()","");return"execute immediate '"+E.replace(/'/g,"''")+(T||b?"' using ":"")+T+(T&&v?",":"")+v+";"}).join(" ")+"end;",g.outBinding=p,w[0]==="*"&&(g.returningSql=function(){return"select * from "+l.tableName+" where ROWID in ("+this.outBinding.map(function(b,_){return":"+(_+1)}).join(", ")+") order by case ROWID "+this.outBinding.map(function(b,_){return"when CHARTOROWID(:"+(_+1)+") then "+_}).join(" ")+" end"}),g}with(){const l=[];if(this.grouped.with)for(const p of this.grouped.with)p.recursive&&(l.push(p),p.recursive=!1);const f=super.with();for(const p of l)p.recursive=!0;return f}_addReturningToSqlAndConvert(l,f,p,w){const C=this,m={sql:l};if(!f)return m;const g=Array.isArray(f)?f:[f];let d="",b="";return g.forEach(function(_){const q=_.columnName||_;if(d+=C.formatter.wrap(q)+",",b+="?,",_ instanceof r)return C.formatter.bindings.push(_);C.formatter.bindings.push(new o(q))}),m.sql=l,d=d.slice(0,-1),b=b.slice(0,-1),d&&b&&(m.sql+=" returning "+d+" into "+b),m.outBinding=[f],w[0]==="*"&&(m.returningSql=function(){return"select * from "+C.tableName+" where ROWID = :1"}),m.returning=w,m}_prepOutbindings(l,f){const p={};let w=l||[],C=f||[];!Array.isArray(w)&&n(l)&&(w=[w]),C&&!Array.isArray(C)&&(C=[C]);const m=[];return s(w,function(g,d){C[0]==="*"?m[d]=["ROWID"]:m[d]=a(C),s(g,function(b,_){if(b instanceof Buffer){g[_]=new r(_,b);const q=m[d].indexOf(_);q>=0&&(m[d].splice(q,1),g[_].returning=!0),m[d].push(g[_])}b===void 0&&delete w[d][_]})}),p.returning=C,p.outBinding=m,p.values=w,p}_groupOrder(l,f){return super._groupOrderNulls(l,f)}update(){const l=this,f={},p=this._prepOutbindings(this.single.update||this.single.counter,this.single.returning),w=p.outBinding,C=p.returning,m=this._prepUpdate(this.single.update),g=this.where();let d="",b="";return i(m)&&typeof this.single.update!="function"?"":(w.forEach(function(_){_.forEach(function(q){const E=q.columnName||q;if(d+=l.formatter.wrap(E)+",",b+=" ?,",q instanceof r)return l.formatter.bindings.push(q);l.formatter.bindings.push(new o(E))})}),d=d.slice(0,-1),b=b.slice(0,-1),f.outBinding=w,f.returning=C,f.sql="update "+this.tableName+" set "+m.join(", ")+(g?" "+g:""),w.length&&!i(w[0])&&(f.sql+=" returning "+d+" into"+b),C[0]==="*"&&(f.returningSql=function(){let _="select * from "+l.tableName;const q=this.rowsAffected.length||this.rowsAffected;let E=" where ROWID in (",R=") order by case ROWID ";for(let $=0;$<q;$++)this.returning[0]==="*"&&(E+=":"+($+1)+", ",R+="when CHARTOROWID(:"+($+1)+") then "+$+" ");return this.returning[0]==="*"&&(this.returning=this.returning.slice(0,-1),E=E.slice(0,-2),R=R.slice(0,-1)),_+=E+R+" end"}),f)}_jsonPathWrap(l){return`'${l.path||l[1]}'`}jsonExtract(l){return this._jsonExtract(l.singleValue?"json_value":"json_query",l)}jsonSet(l){return`json_transform(${c(l.column,this.builder,this.client,this.bindingsHolder)}, set ${this.client.parameter(l.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(l.value,this.builder,this.bindingsHolder)})`}jsonInsert(l){return`json_transform(${c(l.column,this.builder,this.client,this.bindingsHolder)}, insert ${this.client.parameter(l.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(l.value,this.builder,this.bindingsHolder)})`}jsonRemove(l){const f=`json_transform(${c(l.column,this.builder,this.client,this.bindingsHolder)}, remove ${this.client.parameter(l.path,this.builder,this.bindingsHolder)})`;return l.alias?this.client.alias(f,this.formatter.wrap(l.alias)):f}whereJsonPath(l){return this._whereJsonPath("json_value",l)}whereJsonSupersetOf(l){throw new Error("Json superset where clause not actually supported by Oracle")}whereJsonSubsetOf(l){throw new Error("Json subset where clause not actually supported by Oracle")}onJsonPathEquals(l){return this._onJsonPathEquals("json_value",l)}}return Yl=u,Yl}var Xl,t_;function _A(){if(t_)return Xl;t_=1;const a=Bw();class s extends a{constructor(n,t){super(n,t)}_setNullableState(n,t){const o=t?"NULL":"NOT NULL",r=`alter table ${this.tableName()} modify (${this.formatter.wrap(n)} ${o})`;return this.pushQuery({sql:r})}}return Xl=s,Xl}var Zl,r_;function wA(){if(r_)return Zl;r_=1;const a=Lw(),{isObject:s}=ye();class i extends a{constructor(){super(...arguments),this.modifiers=["defaultTo","nullable","comment","checkJson"],this._addCheckModifiers()}datetime(t){let o;return s(t)?{useTz:o}=t:o=!t,o?"timestamp with local time zone":"timestamp"}timestamp(t){let o;return s(t)?{useTz:o}=t:o=!t,o?"timestamp with local time zone":"timestamp"}checkRegex(t,o){return this._check(`REGEXP_LIKE(${this.formatter.wrap(this.getColumnName())},${this.client._escapeBinding(t)})`,o)}json(){return this.columnBuilder._modifiers.checkJson=[this.formatter.columnize(this.getColumnName())],"varchar2(4000)"}jsonb(){return this.json()}checkJson(t){return`check (${t} is json)`}}return i.prototype.time="timestamp with local time zone",i.prototype.uuid=({useBinaryUuid:n=!1}={})=>n?"raw(16)":"char(36)",Zl=i,Zl}var ec,n_;function vA(){if(n_)return ec;n_=1;const a=ft();class s extends a{constructor(n,t){super(n,t)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return ec=s,ec}var tc,i_;function CA(){if(i_)return tc;i_=1;const a=St();class s extends a{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}}return tc=s,tc}var rc,s_;function qA(){if(s_)return rc;s_=1;const a=Be(),{timeout:s,KnexTimeoutError:i}=et(),n=Oe()("knex:tx");return rc=class extends a{begin(o){return this.isolationLevel&&this.client.logger.warn("Transaction isolation is not currently supported for Oracle"),Promise.resolve()}async commit(o,r){this._completed=!0;try{await o.commitAsync(),this._resolver(r)}catch(e){this._rejecter(e)}}release(o,r){return this._resolver(r)}rollback(o,r){return this._completed=!0,n("%s: rolling back",this.txid),s(o.rollbackAsync(),5e3).catch(e=>{if(!(e instanceof i))return Promise.reject(e);this._rejecter(e)}).then(()=>{if(r===void 0){if(this.doNotRejectOnRollback){this._resolver();return}r=new Error(`Transaction rejected with non-error: ${r}`)}this._rejecter(r)})}savepoint(o){return this.query(o,`SAVEPOINT ${this.txid}`)}async acquireConnection(o,r){const e=o&&o.connection,c=e||await this.client.acquireConnection();try{return c.__knexTxId=this.txid,c.isTransaction=!0,await r(c)}finally{n("%s: releasing connection",this.txid),c.isTransaction=!1;try{await c.commitAsync()}catch(u){this._rejecter(u)}finally{e?n("%s: not releasing external connection",this.txid):await this.client.releaseConnection(c)}}}},rc}var nc,o_;function EA(){if(o_)return nc;o_=1;var a={};const s=Et(),i=sw(),n=Te(),t=ze(),o=hr(),r=bA(),e=_A(),c=wA(),{BlobHelper:u,ReturningHelper:h,monkeyPatchConnection:l}=gc(),f=vA(),p=CA(),w=qA(),C=Mw(),{isString:m}=ye(),{outputQuery:g,unwrapRaw:d}=qe(),{compileCallback:b}=Ge();class _ extends C{constructor($){super($),this.version&&(this.version=q(this.version)),this.driver&&(a.UV_THREADPOOL_SIZE=a.UV_THREADPOOL_SIZE||1,a.UV_THREADPOOL_SIZE=parseInt(a.UV_THREADPOOL_SIZE)+this.driver.poolMax)}_driver(){const $=this,M=ve;return $.fetchAsString=[],this.config.fetchAsString&&Array.isArray(this.config.fetchAsString)&&this.config.fetchAsString.forEach(function(v){m(v)&&(v=v.toUpperCase(),M[v]&&(v!=="NUMBER"&&v!=="DATE"&&v!=="CLOB"&&v!=="BUFFER"&&this.logger.warn('Only "date", "number", "clob" and "buffer" are supported for fetchAsString'),$.fetchAsString.push(M[v])))}),M}queryCompiler($,M){return new r(this,$,M)}tableCompiler(){return new e(this,...arguments)}columnCompiler(){return new c(this,...arguments)}viewBuilder(){return new p(this,...arguments)}viewCompiler(){return new f(this,...arguments)}formatter($){return new o(this,$)}transaction(){return new w(this,...arguments)}prepBindings($){return t($,M=>M instanceof u&&this.driver?{type:this.driver.BLOB,dir:this.driver.BIND_OUT}:M instanceof h&&this.driver?{type:this.driver.STRING,dir:this.driver.BIND_OUT}:typeof M=="boolean"?M?1:0:M)}parameter($,M,v){return typeof $=="function"?g(b($,void 0,this,v),!0,M,this):$ instanceof u?(v.bindings.push($.value),"?"):d($,!0,M,this,v)||"?"}acquireRawConnection(){return new Promise(($,M)=>{const v=this.connectionSettings.externalAuth?{externalAuth:this.connectionSettings.externalAuth}:{user:this.connectionSettings.user,password:this.connectionSettings.password};v.connectString=E(this.connectionSettings),this.connectionSettings.prefetchRowCount&&(v.prefetchRows=this.connectionSettings.prefetchRowCount),this.connectionSettings.stmtCacheSize!==void 0&&(v.stmtCacheSize=this.connectionSettings.stmtCacheSize),this.driver.fetchAsString=this.fetchAsString,this.driver.getConnection(v,(T,B)=>{if(T)return M(T);l(B,this),$(B)})})}destroyRawConnection($){return $.release()}async acquireConnection(){const $=await super.acquireConnection();return this.checkVersion($),$}checkVersion($){if(this.version)return this.version;const M=q($.oracleServerVersionString);if(!M)throw new Error(this.version===null?"Invalid Oracledb version number format passed to knex. Unable to successfully auto-detect as fallback. Please specify a valid oracledb version.":"Unable to detect Oracledb version number automatically. Please specify the version in knex configuration.");return this.version=M,M}_query($,M){if(!M.sql)throw new Error("The query is empty");const v=Object.assign({},M.options,{autoCommit:!1});return M.method==="select"&&(v.resultSet=!0),$.executeAsync(M.sql,M.bindings,v).then(async function(T){let B=i(T.outBinds);if(M.response=T.rows||[],M.rowsAffected=T.rows?T.rows.rowsAffected:T.rowsAffected,M.method==="raw"&&B.length>0)return{response:B};if(M.method==="update"){const A=M.rowsAffected.length||M.rowsAffected,j=[],Y=[],ee=H=>function(N,V){const K=V*A;Y.push(B[H+K])};for(let H=0;H<A;H++)j.push(M.outBinding[0]),s(M.outBinding[0],ee(H));B=Y,M.outBinding=j}if(!M.returning&&B.length===0)return $.isTransaction||await $.commitAsync(),M;const F=[];let y=0;for(let A=0;A<M.outBinding.length;A++){const j=M.outBinding[A];y=y+(M.outBinding[A-1]?M.outBinding[A-1].length:0);for(let Y=0;Y<j.length;Y++){const ee=j[Y];await new Promise(function(H,N){if(ee instanceof u){const V=B[Y+y];ee.returning&&(M.response[A]=M.response[A]||{},M.response[A][ee.columnName]=ee.value),V.on("error",function(K){N(K)}),V.on("finish",function(){H()}),V.write(ee.value),V.end()}else M.outBinding[A][Y]==="ROWID"?(F.push(B[Y+y]),H()):(M.response[A]=M.response[A]||{},M.response[A][ee]=B[Y+y],H())})}}if(M.returningSql){const A=await $.executeAsync(M.returningSql(),F,{resultSet:!0});M.response=A.rows}return $.isTransaction||await $.commitAsync(),M})}processResponse($,M){const{response:v}=$;if($.output)return $.output.call(M,v);switch($.method){case"select":return v;case"first":return v[0];case"pluck":return t(v,$.pluck);case"insert":case"del":case"update":case"counter":return $.returning&&!n($.returning)||$.returningSql?v:$.rowsAffected!==void 0?$.rowsAffected:1;default:return v}}processPassedConnection($){this.checkVersion($),l($,this)}}_.prototype.driverName="oracledb";function q(R){try{const $=R.split(".").slice(0,2);$.forEach((v,T)=>{$[T]=v.replace(/\D$/,"")});const M=$.join(".");return M.match(/^\d+\.?\d*$/)?M:null}catch{return null}}function E(R){return R.connectString?R.connectString:R.port?R.host+":"+R.port+"/"+R.database:R.host+"/"+R.database}return nc=_,nc}var ic,a_;function AA(){if(a_)return ic;a_=1;const a=fr();class s extends a{constructor(...n){super(...n),this.driverName="pgnative",this.canCancelQuery=!0}_driver(){return ve.native}_stream(n,t,o,r){if(!t.sql)throw new Error("The query is empty");const e=this;return new Promise((c,u)=>(o.on("error",u),o.on("end",c),e._query(n,t).then(h=>h.response).then(({rows:h})=>h.forEach(l=>o.write(l))).catch(function(h){o.emit("error",h)}).then(function(){o.end()})))}async cancelQuery(n){try{return await this._wrappedCancelQueryCall(null,n)}catch(t){throw this.logger.warn(`Connection Error: ${t}`),t}}_wrappedCancelQueryCall(n,t){return new Promise(function(o,r){t.native.cancel(function(e){if(e){r(e);return}o(!0)})})}}return ic=s,ic}var sc,u_;function RA(){if(u_)return sc;u_=1;const a=Be();return sc=class extends a{begin(i){const n=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return n.length===0?this.query(i,"BEGIN;"):this.query(i,`BEGIN ${n};`)}savepoint(i){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}release(i,n){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}rollbackTo(i,n){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}},sc}var oc,l_;function TA(){if(l_)return oc;l_=1;const a=Ke(),s=Kc(),i=Re(),{columnize:n}=qe();class t extends s{truncate(){return`truncate ${this.tableName.toLowerCase()}`}insert(){const r=a.prototype.insert.apply(this,arguments);return r===""?r:(this._slightReturn(),{sql:r})}update(){const r=a.prototype.update.apply(this,arguments);return this._slightReturn(),{sql:r}}del(){const r=a.prototype.del.apply(this,arguments);return this._slightReturn(),{sql:r}}_slightReturn(){this.single.isReturning&&this.client.logger.warn("insert/update/delete returning is not supported by redshift dialect")}forUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}forNoKeyUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forKeyShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}columnInfo(){const r=this.single.columnInfo;let e=this.single.schema;const c=this.client.customWrapIdentifier(this.single.table,i);e&&(e=this.client.customWrapIdentifier(e,i));const u="select * from information_schema.columns where table_name = ? and table_catalog = ?",h=[c.toLowerCase(),this.client.database().toLowerCase()];return this._buildColumnInfoQuery(e,u,h,r)}jsonExtract(r){let e;return Array.isArray(r.column)?e=r.column:e=[r],e.map(c=>{const u=`json_extract_path_text(${n(c.column||c[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toPathForJson(r.path||c[1],this.builder,this.bindingsHolder)})`,h=c.alias||c[2];return h?this.client.alias(u,this.formatter.wrap(h)):u}).join(", ")}jsonSet(r){throw new Error("Json set is not supported by Redshift")}jsonInsert(r){throw new Error("Json insert is not supported by Redshift")}jsonRemove(r){throw new Error("Json remove is not supported by Redshift")}whereJsonPath(r){return this._whereJsonPath("json_extract_path_text",Object.assign({},r,{path:this.client.toPathForJson(r.path)}))}whereJsonSupersetOf(r){throw new Error("Json superset is not supported by Redshift")}whereJsonSubsetOf(r){throw new Error("Json subset is not supported by Redshift")}onJsonPathEquals(r){return this._onJsonPathEquals("json_extract_path_text",r)}}return oc=t,oc}var ac,c_;function SA(){if(c_)return ac;c_=1;const a=cr();class s extends a{constructor(){super(...arguments)}primary(){return this.notNullable(),super.primary(...arguments)}index(){return this.client.logger.warn("Redshift does not support the creation of indexes."),this}}return ac=s,ac}var uc,h_;function OA(){if(h_)return uc;h_=1;const a=Jc(),s=Je();class i extends a{constructor(){super(...arguments)}bit(t){return t.length!==!1?`char(${t.length})`:"char(1)"}datetime(t){return t?"timestamp":"timestamptz"}timestamp(t){return t?"timestamp":"timestamptz"}comment(t){this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(this.args[0])+" is "+(t?`'${t}'`:"NULL"))},t)}}return i.prototype.increments=({primaryKey:n=!0}={})=>"integer identity(1,1)"+(n?" primary key":"")+" not null",i.prototype.bigincrements=({primaryKey:n=!0}={})=>"bigint identity(1,1)"+(n?" primary key":"")+" not null",i.prototype.binary="varchar(max)",i.prototype.blob="varchar(max)",i.prototype.enu="varchar(255)",i.prototype.enum="varchar(255)",i.prototype.json="varchar(max)",i.prototype.jsonb="varchar(max)",i.prototype.longblob="varchar(max)",i.prototype.mediumblob="varchar(16777218)",i.prototype.set="text",i.prototype.text="varchar(max)",i.prototype.tinyblob="varchar(256)",i.prototype.uuid=s.prototype.uuid,i.prototype.varbinary="varchar(max)",i.prototype.bigint="bigint",i.prototype.bool="boolean",i.prototype.double="double precision",i.prototype.floating="real",i.prototype.smallint="smallint",i.prototype.tinyint="smallint",uc=i,uc}var lc,f_;function NA(){if(f_)return lc;f_=1;const a=ar(),s=Yc();class i extends s{constructor(){super(...arguments)}index(t,o,r){this.client.logger.warn("Redshift does not support the creation of indexes.")}dropIndex(t,o){this.client.logger.warn("Redshift does not support the deletion of indexes.")}createQuery(t,o,r){const e=o?"create table if not exists ":"create table ",c=" ("+t.sql.join(", ")+this._addChecks()+")";let u=e+this.tableName()+(r&&this.tableNameLike()?" (like "+this.tableNameLike()+")":c);this.single.inherits&&(u+=` like (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:u,bindings:t.bindings}),a(this.single,"comment")&&this.comment(this.single.comment),r&&this.addColumns(t,this.addColumnsPrefix)}primary(t,o){const r=this;o=o?r.formatter.wrap(o):r.formatter.wrap(`${this.tableNameRaw}_pkey`),t.constructor!==Array&&(t=[t]);const e=r.grouped.columns;if(e)for(let c=0;c<t.length;c++){let u=e.find(l=>l.grouping==="columns"&&l.builder&&l.builder._method==="add"&&l.builder._args&&l.builder._args.indexOf(t[c])>-1);if(u&&(u=u.builder),!(u&&u._modifiers&&u._modifiers.nullable&&u._modifiers.nullable[0]===!1))return u?this.client.logger.warn("Redshift does not allow primary keys to contain nullable columns."):this.client.logger.warn("Redshift does not allow primary keys to contain nonexistent columns.")}return r.pushQuery(`alter table ${r.tableName()} add constraint ${o} primary key (${r.formatter.columnize(t)})`)}addColumns(t,o,r){if(o===this.alterColumnsPrefix)super.addColumns(t,o,r);else{o=o||this.addColumnsPrefix,r=r||this.getColumns();for(const e of r){const c=this.tableName(),u=e.compileColumn();this.pushQuery({sql:`alter table ${c} ${o}${u}`,bindings:[]})}}}}return lc=i,lc}var cc,d_;function IA(){if(d_)return cc;d_=1;const a=Pw();class s extends a{constructor(){super(...arguments)}}return cc=s,cc}var hc,p_;function $A(){if(p_)return hc;p_=1;const a=Xc();class s extends a{constructor(n,t){super(n,t)}}return hc=s,hc}var fc,m_;function xA(){if(m_)return fc;m_=1;const a=fr(),s=ze(),i=RA(),n=TA(),t=SA(),o=OA(),r=NA(),e=IA(),c=$A();class u extends a{transaction(){return new i(this,...arguments)}queryCompiler(l,f){return new n(this,l,f)}columnBuilder(){return new t(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new r(this,...arguments)}schemaCompiler(){return new e(this,...arguments)}viewCompiler(){return new c(this,...arguments)}_driver(){return ve}processResponse(l,f){const p=l.response;return l.output?l.output.call(f,p):l.method==="raw"?p:p.command==="SELECT"?l.method==="first"?p.rows[0]:l.method==="pluck"?s(p.rows,l.pluck):p.rows:p.command==="INSERT"||p.command==="UPDATE"||p.command==="DELETE"?p.rowCount:p}toPathForJson(l,f,p){return l.replace(/^(\$\.)/,"").split(".").map((function(w){return this.parameter(w,f,p)}).bind(this)).join(", ")}}return Object.assign(u.prototype,{dialect:"redshift",driverName:"pg-redshift"}),fc=u,fc}var g_;function PA(){if(g_)return gt;g_=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.getDialectByNameOrAlias=void 0;const{resolveClientNameWithAliases:a}=Ce(),s=Object.freeze({"better-sqlite3":()=>$E(),cockroachdb:()=>DE(),mssql:()=>KE(),mysql:()=>jw(),mysql2:()=>aA(),oracle:()=>Mw(),oracledb:()=>EA(),pgnative:()=>AA(),postgres:()=>fr(),redshift:()=>xA(),sqlite3:()=>$w()});function i(n){const t=a(n),o=s[t];if(!o)throw new Error(`Invalid clientName given: ${n}`);return o()}return gt.getDialectByNameOrAlias=i,gt}var dc,y_;function jA(){if(y_)return dc;y_=1;const a=Ye(),{SUPPORTED_CLIENTS:s}=Hc(),i=pE(),{getDialectByNameOrAlias:n}=PA();function t(o){let r,e;const c=typeof o=="string"?Object.assign(i(o),arguments[2]):o;if(arguments.length===0||!c.client&&!c.dialect)r=a;else if(typeof c.client=="function")r=c.client;else{const u=c.client||c.dialect;if(!s.includes(u))throw new Error(`knex: Unknown configuration option 'client' value ${u}. Note that it is case-sensitive, check documentation for supported values.`);r=n(u)}return typeof c.connection=="string"?e=Object.assign({},c,{connection:i(c.connection).connection}):e=Object.assign({},c),{resolvedConfig:e,Dialect:r}}return dc={resolveConfig:t},dc}var pc,b_;function LA(){if(b_)return pc;b_=1;const a=Ye(),s=je(),i=Z_(),n=ow(),{KnexTimeoutError:t}=et(),{resolveConfig:o}=jA(),r=Ow(),e=St(),c=cr(),u=Nw();function h(l){const{resolvedConfig:f,Dialect:p}=o(...arguments),w=n(new p(f));return f.userParams&&(w.userParams=f.userParams),w}return h.Client=a,h.KnexTimeoutError=t,h.QueryBuilder={extend:function(l,f){s.extend(l,f),i.push(l)}},h.SchemaBuilder={extend:function(l,f){r.extend(l,f)}},h.ViewBuilder={extend:function(l,f){e.extend(l,f)}},h.ColumnBuilder={extend:function(l,f){c.extend(l,f)}},h.TableBuilder={extend:function(l,f){u.extend(l,f)}},pc=h,pc}var mc,__;function BA(){return __||(__=1,mc=LA()),mc}var MA=BA();const kA=Fw(MA),kw=a=>{const s=[];for(const i of a.values()||[]){const{fields:n,rows:t}=i,o=new Array(t.length);for(let r=0,e=o.length;r<e;r++){const c=t[r],u={};for(let h=0,l=n.length;h<l;h++){const{name:f,dataTypeID:p}=n[h];u[f]=c[f]}o[r]=u}s.push(...o)}return s};class DA{_profiler;_queryLogger;_resultsLogger;_index=0;_sql=null;constructor(s,i,n){this._profiler=s,this._queryLogger=i,this._resultsLogger=n}init(s){this._sql=s}async execute(s){if(!this._sql)throw new Error("PGLiteQueryExecutor not initialized");const i=s.toString(),n=this._index++;this._queryLogger&&this._queryLogger(n,i);const t=await this._profiler.record("Query",async()=>{const o=await this._sql?.exec(i);return o?kw(o):void 0});return this._resultsLogger&&this._resultsLogger(n,t),t}}const FA=`
123
+
124
+ create table if not exists "AnalyticsSeries"
125
+ (
126
+ id serial primary key,
127
+ source varchar(255) not null,
128
+ start timestamp not null,
129
+ "end" timestamp,
130
+ metric varchar(255) not null,
131
+ value real not null,
132
+ unit varchar(255),
133
+ fn varchar(255) not null,
134
+ params json
135
+ );
136
+
137
+ create unique index if not exists "AnalyticsSeries_pkey"
138
+ on "AnalyticsSeries" (id);
139
+
140
+ create index if not exists analyticsseries_end_index
141
+ on "AnalyticsSeries" ("end");
142
+
143
+ create index if not exists analyticsseries_fn_index
144
+ on "AnalyticsSeries" (fn);
145
+
146
+ create index if not exists analyticsseries_metric_index
147
+ on "AnalyticsSeries" (metric);
148
+
149
+ create index if not exists analyticsseries_source_index
150
+ on "AnalyticsSeries" (source);
151
+
152
+ create index if not exists analyticsseries_start_index
153
+ on "AnalyticsSeries" (start);
154
+
155
+ create index if not exists analyticsseries_unit_index
156
+ on "AnalyticsSeries" (unit);
157
+
158
+ create index if not exists analyticsseries_value_index
159
+ on "AnalyticsSeries" (value);
160
+
161
+ create table if not exists "AnalyticsDimension"
162
+ (
163
+ id serial primary key,
164
+ dimension varchar(255) not null,
165
+ path varchar(255) not null,
166
+ label varchar(255),
167
+ icon varchar(1000),
168
+ description text
169
+ );
170
+
171
+ create unique index if not exists "AnalyticsDimension_pkey"
172
+ on "AnalyticsDimension" (id);
173
+
174
+ create index if not exists analyticsdimension_dimension_index
175
+ on "AnalyticsDimension" (dimension);
176
+
177
+ create index if not exists analyticsdimension_path_index
178
+ on "AnalyticsDimension" (path);
179
+
180
+ create table if not exists "AnalyticsSeries_AnalyticsDimension"
181
+ (
182
+ "seriesId" integer not null
183
+ constraint analyticsseries_analyticsdimension_seriesid_foreign
184
+ references "AnalyticsSeries"
185
+ on delete cascade,
186
+ "dimensionId" integer not null
187
+ constraint analyticsseries_analyticsdimension_dimensionid_foreign
188
+ references "AnalyticsDimension"
189
+ on delete cascade
190
+ );
191
+
192
+ create index if not exists analyticsseries_analyticsdimension_dimensionid_index
193
+ on "AnalyticsSeries_AnalyticsDimension" ("dimensionId");
194
+
195
+ create index if not exists analyticsseries_analyticsdimension_seriesid_index
196
+ on "AnalyticsSeries_AnalyticsDimension" ("seriesId");
197
+
198
+ `;class UA extends Gw{_pgLiteFactory;_queryLogger;_resultsLogger;_pgExecutor;_profiler;_sql=null;constructor({knex:s,pgLiteFactory:i,queryLogger:n,resultsLogger:t,profiler:o}={}){o||(o=new Vw);const r=new DA(o,n,t);super({executor:r,knex:s||kA({client:"pg",useNullAsDefault:!0})}),this._pgLiteFactory=i||w_.create,this._queryLogger=n||(()=>{}),this._resultsLogger=t||(()=>{}),this._profiler=o,this._pgExecutor=r}async init(){this._sql=await this._pgLiteFactory(),this._pgExecutor.init(this._sql),await this._sql.exec(FA)}async raw(s){return this._queryLogger(-1,s),await this._profiler.record("QueryRaw",async()=>{const i=await this._sql?.exec(s);return this._resultsLogger(-1,i),kw(i||[])})}async destroy(){super.destroy(),this._sql?.close()}}class lR extends UA{constructor(s={databaseName:"analytics"}){s.pgLiteFactory||(s.pgLiteFactory=async()=>w_.create({fs:new Qw(s.databaseName),relaxedDurability:!0})),super(s)}}export{lR as BrowserAnalyticsStore,UA as MemoryAnalyticsStore};
199
+ //# sourceMappingURL=index-CUlo2oTb.js.map