@gct-paas/core 0.1.4-dev.11 → 0.1.4-dev.13

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 (142) hide show
  1. package/dist/index.esm.min.js +4522 -0
  2. package/es/constants/core.mjs +5 -4
  3. package/es/constants/default-date-type/default-date-type.mjs +73 -21
  4. package/es/constants/editor-register/editor-register.mjs +17 -5
  5. package/es/constants/expression-type/BuiltOperators.mjs +152 -147
  6. package/es/constants/expression-type/FunctionKeys.mjs +75 -79
  7. package/es/constants/expression-type/editor.mjs +10 -3
  8. package/es/constants/expression-type/function.mjs +602 -613
  9. package/es/constants/expression-type/index.mjs +111 -113
  10. package/es/constants/expression-type/modeCfg.mjs +256 -263
  11. package/es/constants/expression-type/variable.mjs +43 -39
  12. package/es/constants/form-container-type/form-container-type.mjs +17 -5
  13. package/es/constants/index.d.ts +1 -0
  14. package/es/constants/index.mjs +31 -10
  15. package/es/constants/page-designer/model.mjs +15 -5
  16. package/es/constants/page-designer/regex.d.ts +2 -0
  17. package/es/constants/page-designer/regex.mjs +5 -0
  18. package/es/create-app-vue.mjs +15 -9
  19. package/es/enums/app-designer/index.d.ts +19 -0
  20. package/es/enums/app-designer/index.mjs +131 -63
  21. package/es/enums/appEnum.mjs +681 -360
  22. package/es/enums/appStateEnum.mjs +17 -10
  23. package/es/enums/authActionEnum.mjs +63 -51
  24. package/es/enums/breakpointEnum.mjs +27 -26
  25. package/es/enums/cacheEnum.mjs +22 -21
  26. package/es/enums/designEnum.mjs +110 -71
  27. package/es/enums/developer-center/integration.mjs +7 -6
  28. package/es/enums/exceptionEnum.mjs +21 -17
  29. package/es/enums/expressionEnum.d.ts +1 -1
  30. package/es/enums/expressionEnum.mjs +81 -74
  31. package/es/enums/globalEnum.mjs +59 -36
  32. package/es/enums/httpEnum.mjs +71 -61
  33. package/es/enums/index.mjs +44 -14
  34. package/es/enums/menuEnum.mjs +42 -38
  35. package/es/enums/page-designer/designer.mjs +403 -407
  36. package/es/enums/page-designer/index.d.ts +1 -0
  37. package/es/enums/page-designer/index.mjs +5 -0
  38. package/es/enums/page-designer/layout.d.ts +12 -0
  39. package/es/enums/page-designer/layout.mjs +17 -0
  40. package/es/enums/page-designer/panel.mjs +341 -213
  41. package/es/enums/page-designer/toolkit.mjs +13 -12
  42. package/es/enums/page-designer/widget.mjs +425 -338
  43. package/es/enums/pageEnum.mjs +14 -13
  44. package/es/enums/plugin-enum.mjs +23 -7
  45. package/es/enums/processEnum.mjs +95 -60
  46. package/es/enums/roleEnum.mjs +7 -6
  47. package/es/enums/sizeEnum.d.ts +18 -0
  48. package/es/enums/sizeEnum.mjs +28 -8
  49. package/es/global/gct/gct.mjs +84 -96
  50. package/es/global/index.mjs +1 -0
  51. package/es/hooks/index.mjs +4 -0
  52. package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
  53. package/es/hooks/use-modal/use-modal.mjs +16 -10
  54. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +43 -23
  55. package/es/hooks/useCopyToClipboard.mjs +50 -50
  56. package/es/index.mjs +125 -114
  57. package/es/interface/i-pinia-state/i-global-state.d.ts +0 -11
  58. package/es/locale/index.mjs +50 -57
  59. package/es/modules/env-manager/env-manager.const.mjs +16 -8
  60. package/es/modules/env-manager/env-manager.d.ts +2 -0
  61. package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
  62. package/es/modules/env-manager/env-manager.interface.mjs +14 -7
  63. package/es/modules/env-manager/env-manager.mjs +108 -107
  64. package/es/modules/error-handler/error-handler.const.mjs +11 -16
  65. package/es/modules/error-handler/error-strategy.mjs +199 -175
  66. package/es/modules/error-handler/index.mjs +120 -106
  67. package/es/modules/mqtt/constants/mqtt.const.mjs +21 -24
  68. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +23 -9
  69. package/es/modules/mqtt/index.mjs +4 -0
  70. package/es/modules/mqtt/mqtt-client.mjs +228 -261
  71. package/es/modules/mqtt/mqtt-manager.mjs +117 -77
  72. package/es/modules/platform-config/constants/index.mjs +4 -0
  73. package/es/modules/platform-config/constants/login.const.mjs +48 -45
  74. package/es/modules/platform-config/constants/org.const.mjs +57 -52
  75. package/es/modules/platform-config/constants/theme.const.mjs +11 -4
  76. package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
  77. package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
  78. package/es/modules/platform-config/enums/login.enum.mjs +29 -15
  79. package/es/modules/platform-config/enums/platform.enum.mjs +16 -13
  80. package/es/modules/platform-config/index.mjs +9 -0
  81. package/es/modules/platform-config/store.mjs +68 -79
  82. package/es/modules/platform-config/useBasicSetting.mjs +47 -35
  83. package/es/modules/platform-config/useDeploySetting.mjs +29 -21
  84. package/es/modules/platform-config/useLoginSetting.mjs +151 -173
  85. package/es/modules/platform-config/useOrgSetting.mjs +63 -62
  86. package/es/modules/platform-config/useProjectSetting.mjs +14 -6
  87. package/es/modules/platform-config/useSecuritySetting.mjs +68 -56
  88. package/es/modules/platform-config/useThemeSetting.mjs +78 -59
  89. package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
  90. package/es/modules/user-stores/index.mjs +3 -0
  91. package/es/modules/user-stores/store/permission.store.mjs +27 -36
  92. package/es/modules/user-stores/store/tenant.store.mjs +20 -22
  93. package/es/modules/user-stores/store/user.store.mjs +94 -117
  94. package/es/router/index.mjs +25 -28
  95. package/es/setup-app.mjs +23 -39
  96. package/es/state/global-pinia-state/global-pinia-state.d.ts +0 -6
  97. package/es/state/global-pinia-state/global-pinia-state.mjs +43 -71
  98. package/es/state/index.mjs +1 -0
  99. package/es/store/global-store.mjs +50 -72
  100. package/es/store/index.mjs +25 -19
  101. package/es/types/index.d.ts +7 -0
  102. package/es/utils/axios/interceptors.mjs +21 -17
  103. package/es/utils/cache-adapter/cache-adapter.mjs +61 -56
  104. package/es/utils/css-loader/css-loader.d.ts +36 -0
  105. package/es/utils/css-loader/css-loader.mjs +82 -0
  106. package/es/utils/design/design.mjs +18 -12
  107. package/es/utils/deviceFingerprint.mjs +77 -63
  108. package/es/utils/dictionary/dictionary.mjs +142 -145
  109. package/es/utils/file/base64Conver.mjs +35 -30
  110. package/es/utils/file/download.mjs +94 -98
  111. package/es/utils/file/parser.d.ts +3 -0
  112. package/es/utils/file/parser.mjs +29 -0
  113. package/es/utils/i18n/index.mjs +14 -3
  114. package/es/utils/index.d.ts +3 -1
  115. package/es/utils/index.mjs +32 -0
  116. package/es/utils/is-sort-filed/is-sort-filed.mjs +42 -37
  117. package/es/utils/linked-list/linked-list.mjs +115 -118
  118. package/es/utils/linked-node/linked-node.mjs +41 -31
  119. package/es/utils/lowcode/utils.mjs +13 -18
  120. package/es/utils/lowcode/validate.mjs +20 -26
  121. package/es/utils/mitt/mitt.mjs +4 -4
  122. package/es/utils/model-loader/model-loader.mjs +280 -325
  123. package/es/utils/namespace/namespace.mjs +178 -164
  124. package/es/utils/openUtil/index.mjs +2 -0
  125. package/es/utils/openUtil/modal/modal.mjs +72 -79
  126. package/es/utils/openUtil/overlay-container/overlay-container.mjs +144 -138
  127. package/es/utils/permission.mjs +33 -37
  128. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +46 -42
  129. package/es/utils/style/index.mjs +94 -138
  130. package/es/utils/tools/tools.mjs +86 -54
  131. package/es/utils/treeHelper/treeHelper.mjs +205 -233
  132. package/es/utils/uploader/uploader.mjs +81 -115
  133. package/es/utils/useUUid.mjs +79 -87
  134. package/es/utils/util.mjs +55 -35
  135. package/es/utils/uuid/uuid.d.ts +2 -0
  136. package/es/utils/uuid/uuid.mjs +33 -43
  137. package/es/utils/validate.mjs +15 -19
  138. package/es/utils/value-helper/value-helper.mjs +113 -98
  139. package/package.json +9 -18
  140. package/dist/index.esm.min.mjs +0 -18322
  141. package/dist/index.min.cjs +0 -393
  142. package/dist/index.system.min.js +0 -393
@@ -1,393 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Zt=require("pinia"),rs=require("qs"),qe=require("lodash-es"),Ne=require("vue"),Cd=require("axios"),xd=require("dayjs"),Dd=require("vue-i18n"),ks=require("vue-router"),zn=require("@gct-paas/api"),kd=48,Ud=80;var fl=(e=>(e.FULL="full",e.FIXED="fixed",e))(fl||{}),hl=(e=>(e.DARK="dark",e.LIGHT="light",e))(hl||{}),dl=(e=>(e.AUTO="auto",e.HEADER="header",e.FIXED="fixed",e))(dl||{}),pl=(e=>(e[e.ROUTE_JUMP=0]="ROUTE_JUMP",e[e.PAGE_COVERAGE=1]="PAGE_COVERAGE",e))(pl||{}),gl=(e=>(e.ROLE="ROLE",e.BACK="BACK",e.ROUTE_MAPPING="ROUTE_MAPPING",e.PLATFORM_ROLE="PLATFORM_ROLE",e))(gl||{}),bl=(e=>(e.ZOOM_FADE="zoom-fade",e.ZOOM_OUT="zoom-out",e.FADE_SIDE="fade-slide",e.FADE="fade",e.FADE_BOTTOM="fade-bottom",e.FADE_SCALE="fade-scale",e))(bl||{}),ns=(e=>(e.PORTAL="portal",e.BACKEND_MANAGEMENT="backend-management",e.DEVELOPER_CENTER="developer-center",e.TENANT_CENTER="tenant-center",e.APP_DESIGNER="app-designer",e.PAGE_DESIGNER="page-designer",e.WEB_RENDER="web-render",e.MOBILE_RENDER="mobile-render",e))(ns||{}),ml=(e=>(e.ALL="field_type_all",e.BASIC="field_type_basic",e.LOGIC="field_type_logic",e.TRACE="field_type_trace",e))(ml||{}),be=(e=>(e.PRIMARY_KEY="primary_key",e.ASSOCIATED_PRIMARY_KEY="associated_primary_key",e.TEXT="text",e.LONG_TEXT="long_text",e.INTEGER="integer",e.LONG="long",e.DOUBLE="double",e.DECIMAL="decimal",e.BOOLEAN="boolean",e.DATE="date",e.TIME="time",e.DATE_TIME="date_time",e.IMAGE="image",e.ATTACHMENT="attachment",e.SERIAL="serial_number",e.MASTERSLAVE="master_slave",e.USER="user",e.USER_MULTI="user_multi",e.ORG="org",e.ORG_MULTI="org_multi",e.ENUM="enum",e.ENUM_MULTI="enum_multi",e.OPTION="option",e.OPTION_MULTI="option_multi",e.REF="ref",e.REF_MULTI="ref_multi",e.RDO_REF="rdo_ref",e.EXPRESSION="expression",e.EXPRESSION_CONDITION="expression_condition",e.AGG="agg",e.ESOP="esop",e.TRANSACTION="transaction",e.LABEL_TEMPLATE="label_template",e.LABEL_TEMPLATE_REF="label_template_ref",e.DOCUMENT_TEMPLATE="document_template",e.SERIALRULE="serial_number_rule",e.PRINTER="printer",e.MESSAGE_TMPL="message_tmpl",e.RANGE_USER="range_user",e.SIGNATURE="electronic_signature",e.ONLINE_FORM_TEMPLATE="online_form_tmpl",e.E_DHR_TEMPLATE="edhr_tmpl",e.ONLINE_FORM="online_form",e.DATA_TABLE_FORMULA="data_table_formula",e.READONLYCMP="readonlycmp",e.MATERIAL_NO="material_no",e.PRODUCT="product",e.DEVICE="device",e.Biz_Process="biz_process",e.TENANT="tenant",e))(be||{}),yl=(e=>(e.TEXT="text",e.LONG_TEXT="long_text",e.INTEGER="integer",e.LONG="long",e.DOUBLE="double",e.DECIMAL="decimal",e.BOOLEAN="boolean",e.DATE="date",e.TIME="time",e.DATE_TIME="date_time",e))(yl||{}),vl=(e=>(e.IMAGE="image",e.ATTACHMENT="attachment",e.SERIAL="serial_number",e.MASTERSLAVE="master_slave",e.USER="user",e.USER_MULTI="user_multi",e.ORG="org",e.ORG_MULTI="org_multi",e.ENUM="enum",e.ENUM_MULTI="enum_multi",e.OPTION="option",e.OPTION_MULTI="option_multi",e.REF="ref",e.REF_MULTI="ref_multi",e.RDO_REF="rdo_ref",e.EXPRESSION="expression",e.EXPRESSION_CONDITION="expression_condition",e.AGG="agg",e.ESOP="esop",e.TRANSACTION="transaction",e.LABEL_TEMPLATE="label_template",e.LABEL_TEMPLATE_REF="label_template_ref",e.DOCUMENT_TEMPLATE="document_template",e.SERIALRULE="serial_number_rule",e.PRINTER="printer",e.MESSAGE_TMPL="message_tmpl",e.RANGE_USER="range_user",e.SIGNATURE="electronic_signature",e.ONLINE_FORM_TEMPLATE="online_form_tmpl",e.E_DHR_TEMPLATE="edhr_tmpl",e.ONLINE_FORM="online_form",e.Biz_Process="biz_process",e))(vl||{}),_l=(e=>(e.MATERIAL_NO="material_no",e.PRODUCT="product",e.DEVICE="device",e))(_l||{});const Bd={attachment:"string",boolean:"boolean",date:"string",date_time:"string",decimal:"number",double:"number",enum:"string",enum_multi:"string",image:"string",integer:"number",long:"number",long_text:"string",master_slave:"string",org:"string",org_multi:"string",rdo_ref:"string",ref:"string",ref_multi:"string",serial_number:"string",text:"string",time:"string",user:"string",user_multi:"string",expression:"string",expression_condition:"string",agg:"number",esop:"string",serial_number_rule:"string",label_template:"string",label_template_ref:"string",document_template:"string",transaction:"string",printer:"string",message_tmpl:"string",range_user:"string",primary_key:"string",associated_primary_key:"string",readonlycmp:"string",material_no:"string",product:"string",device:"string",option:"string",option_multi:"string",electronic_signature:"string",online_form_tmpl:"string",edhr_tmpl:"string",online_form:"string",data_table_formula:"string",biz_process:"string",tenant:"string"};var El=(e=>(e.SYSTEM="SYSTEM",e.USER_DEFINED="USER_DEFINED",e.BUILTIN="BUILTIN",e.CUSTOM="CUSTOM",e.PROCESS="PROCESS",e))(El||{}),wl=(e=>(e.CATALOG="CATALOG",e.STANDARD="STANDARD",e.LINK="LINK",e))(wl||{}),Sl=(e=>(e.PRESENT="PRESENT",e.IFRAME="IFRAME",e.NEW="NEW",e))(Sl||{}),Al=(e=>(e.MaterialFormField="formField",e.MaterialTableField="tableField",e.MaterialEmbedTableField="embedTableField",e.MaterialSubTableField="subTableField",e.MaterialSubTableModalField="subTableModalField",e.cardListFormField="cardList",e.MaterialTableSelectField="tableSelectField",e.DescriptionsFormField="descriptions",e))(Al||{});const Fd={primary_key:"icon-id",text:"icon-wenben1",long_text:"icon-changwenben",integer:"icon-zhengshu",long:"icon-changzhengshu",decimal:"icon-jingduxiaoshu1",double:"icon-xiaoshu",boolean:"icon-buer",date:"icon-riqi1",time:"icon-shijian1",date_time:"icon-riqishijian",user:"icon-renyuanguanlian",org:"icon-bumenguanlian",user_multi:"icon-renyuanduoxuan",org_multi:"icon-bumenduoxuan",image:"icon-tupian1",attachment:"icon-fujian1",serial_number:"icon-xuliehao",master_slave:"icon-zhuziguanlian",enum:"icon-meijuguanlian",ref:"icon-moxingguanlian",rdo_ref:"icon-RDOmoxingguanlian",enum_multi:"icon-meijuguanlianduoxuan",option:"icon-meijuguanlian",option_multi:"icon-meijuguanlianduoxuan",ref_multi:"icon-moxingduoxuan",expression:"icon-gongshiziduan",expression_condition:"icon-gongshiziduan",agg:"icon-huizong",esop:"icon-E-SOP",transaction:"icon-ziduan1",serial_number_rule:"icon-ziduan1",printer:"icon-dayinanniu",message_tmpl:"icon-xiaoximoban",range_user:"icon-fanweirenyuan",label_template:"icon-biaoqianmoban",label_template_ref:"icon-biaoqianmoban",document_template:"icon-danjumoban",electronic_signature:"icon-qianming1",online_form_tmpl:"icon-zaixianbiaodanmoban",edhr_tmpl:"icon-edhr",online_form:"icon-zaixianbiaodan",data_table_formula:"icon-gongshiziduan",readonlycmp:"icon-wenben1",tenant:"icon-id",associated_primary_key:"icon-id",material_no:"icon-field-material-no",product:"icon-field-product",device:"icon-field-device",biz_process:"icon-jichengzhongxin1"};var Tl=(e=>(e.COUNT="COUNT",e.SUM="SUM",e.MAX="MAX",e.MIN="MIN",e.AVG="AVG",e))(Tl||{}),Il=(e=>(e.SPEC="spec",e.SUB_WORKFLOW="sub_workflow",e))(Il||{}),Rl=(e=>(e.None="none",e.SingleChoice="gct_radio",e.MultipleChoice="checkbox",e))(Rl||{}),Ol=(e=>(e.NONE="NONE",e.GLOBAL="GLOBAL",e.LEVEL="LEVEL",e.LOGIC="LOGIC",e))(Ol||{});const jd={ALL:"all",UNREAD:"unread"},Wd={TEST:"myTestApp",QUICK:"quickAccess",MY:"myApp"};var Nl=(e=>(e.PROFILE="profile",e.GENDER="gender",e.ENTERPRISE="enterprise",e))(Nl||{}),Ll=(e=>(e.FEMALE="female",e.MALE="male",e.PRIVARY="privary",e))(Ll||{}),Ml=(e=>(e.TODO="todo",e.APPLICATION="application",e.DONE="done",e.DELEGATE="delegate",e))(Ml||{}),Pl=(e=>(e.HOVER="hover",e.CLICK="click",e))(Pl||{});const Gd=[be.TEXT,be.LONG_TEXT,be.LONG,be.INTEGER,be.DECIMAL,be.DOUBLE,be.SERIAL];var Cl=(e=>(e.SCRIPT_SERVICE="SCRIPT_SERVICE",e.SQL_SERVICE="SQL_SERVICE",e.SO_SERVICE="SO_SERVICE",e.BUILTIN_SERVICE="SYS_BUILTIN",e))(Cl||{}),is=(e=>(e.ENTITY="entity",e.DATA="data",e.VIEW="view",e.FORM="form",e.DATA_SET="dataSet",e))(is||{}),xl=(e=>(e.BASE="BASE",e.NDO="NDO",e.RDO="RDO",e.TREE="TREE",e.DYNAMIC_FORM="DYNAMIC_FORM",e.WORKFLOW="WORKFLOW",e.TRANSACTION="TRANSACTION",e))(xl||{}),Dl=(e=>(e.NONE="NONE",e.FIXED="FIXED",e.SYS_VAR="SYS_VAR",e))(Dl||{}),kl=(e=>(e.NULL="",e.SYS_DATE="SYS_DATE",e.SYS_TIME="SYS_TIME",e.SYS_DATE_TIME="SYS_DATE_TIME",e.CURRENT_USER="CURRENT_USER",e.CURRENT_ORG="CURRENT_ORG",e))(kl||{}),Ul=(e=>(e.EVENT="event",e.BUSINESSSERVICE="businessService",e.TIMER="timer",e))(Ul||{}),Bl=(e=>(e.SHOW_BOX_SCROLL="showBoxScroll",e.SHOW_ALL_DATA="showAllData",e))(Bl||{}),Fl=(e=>(e.PAGE="page",e.HISTORY="history",e.GLOBAL="global",e.WIDGET="widget",e.CHANGE_DESIGN="changeDesign",e))(Fl||{}),jl=(e=>(e.STATIC="static",e.RELATIVE="relative",e.ABSOLUTE="absolute",e.FIXED="fixed",e.STICKY="sticky",e))(jl||{}),Wl=(e=>(e.NONE="none",e.SOLID="solid",e.DOTTED="dotted",e.DASHED="dashed",e.DOUBLE="double",e))(Wl||{}),Gl=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.JUSTIFY="justify",e))(Gl||{}),Hl=(e=>(e.LINETHROUGH="line-through",e.UNDERLINE="underline",e.NONE="none",e))(Hl||{}),Vl=(e=>(e.INNER="inner",e.JS="js",e))(Vl||{}),$l=(e=>(e.BASIC="basic",e.ADVANCED="advance",e.DISPLAY="display",e.LABEL="label",e.FIELD="field",e.DATA="data",e.OTHER="other",e.LIST="list",e.Table="table",e.SUBMIT_RULE="submitRule",e.LISTDATA="listdata",e.SHOW="show",e.FIELD_CONFIG="fieldConfig",e.FORM_CONFIG="formConfig",e.FIELD_LAYOUT="FieldLayout",e.LEFT_RIGHT_COLUMNS="leftRightColumns",e.TABLESELECT_CONFIG="tableSelect",e.GENRADIO="genRadio",e.GENCHECKBOX="genCheckbox",e.GENSWITCH="genSwitch",e.OPTIONS="options",e.COLLAPSE="collapse",e.SPACE_OCCUPATION="spaceOccupation",e.DIVIDER="divider",e.IFRAME="iframe",e.FILECOLLECT="fileCollect",e.CARDLIST="cardList",e.BUTTON="button",e.Button="Button",e.ButtonShow="ButtonShow",e.ButtonStyle="ButtonStyle",e.LISTBUTTON="listButton",e.MODAL="modal",e.MODALWIDTH="modalWidth",e.MODALHEIGHT="modalHeight",e.MODALTITLECONFIG="modalTitleConfig",e.SEARCH="search",e.QUERY="query",e.INPUT_CONFIG="inputConfig",e.DATALINKAGE="dataLinkage",e.PERMISSION="permission",e.DATASOURCE="dataSource",e.VALIDATERULE="validaterule",e.TEXT="text",e.GRID_CONFIG="gridConfig",e.COL_CONFIG="colConfig",e.COMPONENTDEPENDENCY="componentDependency",e.GENIMAGE="genImage",e.DATARANGE="dataRange",e.OPERATOR_CONFIG="operatorConfig",e.BUSINESS_CONFIG="businessConfig",e.Vue3="Vue3",e.TREE_CONFIG="treeConfig",e.CARDDISPLAY="cardDisplay",e))($l||{}),ql=(e=>(e.LAYOUT="layout",e.STYLE="style",e.BACKGROUND="background",e.MARGIN="margin",e.BORDER="border",e.HEADER="header",e.SHOW_PROP="showProp",e))(ql||{}),Yl=(e=>(e.TAG="tag",e.PROGRESS="progress",e))(Yl||{}),Kl=(e=>(e.RADIUS="radius",e.LINEAR_RADIUS="linear_radius",e.BIG_RADIUS="big_radius",e.LINEAR_BIG_RADIUS="linear_big_radius",e.DASHED_RADIUS="dashed_radius",e.STATUS="status",e))(Kl||{}),Xl=(e=>(e.RADIUS="radius",e.BIG_RADIUS="big_radius",e.STATUS="status",e.SURFACE_RADIUS="surface_radius",e.SURFACE_BIG_RADIUS="surface_big_radius",e.SURFACE_STATUS="surface_status",e.LINE_RADIUS="line_radius",e.LINE_BIG_RADIUS="line_big_radius",e.LINE_DASHED_RADIUS="line_dashed_radius",e.LINE_STATUS="line_status",e))(Xl||{}),zl=(e=>(e.CIRCLE="circle",e.LINE="line",e))(zl||{}),Ql=(e=>(e.RULE="rule",e.CONFIG="config",e))(Ql||{}),Jl=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="NULL",e.DATE="date",e.DATETIME="datetime",e.TIME="time",e.VAR="var",e))(Jl||{}),Zl=(e=>(e.MODAL="modal",e.EVENT="event",e.VAR="var",e))(Zl||{}),eu=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(eu||{}),tu=(e=>(e.CLOSE_MODAL="__CLOSEMODAL__",e.OPEN_MODAL="__OPENMODAL__",e.REFRESH_TABLE="__REFRESHTABLE__",e))(tu||{}),ru=(e=>(e.INLINE="inline",e.MODAL="modal",e))(ru||{}),nu=(e=>(e.DELETE="delete",e.COPY="copy",e))(nu||{}),iu=(e=>(e.DELETE="delete",e.EDIT="edit",e.COPY="copy",e))(iu||{}),ou=(e=>(e.JS="js",e))(ou||{}),su=(e=>(e.alwaysCover="alwaysCover",e.notCovered="notCovered",e))(su||{}),au=(e=>(e.HIDDEN="hidden",e.READONLY="readonly",e.DISABLED="disabled",e.REQUIRED="required",e.ASSIGNMENT="assignment",e))(au||{}),lu=(e=>(e.OUTLINE="OUTLINE",e.WIDGETS="WIDGETS",e.FIELD="FIELD",e.MODAL="MODAL",e.JS="JS",e.CSS="CSS",e.TEMPLATE="TEMPLATE",e.LO="LO",e))(lu||{}),uu=(e=>(e.FORM="form",e.LAYOUT="layout",e.ADVANCED="advanced",e.DATA="data",e.BUTTON="button",e.RDO="rdo",e.KIT="kit",e.PROCESS="process",e))(uu||{}),os=(e=>(e.WEB="web",e.MOBILE="mobile",e.PAD="pad",e))(os||{}),cu=(e=>(e.MODAL="modal",e.MODAL_BODY="modalBody",e.MODAL_FOOTER="modalFooter",e.BottomButtonContainer="bottom-button-container",e))(cu||{}),fu=(e=>(e.WEEK_NOW="sys.pageDesigner.dateRange.weekNow",e.MONTH_NOW="sys.pageDesigner.dateRange.monthNow",e.QUARTER_NOW="sys.pageDesigner.dateRange.quarterNow",e.YEAR_NOW="sys.pageDesigner.dateRange.yearNow",e.WEEk_BEFORE="sys.pageDesigner.dateRange.weekBefore",e.MONTH_BEFORE="sys.pageDesigner.dateRange.monthBefore",e.QUARTER_BEFORE="sys.pageDesigner.dateRange.quarterBefore",e.YEAR_BEFORE="sys.pageDesigner.dateRange.yearBefore",e.DATE_BEFORE="sys.pageDesigner.dateRange.dateBefore",e.DATE_AFTER="sys.pageDesigner.dateRange.dateAfter",e))(fu||{}),hu=(e=>(e.DROPDOWN_SELECTION="dropdownSelection",e.TREE_SELECTION="treeSelection",e.MODAL_BOX_SELECTION="modalBoxSelection",e))(hu||{}),du=(e=>(e["¥"]="¥",e.$="$",e.S$="S$",e))(du||{}),pu=(e=>(e.d="d",e["d:h"]="d:h",e["d:h:m"]="d:h:m",e["d:h:m:s"]="d:h:m:s",e.h="h",e["h:m"]="h:m",e["h:m:s"]="h:m:s",e.m="m",e["m:s"]="m:s",e.s="s",e))(pu||{}),gu=(e=>(e.d="days",e["d:h"]="dayhour",e["d:h:m"]="dayhourminute",e["d:h:m:s"]="dayhourminutesecond",e.h="hour",e["h:m"]="hourminute",e["h:m:s"]="hourminutesecond",e.m="minute",e["m:s"]="minutesecond",e.s="seconds",e))(gu||{}),bu=(e=>(e["¥"]="chMoney",e.$="usMoney",e.S$="sgpMoney",e))(bu||{}),mu=(e=>(e.SingleChoice="radio",e.MultipleChoice="checkbox",e))(mu||{}),yu=(e=>(e.Current="current",e.Whole="whole",e))(yu||{}),vu=(e=>(e.Local="local",e.Server="server",e.PREVIEW_PRINT="PreviewPrint",e.DIRECT_PRINTING="DirectPrinting",e))(vu||{}),_u=(e=>(e.OPEN="open",e.APPROVE="linkApprove",e))(_u||{}),Eu=(e=>(e.SYSTEM="system",e.TRANSACTION="transaction",e))(Eu||{}),wu=(e=>(e.CURRENT="current",e.REFERENCE="reference",e))(wu||{}),Su=(e=>(e.BLOCK="block",e.INLINE_BLOCK="inline-block",e))(Su||{}),Au=(e=>(e.DEFAULT="default",e.LINK="link",e))(Au||{}),Tu=(e=>(e.DEFAULT="default",e.PRIMARY="primary",e.ERROR="error",e.WARNING="warning",e.SUCCESS="success",e))(Tu||{}),Iu=(e=>(e.ORDINARY="ordinary",e.SQUARE="square",e))(Iu||{}),Ru=(e=>(e.SMALL="small",e.DEFAULT="middle",e.LARGE="large",e))(Ru||{}),Ou=(e=>(e.TEXT="TEXT",e.ICON_TEXT="ICON_TEXT",e.ICON="ICON",e))(Ou||{}),Nu=(e=>(e.PRIMARY="primary",e.DEFAULT="default",e.DASHED="dashed",e.LINK="link",e))(Nu||{}),Lu=(e=>(e.PRIMARY="primary",e.DANGER="danger",e.DEFAULT="default",e))(Lu||{});const Hd={TEXT:[{type:"primary",label:"sys.pageDesigner.button_primary",hasText:!0},{type:"default",label:"sys.pageDesigner.button_default",hasText:!0},{type:"primary",danger:!0,label:"sys.pageDesigner.button_primary_danger",hasText:!0},{type:"default",danger:!0,label:"sys.pageDesigner.button_danger",hasText:!0},{type:"dashed",label:"sys.pageDesigner.button_dashed",hasText:!0},{type:"link",label:"sys.pageDesigner.button_text",hasText:!0}],ICON_TEXT:[{type:"primary",label:"sys.pageDesigner.button_primary",hasText:!0,hasIcon:!0},{type:"default",label:"sys.pageDesigner.button_default",hasText:!0,hasIcon:!0},{type:"primary",danger:!0,label:"sys.pageDesigner.button_primary_danger",hasText:!0,hasIcon:!0},{type:"default",danger:!0,label:"sys.pageDesigner.button_danger",hasText:!0,hasIcon:!0},{type:"dashed",label:"sys.pageDesigner.button_dashed",hasText:!0,hasIcon:!0},{type:"link",label:"sys.pageDesigner.button_text",hasText:!0,hasIcon:!0}],ICON:[{type:"primary",hasIcon:!0},{type:"default",hasIcon:!0},{type:"primary",danger:!0,hasIcon:!0},{type:"default",danger:!0,hasIcon:!0},{type:"dashed",hasIcon:!0},{type:"link",hasIcon:!0}]};var Mu=(e=>(e.COLUMNDELETE="columnDelete",e.COLUMNLINK="columnLink",e.COPY="copy",e.VERSION_COPY="version_copy",e.VERSION_CREATE="version_create",e.DETAILS="details",e.EDIT="edit",e.USAGEINFORMATION="usageInformation",e.MODELINGTRACEABILITY="modelingTraceability",e.IMPORT="import",e.EXPORT="export",e.BATCHDELETE="batchDelete",e.SUBMIT="submit",e.RESET="reset",e.EXCUTE="excute",e.LABEL_PRINT="label_print",e.DOCUMENT_PRINT="document_print",e.EXAMINE_AND_APPROVE="examineAndApprove",e))(Mu||{}),Pu=(e=>(e.NONE="none",e.EMBEDDED="embedded",e.EXTERNAL="external",e))(Pu||{}),Cu=(e=>(e.DEFAULT="default",e.EMBED="embed",e.SUB="sub",e))(Cu||{}),xu=(e=>(e.DEFAULTEDITING="defaultEditing",e.CLICKTOENTEREDITING="clickToEnterEditing",e))(xu||{}),Du=(e=>(e.GCT="gct",e.GCT_MODAL="gct-modal",e.GCT_SUB_TABLE_MODAL="gct-sub-table-modal",e))(Du||{}),ku=(e=>(e.ALL="ALL",e.SEARCH="SEARCH",e.SEARCHALL="SEARCHALL",e.LEVEL="LEVEL",e.CHILDREN="CHILDREN",e))(ku||{}),Uu=(e=>(e.REALTIMEDATASOURCE="realTimeDataSource",e.SERVICEDATASOURCE="serviceDataSource",e))(Uu||{}),Bu=(e=>(e.SIGNATURE_ONLY="signature_only",e.SIGNATURE_DATE="signature_date",e.SIGNATURE_DATETIME="signature_datetime",e))(Bu||{}),Fu=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Fu||{}),ju=(e=>(e.WIPE_DATA="wipe_data",e.REFRESHDATA="refresh_data",e))(ju||{}),Wu=(e=>(e.PAGE="page",e.MODAL="modal",e))(Wu||{}),Gu=(e=>(e.RdoInput="rdo-input",e.Input="input",e.ElectronicSignature="electronic-signature",e.UseinfoButton="useinfo-button",e.ModelingButton="modeling-button",e.ImportButton="gc-import-button",e.ExportButton="gc-export-button",e.DocumentPrintButton="document-print-button",e.SubmitButton="submit-button",e.BatchDeleteButton="batchdelete-button",e.CustomButton="custom-button",e.TableLinkButton="table-link-button",e.TableInfoButton="table-info-button",e.TableApproveButton="table-approve-button",e.OpeButton="ope-button",e.ResetButton="reset-button",e.RdoSaveButton="rdo-save-button",e.LabelPrintButton="labelprint-button",e.ProcessButton="process-button",e.ProcessApproveButton="process-approve-button",e.CreateButton="create-button",e.DeleteButton="delete-button",e.CopyButton="copy-button",e.RefreshButton="refresh-button",e.CreateVersionButton="create-version-button",e.CopyVersionButton="copy-version-button",e.Checkbox="checkbox",e.DataTable="data-table",e.DataVTable="data-v-table",e.TreeTable="tree-table",e.DataTableColumn="data-table-column",e.RefDataTable="ref-data-table",e.DataList="data-list",e.RdoDataList="rdo-data-list",e.DataTableOpe="data-table-ope",e.DataTableFormula="data-table-formula",e.Datepicker="datepicker",e.DateTimepicker="datetimepicker",e.Department="department",e.Form="form",e.RdoForm="rdo-form",e.RdoTable="rdo-table",e.MedProRdoForm="medprordo-form",e.MedProRdoTable="medprordo-table",e.FormProcess="form-process",e.Inputmoney="inputmoney",e.Inputnumber="inputnumber",e.InputDouble="inputdouble",e.Radio="radio",e.Select="select",e.RdoSelect="rdo-select",e.Switch="switch",e.Textarea="textarea",e.Timepicker="timepicker",e.Userpicker="userpicker",e.Search="search",e.SelectSearch="select-search",e.QuickSearch="quick-search",e.LayoutContainer="layout-container",e.ButtonContainer="button-container",e.ButtonProcessContainer="button-process-container",e.BottomButtonContainer="bottom-button-container",e.Grid="grid",e.GridCol="grid-col",e.Tabs="tabs",e.TabPane="tab-pane",e.LeftRightColumns="left-right-columns",e.TopBottomColumns="top-bottom-columns",e.LeftLayoutThree="left-layout-three",e.TopLayoutThree="top-layout-three",e.UploadFile="upload-file",e.UploadImage="upload-image",e.SubTable="sub-table",e.SubTableOpe="sub-table-ope",e.SubTableAddBtn="sub-table-add-button",e.SubTableCopyBtn="sub-table-copy-button",e.SubTableEditBtn="sub-table-edit-button",e.SubTableDeleteBtn="sub-table-delete-button",e.LinkPageBtn="link-page-button",e.Collapse="collapse",e.SpaceOccupation="space-occupation",e.Divider="divider",e.CardList="card-list",e.CardHeaderLeft="card-header-left",e.CardHeaderRight="card-header-right",e.CardContent="card-content",e.CardOpeBtn="card-ope-btn",e.BaseButton="base-button",e.ReadonlyCmp="readonlycmp",e.TableSelect="table-select",e.GenCheckbox="gen-checkbox",e.GenRadio="gen-radio",e.GenSwitch="gen-switch",e.WorkflowNodes="workflow-nodes",e.WorkflowNodeModal="workflow-node-modal",e.ESOP="e-sop",e.EXPRESSION="expression",e.ExpressionCondition="expression-condition",e.AGG="agg",e.DynamicFormType="dynamic-form-type",e.DynamicFormValue="dynamic-form-value",e.DynamicFormOpts="dynamic-form-options",e.DynamicFormShowType="dynamic-form-show-type",e.DynamicTable="dynamic-table",e.Transaction="transaction",e.SerialRule="serial-rule",e.LabelTemplate="label-template",e.LabelTemplateRef="label-template-ref",e.DocumentTemplate="document-template",e.Wacom="wacom",e.Text="text",e.CustomField="custom-field",e.Printer="printer",e.Descriptions="descriptions",e.RangeUser="range-user",e.GenImage="gen-image",e.TestButton="test-button",e.Iframe="iframe",e.ExcuteButton="medproexcute-button",e.SubDataTable="sub-data-table",e.Signature="signature",e.OnlineForm="online-form",e.TmplTreeSelect="tmpl-tree-select",e.Boolean="boolean",e.BizProcess="biz-process",e.ApprovalHistory="approval-history",e.FlowDiagram="flow-diagram",e.CustomCode="custom-code",e.ApprovalProcess="approval-process",e))(Gu||{}),Hu=(e=>(e.SearchInput="SearchInput",e.SearchNumberInput="SearchNumberInput",e.SearchStringNumberInput="SearchStringNumberInput",e.SearchSwitch="SearchSwitch",e.SearchDate="SearchDate",e.SearchDateTime="SearchDateTime",e.SearchTime="SearchTime",e.SearchSelect="SearchSelect",e.SearchUserSelect="SearchUserSelect",e.SearchRdoSelect="SearchRdoSelect",e.SearchTransaction="SearchTransaction",e.SearchTmplTreeSelect="SearchTmplTreeSelect",e.SearchPrinter="SearchPrinter",e.SearchBizProcess="SearchBizProcess",e.SearchSelectRangUser="SearchSelectRangUser",e.SearchSelectDepartment="SearchSelectDepartment",e))(Hu||{}),Vu=(e=>(e.AUTO_PARENT_BOX="AutoParentBox",e.ATUO="selfAdaption",e.ENUMERATION="fixed",e.PERCENTAGE="percentage",e))(Vu||{}),$u=(e=>(e.NULL="NULL",e.STRING="空字符串",e.ZERO="0",e))($u||{}),qu=(e=>(e.TOTAL="total",e.AVERAGE="average",e))(qu||{}),Yu=(e=>(e.RIGHT="right",e.NONE="",e.LEFT="left",e))(Yu||{}),Ku=(e=>(e.COLUMN_TEXT="COLUMN_TEXT",e.COLUMN_NUMBER="COLUMN_NUMBER",e.COLUMNTEXT_DATA="COLUMNTEXT_DATA",e.COLUMNTEXT_REF="COLUMNTEXT_REF",e.COLUMNTEXT_ENUM="COLUMNTEXT_ENUM",e.COLUMNTEXT_ORG="COLUMNTEXT_ORG",e.COLUMNTEXT_USER="COLUMNTEXT_USER",e.COLUMNTEXT_BOOLEAN="COLUMNTEXT_BOOLEAN",e.COLUMNTEXT_IMAGE="COLUMNTEXT_IMAGE",e))(Ku||{}),Xu=(e=>(e.LINE="line",e.CARD="card",e.TEXt="text",e.CAPSULE="capsule",e.CUSTOM="custom",e))(Xu||{}),zu=(e=>(e.ASC="asc",e.DESC="desc",e))(zu||{}),Qu=(e=>(e.CMP_TEXT="TEXT",e.CMP_TEXTAREA="TEXTAREA",e.CMP_ELECTRONICSIGNATURE="ELECTRONICSIGNATURE",e.CMP_BOOLEAN="BOOLEAN",e.CMP_SELECT_LIST="SELECT_LIST",e.CMP_RADIO="RADIO",e.CMP_CHECKBOX="CHECKBOX",e.CMP_DROPDOWN_SELECT="dropdownSelection",e.CMP_MODAL="modalBoxSelection",e.CMP_TREE_SELECTION="treeSelection",e.CMP_NUMBER="NUMBER",e.CMP_CURRENCY="CURRENCY",e.CMP_TIME="TIME",e))(Qu||{});const Vd={TEXT:"sys.pageDesigner.bindCmpStyle.bindText",TEXTAREA:"sys.pageDesigner.bindCmpStyle.bindTextarea",ELECTRONICSIGNATURE:"sys.pageDesigner.bindCmpStyle.electronicSignature",BOOLEAN:"sys.pageDesigner.bindCmpStyle.bindBoolean",SELECT_LIST:"sys.pageDesigner.bindCmpStyle.bindSelectList",RADIO:"sys.pageDesigner.bindCmpStyle.bindRadio",CHECKBOX:"sys.pageDesigner.bindCmpStyle.bindCheckbox",dropdownSelection:"sys.pageDesigner.bindCmpStyle.bindDropdownSelect",modalBoxSelection:"sys.pageDesigner.bindCmpStyle.bindModal",treeSelection:"sys.pageDesigner.bindCmpStyle.bindTreeSelection",NUMBER:"sys.pageDesigner.bindCmpStyle.bindNumber",CURRENCY:"sys.pageDesigner.bindCmpStyle.bindCurrency",TIME:"sys.pageDesigner.bindCmpStyle.bindTime"};var Ju=(e=>(e.BindText="bindText",e.BindLongText="BindLongText",e.BindBool="bindBool",e.BindPerson="bindPerson",e.BindDept="bindDept",e.BindLink="bindLink",e.BindMulti="bindMulti",e.BindNum="bindNum",e.BindDecimal="bindDecimal",e))(Ju||{});const $d={TEXT:"input",TEXTAREA:"textarea",ELECTRONICSIGNATURE:"electronic-signature",SELECT_LIST:"select",RADIO:"radio",CHECKBOX:"checkbox"},qd={bindText:["TEXT","TEXTAREA"],BindLongText:["TEXT","TEXTAREA","ELECTRONICSIGNATURE"],bindBool:["BOOLEAN","SELECT_LIST","RADIO","CHECKBOX"],bindPerson:["dropdownSelection","modalBoxSelection"],bindDept:["treeSelection","modalBoxSelection"],bindLink:["SELECT_LIST","RADIO"],bindMulti:["SELECT_LIST","CHECKBOX"],bindNum:["NUMBER","CURRENCY","TIME"],bindDecimal:["NUMBER","CURRENCY"]};var Zu=(e=>(e.FOLD_ALL="foldAll",e.FOLD_PART="foldPart",e))(Zu||{});const Yd=[be.BOOLEAN,be.DATE,be.DATE_TIME,be.DECIMAL,be.DOUBLE,be.ENUM,be.ENUM_MULTI,be.INTEGER,be.LONG,be.LONG_TEXT,be.TEXT,be.USER_MULTI,be.USER,be.TIME,be.REF_MULTI,be.REF,be.RDO_REF,be.ORG_MULTI,be.ORG,be.SERIAL,be.ONLINE_FORM_TEMPLATE,be.E_DHR_TEMPLATE,be.PRINTER,be.LABEL_TEMPLATE_REF,be.Biz_Process,be.DOCUMENT_TEMPLATE,be.TRANSACTION,be.RANGE_USER,be.MESSAGE_TMPL],Kd=[be.BOOLEAN,be.DATE,be.DATE_TIME,be.DECIMAL,be.DOUBLE,be.ENUM,be.ENUM_MULTI,be.INTEGER,be.LONG,be.LONG_TEXT,be.TEXT,be.USER_MULTI,be.USER,be.TIME,be.REF_MULTI,be.REF,be.RDO_REF,be.ORG_MULTI,be.ORG,be.SERIAL,be.ONLINE_FORM_TEMPLATE,be.E_DHR_TEMPLATE,be.PRINTER,be.LABEL_TEMPLATE_REF,be.Biz_Process,be.DOCUMENT_TEMPLATE,be.TRANSACTION,be.MESSAGE_TMPL],Xd=[be.BOOLEAN,be.DATE,be.DATE_TIME,be.DECIMAL,be.DOUBLE,be.ENUM,be.ENUM_MULTI,be.INTEGER,be.LONG,be.LONG_TEXT,be.TEXT,be.USER_MULTI,be.USER,be.TIME,be.REF_MULTI,be.REF,be.RDO_REF,be.ORG_MULTI,be.ORG,be.SERIAL,be.PRINTER,be.LABEL_TEMPLATE_REF,be.TRANSACTION];var ec=(e=>(e.FIELD_LIST="fieldList",e.FIELD_FORM="fieldForm",e))(ec||{}),tc=(e=>(e.CLIENT_PRINT="CLIENT_PRINT",e.INTERNET_PRINT="INTERNET_PRINT",e))(tc||{}),rc=(e=>(e.SUCCESS="SUCCESS",e.FAILURE="FAILURE",e.PREPARING="PREPARING",e.EVENTING="EVENTING",e.PROCESSIING="PROCESSIING",e.DEPLOYING="DEPLOYING",e))(rc||{}),nc=(e=>(e.Insert="Insert",e.Update="Update",e.Delete="Delete",e.Import="Import",e.Export="Export",e.Setting="Setting",e.Download="Download",e.Test="Test",e.Design="Design",e.Add="Add",e))(nc||{}),ic=(e=>(e.ResetPassword="ResetPassword",e.PermissionSetting="PermissionSetting",e.RemoveAndHandover="RemoveAndHandover",e.CategoryManagement="CategoryManagement",e.BaiscSetting="BaiscSetting",e.WatermarkSetting="WatermarkSetting",e.SecuritySetting="SecuritySetting",e.LoginSetting="LoginSetting",e.ThemeSetting="ThemeSetting",e.OrganizationSetting="OrganizationSetting",e.ApkSetting="ApkSetting",e.DevelopIconManagement="DevelopIconManagement",e.DevelopImageManagement="DevelopImageManagement",e.Reprint="Reprint",e.ViewTask="ViewTask",e.ManualTrigger="ManualTrigger",e.Setting="Setting",e.Terminate="Terminate",e.Reassign="Reassign",e.Log="Log",e.Moving="Moving",e.EnableDisable="EnableDisable",e))(ic||{});const zd=["Insert","Update","Delete"],Qd=["BaiscSetting","WatermarkSetting","SecuritySetting","LoginSetting","ThemeSetting","OrganizationSetting","ApkSetting"];var oc=(e=>(e.XS="XS",e.SM="SM",e.MD="MD",e.LG="LG",e.XL="XL",e.XXL="XXL",e))(oc||{}),sc=(e=>(e[e.XS=480]="XS",e[e.SM=576]="SM",e[e.MD=768]="MD",e[e.LG=992]="LG",e[e.XL=1200]="XL",e[e.XXL=1600]="XXL",e))(sc||{});const tr=new Map;tr.set("XS",480);tr.set("SM",576);tr.set("MD",768);tr.set("LG",992);tr.set("XL",1200);tr.set("XXL",1600);const ac="TIMEZONE__",Jd="TENANT__",Zd="TOKEN__",ep="LOCALE__",tp="LOCALE__LIST",rp="LOCAL_I18N_TRANSLATE",np="USER__INFO__",ip="ROLES__KEY__",op="PROJ__CFG__KEY__",sp="LOCK__INFO__KEY__",ap="MULTIPLE_TABS__KEY__",lp="__APP__DARK__MODE__",up="COMMON__LOCAL__KEY__",cp="COMMON__SESSION__KEY__",fp="DESIGNER_SESSION_CACHE_KEY";var lc=(e=>(e[e.SESSION=0]="SESSION",e[e.LOCAL=1]="LOCAL",e))(lc||{}),uc=(e=>(e.EQ="eq",e.IEQ="iEq",e.NE="ne",e.INE="ine",e.GT="gt",e.GE="ge",e.LT="lt",e.LE="le",e.ISNULL="isNull",e.ISNOTNULL="isNotNull",e.LIKE="like",e.ILIKE="iLike",e.NOTLIKE="notLike",e.NOTILIKE="iNotLike",e.LEFTLIKE="leftLike",e.ILEFTLIKE="iLeftLike",e.RIGHTLIKE="rightLike",e.IRIGHTLIKE="iRightLike",e.IN="in",e.NOTIN="notIn",e.CONTAINANY="containAny",e.CONTAINALL="containAll",e.RANGE="range",e.ORANGE="oRange",e.LORANGE="loRange",e.RORANGE="roRange",e.VERSIONIN="versionIn",e.VERSIONNOTIN="versionNotIn",e.VERSIONEQ="versionEq",e.VERSIONNE="versionNe",e))(uc||{});const cc=["in","notIn","containAny","containAll","versionIn"];var fc=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.BETWEEN="between",e))(fc||{});const hp=["#DBDBDB","#FFE4E4","#D1D1D1","#838383","#838383","#FFEECB","#D8E3FF","#FF8888","#FF8888","#0DAA9C","#3370FF"];var hc=(e=>(e[e.SINGLELINE=0]="SINGLELINE",e[e.HEAD=1]="HEAD",e[e.BATCH=2]="BATCH",e[e.SINGLELINE_RDO=3]="SINGLELINE_RDO",e))(hc||{}),dc=(e=>(e[e.parentVersion=0]="parentVersion",e[e.childVersion=1]="childVersion",e))(dc||{}),pc=(e=>(e[e.PAGE_NOT_ACCESS=403]="PAGE_NOT_ACCESS",e[e.PAGE_NOT_FOUND=404]="PAGE_NOT_FOUND",e[e.ERROR=500]="ERROR",e[e.NET_WORK_ERROR=1e4]="NET_WORK_ERROR",e[e.PAGE_NOT_DATA=10100]="PAGE_NOT_DATA",e))(pc||{}),ht=(e=>(e.VUE="vue",e.SCRIPT="script",e.RESOURCE="resource",e.AJAX="ajax",e.PROMISE="promise",e))(ht||{}),gc=(e=>(e[e.SUCCESS=200]="SUCCESS",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=401]="TIMEOUT",e.TYPE="success",e))(gc||{}),bc=(e=>(e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e))(bc||{}),mc=(e=>(e.JSON="application/json;charset=UTF-8",e.FORM_URLENCODED="application/x-www-form-urlencoded;charset=UTF-8",e.FORM_DATA="multipart/form-data;charset=UTF-8",e))(mc||{}),yc=(e=>(e.submit="post",e.listByIds="get",e.getone="post",e.listAll="post",e.listByPage="post",e.listTree="post",e.save="post",e.saveOrUpdate="post",e.saveBatch="post",e.importData="post",e.exportData="post",e.remove="post",e.removeById="delete",e.removeByIds="delete",e.update="put",e.updateById="put",e.updateByIds="put",e.rdoSave="post",e.rdoListAll="post",e.rdoListByPage="post",e.rdoListVersionById="get",e.rdoSaveVersion="post",e.rdoSaveBatch="post",e.rdoUpdateVersionById="put",e.rdoRemoveVersionById="delete",e.rdoRemoveById="delete",e.rdoGetVersionById="get",e.getOne="post",e.rdoGetVersionByRefId="post",e.getById="get",e.rdoListAllVersion="post",e.rdoRefListByPage="post",e.export="post",e.import="post",e.rdoExport="post",e.rdoImport="post",e.biz_search="post",e))(yc||{}),vc=(e=>(e.WEB="web",e.PDA="pda",e.PAD="pad",e))(vc||{}),ss=(e=>(e["--"]="--",e.empty="(空)",e.null="null",e["N/A"]="N/A",e.noDisplay="",e))(ss||{}),_c=(e=>(e.STRING="String",e.INTEGER="Integer",e.LONG="Long",e.FLOAT="Float",e.BOOLEAN="Boolean",e.DATE="Date",e))(_c||{}),He=(e=>(e.BASIC="BASE_CFG",e.WATERMARK="MARK_CFG",e.SECURITY="SECURITY_CFG",e.LOGIN="LOGIN_CFG",e.THEME="THEME_CFG",e.ORGANIZATION="ORG_CFG",e.APK="APK_CFG",e.DEPLOY="DEPLOY_CFG",e.GLOBAL="GLOBAL_CFG",e))(He||{}),Ec=(e=>(e.SIDEBAR="sidebar",e.MIX_SIDEBAR="mix-sidebar",e.MIX="mix",e.TOP_MENU="top-menu",e))(Ec||{}),wc=(e=>(e.NONE="NONE",e.FOOTER="FOOTER",e.HEADER="HEADER",e))(wc||{}),Sc=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e.VERTICAL_RIGHT="vertical-right",e.INLINE="inline",e))(Sc||{}),Ac=(e=>(e[e.NONE=0]="NONE",e[e.TOP=1]="TOP",e[e.LEFT=2]="LEFT",e))(Ac||{}),Tc=(e=>(e.CENTER="center",e.START="start",e.END="end",e))(Tc||{}),Ic=(e=>(e.HOVER="hover",e.CLICK="click",e))(Ic||{}),Rc=(e=>(e.BASE_LOGIN="/login",e.BASE_TENANT="/tenant",e.BASE_HOME="/home",e.USER_CENTER="/user-center",e.PROCESS_CENTER="/process",e.MESSAGE_CENTER="/message",e.ERROR_PAGE="/exception",e.ERROR_LOG_PAGE="/error-log/list",e.USER_CENTER_PWD="/user-center/password",e))(Rc||{}),Oc=(e=>(e.SUPER="super",e.TEST="test",e))(Oc||{}),Nc=(e=>(e.DEFAULT="default",e.SMALL="small",e.LARGE="large",e))(Nc||{}),Lc=(e=>(e.APPROVING="APPROVING",e.COMPLETED="COMPLETED",e.REFUSED="REFUSED",e.REJECTED="REJECTED",e.TERMINATED="TERMINATED",e.WITHDRAWN="WITHDRAWN",e))(Lc||{});const dp={APPROVING:"sys.process.status.approving",COMPLETED:"sys.process.status.completed",REFUSED:"sys.process.status.refused",REJECTED:"sys.process.status.rejected",TERMINATED:"sys.process.status.terminated",WITHDRAWN:"sys.process.status.withdrawn"};var Mc=(e=>(e.MY_APPLICATION="myApplication",e.MY_AGENT="myAgent",e.MY_DONE="myDone",e.MY_CUSTOM="myCustom",e.MY_CUSTOM_Modal="myCustomModal",e))(Mc||{}),Pc=(e=>(e.Resubmit="Resubmit",e.End="Terminate",e.Withdraw="Withdraw",e.Approve="Approve",e.Refuse="Refuse",e.Reassign="Reassign",e.Countersign="Countersign",e.Reject="Reject",e))(Pc||{}),Cc=(e=>(e.Required="Required",e.Optional="Optional",e.ApproveRequired="ApproveRequired",e.RefuseRequired="RefuseRequired",e.ReassignRequired="ReassignRequired",e.RejectRequired="RejectRequired",e.CountersignRequired="CountersignRequired",e))(Cc||{}),xc=(e=>(e.BpmnStart="bpmnStart",e.BpmnSubmit="bpmnSubmit",e.BpmnApproval="bpmnApproval",e.BpmnEnd="bpmnEnd",e.BpmnExclusive="bpmnExclusive",e.BpmnJs="bpmnJs",e.BpmnMessage="bpmnMessage",e.BpmnParallel="bpmnParallel",e.BpmnJoin="bpmnJoin",e.BpmnForm="bpmnForm",e.BpmnBusiness="bpmnBusiness",e))(xc||{}),Dc=(e=>(e.DESIGN="design",e.WEB="web",e.MOBILE="mobile",e))(Dc||{}),Ce=(e=>(e[e.SEARCH=0]="SEARCH",e[e.FIELD_DISPLAY=1]="FIELD_DISPLAY",e[e.EXPORT_TEMPLATE=2]="EXPORT_TEMPLATE",e[e.DISPLAY_RULE=3]="DISPLAY_RULE",e[e.PROCESS_TITLE=4]="PROCESS_TITLE",e[e.GATEWAY_RULE=5]="GATEWAY_RULE",e[e.CREATE_FIELD=6]="CREATE_FIELD",e[e.PAAS_CREATE_FIELD=7]="PAAS_CREATE_FIELD",e[e.ENTITY_FORMULA=8]="ENTITY_FORMULA",e[e.IPAAS_BACK=9]="IPAAS_BACK",e[e.LABEL_PRINT=10]="LABEL_PRINT",e[e.NOCODE_BPMN_RULE=11]="NOCODE_BPMN_RULE",e[e.PAAS_BPMN_RULE=12]="PAAS_BPMN_RULE",e[e.ONLINE_FORM_FIELD_FORMULA=13]="ONLINE_FORM_FIELD_FORMULA",e[e.MEDPRO_BUSINESSFLOW=14]="MEDPRO_BUSINESSFLOW",e[e.RUN_FORMULA=15]="RUN_FORMULA",e[e.BI_FORMULA=16]="BI_FORMULA",e[e.DATA_SET_FORMULA=17]="DATA_SET_FORMULA",e))(Ce||{}),Te=(e=>(e.FUNCTION="function",e.FORM="form",e.FIELD="field",e.VARIABLE="variable",e.NODE="node",e.OPERATOR="operator",e))(Te||{}),je=(e=>(e.ARITHMETIC="arithmetic",e.RELATIONSHIP="relationship",e.LOGIC="logic",e.OTHER="other",e))(je||{}),kc=(e=>(e.INNER_VAR="INNER_VAR",e.SYSTEM_VAR="SYSTEM_VAR",e.GLOBAL_VAR="GLOBAL_VAR",e.PAGE_VAR="PAGE_VAR",e))(kc||{}),as=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e))(as||{}),ls=(e=>(e.String="string",e.Double="number",e))(ls||{}),Or=(e=>(e.Text="text",e.LongText="long_text",e.Int="integer",e.Long="long",e.Double="decimal",e.Boolen="boolean",e))(Or||{}),Uc=(e=>(e.Prefix="​",e))(Uc||{});const pp="​";var Bc=(e=>(e.EDHR_FORM_INST_MULTI_PERSON_EDIT_BREAK="FORM_INST_MULTI_PERSON_EDIT_BREAK",e.EDHR_FORM_INST_MULTI_PERSON_EDIT_UNLOCK="FORM_INST_MULTI_PERSON_EDIT_UNLOCK",e))(Bc||{}),Fc=(e=>(e.SELECT_ID="$VAR_GCT_SELECT_ID",e))(Fc||{});class gp{context={aid:"",bid:"",pid:"",platform:os.WEB};globalSetting={emptyDisplay:"--"};appInfo={};userInfo={};projectName=ns.PORTAL;lang="zh-CN"}const bp=(...e)=>mp.bind(null,...e);function mp(e,...t){const o=typeof t=="object"?rs.stringify(t):t;let u=Dn.get(o);return u||(u=(async()=>{try{return await e(...t)}catch(n){throw Dn.delete(o),n}})(),Dn.set(o,u,3e5),u)}class Dn{static cachedata={};static set(t,r,o){this.cachedata[t]={maxAge:o||0,value:r,now:Date.now()}}static get(t){this.reset();const r=this.cachedata[t];return r?r.value:null}static delete(t){return delete this.cachedata[t]}static clear(){this.cachedata={}}static reset(){for(const t in this.cachedata){const r=this.cachedata[t];r&&Date.now()-r.now>r.maxAge&&this.delete(t)}}}class jc{configs=new Map;cache=new Map;getConfig(t){return this.configs.get(t)}register(t){this.configs.set(t.tag,t),t.items&&this.cache.set(t.tag,t.items)}unregister(t){this.configs.delete(t),this.cache.delete(t)}get(t){return this.cache.get(t)||[]}async asyncGet(t,r){const o=this.configs.get(t);return o?o.mode==="static"?this.getByConfig(o):o.mode==="async"?this.cache.has(t)?this.cache.get(t)||[]:this.asyncGetByConfig(o,r):[]:[]}getByConfig(t){return t.items||[]}async asyncGetByConfig(t,r={}){if(t.fetch){const o=await t.fetch(r||{});if(o){const[u,n]=t.keys||["name","id"];return this.deepFormat(o,u,n)}}return[]}deepFormat(t,r,o){return t.map(u=>{const n={label:u[r],value:u[o]};return u.children&&u.children.length>0&&(n.options=this.deepFormat(u.children,r,o)),n})}}const pr=(...e)=>_gct.i18n.global.t(...e);class Qn{data;next;prev;constructor(t,r=null,o=null){this.data=t,this.next=r,this.prev=o}clear(){this.data=null,this.next=null,this.prev=null}}class yp{active=null;add(t){if(!this.active)this.active=new Qn(t);else{if(this.active.next){let o=this.active.next;for(;o;)o=o.next,o&&o.clear()}const r=new Qn(t,null,this.active);this.active.next=r,this.active=r}}delete(t){const{prev:r,next:o}=t;r&&(r.next=o),o&&(o.prev=r),t.clear()}prev(){this.active&&this.active.prev&&(this.active=this.active.prev)}next(){this.active&&this.active.next&&(this.active=this.active.next)}clearAll(){if(this.active){let t=this.active.prev,r=this.active.next;for(;t;)t.clear(),t=t.prev;for(;r;)r.clear(),r=r.next;this.active.clear()}}canUndo(){return!!this.active&&!!this.active.prev}canRedo(){return!!this.active&&!!this.active.next}}const vp=function(e,t=""){const r=document.getElementsByTagName("head")[0],o=document.getElementById("gct-custom-css"+t);o&&r.removeChild(o);const u=document.createElement("style");u.id="gct-custom-css"+t,u.type="text/css",qe.isEmpty(t)?u.innerHTML=e:u.innerHTML=`#${t}{${e}}`,r.appendChild(u)};function _p(e){const t=[];if(e.required&&t.push({required:!0,message:pr("sys.notNull")}),e.reg){const{reg:o,regHint:u}=e,n=new RegExp(o),i=s=>n.test(s);t.push({validator:i,message:u??pr("sys.regError")})}const r=e.validateFn;return r&&t.push({validator:r}),t}function Ep(e){return{all:e=e||new Map,on:function(t,r){var o=e.get(t);o?o.push(r):e.set(t,[r])},off:function(t,r){var o=e.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var o=e.get(t);o&&o.slice().map(function(u){u(r)}),(o=e.get("*"))&&o.slice().map(function(u){u(t,r)})}}}const wp=Ep();class Sp{CACHE_EXPIRATION_TIME=600*1e3;modelCache=new Map;modelLoadingCache=new Map;modelsLoadingCache=new Map;enumCache=new Map;enumLoadingCache=new Map;queryRefDataCache=new Map;queryRefDataLoadingCache=new Map;isExpired(t){return Date.now()>t.expiresAt}createCacheEntry(t){return{data:t,expiresAt:Date.now()+this.CACHE_EXPIRATION_TIME}}async loadModel(t){if(this.modelCache.has(t)){const o=this.modelCache.get(t);if(!this.isExpired(o))return o.data;this.modelCache.delete(t)}if(this.modelLoadingCache.has(t))return this.modelLoadingCache.get(t);const r=(async()=>{try{const o=await _api.apaas.modelMeta.getDetail({modelKey:t});return o?(this.modelCache.set(t,this.createCacheEntry(o)),o):{}}finally{this.modelLoadingCache.delete(t)}})();return this.modelLoadingCache.set(t,r),r}async loadModels(t){const r=t.join(",");if(t.every(n=>{const i=this.modelCache.get(n);return i&&!this.isExpired(i)}))return t.map(n=>this.modelCache.get(n).data);if(t.forEach(n=>{const i=this.modelCache.get(n);i&&this.isExpired(i)&&this.modelCache.delete(n)}),this.modelsLoadingCache.has(r))return this.modelsLoadingCache.get(r);const u=(async()=>{try{const n=t.filter(i=>!this.modelCache.has(i));if(n.length>0){const i=await _api.apaas.modelMeta.getByKeys({modelKeys:n.join(",")});i&&i.length>0&&i.forEach(s=>{this.modelCache.set(s.key,this.createCacheEntry(s)),s.fieldMetaList=s.fieldMetas||[]})}return t.map(i=>this.modelCache.get(i).data)}finally{this.modelsLoadingCache.delete(r)}})();return this.modelsLoadingCache.set(r,u),u}async loadField(t,r){const o=await this.loadModel(t);if(o?.fieldMetaList)return o.fieldMetaList.find(u=>u.key===r)}async loadFieldPaths(t,r,o){if(!o)return[];const u=[],n=!!o.bindFieldKey,i=n?o.modelLink||[o.belongModelKey,o.bindModelKey]:[o.modelKey],s=await this.loadModels(i);if(n)u.push(...s.map(l=>l.name));else{const l=await this.loadModel(o.modelKey);l&&u.push(l.name)}const a=await this.loadModel(t);if(a?.fieldMetaList){const l=a.fieldMetaList.find(c=>c.key===r);l&&u.push(l.name)}return u}async loadEnumList(t,r,o=is.ENTITY){const u=`${o}:${t}:${r}`;if(this.enumCache.has(u)){const i=this.enumCache.get(u);if(!this.isExpired(i))return qe.cloneDeep(i.data);this.enumCache.delete(u),this.enumLoadingCache.delete(u)}if(this.enumLoadingCache.has(u))return this.enumLoadingCache.get(u);const n=(async()=>{try{return[]}finally{this.enumLoadingCache.delete(u)}})();return this.enumLoadingCache.set(u,n),n}async loadQueryRefData(t){if(!t||!t.modelKey)throw new Error("queryRefData 参数缺失");const r=JSON.stringify(t);if(this.queryRefDataCache.has(r)){const u=this.queryRefDataCache.get(r);if(!this.isExpired(u))return qe.cloneDeep(u.data);this.queryRefDataCache.delete(r),this.queryRefDataLoadingCache.delete(r)}if(this.queryRefDataLoadingCache.has(r))return this.queryRefDataLoadingCache.get(r);const o=(async()=>{try{const u=await _api.apaas.modelData.postQueryRefData(t);return u?(this.queryRefDataCache.set(r,this.createCacheEntry(u)),qe.cloneDeep(u)):{}}finally{this.queryRefDataLoadingCache.delete(r)}})();return this.queryRefDataLoadingCache.set(r,o),o}getCachedModel(t){const r=this.modelCache.get(t);if(r&&!this.isExpired(r))return r.data;r&&this.isExpired(r)&&this.modelCache.delete(t)}clear(t){this.modelCache.delete(t),this.modelLoadingCache.delete(t);const r=[];this.modelsLoadingCache.forEach((n,i)=>{i.includes(t)&&r.push(i)}),r.forEach(n=>{this.modelsLoadingCache.delete(n)});const o=[];this.enumCache.forEach((n,i)=>{i.includes(t)&&o.push(i)}),o.forEach(n=>{this.enumCache.delete(n),this.enumLoadingCache.delete(n)});const u=[];this.queryRefDataCache.forEach((n,i)=>{i.includes(`"modelKey":"${t}"`)&&u.push(i)}),u.forEach(n=>{this.queryRefDataCache.delete(n),this.queryRefDataLoadingCache.delete(n)})}clearAll(){this.modelCache.clear(),this.modelLoadingCache.clear(),this.modelsLoadingCache.clear(),this.enumCache.clear(),this.enumLoadingCache.clear(),this.queryRefDataCache.clear(),this.queryRefDataLoadingCache.clear()}keys(){return Array.from(this.modelCache.keys())}}const Ap=new Sp,Tp={[Ce.EXPORT_TEMPLATE]:["CONCAT"],[Ce.PROCESS_TITLE]:["CONCAT"],[Ce.SEARCH]:["AND","OR"],[Ce.GATEWAY_RULE]:["IF","AND","OR","EQ","NE","LE","LT","GE","GT"],[Ce.NOCODE_BPMN_RULE]:["IF","AND","OR","EQ","NE","LE","LT","GE","GT","ISNULL","ISEMPTY"],[Ce.PAAS_BPMN_RULE]:["IF","AND","OR","EQ","NE","LE","LT","GE","GT"],[Ce.MEDPRO_BUSINESSFLOW]:["IF","AND","OR","EQ","NE","LE","LT","GE","GT"],[Ce.ENTITY_FORMULA]:["IF","ISEMPTY","ISNULL","AND","OR","EQ","NE","LE","LT","GE","GT","PARSENUMBER","CONCAT","SPLIT","SUM","REDUCE","MULTIPLICATION","DIVISION","FIXED","ROUND","ROUNDUP","MAX","LARGE","MIN","SMALL","AVERAGE","ABS","MOD","POWER","SQRT","YEAR","MONTH","DAY","HOUR","MINUTE","TUPLE","SEQMAP","SUMSQ"],[Ce.LABEL_PRINT]:["IF","ISEMPTY","ISNULL","AND","OR","EQ","NE","LE","LT","GE","GT","PARSENUMBER","CONCAT","SPLIT","SUM","REDUCE","MULTIPLICATION","DIVISION","FIXED","ROUND","ROUNDUP","MAX","LARGE","MIN","SMALL","AVERAGE","ABS","MOD","POWER","SQRT","DATEFORMAT","YEAR","MONTH","DAY","HOUR","MINUTE","TUPLE","SEQMAP","SUMSQ"]},Ip={[Ce.EXPORT_TEMPLATE]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.PROCESS_TITLE]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.GATEWAY_RULE]:[Te.FIELD,Te.FUNCTION,Te.OPERATOR],[Ce.NOCODE_BPMN_RULE]:[Te.FIELD,Te.FUNCTION,Te.NODE,Te.VARIABLE,Te.OPERATOR],[Ce.PAAS_BPMN_RULE]:[Te.FIELD,Te.FUNCTION,Te.OPERATOR],[Ce.SEARCH]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.FIELD_DISPLAY]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.DISPLAY_RULE]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.CREATE_FIELD]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.DATA_SET_FORMULA]:[Te.FIELD,Te.FUNCTION,Te.OPERATOR],[Ce.PAAS_CREATE_FIELD]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.ENTITY_FORMULA]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.IPAAS_BACK]:[Te.FUNCTION,Te.OPERATOR],[Ce.LABEL_PRINT]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.ONLINE_FORM_FIELD_FORMULA]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.MEDPRO_BUSINESSFLOW]:[Te.FIELD,Te.FUNCTION,Te.OPERATOR],[Ce.RUN_FORMULA]:[Te.FIELD,Te.FUNCTION,Te.VARIABLE,Te.OPERATOR],[Ce.BI_FORMULA]:[Te.FIELD,Te.FUNCTION,Te.OPERATOR]},Rp={[Ce.CREATE_FIELD]:as,[Ce.DATA_SET_FORMULA]:ls,[Ce.PAAS_CREATE_FIELD]:Or,[Ce.ENTITY_FORMULA]:Or,[Ce.RUN_FORMULA]:Or},Op={[Te.FUNCTION]:{icon:"iconfont icon-hanshu1"},[Te.FIELD]:{icon:"iconfont icon-ziduan2"},[Te.VARIABLE]:{icon:"iconfont icon-bianliang"},[Te.NODE]:{icon:"iconfont icon-hanshu1"},[Te.OPERATOR]:{icon:"iconfont icon-a-yunsuanfu1"}},Jn={"+":{title:"加法: a+b",description:"a,b: 整数,数字",group:je.ARITHMETIC},"-":{title:"减法: a-b",description:"a,b: 整数,数字",group:je.ARITHMETIC},"*":{title:"乘法: a*b",description:"a,b: 整数,数字",group:je.ARITHMETIC},"/":{title:"除法: a/b",description:"a,b: 整数,数字",group:je.ARITHMETIC},"%":{title:"求余: a%b",description:"a,b: 整数,数字",group:je.ARITHMETIC},">":{title:"大于: a>b",description:"a,b: 整数,数字",group:je.RELATIONSHIP},">=":{title:"大于等于: a>=b",description:"a,b: 整数,数字",group:je.RELATIONSHIP},"<":{title:"小于: a<b",description:"a,b: 整数,数字",group:je.RELATIONSHIP},"<=":{title:"小于等于: a<=b",description:"a,b: 整数,数字",group:je.RELATIONSHIP},"==":{title:"等于: a==b",description:"a,b: 整数,数字,布尔,字符串",group:je.RELATIONSHIP},"!=":{title:"不等于: a!=b",description:"a,b: 整数,数字,布尔,字符串",group:je.RELATIONSHIP},"&&":{title:"与: a&&b",description:"a,b: 布尔",group:je.LOGIC},"||":{title:"或: a||b",description:"a,b: 布尔",group:je.LOGIC},"!":{title:"非: !a",description:"a: 布尔",group:je.LOGIC},"?":{title:"判断: a?b:c",description:"若a的值为true,则执行b否则执行c",group:je.OTHER,label:"?:",output:"?:"},"(":{title:"左括号: c-(a+b)",description:"优先运算 () 中的内容",group:je.OTHER},")":{title:"右括号: c-(a+b)",description:"优先运算 () 中的内容",group:je.OTHER}},Np=["+","-","*","/","%",">",">=","<","<="],Lp=["&&","||","!"],Mp=["==","!=","?",":"],Pp=["&&","||","!","==","!=",">",">=","<","<="],Cp=()=>{const e=Object.keys(Jn).map(t=>{const{title:r,description:o,group:u,label:n,output:i}=Jn[t];return{name:n??t,group:u,desc:`${r}
2
- ${o}`,id:i??t}});return[je.ARITHMETIC,je.RELATIONSHIP,je.LOGIC,je.OTHER].map(t=>({id:t,name:pr(`sys.expression.${t}`),children:e.filter(r=>r.group===t),idToChildren:!1}))},xp="custom-expression",Dp="custom-expression-theme",us=[{id:"LOGIC",name:"逻辑",children:[{desc:`IF(expr, a, b)
3
- 根据条件表达式,返回不同的值, 当expr执行为true,返回a, 否则返回b。
4
- 参数 expr: 条件表达式 a: 值 b: 另一个值 返回值 a|b
5
- 示例
6
- IF(1 > 2, 1, 2); 返回 2`,definition:"declare function IF<T>(expr: boolean, v: T, l: T): T;"},{desc:`ISEMPTY(a)
7
- 判断参数a是否为空,a为空则返回true
8
- 参数a支持的类型:String,Array,Object,返回值 true|false
9
- 示例
10
- ISEMPTY('') 返回 true
11
- ISEMPTY(null) 返回 true
12
- ISEMPTY(undefined) 返回 true
13
- ISEMPTY([]) 返回 true
14
- ISEMPTY({}) 返回 true
15
- `,definition:"declare function ISEMPTY<T>(val: T): boolean;"},{desc:`ISNULL(a)
16
- 判断参数a是否为null,a为null则返回true
17
- 示例
18
- ISNULL('') 返回 false
19
- ISNULL(null) 返回 true
20
- ISNULL(undefined) 返回 false`,definition:"declare function ISNULL<T>(val: T): Promise<boolean>;"},{desc:`ISUNDEFINED(a)
21
- 判断参数a是否为undefined,a为undefined则返回true
22
- 示例
23
- ISUNDEFINED('') 返回 false
24
- ISUNDEFINED(null) 返回 false
25
- ISUNDEFINED(undefined) 返回 true`,definition:"declare function ISUNDEFINED<T>(val: T): Promise<boolean>;"},{desc:`AND(conditions): boolean
26
- 根据一组表达式判断是否为真,只要有一个为false,则返回false
27
- 参数 conditions: 条件表达式列表 返回值 true|false
28
- 示例
29
- IF(AND(1==1,1 > 2,3==3),'正确','错误'); 返回 错误`,definition:"declare function AND<T>(...e: T[]): Promise<boolean>;"},{desc:`OR(conditions)
30
- 根据一组表达式判断是否为真,只要有一个为true,则返回true
31
- 参数 conditions: 条件表达式数组 返回值 true|false
32
- 示例
33
- IF(AND(1==1,1 > 2,3==3),'正确','错误'); 返回 正确`,definition:"declare function OR<T>(...e: T[]): Promise<boolean>;"},{desc:`EQ(a, b)
34
- 比较两个值是否相等,如果相等则返回true
35
- 参数a/b支持的类型:Number,String ,Boolean , Date , Array , Object,Array及Object比较数值型知否相等,参数 a: 一个值 b: 另一个值 返回值 true|false
36
- 示例
37
- EQ(1, 1); 返回 true
38
- EQ("a", "c"); 返回 false
39
- EQ([1,2,3],[1,2,3]) 返回 true
40
- EQ({a:1,b:1},{a:1,b:1}) 返回 true`,definition:"declare function EQ<T, K>(v: T, o: K): Promise<boolean>;"},{desc:`NE(a, b)
41
- 比较两个值是否不相等,如果不相等则返回true
42
- 参数a/b支持的类型:Number,String ,Boolean , Date , Array , Object,Array及Object比较数值型知否不相等, 参数 a: 一个值 b: 另一个值 返回值 true|false
43
- 示例
44
- NE(1, 1); 返回 false
45
- NE("a", "c"); 返回 true
46
- NE([1,2,3],[1,2,3]) 返回 false
47
- NE({a:1,b:1},{a:1,b:1}) 返回 false`,definition:"declare function NE<T>(v: T, o: T): Promise<boolean>;"},{desc:`LE(a, b)
48
- 比较两个值大小,a小于等于b返回true
49
- 参数a/b支持的类型:Number,String,Date, 参数 a: 一个值 b: 另一个值 返回值 true|false
50
- 示例
51
- LE(1, 1); 返回 true
52
- LE(2, 1); 返回 false
53
- LE('2023-07-12',''2023-07-13'') 返回 true
54
- LE('12:00',''13:00'') 返回 true`,definition:"declare function LE<T>(v: T, o: T): Promise<boolean>;"},{desc:`LT(a, b)
55
- 比较两个值大小,a小于b返回true
56
- 参数a/b支持的类型:Number,String,Date, 参数 a: 一个值 b: 另一个值 返回值 true|false
57
- 示例
58
- LT(1, 1); 返回 false
59
- LT(1, 2); 返回 true
60
- LT('2023-07-12',''2023-07-13'') 返回 true
61
- LT('13:00',''12:00'') 返回 true`,definition:"declare function LT<T>(v: T, o: T): Promise<boolean>;"},{desc:`GE(a, b)
62
- 比较两个值大小,a大于等于b返回true
63
- 参数a/b支持的类型:Number,String,Date, 参数 a: 一个值 b: 另一个值 返回值 true|false
64
- 示例
65
- GE(1, 1); 返回 true
66
- GE(2, 3); 返回 false
67
- GE('2023-07-13','2023-07-12') 返回 true
68
- GE('13:00','12:00') 返回 true`,definition:"declare function GE<T>(v: T, o: T): Promise<boolean>;"},{desc:`GT(a, b)
69
- 比较两个值大小,a大于b返回true
70
- 参数a/b支持的类型:Number,String,Date, 参数 a: 一个值 b: 另一个值 返回值 true|false
71
- 示例
72
- GT(1, 1); 返回 false
73
- GT(2, 1); 返回 false
74
- GT('2023-07-13','2023-07-12') 返回 true
75
- GT('13:00','12:00') 返回 true`,definition:"declare function GT<T>(v: T, o: T): Promise<boolean>;"}]},{id:"STRING",name:"字符串",children:[{desc:`LEN(a)
76
- 返回字符串长度
77
- 示例
78
- LEN('aa'); 返回 2`,definition:"declare function LEN(v: string): Promise<number>;"},{desc:`CONCAT(a,b....)
79
- 拼接参数a和b,返回拼接后的字符串
80
- 参数a/b支持字符串,返回字符串
81
- 示例
82
- CONCAT('a','b','c') 返回abc`,definition:"declare function CONCAT(...args: string[]): Promise<string>;"},{desc:`SUBSTRING(str,start,end)
83
- 截取字符串str,从start开始截取到end,start从0开始,如果start和end为负数表示从最后开始截取,start为-1表示从最后一位开始截取,返回截取的字符串
84
- 示例
85
- SUBSTRING('abcd',0,2) 返回abc
86
- SUBSTRING('abcd',-1,-2) 返回 cd`,definition:"declare function SUBSTRING(v: string, s: number, e: number): Promise<string>;"},{desc:`SUBSTR(str,start,len)
87
- 截取字符串str,从start开始截取len长度,start从0开始,如果start为负数表示从最后开始截取,start为-1表示从最后一位开始截取,返回截取的字符串
88
- SUBSTR('abcd',0,2) 返回ab
89
- SUBSTRING('abcd',-1,2) 返回 cd`,definition:"declare function SUBSTR(v: string, s: number, l: number): Promise<string>;"},{desc:`UPPER(a)
90
- 字符串a转化为大写,参数a支持字符串
91
- 示例
92
- UPPER('aa') 返回 AA `,definition:"declare function UPPER(v: string): Promise<string>;"},{desc:`LOWER(a)
93
- 字符串a转化为小写,参数a支持字符串
94
- 示例
95
- LOWER('AA') 返回 aa`,definition:"declare function LOWER(v: string): Promise<string>;"},{desc:`TRIM(a)
96
- 字符串a去前后空格
97
- 示例
98
- TRIM(' ab ') 返回 'ab'`,definition:"declare function TRIM(v: string): Promise<string>;"},{desc:`LTRIM(a)
99
- 字符串a去前空格
100
- 示例
101
- LTRIM(' ab ') 返回 'ab '`,definition:"declare function LTRIM(v: string): Promise<string>;"},{desc:`RTRIM(a)
102
- 字符串a去前空格
103
- 示例
104
- LTRIM(' ab ') 返回 ' ab'`,definition:"declare function RTRIM(v: string): Promise<string>;"},{desc:`REPEAT(str,a)
105
- 字符串a在str中重复的次数,返回重复次数
106
- 示例
107
- REPEAT('aabbcc','a') 返回 2`,definition:"declare function REPEAT(v: string, c: string): Promise<number | null>;"},{desc:`REPLACE(str,a,b)
108
- 字符串str中把所有的a替换成b
109
- 示例
110
- REPLACE('aabbcc','a','1') 返回 11bbcc`,definition:"declare function REPLACE(v: string, o: string, t: string): Promise<string>;"},{desc:`FINDSTR(str,a)
111
- 在字符串str中查找字符串a,如果存在返回true,不存在返回false
112
- 示例
113
- FINDSTR('aabbcc','a') 返回 true`,definition:"declare function FINDSTR(v: string, c: string): Promise<boolean>;"},{desc:`SEARCHSTR(str,a)
114
- 在字符串str中查找字符串a,返回a在str中出现的次数,如果不存在则返回0
115
- 示例
116
- SEARCHSTR('aabbcc','a') 返回 2`,definition:"declare function SEARCHSTR(v: string, c: string): Promise<number>;"},{desc:`PARSENUMBER(str)
117
- 字符串str转化为数值
118
- 示例
119
- PARSENUMBER('1') 返回 1
120
- PARSENUMBER('0.1') 返回 0.1`,definition:"declare function PARSENUMBER(v: string): Promise<number | null>;"},{desc:`SPLIET(str,a)
121
- 字符串str根据a分割转化为数组,返回数组
122
- 参数仅支持Number类型
123
- 示例
124
- SPLIT('aa-bb-cc','-') 返回 ['aa','bb','cc']`,definition:"declare function SPLIT(v: string, c: string): Promise<string[]>;"}]},{id:"NUMBER",name:"数值",children:[{desc:`SUM(a,b,c...)
125
- 参数a、b、c...相加,返回相加后的数值
126
- 示例
127
- SUM(1,2,3) 返回 6`,definition:"declare function SUM(...args: number[]): Promise<number>;"},{desc:`REDUCE(a,b,c...)
128
- 参数a、b、c...相减,返回相减后的数值
129
- 示例
130
- REDUCE(2,1) 返回 1
131
- REDUCE(5,1,2) 返回 2`,definition:"declare function REDUCE(...args: number[]): Promise<number>;"},{desc:`MULTIPLICATION(a,b,c...)
132
- 参数a、b、c...相乘,返回相乘后的数值
133
- 示例
134
- MULTIPLICATION(2,1) 返回 2
135
- MULTIPLICATION(5,1,2) 返回 10`,definition:"declare function MULTIPLICATION(...args: number[]): Promise<number>;"},{desc:`DIVISION(a,b,c...)
136
- 参数a、b、c...相除,返回相除后的数值
137
- 示例
138
- DIVISION(2,1) 返回 2
139
- DIVISION(10,5,2) 返回 1`,definition:"declare function DIVISION(...args: number[]): Promise<number>;"},{desc:`FIXED(value,num)
140
- 参数value保留num位小数,返回数值
141
- 示例
142
- FIXED(2.01,1) 返回 2.0
143
- FIXED(2.015,2) 返回 2.01`,definition:"declare function FIXED(v: number, n: number): Promise<number | Promise<Error>>;"},{desc:`ROUND(value,num)
144
- 参数value保留num位四舍五入后的小数,返回数值
145
- 示例
146
- ROUND(2.01,1) 返回 2.0
147
- ROUND(2.015,2) 返回 2.02`,definition:"declare function ROUND(v: number, n: number): Promise<number | Promise<Error>>;"},{desc:`ROUNDUP(value,num)
148
- 将数字向上舍入到指定的位数。无论数字正负,舍入方向始终向绝对值更大的方向进行。
149
- 示例
150
- ROUNDUP(3.141,2) 返回 3.15`,definition:"declare function ROUNDUP(v: number, n: number): Promise<number | Promise<Error>>;"},{desc:`MAX([value1, value2...])
151
- 从数组参数中获取最大的数,返回数值
152
- 参数必须为Number类型数组
153
- 示例
154
- MAX([2, 1]) 返回 2
155
- MAX([2.1, 2.2]) 返回 2.2`,definition:"declare function MAX(v: number[]): Promise<number>;"},{desc:`LARGE([value1, value2...], n)
156
- 从数组参数中获取第n大数值,返回数值
157
- 参数必须为Number类型数组
158
- 示例
159
- LARGE([5, 4, 3, 2, 1],2) 返回 4
160
- LARGE([2.5, 2.4, 2.3, 2.2, 2.1], 3) 返回 2.3`,definition:"declare function LARGE(v: number[], n: number): Promise<number | Promise<Error>>;"},{desc:`MIN([value1, value2...])
161
- 从数组参数中获取最小的数,返回数值
162
- 参数必须为Number类型数组
163
- 示例
164
- MIN([2, 1]) 返回 1
165
- MIN([2.1, 2.2]) 返回 2.1`,definition:"declare function MIN(v: number[]): Promise<number>;"},{desc:`SMALL([value1, value2...], n)
166
- 从数组参数中获取第n小数值,返回数值
167
- 参数必须为Number类型数组
168
- 示例
169
- SMALL([5, 4, 3, 2, 1], 2) 返回 2
170
- SMALL([2.5, 2.4, 2.3, 2.2, 2.1], 3) 返回 2.3`,definition:"declare function SMALL(v: number[], n: number): Promise<number | Promise<Error>>;"},{desc:`AVERAGE([value1, value2...])
171
- 取数组中所有数值的平均值,返回数值
172
- 参数必须为Number类型数组
173
- 示例
174
- AVERAGE([5, 4, 3, 2, 1]) 返回 3`,definition:"declare function AVERAGE(v: number[]): Promise<number | Promise<Error>>;"},{desc:`ABS(value)
175
- 取数值参数value的绝对值,返回数值
176
- 参数必须为Number类型
177
- 示例
178
- ABS(-1) 返回 1`,definition:"declare function ABS(v: number): Promise<number>;"},{desc:`MOD(value1, value2)
179
- 取数value1除以value2的余数,返回数值
180
- 参数必须为Number类型
181
- 示例
182
- MOD(4, 3) 返回 1`,definition:"declare function MOD(v: number, n: number): Promise<number | Promise<Error>>;"},{desc:`POWER(value, n)
183
- 获取数值value的n次乘幂,返回数值
184
- 参数必须为Number类型
185
- 示例
186
- POWER(4, 2) 返回 16`,definition:"declare function POWER(v: number, n: number): Promise<number>;"},{desc:`SQRT(value)
187
- 获取数值value的平方根,返回数值
188
- 参数必须为Number类型
189
- 示例
190
- SQRT(4) 返回 2`,definition:"declare function SQRT(v: number): Promise<number>;"},{desc:`SUMSQ
191
- SUMSQ(数字1, 数字2, ...) 计算一组数值的平方和。
192
- 示例
193
- SUMSQ(2,3)=2²+3²=13`,definition:"declare function SUMSQ(...args: number[]): Promise<number>;"},{desc:`STDEV
194
- STDEV(数字1, 数字2, ...) 计算一组数值的标准差。
195
- 示例
196
- STDEV([10, 12, 23, 23, 16, 23, 21, 16])=5.237229365663817`,definition:"declare function STDEV(...args: number[]): Promise<number>;"}]},{id:"OBJECT,ARRAY",name:"对象/数组",children:[{desc:`TUPLE(1, 2, 3)
197
- 把多个参数转化为数组结构
198
- 示例
199
- TUPLE(1, 2, 3) 返回[1, 2, 3]`,definition:"declare function TUPLE(x:any): any[]"},{desc:`SEQMAP('a', 1, 'b', 'c')
200
- 把多个参数转化对象
201
- 示例
202
- SEQMAP('a', 1, 'b', 'c') 返回 { a: 1, b: 'c' } `,definition:"declare function SEQMAP(a:string,b:any): object"},{desc:`GET(a, b)
203
- 如果a是对象,则获取对象a中属性b的值,如果a是数组,则获取下标b的数据项
204
- 参数a支持的类型: Array , Object,参数b支持的类型: Number,String
205
- 示例
206
- GET(['A', 'B', 'C'], 1) 返回 A
207
- GET({ a: 1, b: 2, c: 3 }, 'a') 返回 B`,definition:"declare function GET<T extends object | any[]>(v: T, p: number | keyof T): Promise<T[keyof T]>;"},{desc:`PUT(a, b, c)
208
- 如果a是对象,则b为对象中的属性,c为需要设置的属性值,如果a是数组,则b数组的下标,c为该下标需要设置的数据项
209
- 参数a支持的类型: Array , Object,参数b支持的类型: Number,String ,参数c泛型
210
- 示例
211
- PUT(['A', 'B', 'C'], 1, 'D') 返回['A', 'D', 'C']
212
- PUT({ a: 1, b: 2, c: 3 }, 'a', 4) 返回 { a: 4, b: 2, c: 3 } `,definition:"declare function PUT<T>(a: T, b: keyof T, c: T[keyof T | any]): Promise<T | Promise<Error>>;"},{desc:`PUSH(a, b)
213
- 在数组对象a末尾追加b
214
- 参数a的类型为Array, 参数b泛型,返回数组
215
- 示例
216
- PUSH([1, 2, 3], 4) 返回[1, 2, 3, 4]`,definition:"declare function PUSH<T>(v: any[], n: T): Promise<T[] | Promise<Error>>;"},{desc:`HEADPUSH(a, b)
217
- 在数组对象a头部追加b
218
- 参数a的类型为Array, 参数b泛型,返回数组
219
- 示例
220
- HEADPUSH([1, 2, 3], 0) 返回[0, 1, 2, 3]`,definition:"declare function HEADPUSH<T>(v: any[], n: T): Promise<T[] | Promise<Error>>;"},{desc:`COUNT
221
- COUNT([数字1, 数字2, ...]) 计算数组的数量。
222
- 示例
223
- COUNT([10, 12, 23, 23, 16, 23, 21, 16])=8`,definition:"declare function COUNT(v: number[]): Promise<number>;"}]},{id:"DATE",name:"日期",children:[{desc:`TIMESTAMP2DATE(dtstr)
224
- 时间戳转化为日期对象,参数dtstr为时间戳类型,返回日期时间对象
225
- 示例
226
- TIMESTAMP2DATE(1689558261) 返回 2023-07 - 17 9: 44: 21`,definition:"declare function TIMESTAMP2DATE(v: number): Promise<string | Promise<Error>>;"},{desc:`DATE2TIMESTAMP(dt)
227
- 日期转时间戳,参数dt为日期类型,返回时间戳
228
- 示例
229
- DATE2TIMESTAMP()`,definition:"declare function DATE2TIMESTAMP(v: string): Promise<number>;"},{desc:`DATEFORMAT(dt, format)
230
- 日期转字符串,参数dt为日期类型,format为格式
231
- 示例
232
- DATEFORMAT(NOW(), YYYY-MM-DD HH:mm)`,definition:"declare function DATEFORMAT(v: Date, f: string): Promise<string>;"},{desc:`NOW()
233
- 获取当前日期时间
234
- NOW() 返回 2023-07 - 17 9: 44: 21`,definition:"declare function NOW(): Promise<string>;"},{desc:"TODAY(获取当天日期TODAY() 返回2023-07-17",definition:"declare function TODAY(): Promise<string>;"},{desc:`YEAR(dt)
235
- 获取参数dt类型的年份
236
- YEAR(NOW()) 返回 2024`,definition:"declare function YEAR(v: string | number | Date | null | undefined): number;"},{desc:`MONTH(dt)
237
- 获取参数dt类型的月份
238
- MONTH(NOW()) 返回 7`,definition:"declare function MONTH(v: string | number | Date | null | undefined): Promise<number>;"},{desc:`DAY(dt)
239
- 获取参数dt类型的日
240
- DAY(NOW()) 返回 17`,definition:"declare function DAY(v: string | number | Date | null | undefined): Promise<number>;"},{desc:`HOUR(dt)
241
- 获取参数dt类型的小时
242
- HOUR(NOW()) 返回 10`,definition:"declare function HOUR(v: string | number | Date | null | undefined): Promise<number>;"},{desc:`MINUTE(dt)
243
- 获取参数dt类型的分钟
244
- MINUTE(NOW()) 返回 44`,definition:"declare function MINUTE(v: string | number | Date | null | undefined): Promise<number>;"},{desc:`WEEKRANGE()
245
- 获取本周开始及结束日期
246
- WEEKRANGE() 返回[2023-07 - 17 00:00:00.000000000 +0800 CST, 2023-07 - 23 23: 59: 59.000000000 +0800 CST]`,definition:"declare function WEEKRANGE(): Promise<[string, string]>;"},{desc:`LASTWEEKRANGE()
247
- 获取本周开始及结束日期
248
- LASTWEEKRANGE() 返回[2023-07 - 10 00:00:00.000000000 +0800 CST, 2023-07 - 16 23: 59: 59.000000000 +0800 CST]`,definition:"declare function LASTWEEKRANGE(): Promise<[string, string]>;"},{desc:`MONTHRANGE()
249
- 获取本月开始及结束日期
250
- MONTHRANGE() 返回[2023-07-01 00:00:00.000000000 +0800 CST, 2023-07 - 31 23: 59: 59.000000000 +0800 CST]`,definition:"declare function MONTHRANGE(): Promise<[string, string]>;"},{desc:`LASTMONTHRANGE()
251
- 获取上月开始及结束日期
252
- MONTHRANGE() 返回[2023-06-01 00:00:00.000000000 +0800 CST, 2023-06 - 30 23: 59: 59.000000000 +0800 CST]`,definition:"declare function LASTMONTHRANGE(): Promise<[string, string]>;"},{desc:`YEARRANGE()
253
- 获取本年开始及结束日期
254
- YEARRANGE() 返回[2023-01-01 00:00:00.000000000 +0800 CST, 2023 - 12 - 31 23: 59: 59.000000000 +0800 CST]`,definition:"declare function YEARRANGE(): Promise<[string, string]>;"},{desc:`LASTYEARRANGE()
255
- 获取上一年开始及结束日期
256
- LASTYEARRANGE() 返回[2022-01-01 00:00:00.000000000 +0800 CST, 2022 - 12 - 31 23: 59: 59.000000000 +0800 CST]`,definition:"declare function LASTYEARRANGE(): Promise<[string, string]>;"},{desc:`QUARTER()
257
- 获取本季度开始及结束日期
258
- QUARTER() 返回[2022-07-01 00:00:00.000000000 +0800 CST, 2022 -09 - 30 23: 59: 59.000000000 +0800 CST]`,definition:"declare function QUARTER(): Promise<[string, string]>;"},{desc:`LASTQUARTER()
259
- 获取上季度开始及结束日期
260
- LASTQUARTER() 返回[2022-04-01 00:00:00.000000000 +0800 CST, 2022-06 - 30 23: 59: 59.000000000 +0800 CST]`,definition:"declare function LASTQUARTER(): Promise<[string, string]>;"},{desc:`ISDATERANGE(dt, [startDate, endDate])
261
- 判断参数dt是否在给定的区间范围内,如果在则返回true,反之返回false
262
- ISDATERANGE(NOW(), WEEKRANGE()) 返回 true`,definition:"declare function ISDATERANGE(v: Date, r: [Date, Date]): Promise<boolean>;"},{desc:`ISTIMERANGE(dt, [startTime, endTime])
263
- 判断参数dt是否在给定的区间范围内,如果在则返回true,反之返回false
264
- 参数dt、startTime、endTime为时间字符串,如果startTime大于endTime则跨天
265
- ISTIMERANGE(DATEFORMAT(NOW(), HH:mm), ['06:00', '12:00']) 返回 true
266
- ISTIMERANGE(DATEFORMAT(NOW(), HH:mm), ['13:00', '07:00']) 返回 true `,definition:"declare function ISTIMERANGE(v: string, r: [string, string]): Promise<boolean>;"}]}].map(e=>(e.children=(e.children??[]).map(t=>{const o=t.definition.match(new RegExp("(?<=declare function )([A-Z0-9]+)","g"))?.[0]??"UNKNOWN",u=(t.definition.match(/([a-z]:)+/g)||[]).length;return Object.assign(t,{id:o,name:o,idToChildren:!1,_args_:u}),t}),e)),kp=us.reduce((e,t)=>(t.children.forEach(r=>{e[r.id]=r}),e),{}),Up=[{id:"INNER",name:"内置",children:[{desc:`MD5(str) 计算输入字符串的MD5值
267
- 示例: MD5('abc')
268
- 返回 900150983cd24fb0d6963f7d28e17f72
269
- `,definition:"declare function MD5(str: string): string;"},{desc:`SHA1(str) 计算输入字符串的HASH值
270
- 示例: SHA1('abc')
271
- 返回 a9993e364706816aba3e25717850c26c9cd0d89d`,definition:"declare function SHA1(str: string): string;"},{desc:`SHA256(str) 计算输入字符串的HASH值
272
- `,definition:"declare function SHA256(str: string): string;"},{desc:`SHA512(str) 计算输入字符串的HASH值
273
- 示例: SHA512('abc')
274
- 返回 ddaf35a193617abacc417349ae20...`,definition:"declare function SHA512(str: string): string;"},{desc:`RANDOMSTR(number) 生成随机字符串
275
- number:为随机字符串的长度
276
- 示例: RandomStr(6)
277
- 返回 o4EX1D`,definition:"declare function RANDOMSTR(number: number): string;"},{desc:`NOW(format) 生成指定格式的当前时间戳
278
- format为时间格式,可选值参考'yyyy-MM-dd','yyyy-MM-dd HH:mm:ss','HH:mm:ss'
279
- 示例: NOW('yyyy-MM-dd')
280
- 返回 1970-01-01`,definition:"declare function NOW(format: string): string;"},{desc:`CONCAT(a,b....)
281
- 拼接参数a和b,返回拼接后的字符串
282
- 参数a/b支持字符串,返回字符串
283
- 示例 CONCAT('a','b','c')
284
- 返回abc`,definition:"declare function CONCAT(...args: string[]): string;"},{desc:`UNIX10()
285
- 返回10位的时间戳
286
- UNIX10() 返回 1677811200`,definition:"declare function UNIX10(): number;"},{desc:`UNIX13()
287
- 返回13位的时间戳
288
- UNIX13() 返回 1677811200000`,definition:"declare function UNIX13(): number;"}]}].map(e=>(e.children=e.children.map(t=>{const r=t.definition.match(new RegExp("(?<=declare function )([A-Z0-9]+)","g"))[0],o=(t.definition.match(/([a-z]:)+/g)||[]).length;return Object.assign(t,{id:r,name:r,idToChildren:!1,_args_:o}),t}),e)),Bp=us.reduce((e,t)=>(t.children.forEach(r=>{e[r.id]=r}),e),{}),Wc=[{id:"COMMON",name:"常用",children:[{desc:`将多个字段合并成一个字符串
289
- 示例: CONCAT('a', '-', 'b') = 'a-b'
290
- `,definition:"declare function CONCAT( ...any: string[]): string;"},{desc:`返回日期的指定中加上指定的数字 后的日期
291
- 示例: DATEADD('2020-09-29', 100, days) = 2021-01-07
292
- `,definition:"declare function DATEADD(data: string, interval: number, date_part: string): string;"},{desc:`返回 <date1> 与 <date2> 之差。以 <date_part> 的单位表示,只计算完整<date_part>
293
- 示例: DATEDIFF('2024-05-22', '2020-09-29', 'year') = 3
294
- `,definition:"declare function DATEDIFF(date1: string, date2: string, date_part: string): number;"},{desc:`将日期进行格式化,并输出文本
295
- 示例: DATEFORMAT(2020-09-29, yyyyMMdd) = '20200929'
296
- `,definition:"declare function DATEFORMAT(date: any, format: string): string;"},{desc:`以<format>格式解析字符串<date_string>,并转化为日期类型。
297
- 示例: TODATE('2020-09-29', 'yyyy-MM-dd') = 2020-09-29
298
- `,definition:"declare function TODATE(date_string: string, format:string): any;"},{desc:`NULLIF函数接受两个参数,如果两个参数相等则返回NULL,否则返回第一个参数,可以用来避免分母为0的情况
299
- 示例: 如果field为0 则返回null,NULLIF(<field>,0) = null
300
- `,definition:"declare function NULLIF(arg1: any,arg2:any): any;"}]},{id:"NUMBER",name:"数值",children:[{desc:`返回多个参数中的最大值,至少输入2个参数
301
- 示例: GREATEST(10, 5, 7) = 10
302
- `,definition:"declare function GREATEST( ...any: number[]): number;"},{desc:`返回多个参数中的最小值,至少输入2个参数
303
- 示例: LEAST(10, 5, 7) = 5
304
- `,definition:"declare function LEAST( ...any: number[]): number;"},{desc:`将<number> 舍入为指定位数。 <decimals>指定输出结果的小数位数精度。如果省略decimals,则输出为整数
305
- 示例: ROUND(1/3, 2) = 0.33
306
- `,definition:"declare function ROUND(number: number, decimals?: number): number"}]},{id:"TEXT",name:"文本",children:[{desc:`将多个字段合并成一个字符串
307
- 示例: CONCAT('a', '-', 'b') = 'a-b'
308
- `,definition:"declare function CONCAT( ...any: string[]): string;"},{desc:`如果给定字符串包含指定子字符串,则返回 true
309
- 示例: CONTAINS('Hello World', ' ') = true
310
- `,definition:"declare function CONTAINS(string: string, substring: string): boolean;"},{desc:`返回子字符串在字符串中的索引位置,从指定的索引<start>开始查找(<start>可不填)。如果未找到子字符串,则返回 0。字符串中第一个字符的位置为 1
311
- 示例: FIND('World', 'Hello World') = 7
312
- FIND('Computer', 'Hello World') = 0
313
- `,definition:"declare function FIND(substring: string, string: string, start?: number): number;"},{desc:`返回字符串长度
314
- 示例: LEN('Hello World') = 11
315
- `,definition:"declare function LEN(string: string): number;"},{desc:`返回<string>从指定<start>位置处开始的字符串。字符串中第一个字符的位置为 1。 如果添加了可选数字参数<length>,则返回的字符串仅包含该数量的字符
316
- 示例: MID('Hello World', 2) = 'ello World'
317
- MID('Hello World', 2, 4) ='ello'
318
- `,definition:"declare function MID(string: string, start: number, length?: number): string"},{desc:`在 <string> 中搜索 <substring> 并将其替换为 <replacement>。如果未找到 <substring>,则字符串保持不变。
319
- 示例: REPLACE('Hello World', ' ', '-') = 'Hello-World'
320
- `,definition:"declare function REPLACE(string: string, substring: string, replacement: string): string"},{desc:`移除 <string> 的所有前置空格和尾随空格
321
- 示例: TRIM(' Hello World ') = 'Hello World'
322
- `,definition:"declare function TRIM(string: string): string"}]},{id:"DATE",name:"日期",children:[{desc:`返回日期的指定中加上指定的数字 后的日期
323
- 示例: DATEADD('2020-09-29', 100, days) = 2021-01-07
324
- `,definition:"declare function DATEADD(data: string, interval: number, date_part: string): string;"},{desc:`以整数的形式返回给定 <date> 的天
325
- 示例: DAY('2020-09-29') = 29
326
- `,definition:"declare function DAY(date: string): number;"},{desc:`以整数形式返回给定 <date> 的月份
327
- 示例: MONTH('2020-09-29') = 9
328
- `,definition:"declare function MONTH(date: string): number;"},{desc:`返回一个依据指定 <year>、<month> 和 <day> 构造的日期值
329
- 示例: MAKEDATE(2020, 9, 29) = 2020-09-29
330
- `,definition:"declare function MAKEDATE(year: number, month: number, day: number): any;"},{desc:`返回当前时间
331
- 示例: NOW() = 2024-05-22 09:29:29
332
- `,definition:"declare function NOW(): any;"},{desc:`以整数形式返回给定 <date> 的季度
333
- 示例: QUARTER('2020-09-29') = 3
334
- `,definition:"declare function QUARTER(date: string): number;"},{desc:`返回当前日期
335
- 示例: TODAY() = 2024-05-22
336
- `,definition:"declare function TODAY(): any;"},{desc:`以整数形式返回给定 <date> 的周
337
- 示例: WEEK('2010-01-01') = 52
338
- WEEK('2010-01-06') = 1
339
- `,definition:"declare function WEEK(date: string): number;"},{desc:`以整数形式返回给定 <date> 的年份
340
- 示例: YEAR('2020-09-29') = 2020
341
- `,definition:"declare function YEAR(date: string): number;"}]},{id:"PARSE",name:"转换",children:[{desc:`将日期进行格式化,并输出文本
342
- 示例: DATEFORMAT(2020-09-29, yyyyMMdd) = '20200929'
343
- `,definition:"declare function DATEFORMAT(date: any, format: string): string;"},{desc:`以<format>格式解析字符串<date_string>,并转化为日期类型。
344
- 示例: TODATE('2020-09-29', 'yyyy-MM-dd') = 2020-09-29
345
- `,definition:"declare function TODATE(date_string: string, format:string): any;"},{desc:`将文本或数值转为浮点数
346
- 示例: TODOUBLE('123.21') = 123.21
347
- TODOUBLE(3) = 3.0
348
- `,definition:"declare function TODOUBLE(expression: string | number): number;"},{desc:`将文本或数值转为整数,若存在小数部分将舍弃
349
- TOINT('123.9') = 123
350
- `,definition:"declare function TOINT(expression: string | number) : number;"},{desc:`将数值转为字符串
351
- TOSTR(123) = '123'
352
- `,definition:"declare function TOSTR(expression: number) : string;"}]},{id:"AGG",name:"聚合",children:[{desc:`平均值
353
- 示例: AVG([订单金额])
354
- 根据图表中使用的维度进行聚合,求订单金额的平均值
355
- `,definition:"declare function AVG(number: number): number;"},{desc:`计数
356
- 示例: COUNT([订单ID])
357
- 根据图表中使用的维度进行聚合,求订单的数量
358
- `,definition:"declare function COUNT(expression: string | number): number;"},{desc:`去重计数
359
- 示例: COUNTD([订单ID])
360
- 根据图表中使用的维度进行聚合,求订单ID去重后的数量
361
- `,definition:"declare function COUNTD(expression: string | number): number;"},{desc:`最大值
362
- 示例: MAX([订单金额])
363
- 根据图表中使用的维度进行聚合,求订单金额的最大值
364
- `,definition:"declare function MAX(expression: number): number;"},{desc:`中位数
365
- 示例: MEDIAN([订单金额])
366
- 根据图表中使用的维度进行聚合,求订单金额的中位数
367
- `,definition:"declare function MEDIAN(number: number): number;"},{desc:`最小值
368
- 示例: MIN([订单金额])
369
- 根据图表中使用的维度进行聚合,求订单金额的最小值
370
- `,definition:"declare function MIN(expression: number): number;"},{desc:`求和
371
- 示例: SUM([订单金额])
372
- 根据图表中使用的维度进行聚合,求订单金额的总和
373
- `,definition:"declare function SUM(number: number): number;"}]}].map(e=>(e.children=e.children.map(t=>{const r=t.definition.match(new RegExp("(?<=declare function )([A-Z0-9_]+)","g"))[0],o=(t.definition.match(/([a-z]:)+/g)||[]).length;return Object.assign(t,{id:r,name:r,idToChildren:!1,_args_:o}),t}),e)),Fp=Wc.reduce((e,t)=>(t.children.forEach(r=>{e[r.id]=r}),e),{}),jp=["IF","ISEMPTY","ISNULL","ISUNDEFINED","AND","OR","EQ","NE","LE","LT","GE","GT","LEN","CONCAT","SUBSTRING","SUBSTR","UPPER","LOWER","TRIM","LTRIM","RTRIM","REPEAT","REPLACE","FINDSTR","SEARCHSTR","PARSENUMBER","SPLIT","SUM","REDUCE","MULTIPLICATION","DIVISION","FIXED","ROUND","ROUNDUP","MAX","LARGE","MIN","SMALL","AVERAGE","ABS","MOD","POWER","SQRT","SUMSQ","STDEV","TUPLE","SEQMAP","GET","PUT","PUSH","HEADPUSH","COUNT","TIMESTAMP2DATE","DATE2TIMESTAMP","DATEFORMAT","NOW","TODAY","YEAR","MONTH","DAY","HOUR","MINUTE","WEEKRANGE","LASTWEEKRANGE","MONTHRANGE","LASTMONTHRANGE","YEARRANGE","LASTYEARRANGE","QUARTER","LASTQUARTER","ISDATERANGE","ISTIMERANGE"],Wp="$SYSTEM_VAR_",Gc=[{id:"$USERID",name:"$USERID",valueType:"string",desc:"当前登录人id"},{id:"$USERNAME",name:"$USERNAME",valueType:"string",desc:"当前登录人姓名"},{id:"$USERDEPARTMENTID",name:"$USERDEPARTMENTID",valueType:"string",desc:"当前登录人主部门"},{id:"$USERDEPARTMENTNAME",name:"$USERDEPARTMENTNAME",valueType:"string",desc:"当前登录人主部门名称"}],Gp=Gc.map(e=>e.id),Hp=[be.INTEGER,be.LONG,be.DOUBLE,be.DECIMAL],Vp=[be.BOOLEAN],$p="number",qp="string",Yp="boolean",Kp="object",Xp="array",zp=["SUM","REDUCE","MULTIPLICATION","DIVISION","FIXED","ROUND","ROUNDUP","MAX","LARGE","MIN","SMALL","AVERAGE","ABS","MOD","POWER","SQRT","LEN","DATE2TIMESTAMP","SUMSQ","STDEV","COUNT","TOINT","FIND","YEAR","WEEK","DAY","MONTH","QUARTER","TODOUBLE","DATEDIFF","AVG","GREATEST","LEAST","COUNTD","MEDIAN"],Qp=["CONCAT","SUBSTRING","SUBSTR","UPPER","LOWER","TRIM","LTRIM","RTRIM","REPEAT","REPLACE","FINDSTR","SEARCHSTR","PARSENUMBER","SPLIT"],Jp=["IF","ISEMPTY","ISNULL","ISUNDEFINED","AND","OR","EQ","NE","LE","LT","GE","GT","CONTAINS"],Zp=["TUPLE","SEQMAP","GET","PUT","PUSH","HEADPUSH"],eg={string:"字符串",number:"数值",boolean:"布尔",date:"日期",time:"时间",datetime:"日期时间",array:"数组",object:"对象",null:"空值",unknown:"未知",text:"文本",long_text:"长文本",integer:"整数",long:"长整数",decimal:"小数"};var Hc=(e=>(e.EXPRESSION="expression-language-service",e))(Hc||{});const tg={"+":"ADD","-":"REDUCE","*":"MULTIPLICATION","/":"DIVISION","%":"MOD"};var Vc=(e=>(e.PREFIX="EDITOR___",e))(Vc||{}),$c=(e=>(e.FORM_TITLE_GROUP="form-title-group",e))($c||{}),qc=(e=>(e.SystemDate="system-date",e.Yesterday="yesterday",e.Past7Days="past-7-days",e.Past30Days="past-30-days",e.PastDays="past-days",e.ThisWeek="this-week",e.LastWeek="last-week",e.PastWeeks="past-weeks",e.ThisMonth="this-month",e.LastMonth="last-month",e.PastMonths="past-months",e.ThisQuarter="this-quarter",e.LastQuarter="last-quarter",e.PastQuarters="past-quarters",e.ThisYear="this-year",e.LastYear="last-year",e.PastYears="past-years",e))(qc||{});const er={TOKEN:"gct-token",TENANT:"gct-tenant"},rg=[{value:"entity",label:"sys.pageDesigner.entity"},{value:"data",label:"sys.pageDesigner.data"},{value:"view",label:"sys.pageDesigner.view"}],Yc="gct",ng="/minio",ig="/minio",cs="app_inst",og="is-";function qt(e,t,r,o,u){let n=`${e}-${t}`;return r&&(n+=`-${r}`),o&&(n+=`__${o}`),u&&(n+=`--${u}`),n}class Kc{constructor(t,r){this.block=t,this.namespace=r||Yc}namespace;b(t=""){return qt(this.namespace,this.block,t,"","")}e(t){return t?qt(this.namespace,this.block,"",t,""):""}m(t){return t?qt(this.namespace,this.block,"","",t):""}be(t,r){return t&&r?qt(this.namespace,this.block,t,r,""):""}em(t,r){return t&&r?qt(this.namespace,this.block,"",t,r):""}bm(t,r){return t&&r?qt(this.namespace,this.block,t,"",r):""}bem(t,r,o){return t&&r&&o?qt(this.namespace,this.block,t,r,o):""}is(t,r){return t&&r?`${og}${t}`:""}cssVar(t){const r={};for(const o in t)t[o]&&(r[this.cssVarName(o)]=t[o]);return r}cssVarBlock(t){const r={};for(const o in t)t[o]&&(r[this.cssVarBlockName(o)]=t[o]);return r}cssVarName(t){return`--${this.namespace}-${t}`}cssVarBlockName(t){return`--${this.namespace}-${this.block}-${t}`}}function sg(e){return new Kc(e)}function ag(e){if(e instanceof Array)e&&e.length>0&&e.splice(0,e.length);else if(e instanceof Object&&e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t]}class lg{constructor(){this.map=new Map,this.maxListeners=100}setMaxListeners(t){this.maxListeners=t}getSize(t){return this.map.has(t)?this.map.get(t).length:0}addListener(t,r){if(r instanceof Function){this.map.has(t)||this.map.set(t,[]);const o=this.map.get(t);if(o.length<this.maxListeners)o.push(r);else throw new Error(`事件监听已达最大上限[${this.maxListeners}],无法新增监听!`)}}removeListener(t,r){if(this.map.has(t)){const o=this.map.get(t);if(o.length>0){for(let u=0;u<o.length;u++)if(o[u]===r){o.splice(u,1);break}}}}emit(t,...r){this.map.has(t)&&this.map.get(t).forEach(u=>{u(...r)})}async asyncEmit(t,...r){if(this.map.has(t)){const u=this.map.get(t).map(n=>n(...r));return Promise.all(u)}return[]}reset(){this.map.forEach(t=>{ag(t)}),this.map.clear()}}class ug{constructor(t){this.e=new lg,this.e.setMaxListeners(t||300)}getSize(t){return this.e.getSize(t)}on(t,r){this.e.addListener(t,r)}off(t,r){this.e.removeListener(t,r)}emit(t,...r){this.e.emit(t,...r)}asyncEmit(t,...r){return this.e.asyncEmit(t,...r)}reset(){this.e.reset()}}const{toString:fs}=Object.prototype;function Xc(e){return dg(e)==="function"}function cg(e){return fs.call(e)==="[object AsyncFunction]"}function fg(e){return fs.call(e)==="[object Promise]"}const hg={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object","[object Set]":"set","[object Map]":"map","[object WeakMap]":"weakmap"};function dg(e){return hg[fs.call(e)]}function Dt(){return((1+Math.random())*65536|0).toString(16).substring(1)}function pg(){return`${Dt()+Dt()}-${Dt()}-${Dt()}-${Dt()}-${Dt()}${Dt()}${Dt()}`}function hs(e,t,r=0,o=!1,u="/"){let n="";if(o&&!/^(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)$/.test(location.hostname)){const s=location.hostname;s.indexOf(".")!==s.lastIndexOf(".")&&(n=`;domain=${s.substring(s.indexOf("."),s.length)}`)}if(r!==0){const i=r*24*60*60*1e3,s=new Date(new Date().getTime()+i);document.cookie=`${e}=${escape(t)};path=${u};expires=${s.toUTCString()}${n}`}else document.cookie=`${e}=${escape(t)};path=${u}${n}`}function zc(e,t){hs(e,"",-1,t)}function Qc(e){const t=new RegExp(`(^| )${e}=([^;]*)(;|$)`),r=document.cookie.match(t);return r&&r.length>1?unescape(r[2]):null}class gg{constructor(){this.items=[]}get size(){return this.items.length}callSync(t,...r){const o=t||Object.create({});let u;for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i.fn&&(u=i.fn(o,...r)),u===null){console.warn(`因${i.fn?i.fn.name:null}方法返回值为「null」,钩子中断执行。`,i);break}}return o}tap(t){if(t&&Xc(t)){const r={mode:"sync"};r.fn=t,this.items.push(r)}}removeTap(t){if(t)for(let r=0;r<this.items.length;r++){const o=this.items[r];t===o.fn&&this.items.splice(r,1)}}clear(){this.items=[]}}class Us extends gg{async call(t,...r){const o=t||Object.create({});let u;for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i.fn&&(i.mode==="promise"?(u=i.fn(o,...r),fg(u)&&(u=await u)):u=i.fn(o,...r)),u===null){console.warn(`因${i.fn?i.fn.name:null}方法返回值为「null」,钩子中断执行。`,i);break}}return o}tapPromise(t){if(t&&(Xc(t)||cg(t))){const r={mode:"promise"};r.fn=t,this.items.push(r)}}removeTapPromise(t){this.removeTap(t)}}class bg{ignoreDismissCheck=!1;state=Ne.reactive({okDisabled:!1,cancelDisabled:!1});hooks={shouldDismiss:new Us,beforeDismiss:new Us};ok;setOptions;constructor(t){t.dismiss&&(this._dismiss=t.dismiss),t.setOptions&&(this.setOptions=t.setOptions)}cancel;callback(t,r){t&&(this.ok=t),r&&(this.cancel=r)}_dismiss=t=>{console.warn("外部关闭能力未注册",t)};injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const r={};return this.ignoreDismissCheck!==!0&&await this.hooks.shouldDismiss.call(r),r.allowClose===!1?(console.warn("shouldDismiss结果为false,关闭中断。"),!1):(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}}class ds{constructor(t,r,o){this.component=t,this.render=r,this.opts=o,this._initPromise=this.init()}vm;modal;result;evt=new ug;_initPromise;static async createVueApp(t,r){return console.error("没有注入createVueApp方法"),Ne.createApp(t,r)}async init(){const t=this,{render:r,opts:o}=this,u=document.createElement("div");document.body.appendChild(u);const n=await ds.createVueApp({mounted(){t.modal=this.$refs.root},unmounted(){document.body.removeChild(u),t.evt.emit("dismiss",t.result)},render(){return Ne.h(t.component,{ref:"root",opts:o,onDismiss(i){t.result=i,n.unmount()}},{default:r})}});n.mount(u),this.vm=n}async present(){return await this._initPromise,await Ne.nextTick(),this.modal.present()}async dismiss(t){await this.modal.dismiss(t)}async onWillDismiss(){return new Promise(t=>{const r=o=>{t(o),this.evt.off("dismiss",r)};this.evt.on("dismiss",r)})}}function mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kn,Bs;function yg(){if(Bs)return kn;Bs=1;function e(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function t(u,n){for(var i="",s=0,a=-1,l=0,c,f=0;f<=u.length;++f){if(f<u.length)c=u.charCodeAt(f);else{if(c===47)break;c=47}if(c===47){if(!(a===f-1||l===1))if(a!==f-1&&l===2){if(i.length<2||s!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var p=i.lastIndexOf("/");if(p!==i.length-1){p===-1?(i="",s=0):(i=i.slice(0,p),s=i.length-1-i.lastIndexOf("/")),a=f,l=0;continue}}else if(i.length===2||i.length===1){i="",s=0,a=f,l=0;continue}}n&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+u.slice(a+1,f):i=u.slice(a+1,f),s=f-a-1;a=f,l=0}else c===46&&l!==-1?++l:l=-1}return i}function r(u,n){var i=n.dir||n.root,s=n.base||(n.name||"")+(n.ext||"");return i?i===n.root?i+s:i+u+s:s}var o={resolve:function(){for(var n="",i=!1,s,a=arguments.length-1;a>=-1&&!i;a--){var l;a>=0?l=arguments[a]:(s===void 0&&(s=process.cwd()),l=s),e(l),l.length!==0&&(n=l+"/"+n,i=l.charCodeAt(0)===47)}return n=t(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(e(n),n.length===0)return".";var i=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=t(n,!i),n.length===0&&!i&&(n="."),n.length>0&&s&&(n+="/"),i?"/"+n:n},isAbsolute:function(n){return e(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,i=0;i<arguments.length;++i){var s=arguments[i];e(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":o.normalize(n)},relative:function(n,i){if(e(n),e(i),n===i||(n=o.resolve(n),i=o.resolve(i),n===i))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var a=n.length,l=a-s,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var f=i.length,p=f-c,m=l<p?l:p,h=-1,g=0;g<=m;++g){if(g===m){if(p>m){if(i.charCodeAt(c+g)===47)return i.slice(c+g+1);if(g===0)return i.slice(c+g)}else l>m&&(n.charCodeAt(s+g)===47?h=g:g===0&&(h=0));break}var y=n.charCodeAt(s+g),w=i.charCodeAt(c+g);if(y!==w)break;y===47&&(h=g)}var b="";for(g=s+h+1;g<=a;++g)(g===a||n.charCodeAt(g)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+i.slice(c+h):(c+=h,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(n){return n},dirname:function(n){if(e(n),n.length===0)return".";for(var i=n.charCodeAt(0),s=i===47,a=-1,l=!0,c=n.length-1;c>=1;--c)if(i=n.charCodeAt(c),i===47){if(!l){a=c;break}}else l=!1;return a===-1?s?"/":".":s&&a===1?"//":n.slice(0,a)},basename:function(n,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(n);var s=0,a=-1,l=!0,c;if(i!==void 0&&i.length>0&&i.length<=n.length){if(i.length===n.length&&i===n)return"";var f=i.length-1,p=-1;for(c=n.length-1;c>=0;--c){var m=n.charCodeAt(c);if(m===47){if(!l){s=c+1;break}}else p===-1&&(l=!1,p=c+1),f>=0&&(m===i.charCodeAt(f)?--f===-1&&(a=c):(f=-1,a=p))}return s===a?a=p:a===-1&&(a=n.length),n.slice(s,a)}else{for(c=n.length-1;c>=0;--c)if(n.charCodeAt(c)===47){if(!l){s=c+1;break}}else a===-1&&(l=!1,a=c+1);return a===-1?"":n.slice(s,a)}},extname:function(n){e(n);for(var i=-1,s=0,a=-1,l=!0,c=0,f=n.length-1;f>=0;--f){var p=n.charCodeAt(f);if(p===47){if(!l){s=f+1;break}continue}a===-1&&(l=!1,a=f+1),p===46?i===-1?i=f:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||a===-1||c===0||c===1&&i===a-1&&i===s+1?"":n.slice(i,a)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return r("/",n)},parse:function(n){e(n);var i={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return i;var s=n.charCodeAt(0),a=s===47,l;a?(i.root="/",l=1):l=0;for(var c=-1,f=0,p=-1,m=!0,h=n.length-1,g=0;h>=l;--h){if(s=n.charCodeAt(h),s===47){if(!m){f=h+1;break}continue}p===-1&&(m=!1,p=h+1),s===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1)}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===f+1?p!==-1&&(f===0&&a?i.base=i.name=n.slice(1,p):i.base=i.name=n.slice(f,p)):(f===0&&a?(i.name=n.slice(1,c),i.base=n.slice(1,p)):(i.name=n.slice(f,c),i.base=n.slice(f,p)),i.ext=n.slice(c,p)),f>0?i.dir=n.slice(0,f-1):a&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,kn=o,kn}var vg=yg();const Fs=mg(vg);class _g{constructor(t,r=!1){this.isDev=r,this.url=new URL(t),this.baseDir=Fs.dirname(this.url.pathname)}baseDir;url;dir(t){return this.isDev===!0?t:this.url.origin+Fs.resolve(this.baseDir,t)}}function Pr(){return Qc(er.TOKEN)}function Jc(e){e?hs(er.TOKEN,e,7,!0):zc(er.TOKEN,!0)}function Zc(){return Qc(er.TENANT)}function Eg(e){e?hs(er.TENANT,e,7,!0):zc(er.TENANT,!0)}const ef=(()=>{const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/,r=window.innerWidth<=768,o="ontouchstart"in window||navigator.maxTouchPoints>0;return t.test(e)||r&&o})();function tf(){return localStorage.getItem(ac)||"UTC+08:00"}function wg(e,t){return qe.mergeWith(qe.cloneDeep(e),t,(r,o)=>{if(typeof r=="object"&&typeof o=="object")return qe.mergeWith(qe.cloneDeep(r),o,(u,n)=>Array.isArray(u)?qe.unionWith(u,n,qe.isEqual):void 0)})}function Sg(e){const t=rs.stringify(e,{encode:!0,delimiter:";"});return t?`;${t}`:""}function rf(e){return e.indexOf(";")===-1?{}:rs.parse(e,{delimiter:";"})}const Zn=[];for(let e=0;e<=15;e++)Zn[e]=e.toString(16);function Ag(){let e="";for(let t=1;t<=36;t++)t===9||t===14||t===19||t===24?e+="-":t===15?e+=4:t===20?e+=Zn[Math.random()*4|8]:e+=Zn[Math.random()*16|0];return e.replace(/-/g,"")}let js=0;function Tg(e=""){e=e.replaceAll("-","");const t=Math.floor(Math.random()*1e9);return js++,e+"_"+t+js}const Ig=(e,t)=>{const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];let u;if(t=t||r.length,e)for(u=0;u<e;u++)o[u]=r[0|Math.random()*t];else{let n;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",u=0;u<36;u++)o[u]||(n=0|Math.random()*16,o[u]=r[u==19?n&3|8:n])}return o.join("")};function Rg(e,t){return Ne.computed({get:()=>e.value,set:o=>{e.value=o,t(o)}})}function Og(e,t){const r=Object.keys(Ne.isRef(e)?e.value:e),o={};return r.forEach(u=>{o[u]=Ne.computed({get:()=>(Ne.isRef(e)?e.value:e)[u],set(n){(Ne.isRef(e)?e.value:e)[u]=n,t(u,n)}})}),o}function Ng(e,t){const r=Object.keys(Ne.isRef(e)?e.value:e),o={};let u={};return r.forEach(n=>{o[n]=Ne.computed({get:()=>(u={},(Ne.isRef(e)?e.value:e)[n]),set(i){const s=Ne.isRef(e)?e.value:e;u[n]=i;const a={...s,...u};t(n,i,a)}})}),o}function Lg(e){if(e==="nullpx")return{value:0,unit:"px"};const t=/^(\d+\.?\d*)([a-zA-Z%]+)$/,r=e.match(t);if(r)return{value:parseFloat(r[1]),unit:r[2]};throw new Error("Invalid value")}function Mg(e){const t=Ne.ref();let r;const o=()=>{e.deep&&(r=Ne.watch(()=>t.value,u=>{console.info("computedEx:属性或者值修改",u),e.set(u)},{deep:!0}))};return Ne.watch(()=>e.get(),u=>{r&&r(),console.info("computedEx:获取新值,重新监听",u),t.value=u,o()},{immediate:!0}),t}function Pg(e){const t=new Map;return function(...r){const o=JSON.stringify(r);if(t.has(o))return t.get(o);const u=e(...r);return t.set(o,u),u}}function nf(e){e.interceptors.request.use(t=>(t.headers||(t.headers=new Cd.AxiosHeaders),Object.assign(t.headers,{Token:Pr(),Source:ef?502:501,Lang:_gct.store.lang,"Tenant-Id":Zc(),Timezone:tf()}),t))}var of="5.1.0";function An(e,t){return new Promise(r=>setTimeout(r,e,t))}function Cg(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function xg(e,t=1/0){const{requestIdleCallback:r}=window;return r?new Promise(o=>r.call(window,()=>o(),{timeout:t})):An(Math.min(e,t))}function sf(e){return!!e&&typeof e.then=="function"}function Ws(e,t){try{const r=e();sf(r)?r.then(o=>t(!0,o),o=>t(!1,o)):t(!0,r)}catch(r){t(!1,r)}}async function Gs(e,t,r=16){const o=Array(e.length);let u=Date.now();for(let n=0;n<e.length;++n){o[n]=t(e[n],n);const i=Date.now();i>=u+r&&(u=i,await Cg())}return o}function Cr(e){return e.then(void 0,()=>{}),e}function Dg(e,t){for(let r=0,o=e.length;r<o;++r)if(e[r]===t)return!0;return!1}function kg(e,t){return!Dg(e,t)}function ps(e){return parseInt(e)}function ct(e){return parseFloat(e)}function It(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Ye(e){return e.reduce((t,r)=>t+(r?1:0),0)}function af(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const r=1/t;return Math.round(e*r)/r}}function Ug(e){var t,r;const o=`Unexpected syntax '${e}'`,u=/^\s*([a-z-]*)(.*)$/i.exec(e),n=u[1]||void 0,i={},s=/([.:#][\w-]+|\[.+?\])/gi,a=(l,c)=>{i[l]=i[l]||[],i[l].push(c)};for(;;){const l=s.exec(u[2]);if(!l)break;const c=l[0];switch(c[0]){case".":a("class",c.slice(1));break;case"#":a("id",c.slice(1));break;case"[":{const f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(c);if(f)a(f[1],(r=(t=f[4])!==null&&t!==void 0?t:f[5])!==null&&r!==void 0?r:"");else throw new Error(o);break}default:throw new Error(o)}}return[n,i]}function Bg(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);if(o>127)return new TextEncoder().encode(e);t[r]=o}return t}function kt(e,t){const r=e[0]>>>16,o=e[0]&65535,u=e[1]>>>16,n=e[1]&65535,i=t[0]>>>16,s=t[0]&65535,a=t[1]>>>16,l=t[1]&65535;let c=0,f=0,p=0,m=0;m+=n+l,p+=m>>>16,m&=65535,p+=u+a,f+=p>>>16,p&=65535,f+=o+s,c+=f>>>16,f&=65535,c+=r+i,c&=65535,e[0]=c<<16|f,e[1]=p<<16|m}function st(e,t){const r=e[0]>>>16,o=e[0]&65535,u=e[1]>>>16,n=e[1]&65535,i=t[0]>>>16,s=t[0]&65535,a=t[1]>>>16,l=t[1]&65535;let c=0,f=0,p=0,m=0;m+=n*l,p+=m>>>16,m&=65535,p+=u*l,f+=p>>>16,p&=65535,p+=n*a,f+=p>>>16,p&=65535,f+=o*l,c+=f>>>16,f&=65535,f+=u*a,c+=f>>>16,f&=65535,f+=n*s,c+=f>>>16,f&=65535,c+=r*l+o*a+u*s+n*i,c&=65535,e[0]=c<<16|f,e[1]=p<<16|m}function ar(e,t){const r=e[0];t%=64,t===32?(e[0]=e[1],e[1]=r):t<32?(e[0]=r<<t|e[1]>>>32-t,e[1]=e[1]<<t|r>>>32-t):(t-=32,e[0]=e[1]<<t|r>>>32-t,e[1]=r<<t|e[1]>>>32-t)}function ot(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Be(e,t){e[0]^=t[0],e[1]^=t[1]}const Fg=[4283543511,3981806797],jg=[3301882366,444984403];function Hs(e){const t=[0,e[0]>>>1];Be(e,t),st(e,Fg),t[1]=e[0]>>>1,Be(e,t),st(e,jg),t[1]=e[0]>>>1,Be(e,t)}const $r=[2277735313,289559509],qr=[1291169091,658871167],Vs=[0,5],Wg=[0,1390208809],Gg=[0,944331445];function Hg(e,t){const r=Bg(e);t=t||0;const o=[0,r.length],u=o[1]%16,n=o[1]-u,i=[0,t],s=[0,t],a=[0,0],l=[0,0];let c;for(c=0;c<n;c=c+16)a[0]=r[c+4]|r[c+5]<<8|r[c+6]<<16|r[c+7]<<24,a[1]=r[c]|r[c+1]<<8|r[c+2]<<16|r[c+3]<<24,l[0]=r[c+12]|r[c+13]<<8|r[c+14]<<16|r[c+15]<<24,l[1]=r[c+8]|r[c+9]<<8|r[c+10]<<16|r[c+11]<<24,st(a,$r),ar(a,31),st(a,qr),Be(i,a),ar(i,27),kt(i,s),st(i,Vs),kt(i,Wg),st(l,qr),ar(l,33),st(l,$r),Be(s,l),ar(s,31),kt(s,i),st(s,Vs),kt(s,Gg);a[0]=0,a[1]=0,l[0]=0,l[1]=0;const f=[0,0];switch(u){case 15:f[1]=r[c+14],ot(f,48),Be(l,f);case 14:f[1]=r[c+13],ot(f,40),Be(l,f);case 13:f[1]=r[c+12],ot(f,32),Be(l,f);case 12:f[1]=r[c+11],ot(f,24),Be(l,f);case 11:f[1]=r[c+10],ot(f,16),Be(l,f);case 10:f[1]=r[c+9],ot(f,8),Be(l,f);case 9:f[1]=r[c+8],Be(l,f),st(l,qr),ar(l,33),st(l,$r),Be(s,l);case 8:f[1]=r[c+7],ot(f,56),Be(a,f);case 7:f[1]=r[c+6],ot(f,48),Be(a,f);case 6:f[1]=r[c+5],ot(f,40),Be(a,f);case 5:f[1]=r[c+4],ot(f,32),Be(a,f);case 4:f[1]=r[c+3],ot(f,24),Be(a,f);case 3:f[1]=r[c+2],ot(f,16),Be(a,f);case 2:f[1]=r[c+1],ot(f,8),Be(a,f);case 1:f[1]=r[c],Be(a,f),st(a,$r),ar(a,31),st(a,qr),Be(i,a)}return Be(i,o),Be(s,o),kt(i,s),kt(s,i),Hs(i),Hs(s),kt(i,s),kt(s,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function Vg(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
374
- `),...e}}function $g(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function qg(e){return typeof e!="function"}function Yg(e,t){const r=Cr(new Promise(o=>{const u=Date.now();Ws(e.bind(null,t),(...n)=>{const i=Date.now()-u;if(!n[0])return o(()=>({error:n[1],duration:i}));const s=n[1];if(qg(s))return o(()=>({value:s,duration:i}));o(()=>new Promise(a=>{const l=Date.now();Ws(s,(...c)=>{const f=i+Date.now()-l;if(!c[0])return a({error:c[1],duration:f});a({value:c[1],duration:f})})}))})}));return function(){return r.then(u=>u())}}function Kg(e,t,r,o){const u=Object.keys(e).filter(i=>kg(r,i)),n=Cr(Gs(u,i=>Yg(e[i],t),o));return async function(){const s=await n,a=await Gs(s,f=>Cr(f()),o),l=await Promise.all(a),c={};for(let f=0;f<u.length;++f)c[u[f]]=l[f];return c}}function lf(){const e=window,t=navigator;return Ye(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Xg(){const e=window,t=navigator;return Ye(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!lf()}function Ur(){const e=window,t=navigator;return Ye(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function dt(){const e=window,t=navigator;return Ye(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function gs(){const e=window,{HTMLElement:t,Document:r}=e;return Ye(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),r&&"pointerLockElement"in r.prototype])>=4}function Br(){const e=window;return $g(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Fr(){var e,t;const r=window;return Ye(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function zg(){const e=window,t=navigator,{CSS:r}=e;return Ye(["userActivation"in t,r.supports("color","light-dark(#000, #fff)"),r.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function uf(){const{CSS:e}=window;return Ye([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Qg(){const e=window;return Ye([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Jg(){const e=window,{URLPattern:t}=e;return Ye(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Zg(){const e=window;return Ye(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function jr(){const e=window,t=navigator,{CSS:r,HTMLButtonElement:o}=e;return Ye([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function eb(){if(navigator.platform==="iPad")return!0;const e=screen,t=e.width/e.height;return Ye(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function tb(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function rb(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function bs(){const e=Ur(),t=Fr(),r=window,o=navigator,u="connection";return e?Ye([!("SharedWorker"in r),o[u]&&"ontypechange"in o[u],!("sinkId"in new Audio)])>=2:t?Ye(["onorientationchange"in r,"orientation"in r,/android/i.test(o.appVersion)])>=2:!1}function nb(){const e=navigator,t=window,r=Audio.prototype,{visualViewport:o}=t;return Ye(["srLatency"in r,"srChannelCount"in r,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}function ib(){return ab()?-4:ob()}function ob(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(sb())return-1;const r=4500,o=5e3,u=new t(1,o,44100),n=u.createOscillator();n.type="triangle",n.frequency.value=1e4;const i=u.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,n.connect(i),i.connect(u.destination),n.start(0);const[s,a]=lb(u),l=Cr(s.then(c=>ub(c.getChannelData(0).subarray(r)),c=>{if(c.name==="timeout"||c.name==="suspended")return-3;throw c}));return()=>(a(),l)}function sb(){return dt()&&!gs()&&!Zg()}function ab(){return dt()&&jr()&&Br()||Ur()&&nb()&&Jg()}function lb(e){let n=()=>{};return[new Promise((s,a)=>{let l=!1,c=0,f=0;e.oncomplete=h=>s(h.renderedBuffer);const p=()=>{setTimeout(()=>a($s("timeout")),Math.min(500,f+5e3-Date.now()))},m=()=>{try{const h=e.startRendering();switch(sf(h)&&Cr(h),e.state){case"running":f=Date.now(),l&&p();break;case"suspended":document.hidden||c++,l&&c>=3?a($s("suspended")):setTimeout(m,500);break}}catch(h){a(h)}};m(),n=()=>{l||(l=!0,f>0&&p())}}),n]}function ub(e){let t=0;for(let r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function $s(e){const t=new Error(e);return t.name=e,t}async function cf(e,t,r=50){var o,u,n;const i=document;for(;!i.body;)await An(r);const s=i.createElement("iframe");try{for(await new Promise((a,l)=>{let c=!1;const f=()=>{c=!0,a()},p=g=>{c=!0,l(g)};s.onload=f,s.onerror=p;const{style:m}=s;m.setProperty("display","block","important"),m.position="absolute",m.top="0",m.left="0",m.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",i.body.appendChild(s);const h=()=>{var g,y;c||(((y=(g=s.contentWindow)===null||g===void 0?void 0:g.document)===null||y===void 0?void 0:y.readyState)==="complete"?f():setTimeout(h,10))};h()});!(!((u=(o=s.contentWindow)===null||o===void 0?void 0:o.document)===null||u===void 0)&&u.body);)await An(r);return await e(s,s.contentWindow)}finally{(n=s.parentNode)===null||n===void 0||n.removeChild(s)}}function cb(e){const[t,r]=Ug(e),o=document.createElement(t??"div");for(const u of Object.keys(r)){const n=r[u].join(" ");u==="style"?fb(o.style,n):o.setAttribute(u,n)}return o}function fb(e,t){for(const r of t.split(";")){const o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(r);if(o){const[,u,n,,i]=o;e.setProperty(u,n,i||"")}}}function hb(){let e=window;for(;;){const t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(r){if(r instanceof Error&&r.name==="SecurityError")return!0;throw r}e=t}}const db="mmMwWLliI0O&1",pb="48px",lr=["monospace","sans-serif","serif"],qs=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function gb(){return cf(async(e,{document:t})=>{const r=t.body;r.style.fontSize=pb;const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const u={},n={},i=m=>{const h=t.createElement("span"),{style:g}=h;return g.position="absolute",g.top="0",g.left="0",g.fontFamily=m,h.textContent=db,o.appendChild(h),h},s=(m,h)=>i(`'${m}',${h}`),a=()=>lr.map(i),l=()=>{const m={};for(const h of qs)m[h]=lr.map(g=>s(h,g));return m},c=m=>lr.some((h,g)=>m[g].offsetWidth!==u[h]||m[g].offsetHeight!==n[h]),f=a(),p=l();r.appendChild(o);for(let m=0;m<lr.length;m++)u[lr[m]]=f[m].offsetWidth,n[lr[m]]=f[m].offsetHeight;return qs.filter(m=>c(p[m]))})}function bb(){const e=navigator.plugins;if(!e)return;const t=[];for(let r=0;r<e.length;++r){const o=e[r];if(!o)continue;const u=[];for(let n=0;n<o.length;++n){const i=o[n];u.push({type:i.type,suffixes:i.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:u})}return t}function mb(){return yb(Tb())}function yb(e){let t=!1,r,o;const[u,n]=vb();return _b(u,n)?(t=Eb(n),e?r=o="skipped":[r,o]=wb(u,n)):r=o="unsupported",{winding:t,geometry:r,text:o}}function vb(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function _b(e,t){return!!(t&&e.toDataURL)}function Eb(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function wb(e,t){Sb(e,t);const r=Un(e),o=Un(e);return r!==o?["unstable","unstable"]:(Ab(e,t),[Un(e),r])}function Sb(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const r="Cwm fjordbank gly 😃";t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}function Ab(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[r,o,u]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=r,t.beginPath(),t.arc(o,u,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Un(e){return e.toDataURL()}function Tb(){const e=dt()&&jr()&&Br(),t=Fr()&&zg();return e||t}function Ib(){const e=navigator;let t=0,r;e.maxTouchPoints!==void 0?t=ps(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),r=!0}catch{r=!1}const o="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:r,touchStart:o}}function Rb(){return navigator.oscpu}function Ob(){const e=navigator,t=[],r=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(r!==void 0&&t.push([r]),Array.isArray(e.languages))Ur()&&Qg()||t.push(e.languages);else if(typeof e.languages=="string"){const o=e.languages;o&&t.push(o.split(","))}return t}function Nb(){return window.screen.colorDepth}function Lb(){return It(ct(navigator.deviceMemory),void 0)}function Mb(){if(!(dt()&&jr()&&Br()))return Pb()}function Pb(){const e=screen,t=o=>It(ps(o),null),r=[t(e.width),t(e.height)];return r.sort().reverse(),r}const Cb=2500,xb=10;let Qr,Bn;function Db(){if(Bn!==void 0)return;const e=()=>{const t=ei();ti(t)?Bn=setTimeout(e,Cb):(Qr=t,Bn=void 0)};e()}function kb(){return Db(),async()=>{let e=ei();if(ti(e)){if(Qr)return[...Qr];tb()&&(await rb(),e=ei())}return ti(e)||(Qr=e),e}}function Ub(){const e=dt()&&jr()&&Br(),t=Fr()&&uf();if(e||t)return()=>Promise.resolve(void 0);const r=kb();return async()=>{const o=await r(),u=n=>n===null?null:af(n,xb);return[u(o[0]),u(o[1]),u(o[2]),u(o[3])]}}function ei(){const e=screen;return[It(ct(e.availTop),null),It(ct(e.width)-ct(e.availWidth)-It(ct(e.availLeft),0),null),It(ct(e.height)-ct(e.availHeight)-It(ct(e.availTop),0),null),It(ct(e.availLeft),null)]}function ti(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Bb(){const e=Fb();return e!==void 0&&Fr()&&uf()?e>=8?8:4:e}function Fb(){return It(ps(navigator.hardwareConcurrency),void 0)}function jb(){var e;const t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){const o=new t().resolvedOptions().timeZone;if(o)return o}const r=-Wb();return`UTC${r>=0?"+":""}${r}`}function Wb(){const e=new Date().getFullYear();return Math.max(ct(new Date(e,0,1).getTimezoneOffset()),ct(new Date(e,6,1).getTimezoneOffset()))}function Gb(){try{return!!window.sessionStorage}catch{return!0}}function Hb(){try{return!!window.localStorage}catch{return!0}}function Vb(){if(!(lf()||Xg()))try{return!!window.indexedDB}catch{return!0}}function $b(){return!!window.openDatabase}function qb(){return navigator.cpuClass}function Yb(){const{platform:e}=navigator;return e==="MacIntel"&&dt()&&!gs()?eb()?"iPad":"iPhone":e}function Kb(){return navigator.vendor||""}function Xb(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const r=window[t];r&&typeof r=="object"&&e.push(t)}return e.sort()}function zb(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Qb(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function Jb({debug:e}={}){if(!Zb())return;const t=Qb(),r=Object.keys(t),o=[].concat(...r.map(i=>t[i])),u=await em(o);e&&tm(t,u);const n=r.filter(i=>{const s=t[i];return Ye(s.map(l=>u[l]))>s.length*.6});return n.sort(),n}function Zb(){return dt()||bs()}async function em(e){var t;const r=document,o=r.createElement("div"),u=new Array(e.length),n={};Ys(o);for(let i=0;i<e.length;++i){const s=cb(e[i]);s.tagName==="DIALOG"&&s.show();const a=r.createElement("div");Ys(a),a.appendChild(s),o.appendChild(a),u[i]=s}for(;!r.body;)await An(50);r.body.appendChild(o);try{for(let i=0;i<e.length;++i)u[i].offsetParent||(n[e[i]]=!0)}finally{(t=o.parentNode)===null||t===void 0||t.removeChild(o)}return n}function Ys(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function tm(e,t){let r="DOM blockers debug:\n```";for(const o of Object.keys(e)){r+=`
375
- ${o}:`;for(const u of e[o])r+=`
376
- ${t[u]?"🚫":"➡️"} ${u}`}console.log(`${r}
377
- \`\`\``)}function rm(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function nm(){if(Ks("inverted"))return!0;if(Ks("none"))return!1}function Ks(e){return matchMedia(`(inverted-colors: ${e})`).matches}function im(){if(Xs("active"))return!0;if(Xs("none"))return!1}function Xs(e){return matchMedia(`(forced-colors: ${e})`).matches}const om=100;function sm(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=om;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function am(){if(ur("no-preference"))return 0;if(ur("high")||ur("more"))return 1;if(ur("low")||ur("less"))return-1;if(ur("forced"))return 10}function ur(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function lm(){if(zs("reduce"))return!0;if(zs("no-preference"))return!1}function zs(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function um(){if(Qs("reduce"))return!0;if(Qs("no-preference"))return!1}function Qs(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function cm(){if(Js("high"))return!0;if(Js("standard"))return!1}function Js(e){return matchMedia(`(dynamic-range: ${e})`).matches}const xe=Math,et=()=>0;function fm(){const e=xe.acos||et,t=xe.acosh||et,r=xe.asin||et,o=xe.asinh||et,u=xe.atanh||et,n=xe.atan||et,i=xe.sin||et,s=xe.sinh||et,a=xe.cos||et,l=xe.cosh||et,c=xe.tan||et,f=xe.tanh||et,p=xe.exp||et,m=xe.expm1||et,h=xe.log1p||et,g=R=>xe.pow(xe.PI,R),y=R=>xe.log(R+xe.sqrt(R*R-1)),w=R=>xe.log(R+xe.sqrt(R*R+1)),b=R=>xe.log((1+R)/(1-R))/2,E=R=>xe.exp(R)-1/xe.exp(R)/2,T=R=>(xe.exp(R)+1/xe.exp(R))/2,v=R=>xe.exp(R)-1,A=R=>(xe.exp(2*R)-1)/(xe.exp(2*R)+1),S=R=>xe.log(1+R);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:y(1e154),asin:r(.12312423423423424),asinh:o(1),asinhPf:w(1),atanh:u(.5),atanhPf:b(.5),atan:n(.5),sin:i(-1e300),sinh:s(1),sinhPf:E(1),cos:a(10.000000000123),cosh:l(1),coshPf:T(1),tan:c(-1e300),tanh:f(1),tanhPf:A(1),exp:p(1),expm1:m(1),expm1Pf:v(1),log1p:h(10),log1pPf:S(10),powPI:g(-100)}}const hm="mmMwWLliI0fiflO&1",Fn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function dm(){return pm((e,t)=>{const r={},o={};for(const u of Object.keys(Fn)){const[n={},i=hm]=Fn[u],s=e.createElement("span");s.textContent=i,s.style.whiteSpace="nowrap";for(const a of Object.keys(n)){const l=n[a];l!==void 0&&(s.style[a]=l)}r[u]=s,t.append(e.createElement("br"),s)}for(const u of Object.keys(Fn))o[u]=r[u].getBoundingClientRect().width;return o})}function pm(e,t=4e3){return cf((r,o)=>{const u=o.document,n=u.body,i=n.style;i.width=`${t}px`,i.webkitTextSizeAdjust=i.textSizeAdjust="none",Ur()?n.style.zoom=`${1/o.devicePixelRatio}`:dt()&&(n.style.zoom="reset");const s=u.createElement("div");return s.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),n.appendChild(s),e(u,n)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function gm(){return navigator.pdfViewerEnabled}function bm(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function mm(){const{ApplePaySession:e}=window;if(typeof e?.canMakePayments!="function")return-1;if(ym())return-3;try{return e.canMakePayments()?1:0}catch(t){return vm(t)}}const ym=hb;function vm(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function _m(){var e;const t=document.createElement("a"),r=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return r===void 0?void 0:String(r)}const ff=-1,hf=-2,Em=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),wm=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Sm=["FRAGMENT_SHADER","VERTEX_SHADER"],Am=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],df="WEBGL_debug_renderer_info",Tm="WEBGL_polygon_mode";function Im({cache:e}){var t,r,o,u,n,i;const s=pf(e);if(!s)return ff;if(!bf(s))return hf;const a=gf()?null:s.getExtension(df);return{version:((t=s.getParameter(s.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((r=s.getParameter(s.VENDOR))===null||r===void 0?void 0:r.toString())||"",vendorUnmasked:a?(o=s.getParameter(a.UNMASKED_VENDOR_WEBGL))===null||o===void 0?void 0:o.toString():"",renderer:((u=s.getParameter(s.RENDERER))===null||u===void 0?void 0:u.toString())||"",rendererUnmasked:a?(n=s.getParameter(a.UNMASKED_RENDERER_WEBGL))===null||n===void 0?void 0:n.toString():"",shadingLanguageVersion:((i=s.getParameter(s.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function Rm({cache:e}){const t=pf(e);if(!t)return ff;if(!bf(t))return hf;const r=t.getSupportedExtensions(),o=t.getContextAttributes(),u=[],n=[],i=[],s=[],a=[];if(o)for(const c of Object.keys(o))n.push(`${c}=${o[c]}`);const l=Zs(t);for(const c of l){const f=t[c];i.push(`${c}=${f}${Em.has(f)?`=${t.getParameter(f)}`:""}`)}if(r)for(const c of r){if(c===df&&gf()||c===Tm&&Lm())continue;const f=t.getExtension(c);if(!f){u.push(c);continue}for(const p of Zs(f)){const m=f[p];s.push(`${p}=${m}${wm.has(m)?`=${t.getParameter(m)}`:""}`)}}for(const c of Sm)for(const f of Am){const p=Om(t,c,f);a.push(`${c}.${f}=${p.join(",")}`)}return s.sort(),i.sort(),{contextAttributes:n,parameters:i,shaderPrecisions:a,extensions:r,extensionParameters:s,unsupportedExtensions:u}}function pf(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let r;t.addEventListener("webglCreateContextError",()=>r=void 0);for(const o of["webgl","experimental-webgl"]){try{r=t.getContext(o)}catch{}if(r)break}return e.webgl={context:r},r}function Om(e,t,r){const o=e.getShaderPrecisionFormat(e[t],e[r]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Zs(e){return Object.keys(e.__proto__).filter(Nm)}function Nm(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function gf(){return Fr()}function Lm(){return Ur()||dt()}function bf(e){return typeof e.getParameter=="function"}function Mm(){if(!(bs()||dt()))return-2;if(!window.AudioContext)return-1;const t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Pm(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}const Cm={fonts:gb,domBlockers:Jb,fontPreferences:dm,audio:ib,screenFrame:Ub,canvas:mb,osCpu:Rb,languages:Ob,colorDepth:Nb,deviceMemory:Lb,screenResolution:Mb,hardwareConcurrency:Bb,timezone:jb,sessionStorage:Gb,localStorage:Hb,indexedDB:Vb,openDatabase:$b,cpuClass:qb,platform:Yb,plugins:bb,touchSupport:Ib,vendor:Kb,vendorFlavors:Xb,cookiesEnabled:zb,colorGamut:rm,invertedColors:nm,forcedColors:im,monochrome:sm,contrast:am,reducedMotion:lm,reducedTransparency:um,hdr:cm,math:fm,pdfViewerEnabled:gm,architecture:bm,applePay:mm,privateClickMeasurement:_m,audioBaseLatency:Mm,dateTimeLocale:Pm,webGlBasics:Im,webGlExtensions:Rm};function xm(e){return Kg(Cm,e,[])}const Dm="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";function km(e){const t=Um(e),r=Bm(t);return{score:t,comment:Dm.replace(/\$/g,`${r}`)}}function Um(e){if(bs())return .4;if(dt())return gs()&&!(jr()&&Br())?.5:.3;const t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Bm(e){return af(.99+.01*e,1e-4)}function Fm(e){let t="";for(const r of Object.keys(e).sort()){const o=e[r],u="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${r.replace(/([:|\\])/g,"\\$1")}:${u}`}return t}function mf(e){return JSON.stringify(e,(t,r)=>r instanceof Error?Vg(r):r,2)}function yf(e){return Hg(Fm(e))}function jm(e){let t;const r=km(e);return{get visitorId(){return t===void 0&&(t=yf(this.components)),t},set visitorId(o){t=o},confidence:r,components:e,version:of}}function Wm(e=50){return xg(e,e*2)}function Gm(e,t){const r=Date.now();return{async get(o){const u=Date.now(),n=await e(),i=jm(n);return(t||o?.debug)&&console.log(`Copy the text below to get the debug data:
378
-
379
- \`\`\`
380
- version: ${i.version}
381
- userAgent: ${navigator.userAgent}
382
- timeBetweenLoadAndGet: ${u-r}
383
- visitorId: ${i.visitorId}
384
- components: ${mf(n)}
385
- \`\`\``),i}}}function Hm(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${of}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function Vm(e={}){const{delayFallback:t,debug:r,monitoring:o=!0}=e;o&&Hm(),await Wm(t);const u=xm({cache:{},debug:r});return Gm(u,r)}var $m={load:Vm,hashComponents:yf,componentsToDebugString:mf};const ea="FINGERPRINT";function vf(){return typeof window<"u"&&typeof navigator<"u"}function qm(){if(!vf())return{type:"unknown",name:"unknown"};const e=navigator.userAgent;return/iPad|iPhone|iPod/i.test(e)?{type:"mobile",name:"iOS"}:/Android/i.test(e)?{type:"mobile",name:"Android"}:/Windows Phone/i.test(e)?{type:"mobile",name:"Windows Phone"}:/BlackBerry/i.test(e)?{type:"mobile",name:"BlackBerry"}:/Edg/i.test(e)?{type:"web",name:"Edge"}:/OPR|Opera/i.test(e)?{type:"web",name:"Opera"}:/Firefox/i.test(e)?{type:"web",name:"Firefox"}:/Chrome/i.test(e)?{type:"web",name:"Chrome"}:/Safari/i.test(e)?{type:"web",name:"Safari"}:{type:"unknown",name:"unknown"}}async function Ym(){return(await $m.load()).get()}async function ms(){if(!vf())return"unknown/unknown";const{type:e,name:t}=qm(),r=e==="web";if(r){const n=localStorage.getItem(ea);if(n)return`${t}/${n}`}const u=(await Ym()).visitorId;return r&&localStorage.setItem(ea,u),`${t}/${u}`}function _f(){let e=sessionStorage.getItem("currentPageTag");return e||(e=Date.now().toString(),sessionStorage.setItem("currentPageTag",e)),e}class at{static _DEFAULT_CONFIG={id:"id",children:"children",pid:"pid",deep:!0};static _getConfig(t){return Object.assign({},at._DEFAULT_CONFIG,t)}static listToTree(t,r={},o){const u=at._getConfig(r),n=new Map,i=[],{id:s,children:a,pid:l,deep:c}=u;for(const f of t){const p=f;c?p[a]=p[a]??void 0:p[a]=p[l]==="ROOT"?p[a]??[]:[],n.set(p[s],o(f))}for(const f of t){const p=f,m=n.get(p[l]);if(m){const h=m;h[a]||(h[a]=[]),h[a].push(o(f))}else i.push(o(f))}return i}static treeToList(t,r={}){const{children:o}=at._getConfig(r),u=[...t];for(let n=0;n<u.length;n++){const s=u[n][o];Array.isArray(s)&&u.splice(n+1,0,...s)}return u}static findNode(t,r,o={}){const{children:u}=at._getConfig(o),n=t?[...t]:[];for(const i of n){if(r(i))return i;const a=i[u];Array.isArray(a)&&n.push(...a)}return null}static findNodeAll(t,r,o={}){const{children:u}=at._getConfig(o),n=t?[...t]:[],i=[];for(const s of n){r(s)&&i.push(s);const l=s[u];Array.isArray(l)&&n.push(...l)}return i}static findPath(t,r,o={}){const{children:u}=at._getConfig(o),n=[],i=t?[...t]:[],s=new Set;for(;i.length;){const a=i[0];if(s.has(a))n.pop(),i.shift();else{s.add(a);const c=a[u];if(Array.isArray(c)&&i.unshift(...c),n.push(a),r(a))return n}}return null}static findClosestParent(t,r,o,u={}){const{id:n}=at._getConfig(u);return at.findPath(t,s=>s[n]===r,u)?.reverse().find(s=>o(s))}static list_to_tree(t,r){const o={},u=[];for(let n=0;n<t.length;n++){const i=t[n];o[i.id]=n,i.children=[]}for(const n of t)if(n.parentId==="ROOT"||!n.parentId)u.push(r(n));else{const i=n,s=o[n.parentId];s!==void 0&&t[s].children?.push(r(i))}return u}static getAllParentPath(t,r){return(at.findPath(t,u=>u.path===r)||[]).map(u=>u.path)}static traverseAndBuildTree(t,r,o={}){o=this._getConfig(o);const{children:u}=o;return t.map(n=>{const i=r(n)||n;return u&&n[u]&&n[u].length>0&&(i[u]=this.traverseAndBuildTree(n.children,r)),i})}static eachTree(t,r,o={}){t.forEach(u=>{const n=r(u,o)||u;u.children&&at.eachTree(u.children,r,n)})}}const Km=(e,t=[])=>{const r={},o=e.padding;o&&(o.top!=null&&o.top!=""&&!t.includes("paddingTop")&&(r["padding-top"]=o.top),o.right!=null&&o.right!=""&&!t.includes("paddingRight")&&(r["padding-right"]=o.right),o.bottom!=null&&o.bottom!=""&&!t.includes("paddingBottom")&&(r["padding-bottom"]=o.bottom),o.left!=null&&o.left!=""&&!t.includes("paddingLeft")&&(r["padding-left"]=o.left));const u=e.margin;u&&(u.top!=null&&u.top!=""&&!t.includes("marginTop")&&(r["margin-top"]=u.top),u.right!=null&&u.right!=""&&!t.includes("marginRight")&&(r["margin-right"]=u.right),u.bottom!=null&&u.bottom!=""&&!t.includes("marginBottom")&&(r["margin-bottom"]=u.bottom),u.left!=null&&u.left!=""&&!t.includes("marginLeft")&&(r["margin-left"]=u.left)),e.background!=null&&e.background!=""&&!t.includes("backgroundColor")&&(r["background-color"]=e.background),e.width!=null&&e.width!=""&&!t.includes("width")&&(r.width=e.width),e.height!=null&&e.height!=""&&!t.includes("height")&&(r.height=e.height,r.overflowX="hidden",r.overflowY="auto");const n=e.position;n&&(n.position!=null&&n.position!=""&&!t.includes("zIndex")&&(r.position=n.position,r["z-index"]=1),n.top!=null&&n.top!=""&&!t.includes("top")&&(r.top=`${n.top}px`),n.right!=null&&n.right!=""&&!t.includes("right")&&(r.right=`${n.right}px`),n.bottom!=null&&n.bottom!=""&&!t.includes("bottom")&&(r.bottom=`${n.bottom}px`),n.left!=null&&n.left!=""&&!t.includes("left")&&(r.left=`${n.left}px`));const i=e.border;return i&&(i.topLeftRadius!=null&&i.topLeftRadius!=""&&!t.includes("borderTopLeftRadius")&&(r["border-top-left-radius"]=i.topLeftRadius),i.topRightRadius!=null&&i.topRightRadius!=""&&!t.includes("borderTopRightRadius")&&(r["border-top-right-radius"]=i.topRightRadius),i.bottomLeftRadius!=null&&i.bottomLeftRadius!=""&&!t.includes("borderBottomLeftRadius")&&(r["border-bottom-left-radius"]=i.bottomLeftRadius),i.bottomRightRadius!=null&&i.bottomRightRadius!=""&&!t.includes("borderBottomRightRadius")&&(r["border-bottom-right-radius"]=i.bottomRightRadius),i.top&&(i.top.color!=null&&i.top.color!=""&&!t.includes("borderTopColor")&&(r["border-top-color"]=i.top.color),i.top.width!=null&&i.top.width!=""&&!t.includes("borderTopWidth")&&(r["border-top-width"]=i.top.width),i.top.style&&!t.includes("borderTopStyle")&&(r["border-top-style"]=i.top.style)),i.right&&(i.right.color!=null&&i.right.color!=""&&!t.includes("borderRightColor")&&(r["border-right-color"]=i.right.color),i.right.width!=null&&i.right.width!=""&&!t.includes("borderRightWidth")&&(r["border-right-width"]=i.right.width),i.right.style&&!t.includes("borderRightStyle")&&(r["border-right-style"]=i.right.style)),i.bottom&&(i.bottom.color!=null&&i.bottom.color!=""&&!t.includes("borderBottomColor")&&(r["border-bottom-color"]=i.bottom.color),i.bottom.width!=null&&i.bottom.width!=""&&!t.includes("borderBottomWidth")&&(r["border-bottom-width"]=i.bottom.width),i.bottom.style&&!t.includes("borderBottomStyle")&&(r["border-bottom-style"]=i.bottom.style)),i.left&&(i.left.color!=null&&i.left.color!=""&&!t.includes("borderLeftColor")&&(r["border-left-color"]=i.left.color),i.left.width!=null&&i.left.width!=""&&!t.includes("borderLeftWidth")&&(r["border-left-width"]=i.left.width),i.left.style&&!t.includes("borderLeftStyle")&&(r["border-left-style"]=i.left.style))),e.border_radius&&(r["border-radius"]=`${e.border_radius}px`),r},Xm=(e,t=[])=>{const r={},o=e.labelFont;return o&&(o.color!=null&&o.color!=""&&!t.includes("color")&&(r.color=o.color),o.fontSize!=null&&o.fontSize!=""&&!t.includes("fontSize")&&(r["font-size"]=o.fontSize),o.align&&!t.includes("textAlign")&&(r["text-align"]=o.align,r["text-align-last"]=o.align),o.bold===!0&&!t.includes("fontWeight")&&(r["font-weight"]="bold"),o.italic===!0&&!t.includes("fontStyle")&&(r["font-style"]="italic"),o.textDecoration&&!t.includes("textDecoration")&&(r["text-decoration"]=o.textDecoration)),r};function Ef(e,t){let r=e;return Object.keys(t).forEach(o=>{r=r.replace(`{${o}}`,t[o]??""),r=r.replace(`{${o}?}`,t[o]??"")}),r=r.replace(/\/\{[a-z]+\?\}/g,""),r}function wf(e,t){const{target:r="_blank",noopener:o=!0,noreferrer:u=!0,genUrlData:n,routePath:i="",optionStr:s=""}=t||{},a=[];o&&a.push("noopener=yes"),u&&a.push("noreferrer=yes");let l=e;n&&(l=Ef(l,n)),i&&(l+=i);let c=a.join(",");return s&&(c=c?`${c},${s}`:s),window.open(l,r,c)}function zm(e){switch(e){case be.TEXT:case be.INTEGER:case be.LONG:case be.DOUBLE:case be.DECIMAL:case be.DATE:case be.TIME:case be.DATE_TIME:case be.BOOLEAN:case be.USER:case be.USER_MULTI:case be.ORG:case be.ORG_MULTI:case be.ENUM:case be.ENUM_MULTI:case be.REF:case be.REF_MULTI:case be.RDO_REF:case be.EXPRESSION:case be.AGG:case be.SERIAL:case be.DOCUMENT_TEMPLATE:case be.PRINTER:case be.TRANSACTION:case be.MESSAGE_TMPL:case be.RANGE_USER:return!0;default:return!1}}const xr=(e=[],t)=>{const{needPrefix:r=!1,isString:o=!0,prefix:u="u_",length:n=8,chars:i="",numPref:s=!1}=t||{};let a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";i==="capital&number"?a="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789":i==="lowercase&number"?a="abcdefghijklmnopqrstuvwxyz0123456789":i==="lowercase"&&(a="abcdefghijklmnopqrstuvwxyz");let l;for(;!l;){let c="";if(o){s&&(c+=Math.floor(Math.random()*9)+1);for(let f=0;f<n;f++)c+=a.charAt(Math.floor(Math.random()*a.length))}else c=`${r?u:""}${s?Math.floor(Math.random()*9)+1:""}${Math.random().toString(36).substr(2,n)}`;e.includes(c)||(l=c)}return l};xr.Generate=(e,t)=>{const r=Array.isArray(e)?e.concat():[];return{next:()=>{const o=xr(r,t);return r.push(o),o}}};function Qm(e,t,r){const o="children",n=Ne.computed(()=>e.value.reduce((l,c)=>{l.push(c);const f=c[o].map(p=>({...p,_pid_:c.id}));return l.push(...f),l},[])),i=Ne.computed(()=>n.value.map(l=>l._pid_?l.key.replace(new RegExp(`^${Ne.unref(t)}_*`),""):null).filter(l=>l));function s(l,c){return xr([...Ne.unref(i),...l??[]],{...r,...c})}function a(l,c){return xr.Generate([...Ne.unref(i),...l??[]],{...r,...c})}return{oldUUids:i,flatTableData:n,getUuid:s,getUuidGenerate:a}}const ys=e=>{const t=/[\u{1F300}-\u{1F5FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu,r=/\u{1F91D}\u{1F3FB}-\u{1F3FF}/u;return t.test(e)||r.test(e)},Sf=e=>ys(e)||/[*??::,,[\]【】#]/.test(e),Af=e=>ys(e)||/[*??::,,[\]\\/【】#]/.test(e),Jm=(e,t)=>Sf(t)?Promise.reject(pr("sys.model.modelNameError")):Promise.resolve(),Zm=(e,t)=>Af(t)?Promise.reject(pr("sys.model.notModelNameError")):Promise.resolve();class ey{static getFiles({multiple:t,acceptList:r}){const o=document.createElement("input");return o.type="file",o.multiple=!!t,o.accept=r||"*",o.click(),new Promise((u,n)=>{o.onchange=async()=>{const i=o.files||[];u(Object.values(i))},o.onerror=async()=>{n()}})}static async beforeUploadFun(t,{maxSize:r=5,acceptList:o=[],beforeUpload:u}){if(t.name.indexOf(",")>-1)return Promise.reject("文件名不能有逗号");if(u&&await u(t),t.size/1024/1024>r)return Promise.reject(`【${t.name}】文件大小不能超过 ${r}MB`);if(o.length){const i=t?.name?.replaceAll(" ","")?.match(/\.([A-Za-z0-9]+)$/)?.at(-1);if(!o.includes(`.${i?.toLocaleLowerCase()}`))return Promise.reject(`【${t.name}】支持的扩展名为${o.join(" ")}`)}}static async uploadByFile(t,r=!1,o){const u=new FormData;return u.append("file",t,t.name),"/"+await(r?ty:ry)(u,o)}static toBase64(t){return new Promise((r,o)=>{const u=new FileReader;u.onloadend=function(){r(u.result)},u.onerror=()=>o("转换失败"),t&&u.readAsDataURL(t)})}static compressToBase64(t,{quality:r=.8,scale:o=.8}={}){return new Promise((u,n)=>{if(!t.type.startsWith("image/")){n("请选择图片文件");return}if(typeof o!="number"||o<=0||o>1){n("缩放比例必须在0-1之间");return}const i=new FileReader;i.onload=s=>{const a=new Image;a.onload=()=>{const l=Math.floor(a.width*o),c=Math.floor(a.height*o),f=document.createElement("canvas");f.width=l,f.height=c;const p=f.getContext("2d");p.imageSmoothingEnabled=!0,p.imageSmoothingQuality="high",p.drawImage(a,0,0,l,c),u(f.toDataURL(t.type,r))},a.onerror=()=>n("图片加载失败"),a.src=s.target?.result},i.onerror=()=>n("文件读取失败"),i.readAsDataURL(t)})}}async function ty(e,t){return _api.apaas.fileResource.postUpload({...t?{modelKey:t}:{}},e,{headers:{"Content-Type":"multipart/form-data;charset=UTF-8"}})}async function ry(e){return _api.apaas.file.postUploadImage({bucket:"IMAGE"},e,{headers:{"Content-Type":"multipart/form-data;charset=UTF-8"}})}function Tf(e){const t=e.split(","),o=t[0].match(/:(.*?);/)[1],u=window.atob(t[1]);let n=u.length;const i=new Uint8Array(n);for(;n>0;)n-=1,i[n]=u.charCodeAt(n);return new Blob([i],{type:o})}function If(e,t){return new Promise((r,o)=>{let u=document.createElement("CANVAS");const n=u.getContext("2d"),i=new Image;i.crossOrigin="",i.onload=function(){if(!u||!n)return o();u.height=i.height,u.width=i.width,n.drawImage(i,0,0);const s=u.toDataURL(t||"image/png");u=null,r(s)},i.src=e})}function ny(e,t,r,o){If(e).then(u=>{Rf(u,t,r,o)})}function Rf(e,t,r,o){const u=Tf(e);Of(u,{filename:t,mime:r,bom:o})}function iy({multiple:e=!1,accept:t="*"}={}){const r=document.createElement("input");return r.type="file",r.multiple=!!e,r.accept=t,r.click(),new Promise((o,u)=>{r.onchange=async()=>{const n=r.files||[];o(Object.values(n))},r.onerror=async()=>{u()}})}function Of(e,{filename:t="file",timestamp:r=!1,mime:o,bom:u}){if(r){const l=t.split(".").pop(),c=t.replace(/\.[^/.]+$/,""),f=xd(new Date).format("YYYYMMDDHHmmss");t=`${c}${f}.${l}`}const n=typeof u<"u"?[u,e]:[e],i=new Blob(n,{type:o||"application/octet-stream"}),s=window.URL.createObjectURL(i),a=document.createElement("a");a.style.display="none",a.href=s,a.setAttribute("download",t),typeof a.download>"u"&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s)}function oy({url:e,target:t="_blank",fileName:r}){const o=window.navigator.userAgent.toLowerCase().indexOf("chrome")>-1,u=window.navigator.userAgent.toLowerCase().indexOf("safari")>-1;if(/(iP)/g.test(window.navigator.userAgent))return console.error("Your browser does not support download!"),!1;if(o||u){const n=document.createElement("a");if(n.href=e,n.target=t,n.download!==void 0&&(n.download=r||e.substring(e.lastIndexOf("/")+1,e.length)),document.createEvent){const i=document.createEvent("MouseEvents");return i.initEvent("click",!0,!0),n.dispatchEvent(i),!0}}return e.indexOf("?")===-1&&(e+="?download"),wf(e,{target:t}),!0}function sy(e){const t=qe.intersection(e,cc);return t.length>0&&t.length===e.length}class ay{handlers=[];use(t){this.handlers.push(t)}getHandlers(){return this.handlers}}class ly{interceptors=new ay;constructor(){this.interceptors.use(this.checkRole)}baseCheck(t){return console.log(t),!0}checkRole(){return!0}has(t){if(!t)return!0;const r=this.interceptors.getHandlers();for(const o of r)if(o(t)===!1)return!1;return this.baseCheck(t)}}const uy=new ly,cy=Zt.defineStore("global-store",{state(){return new gp},getters:{getProjectName(){return this.projectName},geLang(){return this.lang},getAppInfo(){return this.appInfo},getEmptyDisplay(){return ss[this.globalSetting.emptyDisplay]}},actions:{async init(){const e=location.pathname.split("/")[2];if(e){const t=rf(e);t&&(this.context=t)}},async loadAppInfo(){const e=await _api.apaas.designerCommon.getGetApp();this.appInfo=e},async loadEmptySetting(){const{value:e}=await _gct.api.apaas.basicConfig.getDetail({configEnum:He.GLOBAL});e&&Object.assign(this.globalSetting,JSON.parse(e))},setProjectName(e){this.projectName=e},setLang(e){this.lang=e}}});class Nf{pinia=Zt.createPinia();store;constructor(){Zt.setActivePinia(this.pinia),this.store=cy()}}var Nr=(e=>(e.DEV="dev",e.TEST="test",e.PROD="prod",e))(Nr||{});const Lf=/^http:\/\/\d{1,3}(\.\d{1,3}){3}:(\d{1,5})$/,ri=/^https?:\/\/([a-z0-9]+)-test\./,Mf=/\/web-render|\/web\/|web-single\/|dev-single\/|test-single\//,Pf=/\/web\/|\/web-single\//,Cf=/\/web-render\//,xf=/\/dev-single\//,Df=/\/test-single\//;class kf{_testEnv=!1;_testTenantData={};_platformOrigin;_isHostMode=!1;constructor(){this._platformOrigin=location.origin||"",this._isHostMode=ri.test(this._platformOrigin)}get isAppRun(){return Mf.test(location.pathname)}get isAppProd(){return Pf.test(location.pathname)}get isAppPreview(){return Cf.test(location.pathname)}get isDevSingleEnv(){return xf.test(location.pathname)}get isTestEnv(){return Df.test(location.pathname)||this._testEnv}get platformOrigin(){return this._platformOrigin}get isHostMode(){return this._isHostMode}get testTenantData(){return this._testTenantData}async checkIsTestEnv(){let t=null;if(this._isHostMode){if(t=this._platformOrigin.match(ri),this._testEnv=!!(t&&t[1]),this._testEnv){const r=await _api.platform.tenant.getInfoByPortOrDomain({domain:t[1]});Object.assign(this._testTenantData,r)}}else{t=this._platformOrigin.match(Lf);const r=t&&t[2];if(r){const o=await _api.platform.tenant.getInfoByPortOrDomain({port:r});o&&(Object.assign(this._testTenantData,o),this._testEnv=o.testEnvPort===r)}}}getEnv(){return this.isTestEnv?Nr.TEST:this.isAppProd?Nr.PROD:Nr.DEV}}const Sr={keepalive:60,connectTimeout:3e4,reconnectPeriod:5e3,clean:!1},St={CONNECT:"connect",RECONNECT:"reconnect",DISCONNECT:"disconnect",ERROR:"error",MESSAGE:"message"};var Je=(e=>(e.CONNECTING="connecting",e.CONNECTED="connected",e.DISCONNECTING="disconnecting",e.DISCONNECTED="disconnected",e.RECONNECTING="reconnecting",e))(Je||{}),vs=Object.defineProperty,fy=Object.getOwnPropertyDescriptor,hy=Object.getOwnPropertyNames,dy=Object.prototype.hasOwnProperty,nt=(e,t)=>()=>(e&&(t=e(e=0)),t),pe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gr=(e,t)=>{for(var r in t)vs(e,r,{get:t[r],enumerable:!0})},py=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of hy(t))!dy.call(e,u)&&u!==r&&vs(e,u,{get:()=>t[u],enumerable:!(o=fy(t,u))||o.enumerable});return e},ke=e=>py(vs({},"__esModule",{value:!0}),e),le=nt(()=>{}),Ue={};gr(Ue,{_debugEnd:()=>ki,_debugProcess:()=>Di,_events:()=>Qi,_eventsCount:()=>Ji,_exiting:()=>Ei,_fatalExceptions:()=>Pi,_getActiveHandles:()=>Hf,_getActiveRequests:()=>Gf,_kill:()=>Ai,_linkedBinding:()=>jf,_maxListeners:()=>zi,_preload_modules:()=>Ki,_rawDebug:()=>yi,_startProfilerIdleNotifier:()=>Ui,_stopProfilerIdleNotifier:()=>Bi,_tickCallback:()=>xi,abort:()=>Gi,addListener:()=>Zi,allowedNodeEnvironmentFlags:()=>Li,arch:()=>ii,argv:()=>ai,argv0:()=>Yi,assert:()=>Vf,binding:()=>hi,browser:()=>mi,chdir:()=>gi,config:()=>wi,cpuUsage:()=>Ar,cwd:()=>pi,debugPort:()=>qi,default:()=>Es,dlopen:()=>Wf,domain:()=>_i,emit:()=>io,emitWarning:()=>fi,env:()=>si,execArgv:()=>li,execPath:()=>$i,exit:()=>Oi,features:()=>Mi,hasUncaughtExceptionCaptureCallback:()=>$f,hrtime:()=>Jr,kill:()=>Ri,listeners:()=>Yf,memoryUsage:()=>Ii,moduleLoadList:()=>vi,nextTick:()=>Bf,off:()=>to,on:()=>At,once:()=>eo,openStdin:()=>Ni,pid:()=>Hi,platform:()=>oi,ppid:()=>Vi,prependListener:()=>oo,prependOnceListener:()=>so,reallyExit:()=>Si,release:()=>bi,removeAllListeners:()=>no,removeListener:()=>ro,resourceUsage:()=>Ti,setSourceMapsEnabled:()=>Xi,setUncaughtExceptionCaptureCallback:()=>Ci,stderr:()=>ji,stdin:()=>Wi,stdout:()=>Fi,title:()=>ni,umask:()=>di,uptime:()=>qf,version:()=>ui,versions:()=>ci});function _s(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function gy(){!Qt||!Xt||(Qt=!1,Xt.length?_t=Xt.concat(_t):Lr=-1,_t.length&&Uf())}function Uf(){if(!Qt){var e=setTimeout(gy,0);Qt=!0;for(var t=_t.length;t;){for(Xt=_t,_t=[];++Lr<t;)Xt&&Xt[Lr].run();Lr=-1,t=_t.length}Xt=null,Qt=!1,clearTimeout(e)}}function Bf(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];_t.push(new Ff(e,t)),_t.length===1&&!Qt&&setTimeout(Uf,0)}function Ff(e,t){this.fun=e,this.array=t}function Xe(){}function jf(e){_s("_linkedBinding")}function Wf(e){_s("dlopen")}function Gf(){return[]}function Hf(){return[]}function Vf(e,t){if(!e)throw new Error(t||"assertion error")}function $f(){return!1}function qf(){return Rt.now()/1e3}function Jr(e){var t=Math.floor((Date.now()-Rt.now())*.001),r=Rt.now()*.001,o=Math.floor(r)+t,u=Math.floor(r%1*1e9);return e&&(o=o-e[0],u=u-e[1],u<0&&(o--,u+=Zr)),[o,u]}function At(){return Es}function Yf(e){return[]}var _t,Qt,Xt,Lr,ni,ii,oi,si,ai,li,ui,ci,fi,hi,di,pi,gi,bi,mi,yi,vi,_i,Ei,wi,Si,Ai,Ar,Ti,Ii,Ri,Oi,Ni,Li,Mi,Pi,Ci,xi,Di,ki,Ui,Bi,Fi,ji,Wi,Gi,Hi,Vi,$i,qi,Yi,Ki,Xi,Rt,jn,Zr,zi,Qi,Ji,Zi,eo,to,ro,no,io,oo,so,Es,by=nt(()=>{le(),ce(),ue(),_t=[],Qt=!1,Lr=-1,Ff.prototype.run=function(){this.fun.apply(null,this.array)},ni="browser",ii="x64",oi="browser",si={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},ai=["/usr/bin/node"],li=[],ui="v16.8.0",ci={},fi=function(e,t){console.warn((t?t+": ":"")+e)},hi=function(e){_s("binding")},di=function(e){return 0},pi=function(){return"/"},gi=function(e){},bi={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},mi=!0,yi=Xe,vi=[],_i={},Ei=!1,wi={},Si=Xe,Ai=Xe,Ar=function(){return{}},Ti=Ar,Ii=Ar,Ri=Xe,Oi=Xe,Ni=Xe,Li={},Mi={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Pi=Xe,Ci=Xe,xi=Xe,Di=Xe,ki=Xe,Ui=Xe,Bi=Xe,Fi=void 0,ji=void 0,Wi=void 0,Gi=Xe,Hi=2,Vi=1,$i="/bin/usr/node",qi=9229,Yi="node",Ki=[],Xi=Xe,Rt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Rt.now===void 0&&(jn=Date.now(),Rt.timing&&Rt.timing.navigationStart&&(jn=Rt.timing.navigationStart),Rt.now=()=>Date.now()-jn),Zr=1e9,Jr.bigint=function(e){var t=Jr(e);return typeof BigInt>"u"?t[0]*Zr+t[1]:BigInt(t[0]*Zr)+BigInt(t[1])},zi=10,Qi={},Ji=0,Zi=At,eo=At,to=At,ro=At,no=At,io=Xe,oo=At,so=At,Es={version:ui,versions:ci,arch:ii,platform:oi,browser:mi,release:bi,_rawDebug:yi,moduleLoadList:vi,binding:hi,_linkedBinding:jf,_events:Qi,_eventsCount:Ji,_maxListeners:zi,on:At,addListener:Zi,once:eo,off:to,removeListener:ro,removeAllListeners:no,emit:io,prependListener:oo,prependOnceListener:so,listeners:Yf,domain:_i,_exiting:Ei,config:wi,dlopen:Wf,uptime:qf,_getActiveRequests:Gf,_getActiveHandles:Hf,reallyExit:Si,_kill:Ai,cpuUsage:Ar,resourceUsage:Ti,memoryUsage:Ii,kill:Ri,exit:Oi,openStdin:Ni,allowedNodeEnvironmentFlags:Li,assert:Vf,features:Mi,_fatalExceptions:Pi,setUncaughtExceptionCaptureCallback:Ci,hasUncaughtExceptionCaptureCallback:$f,emitWarning:fi,nextTick:Bf,_tickCallback:xi,_debugProcess:Di,_debugEnd:ki,_startProfilerIdleNotifier:Ui,_stopProfilerIdleNotifier:Bi,stdout:Fi,stdin:Wi,stderr:ji,abort:Gi,umask:di,chdir:gi,cwd:pi,env:si,title:ni,argv:ai,execArgv:li,pid:Hi,ppid:Vi,execPath:$i,debugPort:qi,hrtime:Jr,argv0:Yi,_preload_modules:Ki,setSourceMapsEnabled:Xi}}),ue=nt(()=>{by()});function my(){if(ao)return fr;ao=!0,fr.byteLength=s,fr.toByteArray=l,fr.fromByteArray=p;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,n=o.length;u<n;++u)e[u]=o[u],t[o.charCodeAt(u)]=u;t[45]=62,t[95]=63;function i(m){var h=m.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=m.indexOf("=");g===-1&&(g=h);var y=g===h?0:4-g%4;return[g,y]}function s(m){var h=i(m),g=h[0],y=h[1];return(g+y)*3/4-y}function a(m,h,g){return(h+g)*3/4-g}function l(m){var h,g=i(m),y=g[0],w=g[1],b=new r(a(m,y,w)),E=0,T=w>0?y-4:y,v;for(v=0;v<T;v+=4)h=t[m.charCodeAt(v)]<<18|t[m.charCodeAt(v+1)]<<12|t[m.charCodeAt(v+2)]<<6|t[m.charCodeAt(v+3)],b[E++]=h>>16&255,b[E++]=h>>8&255,b[E++]=h&255;return w===2&&(h=t[m.charCodeAt(v)]<<2|t[m.charCodeAt(v+1)]>>4,b[E++]=h&255),w===1&&(h=t[m.charCodeAt(v)]<<10|t[m.charCodeAt(v+1)]<<4|t[m.charCodeAt(v+2)]>>2,b[E++]=h>>8&255,b[E++]=h&255),b}function c(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function f(m,h,g){for(var y,w=[],b=h;b<g;b+=3)y=(m[b]<<16&16711680)+(m[b+1]<<8&65280)+(m[b+2]&255),w.push(c(y));return w.join("")}function p(m){for(var h,g=m.length,y=g%3,w=[],b=16383,E=0,T=g-y;E<T;E+=b)w.push(f(m,E,E+b>T?T:E+b));return y===1?(h=m[g-1],w.push(e[h>>2]+e[h<<4&63]+"==")):y===2&&(h=(m[g-2]<<8)+m[g-1],w.push(e[h>>10]+e[h>>4&63]+e[h<<2&63]+"=")),w.join("")}return fr}function yy(){return lo?Tr:(lo=!0,Tr.read=function(e,t,r,o,u){var n,i,s=u*8-o-1,a=(1<<s)-1,l=a>>1,c=-7,f=r?u-1:0,p=r?-1:1,m=e[t+f];for(f+=p,n=m&(1<<-c)-1,m>>=-c,c+=s;c>0;n=n*256+e[t+f],f+=p,c-=8);for(i=n&(1<<-c)-1,n>>=-c,c+=o;c>0;i=i*256+e[t+f],f+=p,c-=8);if(n===0)n=1-l;else{if(n===a)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,o),n=n-l}return(m?-1:1)*i*Math.pow(2,n-o)},Tr.write=function(e,t,r,o,u,n){var i,s,a,l=n*8-u-1,c=(1<<l)-1,f=c>>1,p=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=o?0:n-1,h=o?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-i))<1&&(i--,a*=2),i+f>=1?t+=p/a:t+=p*Math.pow(2,1-f),t*a>=2&&(i++,a/=2),i+f>=c?(s=0,i=c):i+f>=1?(s=(t*a-1)*Math.pow(2,u),i=i+f):(s=t*Math.pow(2,f-1)*Math.pow(2,u),i=0));u>=8;e[r+m]=s&255,m+=h,s/=256,u-=8);for(i=i<<u|s,l+=u;l>0;e[r+m]=i&255,m+=h,i/=256,l-=8);e[r+m-h]|=g*128},Tr)}function vy(){if(uo)return Bt;uo=!0;let e=my(),t=yy(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Bt.Buffer=i,Bt.SlowBuffer=w,Bt.INSPECT_MAX_BYTES=50;let o=2147483647;Bt.kMaxLength=o,i.TYPED_ARRAY_SUPPORT=u(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{let d=new Uint8Array(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,Uint8Array.prototype),Object.setPrototypeOf(d,_),d.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function n(d){if(d>o)throw new RangeError('The value "'+d+'" is invalid for option "size"');let _=new Uint8Array(d);return Object.setPrototypeOf(_,i.prototype),_}function i(d,_,I){if(typeof d=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(d)}return s(d,_,I)}i.poolSize=8192;function s(d,_,I){if(typeof d=="string")return f(d,_);if(ArrayBuffer.isView(d))return m(d);if(d==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d);if(H(d,ArrayBuffer)||d&&H(d.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(H(d,SharedArrayBuffer)||d&&H(d.buffer,SharedArrayBuffer)))return h(d,_,I);if(typeof d=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=d.valueOf&&d.valueOf();if(U!=null&&U!==d)return i.from(U,_,I);let J=g(d);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof d[Symbol.toPrimitive]=="function")return i.from(d[Symbol.toPrimitive]("string"),_,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d)}i.from=function(d,_,I){return s(d,_,I)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function a(d){if(typeof d!="number")throw new TypeError('"size" argument must be of type number');if(d<0)throw new RangeError('The value "'+d+'" is invalid for option "size"')}function l(d,_,I){return a(d),d<=0?n(d):_!==void 0?typeof I=="string"?n(d).fill(_,I):n(d).fill(_):n(d)}i.alloc=function(d,_,I){return l(d,_,I)};function c(d){return a(d),n(d<0?0:y(d)|0)}i.allocUnsafe=function(d){return c(d)},i.allocUnsafeSlow=function(d){return c(d)};function f(d,_){if((typeof _!="string"||_==="")&&(_="utf8"),!i.isEncoding(_))throw new TypeError("Unknown encoding: "+_);let I=b(d,_)|0,U=n(I),J=U.write(d,_);return J!==I&&(U=U.slice(0,J)),U}function p(d){let _=d.length<0?0:y(d.length)|0,I=n(_);for(let U=0;U<_;U+=1)I[U]=d[U]&255;return I}function m(d){if(H(d,Uint8Array)){let _=new Uint8Array(d);return h(_.buffer,_.byteOffset,_.byteLength)}return p(d)}function h(d,_,I){if(_<0||d.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(d.byteLength<_+(I||0))throw new RangeError('"length" is outside of buffer bounds');let U;return _===void 0&&I===void 0?U=new Uint8Array(d):I===void 0?U=new Uint8Array(d,_):U=new Uint8Array(d,_,I),Object.setPrototypeOf(U,i.prototype),U}function g(d){if(i.isBuffer(d)){let _=y(d.length)|0,I=n(_);return I.length===0||d.copy(I,0,0,_),I}if(d.length!==void 0)return typeof d.length!="number"||ge(d.length)?n(0):p(d);if(d.type==="Buffer"&&Array.isArray(d.data))return p(d.data)}function y(d){if(d>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return d|0}function w(d){return+d!=d&&(d=0),i.alloc(+d)}i.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==i.prototype},i.compare=function(d,_){if(H(d,Uint8Array)&&(d=i.from(d,d.offset,d.byteLength)),H(_,Uint8Array)&&(_=i.from(_,_.offset,_.byteLength)),!i.isBuffer(d)||!i.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===_)return 0;let I=d.length,U=_.length;for(let J=0,fe=Math.min(I,U);J<fe;++J)if(d[J]!==_[J]){I=d[J],U=_[J];break}return I<U?-1:U<I?1:0},i.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(d,_){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return i.alloc(0);let I;if(_===void 0)for(_=0,I=0;I<d.length;++I)_+=d[I].length;let U=i.allocUnsafe(_),J=0;for(I=0;I<d.length;++I){let fe=d[I];if(H(fe,Uint8Array))J+fe.length>U.length?(i.isBuffer(fe)||(fe=i.from(fe)),fe.copy(U,J)):Uint8Array.prototype.set.call(U,fe,J);else if(i.isBuffer(fe))fe.copy(U,J);else throw new TypeError('"list" argument must be an Array of Buffers');J+=fe.length}return U};function b(d,_){if(i.isBuffer(d))return d.length;if(ArrayBuffer.isView(d)||H(d,ArrayBuffer))return d.byteLength;if(typeof d!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof d);let I=d.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&I===0)return 0;let J=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return W(d).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return de(d).length;default:if(J)return U?-1:W(d).length;_=(""+_).toLowerCase(),J=!0}}i.byteLength=b;function E(d,_,I){let U=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,_>>>=0,I<=_))return"";for(d||(d="utf8");;)switch(d){case"hex":return q(this,_,I);case"utf8":case"utf-8":return G(this,_,I);case"ascii":return ae(this,_,I);case"latin1":case"binary":return X(this,_,I);case"base64":return O(this,_,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,_,I);default:if(U)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase(),U=!0}}i.prototype._isBuffer=!0;function T(d,_,I){let U=d[_];d[_]=d[I],d[I]=U}i.prototype.swap16=function(){let d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<d;_+=2)T(this,_,_+1);return this},i.prototype.swap32=function(){let d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<d;_+=4)T(this,_,_+3),T(this,_+1,_+2);return this},i.prototype.swap64=function(){let d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<d;_+=8)T(this,_,_+7),T(this,_+1,_+6),T(this,_+2,_+5),T(this,_+3,_+4);return this},i.prototype.toString=function(){let d=this.length;return d===0?"":arguments.length===0?G(this,0,d):E.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(d){if(!i.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:i.compare(this,d)===0},i.prototype.inspect=function(){let d="",_=Bt.INSPECT_MAX_BYTES;return d=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(d+=" ... "),"<Buffer "+d+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(d,_,I,U,J){if(H(d,Uint8Array)&&(d=i.from(d,d.offset,d.byteLength)),!i.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(_===void 0&&(_=0),I===void 0&&(I=d?d.length:0),U===void 0&&(U=0),J===void 0&&(J=this.length),_<0||I>d.length||U<0||J>this.length)throw new RangeError("out of range index");if(U>=J&&_>=I)return 0;if(U>=J)return-1;if(_>=I)return 1;if(_>>>=0,I>>>=0,U>>>=0,J>>>=0,this===d)return 0;let fe=J-U,Se=I-_,$=Math.min(fe,Se),ie=this.slice(U,J),Re=d.slice(_,I);for(let Oe=0;Oe<$;++Oe)if(ie[Oe]!==Re[Oe]){fe=ie[Oe],Se=Re[Oe];break}return fe<Se?-1:Se<fe?1:0};function v(d,_,I,U,J){if(d.length===0)return-1;if(typeof I=="string"?(U=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,ge(I)&&(I=J?0:d.length-1),I<0&&(I=d.length+I),I>=d.length){if(J)return-1;I=d.length-1}else if(I<0)if(J)I=0;else return-1;if(typeof _=="string"&&(_=i.from(_,U)),i.isBuffer(_))return _.length===0?-1:A(d,_,I,U,J);if(typeof _=="number")return _=_&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(d,_,I):Uint8Array.prototype.lastIndexOf.call(d,_,I):A(d,[_],I,U,J);throw new TypeError("val must be string, number or Buffer")}function A(d,_,I,U,J){let fe=1,Se=d.length,$=_.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(d.length<2||_.length<2)return-1;fe=2,Se/=2,$/=2,I/=2}function ie(Oe,Le){return fe===1?Oe[Le]:Oe.readUInt16BE(Le*fe)}let Re;if(J){let Oe=-1;for(Re=I;Re<Se;Re++)if(ie(d,Re)===ie(_,Oe===-1?0:Re-Oe)){if(Oe===-1&&(Oe=Re),Re-Oe+1===$)return Oe*fe}else Oe!==-1&&(Re-=Re-Oe),Oe=-1}else for(I+$>Se&&(I=Se-$),Re=I;Re>=0;Re--){let Oe=!0;for(let Le=0;Le<$;Le++)if(ie(d,Re+Le)!==ie(_,Le)){Oe=!1;break}if(Oe)return Re}return-1}i.prototype.includes=function(d,_,I){return this.indexOf(d,_,I)!==-1},i.prototype.indexOf=function(d,_,I){return v(this,d,_,I,!0)},i.prototype.lastIndexOf=function(d,_,I){return v(this,d,_,I,!1)};function S(d,_,I,U){I=Number(I)||0;let J=d.length-I;U?(U=Number(U),U>J&&(U=J)):U=J;let fe=_.length;U>fe/2&&(U=fe/2);let Se;for(Se=0;Se<U;++Se){let $=parseInt(_.substr(Se*2,2),16);if(ge($))return Se;d[I+Se]=$}return Se}function R(d,_,I,U){return ve(W(_,d.length-I),d,I,U)}function P(d,_,I,U){return ve(ee(_),d,I,U)}function L(d,_,I,U){return ve(de(_),d,I,U)}function B(d,_,I,U){return ve(he(_,d.length-I),d,I,U)}i.prototype.write=function(d,_,I,U){if(_===void 0)U="utf8",I=this.length,_=0;else if(I===void 0&&typeof _=="string")U=_,I=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(I)?(I=I>>>0,U===void 0&&(U="utf8")):(U=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let J=this.length-_;if((I===void 0||I>J)&&(I=J),d.length>0&&(I<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let fe=!1;for(;;)switch(U){case"hex":return S(this,d,_,I);case"utf8":case"utf-8":return R(this,d,_,I);case"ascii":case"latin1":case"binary":return P(this,d,_,I);case"base64":return L(this,d,_,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,d,_,I);default:if(fe)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),fe=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(d,_,I){return _===0&&I===d.length?e.fromByteArray(d):e.fromByteArray(d.slice(_,I))}function G(d,_,I){I=Math.min(d.length,I);let U=[],J=_;for(;J<I;){let fe=d[J],Se=null,$=fe>239?4:fe>223?3:fe>191?2:1;if(J+$<=I){let ie,Re,Oe,Le;switch($){case 1:fe<128&&(Se=fe);break;case 2:ie=d[J+1],(ie&192)===128&&(Le=(fe&31)<<6|ie&63,Le>127&&(Se=Le));break;case 3:ie=d[J+1],Re=d[J+2],(ie&192)===128&&(Re&192)===128&&(Le=(fe&15)<<12|(ie&63)<<6|Re&63,Le>2047&&(Le<55296||Le>57343)&&(Se=Le));break;case 4:ie=d[J+1],Re=d[J+2],Oe=d[J+3],(ie&192)===128&&(Re&192)===128&&(Oe&192)===128&&(Le=(fe&15)<<18|(ie&63)<<12|(Re&63)<<6|Oe&63,Le>65535&&Le<1114112&&(Se=Le))}}Se===null?(Se=65533,$=1):Se>65535&&(Se-=65536,U.push(Se>>>10&1023|55296),Se=56320|Se&1023),U.push(Se),J+=$}return k(U)}let F=4096;function k(d){let _=d.length;if(_<=F)return String.fromCharCode.apply(String,d);let I="",U=0;for(;U<_;)I+=String.fromCharCode.apply(String,d.slice(U,U+=F));return I}function ae(d,_,I){let U="";I=Math.min(d.length,I);for(let J=_;J<I;++J)U+=String.fromCharCode(d[J]&127);return U}function X(d,_,I){let U="";I=Math.min(d.length,I);for(let J=_;J<I;++J)U+=String.fromCharCode(d[J]);return U}function q(d,_,I){let U=d.length;(!_||_<0)&&(_=0),(!I||I<0||I>U)&&(I=U);let J="";for(let fe=_;fe<I;++fe)J+=_e[d[fe]];return J}function re(d,_,I){let U=d.slice(_,I),J="";for(let fe=0;fe<U.length-1;fe+=2)J+=String.fromCharCode(U[fe]+U[fe+1]*256);return J}i.prototype.slice=function(d,_){let I=this.length;d=~~d,_=_===void 0?I:~~_,d<0?(d+=I,d<0&&(d=0)):d>I&&(d=I),_<0?(_+=I,_<0&&(_=0)):_>I&&(_=I),_<d&&(_=d);let U=this.subarray(d,_);return Object.setPrototypeOf(U,i.prototype),U};function j(d,_,I){if(d%1!==0||d<0)throw new RangeError("offset is not uint");if(d+_>I)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(d,_,I){d=d>>>0,_=_>>>0,I||j(d,_,this.length);let U=this[d],J=1,fe=0;for(;++fe<_&&(J*=256);)U+=this[d+fe]*J;return U},i.prototype.readUintBE=i.prototype.readUIntBE=function(d,_,I){d=d>>>0,_=_>>>0,I||j(d,_,this.length);let U=this[d+--_],J=1;for(;_>0&&(J*=256);)U+=this[d+--_]*J;return U},i.prototype.readUint8=i.prototype.readUInt8=function(d,_){return d=d>>>0,_||j(d,1,this.length),this[d]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(d,_){return d=d>>>0,_||j(d,2,this.length),this[d]|this[d+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(d,_){return d=d>>>0,_||j(d,2,this.length),this[d]<<8|this[d+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(d,_){return d=d>>>0,_||j(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(d,_){return d=d>>>0,_||j(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},i.prototype.readBigUInt64LE=se(function(d){d=d>>>0,z(d,"offset");let _=this[d],I=this[d+7];(_===void 0||I===void 0)&&me(d,this.length-8);let U=_+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,J=this[++d]+this[++d]*2**8+this[++d]*2**16+I*2**24;return BigInt(U)+(BigInt(J)<<BigInt(32))}),i.prototype.readBigUInt64BE=se(function(d){d=d>>>0,z(d,"offset");let _=this[d],I=this[d+7];(_===void 0||I===void 0)&&me(d,this.length-8);let U=_*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],J=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I;return(BigInt(U)<<BigInt(32))+BigInt(J)}),i.prototype.readIntLE=function(d,_,I){d=d>>>0,_=_>>>0,I||j(d,_,this.length);let U=this[d],J=1,fe=0;for(;++fe<_&&(J*=256);)U+=this[d+fe]*J;return J*=128,U>=J&&(U-=Math.pow(2,8*_)),U},i.prototype.readIntBE=function(d,_,I){d=d>>>0,_=_>>>0,I||j(d,_,this.length);let U=_,J=1,fe=this[d+--U];for(;U>0&&(J*=256);)fe+=this[d+--U]*J;return J*=128,fe>=J&&(fe-=Math.pow(2,8*_)),fe},i.prototype.readInt8=function(d,_){return d=d>>>0,_||j(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},i.prototype.readInt16LE=function(d,_){d=d>>>0,_||j(d,2,this.length);let I=this[d]|this[d+1]<<8;return I&32768?I|4294901760:I},i.prototype.readInt16BE=function(d,_){d=d>>>0,_||j(d,2,this.length);let I=this[d+1]|this[d]<<8;return I&32768?I|4294901760:I},i.prototype.readInt32LE=function(d,_){return d=d>>>0,_||j(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},i.prototype.readInt32BE=function(d,_){return d=d>>>0,_||j(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},i.prototype.readBigInt64LE=se(function(d){d=d>>>0,z(d,"offset");let _=this[d],I=this[d+7];(_===void 0||I===void 0)&&me(d,this.length-8);let U=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(I<<24);return(BigInt(U)<<BigInt(32))+BigInt(_+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),i.prototype.readBigInt64BE=se(function(d){d=d>>>0,z(d,"offset");let _=this[d],I=this[d+7];(_===void 0||I===void 0)&&me(d,this.length-8);let U=(_<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(U)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I)}),i.prototype.readFloatLE=function(d,_){return d=d>>>0,_||j(d,4,this.length),t.read(this,d,!0,23,4)},i.prototype.readFloatBE=function(d,_){return d=d>>>0,_||j(d,4,this.length),t.read(this,d,!1,23,4)},i.prototype.readDoubleLE=function(d,_){return d=d>>>0,_||j(d,8,this.length),t.read(this,d,!0,52,8)},i.prototype.readDoubleBE=function(d,_){return d=d>>>0,_||j(d,8,this.length),t.read(this,d,!1,52,8)};function Z(d,_,I,U,J,fe){if(!i.isBuffer(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>J||_<fe)throw new RangeError('"value" argument is out of bounds');if(I+U>d.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(d,_,I,U){if(d=+d,_=_>>>0,I=I>>>0,!U){let Se=Math.pow(2,8*I)-1;Z(this,d,_,I,Se,0)}let J=1,fe=0;for(this[_]=d&255;++fe<I&&(J*=256);)this[_+fe]=d/J&255;return _+I},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(d,_,I,U){if(d=+d,_=_>>>0,I=I>>>0,!U){let Se=Math.pow(2,8*I)-1;Z(this,d,_,I,Se,0)}let J=I-1,fe=1;for(this[_+J]=d&255;--J>=0&&(fe*=256);)this[_+J]=d/fe&255;return _+I},i.prototype.writeUint8=i.prototype.writeUInt8=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,1,255,0),this[_]=d&255,_+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,2,65535,0),this[_]=d&255,this[_+1]=d>>>8,_+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,2,65535,0),this[_]=d>>>8,this[_+1]=d&255,_+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,4,4294967295,0),this[_+3]=d>>>24,this[_+2]=d>>>16,this[_+1]=d>>>8,this[_]=d&255,_+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,4,4294967295,0),this[_]=d>>>24,this[_+1]=d>>>16,this[_+2]=d>>>8,this[_+3]=d&255,_+4};function M(d,_,I,U,J){K(_,U,J,d,I,7);let fe=Number(_&BigInt(4294967295));d[I++]=fe,fe=fe>>8,d[I++]=fe,fe=fe>>8,d[I++]=fe,fe=fe>>8,d[I++]=fe;let Se=Number(_>>BigInt(32)&BigInt(4294967295));return d[I++]=Se,Se=Se>>8,d[I++]=Se,Se=Se>>8,d[I++]=Se,Se=Se>>8,d[I++]=Se,I}function Q(d,_,I,U,J){K(_,U,J,d,I,7);let fe=Number(_&BigInt(4294967295));d[I+7]=fe,fe=fe>>8,d[I+6]=fe,fe=fe>>8,d[I+5]=fe,fe=fe>>8,d[I+4]=fe;let Se=Number(_>>BigInt(32)&BigInt(4294967295));return d[I+3]=Se,Se=Se>>8,d[I+2]=Se,Se=Se>>8,d[I+1]=Se,Se=Se>>8,d[I]=Se,I+8}i.prototype.writeBigUInt64LE=se(function(d,_=0){return M(this,d,_,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=se(function(d,_=0){return Q(this,d,_,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(d,_,I,U){if(d=+d,_=_>>>0,!U){let $=Math.pow(2,8*I-1);Z(this,d,_,I,$-1,-$)}let J=0,fe=1,Se=0;for(this[_]=d&255;++J<I&&(fe*=256);)d<0&&Se===0&&this[_+J-1]!==0&&(Se=1),this[_+J]=(d/fe>>0)-Se&255;return _+I},i.prototype.writeIntBE=function(d,_,I,U){if(d=+d,_=_>>>0,!U){let $=Math.pow(2,8*I-1);Z(this,d,_,I,$-1,-$)}let J=I-1,fe=1,Se=0;for(this[_+J]=d&255;--J>=0&&(fe*=256);)d<0&&Se===0&&this[_+J+1]!==0&&(Se=1),this[_+J]=(d/fe>>0)-Se&255;return _+I},i.prototype.writeInt8=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,1,127,-128),d<0&&(d=255+d+1),this[_]=d&255,_+1},i.prototype.writeInt16LE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,2,32767,-32768),this[_]=d&255,this[_+1]=d>>>8,_+2},i.prototype.writeInt16BE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,2,32767,-32768),this[_]=d>>>8,this[_+1]=d&255,_+2},i.prototype.writeInt32LE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,4,2147483647,-2147483648),this[_]=d&255,this[_+1]=d>>>8,this[_+2]=d>>>16,this[_+3]=d>>>24,_+4},i.prototype.writeInt32BE=function(d,_,I){return d=+d,_=_>>>0,I||Z(this,d,_,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[_]=d>>>24,this[_+1]=d>>>16,this[_+2]=d>>>8,this[_+3]=d&255,_+4},i.prototype.writeBigInt64LE=se(function(d,_=0){return M(this,d,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=se(function(d,_=0){return Q(this,d,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(d,_,I,U,J,fe){if(I+U>d.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function te(d,_,I,U,J){return _=+_,I=I>>>0,J||ye(d,_,I,4),t.write(d,_,I,U,23,4),I+4}i.prototype.writeFloatLE=function(d,_,I){return te(this,d,_,!0,I)},i.prototype.writeFloatBE=function(d,_,I){return te(this,d,_,!1,I)};function Ee(d,_,I,U,J){return _=+_,I=I>>>0,J||ye(d,_,I,8),t.write(d,_,I,U,52,8),I+8}i.prototype.writeDoubleLE=function(d,_,I){return Ee(this,d,_,!0,I)},i.prototype.writeDoubleBE=function(d,_,I){return Ee(this,d,_,!1,I)},i.prototype.copy=function(d,_,I,U){if(!i.isBuffer(d))throw new TypeError("argument should be a Buffer");if(I||(I=0),!U&&U!==0&&(U=this.length),_>=d.length&&(_=d.length),_||(_=0),U>0&&U<I&&(U=I),U===I||d.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),d.length-_<U-I&&(U=d.length-_+I);let J=U-I;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(_,I,U):Uint8Array.prototype.set.call(d,this.subarray(I,U),_),J},i.prototype.fill=function(d,_,I,U){if(typeof d=="string"){if(typeof _=="string"?(U=_,_=0,I=this.length):typeof I=="string"&&(U=I,I=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!i.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(d.length===1){let fe=d.charCodeAt(0);(U==="utf8"&&fe<128||U==="latin1")&&(d=fe)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(_<0||this.length<_||this.length<I)throw new RangeError("Out of range index");if(I<=_)return this;_=_>>>0,I=I===void 0?this.length:I>>>0,d||(d=0);let J;if(typeof d=="number")for(J=_;J<I;++J)this[J]=d;else{let fe=i.isBuffer(d)?d:i.from(d,U),Se=fe.length;if(Se===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(J=0;J<I-_;++J)this[J+_]=fe[J%Se]}return this};let Y={};function D(d,_,I){Y[d]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${d}]`,this.stack,delete this.name}get code(){return d}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${d}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(d){return d?`${d} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(d,_){return`The "${d}" argument must be of type number. Received type ${typeof _}`},TypeError),D("ERR_OUT_OF_RANGE",function(d,_,I){let U=`The value of "${d}" is out of range.`,J=I;return Number.isInteger(I)&&Math.abs(I)>2**32?J=ne(String(I)):typeof I=="bigint"&&(J=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(J=ne(J)),J+="n"),U+=` It must be ${_}. Received ${J}`,U},RangeError);function ne(d){let _="",I=d.length,U=d[0]==="-"?1:0;for(;I>=U+4;I-=3)_=`_${d.slice(I-3,I)}${_}`;return`${d.slice(0,I)}${_}`}function V(d,_,I){z(_,"offset"),(d[_]===void 0||d[_+I]===void 0)&&me(_,d.length-(I+1))}function K(d,_,I,U,J,fe){if(d>I||d<_){let Se=typeof _=="bigint"?"n":"",$;throw _===0||_===BigInt(0)?$=`>= 0${Se} and < 2${Se} ** ${(fe+1)*8}${Se}`:$=`>= -(2${Se} ** ${(fe+1)*8-1}${Se}) and < 2 ** ${(fe+1)*8-1}${Se}`,new Y.ERR_OUT_OF_RANGE("value",$,d)}V(U,J,fe)}function z(d,_){if(typeof d!="number")throw new Y.ERR_INVALID_ARG_TYPE(_,"number",d)}function me(d,_,I){throw Math.floor(d)!==d?(z(d,I),new Y.ERR_OUT_OF_RANGE("offset","an integer",d)):_<0?new Y.ERR_BUFFER_OUT_OF_BOUNDS:new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${_}`,d)}let oe=/[^+/0-9A-Za-z-_]/g;function C(d){if(d=d.split("=")[0],d=d.trim().replace(oe,""),d.length<2)return"";for(;d.length%4!==0;)d=d+"=";return d}function W(d,_){_=_||1/0;let I,U=d.length,J=null,fe=[];for(let Se=0;Se<U;++Se){if(I=d.charCodeAt(Se),I>55295&&I<57344){if(!J){if(I>56319){(_-=3)>-1&&fe.push(239,191,189);continue}else if(Se+1===U){(_-=3)>-1&&fe.push(239,191,189);continue}J=I;continue}if(I<56320){(_-=3)>-1&&fe.push(239,191,189),J=I;continue}I=(J-55296<<10|I-56320)+65536}else J&&(_-=3)>-1&&fe.push(239,191,189);if(J=null,I<128){if((_-=1)<0)break;fe.push(I)}else if(I<2048){if((_-=2)<0)break;fe.push(I>>6|192,I&63|128)}else if(I<65536){if((_-=3)<0)break;fe.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((_-=4)<0)break;fe.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return fe}function ee(d){let _=[];for(let I=0;I<d.length;++I)_.push(d.charCodeAt(I)&255);return _}function he(d,_){let I,U,J,fe=[];for(let Se=0;Se<d.length&&!((_-=2)<0);++Se)I=d.charCodeAt(Se),U=I>>8,J=I%256,fe.push(J),fe.push(U);return fe}function de(d){return e.toByteArray(C(d))}function ve(d,_,I,U){let J;for(J=0;J<U&&!(J+I>=_.length||J>=d.length);++J)_[J+I]=d[J];return J}function H(d,_){return d instanceof _||d!=null&&d.constructor!=null&&d.constructor.name!=null&&d.constructor.name===_.name}function ge(d){return d!==d}let _e=(function(){let d="0123456789abcdef",_=new Array(256);for(let I=0;I<16;++I){let U=I*16;for(let J=0;J<16;++J)_[U+J]=d[I]+d[J]}return _})();function se(d){return typeof BigInt>"u"?Me:d}function Me(){throw new Error("BigInt not supported")}return Bt}var fr,ao,Tr,lo,Bt,uo,_y=nt(()=>{le(),ce(),ue(),fr={},ao=!1,Tr={},lo=!1,Bt={},uo=!1}),Ve={};gr(Ve,{Buffer:()=>Tn,INSPECT_MAX_BYTES:()=>Kf,default:()=>Tt,kMaxLength:()=>Xf});var Tt,Tn,Kf,Xf,$e=nt(()=>{le(),ce(),ue(),_y(),Tt=vy(),Tt.Buffer,Tt.SlowBuffer,Tt.INSPECT_MAX_BYTES,Tt.kMaxLength,Tn=Tt.Buffer,Kf=Tt.INSPECT_MAX_BYTES,Xf=Tt.kMaxLength}),ce=nt(()=>{$e()}),We=pe((e,t)=>{le(),ce(),ue();var r=class extends Error{constructor(o){if(!Array.isArray(o))throw new TypeError(`Expected input to be an Array, got ${typeof o}`);let u="";for(let n=0;n<o.length;n++)u+=` ${o[n].stack}
386
- `;super(u),this.name="AggregateError",this.errors=o}};t.exports={AggregateError:r,ArrayIsArray(o){return Array.isArray(o)},ArrayPrototypeIncludes(o,u){return o.includes(u)},ArrayPrototypeIndexOf(o,u){return o.indexOf(u)},ArrayPrototypeJoin(o,u){return o.join(u)},ArrayPrototypeMap(o,u){return o.map(u)},ArrayPrototypePop(o,u){return o.pop(u)},ArrayPrototypePush(o,u){return o.push(u)},ArrayPrototypeSlice(o,u,n){return o.slice(u,n)},Error,FunctionPrototypeCall(o,u,...n){return o.call(u,...n)},FunctionPrototypeSymbolHasInstance(o,u){return Function.prototype[Symbol.hasInstance].call(o,u)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(o,u){return Object.defineProperties(o,u)},ObjectDefineProperty(o,u,n){return Object.defineProperty(o,u,n)},ObjectGetOwnPropertyDescriptor(o,u){return Object.getOwnPropertyDescriptor(o,u)},ObjectKeys(o){return Object.keys(o)},ObjectSetPrototypeOf(o,u){return Object.setPrototypeOf(o,u)},Promise,PromisePrototypeCatch(o,u){return o.catch(u)},PromisePrototypeThen(o,u,n){return o.then(u,n)},PromiseReject(o){return Promise.reject(o)},PromiseResolve(o){return Promise.resolve(o)},ReflectApply:Reflect.apply,RegExpPrototypeTest(o,u){return o.test(u)},SafeSet:Set,String,StringPrototypeSlice(o,u,n){return o.slice(u,n)},StringPrototypeToLowerCase(o){return o.toLowerCase()},StringPrototypeToUpperCase(o){return o.toUpperCase()},StringPrototypeTrim(o){return o.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(o,u,n){return o.set(u,n)},Boolean,Uint8Array}}),zf=pe((e,t)=>{le(),ce(),ue(),t.exports={format(r,...o){return r.replace(/%([sdifj])/g,function(...[u,n]){let i=o.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}}),tt=pe((e,t)=>{le(),ce(),ue();var{format:r,inspect:o}=zf(),{AggregateError:u}=We(),n=globalThis.AggregateError||u,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",c={};function f(b,E){if(!b)throw new c.ERR_INTERNAL_ASSERTION(E)}function p(b){let E="",T=b.length,v=b[0]==="-"?1:0;for(;T>=v+4;T-=3)E=`_${b.slice(T-3,T)}${E}`;return`${b.slice(0,T)}${E}`}function m(b,E,T){if(typeof E=="function")return f(E.length<=T.length,`Code: ${b}; The provided arguments length (${T.length}) does not match the required ones (${E.length}).`),E(...T);let v=(E.match(/%[dfijoOs]/g)||[]).length;return f(v===T.length,`Code: ${b}; The provided arguments length (${T.length}) does not match the required ones (${v}).`),T.length===0?E:r(E,...T)}function h(b,E,T){T||(T=Error);class v extends T{constructor(...S){super(m(b,E,S))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:T.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=b,v.prototype[i]=!0,c[b]=v}function g(b){let E=l+b.name;return Object.defineProperty(b,"name",{value:E}),b}function y(b,E){if(b&&E&&b!==E){if(Array.isArray(E.errors))return E.errors.push(b),E;let T=new n([E,b],E.message);return T.code=E.code,T}return b||E}var w=class extends Error{constructor(b="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",E);super(b,E),this.code="ABORT_ERR",this.name="AbortError"}};h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",(b,E,T)=>{f(typeof b=="string","'name' must be a string"),Array.isArray(E)||(E=[E]);let v="The ";b.endsWith(" argument")?v+=`${b} `:v+=`"${b}" ${b.includes(".")?"property":"argument"} `,v+="must be ";let A=[],S=[],R=[];for(let L of E)f(typeof L=="string","All expected entries have to be of type string"),s.includes(L)?A.push(L.toLowerCase()):a.test(L)?S.push(L):(f(L!=="object",'The value "object" should be written as "Object"'),R.push(L));if(S.length>0){let L=A.indexOf("object");L!==-1&&(A.splice(A,L,1),S.push("Object"))}if(A.length>0){switch(A.length){case 1:v+=`of type ${A[0]}`;break;case 2:v+=`one of type ${A[0]} or ${A[1]}`;break;default:{let L=A.pop();v+=`one of type ${A.join(", ")}, or ${L}`}}(S.length>0||R.length>0)&&(v+=" or ")}if(S.length>0){switch(S.length){case 1:v+=`an instance of ${S[0]}`;break;case 2:v+=`an instance of ${S[0]} or ${S[1]}`;break;default:{let L=S.pop();v+=`an instance of ${S.join(", ")}, or ${L}`}}R.length>0&&(v+=" or ")}switch(R.length){case 0:break;case 1:R[0].toLowerCase()!==R[0]&&(v+="an "),v+=`${R[0]}`;break;case 2:v+=`one of ${R[0]} or ${R[1]}`;break;default:{let L=R.pop();v+=`one of ${R.join(", ")}, or ${L}`}}if(T==null)v+=`. Received ${T}`;else if(typeof T=="function"&&T.name)v+=`. Received function ${T.name}`;else if(typeof T=="object"){var P;if((P=T.constructor)!==null&&P!==void 0&&P.name)v+=`. Received an instance of ${T.constructor.name}`;else{let L=o(T,{depth:-1});v+=`. Received ${L}`}}else{let L=o(T,{colors:!1});L.length>25&&(L=`${L.slice(0,25)}...`),v+=`. Received type ${typeof T} (${L})`}return v},TypeError),h("ERR_INVALID_ARG_VALUE",(b,E,T="is invalid")=>{let v=o(E);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${T}. Received ${v}`},TypeError),h("ERR_INVALID_RETURN_VALUE",(b,E,T)=>{var v;let A=T!=null&&(v=T.constructor)!==null&&v!==void 0&&v.name?`instance of ${T.constructor.name}`:`type ${typeof T}`;return`Expected ${b} to be returned from the "${E}" function but got ${A}.`},TypeError),h("ERR_MISSING_ARGS",(...b)=>{f(b.length>0,"At least one arg needs to be specified");let E,T=b.length;switch(b=(Array.isArray(b)?b:[b]).map(v=>`"${v}"`).join(" or "),T){case 1:E+=`The ${b[0]} argument`;break;case 2:E+=`The ${b[0]} and ${b[1]} arguments`;break;default:{let v=b.pop();E+=`The ${b.join(", ")}, and ${v} arguments`}break}return`${E} must be specified`},TypeError),h("ERR_OUT_OF_RANGE",(b,E,T)=>{f(E,'Missing "range" argument');let v;if(Number.isInteger(T)&&Math.abs(T)>2**32)v=p(String(T));else if(typeof T=="bigint"){v=String(T);let A=BigInt(2)**BigInt(32);(T>A||T<-A)&&(v=p(v)),v+="n"}else v=o(T);return`The value of "${b}" is out of range. It must be ${E}. Received ${v}`},RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:w,aggregateTwoErrors:g(y),hideStackFrames:g,codes:c}}),Dr=pe((e,t)=>{le(),ce(),ue();var{AbortController:r,AbortSignal:o}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=o,t.exports.default=r}),Gt={};gr(Gt,{EventEmitter:()=>Qf,default:()=>hr,defaultMaxListeners:()=>Jf,init:()=>Zf,listenerCount:()=>eh,on:()=>th,once:()=>rh});function Ey(){if(co)return Ir;co=!0;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(T,v,A){return Function.prototype.apply.call(T,v,A)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:r=function(T){return Object.getOwnPropertyNames(T)};function o(T){console&&console.warn&&console.warn(T)}var u=Number.isNaN||function(T){return T!==T};function n(){n.init.call(this)}Ir=n,Ir.once=w,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var i=10;function s(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(T){if(typeof T!="number"||T<0||u(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");i=T}}),n.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},n.prototype.setMaxListeners=function(T){if(typeof T!="number"||T<0||u(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function a(T){return T._maxListeners===void 0?n.defaultMaxListeners:T._maxListeners}n.prototype.getMaxListeners=function(){return a(this)},n.prototype.emit=function(T){for(var v=[],A=1;A<arguments.length;A++)v.push(arguments[A]);var S=T==="error",R=this._events;if(R!==void 0)S=S&&R.error===void 0;else if(!S)return!1;if(S){var P;if(v.length>0&&(P=v[0]),P instanceof Error)throw P;var L=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw L.context=P,L}var B=R[T];if(B===void 0)return!1;if(typeof B=="function")t(B,this,v);else for(var O=B.length,G=h(B,O),A=0;A<O;++A)t(G[A],this,v);return!0};function l(T,v,A,S){var R,P,L;if(s(A),P=T._events,P===void 0?(P=T._events=Object.create(null),T._eventsCount=0):(P.newListener!==void 0&&(T.emit("newListener",v,A.listener?A.listener:A),P=T._events),L=P[v]),L===void 0)L=P[v]=A,++T._eventsCount;else if(typeof L=="function"?L=P[v]=S?[A,L]:[L,A]:S?L.unshift(A):L.push(A),R=a(T),R>0&&L.length>R&&!L.warned){L.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=T,B.type=v,B.count=L.length,o(B)}return T}n.prototype.addListener=function(T,v){return l(this,T,v,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(T,v){return l(this,T,v,!0)};function c(){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 f(T,v,A){var S={fired:!1,wrapFn:void 0,target:T,type:v,listener:A},R=c.bind(S);return R.listener=A,S.wrapFn=R,R}n.prototype.once=function(T,v){return s(v),this.on(T,f(this,T,v)),this},n.prototype.prependOnceListener=function(T,v){return s(v),this.prependListener(T,f(this,T,v)),this},n.prototype.removeListener=function(T,v){var A,S,R,P,L;if(s(v),S=this._events,S===void 0)return this;if(A=S[T],A===void 0)return this;if(A===v||A.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete S[T],S.removeListener&&this.emit("removeListener",T,A.listener||v));else if(typeof A!="function"){for(R=-1,P=A.length-1;P>=0;P--)if(A[P]===v||A[P].listener===v){L=A[P].listener,R=P;break}if(R<0)return this;R===0?A.shift():g(A,R),A.length===1&&(S[T]=A[0]),S.removeListener!==void 0&&this.emit("removeListener",T,L||v)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(T){var v,A,S;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[T]),this;if(arguments.length===0){var R=Object.keys(A),P;for(S=0;S<R.length;++S)P=R[S],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=A[T],typeof v=="function")this.removeListener(T,v);else if(v!==void 0)for(S=v.length-1;S>=0;S--)this.removeListener(T,v[S]);return this};function p(T,v,A){var S=T._events;if(S===void 0)return[];var R=S[v];return R===void 0?[]:typeof R=="function"?A?[R.listener||R]:[R]:A?y(R):h(R,R.length)}n.prototype.listeners=function(T){return p(this,T,!0)},n.prototype.rawListeners=function(T){return p(this,T,!1)},n.listenerCount=function(T,v){return typeof T.listenerCount=="function"?T.listenerCount(v):m.call(T,v)},n.prototype.listenerCount=m;function m(T){var v=this._events;if(v!==void 0){var A=v[T];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function h(T,v){for(var A=new Array(v),S=0;S<v;++S)A[S]=T[S];return A}function g(T,v){for(;v+1<T.length;v++)T[v]=T[v+1];T.pop()}function y(T){for(var v=new Array(T.length),A=0;A<v.length;++A)v[A]=T[A].listener||T[A];return v}function w(T,v){return new Promise(function(A,S){function R(L){T.removeListener(v,P),S(L)}function P(){typeof T.removeListener=="function"&&T.removeListener("error",R),A([].slice.call(arguments))}E(T,v,P,{once:!0}),v!=="error"&&b(T,R,{once:!0})})}function b(T,v,A){typeof T.on=="function"&&E(T,"error",v,A)}function E(T,v,A,S){if(typeof T.on=="function")S.once?T.once(v,A):T.on(v,A);else if(typeof T.addEventListener=="function")T.addEventListener(v,function R(P){S.once&&T.removeEventListener(v,R),A(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return Ir}var Ir,co,hr,Qf,Jf,Zf,eh,th,rh,rr=nt(()=>{le(),ce(),ue(),Ir={},co=!1,hr=Ey(),hr.once,hr.once=function(e,t){return new Promise((r,o)=>{function u(...i){n!==void 0&&e.removeListener("error",n),r(i)}let n;t!=="error"&&(n=i=>{e.removeListener(name,u),o(i)},e.once("error",n)),e.once(t,u)})},hr.on=function(e,t){let r=[],o=[],u=null,n=!1,i={async next(){let l=r.shift();if(l)return createIterResult(l,!1);if(u){let c=Promise.reject(u);return u=null,c}return n?createIterResult(void 0,!0):new Promise((c,f)=>o.push({resolve:c,reject:f}))},async return(){e.removeListener(t,s),e.removeListener("error",a),n=!0;for(let l of o)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){u=l,e.removeListener(t,s),e.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return e.on(t,s),e.on("error",a),i;function s(...l){let c=o.shift();c?c.resolve(createIterResult(l,!1)):r.push(l)}function a(l){n=!0;let c=o.shift();c?c.reject(l):u=l,i.return()}},{EventEmitter:Qf,defaultMaxListeners:Jf,init:Zf,listenerCount:eh,on:th,once:rh}=hr}),rt=pe((e,t)=>{le(),ce(),ue();var r=($e(),ke(Ve)),{format:o,inspect:u}=zf(),{codes:{ERR_INVALID_ARG_TYPE:n}}=tt(),{kResistStopPropagation:i,AggregateError:s,SymbolDispose:a}=We(),l=globalThis.AbortSignal||Dr().AbortSignal,c=globalThis.AbortController||Dr().AbortController,f=Object.getPrototypeOf(async function(){}).constructor,p=globalThis.Blob||r.Blob,m=typeof p<"u"?function(y){return y instanceof p}:function(y){return!1},h=(y,w)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new n(w,"AbortSignal",y)},g=(y,w)=>{if(typeof y!="function")throw new n(w,"Function",y)};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(y){let w=!1;return function(...b){w||(w=!0,y.apply(this,b))}},createDeferredPromise:function(){let y,w;return{promise:new Promise((b,E)=>{y=b,w=E}),resolve:y,reject:w}},promisify(y){return new Promise((w,b)=>{y((E,...T)=>E?b(E):w(...T))})},debuglog(){return function(){}},format:o,inspect:u,types:{isAsyncFunction(y){return y instanceof f},isArrayBufferView(y){return ArrayBuffer.isView(y)}},isBlob:m,deprecate(y,w){return y},addAbortListener:(rr(),ke(Gt)).addAbortListener||function(y,w){if(y===void 0)throw new n("signal","AbortSignal",y);h(y,"signal"),g(w,"listener");let b;return y.aborted?queueMicrotask(()=>w()):(y.addEventListener("abort",w,{__proto__:null,once:!0,[i]:!0}),b=()=>{y.removeEventListener("abort",w)}),{__proto__:null,[a](){var E;(E=b)===null||E===void 0||E()}}},AbortSignalAny:l.any||function(y){if(y.length===1)return y[0];let w=new c,b=()=>w.abort();return y.forEach(E=>{h(E,"signals"),E.addEventListener("abort",b,{once:!0})}),w.signal.addEventListener("abort",()=>{y.forEach(E=>E.removeEventListener("abort",b))},{once:!0}),w.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Wr=pe((e,t)=>{le(),ce(),ue();var{ArrayIsArray:r,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:u,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:l,NumberParseInt:c,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:p,String:m,StringPrototypeToUpperCase:h,StringPrototypeTrim:g}=We(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:w,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:E,ERR_OUT_OF_RANGE:T,ERR_UNKNOWN_SIGNAL:v}}=tt(),{normalizeEncoding:A}=rt(),{isAsyncFunction:S,isArrayBufferView:R}=rt().types,P={};function L(H){return H===(H|0)}function B(H){return H===H>>>0}var O=/^[0-7]+$/,G="must be a 32-bit unsigned integer or an octal string";function F(H,ge,_e){if(typeof H>"u"&&(H=_e),typeof H=="string"){if(p(O,H)===null)throw new E(ge,H,G);H=c(H,8)}return X(H,ge),H}var k=y((H,ge,_e=l,se=a)=>{if(typeof H!="number")throw new b(ge,"number",H);if(!i(H))throw new T(ge,"an integer",H);if(H<_e||H>se)throw new T(ge,`>= ${_e} && <= ${se}`,H)}),ae=y((H,ge,_e=-2147483648,se=2147483647)=>{if(typeof H!="number")throw new b(ge,"number",H);if(!i(H))throw new T(ge,"an integer",H);if(H<_e||H>se)throw new T(ge,`>= ${_e} && <= ${se}`,H)}),X=y((H,ge,_e=!1)=>{if(typeof H!="number")throw new b(ge,"number",H);if(!i(H))throw new T(ge,"an integer",H);let se=_e?1:0,Me=4294967295;if(H<se||H>Me)throw new T(ge,`>= ${se} && <= ${Me}`,H)});function q(H,ge){if(typeof H!="string")throw new b(ge,"string",H)}function re(H,ge,_e=void 0,se){if(typeof H!="number")throw new b(ge,"number",H);if(_e!=null&&H<_e||se!=null&&H>se||(_e!=null||se!=null)&&s(H))throw new T(ge,`${_e!=null?`>= ${_e}`:""}${_e!=null&&se!=null?" && ":""}${se!=null?`<= ${se}`:""}`,H)}var j=y((H,ge,_e)=>{if(!o(_e,H)){let se="must be one of: "+u(n(_e,Me=>typeof Me=="string"?`'${Me}'`:m(Me)),", ");throw new E(ge,H,se)}});function Z(H,ge){if(typeof H!="boolean")throw new b(ge,"boolean",H)}function M(H,ge,_e){return H==null||!f(H,ge)?_e:H[ge]}var Q=y((H,ge,_e=null)=>{let se=M(_e,"allowArray",!1),Me=M(_e,"allowFunction",!1);if(!M(_e,"nullable",!1)&&H===null||!se&&r(H)||typeof H!="object"&&(!Me||typeof H!="function"))throw new b(ge,"Object",H)}),ye=y((H,ge)=>{if(H!=null&&typeof H!="object"&&typeof H!="function")throw new b(ge,"a dictionary",H)}),te=y((H,ge,_e=0)=>{if(!r(H))throw new b(ge,"Array",H);if(H.length<_e){let se=`must be longer than ${_e}`;throw new E(ge,H,se)}});function Ee(H,ge){te(H,ge);for(let _e=0;_e<H.length;_e++)q(H[_e],`${ge}[${_e}]`)}function Y(H,ge){te(H,ge);for(let _e=0;_e<H.length;_e++)Z(H[_e],`${ge}[${_e}]`)}function D(H,ge){te(H,ge);for(let _e=0;_e<H.length;_e++){let se=H[_e],Me=`${ge}[${_e}]`;if(se==null)throw new b(Me,"AbortSignal",se);me(se,Me)}}function ne(H,ge="signal"){if(q(H,ge),P[H]===void 0)throw P[h(H)]!==void 0?new v(H+" (signals must use all capital letters)"):new v(H)}var V=y((H,ge="buffer")=>{if(!R(H))throw new b(ge,["Buffer","TypedArray","DataView"],H)});function K(H,ge){let _e=A(ge),se=H.length;if(_e==="hex"&&se%2!==0)throw new E("encoding",ge,`is invalid for data of length ${se}`)}function z(H,ge="Port",_e=!0){if(typeof H!="number"&&typeof H!="string"||typeof H=="string"&&g(H).length===0||+H!==+H>>>0||H>65535||H===0&&!_e)throw new w(ge,H,_e);return H|0}var me=y((H,ge)=>{if(H!==void 0&&(H===null||typeof H!="object"||!("aborted"in H)))throw new b(ge,"AbortSignal",H)}),oe=y((H,ge)=>{if(typeof H!="function")throw new b(ge,"Function",H)}),C=y((H,ge)=>{if(typeof H!="function"||S(H))throw new b(ge,"Function",H)}),W=y((H,ge)=>{if(H!==void 0)throw new b(ge,"undefined",H)});function ee(H,ge,_e){if(!o(_e,H))throw new b(ge,`('${u(_e,"|")}')`,H)}var he=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function de(H,ge){if(typeof H>"u"||!p(he,H))throw new E(ge,H,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ve(H){if(typeof H=="string")return de(H,"hints"),H;if(r(H)){let ge=H.length,_e="";if(ge===0)return _e;for(let se=0;se<ge;se++){let Me=H[se];de(Me,"hints"),_e+=Me,se!==ge-1&&(_e+=", ")}return _e}throw new E("hints",H,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:L,isUint32:B,parseFileMode:F,validateArray:te,validateStringArray:Ee,validateBooleanArray:Y,validateAbortSignalArray:D,validateBoolean:Z,validateBuffer:V,validateDictionary:ye,validateEncoding:K,validateFunction:oe,validateInt32:ae,validateInteger:k,validateNumber:re,validateObject:Q,validateOneOf:j,validatePlainFunction:C,validatePort:z,validateSignalName:ne,validateString:q,validateUint32:X,validateUndefined:W,validateUnion:ee,validateAbortSignal:me,validateLinkHeaderValue:ve}}),nr=pe((e,t)=>{le(),ce(),ue();var r=t.exports={},o,u;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?o=setTimeout:o=n}catch{o=n}try{typeof clearTimeout=="function"?u=clearTimeout:u=i}catch{u=i}})();function s(w){if(o===setTimeout)return setTimeout(w,0);if((o===n||!o)&&setTimeout)return o=setTimeout,setTimeout(w,0);try{return o(w,0)}catch{try{return o.call(null,w,0)}catch{return o.call(this,w,0)}}}function a(w){if(u===clearTimeout)return clearTimeout(w);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(w);try{return u(w)}catch{try{return u.call(null,w)}catch{return u.call(this,w)}}}var l=[],c=!1,f,p=-1;function m(){!c||!f||(c=!1,f.length?l=f.concat(l):p=-1,l.length&&h())}function h(){if(!c){var w=s(m);c=!0;for(var b=l.length;b;){for(f=l,l=[];++p<b;)f&&f[p].run();p=-1,b=l.length}f=null,c=!1,a(w)}}r.nextTick=function(w){var b=new Array(arguments.length-1);if(arguments.length>1)for(var E=1;E<arguments.length;E++)b[E-1]=arguments[E];l.push(new g(w,b)),l.length===1&&!c&&s(h)};function g(w,b){this.fun=w,this.array=b}g.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function y(){}r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(w){return[]},r.binding=function(w){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(w){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}),Mt=pe((e,t)=>{le(),ce(),ue();var{SymbolAsyncIterator:r,SymbolIterator:o,SymbolFor:u}=We(),n=u("nodejs.stream.destroyed"),i=u("nodejs.stream.errored"),s=u("nodejs.stream.readable"),a=u("nodejs.stream.writable"),l=u("nodejs.stream.disturbed"),c=u("nodejs.webstream.isClosedPromise"),f=u("nodejs.webstream.controllerErrorFunction");function p(M,Q=!1){var ye;return!!(M&&typeof M.pipe=="function"&&typeof M.on=="function"&&(!Q||typeof M.pause=="function"&&typeof M.resume=="function")&&(!M._writableState||((ye=M._readableState)===null||ye===void 0?void 0:ye.readable)!==!1)&&(!M._writableState||M._readableState))}function m(M){var Q;return!!(M&&typeof M.write=="function"&&typeof M.on=="function"&&(!M._readableState||((Q=M._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function h(M){return!!(M&&typeof M.pipe=="function"&&M._readableState&&typeof M.on=="function"&&typeof M.write=="function")}function g(M){return M&&(M._readableState||M._writableState||typeof M.write=="function"&&typeof M.on=="function"||typeof M.pipe=="function"&&typeof M.on=="function")}function y(M){return!!(M&&!g(M)&&typeof M.pipeThrough=="function"&&typeof M.getReader=="function"&&typeof M.cancel=="function")}function w(M){return!!(M&&!g(M)&&typeof M.getWriter=="function"&&typeof M.abort=="function")}function b(M){return!!(M&&!g(M)&&typeof M.readable=="object"&&typeof M.writable=="object")}function E(M){return y(M)||w(M)||b(M)}function T(M,Q){return M==null?!1:Q===!0?typeof M[r]=="function":Q===!1?typeof M[o]=="function":typeof M[r]=="function"||typeof M[o]=="function"}function v(M){if(!g(M))return null;let Q=M._writableState,ye=M._readableState,te=Q||ye;return!!(M.destroyed||M[n]||te!=null&&te.destroyed)}function A(M){if(!m(M))return null;if(M.writableEnded===!0)return!0;let Q=M._writableState;return Q!=null&&Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function S(M,Q){if(!m(M))return null;if(M.writableFinished===!0)return!0;let ye=M._writableState;return ye!=null&&ye.errored?!1:typeof ye?.finished!="boolean"?null:!!(ye.finished||Q===!1&&ye.ended===!0&&ye.length===0)}function R(M){if(!p(M))return null;if(M.readableEnded===!0)return!0;let Q=M._readableState;return!Q||Q.errored?!1:typeof Q?.ended!="boolean"?null:Q.ended}function P(M,Q){if(!p(M))return null;let ye=M._readableState;return ye!=null&&ye.errored?!1:typeof ye?.endEmitted!="boolean"?null:!!(ye.endEmitted||Q===!1&&ye.ended===!0&&ye.length===0)}function L(M){return M&&M[s]!=null?M[s]:typeof M?.readable!="boolean"?null:v(M)?!1:p(M)&&M.readable&&!P(M)}function B(M){return M&&M[a]!=null?M[a]:typeof M?.writable!="boolean"?null:v(M)?!1:m(M)&&M.writable&&!A(M)}function O(M,Q){return g(M)?v(M)?!0:!(Q?.readable!==!1&&L(M)||Q?.writable!==!1&&B(M)):null}function G(M){var Q,ye;return g(M)?M.writableErrored?M.writableErrored:(Q=(ye=M._writableState)===null||ye===void 0?void 0:ye.errored)!==null&&Q!==void 0?Q:null:null}function F(M){var Q,ye;return g(M)?M.readableErrored?M.readableErrored:(Q=(ye=M._readableState)===null||ye===void 0?void 0:ye.errored)!==null&&Q!==void 0?Q:null:null}function k(M){if(!g(M))return null;if(typeof M.closed=="boolean")return M.closed;let Q=M._writableState,ye=M._readableState;return typeof Q?.closed=="boolean"||typeof ye?.closed=="boolean"?Q?.closed||ye?.closed:typeof M._closed=="boolean"&&ae(M)?M._closed:null}function ae(M){return typeof M._closed=="boolean"&&typeof M._defaultKeepAlive=="boolean"&&typeof M._removedConnection=="boolean"&&typeof M._removedContLen=="boolean"}function X(M){return typeof M._sent100=="boolean"&&ae(M)}function q(M){var Q;return typeof M._consuming=="boolean"&&typeof M._dumped=="boolean"&&((Q=M.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function re(M){if(!g(M))return null;let Q=M._writableState,ye=M._readableState,te=Q||ye;return!te&&X(M)||!!(te&&te.autoDestroy&&te.emitClose&&te.closed===!1)}function j(M){var Q;return!!(M&&((Q=M[l])!==null&&Q!==void 0?Q:M.readableDidRead||M.readableAborted))}function Z(M){var Q,ye,te,Ee,Y,D,ne,V,K,z;return!!(M&&((Q=(ye=(te=(Ee=(Y=(D=M[i])!==null&&D!==void 0?D:M.readableErrored)!==null&&Y!==void 0?Y:M.writableErrored)!==null&&Ee!==void 0?Ee:(ne=M._readableState)===null||ne===void 0?void 0:ne.errorEmitted)!==null&&te!==void 0?te:(V=M._writableState)===null||V===void 0?void 0:V.errorEmitted)!==null&&ye!==void 0?ye:(K=M._readableState)===null||K===void 0?void 0:K.errored)!==null&&Q!==void 0?Q:!((z=M._writableState)===null||z===void 0)&&z.errored))}t.exports={isDestroyed:v,kIsDestroyed:n,isDisturbed:j,kIsDisturbed:l,isErrored:Z,kIsErrored:i,isReadable:L,kIsReadable:s,kIsClosedPromise:c,kControllerErrorFunction:f,kIsWritable:a,isClosed:k,isDuplexNodeStream:h,isFinished:O,isIterable:T,isReadableNodeStream:p,isReadableStream:y,isReadableEnded:R,isReadableFinished:P,isReadableErrored:F,isNodeStream:g,isWebStream:E,isWritable:B,isWritableNodeStream:m,isWritableStream:w,isWritableEnded:A,isWritableFinished:S,isWritableErrored:G,isServerRequest:q,isServerResponse:X,willEmitClose:re,isTransformStream:b}}),Ht=pe((e,t)=>{le(),ce(),ue();var r=nr(),{AbortError:o,codes:u}=tt(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=u,{kEmptyObject:s,once:a}=rt(),{validateAbortSignal:l,validateFunction:c,validateObject:f,validateBoolean:p}=Wr(),{Promise:m,PromisePrototypeThen:h,SymbolDispose:g}=We(),{isClosed:y,isReadable:w,isReadableNodeStream:b,isReadableStream:E,isReadableFinished:T,isReadableErrored:v,isWritable:A,isWritableNodeStream:S,isWritableStream:R,isWritableFinished:P,isWritableErrored:L,isNodeStream:B,willEmitClose:O,kIsClosedPromise:G}=Mt(),F;function k(j){return j.setHeader&&typeof j.abort=="function"}var ae=()=>{};function X(j,Z,M){var Q,ye;if(arguments.length===2?(M=Z,Z=s):Z==null?Z=s:f(Z,"options"),c(M,"callback"),l(Z.signal,"options.signal"),M=a(M),E(j)||R(j))return q(j,Z,M);if(!B(j))throw new n("stream",["ReadableStream","WritableStream","Stream"],j);let te=(Q=Z.readable)!==null&&Q!==void 0?Q:b(j),Ee=(ye=Z.writable)!==null&&ye!==void 0?ye:S(j),Y=j._writableState,D=j._readableState,ne=()=>{j.writable||z()},V=O(j)&&b(j)===te&&S(j)===Ee,K=P(j,!1),z=()=>{K=!0,j.destroyed&&(V=!1),!(V&&(!j.readable||te))&&(!te||me)&&M.call(j)},me=T(j,!1),oe=()=>{me=!0,j.destroyed&&(V=!1),!(V&&(!j.writable||Ee))&&(!Ee||K)&&M.call(j)},C=H=>{M.call(j,H)},W=y(j),ee=()=>{W=!0;let H=L(j)||v(j);if(H&&typeof H!="boolean")return M.call(j,H);if(te&&!me&&b(j,!0)&&!T(j,!1))return M.call(j,new i);if(Ee&&!K&&!P(j,!1))return M.call(j,new i);M.call(j)},he=()=>{W=!0;let H=L(j)||v(j);if(H&&typeof H!="boolean")return M.call(j,H);M.call(j)},de=()=>{j.req.on("finish",z)};k(j)?(j.on("complete",z),V||j.on("abort",ee),j.req?de():j.on("request",de)):Ee&&!Y&&(j.on("end",ne),j.on("close",ne)),!V&&typeof j.aborted=="boolean"&&j.on("aborted",ee),j.on("end",oe),j.on("finish",z),Z.error!==!1&&j.on("error",C),j.on("close",ee),W?r.nextTick(ee):Y!=null&&Y.errorEmitted||D!=null&&D.errorEmitted?V||r.nextTick(he):(!te&&(!V||w(j))&&(K||A(j)===!1)||!Ee&&(!V||A(j))&&(me||w(j)===!1)||D&&j.req&&j.aborted)&&r.nextTick(he);let ve=()=>{M=ae,j.removeListener("aborted",ee),j.removeListener("complete",z),j.removeListener("abort",ee),j.removeListener("request",de),j.req&&j.req.removeListener("finish",z),j.removeListener("end",ne),j.removeListener("close",ne),j.removeListener("finish",z),j.removeListener("end",oe),j.removeListener("error",C),j.removeListener("close",ee)};if(Z.signal&&!W){let H=()=>{let ge=M;ve(),ge.call(j,new o(void 0,{cause:Z.signal.reason}))};if(Z.signal.aborted)r.nextTick(H);else{F=F||rt().addAbortListener;let ge=F(Z.signal,H),_e=M;M=a((...se)=>{ge[g](),_e.apply(j,se)})}}return ve}function q(j,Z,M){let Q=!1,ye=ae;if(Z.signal)if(ye=()=>{Q=!0,M.call(j,new o(void 0,{cause:Z.signal.reason}))},Z.signal.aborted)r.nextTick(ye);else{F=F||rt().addAbortListener;let Ee=F(Z.signal,ye),Y=M;M=a((...D)=>{Ee[g](),Y.apply(j,D)})}let te=(...Ee)=>{Q||r.nextTick(()=>M.apply(j,Ee))};return h(j[G].promise,te,te),ae}function re(j,Z){var M;let Q=!1;return Z===null&&(Z=s),(M=Z)!==null&&M!==void 0&&M.cleanup&&(p(Z.cleanup,"cleanup"),Q=Z.cleanup),new m((ye,te)=>{let Ee=X(j,Z,Y=>{Q&&Ee(),Y?te(Y):ye()})})}t.exports=X,t.exports.finished=re}),br=pe((e,t)=>{le(),ce(),ue();var r=nr(),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:u},AbortError:n}=tt(),{Symbol:i}=We(),{kIsDestroyed:s,isDestroyed:a,isFinished:l,isServerRequest:c}=Mt(),f=i("kDestroy"),p=i("kConstruct");function m(O,G,F){O&&(O.stack,G&&!G.errored&&(G.errored=O),F&&!F.errored&&(F.errored=O))}function h(O,G){let F=this._readableState,k=this._writableState,ae=k||F;return k!=null&&k.destroyed||F!=null&&F.destroyed?(typeof G=="function"&&G(),this):(m(O,k,F),k&&(k.destroyed=!0),F&&(F.destroyed=!0),ae.constructed?g(this,O,G):this.once(f,function(X){g(this,o(X,O),G)}),this)}function g(O,G,F){let k=!1;function ae(X){if(k)return;k=!0;let q=O._readableState,re=O._writableState;m(X,re,q),re&&(re.closed=!0),q&&(q.closed=!0),typeof F=="function"&&F(X),X?r.nextTick(y,O,X):r.nextTick(w,O)}try{O._destroy(G||null,ae)}catch(X){ae(X)}}function y(O,G){b(O,G),w(O)}function w(O){let G=O._readableState,F=O._writableState;F&&(F.closeEmitted=!0),G&&(G.closeEmitted=!0),(F!=null&&F.emitClose||G!=null&&G.emitClose)&&O.emit("close")}function b(O,G){let F=O._readableState,k=O._writableState;k!=null&&k.errorEmitted||F!=null&&F.errorEmitted||(k&&(k.errorEmitted=!0),F&&(F.errorEmitted=!0),O.emit("error",G))}function E(){let O=this._readableState,G=this._writableState;O&&(O.constructed=!0,O.closed=!1,O.closeEmitted=!1,O.destroyed=!1,O.errored=null,O.errorEmitted=!1,O.reading=!1,O.ended=O.readable===!1,O.endEmitted=O.readable===!1),G&&(G.constructed=!0,G.destroyed=!1,G.closed=!1,G.closeEmitted=!1,G.errored=null,G.errorEmitted=!1,G.finalCalled=!1,G.prefinished=!1,G.ended=G.writable===!1,G.ending=G.writable===!1,G.finished=G.writable===!1)}function T(O,G,F){let k=O._readableState,ae=O._writableState;if(ae!=null&&ae.destroyed||k!=null&&k.destroyed)return this;k!=null&&k.autoDestroy||ae!=null&&ae.autoDestroy?O.destroy(G):G&&(G.stack,ae&&!ae.errored&&(ae.errored=G),k&&!k.errored&&(k.errored=G),F?r.nextTick(b,O,G):b(O,G))}function v(O,G){if(typeof O._construct!="function")return;let F=O._readableState,k=O._writableState;F&&(F.constructed=!1),k&&(k.constructed=!1),O.once(p,G),!(O.listenerCount(p)>1)&&r.nextTick(A,O)}function A(O){let G=!1;function F(k){if(G){T(O,k??new u);return}G=!0;let ae=O._readableState,X=O._writableState,q=X||ae;ae&&(ae.constructed=!0),X&&(X.constructed=!0),q.destroyed?O.emit(f,k):k?T(O,k,!0):r.nextTick(S,O)}try{O._construct(k=>{r.nextTick(F,k)})}catch(k){r.nextTick(F,k)}}function S(O){O.emit(p)}function R(O){return O?.setHeader&&typeof O.abort=="function"}function P(O){O.emit("close")}function L(O,G){O.emit("error",G),r.nextTick(P,O)}function B(O,G){!O||a(O)||(!G&&!l(O)&&(G=new n),c(O)?(O.socket=null,O.destroy(G)):R(O)?O.abort():R(O.req)?O.req.abort():typeof O.destroy=="function"?O.destroy(G):typeof O.close=="function"?O.close():G?r.nextTick(L,O,G):r.nextTick(P,O),O.destroyed||(O[s]=!0))}t.exports={construct:v,destroyer:B,destroy:h,undestroy:E,errorOrDestroy:T}}),ws=pe((e,t)=>{le(),ce(),ue();var{ArrayIsArray:r,ObjectSetPrototypeOf:o}=We(),{EventEmitter:u}=(rr(),ke(Gt));function n(s){u.call(this,s)}o(n.prototype,u.prototype),o(n,u),n.prototype.pipe=function(s,a){let l=this;function c(w){s.writable&&s.write(w)===!1&&l.pause&&l.pause()}l.on("data",c);function f(){l.readable&&l.resume&&l.resume()}s.on("drain",f),!s._isStdio&&(!a||a.end!==!1)&&(l.on("end",m),l.on("close",h));let p=!1;function m(){p||(p=!0,s.end())}function h(){p||(p=!0,typeof s.destroy=="function"&&s.destroy())}function g(w){y(),u.listenerCount(this,"error")===0&&this.emit("error",w)}i(l,"error",g),i(s,"error",g);function y(){l.removeListener("data",c),s.removeListener("drain",f),l.removeListener("end",m),l.removeListener("close",h),l.removeListener("error",g),s.removeListener("error",g),l.removeListener("end",y),l.removeListener("close",y),s.removeListener("close",y)}return l.on("end",y),l.on("close",y),s.on("close",y),s.emit("pipe",l),s};function i(s,a,l){if(typeof s.prependListener=="function")return s.prependListener(a,l);!s._events||!s._events[a]?s.on(a,l):r(s._events[a])?s._events[a].unshift(l):s._events[a]=[l,s._events[a]]}t.exports={Stream:n,prependListener:i}}),On=pe((e,t)=>{le(),ce(),ue();var{SymbolDispose:r}=We(),{AbortError:o,codes:u}=tt(),{isNodeStream:n,isWebStream:i,kControllerErrorFunction:s}=Mt(),a=Ht(),{ERR_INVALID_ARG_TYPE:l}=u,c,f=(p,m)=>{if(typeof p!="object"||!("aborted"in p))throw new l(m,"AbortSignal",p)};t.exports.addAbortSignal=function(p,m){if(f(p,"signal"),!n(m)&&!i(m))throw new l("stream",["ReadableStream","WritableStream","Stream"],m);return t.exports.addAbortSignalNoValidate(p,m)},t.exports.addAbortSignalNoValidate=function(p,m){if(typeof p!="object"||!("aborted"in p))return m;let h=n(m)?()=>{m.destroy(new o(void 0,{cause:p.reason}))}:()=>{m[s](new o(void 0,{cause:p.reason}))};if(p.aborted)h();else{c=c||rt().addAbortListener;let g=c(p,h);a(m,g[r])}return m}}),wy=pe((e,t)=>{le(),ce(),ue();var{StringPrototypeSlice:r,SymbolIterator:o,TypedArrayPrototypeSet:u,Uint8Array:n}=We(),{Buffer:i}=($e(),ke(Ve)),{inspect:s}=rt();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){let l={data:a,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(a){let l={data:a,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;let a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let l=this.head,c=""+l.data;for(;(l=l.next)!==null;)c+=a+l.data;return c}concat(a){if(this.length===0)return i.alloc(0);let l=i.allocUnsafe(a>>>0),c=this.head,f=0;for(;c;)u(l,c.data,f),f+=c.data.length,c=c.next;return l}consume(a,l){let c=this.head.data;if(a<c.length){let f=c.slice(0,a);return this.head.data=c.slice(a),f}return a===c.length?this.shift():l?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[o](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let l="",c=this.head,f=0;do{let p=c.data;if(a>p.length)l+=p,a-=p.length;else{a===p.length?(l+=p,++f,c.next?this.head=c.next:this.head=this.tail=null):(l+=r(p,0,a),this.head=c,c.data=r(p,a));break}++f}while((c=c.next)!==null);return this.length-=f,l}_getBuffer(a){let l=i.allocUnsafe(a),c=a,f=this.head,p=0;do{let m=f.data;if(a>m.length)u(l,m,c-a),a-=m.length;else{a===m.length?(u(l,m,c-a),++p,f.next?this.head=f.next:this.head=this.tail=null):(u(l,new n(m.buffer,m.byteOffset,a),c-a),this.head=f,f.data=m.slice(a));break}++p}while((f=f.next)!==null);return this.length-=p,l}[Symbol.for("nodejs.util.inspect.custom")](a,l){return s(this,{...l,depth:0,customInspect:!1})}}}),Nn=pe((e,t)=>{le(),ce(),ue();var{MathFloor:r,NumberIsInteger:o}=We(),{validateInteger:u}=Wr(),{ERR_INVALID_ARG_VALUE:n}=tt().codes,i=16*1024,s=16;function a(p,m,h){return p.highWaterMark!=null?p.highWaterMark:m?p[h]:null}function l(p){return p?s:i}function c(p,m){u(m,"value",0),p?s=m:i=m}function f(p,m,h,g){let y=a(m,g,h);if(y!=null){if(!o(y)||y<0){let w=g?`options.${h}`:"options.highWaterMark";throw new n(w,y)}return r(y)}return l(p.objectMode)}t.exports={getHighWaterMark:f,getDefaultHighWaterMark:l,setDefaultHighWaterMark:c}}),Sy=pe((e,t)=>{le(),ce(),ue();var r=($e(),ke(Ve)),o=r.Buffer;function u(i,s){for(var a in i)s[a]=i[a]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=r:(u(r,e),e.Buffer=n);function n(i,s,a){return o(i,s,a)}n.prototype=Object.create(o.prototype),u(o,n),n.from=function(i,s,a){if(typeof i=="number")throw new TypeError("Argument must not be a number");return o(i,s,a)},n.alloc=function(i,s,a){if(typeof i!="number")throw new TypeError("Argument must be a number");var l=o(i);return s!==void 0?typeof a=="string"?l.fill(s,a):l.fill(s):l.fill(0),l},n.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return o(i)},n.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(i)}}),Ay=pe(e=>{le(),ce(),ue();var t=Sy().Buffer,r=t.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(b){if(!b)return"utf8";for(var E;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(E)return;b=(""+b).toLowerCase(),E=!0}}function u(b){var E=o(b);if(typeof E!="string"&&(t.isEncoding===r||!r(b)))throw new Error("Unknown encoding: "+b);return E||b}e.StringDecoder=n;function n(b){this.encoding=u(b);var E;switch(this.encoding){case"utf16le":this.text=p,this.end=m,E=4;break;case"utf8":this.fillLast=l,E=4;break;case"base64":this.text=h,this.end=g,E=3;break;default:this.write=y,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(E)}n.prototype.write=function(b){if(b.length===0)return"";var E,T;if(this.lastNeed){if(E=this.fillLast(b),E===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<b.length?E?E+this.text(b,T):this.text(b,T):E||""},n.prototype.end=f,n.prototype.text=c,n.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function i(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,E,T){var v=E.length-1;if(v<T)return 0;var A=i(E[v]);return A>=0?(A>0&&(b.lastNeed=A-1),A):--v<T||A===-2?0:(A=i(E[v]),A>=0?(A>0&&(b.lastNeed=A-2),A):--v<T||A===-2?0:(A=i(E[v]),A>=0?(A>0&&(A===2?A=0:b.lastNeed=A-3),A):0))}function a(b,E,T){if((E[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return b.lastNeed=2,"�"}}function l(b){var E=this.lastTotal-this.lastNeed,T=a(this,b);if(T!==void 0)return T;if(this.lastNeed<=b.length)return b.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,E,0,b.length),this.lastNeed-=b.length}function c(b,E){var T=s(this,b,E);if(!this.lastNeed)return b.toString("utf8",E);this.lastTotal=T;var v=b.length-(T-this.lastNeed);return b.copy(this.lastChar,0,v),b.toString("utf8",E,v)}function f(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+"�":E}function p(b,E){if((b.length-E)%2===0){var T=b.toString("utf16le",E);if(T){var v=T.charCodeAt(T.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",E,b.length-1)}function m(b){var E=b&&b.length?this.write(b):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,T)}return E}function h(b,E){var T=(b.length-E)%3;return T===0?b.toString("base64",E):(this.lastNeed=3-T,this.lastTotal=3,T===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",E,b.length-T))}function g(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function y(b){return b.toString(this.encoding)}function w(b){return b&&b.length?this.write(b):""}}),nh=pe((e,t)=>{le(),ce(),ue();var r=nr(),{PromisePrototypeThen:o,SymbolAsyncIterator:u,SymbolIterator:n}=We(),{Buffer:i}=($e(),ke(Ve)),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:a}=tt().codes;function l(c,f,p){let m;if(typeof f=="string"||f instanceof i)return new c({objectMode:!0,...p,read(){this.push(f),this.push(null)}});let h;if(f&&f[u])h=!0,m=f[u]();else if(f&&f[n])h=!1,m=f[n]();else throw new s("iterable",["Iterable"],f);let g=new c({objectMode:!0,highWaterMark:1,...p}),y=!1;g._read=function(){y||(y=!0,b())},g._destroy=function(E,T){o(w(E),()=>r.nextTick(T,E),v=>r.nextTick(T,v||E))};async function w(E){let T=E!=null,v=typeof m.throw=="function";if(T&&v){let{value:A,done:S}=await m.throw(E);if(await A,S)return}if(typeof m.return=="function"){let{value:A}=await m.return();await A}}async function b(){for(;;){try{let{value:E,done:T}=h?await m.next():m.next();if(T)g.push(null);else{let v=E&&typeof E.then=="function"?await E:E;if(v===null)throw y=!1,new a;if(g.push(v))continue;y=!1}}catch(E){g.destroy(E)}break}}return g}t.exports=l}),Ln=pe((e,t)=>{le(),ce(),ue();var r=nr(),{ArrayPrototypeIndexOf:o,NumberIsInteger:u,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:a,ObjectSetPrototypeOf:l,Promise:c,SafeSet:f,SymbolAsyncDispose:p,SymbolAsyncIterator:m,Symbol:h}=We();t.exports=se,se.ReadableState=_e;var{EventEmitter:g}=(rr(),ke(Gt)),{Stream:y,prependListener:w}=ws(),{Buffer:b}=($e(),ke(Ve)),{addAbortSignal:E}=On(),T=Ht(),v=rt().debuglog("stream",N=>{v=N}),A=wy(),S=br(),{getHighWaterMark:R,getDefaultHighWaterMark:P}=Nn(),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:B,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:G,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:k},AbortError:ae}=tt(),{validateObject:X}=Wr(),q=h("kPaused"),{StringDecoder:re}=Ay(),j=nh();l(se.prototype,y.prototype),l(se,y);var Z=()=>{},{errorOrDestroy:M}=S,Q=1,ye=2,te=4,Ee=8,Y=16,D=32,ne=64,V=128,K=256,z=512,me=1024,oe=2048,C=4096,W=8192,ee=16384,he=32768,de=65536,ve=1<<17,H=1<<18;function ge(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(x){x?this.state|=N:this.state&=~N}}}s(_e.prototype,{objectMode:ge(Q),ended:ge(ye),endEmitted:ge(te),reading:ge(Ee),constructed:ge(Y),sync:ge(D),needReadable:ge(ne),emittedReadable:ge(V),readableListening:ge(K),resumeScheduled:ge(z),errorEmitted:ge(me),emitClose:ge(oe),autoDestroy:ge(C),destroyed:ge(W),closed:ge(ee),closeEmitted:ge(he),multiAwaitDrain:ge(de),readingMore:ge(ve),dataEmitted:ge(H)});function _e(N,x,we){typeof we!="boolean"&&(we=x instanceof Nt()),this.state=oe|C|Y|D,N&&N.objectMode&&(this.state|=Q),we&&N&&N.readableObjectMode&&(this.state|=Q),this.highWaterMark=N?R(this,N,"readableHighWaterMark",we):P(!1),this.buffer=new A,this.length=0,this.pipes=[],this.flowing=null,this[q]=null,N&&N.emitClose===!1&&(this.state&=~oe),N&&N.autoDestroy===!1&&(this.state&=~C),this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding&&(this.decoder=new re(N.encoding),this.encoding=N.encoding)}function se(N){if(!(this instanceof se))return new se(N);let x=this instanceof Nt();this._readableState=new _e(N,this,x),N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.construct=="function"&&(this._construct=N.construct),N.signal&&!x&&E(N.signal,this)),y.call(this,N),S.construct(this,()=>{this._readableState.needReadable&&$(this,this._readableState)})}se.prototype.destroy=S.destroy,se.prototype._undestroy=S.undestroy,se.prototype._destroy=function(N,x){x(N)},se.prototype[g.captureRejectionSymbol]=function(N){this.destroy(N)},se.prototype[p]=function(){let N;return this.destroyed||(N=this.readableEnded?null:new ae,this.destroy(N)),new c((x,we)=>T(this,Ae=>Ae&&Ae!==N?we(Ae):x(null)))},se.prototype.push=function(N,x){return Me(this,N,x,!1)},se.prototype.unshift=function(N,x){return Me(this,N,x,!0)};function Me(N,x,we,Ae){v("readableAddChunk",x);let Ie=N._readableState,Ge;if((Ie.state&Q)===0&&(typeof x=="string"?(we=we||Ie.defaultEncoding,Ie.encoding!==we&&(Ae&&Ie.encoding?x=b.from(x,we).toString(Ie.encoding):(x=b.from(x,we),we=""))):x instanceof b?we="":y._isUint8Array(x)?(x=y._uint8ArrayToBuffer(x),we=""):x!=null&&(Ge=new B("chunk",["string","Buffer","Uint8Array"],x))),Ge)M(N,Ge);else if(x===null)Ie.state&=~Ee,J(N,Ie);else if((Ie.state&Q)!==0||x&&x.length>0)if(Ae)if((Ie.state&te)!==0)M(N,new k);else{if(Ie.destroyed||Ie.errored)return!1;d(N,Ie,x,!0)}else if(Ie.ended)M(N,new F);else{if(Ie.destroyed||Ie.errored)return!1;Ie.state&=~Ee,Ie.decoder&&!we?(x=Ie.decoder.write(x),Ie.objectMode||x.length!==0?d(N,Ie,x,!1):$(N,Ie)):d(N,Ie,x,!1)}else Ae||(Ie.state&=~Ee,$(N,Ie));return!Ie.ended&&(Ie.length<Ie.highWaterMark||Ie.length===0)}function d(N,x,we,Ae){x.flowing&&x.length===0&&!x.sync&&N.listenerCount("data")>0?((x.state&de)!==0?x.awaitDrainWriters.clear():x.awaitDrainWriters=null,x.dataEmitted=!0,N.emit("data",we)):(x.length+=x.objectMode?1:we.length,Ae?x.buffer.unshift(we):x.buffer.push(we),(x.state&ne)!==0&&fe(N)),$(N,x)}se.prototype.isPaused=function(){let N=this._readableState;return N[q]===!0||N.flowing===!1},se.prototype.setEncoding=function(N){let x=new re(N);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;let we=this._readableState.buffer,Ae="";for(let Ie of we)Ae+=x.write(Ie);return we.clear(),Ae!==""&&we.push(Ae),this._readableState.length=Ae.length,this};var _=1073741824;function I(N){if(N>_)throw new G("size","<= 1GiB",N);return N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++,N}function U(N,x){return N<=0||x.length===0&&x.ended?0:(x.state&Q)!==0?1:n(N)?x.flowing&&x.length?x.buffer.first().length:x.length:N<=x.length?N:x.ended?x.length:0}se.prototype.read=function(N){v("read",N),N===void 0?N=NaN:u(N)||(N=i(N,10));let x=this._readableState,we=N;if(N>x.highWaterMark&&(x.highWaterMark=I(N)),N!==0&&(x.state&=~V),N===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return v("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?mt(this):fe(this),null;if(N=U(N,x),N===0&&x.ended)return x.length===0&&mt(this),null;let Ae=(x.state&ne)!==0;if(v("need readable",Ae),(x.length===0||x.length-N<x.highWaterMark)&&(Ae=!0,v("length less than watermark",Ae)),x.ended||x.reading||x.destroyed||x.errored||!x.constructed)Ae=!1,v("reading, ended or constructing",Ae);else if(Ae){v("do read"),x.state|=Ee|D,x.length===0&&(x.state|=ne);try{this._read(x.highWaterMark)}catch(Ge){M(this,Ge)}x.state&=~D,x.reading||(N=U(we,x))}let Ie;return N>0?Ie=or(N,x):Ie=null,Ie===null?(x.needReadable=x.length<=x.highWaterMark,N=0):(x.length-=N,x.multiAwaitDrain?x.awaitDrainWriters.clear():x.awaitDrainWriters=null),x.length===0&&(x.ended||(x.needReadable=!0),we!==N&&x.ended&&mt(this)),Ie!==null&&!x.errorEmitted&&!x.closeEmitted&&(x.dataEmitted=!0,this.emit("data",Ie)),Ie};function J(N,x){if(v("onEofChunk"),!x.ended){if(x.decoder){let we=x.decoder.end();we&&we.length&&(x.buffer.push(we),x.length+=x.objectMode?1:we.length)}x.ended=!0,x.sync?fe(N):(x.needReadable=!1,x.emittedReadable=!0,Se(N))}}function fe(N){let x=N._readableState;v("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(v("emitReadable",x.flowing),x.emittedReadable=!0,r.nextTick(Se,N))}function Se(N){let x=N._readableState;v("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&!x.errored&&(x.length||x.ended)&&(N.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,gt(N)}function $(N,x){!x.readingMore&&x.constructed&&(x.readingMore=!0,r.nextTick(ie,N,x))}function ie(N,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){let we=x.length;if(v("maybeReadMore read 0"),N.read(0),we===x.length)break}x.readingMore=!1}se.prototype._read=function(N){throw new O("_read()")},se.prototype.pipe=function(N,x){let we=this,Ae=this._readableState;Ae.pipes.length===1&&(Ae.multiAwaitDrain||(Ae.multiAwaitDrain=!0,Ae.awaitDrainWriters=new f(Ae.awaitDrainWriters?[Ae.awaitDrainWriters]:[]))),Ae.pipes.push(N),v("pipe count=%d opts=%j",Ae.pipes.length,x);let Ie=(!x||x.end!==!1)&&N!==r.stdout&&N!==r.stderr?Ze:$t;Ae.endEmitted?r.nextTick(Ie):we.once("end",Ie),N.on("unpipe",Ge);function Ge(vt,wt){v("onunpipe"),vt===we&&wt&&wt.hasUnpiped===!1&&(wt.hasUnpiped=!0,Er())}function Ze(){v("onend"),N.end()}let lt,_r=!1;function Er(){v("cleanup"),N.removeListener("close",yt),N.removeListener("finish",xt),lt&&N.removeListener("drain",lt),N.removeListener("error",Vt),N.removeListener("unpipe",Ge),we.removeListener("end",Ze),we.removeListener("end",$t),we.removeListener("data",Vr),_r=!0,lt&&Ae.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain)&&lt()}function wr(){_r||(Ae.pipes.length===1&&Ae.pipes[0]===N?(v("false write response, pause",0),Ae.awaitDrainWriters=N,Ae.multiAwaitDrain=!1):Ae.pipes.length>1&&Ae.pipes.includes(N)&&(v("false write response, pause",Ae.awaitDrainWriters.size),Ae.awaitDrainWriters.add(N)),we.pause()),lt||(lt=Re(we,N),N.on("drain",lt))}we.on("data",Vr);function Vr(vt){v("ondata");let wt=N.write(vt);v("dest.write",wt),wt===!1&&wr()}function Vt(vt){if(v("onerror",vt),$t(),N.removeListener("error",Vt),N.listenerCount("error")===0){let wt=N._writableState||N._readableState;wt&&!wt.errorEmitted?M(N,vt):N.emit("error",vt)}}w(N,"error",Vt);function yt(){N.removeListener("finish",xt),$t()}N.once("close",yt);function xt(){v("onfinish"),N.removeListener("close",yt),$t()}N.once("finish",xt);function $t(){v("unpipe"),we.unpipe(N)}return N.emit("pipe",we),N.writableNeedDrain===!0?wr():Ae.flowing||(v("pipe resume"),we.resume()),N};function Re(N,x){return function(){let we=N._readableState;we.awaitDrainWriters===x?(v("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(v("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(x)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&N.listenerCount("data")&&N.resume()}}se.prototype.unpipe=function(N){let x=this._readableState,we={hasUnpiped:!1};if(x.pipes.length===0)return this;if(!N){let Ie=x.pipes;x.pipes=[],this.pause();for(let Ge=0;Ge<Ie.length;Ge++)Ie[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}let Ae=o(x.pipes,N);return Ae===-1?this:(x.pipes.splice(Ae,1),x.pipes.length===0&&this.pause(),N.emit("unpipe",this,we),this)},se.prototype.on=function(N,x){let we=y.prototype.on.call(this,N,x),Ae=this._readableState;return N==="data"?(Ae.readableListening=this.listenerCount("readable")>0,Ae.flowing!==!1&&this.resume()):N==="readable"&&!Ae.endEmitted&&!Ae.readableListening&&(Ae.readableListening=Ae.needReadable=!0,Ae.flowing=!1,Ae.emittedReadable=!1,v("on readable",Ae.length,Ae.reading),Ae.length?fe(this):Ae.reading||r.nextTick(Le,this)),we},se.prototype.addListener=se.prototype.on,se.prototype.removeListener=function(N,x){let we=y.prototype.removeListener.call(this,N,x);return N==="readable"&&r.nextTick(Oe,this),we},se.prototype.off=se.prototype.removeListener,se.prototype.removeAllListeners=function(N){let x=y.prototype.removeAllListeners.apply(this,arguments);return(N==="readable"||N===void 0)&&r.nextTick(Oe,this),x};function Oe(N){let x=N._readableState;x.readableListening=N.listenerCount("readable")>0,x.resumeScheduled&&x[q]===!1?x.flowing=!0:N.listenerCount("data")>0?N.resume():x.readableListening||(x.flowing=null)}function Le(N){v("readable nexttick read 0"),N.read(0)}se.prototype.resume=function(){let N=this._readableState;return N.flowing||(v("resume"),N.flowing=!N.readableListening,Pe(this,N)),N[q]=!1,this};function Pe(N,x){x.resumeScheduled||(x.resumeScheduled=!0,r.nextTick(pt,N,x))}function pt(N,x){v("resume",x.reading),x.reading||N.read(0),x.resumeScheduled=!1,N.emit("resume"),gt(N),x.flowing&&!x.reading&&N.read(0)}se.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[q]=!0,this};function gt(N){let x=N._readableState;for(v("flow",x.flowing);x.flowing&&N.read()!==null;);}se.prototype.wrap=function(N){let x=!1;N.on("data",Ae=>{!this.push(Ae)&&N.pause&&(x=!0,N.pause())}),N.on("end",()=>{this.push(null)}),N.on("error",Ae=>{M(this,Ae)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{x&&N.resume&&(x=!1,N.resume())};let we=a(N);for(let Ae=1;Ae<we.length;Ae++){let Ie=we[Ae];this[Ie]===void 0&&typeof N[Ie]=="function"&&(this[Ie]=N[Ie].bind(N))}return this},se.prototype[m]=function(){return Ke(this)},se.prototype.iterator=function(N){return N!==void 0&&X(N,"options"),Ke(this,N)};function Ke(N,x){typeof N.read!="function"&&(N=se.wrap(N,{objectMode:!0}));let we=bt(N,x);return we.stream=N,we}async function*bt(N,x){let we=Z;function Ae(Ze){this===N?(we(),we=Z):we=Ze}N.on("readable",Ae);let Ie,Ge=T(N,{writable:!1},Ze=>{Ie=Ze?L(Ie,Ze):null,we(),we=Z});try{for(;;){let Ze=N.destroyed?null:N.read();if(Ze!==null)yield Ze;else{if(Ie)throw Ie;if(Ie===null)return;await new c(Ae)}}}catch(Ze){throw Ie=L(Ie,Ze),Ie}finally{(Ie||x?.destroyOnReturn!==!1)&&(Ie===void 0||N._readableState.autoDestroy)?S.destroyer(N,null):(N.off("readable",Ae),Ge())}}s(se.prototype,{readable:{__proto__:null,get(){let N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){this._readableState&&(this._readableState.readable=!!N)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){this._readableState&&(this._readableState.flowing=N)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){this._readableState&&(this._readableState.destroyed=N)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(_e.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[q]!==!1},set(N){this[q]=!!N}}}),se._fromList=or;function or(N,x){if(x.length===0)return null;let we;return x.objectMode?we=x.buffer.shift():!N||N>=x.length?(x.decoder?we=x.buffer.join(""):x.buffer.length===1?we=x.buffer.first():we=x.buffer.concat(x.length),x.buffer.clear()):we=x.buffer.consume(N,x.decoder),we}function mt(N){let x=N._readableState;v("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,r.nextTick(it,x,N))}function it(N,x){if(v("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,x.emit("end"),x.writable&&x.allowHalfOpen===!1)r.nextTick(Hr,x);else if(N.autoDestroy){let we=x._writableState;(!we||we.autoDestroy&&(we.finished||we.writable===!1))&&x.destroy()}}}function Hr(N){N.writable&&!N.writableEnded&&!N.destroyed&&N.end()}se.from=function(N,x){return j(se,N,x)};var sr;function vr(){return sr===void 0&&(sr={}),sr}se.fromWeb=function(N,x){return vr().newStreamReadableFromReadableStream(N,x)},se.toWeb=function(N,x){return vr().newReadableStreamFromStreamReadable(N,x)},se.wrap=function(N,x){var we,Ae;return new se({objectMode:(we=(Ae=N.readableObjectMode)!==null&&Ae!==void 0?Ae:N.objectMode)!==null&&we!==void 0?we:!0,...x,destroy(Ie,Ge){S.destroyer(N,Ie),Ge(Ie)}}).wrap(N)}}),Ss=pe((e,t)=>{le(),ce(),ue();var r=nr(),{ArrayPrototypeSlice:o,Error:u,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:l,Symbol:c,SymbolHasInstance:f}=We();t.exports=X,X.WritableState=k;var{EventEmitter:p}=(rr(),ke(Gt)),m=ws().Stream,{Buffer:h}=($e(),ke(Ve)),g=br(),{addAbortSignal:y}=On(),{getHighWaterMark:w,getDefaultHighWaterMark:b}=Nn(),{ERR_INVALID_ARG_TYPE:E,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:A,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:R,ERR_STREAM_NULL_VALUES:P,ERR_STREAM_WRITE_AFTER_END:L,ERR_UNKNOWN_ENCODING:B}=tt().codes,{errorOrDestroy:O}=g;a(X.prototype,m.prototype),a(X,m);function G(){}var F=c("kOnFinished");function k(C,W,ee){typeof ee!="boolean"&&(ee=W instanceof Nt()),this.objectMode=!!(C&&C.objectMode),ee&&(this.objectMode=this.objectMode||!!(C&&C.writableObjectMode)),this.highWaterMark=C?w(this,C,"writableHighWaterMark",ee):b(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let he=!!(C&&C.decodeStrings===!1);this.decodeStrings=!he,this.defaultEncoding=C&&C.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=M.bind(void 0,W),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ae(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!C||C.emitClose!==!1,this.autoDestroy=!C||C.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function ae(C){C.buffered=[],C.bufferedIndex=0,C.allBuffers=!0,C.allNoop=!0}k.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},i(k.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function X(C){let W=this instanceof Nt();if(!W&&!n(X,this))return new X(C);this._writableState=new k(C,this,W),C&&(typeof C.write=="function"&&(this._write=C.write),typeof C.writev=="function"&&(this._writev=C.writev),typeof C.destroy=="function"&&(this._destroy=C.destroy),typeof C.final=="function"&&(this._final=C.final),typeof C.construct=="function"&&(this._construct=C.construct),C.signal&&y(C.signal,this)),m.call(this,C),g.construct(this,()=>{let ee=this._writableState;ee.writing||Ee(this,ee),V(this,ee)})}i(X,f,{__proto__:null,value:function(C){return n(this,C)?!0:this!==X?!1:C&&C._writableState instanceof k}}),X.prototype.pipe=function(){O(this,new A)};function q(C,W,ee,he){let de=C._writableState;if(typeof ee=="function")he=ee,ee=de.defaultEncoding;else{if(!ee)ee=de.defaultEncoding;else if(ee!=="buffer"&&!h.isEncoding(ee))throw new B(ee);typeof he!="function"&&(he=G)}if(W===null)throw new P;if(!de.objectMode)if(typeof W=="string")de.decodeStrings!==!1&&(W=h.from(W,ee),ee="buffer");else if(W instanceof h)ee="buffer";else if(m._isUint8Array(W))W=m._uint8ArrayToBuffer(W),ee="buffer";else throw new E("chunk",["string","Buffer","Uint8Array"],W);let ve;return de.ending?ve=new L:de.destroyed&&(ve=new S("write")),ve?(r.nextTick(he,ve),O(C,ve,!0),ve):(de.pendingcb++,re(C,de,W,ee,he))}X.prototype.write=function(C,W,ee){return q(this,C,W,ee)===!0},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){let C=this._writableState;C.corked&&(C.corked--,C.writing||Ee(this,C))},X.prototype.setDefaultEncoding=function(C){if(typeof C=="string"&&(C=l(C)),!h.isEncoding(C))throw new B(C);return this._writableState.defaultEncoding=C,this};function re(C,W,ee,he,de){let ve=W.objectMode?1:ee.length;W.length+=ve;let H=W.length<W.highWaterMark;return H||(W.needDrain=!0),W.writing||W.corked||W.errored||!W.constructed?(W.buffered.push({chunk:ee,encoding:he,callback:de}),W.allBuffers&&he!=="buffer"&&(W.allBuffers=!1),W.allNoop&&de!==G&&(W.allNoop=!1)):(W.writelen=ve,W.writecb=de,W.writing=!0,W.sync=!0,C._write(ee,he,W.onwrite),W.sync=!1),H&&!W.errored&&!W.destroyed}function j(C,W,ee,he,de,ve,H){W.writelen=he,W.writecb=H,W.writing=!0,W.sync=!0,W.destroyed?W.onwrite(new S("write")):ee?C._writev(de,W.onwrite):C._write(de,ve,W.onwrite),W.sync=!1}function Z(C,W,ee,he){--W.pendingcb,he(ee),te(W),O(C,ee)}function M(C,W){let ee=C._writableState,he=ee.sync,de=ee.writecb;if(typeof de!="function"){O(C,new v);return}ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0,W?(W.stack,ee.errored||(ee.errored=W),C._readableState&&!C._readableState.errored&&(C._readableState.errored=W),he?r.nextTick(Z,C,ee,W,de):Z(C,ee,W,de)):(ee.buffered.length>ee.bufferedIndex&&Ee(C,ee),he?ee.afterWriteTickInfo!==null&&ee.afterWriteTickInfo.cb===de?ee.afterWriteTickInfo.count++:(ee.afterWriteTickInfo={count:1,cb:de,stream:C,state:ee},r.nextTick(Q,ee.afterWriteTickInfo)):ye(C,ee,1,de))}function Q({stream:C,state:W,count:ee,cb:he}){return W.afterWriteTickInfo=null,ye(C,W,ee,he)}function ye(C,W,ee,he){for(!W.ending&&!C.destroyed&&W.length===0&&W.needDrain&&(W.needDrain=!1,C.emit("drain"));ee-- >0;)W.pendingcb--,he();W.destroyed&&te(W),V(C,W)}function te(C){if(C.writing)return;for(let de=C.bufferedIndex;de<C.buffered.length;++de){var W;let{chunk:ve,callback:H}=C.buffered[de],ge=C.objectMode?1:ve.length;C.length-=ge,H((W=C.errored)!==null&&W!==void 0?W:new S("write"))}let ee=C[F].splice(0);for(let de=0;de<ee.length;de++){var he;ee[de]((he=C.errored)!==null&&he!==void 0?he:new S("end"))}ae(C)}function Ee(C,W){if(W.corked||W.bufferProcessing||W.destroyed||!W.constructed)return;let{buffered:ee,bufferedIndex:he,objectMode:de}=W,ve=ee.length-he;if(!ve)return;let H=he;if(W.bufferProcessing=!0,ve>1&&C._writev){W.pendingcb-=ve-1;let ge=W.allNoop?G:se=>{for(let Me=H;Me<ee.length;++Me)ee[Me].callback(se)},_e=W.allNoop&&H===0?ee:o(ee,H);_e.allBuffers=W.allBuffers,j(C,W,!0,W.length,_e,"",ge),ae(W)}else{do{let{chunk:ge,encoding:_e,callback:se}=ee[H];ee[H++]=null;let Me=de?1:ge.length;j(C,W,!1,Me,ge,_e,se)}while(H<ee.length&&!W.writing);H===ee.length?ae(W):H>256?(ee.splice(0,H),W.bufferedIndex=0):W.bufferedIndex=H}W.bufferProcessing=!1}X.prototype._write=function(C,W,ee){if(this._writev)this._writev([{chunk:C,encoding:W}],ee);else throw new T("_write()")},X.prototype._writev=null,X.prototype.end=function(C,W,ee){let he=this._writableState;typeof C=="function"?(ee=C,C=null,W=null):typeof W=="function"&&(ee=W,W=null);let de;if(C!=null){let ve=q(this,C,W);ve instanceof u&&(de=ve)}return he.corked&&(he.corked=1,this.uncork()),de||(!he.errored&&!he.ending?(he.ending=!0,V(this,he,!0),he.ended=!0):he.finished?de=new R("end"):he.destroyed&&(de=new S("end"))),typeof ee=="function"&&(de||he.finished?r.nextTick(ee,de):he[F].push(ee)),this};function Y(C){return C.ending&&!C.destroyed&&C.constructed&&C.length===0&&!C.errored&&C.buffered.length===0&&!C.finished&&!C.writing&&!C.errorEmitted&&!C.closeEmitted}function D(C,W){let ee=!1;function he(de){if(ee){O(C,de??v());return}if(ee=!0,W.pendingcb--,de){let ve=W[F].splice(0);for(let H=0;H<ve.length;H++)ve[H](de);O(C,de,W.sync)}else Y(W)&&(W.prefinished=!0,C.emit("prefinish"),W.pendingcb++,r.nextTick(K,C,W))}W.sync=!0,W.pendingcb++;try{C._final(he)}catch(de){he(de)}W.sync=!1}function ne(C,W){!W.prefinished&&!W.finalCalled&&(typeof C._final=="function"&&!W.destroyed?(W.finalCalled=!0,D(C,W)):(W.prefinished=!0,C.emit("prefinish")))}function V(C,W,ee){Y(W)&&(ne(C,W),W.pendingcb===0&&(ee?(W.pendingcb++,r.nextTick((he,de)=>{Y(de)?K(he,de):de.pendingcb--},C,W)):Y(W)&&(W.pendingcb++,K(C,W))))}function K(C,W){W.pendingcb--,W.finished=!0;let ee=W[F].splice(0);for(let he=0;he<ee.length;he++)ee[he]();if(C.emit("finish"),W.autoDestroy){let he=C._readableState;(!he||he.autoDestroy&&(he.endEmitted||he.readable===!1))&&C.destroy()}}s(X.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(C){this._writableState&&(this._writableState.destroyed=C)}},writable:{__proto__:null,get(){let C=this._writableState;return!!C&&C.writable!==!1&&!C.destroyed&&!C.errored&&!C.ending&&!C.ended},set(C){this._writableState&&(this._writableState.writable=!!C)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let C=this._writableState;return C?!C.destroyed&&!C.ending&&C.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var z=g.destroy;X.prototype.destroy=function(C,W){let ee=this._writableState;return!ee.destroyed&&(ee.bufferedIndex<ee.buffered.length||ee[F].length)&&r.nextTick(te,ee),z.call(this,C,W),this},X.prototype._undestroy=g.undestroy,X.prototype._destroy=function(C,W){W(C)},X.prototype[p.captureRejectionSymbol]=function(C){this.destroy(C)};var me;function oe(){return me===void 0&&(me={}),me}X.fromWeb=function(C,W){return oe().newStreamWritableFromWritableStream(C,W)},X.toWeb=function(C){return oe().newWritableStreamFromStreamWritable(C)}}),Ty=pe((e,t)=>{le(),ce(),ue();var r=nr(),o=($e(),ke(Ve)),{isReadable:u,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:a,isWritableNodeStream:l,isDuplexNodeStream:c,isReadableStream:f,isWritableStream:p}=Mt(),m=Ht(),{AbortError:h,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=tt(),{destroyer:w}=br(),b=Nt(),E=Ln(),T=Ss(),{createDeferredPromise:v}=rt(),A=nh(),S=globalThis.Blob||o.Blob,R=typeof S<"u"?function(F){return F instanceof S}:function(F){return!1},P=globalThis.AbortController||Dr().AbortController,{FunctionPrototypeCall:L}=We(),B=class extends b{constructor(F){super(F),F?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),F?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function F(k,ae){if(c(k))return k;if(a(k))return G({readable:k});if(l(k))return G({writable:k});if(s(k))return G({writable:!1,readable:!1});if(f(k))return G({readable:E.fromWeb(k)});if(p(k))return G({writable:T.fromWeb(k)});if(typeof k=="function"){let{value:q,write:re,final:j,destroy:Z}=O(k);if(i(q))return A(B,q,{objectMode:!0,write:re,final:j,destroy:Z});let M=q?.then;if(typeof M=="function"){let Q,ye=L(M,q,te=>{if(te!=null)throw new y("nully","body",te)},te=>{w(Q,te)});return Q=new B({objectMode:!0,readable:!1,write:re,final(te){j(async()=>{try{await ye,r.nextTick(te,null)}catch(Ee){r.nextTick(te,Ee)}})},destroy:Z})}throw new y("Iterable, AsyncIterable or AsyncFunction",ae,q)}if(R(k))return F(k.arrayBuffer());if(i(k))return A(B,k,{objectMode:!0,writable:!1});if(f(k?.readable)&&p(k?.writable))return B.fromWeb(k);if(typeof k?.writable=="object"||typeof k?.readable=="object"){let q=k!=null&&k.readable?a(k?.readable)?k?.readable:F(k.readable):void 0,re=k!=null&&k.writable?l(k?.writable)?k?.writable:F(k.writable):void 0;return G({readable:q,writable:re})}let X=k?.then;if(typeof X=="function"){let q;return L(X,k,re=>{re!=null&&q.push(re),q.push(null)},re=>{w(q,re)}),q=new B({objectMode:!0,writable:!1,read(){}})}throw new g(ae,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],k)};function O(F){let{promise:k,resolve:ae}=v(),X=new P,q=X.signal;return{value:F((async function*(){for(;;){let re=k;k=null;let{chunk:j,done:Z,cb:M}=await re;if(r.nextTick(M),Z)return;if(q.aborted)throw new h(void 0,{cause:q.reason});({promise:k,resolve:ae}=v()),yield j}})(),{signal:q}),write(re,j,Z){let M=ae;ae=null,M({chunk:re,done:!1,cb:Z})},final(re){let j=ae;ae=null,j({done:!0,cb:re})},destroy(re,j){X.abort(),j(re)}}}function G(F){let k=F.readable&&typeof F.readable.read!="function"?E.wrap(F.readable):F.readable,ae=F.writable,X=!!u(k),q=!!n(ae),re,j,Z,M,Q;function ye(te){let Ee=M;M=null,Ee?Ee(te):te&&Q.destroy(te)}return Q=new B({readableObjectMode:!!(k!=null&&k.readableObjectMode),writableObjectMode:!!(ae!=null&&ae.writableObjectMode),readable:X,writable:q}),q&&(m(ae,te=>{q=!1,te&&w(k,te),ye(te)}),Q._write=function(te,Ee,Y){ae.write(te,Ee)?Y():re=Y},Q._final=function(te){ae.end(),j=te},ae.on("drain",function(){if(re){let te=re;re=null,te()}}),ae.on("finish",function(){if(j){let te=j;j=null,te()}})),X&&(m(k,te=>{X=!1,te&&w(k,te),ye(te)}),k.on("readable",function(){if(Z){let te=Z;Z=null,te()}}),k.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){let te=k.read();if(te===null){Z=Q._read;return}if(!Q.push(te))return}}),Q._destroy=function(te,Ee){!te&&M!==null&&(te=new h),Z=null,re=null,j=null,M===null?Ee(te):(M=Ee,w(ae,te),w(k,te))},Q}}),Nt=pe((e,t)=>{le(),ce(),ue();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:u,ObjectSetPrototypeOf:n}=We();t.exports=a;var i=Ln(),s=Ss();n(a.prototype,i.prototype),n(a,i);{let p=u(s.prototype);for(let m=0;m<p.length;m++){let h=p[m];a.prototype[h]||(a.prototype[h]=s.prototype[h])}}function a(p){if(!(this instanceof a))return new a(p);i.call(this,p),s.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(a.prototype,{writable:{__proto__:null,...o(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(s.prototype,"writableLength")},writableFinished:{__proto__:null,...o(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});var l;function c(){return l===void 0&&(l={}),l}a.fromWeb=function(p,m){return c().newStreamDuplexFromReadableWritablePair(p,m)},a.toWeb=function(p){return c().newReadableWritablePairFromDuplex(p)};var f;a.from=function(p){return f||(f=Ty()),f(p,"body")}}),ih=pe((e,t)=>{le(),ce(),ue();var{ObjectSetPrototypeOf:r,Symbol:o}=We();t.exports=a;var{ERR_METHOD_NOT_IMPLEMENTED:u}=tt().codes,n=Nt(),{getHighWaterMark:i}=Nn();r(a.prototype,n.prototype),r(a,n);var s=o("kCallback");function a(f){if(!(this instanceof a))return new a(f);let p=f?i(this,f,"readableHighWaterMark",!0):null;p===0&&(f={...f,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:f.writableHighWaterMark||0}),n.call(this,f),this._readableState.sync=!1,this[s]=null,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",c)}function l(f){typeof this._flush=="function"&&!this.destroyed?this._flush((p,m)=>{if(p){f?f(p):this.destroy(p);return}m!=null&&this.push(m),this.push(null),f&&f()}):(this.push(null),f&&f())}function c(){this._final!==l&&l.call(this)}a.prototype._final=l,a.prototype._transform=function(f,p,m){throw new u("_transform()")},a.prototype._write=function(f,p,m){let h=this._readableState,g=this._writableState,y=h.length;this._transform(f,p,(w,b)=>{if(w){m(w);return}b!=null&&this.push(b),g.ended||y===h.length||h.length<h.highWaterMark?m():this[s]=m})},a.prototype._read=function(){if(this[s]){let f=this[s];this[s]=null,f()}}}),oh=pe((e,t)=>{le(),ce(),ue();var{ObjectSetPrototypeOf:r}=We();t.exports=u;var o=ih();r(u.prototype,o.prototype),r(u,o);function u(n){if(!(this instanceof u))return new u(n);o.call(this,n)}u.prototype._transform=function(n,i,s){s(null,n)}}),As=pe((e,t)=>{le(),ce(),ue();var r=nr(),{ArrayIsArray:o,Promise:u,SymbolAsyncIterator:n,SymbolDispose:i}=We(),s=Ht(),{once:a}=rt(),l=br(),c=Nt(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:h,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:w}=tt(),{validateFunction:b,validateAbortSignal:E}=Wr(),{isIterable:T,isReadable:v,isReadableNodeStream:A,isNodeStream:S,isTransformStream:R,isWebStream:P,isReadableStream:L,isReadableFinished:B}=Mt(),O=globalThis.AbortController||Dr().AbortController,G,F,k;function ae(te,Ee,Y){let D=!1;te.on("close",()=>{D=!0});let ne=s(te,{readable:Ee,writable:Y},V=>{D=!V});return{destroy:V=>{D||(D=!0,l.destroyer(te,V||new g("pipe")))},cleanup:ne}}function X(te){return b(te[te.length-1],"streams[stream.length - 1]"),te.pop()}function q(te){if(T(te))return te;if(A(te))return re(te);throw new p("val",["Readable","Iterable","AsyncIterable"],te)}async function*re(te){F||(F=Ln()),yield*F.prototype[n].call(te)}async function j(te,Ee,Y,{end:D}){let ne,V=null,K=oe=>{if(oe&&(ne=oe),V){let C=V;V=null,C()}},z=()=>new u((oe,C)=>{ne?C(ne):V=()=>{ne?C(ne):oe()}});Ee.on("drain",K);let me=s(Ee,{readable:!1},K);try{Ee.writableNeedDrain&&await z();for await(let oe of te)Ee.write(oe)||await z();D&&(Ee.end(),await z()),Y()}catch(oe){Y(ne!==oe?f(ne,oe):oe)}finally{me(),Ee.off("drain",K)}}async function Z(te,Ee,Y,{end:D}){R(Ee)&&(Ee=Ee.writable);let ne=Ee.getWriter();try{for await(let V of te)await ne.ready,ne.write(V).catch(()=>{});await ne.ready,D&&await ne.close(),Y()}catch(V){try{await ne.abort(V),Y(V)}catch(K){Y(K)}}}function M(...te){return Q(te,a(X(te)))}function Q(te,Ee,Y){if(te.length===1&&o(te[0])&&(te=te[0]),te.length<2)throw new h("streams");let D=new O,ne=D.signal,V=Y?.signal,K=[];E(V,"options.signal");function z(){de(new w)}k=k||rt().addAbortListener;let me;V&&(me=k(V,z));let oe,C,W=[],ee=0;function he(_e){de(_e,--ee===0)}function de(_e,se){var Me;if(_e&&(!oe||oe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(oe=_e),!(!oe&&!se)){for(;W.length;)W.shift()(oe);(Me=me)===null||Me===void 0||Me[i](),D.abort(),se&&(oe||K.forEach(d=>d()),r.nextTick(Ee,oe,C))}}let ve;for(let _e=0;_e<te.length;_e++){let se=te[_e],Me=_e<te.length-1,d=_e>0,_=Me||Y?.end!==!1,I=_e===te.length-1;if(S(se)){let U=function(J){J&&J.name!=="AbortError"&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"&&he(J)};if(_){let{destroy:J,cleanup:fe}=ae(se,Me,d);W.push(J),v(se)&&I&&K.push(fe)}se.on("error",U),v(se)&&I&&K.push(()=>{se.removeListener("error",U)})}if(_e===0)if(typeof se=="function"){if(ve=se({signal:ne}),!T(ve))throw new m("Iterable, AsyncIterable or Stream","source",ve)}else T(se)||A(se)||R(se)?ve=se:ve=c.from(se);else if(typeof se=="function"){if(R(ve)){var H;ve=q((H=ve)===null||H===void 0?void 0:H.readable)}else ve=q(ve);if(ve=se(ve,{signal:ne}),Me){if(!T(ve,!0))throw new m("AsyncIterable",`transform[${_e-1}]`,ve)}else{var ge;G||(G=oh());let U=new G({objectMode:!0}),J=(ge=ve)===null||ge===void 0?void 0:ge.then;if(typeof J=="function")ee++,J.call(ve,$=>{C=$,$!=null&&U.write($),_&&U.end(),r.nextTick(he)},$=>{U.destroy($),r.nextTick(he,$)});else if(T(ve,!0))ee++,j(ve,U,he,{end:_});else if(L(ve)||R(ve)){let $=ve.readable||ve;ee++,j($,U,he,{end:_})}else throw new m("AsyncIterable or Promise","destination",ve);ve=U;let{destroy:fe,cleanup:Se}=ae(ve,!1,!0);W.push(fe),I&&K.push(Se)}}else if(S(se)){if(A(ve)){ee+=2;let U=ye(ve,se,he,{end:_});v(se)&&I&&K.push(U)}else if(R(ve)||L(ve)){let U=ve.readable||ve;ee++,j(U,se,he,{end:_})}else if(T(ve))ee++,j(ve,se,he,{end:_});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ve);ve=se}else if(P(se)){if(A(ve))ee++,Z(q(ve),se,he,{end:_});else if(L(ve)||T(ve))ee++,Z(ve,se,he,{end:_});else if(R(ve))ee++,Z(ve.readable,se,he,{end:_});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ve);ve=se}else ve=c.from(se)}return(ne!=null&&ne.aborted||V!=null&&V.aborted)&&r.nextTick(z),ve}function ye(te,Ee,Y,{end:D}){let ne=!1;if(Ee.on("close",()=>{ne||Y(new y)}),te.pipe(Ee,{end:!1}),D){let V=function(){ne=!0,Ee.end()};B(te)?r.nextTick(V):te.once("end",V)}else Y();return s(te,{readable:!0,writable:!1},V=>{let K=te._readableState;V&&V.code==="ERR_STREAM_PREMATURE_CLOSE"&&K&&K.ended&&!K.errored&&!K.errorEmitted?te.once("end",Y).once("error",Y):Y(V)}),s(Ee,{readable:!1,writable:!0},Y)}t.exports={pipelineImpl:Q,pipeline:M}}),sh=pe((e,t)=>{le(),ce(),ue();var{pipeline:r}=As(),o=Nt(),{destroyer:u}=br(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:a,isTransformStream:l,isWritableStream:c,isReadableStream:f}=Mt(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:h}}=tt(),g=Ht();t.exports=function(...y){if(y.length===0)throw new h("streams");if(y.length===1)return o.from(y[0]);let w=[...y];if(typeof y[0]=="function"&&(y[0]=o.from(y[0])),typeof y[y.length-1]=="function"){let O=y.length-1;y[O]=o.from(y[O])}for(let O=0;O<y.length;++O)if(!(!n(y[O])&&!a(y[O]))){if(O<y.length-1&&!(i(y[O])||f(y[O])||l(y[O])))throw new m(`streams[${O}]`,w[O],"must be readable");if(O>0&&!(s(y[O])||c(y[O])||l(y[O])))throw new m(`streams[${O}]`,w[O],"must be writable")}let b,E,T,v,A;function S(O){let G=v;v=null,G?G(O):O?A.destroy(O):!B&&!L&&A.destroy()}let R=y[0],P=r(y,S),L=!!(s(R)||c(R)||l(R)),B=!!(i(P)||f(P)||l(P));if(A=new o({writableObjectMode:!!(R!=null&&R.writableObjectMode),readableObjectMode:!!(P!=null&&P.readableObjectMode),writable:L,readable:B}),L){if(n(R))A._write=function(G,F,k){R.write(G,F)?k():b=k},A._final=function(G){R.end(),E=G},R.on("drain",function(){if(b){let G=b;b=null,G()}});else if(a(R)){let G=(l(R)?R.writable:R).getWriter();A._write=async function(F,k,ae){try{await G.ready,G.write(F).catch(()=>{}),ae()}catch(X){ae(X)}},A._final=async function(F){try{await G.ready,G.close().catch(()=>{}),E=F}catch(k){F(k)}}}let O=l(P)?P.readable:P;g(O,()=>{if(E){let G=E;E=null,G()}})}if(B){if(n(P))P.on("readable",function(){if(T){let O=T;T=null,O()}}),P.on("end",function(){A.push(null)}),A._read=function(){for(;;){let O=P.read();if(O===null){T=A._read;return}if(!A.push(O))return}};else if(a(P)){let O=(l(P)?P.readable:P).getReader();A._read=async function(){for(;;)try{let{value:G,done:F}=await O.read();if(!A.push(G))return;if(F){A.push(null);return}}catch{return}}}}return A._destroy=function(O,G){!O&&v!==null&&(O=new p),T=null,b=null,E=null,v===null?G(O):(v=G,n(P)&&u(P,O))},A}}),Iy=pe((e,t)=>{le(),ce(),ue();var r=globalThis.AbortController||Dr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:u,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=tt(),{validateAbortSignal:a,validateInteger:l,validateObject:c}=Wr(),f=We().Symbol("kWeak"),p=We().Symbol("kResistStopPropagation"),{finished:m}=Ht(),h=sh(),{addAbortSignalNoValidate:g}=On(),{isWritable:y,isNodeStream:w}=Mt(),{deprecate:b}=rt(),{ArrayPrototypePush:E,Boolean:T,MathFloor:v,Number:A,NumberIsNaN:S,Promise:R,PromiseReject:P,PromiseResolve:L,PromisePrototypeThen:B,Symbol:O}=We(),G=O("kEmpty"),F=O("kEof");function k(V,K){if(K!=null&&c(K,"options"),K?.signal!=null&&a(K.signal,"options.signal"),w(V)&&!y(V))throw new o("stream",V,"must be writable");let z=h(this,V);return K!=null&&K.signal&&g(K.signal,z),z}function ae(V,K){if(typeof V!="function")throw new u("fn",["Function","AsyncFunction"],V);K!=null&&c(K,"options"),K?.signal!=null&&a(K.signal,"options.signal");let z=1;K?.concurrency!=null&&(z=v(K.concurrency));let me=z-1;return K?.highWaterMark!=null&&(me=v(K.highWaterMark)),l(z,"options.concurrency",1),l(me,"options.highWaterMark",0),me+=z,(async function*(){let oe=rt().AbortSignalAny([K?.signal].filter(T)),C=this,W=[],ee={signal:oe},he,de,ve=!1,H=0;function ge(){ve=!0,_e()}function _e(){H-=1,se()}function se(){de&&!ve&&H<z&&W.length<me&&(de(),de=null)}async function Me(){try{for await(let d of C){if(ve)return;if(oe.aborted)throw new s;try{if(d=V(d,ee),d===G)continue;d=L(d)}catch(_){d=P(_)}H+=1,B(d,_e,ge),W.push(d),he&&(he(),he=null),!ve&&(W.length>=me||H>=z)&&await new R(_=>{de=_})}W.push(F)}catch(d){let _=P(d);B(_,_e,ge),W.push(_)}finally{ve=!0,he&&(he(),he=null)}}Me();try{for(;;){for(;W.length>0;){let d=await W[0];if(d===F)return;if(oe.aborted)throw new s;d!==G&&(yield d),W.shift(),se()}await new R(d=>{he=d})}}finally{ve=!0,de&&(de(),de=null)}}).call(this)}function X(V=void 0){return V!=null&&c(V,"options"),V?.signal!=null&&a(V.signal,"options.signal"),(async function*(){let K=0;for await(let me of this){var z;if(V!=null&&(z=V.signal)!==null&&z!==void 0&&z.aborted)throw new s({cause:V.signal.reason});yield[K++,me]}}).call(this)}async function q(V,K=void 0){for await(let z of M.call(this,V,K))return!0;return!1}async function re(V,K=void 0){if(typeof V!="function")throw new u("fn",["Function","AsyncFunction"],V);return!await q.call(this,async(...z)=>!await V(...z),K)}async function j(V,K){for await(let z of M.call(this,V,K))return z}async function Z(V,K){if(typeof V!="function")throw new u("fn",["Function","AsyncFunction"],V);async function z(me,oe){return await V(me,oe),G}for await(let me of ae.call(this,z,K));}function M(V,K){if(typeof V!="function")throw new u("fn",["Function","AsyncFunction"],V);async function z(me,oe){return await V(me,oe)?me:G}return ae.call(this,z,K)}var Q=class extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ye(V,K,z){var me;if(typeof V!="function")throw new u("reducer",["Function","AsyncFunction"],V);z!=null&&c(z,"options"),z?.signal!=null&&a(z.signal,"options.signal");let oe=arguments.length>1;if(z!=null&&(me=z.signal)!==null&&me!==void 0&&me.aborted){let de=new s(void 0,{cause:z.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(de)),de}let C=new r,W=C.signal;if(z!=null&&z.signal){let de={once:!0,[f]:this,[p]:!0};z.signal.addEventListener("abort",()=>C.abort(),de)}let ee=!1;try{for await(let de of this){var he;if(ee=!0,z!=null&&(he=z.signal)!==null&&he!==void 0&&he.aborted)throw new s;oe?K=await V(K,de,{signal:W}):(K=de,oe=!0)}if(!ee&&!oe)throw new Q}finally{C.abort()}return K}async function te(V){V!=null&&c(V,"options"),V?.signal!=null&&a(V.signal,"options.signal");let K=[];for await(let me of this){var z;if(V!=null&&(z=V.signal)!==null&&z!==void 0&&z.aborted)throw new s(void 0,{cause:V.signal.reason});E(K,me)}return K}function Ee(V,K){let z=ae.call(this,V,K);return(async function*(){for await(let me of z)yield*me}).call(this)}function Y(V){if(V=A(V),S(V))return 0;if(V<0)throw new i("number",">= 0",V);return V}function D(V,K=void 0){return K!=null&&c(K,"options"),K?.signal!=null&&a(K.signal,"options.signal"),V=Y(V),(async function*(){var z;if(K!=null&&(z=K.signal)!==null&&z!==void 0&&z.aborted)throw new s;for await(let oe of this){var me;if(K!=null&&(me=K.signal)!==null&&me!==void 0&&me.aborted)throw new s;V--<=0&&(yield oe)}}).call(this)}function ne(V,K=void 0){return K!=null&&c(K,"options"),K?.signal!=null&&a(K.signal,"options.signal"),V=Y(V),(async function*(){var z;if(K!=null&&(z=K.signal)!==null&&z!==void 0&&z.aborted)throw new s;for await(let oe of this){var me;if(K!=null&&(me=K.signal)!==null&&me!==void 0&&me.aborted)throw new s;if(V-- >0&&(yield oe),V<=0)return}}).call(this)}t.exports.streamReturningOperators={asIndexedPairs:b(X,"readable.asIndexedPairs will be removed in a future version."),drop:D,filter:M,flatMap:Ee,map:ae,take:ne,compose:k},t.exports.promiseReturningOperators={every:re,forEach:Z,reduce:ye,toArray:te,some:q,find:j}}),ah=pe((e,t)=>{le(),ce(),ue();var{ArrayPrototypePop:r,Promise:o}=We(),{isIterable:u,isNodeStream:n,isWebStream:i}=Mt(),{pipelineImpl:s}=As(),{finished:a}=Ht();lh();function l(...c){return new o((f,p)=>{let m,h,g=c[c.length-1];if(g&&typeof g=="object"&&!n(g)&&!u(g)&&!i(g)){let y=r(c);m=y.signal,h=y.end}s(c,(y,w)=>{y?p(y):f(w)},{signal:m,end:h})})}t.exports={finished:a,pipeline:l}}),lh=pe((e,t)=>{le(),ce(),ue();var{Buffer:r}=($e(),ke(Ve)),{ObjectDefineProperty:o,ObjectKeys:u,ReflectApply:n}=We(),{promisify:{custom:i}}=rt(),{streamReturningOperators:s,promiseReturningOperators:a}=Iy(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=tt(),c=sh(),{setDefaultHighWaterMark:f,getDefaultHighWaterMark:p}=Nn(),{pipeline:m}=As(),{destroyer:h}=br(),g=Ht(),y=ah(),w=Mt(),b=t.exports=ws().Stream;b.isDestroyed=w.isDestroyed,b.isDisturbed=w.isDisturbed,b.isErrored=w.isErrored,b.isReadable=w.isReadable,b.isWritable=w.isWritable,b.Readable=Ln();for(let T of u(s)){let v=function(...S){if(new.target)throw l();return b.Readable.from(n(A,this,S))},A=s[T];o(v,"name",{__proto__:null,value:A.name}),o(v,"length",{__proto__:null,value:A.length}),o(b.Readable.prototype,T,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let T of u(a)){let v=function(...S){if(new.target)throw l();return n(A,this,S)},A=a[T];o(v,"name",{__proto__:null,value:A.name}),o(v,"length",{__proto__:null,value:A.length}),o(b.Readable.prototype,T,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}b.Writable=Ss(),b.Duplex=Nt(),b.Transform=ih(),b.PassThrough=oh(),b.pipeline=m;var{addAbortSignal:E}=On();b.addAbortSignal=E,b.finished=g,b.destroy=h,b.compose=c,b.setDefaultHighWaterMark=f,b.getDefaultHighWaterMark=p,o(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return y}}),o(m,i,{__proto__:null,enumerable:!0,get(){return y.pipeline}}),o(g,i,{__proto__:null,enumerable:!0,get(){return y.finished}}),b.Stream=b,b._isUint8Array=function(T){return T instanceof Uint8Array},b._uint8ArrayToBuffer=function(T){return r.from(T.buffer,T.byteOffset,T.byteLength)}}),ir=pe((e,t)=>{le(),ce(),ue();var r=lh(),o=ah(),u=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=u,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return o}}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),Ry=pe((e,t)=>{le(),ce(),ue(),typeof Object.create=="function"?t.exports=function(r,o){o&&(r.super_=o,r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,o){if(o){r.super_=o;var u=function(){};u.prototype=o.prototype,r.prototype=new u,r.prototype.constructor=r}}}),Oy=pe((e,t)=>{le(),ce(),ue();var{Buffer:r}=($e(),ke(Ve)),o=Symbol.for("BufferList");function u(n){if(!(this instanceof u))return new u(n);u._init.call(this,n)}u._init=function(n){Object.defineProperty(this,o,{value:!0}),this._bufs=[],this.length=0,n&&this.append(n)},u.prototype._new=function(n){return new u(n)},u.prototype._offset=function(n){if(n===0)return[0,0];let i=0;for(let s=0;s<this._bufs.length;s++){let a=i+this._bufs[s].length;if(n<a||s===this._bufs.length-1)return[s,n-i];i=a}},u.prototype._reverseOffset=function(n){let i=n[0],s=n[1];for(let a=0;a<i;a++)s+=this._bufs[a].length;return s},u.prototype.getBuffers=function(){return this._bufs},u.prototype.get=function(n){if(n>this.length||n<0)return;let i=this._offset(n);return this._bufs[i[0]][i[1]]},u.prototype.slice=function(n,i){return typeof n=="number"&&n<0&&(n+=this.length),typeof i=="number"&&i<0&&(i+=this.length),this.copy(null,0,n,i)},u.prototype.copy=function(n,i,s,a){if((typeof s!="number"||s<0)&&(s=0),(typeof a!="number"||a>this.length)&&(a=this.length),s>=this.length||a<=0)return n||r.alloc(0);let l=!!n,c=this._offset(s),f=a-s,p=f,m=l&&i||0,h=c[1];if(s===0&&a===this.length){if(!l)return this._bufs.length===1?this._bufs[0]:r.concat(this._bufs,this.length);for(let g=0;g<this._bufs.length;g++)this._bufs[g].copy(n,m),m+=this._bufs[g].length;return n}if(p<=this._bufs[c[0]].length-h)return l?this._bufs[c[0]].copy(n,i,h,h+p):this._bufs[c[0]].slice(h,h+p);l||(n=r.allocUnsafe(f));for(let g=c[0];g<this._bufs.length;g++){let y=this._bufs[g].length-h;if(p>y)this._bufs[g].copy(n,m,h),m+=y;else{this._bufs[g].copy(n,m,h,h+p),m+=y;break}p-=y,h&&(h=0)}return n.length>m?n.slice(0,m):n},u.prototype.shallowSlice=function(n,i){if(n=n||0,i=typeof i!="number"?this.length:i,n<0&&(n+=this.length),i<0&&(i+=this.length),n===i)return this._new();let s=this._offset(n),a=this._offset(i),l=this._bufs.slice(s[0],a[0]+1);return a[1]===0?l.pop():l[l.length-1]=l[l.length-1].slice(0,a[1]),s[1]!==0&&(l[0]=l[0].slice(s[1])),this._new(l)},u.prototype.toString=function(n,i,s){return this.slice(i,s).toString(n)},u.prototype.consume=function(n){if(n=Math.trunc(n),Number.isNaN(n)||n<=0)return this;for(;this._bufs.length;)if(n>=this._bufs[0].length)n-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(n),this.length-=n;break}return this},u.prototype.duplicate=function(){let n=this._new();for(let i=0;i<this._bufs.length;i++)n.append(this._bufs[i]);return n},u.prototype.append=function(n){return this._attach(n,u.prototype._appendBuffer)},u.prototype.prepend=function(n){return this._attach(n,u.prototype._prependBuffer,!0)},u.prototype._attach=function(n,i,s){if(n==null)return this;if(n.buffer)i.call(this,r.from(n.buffer,n.byteOffset,n.byteLength));else if(Array.isArray(n)){let[a,l]=s?[n.length-1,-1]:[0,1];for(let c=a;c>=0&&c<n.length;c+=l)this._attach(n[c],i,s)}else if(this._isBufferList(n)){let[a,l]=s?[n._bufs.length-1,-1]:[0,1];for(let c=a;c>=0&&c<n._bufs.length;c+=l)this._attach(n._bufs[c],i,s)}else typeof n=="number"&&(n=n.toString()),i.call(this,r.from(n));return this},u.prototype._appendBuffer=function(n){this._bufs.push(n),this.length+=n.length},u.prototype._prependBuffer=function(n){this._bufs.unshift(n),this.length+=n.length},u.prototype.indexOf=function(n,i,s){if(s===void 0&&typeof i=="string"&&(s=i,i=void 0),typeof n=="function"||Array.isArray(n))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof n=="number"?n=r.from([n]):typeof n=="string"?n=r.from(n,s):this._isBufferList(n)?n=n.slice():Array.isArray(n.buffer)?n=r.from(n.buffer,n.byteOffset,n.byteLength):r.isBuffer(n)||(n=r.from(n)),i=Number(i||0),isNaN(i)&&(i=0),i<0&&(i=this.length+i),i<0&&(i=0),n.length===0)return i>this.length?this.length:i;let a=this._offset(i),l=a[0],c=a[1];for(;l<this._bufs.length;l++){let f=this._bufs[l];for(;c<f.length;)if(f.length-c>=n.length){let p=f.indexOf(n,c);if(p!==-1)return this._reverseOffset([l,p]);c=f.length-n.length+1}else{let p=this._reverseOffset([l,c]);if(this._match(p,n))return p;c++}c=0}return-1},u.prototype._match=function(n,i){if(this.length-n<i.length)return!1;for(let s=0;s<i.length;s++)if(this.get(n+s)!==i[s])return!1;return!0},(function(){let n={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let i in n)(function(s){n[s]===null?u.prototype[s]=function(a,l){return this.slice(a,a+l)[s](0,l)}:u.prototype[s]=function(a=0){return this.slice(a,a+n[s])[s](0)}})(i)})(),u.prototype._isBufferList=function(n){return n instanceof u||u.isBufferList(n)},u.isBufferList=function(n){return n!=null&&n[o]},t.exports=u}),Ny=pe((e,t)=>{le(),ce(),ue();var r=ir().Duplex,o=Ry(),u=Oy();function n(i){if(!(this instanceof n))return new n(i);if(typeof i=="function"){this._callback=i;let s=(function(a){this._callback&&(this._callback(a),this._callback=null)}).bind(this);this.on("pipe",function(a){a.on("error",s)}),this.on("unpipe",function(a){a.removeListener("error",s)}),i=null}u._init.call(this,i),r.call(this)}o(n,r),Object.assign(n.prototype,u.prototype),n.prototype._new=function(i){return new n(i)},n.prototype._write=function(i,s,a){this._appendBuffer(i),typeof a=="function"&&a()},n.prototype._read=function(i){if(!this.length)return this.push(null);i=Math.min(i,this.length),this.push(this.slice(0,i)),this.consume(i)},n.prototype.end=function(i){r.prototype.end.call(this,i),this._callback&&(this._callback(null,this.slice()),this._callback=null)},n.prototype._destroy=function(i,s){this._bufs.length=0,this.length=0,s(i)},n.prototype._isBufferList=function(i){return i instanceof n||i instanceof u||n.isBufferList(i)},n.isBufferList=u.isBufferList,t.exports=n,t.exports.BufferListStream=n,t.exports.BufferList=u}),Ly=pe((e,t)=>{le(),ce(),ue();var r=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};t.exports=r}),uh=pe((e,t)=>{le(),ce(),ue();var r=t.exports,{Buffer:o}=($e(),ke(Ve));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let n in r.requiredHeaderFlags){let i=r.requiredHeaderFlags[n];r.requiredHeaderFlagsErrors[n]="Invalid header flag bits, must be 0x"+i.toString(16)+" for "+r.types[n]+" packet"}r.codes={};for(let n in r.types){let i=r.types[n];r.codes[i]=n}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=o.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=o.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=o.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let n in r.properties){let i=r.properties[n];r.propertiesCodes[i]=n}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function u(n){return[0,1,2].map(i=>[0,1].map(s=>[0,1].map(a=>{let l=o.alloc(1);return l.writeUInt8(r.codes[n]<<r.CMD_SHIFT|(s?r.DUP_MASK:0)|i<<r.QOS_SHIFT|a,0,!0),l})))}r.PUBLISH_HEADER=u("publish"),r.SUBSCRIBE_HEADER=u("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=u("unsubscribe"),r.ACKS={unsuback:u("unsuback"),puback:u("puback"),pubcomp:u("pubcomp"),pubrel:u("pubrel"),pubrec:u("pubrec")},r.SUBACK_HEADER=o.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=o.from([3]),r.VERSION4=o.from([4]),r.VERSION5=o.from([5]),r.VERSION131=o.from([131]),r.VERSION132=o.from([132]),r.QOS=[0,1,2].map(n=>o.from([n])),r.EMPTY={pingreq:o.from([r.codes.pingreq<<4,0]),pingresp:o.from([r.codes.pingresp<<4,0]),disconnect:o.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),My=pe((e,t)=>{le(),ce(),ue();var r=1e3,o=r*60,u=o*60,n=u*24,i=n*7,s=n*365.25;t.exports=function(p,m){m=m||{};var h=typeof p;if(h==="string"&&p.length>0)return a(p);if(h==="number"&&isFinite(p))return m.long?c(p):l(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function a(p){if(p=String(p),!(p.length>100)){var m=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(m){var h=parseFloat(m[1]),g=(m[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*u;case"minutes":case"minute":case"mins":case"min":case"m":return h*o;case"seconds":case"second":case"secs":case"sec":case"s":return h*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function l(p){var m=Math.abs(p);return m>=n?Math.round(p/n)+"d":m>=u?Math.round(p/u)+"h":m>=o?Math.round(p/o)+"m":m>=r?Math.round(p/r)+"s":p+"ms"}function c(p){var m=Math.abs(p);return m>=n?f(p,m,n,"day"):m>=u?f(p,m,u,"hour"):m>=o?f(p,m,o,"minute"):m>=r?f(p,m,r,"second"):p+" ms"}function f(p,m,h,g){var y=m>=h*1.5;return Math.round(p/h)+" "+g+(y?"s":"")}}),Py=pe((e,t)=>{le(),ce(),ue();function r(o){n.debug=n,n.default=n,n.coerce=f,n.disable=l,n.enable=s,n.enabled=c,n.humanize=My(),n.destroy=p,Object.keys(o).forEach(m=>{n[m]=o[m]}),n.names=[],n.skips=[],n.formatters={};function u(m){let h=0;for(let g=0;g<m.length;g++)h=(h<<5)-h+m.charCodeAt(g),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=u;function n(m){let h,g=null,y,w;function b(...E){if(!b.enabled)return;let T=b,v=Number(new Date),A=v-(h||v);T.diff=A,T.prev=h,T.curr=v,h=v,E[0]=n.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let S=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(R,P)=>{if(R==="%%")return"%";S++;let L=n.formatters[P];if(typeof L=="function"){let B=E[S];R=L.call(T,B),E.splice(S,1),S--}return R}),n.formatArgs.call(T,E),(T.log||n.log).apply(T,E)}return b.namespace=m,b.useColors=n.useColors(),b.color=n.selectColor(m),b.extend=i,b.destroy=n.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(y!==n.namespaces&&(y=n.namespaces,w=n.enabled(m)),w),set:E=>{g=E}}),typeof n.init=="function"&&n.init(b),b}function i(m,h){let g=n(this.namespace+(typeof h>"u"?":":h)+m);return g.log=this.log,g}function s(m){n.save(m),n.namespaces=m,n.names=[],n.skips=[];let h=(typeof m=="string"?m:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of h)g[0]==="-"?n.skips.push(g.slice(1)):n.names.push(g)}function a(m,h){let g=0,y=0,w=-1,b=0;for(;g<m.length;)if(y<h.length&&(h[y]===m[g]||h[y]==="*"))h[y]==="*"?(w=y,b=g,y++):(g++,y++);else if(w!==-1)y=w+1,b++,g=b;else return!1;for(;y<h.length&&h[y]==="*";)y++;return y===h.length}function l(){let m=[...n.names,...n.skips.map(h=>"-"+h)].join(",");return n.enable(""),m}function c(m){for(let h of n.skips)if(a(m,h))return!1;for(let h of n.names)if(a(m,h))return!0;return!1}function f(m){return m instanceof Error?m.stack||m.message:m}function p(){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}t.exports=r}),Lt=pe((e,t)=>{le(),ce(),ue(),e.formatArgs=o,e.save=u,e.load=n,e.useColors=r,e.storage=i(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!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`."))}})(),e.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 r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return 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&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;a.splice(1,0,l,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(c++,p==="%c"&&(f=c))}),a.splice(f,0,l)}e.log=console.debug||console.log||(()=>{});function u(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function n(){let a;try{a=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!a&&typeof Ue<"u"&&"env"in Ue&&(a=Ue.env.DEBUG),a}function i(){try{return localStorage}catch{}}t.exports=Py()(e);var{formatters:s}=t.exports;s.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}),Cy=pe((e,t)=>{le(),ce(),ue();var r=Ny(),{EventEmitter:o}=(rr(),ke(Gt)),u=Ly(),n=uh(),i=Lt()("mqtt-packet:parser"),s=class fo extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(l){return this instanceof fo?(this.settings=l||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new fo().parser(l)}_resetState(){i("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new u,this.error=null,this._list=r(),this._stateCounter=0}parse(l){for(this.error&&this._resetState(),this._list.append(l),i("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,i("parse: state complete. _stateCounter is now: %d",this._stateCounter),i("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return i("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let l=this._list.readUInt8(0),c=l>>n.CMD_SHIFT;this.packet.cmd=n.types[c];let f=l&15,p=n.requiredHeaderFlags[c];return p!=null&&f!==p?this._emitError(new Error(n.requiredHeaderFlagsErrors[c])):(this.packet.retain=(l&n.RETAIN_MASK)!==0,this.packet.qos=l>>n.QOS_SHIFT&n.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(l&n.DUP_MASK)!==0,i("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let l=this._parseVarByteNum(!0);return l&&(this.packet.length=l.value,this._list.consume(l.bytes)),i("_parseLength %d",l.value),!!l}_parsePayload(){i("_parsePayload: payload %O",this._list);let l=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}l=!0}return i("_parsePayload complete result: %s",l),l}_parseConnect(){i("_parseConnect");let l,c,f,p,m={},h=this.packet,g=this._parseString();if(g===null)return this._emitError(new Error("Cannot parse protocolId"));if(g!=="MQTT"&&g!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(h.protocolId=g,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(h.protocolVersion=this._list.readUInt8(this._pos),h.protocolVersion>=128&&(h.bridgeMode=!0,h.protocolVersion=h.protocolVersion-128),h.protocolVersion!==3&&h.protocolVersion!==4&&h.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));m.username=this._list.readUInt8(this._pos)&n.USERNAME_MASK,m.password=this._list.readUInt8(this._pos)&n.PASSWORD_MASK,m.will=this._list.readUInt8(this._pos)&n.WILL_FLAG_MASK;let y=!!(this._list.readUInt8(this._pos)&n.WILL_RETAIN_MASK),w=(this._list.readUInt8(this._pos)&n.WILL_QOS_MASK)>>n.WILL_QOS_SHIFT;if(m.will)h.will={},h.will.retain=y,h.will.qos=w;else{if(y)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(w)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(h.clean=(this._list.readUInt8(this._pos)&n.CLEAN_SESSION_MASK)!==0,this._pos++,h.keepalive=this._parseNum(),h.keepalive===-1)return this._emitError(new Error("Packet too short"));if(h.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(h.properties=E)}let b=this._parseString();if(b===null)return this._emitError(new Error("Packet too short"));if(h.clientId=b,i("_parseConnect: packet.clientId: %s",h.clientId),m.will){if(h.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(h.will.properties=E)}if(l=this._parseString(),l===null)return this._emitError(new Error("Cannot parse will topic"));if(h.will.topic=l,i("_parseConnect: packet.will.topic: %s",h.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));h.will.payload=c,i("_parseConnect: packet.will.paylaod: %s",h.will.payload)}if(m.username){if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse username"));h.username=p,i("_parseConnect: packet.username: %s",h.username)}if(m.password){if(f=this._parseBuffer(),f===null)return this._emitError(new Error("Cannot parse password"));h.password=f}return this.settings=h,i("_parseConnect: complete"),h}_parseConnack(){i("_parseConnack");let l=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(l.sessionPresent=!!(c&n.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?l.reasonCode=this._list.readUInt8(this._pos++):l.reasonCode=0;else{if(this._list.length<2)return null;l.returnCode=this._list.readUInt8(this._pos++)}if(l.returnCode===-1||l.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(l.properties=f)}i("_parseConnack: complete")}_parsePublish(){i("_parsePublish");let l=this.packet;if(l.topic=this._parseString(),l.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(l.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}l.payload=this._list.slice(this._pos,l.length),i("_parsePublish: payload from buffer list: %o",l.payload)}}_parseSubscribe(){i("_parseSubscribe");let l=this.packet,c,f,p,m,h,g,y;if(l.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let w=this._parseProperties();Object.getOwnPropertyNames(w).length&&(l.properties=w)}if(l.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<l.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=l.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(f=this._parseByte(),this.settings.protocolVersion===5){if(f&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(f&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(p=f&n.SUBSCRIBE_OPTIONS_QOS_MASK,p>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(g=(f>>n.SUBSCRIBE_OPTIONS_NL_SHIFT&n.SUBSCRIBE_OPTIONS_NL_MASK)!==0,h=(f>>n.SUBSCRIBE_OPTIONS_RAP_SHIFT&n.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,m=f>>n.SUBSCRIBE_OPTIONS_RH_SHIFT&n.SUBSCRIBE_OPTIONS_RH_MASK,m>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));y={topic:c,qos:p},this.settings.protocolVersion===5?(y.nl=g,y.rap=h,y.rh=m):this.settings.bridgeMode&&(y.rh=0,y.rap=!0,y.nl=!0),i("_parseSubscribe: push subscription `%s` to subscription",y),l.subscriptions.push(y)}}}_parseSuback(){i("_parseSuback");let l=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}if(l.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!n.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){i("_parseUnsubscribe");let l=this.packet;if(l.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}if(l.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<l.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));i("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),l.unsubscriptions.push(c)}}}_parseUnsuback(){i("_parseUnsuback");let l=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&l.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(l.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(l.properties=c),l.granted=[];this._pos<this.packet.length;){let f=this._list.readUInt8(this._pos++);if(!n.MQTT5_UNSUBACK_CODES[f])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(f)}}}_parseConfirmation(){i("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let l=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(l.length>2){switch(l.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!n.MQTT5_PUBACK_PUBREC_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!n.MQTT5_PUBREL_PUBCOMP_CODES[l.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}i("_parseConfirmation: packet.reasonCode `%d`",l.reasonCode)}else l.reasonCode=0;if(l.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}}return!0}_parseDisconnect(){let l=this.packet;if(i("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(l.reasonCode=this._parseByte(),n.MQTT5_DISCONNECT_CODES[l.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):l.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}return i("_parseDisconnect result: true"),!0}_parseAuth(){i("_parseAuth");let l=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(l.reasonCode=this._parseByte(),!n.MQTT5_AUTH_CODES[l.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(l.properties=c),i("_parseAuth: result: true"),!0}_parseMessageId(){let l=this.packet;return l.messageId=this._parseNum(),l.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(i("_parseMessageId: packet.messageId %d",l.messageId),!0)}_parseString(l){let c=this._parseNum(),f=c+this._pos;if(c===-1||f>this._list.length||f>this.packet.length)return null;let p=this._list.toString("utf8",this._pos,f);return this._pos+=c,i("_parseString: result: %s",p),p}_parseStringPair(){return i("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let l=this._parseNum(),c=l+this._pos;if(l===-1||c>this._list.length||c>this.packet.length)return null;let f=this._list.slice(this._pos,c);return this._pos+=l,i("_parseBuffer: result: %o",f),f}_parseNum(){if(this._list.length-this._pos<2)return-1;let l=this._list.readUInt16BE(this._pos);return this._pos+=2,i("_parseNum: result: %s",l),l}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let l=this._list.readUInt32BE(this._pos);return this._pos+=4,i("_parse4ByteNum: result: %s",l),l}_parseVarByteNum(l){i("_parseVarByteNum");let c=4,f=0,p=1,m=0,h=!1,g,y=this._pos?this._pos:0;for(;f<c&&y+f<this._list.length;){if(g=this._list.readUInt8(y+f++),m+=p*(g&n.VARBYTEINT_MASK),p*=128,(g&n.VARBYTEINT_FIN_MASK)===0){h=!0;break}if(this._list.length<=f)break}return!h&&f===c&&this._list.length>=f&&this._emitError(new Error("Invalid variable byte integer")),y&&(this._pos+=f),h?l?h={bytes:f,value:m}:h=m:h=!1,i("_parseVarByteNum: result: %o",h),h}_parseByte(){let l;return this._pos<this._list.length&&(l=this._list.readUInt8(this._pos),this._pos++),i("_parseByte: result: %o",l),l}_parseByType(l){switch(i("_parseByType: type: %s",l),l){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){i("_parseProperties");let l=this._parseVarByteNum(),c=this._pos+l,f={};for(;this._pos<c;){let p=this._parseByte();if(!p)return this._emitError(new Error("Cannot parse property code type")),!1;let m=n.propertiesCodes[p];if(!m)return this._emitError(new Error("Unknown property")),!1;if(m==="userProperties"){f[m]||(f[m]=Object.create(null));let h=this._parseByType(n.propertiesTypes[m]);if(f[m][h.name])if(Array.isArray(f[m][h.name]))f[m][h.name].push(h.value);else{let g=f[m][h.name];f[m][h.name]=[g],f[m][h.name].push(h.value)}else f[m][h.name]=h.value;continue}f[m]?Array.isArray(f[m])?f[m].push(this._parseByType(n.propertiesTypes[m])):(f[m]=[f[m]],f[m].push(this._parseByType(n.propertiesTypes[m]))):f[m]=this._parseByType(n.propertiesTypes[m])}return f}_newPacket(){return i("_newPacket"),this.packet&&(this._list.consume(this.packet.length),i("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),i("_newPacket: new packet"),this.packet=new u,this._pos=0,!0}_emitError(l){i("_emitError",l),this.error=l,this.emit("error",l)}};t.exports=s}),xy=pe((e,t)=>{le(),ce(),ue();var{Buffer:r}=($e(),ke(Ve)),o=65536,u={},n=r.isBuffer(r.from([1,2]).subarray(0,1));function i(c){let f=r.allocUnsafe(2);return f.writeUInt8(c>>8,0),f.writeUInt8(c&255,1),f}function s(){for(let c=0;c<o;c++)u[c]=i(c)}function a(c){let f=0,p=0,m=r.allocUnsafe(4);do f=c%128|0,c=c/128|0,c>0&&(f=f|128),m.writeUInt8(f,p++);while(c>0&&p<4);return c>0&&(p=0),n?m.subarray(0,p):m.slice(0,p)}function l(c){let f=r.allocUnsafe(4);return f.writeUInt32BE(c,0),f}t.exports={cache:u,generateCache:s,generateNumber:i,genBufVariableByteInt:a,generate4ByteBuffer:l}}),Dy=pe((e,t)=>{le(),ce(),ue(),typeof Ue>"u"||!Ue.version||Ue.version.indexOf("v0.")===0||Ue.version.indexOf("v1.")===0&&Ue.version.indexOf("v1.8.")!==0?t.exports={nextTick:r}:t.exports=Ue;function r(o,u,n,i){if(typeof o!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,a,l;switch(s){case 0:case 1:return Ue.nextTick(o);case 2:return Ue.nextTick(function(){o.call(null,u)});case 3:return Ue.nextTick(function(){o.call(null,u,n)});case 4:return Ue.nextTick(function(){o.call(null,u,n,i)});default:for(a=new Array(s-1),l=0;l<a.length;)a[l++]=arguments[l];return Ue.nextTick(function(){o.apply(null,a)})}}}),ch=pe((e,t)=>{le(),ce(),ue();var r=uh(),{Buffer:o}=($e(),ke(Ve)),u=o.allocUnsafe(0),n=o.from([0]),i=xy(),s=Dy().nextTick,a=Lt()("mqtt-packet:writeToStream"),l=i.cache,c=i.generateNumber,f=i.generateCache,p=i.genBufVariableByteInt,m=i.generate4ByteBuffer,h=X,g=!0;function y(Y,D,ne){switch(a("generate called"),D.cork&&(D.cork(),s(w,D)),g&&(g=!1,f()),a("generate: packet.cmd: %s",Y.cmd),Y.cmd){case"connect":return b(Y,D);case"connack":return E(Y,D,ne);case"publish":return T(Y,D,ne);case"puback":case"pubrec":case"pubrel":case"pubcomp":return v(Y,D,ne);case"subscribe":return A(Y,D,ne);case"suback":return S(Y,D,ne);case"unsubscribe":return R(Y,D,ne);case"unsuback":return P(Y,D,ne);case"pingreq":case"pingresp":return L(Y,D);case"disconnect":return B(Y,D,ne);case"auth":return O(Y,D,ne);default:return D.destroy(new Error("Unknown command")),!1}}Object.defineProperty(y,"cacheNumbers",{get(){return h===X},set(Y){Y?((!l||Object.keys(l).length===0)&&(g=!0),h=X):(g=!1,h=q)}});function w(Y){Y.uncork()}function b(Y,D,ne){let V=Y||{},K=V.protocolId||"MQTT",z=V.protocolVersion||4,me=V.will,oe=V.clean,C=V.keepalive||0,W=V.clientId||"",ee=V.username,he=V.password,de=V.properties;oe===void 0&&(oe=!0);let ve=0;if(typeof K!="string"&&!o.isBuffer(K))return D.destroy(new Error("Invalid protocolId")),!1;if(ve+=K.length+2,z!==3&&z!==4&&z!==5)return D.destroy(new Error("Invalid protocol version")),!1;if(ve+=1,(typeof W=="string"||o.isBuffer(W))&&(W||z>=4)&&(W||oe))ve+=o.byteLength(W)+2;else{if(z<4)return D.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(oe*1===0)return D.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof C!="number"||C<0||C>65535||C%1!==0)return D.destroy(new Error("Invalid keepalive")),!1;ve+=2,ve+=1;let H,ge;if(z===5){if(H=Z(D,de),!H)return!1;ve+=H.length}if(me){if(typeof me!="object")return D.destroy(new Error("Invalid will")),!1;if(!me.topic||typeof me.topic!="string")return D.destroy(new Error("Invalid will topic")),!1;if(ve+=o.byteLength(me.topic)+2,ve+=2,me.payload)if(me.payload.length>=0)typeof me.payload=="string"?ve+=o.byteLength(me.payload):ve+=me.payload.length;else return D.destroy(new Error("Invalid will payload")),!1;if(ge={},z===5){if(ge=Z(D,me.properties),!ge)return!1;ve+=ge.length}}let _e=!1;if(ee!=null)if(Ee(ee))_e=!0,ve+=o.byteLength(ee)+2;else return D.destroy(new Error("Invalid username")),!1;if(he!=null){if(!_e)return D.destroy(new Error("Username is required to use password")),!1;if(Ee(he))ve+=te(he)+2;else return D.destroy(new Error("Invalid password")),!1}D.write(r.CONNECT_HEADER),F(D,ve),j(D,K),V.bridgeMode&&(z+=128),D.write(z===131?r.VERSION131:z===132?r.VERSION132:z===4?r.VERSION4:z===5?r.VERSION5:r.VERSION3);let se=0;return se|=ee!=null?r.USERNAME_MASK:0,se|=he!=null?r.PASSWORD_MASK:0,se|=me&&me.retain?r.WILL_RETAIN_MASK:0,se|=me&&me.qos?me.qos<<r.WILL_QOS_SHIFT:0,se|=me?r.WILL_FLAG_MASK:0,se|=oe?r.CLEAN_SESSION_MASK:0,D.write(o.from([se])),h(D,C),z===5&&H.write(),j(D,W),me&&(z===5&&ge.write(),k(D,me.topic),j(D,me.payload)),ee!=null&&j(D,ee),he!=null&&j(D,he),!0}function E(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=V===5?K.reasonCode:K.returnCode,me=K.properties,oe=2;if(typeof z!="number")return D.destroy(new Error("Invalid return code")),!1;let C=null;if(V===5){if(C=Z(D,me),!C)return!1;oe+=C.length}return D.write(r.CONNACK_HEADER),F(D,oe),D.write(K.sessionPresent?r.SESSIONPRESENT_HEADER:n),D.write(o.from([z])),C?.write(),!0}function T(Y,D,ne){a("publish: packet: %o",Y);let V=ne?ne.protocolVersion:4,K=Y||{},z=K.qos||0,me=K.retain?r.RETAIN_MASK:0,oe=K.topic,C=K.payload||u,W=K.messageId,ee=K.properties,he=0;if(typeof oe=="string")he+=o.byteLength(oe)+2;else if(o.isBuffer(oe))he+=oe.length+2;else return D.destroy(new Error("Invalid topic")),!1;if(o.isBuffer(C)?he+=C.length:he+=o.byteLength(C),z&&typeof W!="number")return D.destroy(new Error("Invalid messageId")),!1;z&&(he+=2);let de=null;if(V===5){if(de=Z(D,ee),!de)return!1;he+=de.length}return D.write(r.PUBLISH_HEADER[z][K.dup?1:0][me?1:0]),F(D,he),h(D,te(oe)),D.write(oe),z>0&&h(D,W),de?.write(),a("publish: payload: %o",C),D.write(C)}function v(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.cmd||"puback",me=K.messageId,oe=K.dup&&z==="pubrel"?r.DUP_MASK:0,C=0,W=K.reasonCode,ee=K.properties,he=V===5?3:2;if(z==="pubrel"&&(C=1),typeof me!="number")return D.destroy(new Error("Invalid messageId")),!1;let de=null;if(V===5&&typeof ee=="object"){if(de=M(D,ee,ne,he),!de)return!1;he+=de.length}return D.write(r.ACKS[z][C][oe][0]),he===3&&(he+=W!==0?1:-1),F(D,he),h(D,me),V===5&&he!==2&&D.write(o.from([W])),de!==null?de.write():he===4&&D.write(o.from([0])),!0}function A(Y,D,ne){a("subscribe: packet: ");let V=ne?ne.protocolVersion:4,K=Y||{},z=K.dup?r.DUP_MASK:0,me=K.messageId,oe=K.subscriptions,C=K.properties,W=0;if(typeof me!="number")return D.destroy(new Error("Invalid messageId")),!1;W+=2;let ee=null;if(V===5){if(ee=Z(D,C),!ee)return!1;W+=ee.length}if(typeof oe=="object"&&oe.length)for(let de=0;de<oe.length;de+=1){let ve=oe[de].topic,H=oe[de].qos;if(typeof ve!="string")return D.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof H!="number")return D.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(V===5){if(typeof(oe[de].nl||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(oe[de].rap||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ge=oe[de].rh||0;if(typeof ge!="number"||ge>2)return D.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}W+=o.byteLength(ve)+2+1}else return D.destroy(new Error("Invalid subscriptions")),!1;a("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),D.write(r.SUBSCRIBE_HEADER[1][z?1:0][0]),F(D,W),h(D,me),ee!==null&&ee.write();let he=!0;for(let de of oe){let ve=de.topic,H=de.qos,ge=+de.nl,_e=+de.rap,se=de.rh,Me;k(D,ve),Me=r.SUBSCRIBE_OPTIONS_QOS[H],V===5&&(Me|=ge?r.SUBSCRIBE_OPTIONS_NL:0,Me|=_e?r.SUBSCRIBE_OPTIONS_RAP:0,Me|=se?r.SUBSCRIBE_OPTIONS_RH[se]:0),he=D.write(o.from([Me]))}return he}function S(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.messageId,me=K.granted,oe=K.properties,C=0;if(typeof z!="number")return D.destroy(new Error("Invalid messageId")),!1;if(C+=2,typeof me=="object"&&me.length)for(let ee=0;ee<me.length;ee+=1){if(typeof me[ee]!="number")return D.destroy(new Error("Invalid qos vector")),!1;C+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let W=null;if(V===5){if(W=M(D,oe,ne,C),!W)return!1;C+=W.length}return D.write(r.SUBACK_HEADER),F(D,C),h(D,z),W!==null&&W.write(),D.write(o.from(me))}function R(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.messageId,me=K.dup?r.DUP_MASK:0,oe=K.unsubscriptions,C=K.properties,W=0;if(typeof z!="number")return D.destroy(new Error("Invalid messageId")),!1;if(W+=2,typeof oe=="object"&&oe.length)for(let de=0;de<oe.length;de+=1){if(typeof oe[de]!="string")return D.destroy(new Error("Invalid unsubscriptions")),!1;W+=o.byteLength(oe[de])+2}else return D.destroy(new Error("Invalid unsubscriptions")),!1;let ee=null;if(V===5){if(ee=Z(D,C),!ee)return!1;W+=ee.length}D.write(r.UNSUBSCRIBE_HEADER[1][me?1:0][0]),F(D,W),h(D,z),ee!==null&&ee.write();let he=!0;for(let de=0;de<oe.length;de++)he=k(D,oe[de]);return he}function P(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.messageId,me=K.dup?r.DUP_MASK:0,oe=K.granted,C=K.properties,W=K.cmd,ee=0,he=2;if(typeof z!="number")return D.destroy(new Error("Invalid messageId")),!1;if(V===5)if(typeof oe=="object"&&oe.length)for(let ve=0;ve<oe.length;ve+=1){if(typeof oe[ve]!="number")return D.destroy(new Error("Invalid qos vector")),!1;he+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let de=null;if(V===5){if(de=M(D,C,ne,he),!de)return!1;he+=de.length}return D.write(r.ACKS[W][ee][me][0]),F(D,he),h(D,z),de!==null&&de.write(),V===5&&D.write(o.from(oe)),!0}function L(Y,D,ne){return D.write(r.EMPTY[Y.cmd])}function B(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.reasonCode,me=K.properties,oe=V===5?1:0,C=null;if(V===5){if(C=M(D,me,ne,oe),!C)return!1;oe+=C.length}return D.write(o.from([r.codes.disconnect<<4])),F(D,oe),V===5&&D.write(o.from([z])),C!==null&&C.write(),!0}function O(Y,D,ne){let V=ne?ne.protocolVersion:4,K=Y||{},z=K.reasonCode,me=K.properties,oe=V===5?1:0;V!==5&&D.destroy(new Error("Invalid mqtt version for auth packet"));let C=M(D,me,ne,oe);return C?(oe+=C.length,D.write(o.from([r.codes.auth<<4])),F(D,oe),D.write(o.from([z])),C!==null&&C.write(),!0):!1}var G={};function F(Y,D){if(D>r.VARBYTEINT_MAX)return Y.destroy(new Error(`Invalid variable byte integer: ${D}`)),!1;let ne=G[D];return ne||(ne=p(D),D<16384&&(G[D]=ne)),a("writeVarByteInt: writing to stream: %o",ne),Y.write(ne)}function k(Y,D){let ne=o.byteLength(D);return h(Y,ne),a("writeString: %s",D),Y.write(D,"utf8")}function ae(Y,D,ne){k(Y,D),k(Y,ne)}function X(Y,D){return a("writeNumberCached: number: %d",D),a("writeNumberCached: %o",l[D]),Y.write(l[D])}function q(Y,D){let ne=c(D);return a("writeNumberGenerated: %o",ne),Y.write(ne)}function re(Y,D){let ne=m(D);return a("write4ByteNumber: %o",ne),Y.write(ne)}function j(Y,D){typeof D=="string"?k(Y,D):D?(h(Y,D.length),Y.write(D)):h(Y,0)}function Z(Y,D){if(typeof D!="object"||D.length!=null)return{length:1,write(){ye(Y,{},0)}};let ne=0;function V(K,z){let me=r.propertiesTypes[K],oe=0;switch(me){case"byte":{if(typeof z!="boolean")return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=2;break}case"int8":{if(typeof z!="number"||z<0||z>255)return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=2;break}case"binary":{if(z&&z===null)return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=1+o.byteLength(z)+2;break}case"int16":{if(typeof z!="number"||z<0||z>65535)return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=3;break}case"int32":{if(typeof z!="number"||z<0||z>4294967295)return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=5;break}case"var":{if(typeof z!="number"||z<0||z>268435455)return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=1+o.byteLength(p(z));break}case"string":{if(typeof z!="string")return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=3+o.byteLength(z.toString());break}case"pair":{if(typeof z!="object")return Y.destroy(new Error(`Invalid ${K}: ${z}`)),!1;oe+=Object.getOwnPropertyNames(z).reduce((C,W)=>{let ee=z[W];return Array.isArray(ee)?C+=ee.reduce((he,de)=>(he+=3+o.byteLength(W.toString())+2+o.byteLength(de.toString()),he),0):C+=3+o.byteLength(W.toString())+2+o.byteLength(z[W].toString()),C},0);break}default:return Y.destroy(new Error(`Invalid property ${K}: ${z}`)),!1}return oe}if(D)for(let K in D){let z=0,me=0,oe=D[K];if(oe!==void 0){if(Array.isArray(oe))for(let C=0;C<oe.length;C++){if(me=V(K,oe[C]),!me)return!1;z+=me}else{if(me=V(K,oe),!me)return!1;z=me}if(!z)return!1;ne+=z}}return{length:o.byteLength(p(ne))+ne,write(){ye(Y,D,ne)}}}function M(Y,D,ne,V){let K=["reasonString","userProperties"],z=ne&&ne.properties&&ne.properties.maximumPacketSize?ne.properties.maximumPacketSize:0,me=Z(Y,D);if(z)for(;V+me.length>z;){let oe=K.shift();if(oe&&D[oe])delete D[oe],me=Z(Y,D);else return!1}return me}function Q(Y,D,ne){switch(r.propertiesTypes[D]){case"byte":{Y.write(o.from([r.properties[D]])),Y.write(o.from([+ne]));break}case"int8":{Y.write(o.from([r.properties[D]])),Y.write(o.from([ne]));break}case"binary":{Y.write(o.from([r.properties[D]])),j(Y,ne);break}case"int16":{Y.write(o.from([r.properties[D]])),h(Y,ne);break}case"int32":{Y.write(o.from([r.properties[D]])),re(Y,ne);break}case"var":{Y.write(o.from([r.properties[D]])),F(Y,ne);break}case"string":{Y.write(o.from([r.properties[D]])),k(Y,ne);break}case"pair":{Object.getOwnPropertyNames(ne).forEach(V=>{let K=ne[V];Array.isArray(K)?K.forEach(z=>{Y.write(o.from([r.properties[D]])),ae(Y,V.toString(),z.toString())}):(Y.write(o.from([r.properties[D]])),ae(Y,V.toString(),K.toString()))});break}default:return Y.destroy(new Error(`Invalid property ${D} value: ${ne}`)),!1}}function ye(Y,D,ne){F(Y,ne);for(let V in D)if(Object.prototype.hasOwnProperty.call(D,V)&&D[V]!=null){let K=D[V];if(Array.isArray(K))for(let z=0;z<K.length;z++)Q(Y,V,K[z]);else Q(Y,V,K)}}function te(Y){return Y?Y instanceof o?Y.length:o.byteLength(Y):0}function Ee(Y){return typeof Y=="string"||Y instanceof o}t.exports=y}),ky=pe((e,t)=>{le(),ce(),ue();var r=ch(),{EventEmitter:o}=(rr(),ke(Gt)),{Buffer:u}=($e(),ke(Ve));function n(s,a){let l=new i;return r(s,l,a),l.concat()}var i=class extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(s){return this._array[this._i++]=s,!0}concat(){let s=0,a=new Array(this._array.length),l=this._array,c=0,f;for(f=0;f<l.length&&l[f]!==void 0;f++)typeof l[f]!="string"?a[f]=l[f].length:a[f]=u.byteLength(l[f]),s+=a[f];let p=u.allocUnsafe(s);for(f=0;f<l.length&&l[f]!==void 0;f++)typeof l[f]!="string"?(l[f].copy(p,c),c+=a[f]):(p.write(l[f],c),c+=a[f]);return p}destroy(s){s&&this.emit("error",s)}};t.exports=n}),Uy=pe(e=>{le(),ce(),ue(),e.parser=Cy().parser,e.generate=ky(),e.writeToStream=ch()}),By=pe((e,t)=>{le(),ce(),ue(),t.exports=o;function r(n){return n instanceof Tn?Tn.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function o(n){if(n=n||{},n.circles)return u(n);let i=new Map;if(i.set(Date,f=>new Date(f)),i.set(Map,(f,p)=>new Map(a(Array.from(f),p))),i.set(Set,(f,p)=>new Set(a(Array.from(f),p))),n.constructorHandlers)for(let f of n.constructorHandlers)i.set(f[0],f[1]);let s=null;return n.proto?c:l;function a(f,p){let m=Object.keys(f),h=new Array(m.length);for(let g=0;g<m.length;g++){let y=m[g],w=f[y];typeof w!="object"||w===null?h[y]=w:w.constructor!==Object&&(s=i.get(w.constructor))?h[y]=s(w,p):ArrayBuffer.isView(w)?h[y]=r(w):h[y]=p(w)}return h}function l(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return a(f,l);if(f.constructor!==Object&&(s=i.get(f.constructor)))return s(f,l);let p={};for(let m in f){if(Object.hasOwnProperty.call(f,m)===!1)continue;let h=f[m];typeof h!="object"||h===null?p[m]=h:h.constructor!==Object&&(s=i.get(h.constructor))?p[m]=s(h,l):ArrayBuffer.isView(h)?p[m]=r(h):p[m]=l(h)}return p}function c(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return a(f,c);if(f.constructor!==Object&&(s=i.get(f.constructor)))return s(f,c);let p={};for(let m in f){let h=f[m];typeof h!="object"||h===null?p[m]=h:h.constructor!==Object&&(s=i.get(h.constructor))?p[m]=s(h,c):ArrayBuffer.isView(h)?p[m]=r(h):p[m]=c(h)}return p}}function u(n){let i=[],s=[],a=new Map;if(a.set(Date,m=>new Date(m)),a.set(Map,(m,h)=>new Map(c(Array.from(m),h))),a.set(Set,(m,h)=>new Set(c(Array.from(m),h))),n.constructorHandlers)for(let m of n.constructorHandlers)a.set(m[0],m[1]);let l=null;return n.proto?p:f;function c(m,h){let g=Object.keys(m),y=new Array(g.length);for(let w=0;w<g.length;w++){let b=g[w],E=m[b];if(typeof E!="object"||E===null)y[b]=E;else if(E.constructor!==Object&&(l=a.get(E.constructor)))y[b]=l(E,h);else if(ArrayBuffer.isView(E))y[b]=r(E);else{let T=i.indexOf(E);T!==-1?y[b]=s[T]:y[b]=h(E)}}return y}function f(m){if(typeof m!="object"||m===null)return m;if(Array.isArray(m))return c(m,f);if(m.constructor!==Object&&(l=a.get(m.constructor)))return l(m,f);let h={};i.push(m),s.push(h);for(let g in m){if(Object.hasOwnProperty.call(m,g)===!1)continue;let y=m[g];if(typeof y!="object"||y===null)h[g]=y;else if(y.constructor!==Object&&(l=a.get(y.constructor)))h[g]=l(y,f);else if(ArrayBuffer.isView(y))h[g]=r(y);else{let w=i.indexOf(y);w!==-1?h[g]=s[w]:h[g]=f(y)}}return i.pop(),s.pop(),h}function p(m){if(typeof m!="object"||m===null)return m;if(Array.isArray(m))return c(m,p);if(m.constructor!==Object&&(l=a.get(m.constructor)))return l(m,p);let h={};i.push(m),s.push(h);for(let g in m){let y=m[g];if(typeof y!="object"||y===null)h[g]=y;else if(y.constructor!==Object&&(l=a.get(y.constructor)))h[g]=l(y,p);else if(ArrayBuffer.isView(y))h[g]=r(y);else{let w=i.indexOf(y);w!==-1?h[g]=s[w]:h[g]=p(y)}}return i.pop(),s.pop(),h}}}),Fy=pe((e,t)=>{le(),ce(),ue(),t.exports=By()()}),fh=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=r;function t(o){let u=o.split("/");for(let n=0;n<u.length;n++)if(u[n]!=="+"){if(u[n]==="#")return n===u.length-1;if(u[n].indexOf("+")!==-1||u[n].indexOf("#")!==-1)return!1}return!0}function r(o){if(o.length===0)return"empty_topic_list";for(let u=0;u<o.length;u++)if(!t(o[u]))return o[u];return null}}),hh=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=ir(),r={objectMode:!0},o={clean:!0},u=class{options;_inflights;constructor(n){this.options=n||{},this.options={...o,...n},this._inflights=new Map}put(n,i){return this._inflights.set(n.messageId,n),i&&i(),this}createStream(){let n=new t.Readable(r),i=[],s=!1,a=0;return this._inflights.forEach((l,c)=>{i.push(l)}),n._read=()=>{!s&&a<i.length?n.push(i[a++]):n.push(null)},n.destroy=l=>{if(!s)return s=!0,setTimeout(()=>{n.emit("close")},0),n},n}del(n,i){let s=this._inflights.get(n.messageId);return s?(this._inflights.delete(n.messageId),i(null,s)):i&&i(new Error("missing packet")),this}get(n,i){let s=this._inflights.get(n.messageId);return s?i(null,s):i&&i(new Error("missing packet")),this}close(n){this.options.clean&&(this._inflights=null),n&&n()}};e.default=u}),jy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153],r=(o,u,n)=>{o.log("handlePublish: packet %o",u),n=typeof n<"u"?n:o.noop;let i=u.topic.toString(),s=u.payload,{qos:a}=u,{messageId:l}=u,{options:c}=o;if(o.options.protocolVersion===5){let f;if(u.properties&&(f=u.properties.topicAlias),typeof f<"u")if(i.length===0)if(f>0&&f<=65535){let p=o.topicAliasRecv.getTopicByAlias(f);if(p)i=p,o.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,f);else{o.log("handlePublish :: unregistered topic alias. alias: %d",f),o.emit("error",new Error("Received unregistered Topic Alias"));return}}else{o.log("handlePublish :: topic alias out of range. alias: %d",f),o.emit("error",new Error("Received Topic Alias is out of range"));return}else if(o.topicAliasRecv.put(i,f))o.log("handlePublish :: registered topic: %s - alias: %d",i,f);else{o.log("handlePublish :: topic alias out of range. alias: %d",f),o.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(o.log("handlePublish: qos %d",a),a){case 2:{c.customHandleAcks(i,s,u,(f,p)=>{if(typeof f=="number"&&(p=f,f=null),f)return o.emit("error",f);if(t.indexOf(p)===-1)return o.emit("error",new Error("Wrong reason code for pubrec"));p?o._sendPacket({cmd:"pubrec",messageId:l,reasonCode:p},n):o.incomingStore.put(u,()=>{o._sendPacket({cmd:"pubrec",messageId:l},n)})});break}case 1:{c.customHandleAcks(i,s,u,(f,p)=>{if(typeof f=="number"&&(p=f,f=null),f)return o.emit("error",f);if(t.indexOf(p)===-1)return o.emit("error",new Error("Wrong reason code for puback"));p||o.emit("message",i,s,u),o.handleMessage(u,m=>{if(m)return n&&n(m);o._sendPacket({cmd:"puback",messageId:l,reasonCode:p},n)})});break}case 0:o.emit("message",i,s,u),o.handleMessage(u,n);break;default:o.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=r}),Wy=pe((e,t)=>{t.exports={version:"5.15.0"}}),mr=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=o;var t=class dh extends Error{code;constructor(n,i){super(n),this.code=i,Object.setPrototypeOf(this,dh.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class ph extends Error{packet;constructor(n,i){super(n),this.packet=i,Object.setPrototypeOf(this,ph.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r;function o(u,n,i=!1){let s=[n];for(;;){let a=s[0],l=Object.getPrototypeOf(a);if(l?.prototype)s.unshift(l);else break}for(let a of s)for(let l of Object.getOwnPropertyNames(a.prototype))(i||l!=="constructor")&&Object.defineProperty(u.prototype,l,Object.getOwnPropertyDescriptor(a.prototype,l)??Object.create(null))}e.nextTick=typeof Ue?.nextTick=="function"?Ue.nextTick:u=>{setTimeout(u,0)},e.MQTTJS_VERSION=Wy().version}),Mn=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=mr();e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var r=(o,u)=>{let{messageId:n}=u,i=u.cmd,s=null,a=o.outgoing[n]?o.outgoing[n].cb:null,l=null;if(!a){o.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(o.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let c=u.reasonCode;c&&c>0&&c!==16?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[c]}`,c),o._removeOutgoingAndStoreMessage(n,()=>{a(l,u)})):o._removeOutgoingAndStoreMessage(n,a);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};let c=u.reasonCode;c&&c>0&&c!==16?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[c]}`,c),o._removeOutgoingAndStoreMessage(n,()=>{a(l,u)})):o._sendPacket(s);break}case"suback":{delete o.outgoing[n],o.messageIdProvider.deallocate(n);let c=u.granted;for(let f=0;f<c.length;f++){let p=c[f];if((p&128)!==0){l=new Error(`Subscribe error: ${e.ReasonCodes[p]}`),l.code=p;let m=o.messageIdToTopic[n];m&&m.forEach(h=>{delete o._resubscribeTopics[h]})}}delete o.messageIdToTopic[n],o._invokeStoreProcessingQueue(),a(l,u);break}case"unsuback":{delete o.outgoing[n],o.messageIdProvider.deallocate(n),o._invokeStoreProcessingQueue(),a(null,u);break}default:o.emit("error",new Error("unrecognized packet type"))}o.disconnecting&&Object.keys(o.outgoing).length===0&&o.emit("outgoingEmpty")};e.default=r}),Gy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=mr(),r=Mn(),o=(u,n)=>{let{options:i}=u,s=i.protocolVersion,a=s===5?n.reasonCode:n.returnCode;if(s!==5){let l=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,a);u.emit("error",l);return}u.handleAuth(n,(l,c)=>{if(l){u.emit("error",l);return}if(a===24)u.reconnecting=!1,u._sendPacket(c);else{let f=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[a]}`,a);u.emit("error",f)}})};e.default=o}),Hy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,o=typeof Ue=="object"&&Ue?Ue:{},u=(m,h,g,y)=>{typeof o.emitWarning=="function"?o.emitWarning(m,h,g,y):console.error(`[${g}] ${h}: ${m}`)},n=globalThis.AbortController,i=globalThis.AbortSignal;if(typeof n>"u"){i=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(g,y){this._onabort.push(y)}},n=class{constructor(){h()}signal=new i;abort(g){if(!this.signal.aborted){this.signal.reason=g,this.signal.aborted=!0;for(let y of this.signal._onabort)y(g);this.signal.onabort?.(g)}}};let m=o.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",h=()=>{m&&(m=!1,u("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",h))}}var s=m=>!r.has(m),a=m=>m&&m===Math.floor(m)&&m>0&&isFinite(m),l=m=>a(m)?m<=Math.pow(2,8)?Uint8Array:m<=Math.pow(2,16)?Uint16Array:m<=Math.pow(2,32)?Uint32Array:m<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(m){super(m),this.fill(0)}},f=class Rr{heap;length;static#l=!1;static create(h){let g=l(h);if(!g)return[];Rr.#l=!0;let y=new Rr(h,g);return Rr.#l=!1,y}constructor(h,g){if(!Rr.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new g(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}},p=class gh{#l;#f;#g;#b;#L;#M;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#m;#n;#r;#e;#u;#h;#a;#o;#y;#s;#v;#_;#d;#E;#I;#c;static unsafeExposeInternals(h){return{starts:h.#_,ttls:h.#d,sizes:h.#v,keyMap:h.#n,keyList:h.#r,valList:h.#e,next:h.#u,prev:h.#h,get head(){return h.#a},get tail(){return h.#o},free:h.#y,isBackgroundFetch:g=>h.#t(g),backgroundFetch:(g,y,w,b)=>h.#x(g,y,w,b),moveToTail:g=>h.#N(g),indexes:g=>h.#w(g),rindexes:g=>h.#S(g),isStale:g=>h.#p(g)}}get max(){return this.#l}get maxSize(){return this.#f}get calculatedSize(){return this.#m}get size(){return this.#i}get fetchMethod(){return this.#L}get memoMethod(){return this.#M}get dispose(){return this.#g}get disposeAfter(){return this.#b}constructor(h){let{max:g=0,ttl:y,ttlResolution:w=1,ttlAutopurge:b,updateAgeOnGet:E,updateAgeOnHas:T,allowStale:v,dispose:A,disposeAfter:S,noDisposeOnSet:R,noUpdateTTL:P,maxSize:L=0,maxEntrySize:B=0,sizeCalculation:O,fetchMethod:G,memoMethod:F,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:ae,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:q,ignoreFetchAbort:re}=h;if(g!==0&&!a(g))throw new TypeError("max option must be a nonnegative integer");let j=g?l(g):Array;if(!j)throw new Error("invalid max value: "+g);if(this.#l=g,this.#f=L,this.maxEntrySize=B||this.#f,this.sizeCalculation=O,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(F!==void 0&&typeof F!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=F,G!==void 0&&typeof G!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#L=G,this.#I=!!G,this.#n=new Map,this.#r=new Array(g).fill(void 0),this.#e=new Array(g).fill(void 0),this.#u=new j(g),this.#h=new j(g),this.#a=0,this.#o=0,this.#y=f.create(g),this.#i=0,this.#m=0,typeof A=="function"&&(this.#g=A),typeof S=="function"?(this.#b=S,this.#s=[]):(this.#b=void 0,this.#s=void 0),this.#E=!!this.#g,this.#c=!!this.#b,this.noDisposeOnSet=!!R,this.noUpdateTTL=!!P,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!q,this.ignoreFetchAbort=!!re,this.maxEntrySize!==0){if(this.#f!==0&&!a(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!v,this.noDeleteOnStaleGet=!!ae,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!T,this.ttlResolution=a(w)||w===0?w:1,this.ttlAutopurge=!!b,this.ttl=y||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#l===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#f){let Z="LRU_CACHE_UNBOUNDED";s(Z)&&(r.add(Z),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Z,gh))}}getRemainingTTL(h){return this.#n.has(h)?1/0:0}#D(){let h=new c(this.#l),g=new c(this.#l);this.#d=h,this.#_=g,this.#k=(b,E,T=t.now())=>{if(g[b]=E!==0?T:0,h[b]=E,E!==0&&this.ttlAutopurge){let v=setTimeout(()=>{this.#p(b)&&this.#A(this.#r[b],"expire")},E+1);v.unref&&v.unref()}},this.#R=b=>{g[b]=h[b]!==0?t.now():0},this.#T=(b,E)=>{if(h[E]){let T=h[E],v=g[E];if(!T||!v)return;b.ttl=T,b.start=v,b.now=y||w();let A=b.now-v;b.remainingTTL=T-A}};let y=0,w=()=>{let b=t.now();if(this.ttlResolution>0){y=b;let E=setTimeout(()=>y=0,this.ttlResolution);E.unref&&E.unref()}return b};this.getRemainingTTL=b=>{let E=this.#n.get(b);if(E===void 0)return 0;let T=h[E],v=g[E];if(!T||!v)return 1/0;let A=(y||w())-v;return T-A},this.#p=b=>{let E=g[b],T=h[b];return!!T&&!!E&&(y||w())-E>T}}#R=()=>{};#T=()=>{};#k=()=>{};#p=()=>!1;#W(){let h=new c(this.#l);this.#m=0,this.#v=h,this.#O=g=>{this.#m-=h[g],h[g]=0},this.#U=(g,y,w,b)=>{if(this.#t(y))return 0;if(!a(w))if(b){if(typeof b!="function")throw new TypeError("sizeCalculation must be a function");if(w=b(y,g),!a(w))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return w},this.#P=(g,y,w)=>{if(h[g]=y,this.#f){let b=this.#f-h[g];for(;this.#m>b;)this.#C(!0)}this.#m+=h[g],w&&(w.entrySize=y,w.totalCalculatedSize=this.#m)}}#O=h=>{};#P=(h,g,y)=>{};#U=(h,g,y,w)=>{if(y||w)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:h=this.allowStale}={}){if(this.#i)for(let g=this.#o;!(!this.#B(g)||((h||!this.#p(g))&&(yield g),g===this.#a));)g=this.#h[g]}*#S({allowStale:h=this.allowStale}={}){if(this.#i)for(let g=this.#a;!(!this.#B(g)||((h||!this.#p(g))&&(yield g),g===this.#o));)g=this.#u[g]}#B(h){return h!==void 0&&this.#n.get(this.#r[h])===h}*entries(){for(let h of this.#w())this.#e[h]!==void 0&&this.#r[h]!==void 0&&!this.#t(this.#e[h])&&(yield[this.#r[h],this.#e[h]])}*rentries(){for(let h of this.#S())this.#e[h]!==void 0&&this.#r[h]!==void 0&&!this.#t(this.#e[h])&&(yield[this.#r[h],this.#e[h]])}*keys(){for(let h of this.#w()){let g=this.#r[h];g!==void 0&&!this.#t(this.#e[h])&&(yield g)}}*rkeys(){for(let h of this.#S()){let g=this.#r[h];g!==void 0&&!this.#t(this.#e[h])&&(yield g)}}*values(){for(let h of this.#w())this.#e[h]!==void 0&&!this.#t(this.#e[h])&&(yield this.#e[h])}*rvalues(){for(let h of this.#S())this.#e[h]!==void 0&&!this.#t(this.#e[h])&&(yield this.#e[h])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(h,g={}){for(let y of this.#w()){let w=this.#e[y],b=this.#t(w)?w.__staleWhileFetching:w;if(b!==void 0&&h(b,this.#r[y],this))return this.get(this.#r[y],g)}}forEach(h,g=this){for(let y of this.#w()){let w=this.#e[y],b=this.#t(w)?w.__staleWhileFetching:w;b!==void 0&&h.call(g,b,this.#r[y],this)}}rforEach(h,g=this){for(let y of this.#S()){let w=this.#e[y],b=this.#t(w)?w.__staleWhileFetching:w;b!==void 0&&h.call(g,b,this.#r[y],this)}}purgeStale(){let h=!1;for(let g of this.#S({allowStale:!0}))this.#p(g)&&(this.#A(this.#r[g],"expire"),h=!0);return h}info(h){let g=this.#n.get(h);if(g===void 0)return;let y=this.#e[g],w=this.#t(y)?y.__staleWhileFetching:y;if(w===void 0)return;let b={value:w};if(this.#d&&this.#_){let E=this.#d[g],T=this.#_[g];if(E&&T){let v=E-(t.now()-T);b.ttl=v,b.start=Date.now()}}return this.#v&&(b.size=this.#v[g]),b}dump(){let h=[];for(let g of this.#w({allowStale:!0})){let y=this.#r[g],w=this.#e[g],b=this.#t(w)?w.__staleWhileFetching:w;if(b===void 0||y===void 0)continue;let E={value:b};if(this.#d&&this.#_){E.ttl=this.#d[g];let T=t.now()-this.#_[g];E.start=Math.floor(Date.now()-T)}this.#v&&(E.size=this.#v[g]),h.unshift([y,E])}return h}load(h){this.clear();for(let[g,y]of h){if(y.start){let w=Date.now()-y.start;y.start=t.now()-w}this.set(g,y.value,y)}}set(h,g,y={}){if(g===void 0)return this.delete(h),this;let{ttl:w=this.ttl,start:b,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:T=this.sizeCalculation,status:v}=y,{noUpdateTTL:A=this.noUpdateTTL}=y,S=this.#U(h,g,y.size||0,T);if(this.maxEntrySize&&S>this.maxEntrySize)return v&&(v.set="miss",v.maxEntrySizeExceeded=!0),this.#A(h,"set"),this;let R=this.#i===0?void 0:this.#n.get(h);if(R===void 0)R=this.#i===0?this.#o:this.#y.length!==0?this.#y.pop():this.#i===this.#l?this.#C(!1):this.#i,this.#r[R]=h,this.#e[R]=g,this.#n.set(h,R),this.#u[this.#o]=R,this.#h[R]=this.#o,this.#o=R,this.#i++,this.#P(R,S,v),v&&(v.set="add"),A=!1;else{this.#N(R);let P=this.#e[R];if(g!==P){if(this.#I&&this.#t(P)){P.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:L}=P;L!==void 0&&!E&&(this.#E&&this.#g?.(L,h,"set"),this.#c&&this.#s?.push([L,h,"set"]))}else E||(this.#E&&this.#g?.(P,h,"set"),this.#c&&this.#s?.push([P,h,"set"]));if(this.#O(R),this.#P(R,S,v),this.#e[R]=g,v){v.set="replace";let L=P&&this.#t(P)?P.__staleWhileFetching:P;L!==void 0&&(v.oldValue=L)}}else v&&(v.set="update")}if(w!==0&&!this.#d&&this.#D(),this.#d&&(A||this.#k(R,w,b),v&&this.#T(v,R)),!E&&this.#c&&this.#s){let P=this.#s,L;for(;L=P?.shift();)this.#b?.(...L)}return this}pop(){try{for(;this.#i;){let h=this.#e[this.#a];if(this.#C(!0),this.#t(h)){if(h.__staleWhileFetching)return h.__staleWhileFetching}else if(h!==void 0)return h}}finally{if(this.#c&&this.#s){let h=this.#s,g;for(;g=h?.shift();)this.#b?.(...g)}}}#C(h){let g=this.#a,y=this.#r[g],w=this.#e[g];return this.#I&&this.#t(w)?w.__abortController.abort(new Error("evicted")):(this.#E||this.#c)&&(this.#E&&this.#g?.(w,y,"evict"),this.#c&&this.#s?.push([w,y,"evict"])),this.#O(g),h&&(this.#r[g]=void 0,this.#e[g]=void 0,this.#y.push(g)),this.#i===1?(this.#a=this.#o=0,this.#y.length=0):this.#a=this.#u[g],this.#n.delete(y),this.#i--,g}has(h,g={}){let{updateAgeOnHas:y=this.updateAgeOnHas,status:w}=g,b=this.#n.get(h);if(b!==void 0){let E=this.#e[b];if(this.#t(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#p(b))w&&(w.has="stale",this.#T(w,b));else return y&&this.#R(b),w&&(w.has="hit",this.#T(w,b)),!0}else w&&(w.has="miss");return!1}peek(h,g={}){let{allowStale:y=this.allowStale}=g,w=this.#n.get(h);if(w===void 0||!y&&this.#p(w))return;let b=this.#e[w];return this.#t(b)?b.__staleWhileFetching:b}#x(h,g,y,w){let b=g===void 0?void 0:this.#e[g];if(this.#t(b))return b;let E=new n,{signal:T}=y;T?.addEventListener("abort",()=>E.abort(T.reason),{signal:E.signal});let v={signal:E.signal,options:y,context:w},A=(O,G=!1)=>{let{aborted:F}=E.signal,k=y.ignoreFetchAbort&&O!==void 0;if(y.status&&(F&&!G?(y.status.fetchAborted=!0,y.status.fetchError=E.signal.reason,k&&(y.status.fetchAbortIgnored=!0)):y.status.fetchResolved=!0),F&&!k&&!G)return R(E.signal.reason);let ae=L;return this.#e[g]===L&&(O===void 0?ae.__staleWhileFetching?this.#e[g]=ae.__staleWhileFetching:this.#A(h,"fetch"):(y.status&&(y.status.fetchUpdated=!0),this.set(h,O,v.options))),O},S=O=>(y.status&&(y.status.fetchRejected=!0,y.status.fetchError=O),R(O)),R=O=>{let{aborted:G}=E.signal,F=G&&y.allowStaleOnFetchAbort,k=F||y.allowStaleOnFetchRejection,ae=k||y.noDeleteOnFetchRejection,X=L;if(this.#e[g]===L&&(!ae||X.__staleWhileFetching===void 0?this.#A(h,"fetch"):F||(this.#e[g]=X.__staleWhileFetching)),k)return y.status&&X.__staleWhileFetching!==void 0&&(y.status.returnedStale=!0),X.__staleWhileFetching;if(X.__returned===X)throw O},P=(O,G)=>{let F=this.#L?.(h,b,v);F&&F instanceof Promise&&F.then(k=>O(k===void 0?void 0:k),G),E.signal.addEventListener("abort",()=>{(!y.ignoreFetchAbort||y.allowStaleOnFetchAbort)&&(O(void 0),y.allowStaleOnFetchAbort&&(O=k=>A(k,!0)))})};y.status&&(y.status.fetchDispatched=!0);let L=new Promise(P).then(A,S),B=Object.assign(L,{__abortController:E,__staleWhileFetching:b,__returned:void 0});return g===void 0?(this.set(h,B,{...v.options,status:void 0}),g=this.#n.get(h)):this.#e[g]=B,B}#t(h){if(!this.#I)return!1;let g=h;return!!g&&g instanceof Promise&&g.hasOwnProperty("__staleWhileFetching")&&g.__abortController instanceof n}async fetch(h,g={}){let{allowStale:y=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:T=this.noDisposeOnSet,size:v=0,sizeCalculation:A=this.sizeCalculation,noUpdateTTL:S=this.noUpdateTTL,noDeleteOnFetchRejection:R=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:P=this.allowStaleOnFetchRejection,ignoreFetchAbort:L=this.ignoreFetchAbort,allowStaleOnFetchAbort:B=this.allowStaleOnFetchAbort,context:O,forceRefresh:G=!1,status:F,signal:k}=g;if(!this.#I)return F&&(F.fetch="get"),this.get(h,{allowStale:y,updateAgeOnGet:w,noDeleteOnStaleGet:b,status:F});let ae={allowStale:y,updateAgeOnGet:w,noDeleteOnStaleGet:b,ttl:E,noDisposeOnSet:T,size:v,sizeCalculation:A,noUpdateTTL:S,noDeleteOnFetchRejection:R,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:B,ignoreFetchAbort:L,status:F,signal:k},X=this.#n.get(h);if(X===void 0){F&&(F.fetch="miss");let q=this.#x(h,X,ae,O);return q.__returned=q}else{let q=this.#e[X];if(this.#t(q)){let M=y&&q.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",M&&(F.returnedStale=!0)),M?q.__staleWhileFetching:q.__returned=q}let re=this.#p(X);if(!G&&!re)return F&&(F.fetch="hit"),this.#N(X),w&&this.#R(X),F&&this.#T(F,X),q;let j=this.#x(h,X,ae,O),Z=j.__staleWhileFetching!==void 0&&y;return F&&(F.fetch=re?"stale":"refresh",Z&&re&&(F.returnedStale=!0)),Z?j.__staleWhileFetching:j.__returned=j}}async forceFetch(h,g={}){let y=await this.fetch(h,g);if(y===void 0)throw new Error("fetch() returned undefined");return y}memo(h,g={}){let y=this.#M;if(!y)throw new Error("no memoMethod provided to constructor");let{context:w,forceRefresh:b,...E}=g,T=this.get(h,E);if(!b&&T!==void 0)return T;let v=y(h,T,{options:E,context:w});return this.set(h,v,E),v}get(h,g={}){let{allowStale:y=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,status:E}=g,T=this.#n.get(h);if(T!==void 0){let v=this.#e[T],A=this.#t(v);return E&&this.#T(E,T),this.#p(T)?(E&&(E.get="stale"),A?(E&&y&&v.__staleWhileFetching!==void 0&&(E.returnedStale=!0),y?v.__staleWhileFetching:void 0):(b||this.#A(h,"expire"),E&&y&&(E.returnedStale=!0),y?v:void 0)):(E&&(E.get="hit"),A?v.__staleWhileFetching:(this.#N(T),w&&this.#R(T),v))}else E&&(E.get="miss")}#F(h,g){this.#h[g]=h,this.#u[h]=g}#N(h){h!==this.#o&&(h===this.#a?this.#a=this.#u[h]:this.#F(this.#h[h],this.#u[h]),this.#F(this.#o,h),this.#o=h)}delete(h){return this.#A(h,"delete")}#A(h,g){let y=!1;if(this.#i!==0){let w=this.#n.get(h);if(w!==void 0)if(y=!0,this.#i===1)this.#j(g);else{this.#O(w);let b=this.#e[w];if(this.#t(b)?b.__abortController.abort(new Error("deleted")):(this.#E||this.#c)&&(this.#E&&this.#g?.(b,h,g),this.#c&&this.#s?.push([b,h,g])),this.#n.delete(h),this.#r[w]=void 0,this.#e[w]=void 0,w===this.#o)this.#o=this.#h[w];else if(w===this.#a)this.#a=this.#u[w];else{let E=this.#h[w];this.#u[E]=this.#u[w];let T=this.#u[w];this.#h[T]=this.#h[w]}this.#i--,this.#y.push(w)}}if(this.#c&&this.#s?.length){let w=this.#s,b;for(;b=w?.shift();)this.#b?.(...b)}return y}clear(){return this.#j("delete")}#j(h){for(let g of this.#S({allowStale:!0})){let y=this.#e[g];if(this.#t(y))y.__abortController.abort(new Error("deleted"));else{let w=this.#r[g];this.#E&&this.#g?.(y,w,h),this.#c&&this.#s?.push([y,w,h])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#_&&(this.#d.fill(0),this.#_.fill(0)),this.#v&&this.#v.fill(0),this.#a=0,this.#o=0,this.#y.length=0,this.#m=0,this.#i=0,this.#c&&this.#s){let g=this.#s,y;for(;y=g?.shift();)this.#b?.(...y)}}};e.LRUCache=p}),Pt=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var t=class{constructor(u=0){this.iteratorType=u}equals(u){return this.o===u.o}};e.ContainerIterator=t;var r=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=r;var o=class extends r{};e.Container=o}),Vy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pt(),r=class extends t.Base{constructor(u=[]){super(),this.S=[];let n=this;u.forEach(function(i){n.push(i)})}clear(){this.i=0,this.S=[]}push(u){return this.S.push(u),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},o=r;e.default=o}),$y=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pt(),r=class extends t.Base{constructor(u=[]){super(),this.j=0,this.q=[];let n=this;u.forEach(function(i){n.push(i)})}clear(){this.q=[],this.i=this.j=0}push(u){let n=this.q.length;if(this.j/n>.5&&this.j+this.i>=n&&n>4096){let i=this.i;for(let s=0;s<i;++s)this.q[s]=this.q[this.j+s];this.j=0,this.q[this.i]=u}else this.q[this.j+this.i]=u;return++this.i}pop(){if(this.i===0)return;let u=this.q[this.j++];return this.i-=1,u}front(){if(this.i!==0)return this.q[this.j]}},o=r;e.default=o}),qy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pt(),r=class extends t.Base{constructor(u=[],n=function(s,a){return s>a?-1:s<a?1:0},i=!0){if(super(),this.v=n,Array.isArray(u))this.C=i?[...u]:u;else{this.C=[];let a=this;u.forEach(function(l){a.C.push(l)})}this.i=this.C.length;let s=this.i>>1;for(let a=this.i-1>>1;a>=0;--a)this.k(a,s)}m(u){let n=this.C[u];for(;u>0;){let i=u-1>>1,s=this.C[i];if(this.v(s,n)<=0)break;this.C[u]=s,u=i}this.C[u]=n}k(u,n){let i=this.C[u];for(;u<n;){let s=u<<1|1,a=s+1,l=this.C[s];if(a<this.i&&this.v(l,this.C[a])>0&&(s=a,l=this.C[a]),this.v(l,i)>=0)break;this.C[u]=l,u=s}this.C[u]=i}clear(){this.i=0,this.C.length=0}push(u){this.C.push(u),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let u=this.C[0],n=this.C.pop();return this.i-=1,this.i&&(this.C[0]=n,this.k(0,this.i>>1)),u}top(){return this.C[0]}find(u){return this.C.indexOf(u)>=0}remove(u){let n=this.C.indexOf(u);return n<0?!1:(n===0?this.pop():n===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(n,1,this.C.pop()),this.i-=1,this.m(n),this.k(n,this.i>>1)),!0)}updateItem(u){let n=this.C.indexOf(u);return n<0?!1:(this.m(n),this.k(n,this.i>>1),!0)}toArray(){return[...this.C]}},o=r;e.default=o}),Ts=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pt(),r=class extends t.Container{},o=r;e.default=o}),Ct=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=t;function t(){throw new RangeError("Iterator access denied!")}}),bh=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=Pt(),r=Ct(),o=class extends t.ContainerIterator{constructor(u,n){super(n),this.o=u,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(u){this.container.setElementByPos(this.o,u)}};e.RandomIterator=o}),Yy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=o(Ts()),r=bh();function o(s){return s&&s.t?s:{default:s}}var u=class mh extends r.RandomIterator{constructor(a,l,c){super(a,c),this.container=l}copy(){return new mh(this.o,this.container,this.iteratorType)}},n=class extends t.default{constructor(s=[],a=!0){if(super(),Array.isArray(s))this.J=a?[...s]:s,this.i=s.length;else{this.J=[];let l=this;s.forEach(function(c){l.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J[s]}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;return this.J.splice(s,1),this.i-=1,this.i}eraseElementByValue(s){let a=0;for(let l=0;l<this.i;++l)this.J[l]!==s&&(this.J[a++]=this.J[l]);return this.i=this.J.length=a,this.i}eraseElementByIterator(s){let a=s.o;return s=s.next(),this.eraseElementByPos(a),s}pushBack(s){return this.J.push(s),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(s,a){if(s<0||s>this.i-1)throw new RangeError;this.J[s]=a}insert(s,a,l=1){if(s<0||s>this.i)throw new RangeError;return this.J.splice(s,0,...new Array(l).fill(a)),this.i+=l,this.i}find(s){for(let a=0;a<this.i;++a)if(this.J[a]===s)return new u(a,this);return this.end()}reverse(){this.J.reverse()}unique(){let s=1;for(let a=1;a<this.i;++a)this.J[a]!==this.J[a-1]&&(this.J[s++]=this.J[a]);return this.i=this.J.length=s,this.i}sort(s){this.J.sort(s)}forEach(s){for(let a=0;a<this.i;++a)s(this.J[a],a,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},i=n;e.default=i}),Ky=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=u(Ts()),r=Pt(),o=Ct();function u(a){return a&&a.t?a:{default:a}}var n=class yh extends r.ContainerIterator{constructor(l,c,f,p){super(p),this.o=l,this.h=c,this.container=f,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.l}set pointer(l){this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.l=l}copy(){return new yh(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(a=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let l=this;a.forEach(function(c){l.pushBack(c)})}V(a){let{L:l,B:c}=a;l.B=c,c.L=l,a===this.p&&(this.p=c),a===this._&&(this._=l),this.i-=1}G(a,l){let c=l.B,f={l:a,L:l,B:c};l.B=f,c.L=f,l===this.h&&(this.p=f),c===this.h&&(this._=f),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let l=this.p;for(;a--;)l=l.B;return l.l}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let l=this.p;for(;a--;)l=l.B;return this.V(l),this.i}eraseElementByValue(a){let l=this.p;for(;l!==this.h;)l.l===a&&this.V(l),l=l.B;return this.i}eraseElementByIterator(a){let l=a.o;return l===this.h&&(0,o.throwIteratorAccessError)(),a=a.next(),this.V(l),a}pushBack(a){return this.G(a,this._),this.i}popBack(){if(this.i===0)return;let a=this._.l;return this.V(this._),a}pushFront(a){return this.G(a,this.h),this.i}popFront(){if(this.i===0)return;let a=this.p.l;return this.V(this.p),a}setElementByPos(a,l){if(a<0||a>this.i-1)throw new RangeError;let c=this.p;for(;a--;)c=c.B;c.l=l}insert(a,l,c=1){if(a<0||a>this.i)throw new RangeError;if(c<=0)return this.i;if(a===0)for(;c--;)this.pushFront(l);else if(a===this.i)for(;c--;)this.pushBack(l);else{let f=this.p;for(let m=1;m<a;++m)f=f.B;let p=f.B;for(this.i+=c;c--;)f.B={l,L:f},f.B.L=f,f=f.B;f.B=p,p.L=f}return this.i}find(a){let l=this.p;for(;l!==this.h;){if(l.l===a)return new n(l,this.h,this);l=l.B}return this.end()}reverse(){if(this.i<=1)return;let a=this.p,l=this._,c=0;for(;c<<1<this.i;){let f=a.l;a.l=l.l,l.l=f,a=a.B,l=l.L,c+=1}}unique(){if(this.i<=1)return this.i;let a=this.p;for(;a!==this.h;){let l=a;for(;l.B!==this.h&&l.l===l.B.l;)l=l.B,this.i-=1;a.B=l.B,a.B.L=a,a=a.B}return this.i}sort(a){if(this.i<=1)return;let l=[];this.forEach(function(f){l.push(f)}),l.sort(a);let c=this.p;l.forEach(function(f){c.l=f,c=c.B})}merge(a){let l=this;if(this.i===0)a.forEach(function(c){l.pushBack(c)});else{let c=this.p;a.forEach(function(f){for(;c!==l.h&&c.l<=f;)c=c.B;l.G(f,c.L)})}return this.i}forEach(a){let l=this.p,c=0;for(;l!==this.h;)a(l.l,c++,this),l=l.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let a=this.p;for(;a!==this.h;)yield a.l,a=a.B}).bind(this)()}},s=i;e.default=s}),Xy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=o(Ts()),r=bh();function o(s){return s&&s.t?s:{default:s}}var u=class vh extends r.RandomIterator{constructor(a,l,c){super(a,c),this.container=l}copy(){return new vh(this.o,this.container,this.iteratorType)}},n=class extends t.default{constructor(s=[],a=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let l=(()=>{if(typeof s.length=="number")return s.length;if(typeof s.size=="number")return s.size;if(typeof s.size=="function")return s.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=a,this.P=Math.max(Math.ceil(l/this.F),1);for(let p=0;p<this.P;++p)this.A.push(new Array(this.F));let c=Math.ceil(l/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-l%this.F>>1;let f=this;s.forEach(function(p){f.pushBack(p)})}T(){let s=[],a=Math.max(this.P>>1,1);for(let l=0;l<a;++l)s[l]=new Array(this.F);for(let l=this.j;l<this.P;++l)s[s.length]=this.A[l];for(let l=0;l<this.R;++l)s[s.length]=this.A[l];s[s.length]=[...this.A[this.R]],this.j=a,this.R=s.length-1;for(let l=0;l<a;++l)s[s.length]=new Array(this.F);this.A=s,this.P=s.length}O(s){let a=this.D+s+1,l=a%this.F,c=l-1,f=this.j+(a-l)/this.F;return l===0&&(f-=1),f%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:f,curNodePointerIndex:c}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(s){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=s,this.i}popBack(){if(this.i===0)return;let s=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,s}pushFront(s){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=s,this.i}popFront(){if(this.i===0)return;let s=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,s}getElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:a,curNodePointerIndex:l}=this.O(s);return this.A[a][l]}setElementByPos(s,a){if(s<0||s>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:c}=this.O(s);this.A[l][c]=a}insert(s,a,l=1){if(s<0||s>this.i)throw new RangeError;if(s===0)for(;l--;)this.pushFront(a);else if(s===this.i)for(;l--;)this.pushBack(a);else{let c=[];for(let f=s;f<this.i;++f)c.push(this.getElementByPos(f));this.cut(s-1);for(let f=0;f<l;++f)this.pushBack(a);for(let f=0;f<c.length;++f)this.pushBack(c[f])}return this.i}cut(s){if(s<0)return this.clear(),0;let{curNodeBucketIndex:a,curNodePointerIndex:l}=this.O(s);return this.R=a,this.N=l,this.i=s+1,this.i}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;if(s===0)this.popFront();else if(s===this.i-1)this.popBack();else{let a=[];for(let c=s+1;c<this.i;++c)a.push(this.getElementByPos(c));this.cut(s),this.popBack();let l=this;a.forEach(function(c){l.pushBack(c)})}return this.i}eraseElementByValue(s){if(this.i===0)return 0;let a=[];for(let c=0;c<this.i;++c){let f=this.getElementByPos(c);f!==s&&a.push(f)}let l=a.length;for(let c=0;c<l;++c)this.setElementByPos(c,a[c]);return this.cut(l-1)}eraseElementByIterator(s){let a=s.o;return this.eraseElementByPos(a),s=s.next(),s}find(s){for(let a=0;a<this.i;++a)if(this.getElementByPos(a)===s)return new u(a,this);return this.end()}reverse(){let s=0,a=this.i-1;for(;s<a;){let l=this.getElementByPos(s);this.setElementByPos(s,this.getElementByPos(a)),this.setElementByPos(a,l),s+=1,a-=1}}unique(){if(this.i<=1)return this.i;let s=1,a=this.getElementByPos(0);for(let l=1;l<this.i;++l){let c=this.getElementByPos(l);c!==a&&(a=c,this.setElementByPos(s++,c))}for(;this.i>s;)this.popBack();return this.i}sort(s){let a=[];for(let l=0;l<this.i;++l)a.push(this.getElementByPos(l));a.sort(s);for(let l=0;l<this.i;++l)this.setElementByPos(l,a[l])}shrinkToFit(){if(this.i===0)return;let s=[];this.forEach(function(a){s.push(a)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let a=0;a<this.P;++a)this.A.push(new Array(this.F));for(let a=0;a<s.length;++a)this.pushBack(s[a])}forEach(s){for(let a=0;a<this.i;++a)s(this.getElementByPos(a),a,this)}[Symbol.iterator](){return(function*(){for(let s=0;s<this.i;++s)yield this.getElementByPos(s)}).bind(this)()}},i=n;e.default=i}),zy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(o,u){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=o,this.l=u}L(){let o=this;if(o.ee===1&&o.tt.tt===o)o=o.W;else if(o.U)for(o=o.U;o.W;)o=o.W;else{let u=o.tt;for(;u.U===o;)o=u,u=o.tt;o=u}return o}B(){let o=this;if(o.W){for(o=o.W;o.U;)o=o.U;return o}else{let u=o.tt;for(;u.W===o;)o=u,u=o.tt;return o.W!==u?u:o}}te(){let o=this.tt,u=this.W,n=u.U;return o.tt===this?o.tt=u:o.U===this?o.U=u:o.W=u,u.tt=o,u.U=this,this.tt=u,this.W=n,n&&(n.tt=this),u}se(){let o=this.tt,u=this.U,n=u.W;return o.tt===this?o.tt=u:o.U===this?o.U=u:o.W=u,u.tt=o,u.W=this,this.tt=u,this.U=n,n&&(n.tt=this),u}};e.TreeNode=t;var r=class extends t{constructor(){super(...arguments),this.rt=1}te(){let o=super.te();return this.ie(),o.ie(),o}se(){let o=super.se();return this.ie(),o.ie(),o}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=r}),_h=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=zy(),r=Pt(),o=Ct(),u=class extends r.Container{constructor(i=function(a,l){return a<l?-1:a>l?1:0},s=!1){super(),this.Y=void 0,this.v=i,s?(this.re=t.TreeNodeEnableIndex,this.M=function(a,l,c){let f=this.ne(a,l,c);if(f){let p=f.tt;for(;p!==this.h;)p.rt+=1,p=p.tt;let m=this.he(f);if(m){let{parentNode:h,grandParent:g,curNode:y}=m;h.ie(),g.ie(),y.ie()}}return this.i},this.V=function(a){let l=this.fe(a);for(;l!==this.h;)l.rt-=1,l=l.tt}):(this.re=t.TreeNode,this.M=function(a,l,c){let f=this.ne(a,l,c);return f&&this.he(f),this.i},this.V=this.fe),this.h=new this.re}X(i,s){let a=this.h;for(;i;){let l=this.v(i.u,s);if(l<0)i=i.W;else if(l>0)a=i,i=i.U;else return i}return a}Z(i,s){let a=this.h;for(;i;)this.v(i.u,s)<=0?i=i.W:(a=i,i=i.U);return a}$(i,s){let a=this.h;for(;i;){let l=this.v(i.u,s);if(l<0)a=i,i=i.W;else if(l>0)i=i.U;else return i}return a}rr(i,s){let a=this.h;for(;i;)this.v(i.u,s)<0?(a=i,i=i.W):i=i.U;return a}ue(i){for(;;){let s=i.tt;if(s===this.h)return;if(i.ee===1){i.ee=0;return}if(i===s.U){let a=s.W;if(a.ee===1)a.ee=0,s.ee=1,s===this.Y?this.Y=s.te():s.te();else if(a.W&&a.W.ee===1){a.ee=s.ee,s.ee=0,a.W.ee=0,s===this.Y?this.Y=s.te():s.te();return}else a.U&&a.U.ee===1?(a.ee=1,a.U.ee=0,a.se()):(a.ee=1,i=s)}else{let a=s.U;if(a.ee===1)a.ee=0,s.ee=1,s===this.Y?this.Y=s.se():s.se();else if(a.U&&a.U.ee===1){a.ee=s.ee,s.ee=0,a.U.ee=0,s===this.Y?this.Y=s.se():s.se();return}else a.W&&a.W.ee===1?(a.ee=1,a.W.ee=0,a.te()):(a.ee=1,i=s)}}}fe(i){if(this.i===1)return this.clear(),this.h;let s=i;for(;s.U||s.W;){if(s.W)for(s=s.W;s.U;)s=s.U;else s=s.U;[i.u,s.u]=[s.u,i.u],[i.l,s.l]=[s.l,i.l],i=s}this.h.U===s?this.h.U=s.tt:this.h.W===s&&(this.h.W=s.tt),this.ue(s);let a=s.tt;return s===a.U?a.U=void 0:a.W=void 0,this.i-=1,this.Y.ee=0,a}oe(i,s){return i===void 0?!1:this.oe(i.U,s)||s(i)?!0:this.oe(i.W,s)}he(i){for(;;){let s=i.tt;if(s.ee===0)return;let a=s.tt;if(s===a.U){let l=a.W;if(l&&l.ee===1){if(l.ee=s.ee=0,a===this.Y)return;a.ee=1,i=a;continue}else if(i===s.W){if(i.ee=0,i.U&&(i.U.tt=s),i.W&&(i.W.tt=a),s.W=i.U,a.U=i.W,i.U=s,i.W=a,a===this.Y)this.Y=i,this.h.tt=i;else{let c=a.tt;c.U===a?c.U=i:c.W=i}return i.tt=a.tt,s.tt=i,a.tt=i,a.ee=1,{parentNode:s,grandParent:a,curNode:i}}else s.ee=0,a===this.Y?this.Y=a.se():a.se(),a.ee=1}else{let l=a.U;if(l&&l.ee===1){if(l.ee=s.ee=0,a===this.Y)return;a.ee=1,i=a;continue}else if(i===s.U){if(i.ee=0,i.U&&(i.U.tt=a),i.W&&(i.W.tt=s),a.W=i.U,s.U=i.W,i.U=a,i.W=s,a===this.Y)this.Y=i,this.h.tt=i;else{let c=a.tt;c.U===a?c.U=i:c.W=i}return i.tt=a.tt,s.tt=i,a.tt=i,a.ee=1,{parentNode:s,grandParent:a,curNode:i}}else s.ee=0,a===this.Y?this.Y=a.te():a.te(),a.ee=1}return}}ne(i,s,a){if(this.Y===void 0){this.i+=1,this.Y=new this.re(i,s),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let l,c=this.h.U,f=this.v(c.u,i);if(f===0){c.l=s;return}else if(f>0)c.U=new this.re(i,s),c.U.tt=c,l=c.U,this.h.U=l;else{let p=this.h.W,m=this.v(p.u,i);if(m===0){p.l=s;return}else if(m<0)p.W=new this.re(i,s),p.W.tt=p,l=p.W,this.h.W=l;else{if(a!==void 0){let h=a.o;if(h!==this.h){let g=this.v(h.u,i);if(g===0){h.l=s;return}else if(g>0){let y=h.L(),w=this.v(y.u,i);if(w===0){y.l=s;return}else w<0&&(l=new this.re(i,s),y.W===void 0?(y.W=l,l.tt=y):(h.U=l,l.tt=h))}}}if(l===void 0)for(l=this.Y;;){let h=this.v(l.u,i);if(h>0){if(l.U===void 0){l.U=new this.re(i,s),l.U.tt=l,l=l.U;break}l=l.U}else if(h<0){if(l.W===void 0){l.W=new this.re(i,s),l.W.tt=l,l=l.W;break}l=l.W}else{l.l=s;return}}}}return this.i+=1,l}I(i,s){for(;i;){let a=this.v(i.u,s);if(a<0)i=i.W;else if(a>0)i=i.U;else return i}return i||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(i,s){let a=i.o;if(a===this.h&&(0,o.throwIteratorAccessError)(),this.i===1)return a.u=s,!0;if(a===this.h.U)return this.v(a.B().u,s)>0?(a.u=s,!0):!1;if(a===this.h.W)return this.v(a.L().u,s)<0?(a.u=s,!0):!1;let l=a.L().u;if(this.v(l,s)>=0)return!1;let c=a.B().u;return this.v(c,s)<=0?!1:(a.u=s,!0)}eraseElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let s=0,a=this;return this.oe(this.Y,function(l){return i===s?(a.V(l),!0):(s+=1,!1)}),this.i}eraseElementByKey(i){if(this.i===0)return!1;let s=this.I(this.Y,i);return s===this.h?!1:(this.V(s),!0)}eraseElementByIterator(i){let s=i.o;s===this.h&&(0,o.throwIteratorAccessError)();let a=s.W===void 0;return i.iteratorType===0?a&&i.next():(!a||s.U===void 0)&&i.next(),this.V(s),i}forEach(i){let s=0;for(let a of this)i(a,s++,this)}getElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let s,a=0;for(let l of this){if(a===i){s=l;break}a+=1}return s}getHeight(){if(this.i===0)return 0;let i=function(s){return s?Math.max(i(s.U),i(s.W))+1:0};return i(this.Y)}},n=u;e.default=n}),Eh=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pt(),r=Ct(),o=class extends t.ContainerIterator{constructor(n,i,s){super(s),this.o=n,this.h=i,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let n=this.o,i=this.h.tt;if(n===this.h)return i?i.rt-1:0;let s=0;for(n.U&&(s+=n.U.rt);n!==i;){let a=n.tt;n===a.W&&(s+=1,a.U&&(s+=a.U.rt)),n=a}return s}},u=o;e.default=u}),Qy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=u(_h()),r=u(Eh()),o=Ct();function u(a){return a&&a.t?a:{default:a}}var n=class wh extends r.default{constructor(l,c,f,p){super(l,c,p),this.container=f}get pointer(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o.u}copy(){return new wh(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(a=[],l,c){super(l,c);let f=this;a.forEach(function(p){f.insert(p)})}*K(a){a!==void 0&&(yield*this.K(a.U),yield a.u,yield*this.K(a.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(a,l){return this.M(a,void 0,l)}find(a){let l=this.I(this.Y,a);return new n(l,this.h,this)}lowerBound(a){let l=this.X(this.Y,a);return new n(l,this.h,this)}upperBound(a){let l=this.Z(this.Y,a);return new n(l,this.h,this)}reverseLowerBound(a){let l=this.$(this.Y,a);return new n(l,this.h,this)}reverseUpperBound(a){let l=this.rr(this.Y,a);return new n(l,this.h,this)}union(a){let l=this;return a.forEach(function(c){l.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=i;e.default=s}),Jy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=u(_h()),r=u(Eh()),o=Ct();function u(a){return a&&a.t?a:{default:a}}var n=class Sh extends r.default{constructor(l,c,f,p){super(l,c,p),this.container=f}get pointer(){this.o===this.h&&(0,o.throwIteratorAccessError)();let l=this;return new Proxy([],{get(c,f){if(f==="0")return l.o.u;if(f==="1")return l.o.l},set(c,f,p){if(f!=="1")throw new TypeError("props must be 1");return l.o.l=p,!0}})}copy(){return new Sh(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(a=[],l,c){super(l,c);let f=this;a.forEach(function(p){f.setElement(p[0],p[1])})}*K(a){a!==void 0&&(yield*this.K(a.U),yield[a.u,a.l],yield*this.K(a.W))}begin(){return new n(this.h.U||this.h,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this.h.W||this.h,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){if(this.i===0)return;let a=this.h.U;return[a.u,a.l]}back(){if(this.i===0)return;let a=this.h.W;return[a.u,a.l]}lowerBound(a){let l=this.X(this.Y,a);return new n(l,this.h,this)}upperBound(a){let l=this.Z(this.Y,a);return new n(l,this.h,this)}reverseLowerBound(a){let l=this.$(this.Y,a);return new n(l,this.h,this)}reverseUpperBound(a){let l=this.rr(this.Y,a);return new n(l,this.h,this)}setElement(a,l,c){return this.M(a,l,c)}find(a){let l=this.I(this.Y,a);return new n(l,this.h,this)}getElementByKey(a){return this.I(this.Y,a).l}union(a){let l=this;return a.forEach(function(c){l.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},s=i;e.default=s}),Ah=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=t;function t(r){let o=typeof r;return o==="object"&&r!==null||o==="function"}}),Th=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t=Pt(),r=u(Ah()),o=Ct();function u(s){return s&&s.t?s:{default:s}}var n=class extends t.ContainerIterator{constructor(s,a,l){super(l),this.o=s,this.h=a,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,o.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=n;var i=class extends t.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(s){let{L:a,B:l}=s;a.B=l,l.L=a,s===this.p&&(this.p=l),s===this._&&(this._=a),this.i-=1}M(s,a,l){l===void 0&&(l=(0,r.default)(s));let c;if(l){let f=s[this.HASH_TAG];if(f!==void 0)return this.H[f].l=a,this.i;Object.defineProperty(s,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:s,l:a,L:this._,B:this.h},this.H.push(c)}else{let f=this.g[s];if(f)return f.l=a,this.i;c={u:s,l:a,L:this._,B:this.h},this.g[s]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(s,a){if(a===void 0&&(a=(0,r.default)(s)),a){let l=s[this.HASH_TAG];return l===void 0?this.h:this.H[l]}else return this.g[s]||this.h}clear(){let s=this.HASH_TAG;this.H.forEach(function(a){delete a.u[s]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(s,a){let l;if(a===void 0&&(a=(0,r.default)(s)),a){let c=s[this.HASH_TAG];if(c===void 0)return!1;delete s[this.HASH_TAG],l=this.H[c],delete this.H[c]}else{if(l=this.g[s],l===void 0)return!1;delete this.g[s]}return this.V(l),!0}eraseElementByIterator(s){let a=s.o;return a===this.h&&(0,o.throwIteratorAccessError)(),this.V(a),s.next()}eraseElementByPos(s){if(s<0||s>this.i-1)throw new RangeError;let a=this.p;for(;s--;)a=a.B;return this.V(a),this.i}};e.HashContainer=i}),Zy=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Th(),r=Ct(),o=class Ih extends t.HashContainerIterator{constructor(s,a,l,c){super(s,a,c),this.container=l}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new Ih(this.o,this.h,this.container,this.iteratorType)}},u=class extends t.HashContainer{constructor(i=[]){super();let s=this;i.forEach(function(a){s.insert(a)})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(i,s){return this.M(i,void 0,s)}getElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let s=this.p;for(;i--;)s=s.B;return s.u}find(i,s){let a=this.I(i,s);return new o(a,this.h,this)}forEach(i){let s=0,a=this.p;for(;a!==this.h;)i(a.u,s++,this),a=a.B}[Symbol.iterator](){return(function*(){let i=this.p;for(;i!==this.h;)yield i.u,i=i.B}).bind(this)()}},n=u;e.default=n}),e0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Th(),r=u(Ah()),o=Ct();function u(a){return a&&a.t?a:{default:a}}var n=class Rh extends t.HashContainerIterator{constructor(l,c,f,p){super(l,c,p),this.container=f}get pointer(){this.o===this.h&&(0,o.throwIteratorAccessError)();let l=this;return new Proxy([],{get(c,f){if(f==="0")return l.o.u;if(f==="1")return l.o.l},set(c,f,p){if(f!=="1")throw new TypeError("props must be 1");return l.o.l=p,!0}})}copy(){return new Rh(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(a=[]){super();let l=this;a.forEach(function(c){l.setElement(c[0],c[1])})}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(a,l,c){return this.M(a,l,c)}getElementByKey(a,l){if(l===void 0&&(l=(0,r.default)(a)),l){let f=a[this.HASH_TAG];return f!==void 0?this.H[f].l:void 0}let c=this.g[a];return c?c.l:void 0}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let l=this.p;for(;a--;)l=l.B;return[l.u,l.l]}find(a,l){let c=this.I(a,l);return new n(c,this.h,this)}forEach(a){let l=0,c=this.p;for(;c!==this.h;)a([c.u,c.l],l++,this),c=c.B}[Symbol.iterator](){return(function*(){let a=this.p;for(;a!==this.h;)yield[a.u,a.l],a=a.B}).bind(this)()}},s=i;e.default=s}),t0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return u.default}});var t=f(Vy()),r=f($y()),o=f(qy()),u=f(Yy()),n=f(Ky()),i=f(Xy()),s=f(Qy()),a=f(Jy()),l=f(Zy()),c=f(e0());function f(p){return p&&p.t?p:{default:p}}}),r0=pe((e,t)=>{le(),ce(),ue();var r=t0().OrderedSet,o=Lt()("number-allocator:trace"),u=Lt()("number-allocator:error");function n(s,a){this.low=s,this.high=a}n.prototype.equals=function(s){return this.low===s.low&&this.high===s.high},n.prototype.compare=function(s){return this.low<s.low&&this.high<s.low?-1:s.low<this.low&&s.high<this.low?1:0};function i(s,a){if(!(this instanceof i))return new i(s,a);this.min=s,this.max=a,this.ss=new r([],(l,c)=>l.compare(c)),o("Create"),this.clear()}i.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},i.prototype.alloc=function(){if(this.ss.size()===0)return o("alloc():empty"),null;let s=this.ss.begin(),a=s.pointer.low,l=s.pointer.high,c=a;return c+1<=l?this.ss.updateKeyByIterator(s,new n(a+1,l)):this.ss.eraseElementByPos(0),o("alloc():"+c),c},i.prototype.use=function(s){let a=new n(s,s),l=this.ss.lowerBound(a);if(!l.equals(this.ss.end())){let c=l.pointer.low,f=l.pointer.high;return l.pointer.equals(a)?(this.ss.eraseElementByIterator(l),o("use():"+s),!0):c>s?!1:c===s?(this.ss.updateKeyByIterator(l,new n(c+1,f)),o("use():"+s),!0):f===s?(this.ss.updateKeyByIterator(l,new n(c,f-1)),o("use():"+s),!0):(this.ss.updateKeyByIterator(l,new n(s+1,f)),this.ss.insert(new n(c,s-1)),o("use():"+s),!0)}return o("use():failed"),!1},i.prototype.free=function(s){if(s<this.min||s>this.max){u("free():"+s+" is out of range");return}let a=new n(s,s),l=this.ss.upperBound(a);if(l.equals(this.ss.end())){if(l.equals(this.ss.begin())){this.ss.insert(a);return}l.pre();let c=l.pointer.high;l.pointer.high+1===s?this.ss.updateKeyByIterator(l,new n(c,s)):this.ss.insert(a)}else if(l.equals(this.ss.begin()))if(s+1===l.pointer.low){let c=l.pointer.high;this.ss.updateKeyByIterator(l,new n(s,c))}else this.ss.insert(a);else{let c=l.pointer.low,f=l.pointer.high;l.pre();let p=l.pointer.low;l.pointer.high+1===s?s+1===c?(this.ss.eraseElementByIterator(l),this.ss.updateKeyByIterator(l,new n(p,f))):this.ss.updateKeyByIterator(l,new n(p,s)):s+1===c?(this.ss.eraseElementByIterator(l.next()),this.ss.insert(new n(s,f))):this.ss.insert(a)}o("free():"+s)},i.prototype.clear=function(){o("clear()"),this.ss.clear(),this.ss.insert(new n(this.min,this.max))},i.prototype.intervalCount=function(){return this.ss.size()},i.prototype.dump=function(){console.log("length:"+this.ss.size());for(let s of this.ss)console.log(s)},t.exports=i}),Oh=pe((e,t)=>{le(),ce(),ue();var r=r0();t.exports.NumberAllocator=r}),n0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=Hy(),r=Oh(),o=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(u){u>0&&(this.aliasToTopic=new t.LRUCache({max:u}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,u),this.max=u,this.length=0)}put(u,n){if(n===0||n>this.max)return!1;let i=this.aliasToTopic.get(n);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(n,u),this.topicToAlias[u]=n,this.numberAllocator.use(n),this.length=this.aliasToTopic.size,!0}getTopicByAlias(u){return this.aliasToTopic.get(u)}getAliasByTopic(u){let n=this.topicToAlias[u];return typeof n<"u"&&this.aliasToTopic.get(n),n}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};e.default=o}),i0=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0});var r=Mn(),o=t(n0()),u=mr(),n=(i,s)=>{i.log("_handleConnack");let{options:a}=i,l=a.protocolVersion===5?s.reasonCode:s.returnCode;if(clearTimeout(i.connackTimer),delete i.topicAliasSend,s.properties){if(s.properties.topicAliasMaximum){if(s.properties.topicAliasMaximum>65535){i.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}s.properties.topicAliasMaximum>0&&(i.topicAliasSend=new o.default(s.properties.topicAliasMaximum))}s.properties.serverKeepAlive&&a.keepalive&&(a.keepalive=s.properties.serverKeepAlive),s.properties.maximumPacketSize&&(a.properties||(a.properties={}),a.properties.maximumPacketSize=s.properties.maximumPacketSize)}if(l===0)i.reconnecting=!1,i._onConnect(s);else if(l>0){let c=new u.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[l]}`,l);i.emit("error",c),i.options.reconnectOnConnackError&&i._cleanUp(!0)}};e.default=n}),o0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=(r,o,u)=>{r.log("handling pubrel packet");let n=typeof u<"u"?u:r.noop,{messageId:i}=o,s={cmd:"pubcomp",messageId:i};r.incomingStore.get(o,(a,l)=>{a?r._sendPacket(s,n):(r.emit("message",l.topic,l.payload,l),r.handleMessage(l,c=>{if(c)return n(c);r.incomingStore.del(l,r.noop),r._sendPacket(s,n)}))})};e.default=t}),s0=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(jy()),o=t(Gy()),u=t(i0()),n=t(Mn()),i=t(o0()),s=(a,l,c)=>{let{options:f}=a;if(f.protocolVersion===5&&f.properties&&f.properties.maximumPacketSize&&f.properties.maximumPacketSize<l.length)return a.emit("error",new Error(`exceeding packets size ${l.cmd}`)),a.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),a;switch(a.log("_handlePacket :: emitting packetreceive"),a.emit("packetreceive",l),l.cmd){case"publish":(0,r.default)(a,l,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":a.reschedulePing(),(0,n.default)(a,l),c();break;case"pubrel":a.reschedulePing(),(0,i.default)(a,l,c);break;case"connack":(0,u.default)(a,l),c();break;case"auth":a.reschedulePing(),(0,o.default)(a,l),c();break;case"pingresp":a.log("_handlePacket :: received pingresp"),a.reschedulePing(!0),c();break;case"disconnect":a.emit("disconnect",l),c();break;default:a.log("_handlePacket :: unknown command"),c();break}};e.default=s}),Nh=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let r=this.nextId++;return this.nextId===65536&&(this.nextId=1),r}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(r){return!0}deallocate(r){}clear(){}};e.default=t}),a0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{aliasToTopic;max;length;constructor(r){this.aliasToTopic={},this.max=r}put(r,o){return o===0||o>this.max?!1:(this.aliasToTopic[o]=r,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(r){return this.aliasToTopic[r]}clear(){this.aliasToTopic={}}};e.default=t}),l0=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((rr(),ke(Gt))),o=mr(),u=class{};e.TypedEventEmitter=u,(0,o.applyMixin)(u,r.default)}),Pn=pe((e,t)=>{le(),ce(),ue();function r(o){"@babel/helpers - typeof";return t.exports=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},t.exports.__esModule=!0,t.exports.default=t.exports,r(o)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),u0=pe((e,t)=>{le(),ce(),ue();var r=Pn().default;function o(u,n){if(r(u)!="object"||!u)return u;var i=u[Symbol.toPrimitive];if(i!==void 0){var s=i.call(u,n||"default");if(r(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(u)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),c0=pe((e,t)=>{le(),ce(),ue();var r=Pn().default,o=u0();function u(n){var i=o(n,"string");return r(i)=="symbol"?i:i+""}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}),f0=pe((e,t)=>{le(),ce(),ue();var r=c0();function o(u,n,i){return(n=r(n))in u?Object.defineProperty(u,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):u[n]=i,u}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),h0=pe((e,t)=>{le(),ce(),ue();function r(o){if(Array.isArray(o))return o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),d0=pe((e,t)=>{le(),ce(),ue();function r(o,u){var n=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(n!=null){var i,s,a,l,c=[],f=!0,p=!1;try{if(a=(n=n.call(o)).next,u===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(i=a.call(n)).done)&&(c.push(i.value),c.length!==u);f=!0);}catch(m){p=!0,s=m}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(p)throw s}}return c}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),p0=pe((e,t)=>{le(),ce(),ue();function r(o,u){(u==null||u>o.length)&&(u=o.length);for(var n=0,i=Array(u);n<u;n++)i[n]=o[n];return i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),g0=pe((e,t)=>{le(),ce(),ue();var r=p0();function o(u,n){if(u){if(typeof u=="string")return r(u,n);var i={}.toString.call(u).slice(8,-1);return i==="Object"&&u.constructor&&(i=u.constructor.name),i==="Map"||i==="Set"?Array.from(u):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(u,n):void 0}}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),b0=pe((e,t)=>{le(),ce(),ue();function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
387
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),m0=pe((e,t)=>{le(),ce(),ue();var r=h0(),o=d0(),u=g0(),n=b0();function i(s,a){return r(s)||o(s,a)||u(s,a)||n()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),Lh=pe((e,t)=>{le(),ce(),ue(),(function(r,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.fastUniqueNumbers={}))})(e,function(r){var o=function(m){return function(h){var g=m(h);return h.add(g),g}},u=function(m){return function(h,g){return m.set(h,g),g}},n=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,s=i*2,a=function(m,h){return function(g){var y=h.get(g),w=y===void 0?g.size:y<s?y+1:0;if(!g.has(w))return m(g,w);if(g.size<i){for(;g.has(w);)w=Math.floor(Math.random()*s);return m(g,w)}if(g.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;g.has(w);)w=Math.floor(Math.random()*n);return m(g,w)}},l=new WeakMap,c=u(l),f=a(c,l),p=o(f);r.addUniqueNumber=p,r.generateUniqueNumber=f})}),y0=pe((e,t)=>{le(),ce(),ue();function r(u,n,i,s,a,l,c){try{var f=u[l](c),p=f.value}catch(m){return void i(m)}f.done?n(p):Promise.resolve(p).then(s,a)}function o(u){return function(){var n=this,i=arguments;return new Promise(function(s,a){var l=u.apply(n,i);function c(p){r(l,s,a,c,f,"next",p)}function f(p){r(l,s,a,c,f,"throw",p)}c(void 0)})}}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),Mh=pe((e,t)=>{le(),ce(),ue();function r(o,u){this.v=o,this.k=u}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),Ph=pe((e,t)=>{le(),ce(),ue();function r(o,u,n,i){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}t.exports=r=function(a,l,c,f){function p(m,h){r(a,m,function(g){return this._invoke(m,h,g)})}l?s?s(a,l,{value:c,enumerable:!f,configurable:!f,writable:!f}):a[l]=c:(p("next",0),p("throw",1),p("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(o,u,n,i)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),Ch=pe((e,t)=>{le(),ce(),ue();var r=Ph();function o(){var u,n,i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function l(w,b,E,T){var v=b&&b.prototype instanceof f?b:f,A=Object.create(v.prototype);return r(A,"_invoke",(function(S,R,P){var L,B,O,G=0,F=P||[],k=!1,ae={p:0,n:0,v:u,a:X,f:X.bind(u,4),d:function(q,re){return L=q,B=0,O=u,ae.n=re,c}};function X(q,re){for(B=q,O=re,n=0;!k&&G&&!j&&n<F.length;n++){var j,Z=F[n],M=ae.p,Q=Z[2];q>3?(j=Q===re)&&(O=Z[(B=Z[4])?5:(B=3,3)],Z[4]=Z[5]=u):Z[0]<=M&&((j=q<2&&M<Z[1])?(B=0,ae.v=re,ae.n=Z[1]):M<Q&&(j=q<3||Z[0]>re||re>Q)&&(Z[4]=q,Z[5]=re,ae.n=Q,B=0))}if(j||q>1)return c;throw k=!0,re}return function(q,re,j){if(G>1)throw TypeError("Generator is already running");for(k&&re===1&&X(re,j),B=re,O=j;(n=B<2?u:O)||!k;){L||(B?B<3?(B>1&&(ae.n=-1),X(B,O)):ae.n=O:ae.v=O);try{if(G=2,L){if(B||(q="next"),n=L[q]){if(!(n=n.call(L,O)))throw TypeError("iterator result is not an object");if(!n.done)return n;O=n.value,B<2&&(B=0)}else B===1&&(n=L.return)&&n.call(L),B<2&&(O=TypeError("The iterator does not provide a '"+q+"' method"),B=1);L=u}else if((n=(k=ae.n<0)?O:S.call(R,ae))!==c)break}catch(Z){L=u,B=1,O=Z}finally{G=1}}return{value:n,done:k}}})(w,E,T),!0),A}var c={};function f(){}function p(){}function m(){}n=Object.getPrototypeOf;var h=[][s]?n(n([][s]())):(r(n={},s,function(){return this}),n),g=m.prototype=f.prototype=Object.create(h);function y(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,m):(w.__proto__=m,r(w,a,"GeneratorFunction")),w.prototype=Object.create(g),w}return p.prototype=m,r(g,"constructor",m),r(m,"constructor",p),p.displayName="GeneratorFunction",r(m,a,"GeneratorFunction"),r(g),r(g,a,"Generator"),r(g,s,function(){return this}),r(g,"toString",function(){return"[object Generator]"}),(t.exports=o=function(){return{w:l,m:y}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),xh=pe((e,t)=>{le(),ce(),ue();var r=Mh(),o=Ph();function u(n,i){function s(l,c,f,p){try{var m=n[l](c),h=m.value;return h instanceof r?i.resolve(h.v).then(function(g){s("next",g,f,p)},function(g){s("throw",g,f,p)}):i.resolve(h).then(function(g){m.value=g,f(m)},function(g){return s("throw",g,f,p)})}catch(g){p(g)}}var a;this.next||(o(u.prototype),o(u.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(l,c,f){function p(){return new i(function(m,h){s(l,f,m,h)})}return a=a?a.then(p,p):p()},!0)}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}),Dh=pe((e,t)=>{le(),ce(),ue();var r=Ch(),o=xh();function u(n,i,s,a,l){return new o(r().w(n,i,s,a),l||Promise)}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports}),v0=pe((e,t)=>{le(),ce(),ue();var r=Dh();function o(u,n,i,s,a){var l=r(u,n,i,s,a);return l.next().then(function(c){return c.done?c.value:l.next()})}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),_0=pe((e,t)=>{le(),ce(),ue();function r(o){var u=Object(o),n=[];for(var i in u)n.unshift(i);return function s(){for(;n.length;)if((i=n.pop())in u)return s.value=i,s.done=!1,s;return s.done=!0,s}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),E0=pe((e,t)=>{le(),ce(),ue();var r=Pn().default;function o(u){if(u!=null){var n=u[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(n)return n.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length))return{next:function(){return u&&i>=u.length&&(u=void 0),{value:u&&u[i++],done:!u}}}}throw new TypeError(r(u)+" is not iterable")}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports}),w0=pe((e,t)=>{le(),ce(),ue();var r=Mh(),o=Ch(),u=v0(),n=Dh(),i=xh(),s=_0(),a=E0();function l(){var c=o(),f=c.m(l),p=(Object.getPrototypeOf?Object.getPrototypeOf(f):f.__proto__).constructor;function m(y){var w=typeof y=="function"&&y.constructor;return!!w&&(w===p||(w.displayName||w.name)==="GeneratorFunction")}var h={throw:1,return:2,break:3,continue:3};function g(y){var w,b;return function(E){w||(w={stop:function(){return b(E.a,2)},catch:function(){return E.v},abrupt:function(T,v){return b(E.a,h[T],v)},delegateYield:function(T,v,A){return w.resultName=v,b(E.d,a(T),A)},finish:function(T){return b(E.f,T)}},b=function(T,v,A){E.p=w.prev,E.n=w.next;try{return T(v,A)}finally{w.next=E.n}}),w.resultName&&(w[w.resultName]=E.v,w.resultName=void 0),w.sent=E.v,w.next=E.n;try{return y.call(this,w)}finally{E.p=w.prev,E.n=w.next}}}return(t.exports=l=function(){return{wrap:function(y,w,b,E){return c.w(g(y),w,b,E&&E.reverse())},isGeneratorFunction:m,mark:c.m,awrap:function(y,w){return new r(y,w)},AsyncIterator:i,async:function(y,w,b,E,T){return(m(w)?n:u)(g(y),w,b,E,T)},keys:s,values:a}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports}),S0=pe((e,t)=>{le(),ce(),ue();var r=w0()();t.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),A0=pe((e,t)=>{le(),ce(),ue(),(function(r,o){typeof e=="object"&&typeof t<"u"?o(e,f0(),m0(),Lh(),y0(),S0()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.brokerFactory={},r._defineProperty,r._slicedToArray,r.fastUniqueNumbers,r._asyncToGenerator,r._regeneratorRuntime))})(e,function(r,o,u,n,i,s){var a=function(b){return typeof b.start=="function"},l=new WeakMap;function c(b,E){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(b);E&&(v=v.filter(function(A){return Object.getOwnPropertyDescriptor(b,A).enumerable})),T.push.apply(T,v)}return T}function f(b){for(var E=1;E<arguments.length;E++){var T=arguments[E]!=null?arguments[E]:{};E%2?c(Object(T),!0).forEach(function(v){o(b,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):c(Object(T)).forEach(function(v){Object.defineProperty(b,v,Object.getOwnPropertyDescriptor(T,v))})}return b}var p=function(b){return f(f({},b),{},{connect:function(E){var T=E.call;return i(s.mark(function v(){var A,S,R,P;return s.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return A=new MessageChannel,S=A.port1,R=A.port2,L.next=1,T("connect",{port:S},[S]);case 1:return P=L.sent,l.set(R,P),L.abrupt("return",R);case 2:case"end":return L.stop()}},v)}))},disconnect:function(E){var T=E.call;return(function(){var v=i(s.mark(function A(S){var R;return s.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(R=l.get(S),R!==void 0){P.next=1;break}throw new Error("The given port is not connected.");case 1:return P.next=2,T("disconnect",{portId:R});case 2:case"end":return P.stop()}},A)}));return function(A){return v.apply(this,arguments)}})()},isSupported:function(E){var T=E.call;return function(){return T("isSupported")}}})};function m(b,E){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(b);E&&(v=v.filter(function(A){return Object.getOwnPropertyDescriptor(b,A).enumerable})),T.push.apply(T,v)}return T}function h(b){for(var E=1;E<arguments.length;E++){var T=arguments[E]!=null?arguments[E]:{};E%2?m(Object(T),!0).forEach(function(v){o(b,v,T[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):m(Object(T)).forEach(function(v){Object.defineProperty(b,v,Object.getOwnPropertyDescriptor(T,v))})}return b}var g=new WeakMap,y=function(b){if(g.has(b))return g.get(b);var E=new Map;return g.set(b,E),E},w=function(b){var E=p(b);return function(T){var v=y(T);T.addEventListener("message",function(F){var k=F.data,ae=k.id;if(ae!==null&&v.has(ae)){var X=v.get(ae),q=X.reject,re=X.resolve;v.delete(ae),k.error===void 0?re(k.result):q(new Error(k.error.message))}}),a(T)&&T.start();for(var A=function(F){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(X,q){var re=n.generateUniqueNumber(v);v.set(re,{reject:q,resolve:X}),k===null?T.postMessage({id:re,method:F},ae):T.postMessage({id:re,method:F,params:k},ae)})},S=function(F,k){var ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];T.postMessage({id:null,method:F,params:k},ae)},R={},P=0,L=Object.entries(E);P<L.length;P++){var B=u(L[P],2),O=B[0],G=B[1];R=h(h({},R),{},o({},O,G({call:A,notify:S})))}return h({},R)}};r.createBroker=w})}),T0=pe((e,t)=>{le(),ce(),ue(),(function(r,o){typeof e=="object"&&typeof t<"u"?o(e,Pn(),A0(),Lh()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.workerTimersBroker={},r._typeof,r.brokerFactory,r.fastUniqueNumbers))})(e,function(r,o,u,n){var i=new Map([[0,null]]),s=new Map([[0,null]]),a=u.createBroker({clearInterval:function(c){var f=c.call;return function(p){o(i.get(p))==="symbol"&&(i.set(p,null),f("clear",{timerId:p,timerType:"interval"}).then(function(){i.delete(p)}))}},clearTimeout:function(c){var f=c.call;return function(p){o(s.get(p))==="symbol"&&(s.set(p,null),f("clear",{timerId:p,timerType:"timeout"}).then(function(){s.delete(p)}))}},setInterval:function(c){var f=c.call;return function(p){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=arguments.length,g=new Array(h>2?h-2:0),y=2;y<h;y++)g[y-2]=arguments[y];var w=Symbol(),b=n.generateUniqueNumber(i);i.set(b,w);var E=function(){return f("set",{delay:m,now:performance.timeOrigin+performance.now(),timerId:b,timerType:"interval"}).then(function(){var T=i.get(b);if(T===void 0)throw new Error("The timer is in an undefined state.");T===w&&(p.apply(void 0,g),i.get(b)===w&&E())})};return E(),b}},setTimeout:function(c){var f=c.call;return function(p){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=arguments.length,g=new Array(h>2?h-2:0),y=2;y<h;y++)g[y-2]=arguments[y];var w=Symbol(),b=n.generateUniqueNumber(s);return s.set(b,w),f("set",{delay:m,now:performance.timeOrigin+performance.now(),timerId:b,timerType:"timeout"}).then(function(){var E=s.get(b);if(E===void 0)throw new Error("The timer is in an undefined state.");E===w&&(s.delete(b),p.apply(void 0,g))}),b}}}),l=function(c){var f=new Worker(c);return a(f)};r.load=l,r.wrap=a})}),I0=pe((e,t)=>{le(),ce(),ue(),(function(r,o){typeof e=="object"&&typeof t<"u"?o(e,T0()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.workerTimers={},r.workerTimersBroker))})(e,function(r,o){var u=function(f,p){var m=null;return function(){if(m!==null)return m;var h=new Blob([p],{type:"application/javascript; charset=utf-8"}),g=URL.createObjectURL(h);return m=f(g),setTimeout(function(){return URL.revokeObjectURL(g)}),m}},n=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,i=u(o.load,n),s=function(f){return i().clearInterval(f)},a=function(f){return i().clearTimeout(f)},l=function(){var f;return(f=i()).setInterval.apply(f,arguments)},c=function(){var f;return(f=i()).setTimeout.apply(f,arguments)};r.clearInterval=s,r.clearTimeout=a,r.setInterval=l,r.setTimeout=c})}),Cn=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&Ue?.versions?!Object.prototype.hasOwnProperty.call(Ue.versions,"electron"):typeof window.document<"u":!1,r=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),o=()=>typeof navigator<"u"&&navigator.product==="ReactNative",u=t()||r()||o();e.isWebWorker=r(),e.isReactNativeBrowser=o(),e.default=u}),R0=pe(e=>{le(),ce(),ue();var t=e&&e.__createBinding||(Object.create?function(l,c,f,p){p===void 0&&(p=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,p,m)}:function(l,c,f,p){p===void 0&&(p=f),l[p]=c[f]}),r=e&&e.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),o=e&&e.__importStar||(function(){var l=function(c){return l=Object.getOwnPropertyNames||function(f){var p=[];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(p[p.length]=m);return p},l(c)};return function(c){if(c&&c.__esModule)return c;var f={};if(c!=null)for(var p=l(c),m=0;m<p.length;m++)p[m]!=="default"&&t(f,c,p[m]);return r(f,c),f}})();Object.defineProperty(e,"__esModule",{value:!0});var u=I0(),n=o(Cn()),i={set:u.setInterval,clear:u.clearInterval},s={set:(l,c)=>setInterval(l,c),clear:l=>clearInterval(l)},a=l=>{switch(l){case"native":return s;case"worker":return i;default:return n.default&&!n.isWebWorker&&!n.isReactNativeBrowser?i:s}};e.default=a}),kh=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(R0()),o=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(u,n){this.client=u,this.timer=typeof n=="object"&&"set"in n&&"clear"in n?n:(0,r.default)(n),this.setKeepalive(u.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(u){if(u*=1e3,isNaN(u)||u<=0||u>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${u}`);this._keepalive=u,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${u}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let u=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+u,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=o}),ho=pe(e=>{le(),ce(),ue();var t=e&&e.__createBinding||(Object.create?function(v,A,S,R){R===void 0&&(R=S);var P=Object.getOwnPropertyDescriptor(A,S);(!P||("get"in P?!A.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return A[S]}}),Object.defineProperty(v,R,P)}:function(v,A,S,R){R===void 0&&(R=S),v[R]=A[S]}),r=e&&e.__setModuleDefault||(Object.create?function(v,A){Object.defineProperty(v,"default",{enumerable:!0,value:A})}:function(v,A){v.default=A}),o=e&&e.__importStar||(function(){var v=function(A){return v=Object.getOwnPropertyNames||function(S){var R=[];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(R[R.length]=P);return R},v(A)};return function(A){if(A&&A.__esModule)return A;var S={};if(A!=null)for(var R=v(A),P=0;P<R.length;P++)R[P]!=="default"&&t(S,A,R[P]);return r(S,A),S}})(),u=e&&e.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0});var n=u(Uy()),i=ir(),s=u(Fy()),a=u(Lt()),l=o(fh()),c=u(hh()),f=u(s0()),p=u(Nh()),m=u(a0()),h=mr(),g=l0(),y=u(kh()),w=o(Cn()),b=globalThis.setImmediate||((...v)=>{let A=v.shift();(0,h.nextTick)(()=>{A(...v)})}),E={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},T=class po extends g.TypedEventEmitter{static VERSION=h.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_deferredReconnect;connackPacket;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(A,S){super(),this.options=S||{};for(let R in E)typeof this.options[R]>"u"?this.options[R]=E[R]:this.options[R]=S[R];this.log=this.options.log||(0,a.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",po.VERSION),w.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",w.default?"browser":"node"),this.log("MqttClient :: options.protocol",S.protocol),this.log("MqttClient :: options.protocolVersion",S.protocolVersion),this.log("MqttClient :: options.username",S.username),this.log("MqttClient :: options.keepalive",S.keepalive),this.log("MqttClient :: options.reconnectPeriod",S.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",S.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",S.properties?S.properties.topicAliasMaximum:void 0),this.options.clientId=typeof S.clientId=="string"?S.clientId:po.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=S.protocolVersion===5&&S.customHandleAcks?S.customHandleAcks:(...R)=>{R[3](null,0)},this.options.writeCache||(n.default.writeToStream.cacheNumbers=!1),this.streamBuilder=A,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new p.default:this.options.messageIdProvider,this.outgoingStore=S.outgoingStore||new c.default,this.incomingStore=S.incomingStore||new c.default,this.queueQoSZero=S.queueQoSZero===void 0?!0:S.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,S.properties&&S.properties.topicAliasMaximum>0&&(S.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new m.default(S.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:R}=this,P=()=>{let L=R.shift();this.log("deliver :: entry %o",L);let B=null;if(!L){this._resubscribe();return}B=L.packet,this.log("deliver :: call _sendPacket for %o",B);let O=!0;B.messageId&&B.messageId!==0&&(this.messageIdProvider.register(B.messageId)||(O=!1)),O?this._sendPacket(B,G=>{L.cb&&L.cb(G),P()}):(this.log("messageId: %d has already used. The message is skipped and removed.",B.messageId),P())};this.log("connect :: sending queued packets"),P()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(A,S){S()}handleMessage(A,S){S()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let A=new i.Writable,S=n.default.parser(this.options),R=null,P=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),S.on("packet",F=>{this.log("parser :: on packet push to packets array."),P.push(F)});let L=()=>{this.log("work :: getting next packet in queue");let F=P.shift();if(F)this.log("work :: packet pulled from queue"),(0,f.default)(this,F,B);else{this.log("work :: no packets in queue");let k=R;R=null,this.log("work :: done flag is %s",!!k),k&&k()}},B=()=>{if(P.length)(0,h.nextTick)(L);else{let F=R;R=null,F()}};A._write=(F,k,ae)=>{R=ae,this.log("writable stream :: parsing buffer"),S.parse(F),L()};let O=F=>{this.log("streamErrorHandler :: error",F.message),F.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",F)):this.noop(F)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(A),this.stream.on("error",O),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let G={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(G.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(G.properties||(G.properties={}),this.topicAliasRecv&&(G.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(G),S.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let F={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(F)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(A,S,R,P){this.log("publish :: message `%s` to topic `%s`",S,A);let{options:L}=this;typeof R=="function"&&(P=R,R=null),R=R||{},R={qos:0,retain:!1,dup:!1,...R};let{qos:B,retain:O,dup:G,properties:F,cbStorePut:k}=R;if(this._checkDisconnecting(P))return this;let ae=()=>{let X=0;if((B===1||B===2)&&(X=this._nextId(),X===null))return this.log("No messageId left"),!1;let q={cmd:"publish",topic:A,payload:S,qos:B,retain:O,messageId:X,dup:G};switch(L.protocolVersion===5&&(q.properties=F),this.log("publish :: qos",B),B){case 1:case 2:this.outgoing[q.messageId]={volatile:!1,cb:P||this.noop},this.log("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,void 0,k);break;default:this.log("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,P,k);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ae())&&this._storeProcessingQueue.push({invoke:ae,cbStorePut:R.cbStorePut,callback:P}),this}publishAsync(A,S,R){return new Promise((P,L)=>{this.publish(A,S,R,(B,O)=>{B?L(B):P(O)})})}subscribe(A,S,R){let P=this.options.protocolVersion;typeof S=="function"&&(R=S),R=R||this.noop;let L=!1,B=[];typeof A=="string"?(A=[A],B=A):Array.isArray(A)?B=A:typeof A=="object"&&(L=A.resubscribe,delete A.resubscribe,B=Object.keys(A));let O=l.validateTopics(B);if(O!==null)return b(R,new Error(`Invalid topic ${O}`)),this;if(this._checkDisconnecting(R))return this.log("subscribe: discconecting true"),this;let G={qos:0};P===5&&(G.nl=!1,G.rap=!1,G.rh=0),S={...G,...S};let{properties:F}=S,k=[],ae=(re,j)=>{if(j=j||S,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,re)||this._resubscribeTopics[re].qos<j.qos||L){let Z={topic:re,qos:j.qos};P===5&&(Z.nl=j.nl,Z.rap=j.rap,Z.rh=j.rh,Z.properties=F),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Z.topic,Z.qos),k.push(Z)}};if(Array.isArray(A)?A.forEach(re=>{this.log("subscribe: array topic %s",re),ae(re)}):Object.keys(A).forEach(re=>{this.log("subscribe: object topic %s, %o",re,A[re]),ae(re,A[re])}),!k.length)return R(null,[]),this;let X=(re,j)=>{let Z={cmd:"subscribe",subscriptions:re,messageId:j};if(F&&(Z.properties=F),this.options.resubscribe){this.log("subscribe :: resubscribe true");let Q=[];re.forEach(ye=>{if(this.options.reconnectPeriod>0){let te={qos:ye.qos};P===5&&(te.nl=ye.nl||!1,te.rap=ye.rap||!1,te.rh=ye.rh||0,te.properties=ye.properties),this._resubscribeTopics[ye.topic]=te,Q.push(ye.topic)}}),this.messageIdToTopic[Z.messageId]=Q}let M=new Promise((Q,ye)=>{this.outgoing[Z.messageId]={volatile:!0,cb(te,Ee){if(!te){let{granted:Y}=Ee;for(let D=0;D<Y.length;D+=1)re[D].qos=Y[D]}te?ye(new h.ErrorWithSubackPacket(te.message,Ee)):Q(Ee)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Z),M},q=()=>{let re=this.options.subscribeBatchSize??k.length,j=[];for(let Z=0;Z<k.length;Z+=re){let M=k.slice(Z,Z+re),Q=this._nextId();if(Q===null)return this.log("No messageId left"),!1;j.push(X(M,Q))}return Promise.all(j).then(Z=>{R(null,k,Z.at(-1))}).catch(Z=>{R(Z,k,Z.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!q())&&this._storeProcessingQueue.push({invoke:q,callback:R}),this}subscribeAsync(A,S){return new Promise((R,P)=>{this.subscribe(A,S,(L,B)=>{L?P(L):R(B)})})}unsubscribe(A,S,R){typeof A=="string"&&(A=[A]),typeof S=="function"&&(R=S),R=R||this.noop;let P=l.validateTopics(A);if(P!==null)return b(R,new Error(`Invalid topic ${P}`)),this;if(this._checkDisconnecting(R))return this;let L=()=>{let B=this._nextId();if(B===null)return this.log("No messageId left"),!1;let O={cmd:"unsubscribe",messageId:B,unsubscriptions:[]};return typeof A=="string"?O.unsubscriptions=[A]:Array.isArray(A)&&(O.unsubscriptions=A),this.options.resubscribe&&O.unsubscriptions.forEach(G=>{delete this._resubscribeTopics[G]}),typeof S=="object"&&S.properties&&(O.properties=S.properties),this.outgoing[O.messageId]={volatile:!0,cb:R},this.log("unsubscribe: call _sendPacket"),this._sendPacket(O),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!L())&&this._storeProcessingQueue.push({invoke:L,callback:R}),this}unsubscribeAsync(A,S){return new Promise((R,P)=>{this.unsubscribe(A,S,(L,B)=>{L?P(L):R(B)})})}end(A,S,R){this.log("end :: (%s)",this.options.clientId),(A==null||typeof A!="boolean")&&(R=R||S,S=A,A=!1),typeof S!="object"&&(R=R||S,S=null),this.log("end :: cb? %s",!!R),(!R||typeof R!="function")&&(R=this.noop);let P=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(B=>{this.outgoingStore.close(O=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),R){let G=B||O;this.log("end :: closeStores: invoking callback with args"),R(G)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},L=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,A),this._cleanUp(A,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,h.nextTick)(P)},S)};return this.disconnecting?(R(),this):(this._clearReconnect(),this.disconnecting=!0,!A&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,L,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),L()),this)}endAsync(A,S){return new Promise((R,P)=>{this.end(A,S,L=>{L?P(L):R()})})}removeOutgoingMessage(A){if(this.outgoing[A]){let{cb:S}=this.outgoing[A];this._removeOutgoingAndStoreMessage(A,()=>{S(new Error("Message removed"))})}return this}reconnect(A){this.log("client reconnect");let S=()=>{A?(this.options.incomingStore=A.incomingStore,this.options.outgoingStore=A.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=S:S(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(A=>{this.outgoing[A].volatile&&typeof this.outgoing[A].cb=="function"&&(this.outgoing[A].cb(new Error("Connection closed")),delete this.outgoing[A])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(A=>{typeof this.outgoing[A].cb=="function"&&(this.outgoing[A].cb(new Error("Connection closed")),delete this.outgoing[A])}))}_removeTopicAliasAndRecoverTopicName(A){let S;A.properties&&(S=A.properties.topicAlias);let R=A.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",S,R),R.length===0){if(typeof S>"u")return new Error("Unregistered Topic Alias");if(R=this.topicAliasSend.getTopicByAlias(S),typeof R>"u")return new Error("Unregistered Topic Alias");A.topic=R}S&&delete A.properties.topicAlias}_checkDisconnecting(A){return this.disconnecting&&(A&&A!==this.noop?A(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(A,S,R={}){if(S&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",S)),this.log("_cleanUp :: forced? %s",A),A)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let P={cmd:"disconnect",...R};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(P,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),b(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),S&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",S),S())}_storeAndSend(A,S,R){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",A.cmd);let P=A,L;if(P.cmd==="publish"&&(P=(0,s.default)(A),L=this._removeTopicAliasAndRecoverTopicName(P),L))return S&&S(L);this.outgoingStore.put(P,B=>{if(B)return S&&S(B);R(),this._writePacket(A,S)})}_applyTopicAlias(A){if(this.options.protocolVersion===5&&A.cmd==="publish"){let S;A.properties&&(S=A.properties.topicAlias);let R=A.topic.toString();if(this.topicAliasSend)if(S){if(R.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",R,S),!this.topicAliasSend.put(R,S)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",R,S),new Error("Sending Topic Alias out of range")}else R.length!==0&&(this.options.autoAssignTopicAlias?(S=this.topicAliasSend.getAliasByTopic(R),S?(A.topic="",A.properties={...A.properties,topicAlias:S},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",R,S)):(S=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(R,S),A.properties={...A.properties,topicAlias:S},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",R,S))):this.options.autoUseTopicAlias&&(S=this.topicAliasSend.getAliasByTopic(R),S&&(A.topic="",A.properties={...A.properties,topicAlias:S},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",R,S))));else if(S)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",R,S),new Error("Sending Topic Alias out of range")}}_noop(A){this.log("noop ::",A)}_writePacket(A,S){this.log("_writePacket :: packet: %O",A),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",A),this.log("_writePacket :: writing to stream");let R=n.default.writeToStream(A,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",R),!R&&S&&S!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",S)):S&&(this.log("_writePacket :: invoking cb"),S())}_sendPacket(A,S,R,P){this.log("_sendPacket :: (%s) :: start",this.options.clientId),R=R||this.noop,S=S||this.noop;let L=this._applyTopicAlias(A);if(L){S(L);return}if(!this.connected){if(A.cmd==="auth"){this._writePacket(A,S);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(A,S,R);return}if(P){this._writePacket(A,S);return}switch(A.cmd){case"publish":break;case"pubrel":this._storeAndSend(A,S,R);return;default:this._writePacket(A,S);return}switch(A.qos){case 2:case 1:this._storeAndSend(A,S,R);break;default:this._writePacket(A,S);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(A,S,R){this.log("_storePacket :: packet: %o",A),this.log("_storePacket :: cb? %s",!!S),R=R||this.noop;let P=A;if(P.cmd==="publish"){P=(0,s.default)(A);let B=this._removeTopicAliasAndRecoverTopicName(P);if(B)return S&&S(B)}let L=P.qos||0;L===0&&this.queueQoSZero||P.cmd!=="publish"?this.queue.push({packet:P,cb:S}):L>0?(S=this.outgoing[P.messageId]?this.outgoing[P.messageId].cb:null,this.outgoingStore.put(P,B=>{if(B)return S&&S(B);R()})):S&&S(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new y.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(A=!1){this.keepaliveManager&&this.options.keepalive&&(A||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let A=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&A.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let S=0;S<A.length;S++){let R={};R[A[S]]=this._resubscribeTopics[A[S]],R.resubscribe=!0,this.subscribe(R,{properties:R[A[S]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(A){if(this.disconnected){this.emit("connect",A);return}this.connackPacket=A,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let S=()=>{let R=this.outgoingStore.createStream(),P=()=>{R.destroy(),R=null,this._flushStoreProcessingQueue(),L()},L=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",P),R.on("error",O=>{L(),this._flushStoreProcessingQueue(),this.removeListener("close",P),this.emit("error",O)});let B=()=>{if(!R)return;let O=R.read(1),G;if(!O){R.once("readable",B);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[O.messageId]){B();return}!this.disconnecting&&!this.reconnectTimer?(G=this.outgoing[O.messageId]?this.outgoing[O.messageId].cb:null,this.outgoing[O.messageId]={volatile:!1,cb(F,k){G&&G(F,k),B()}},this._packetIdsDuringStoreProcessing[O.messageId]=!0,this.messageIdProvider.register(O.messageId)?this._sendPacket(O,void 0,void 0,!0):this.log("messageId: %d has already used.",O.messageId)):R.destroy&&R.destroy()};R.on("end",()=>{let O=!0;for(let G in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[G]){O=!1;break}this.removeListener("close",P),O?(L(),this._invokeAllStoreProcessingQueue(),this.emit("connect",A)):S()}),B()};S()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let A=this._storeProcessingQueue[0];if(A&&A.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let A of this._storeProcessingQueue)A.cbStorePut&&A.cbStorePut(new Error("Connection closed")),A.callback&&A.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(A,S){delete this.outgoing[A],this.outgoingStore.del({messageId:A},(R,P)=>{S(R,P),this.messageIdProvider.deallocate(A),this._invokeStoreProcessingQueue()})}};e.default=T}),O0=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=Oh(),r=class{numberAllocator;lastId;constructor(){this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(o){return this.numberAllocator.use(o)}deallocate(o){this.numberAllocator.free(o)}clear(){this.numberAllocator.clear()}};e.default=r});function N0(){if(go)return en;go=!0;let e=2147483647,t=36,r=1,o=26,u=38,n=700,i=72,s=128,a="-",l=/^xn--/,c=/[^\0-\x7F]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=t-r,h=Math.floor,g=String.fromCharCode;function y(L){throw new RangeError(p[L])}function w(L,B){let O=[],G=L.length;for(;G--;)O[G]=B(L[G]);return O}function b(L,B){let O=L.split("@"),G="";O.length>1&&(G=O[0]+"@",L=O[1]),L=L.replace(f,".");let F=L.split("."),k=w(F,B).join(".");return G+k}function E(L){let B=[],O=0,G=L.length;for(;O<G;){let F=L.charCodeAt(O++);if(F>=55296&&F<=56319&&O<G){let k=L.charCodeAt(O++);(k&64512)==56320?B.push(((F&1023)<<10)+(k&1023)+65536):(B.push(F),O--)}else B.push(F)}return B}let T=L=>String.fromCodePoint(...L),v=function(L){return L>=48&&L<58?26+(L-48):L>=65&&L<91?L-65:L>=97&&L<123?L-97:t},A=function(L,B){return L+22+75*(L<26)-((B!=0)<<5)},S=function(L,B,O){let G=0;for(L=O?h(L/n):L>>1,L+=h(L/B);L>m*o>>1;G+=t)L=h(L/m);return h(G+(m+1)*L/(L+u))},R=function(L){let B=[],O=L.length,G=0,F=s,k=i,ae=L.lastIndexOf(a);ae<0&&(ae=0);for(let X=0;X<ae;++X)L.charCodeAt(X)>=128&&y("not-basic"),B.push(L.charCodeAt(X));for(let X=ae>0?ae+1:0;X<O;){let q=G;for(let j=1,Z=t;;Z+=t){X>=O&&y("invalid-input");let M=v(L.charCodeAt(X++));M>=t&&y("invalid-input"),M>h((e-G)/j)&&y("overflow"),G+=M*j;let Q=Z<=k?r:Z>=k+o?o:Z-k;if(M<Q)break;let ye=t-Q;j>h(e/ye)&&y("overflow"),j*=ye}let re=B.length+1;k=S(G-q,re,q==0),h(G/re)>e-F&&y("overflow"),F+=h(G/re),G%=re,B.splice(G++,0,F)}return String.fromCodePoint(...B)},P=function(L){let B=[];L=E(L);let O=L.length,G=s,F=0,k=i;for(let q of L)q<128&&B.push(g(q));let ae=B.length,X=ae;for(ae&&B.push(a);X<O;){let q=e;for(let j of L)j>=G&&j<q&&(q=j);let re=X+1;q-G>h((e-F)/re)&&y("overflow"),F+=(q-G)*re,G=q;for(let j of L)if(j<G&&++F>e&&y("overflow"),j===G){let Z=F;for(let M=t;;M+=t){let Q=M<=k?r:M>=k+o?o:M-k;if(Z<Q)break;let ye=Z-Q,te=t-Q;B.push(g(A(Q+ye%te,0))),Z=h(ye/te)}B.push(g(A(Z,0))),k=S(F,re,X===ae),F=0,++X}++F,++G}return B.join("")};return en={version:"2.3.1",ucs2:{decode:E,encode:T},decode:R,encode:P,toASCII:function(L){return b(L,function(B){return c.test(B)?"xn--"+P(B):B})},toUnicode:function(L){return b(L,function(B){return l.test(B)?R(B.slice(4).toLowerCase()):B})}},en}var en,go,Ft,L0=nt(()=>{le(),ce(),ue(),en={},go=!1,Ft=N0(),Ft.decode,Ft.encode,Ft.toASCII,Ft.toUnicode,Ft.ucs2,Ft.version});function M0(){return mo||(mo=!0,bo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var n=Object.getOwnPropertyDescriptor(e,t);if(n.value!==o||n.enumerable!==!0)return!1}return!0}),bo}function P0(){return vo||(vo=!0,yo=Error),yo}function C0(){return Eo||(Eo=!0,_o=EvalError),_o}function x0(){return So||(So=!0,wo=RangeError),wo}function D0(){return To||(To=!0,Ao=ReferenceError),Ao}function Uh(){return Ro||(Ro=!0,Io=SyntaxError),Io}function Gr(){return No||(No=!0,Oo=TypeError),Oo}function k0(){return Mo||(Mo=!0,Lo=URIError),Lo}function U0(){if(Po)return tn;Po=!0;var e=typeof Symbol<"u"&&Symbol,t=M0();return tn=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},tn}function B0(){if(Co)return rn;Co=!0;var e={__proto__:null,foo:{}},t=Object;return rn=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},rn}function F0(){if(xo)return nn;xo=!0;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,o="[object Function]",u=function(s,a){for(var l=[],c=0;c<s.length;c+=1)l[c]=s[c];for(var f=0;f<a.length;f+=1)l[f+s.length]=a[f];return l},n=function(s,a){for(var l=[],c=a,f=0;c<s.length;c+=1,f+=1)l[f]=s[c];return l},i=function(s,a){for(var l="",c=0;c<s.length;c+=1)l+=s[c],c+1<s.length&&(l+=a);return l};return nn=function(s){var a=this;if(typeof a!="function"||t.apply(a)!==o)throw new TypeError(e+a);for(var l=n(arguments,1),c,f=function(){if(this instanceof c){var y=a.apply(this,u(l,arguments));return Object(y)===y?y:this}return a.apply(s,u(l,arguments))},p=r(0,a.length-l.length),m=[],h=0;h<p;h++)m[h]="$"+h;if(c=Function("binder","return function ("+i(m,",")+"){ return binder.apply(this,arguments); }")(f),a.prototype){var g=function(){};g.prototype=a.prototype,c.prototype=new g,g.prototype=null}return c},nn}function Is(){if(Do)return on;Do=!0;var e=F0();return on=Function.prototype.bind||e,on}function j0(){if(ko)return sn;ko=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Is();return sn=r.call(e,t),sn}function yr(){if(Uo)return an;Uo=!0;var e,t=P0(),r=C0(),o=x0(),u=D0(),n=Uh(),i=Gr(),s=k0(),a=Function,l=function(X){try{return a('"use strict"; return ('+X+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var f=function(){throw new i},p=c?(function(){try{return arguments.callee,f}catch{try{return c(arguments,"callee").get}catch{return f}}})():f,m=U0()(),h=B0()(),g=Object.getPrototypeOf||(h?function(X){return X.__proto__}:null),y={},w=typeof Uint8Array>"u"||!g?e:g(Uint8Array),b={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":m&&g?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&g?g(g([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!g?e:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":o,"%ReferenceError%":u,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!g?e:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&g?g(""[Symbol.iterator]()):e,"%Symbol%":m?Symbol:e,"%SyntaxError%":n,"%ThrowTypeError%":p,"%TypedArray%":w,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(g)try{null.error}catch(X){var E=g(g(X));b["%Error.prototype%"]=E}var T=function X(q){var re;if(q==="%AsyncFunction%")re=l("async function () {}");else if(q==="%GeneratorFunction%")re=l("function* () {}");else if(q==="%AsyncGeneratorFunction%")re=l("async function* () {}");else if(q==="%AsyncGenerator%"){var j=X("%AsyncGeneratorFunction%");j&&(re=j.prototype)}else if(q==="%AsyncIteratorPrototype%"){var Z=X("%AsyncGenerator%");Z&&g&&(re=g(Z.prototype))}return b[q]=re,re},v={__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"]},A=Is(),S=j0(),R=A.call(Function.call,Array.prototype.concat),P=A.call(Function.apply,Array.prototype.splice),L=A.call(Function.call,String.prototype.replace),B=A.call(Function.call,String.prototype.slice),O=A.call(Function.call,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,k=function(X){var q=B(X,0,1),re=B(X,-1);if(q==="%"&&re!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(re==="%"&&q!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var j=[];return L(X,G,function(Z,M,Q,ye){j[j.length]=Q?L(ye,F,"$1"):M||Z}),j},ae=function(X,q){var re=X,j;if(S(v,re)&&(j=v[re],re="%"+j[0]+"%"),S(b,re)){var Z=b[re];if(Z===y&&(Z=T(re)),typeof Z>"u"&&!q)throw new i("intrinsic "+X+" exists, but is not available. Please file an issue!");return{alias:j,name:re,value:Z}}throw new n("intrinsic "+X+" does not exist!")};return an=function(X,q){if(typeof X!="string"||X.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new i('"allowMissing" argument must be a boolean');if(O(/^%?[^%]*%?$/,X)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var re=k(X),j=re.length>0?re[0]:"",Z=ae("%"+j+"%",q),M=Z.name,Q=Z.value,ye=!1,te=Z.alias;te&&(j=te[0],P(re,R([0,1],te)));for(var Ee=1,Y=!0;Ee<re.length;Ee+=1){var D=re[Ee],ne=B(D,0,1),V=B(D,-1);if((ne==='"'||ne==="'"||ne==="`"||V==='"'||V==="'"||V==="`")&&ne!==V)throw new n("property names with quotes must have matching quotes");if((D==="constructor"||!Y)&&(ye=!0),j+="."+D,M="%"+j+"%",S(b,M))Q=b[M];else if(Q!=null){if(!(D in Q)){if(!q)throw new i("base intrinsic for "+X+" exists, but the property is not available.");return}if(c&&Ee+1>=re.length){var K=c(Q,D);Y=!!K,Y&&"get"in K&&!("originalValue"in K.get)?Q=K.get:Q=Q[D]}else Y=S(Q,D),Q=Q[D];Y&&!ye&&(b[M]=Q)}}return Q},an}function Rs(){if(Bo)return ln;Bo=!0;var e=yr(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return ln=t,ln}function Bh(){if(Fo)return un;Fo=!0;var e=yr(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return un=t,un}function W0(){if(jo)return cn;jo=!0;var e=Rs(),t=Uh(),r=Gr(),o=Bh();return cn=function(u,n,i){if(!u||typeof u!="object"&&typeof u!="function")throw new r("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,f=!!o&&o(u,n);if(e)e(u,n,{configurable:l===null&&f?f.configurable:!l,enumerable:s===null&&f?f.enumerable:!s,value:i,writable:a===null&&f?f.writable:!a});else if(c||!s&&!a&&!l)u[n]=i;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},cn}function G0(){if(Wo)return fn;Wo=!0;var e=Rs(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},fn=t,fn}function H0(){if(Go)return hn;Go=!0;var e=yr(),t=W0(),r=G0()(),o=Bh(),u=Gr(),n=e("%Math.floor%");return hn=function(i,s){if(typeof i!="function")throw new u("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||n(s)!==s)throw new u("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in i&&o){var f=o(i,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(c=!1)}return(l||c||!a)&&(r?t(i,"length",s,!0,!0):t(i,"length",s)),i},hn}function V0(){if(Ho)return dr;Ho=!0;var e=Is(),t=yr(),r=H0(),o=Gr(),u=t("%Function.prototype.apply%"),n=t("%Function.prototype.call%"),i=t("%Reflect.apply%",!0)||e.call(n,u),s=Rs(),a=t("%Math.max%");dr=function(c){if(typeof c!="function")throw new o("a function is required");var f=i(e,n,arguments);return r(f,1+a(0,c.length-(arguments.length-1)),!0)};var l=function(){return i(e,u,arguments)};return s?s(dr,"apply",{value:l}):dr.apply=l,dr}function $0(){if(Vo)return dn;Vo=!0;var e=yr(),t=V0(),r=t(e("String.prototype.indexOf"));return dn=function(o,u){var n=e(o,!!u);return typeof n=="function"&&r(o,".prototype.")>-1?t(n):n},dn}var bo,mo,yo,vo,_o,Eo,wo,So,Ao,To,Io,Ro,Oo,No,Lo,Mo,tn,Po,rn,Co,nn,xo,on,Do,sn,ko,an,Uo,ln,Bo,un,Fo,cn,jo,fn,Wo,hn,Go,dr,Ho,dn,Vo,q0=nt(()=>{le(),ce(),ue(),bo={},mo=!1,yo={},vo=!1,_o={},Eo=!1,wo={},So=!1,Ao={},To=!1,Io={},Ro=!1,Oo={},No=!1,Lo={},Mo=!1,tn={},Po=!1,rn={},Co=!1,nn={},xo=!1,on={},Do=!1,sn={},ko=!1,an={},Uo=!1,ln={},Bo=!1,un={},Fo=!1,cn={},jo=!1,fn={},Wo=!1,hn={},Go=!1,dr={},Ho=!1,dn={},Vo=!1});function Os(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Y0(){!Jt||!zt||(Jt=!1,zt.length?Et=zt.concat(Et):Mr=-1,Et.length&&Fh())}function Fh(){if(!Jt){var e=setTimeout(Y0,0);Jt=!0;for(var t=Et.length;t;){for(zt=Et,Et=[];++Mr<t;)zt&&zt[Mr].run();Mr=-1,t=Et.length}zt=null,Jt=!1,clearTimeout(e)}}function K0(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Et.push(new jh(e,t)),Et.length===1&&!Jt&&setTimeout(Fh,0)}function jh(e,t){this.fun=e,this.array=t}function ze(){}function X0(e){Os("_linkedBinding")}function z0(e){Os("dlopen")}function Q0(){return[]}function J0(){return[]}function Z0(e,t){if(!e)throw new Error(t||"assertion error")}function ev(){return!1}function tv(){return Ot.now()/1e3}function Wn(e){var t=Math.floor((Date.now()-Ot.now())*.001),r=Ot.now()*.001,o=Math.floor(r)+t,u=Math.floor(r%1*1e9);return e&&(o=o-e[0],u=u-e[1],u<0&&(o--,u+=pn)),[o,u]}function Ut(){return Ns}function rv(e){return[]}var Et,Jt,zt,Mr,ta,ra,na,ia,oa,sa,aa,la,ua,ca,fa,ha,da,pa,ga,ba,ma,ya,va,_a,Ea,Yr,wa,Sa,Aa,Ta,Ia,Ra,Oa,Na,La,Ma,Pa,Ca,xa,Da,ka,Ua,Ba,Fa,ja,Wa,Ga,Ha,Va,$a,qa,Ot,Gn,pn,Ya,Ka,Xa,za,Qa,Ja,Za,el,tl,rl,nl,Ns,Wh=nt(()=>{le(),ce(),ue(),Et=[],Jt=!1,Mr=-1,jh.prototype.run=function(){this.fun.apply(null,this.array)},ta="browser",ra="x64",na="browser",ia={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},oa=["/usr/bin/node"],sa=[],aa="v16.8.0",la={},ua=function(e,t){console.warn((t?t+": ":"")+e)},ca=function(e){Os("binding")},fa=function(e){return 0},ha=function(){return"/"},da=function(e){},pa={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},ga=ze,ba=[],ma={},ya=!1,va={},_a=ze,Ea=ze,Yr=function(){return{}},wa=Yr,Sa=Yr,Aa=ze,Ta=ze,Ia=ze,Ra={},Oa={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Na=ze,La=ze,Ma=ze,Pa=ze,Ca=ze,xa=ze,Da=ze,ka=void 0,Ua=void 0,Ba=void 0,Fa=ze,ja=2,Wa=1,Ga="/bin/usr/node",Ha=9229,Va="node",$a=[],qa=ze,Ot={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Ot.now===void 0&&(Gn=Date.now(),Ot.timing&&Ot.timing.navigationStart&&(Gn=Ot.timing.navigationStart),Ot.now=()=>Date.now()-Gn),pn=1e9,Wn.bigint=function(e){var t=Wn(e);return typeof BigInt>"u"?t[0]*pn+t[1]:BigInt(t[0]*pn)+BigInt(t[1])},Ya=10,Ka={},Xa=0,za=Ut,Qa=Ut,Ja=Ut,Za=Ut,el=Ut,tl=ze,rl=Ut,nl=Ut,Ns={version:aa,versions:la,arch:ra,platform:na,release:pa,_rawDebug:ga,moduleLoadList:ba,binding:ca,_linkedBinding:X0,_events:Ka,_eventsCount:Xa,_maxListeners:Ya,on:Ut,addListener:za,once:Qa,off:Ja,removeListener:Za,removeAllListeners:el,emit:tl,prependListener:rl,prependOnceListener:nl,listeners:rv,domain:ma,_exiting:ya,config:va,dlopen:z0,uptime:tv,_getActiveRequests:Q0,_getActiveHandles:J0,reallyExit:_a,_kill:Ea,cpuUsage:Yr,resourceUsage:wa,memoryUsage:Sa,kill:Aa,exit:Ta,openStdin:Ia,allowedNodeEnvironmentFlags:Ra,assert:Z0,features:Oa,_fatalExceptions:Na,setUncaughtExceptionCaptureCallback:La,hasUncaughtExceptionCaptureCallback:ev,emitWarning:ua,nextTick:K0,_tickCallback:Ma,_debugProcess:Pa,_debugEnd:Ca,_startProfilerIdleNotifier:xa,_stopProfilerIdleNotifier:Da,stdout:ka,stdin:Ba,stderr:Ua,abort:Fa,umask:fa,chdir:da,cwd:ha,env:ia,title:ta,argv:oa,execArgv:sa,pid:ja,ppid:Wa,execPath:Ga,debugPort:Ha,hrtime:Wn,argv0:Va,_preload_modules:$a,setSourceMapsEnabled:qa}});function nv(){if($o)return gn;$o=!0;var e=Ns;function t(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function r(n,i){for(var s="",a=0,l=-1,c=0,f,p=0;p<=n.length;++p){if(p<n.length)f=n.charCodeAt(p);else{if(f===47)break;f=47}if(f===47){if(!(l===p-1||c===1))if(l!==p-1&&c===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",a=0):(s=s.slice(0,m),a=s.length-1-s.lastIndexOf("/")),l=p,c=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=p,c=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+n.slice(l+1,p):s=n.slice(l+1,p),a=p-l-1;l=p,c=0}else f===46&&c!==-1?++c:c=-1}return s}function o(n,i){var s=i.dir||i.root,a=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+a:s+n+a:a}var u={resolve:function(){for(var n="",i=!1,s,a=arguments.length-1;a>=-1&&!i;a--){var l;a>=0?l=arguments[a]:(s===void 0&&(s=e.cwd()),l=s),t(l),l.length!==0&&(n=l+"/"+n,i=l.charCodeAt(0)===47)}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(t(n),n.length===0)return".";var i=n.charCodeAt(0)===47,s=n.charCodeAt(n.length-1)===47;return n=r(n,!i),n.length===0&&!i&&(n="."),n.length>0&&s&&(n+="/"),i?"/"+n:n},isAbsolute:function(n){return t(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,i=0;i<arguments.length;++i){var s=arguments[i];t(s),s.length>0&&(n===void 0?n=s:n+="/"+s)}return n===void 0?".":u.normalize(n)},relative:function(n,i){if(t(n),t(i),n===i||(n=u.resolve(n),i=u.resolve(i),n===i))return"";for(var s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var a=n.length,l=a-s,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var f=i.length,p=f-c,m=l<p?l:p,h=-1,g=0;g<=m;++g){if(g===m){if(p>m){if(i.charCodeAt(c+g)===47)return i.slice(c+g+1);if(g===0)return i.slice(c+g)}else l>m&&(n.charCodeAt(s+g)===47?h=g:g===0&&(h=0));break}var y=n.charCodeAt(s+g),w=i.charCodeAt(c+g);if(y!==w)break;y===47&&(h=g)}var b="";for(g=s+h+1;g<=a;++g)(g===a||n.charCodeAt(g)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+i.slice(c+h):(c+=h,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(n){return n},dirname:function(n){if(t(n),n.length===0)return".";for(var i=n.charCodeAt(0),s=i===47,a=-1,l=!0,c=n.length-1;c>=1;--c)if(i=n.charCodeAt(c),i===47){if(!l){a=c;break}}else l=!1;return a===-1?s?"/":".":s&&a===1?"//":n.slice(0,a)},basename:function(n,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');t(n);var s=0,a=-1,l=!0,c;if(i!==void 0&&i.length>0&&i.length<=n.length){if(i.length===n.length&&i===n)return"";var f=i.length-1,p=-1;for(c=n.length-1;c>=0;--c){var m=n.charCodeAt(c);if(m===47){if(!l){s=c+1;break}}else p===-1&&(l=!1,p=c+1),f>=0&&(m===i.charCodeAt(f)?--f===-1&&(a=c):(f=-1,a=p))}return s===a?a=p:a===-1&&(a=n.length),n.slice(s,a)}else{for(c=n.length-1;c>=0;--c)if(n.charCodeAt(c)===47){if(!l){s=c+1;break}}else a===-1&&(l=!1,a=c+1);return a===-1?"":n.slice(s,a)}},extname:function(n){t(n);for(var i=-1,s=0,a=-1,l=!0,c=0,f=n.length-1;f>=0;--f){var p=n.charCodeAt(f);if(p===47){if(!l){s=f+1;break}continue}a===-1&&(l=!1,a=f+1),p===46?i===-1?i=f:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||a===-1||c===0||c===1&&i===a-1&&i===s+1?"":n.slice(i,a)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return o("/",n)},parse:function(n){t(n);var i={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return i;var s=n.charCodeAt(0),a=s===47,l;a?(i.root="/",l=1):l=0;for(var c=-1,f=0,p=-1,m=!0,h=n.length-1,g=0;h>=l;--h){if(s=n.charCodeAt(h),s===47){if(!m){f=h+1;break}continue}p===-1&&(m=!1,p=h+1),s===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1)}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===f+1?p!==-1&&(f===0&&a?i.base=i.name=n.slice(1,p):i.base=i.name=n.slice(f,p)):(f===0&&a?(i.name=n.slice(1,c),i.base=n.slice(1,p)):(i.name=n.slice(f,c),i.base=n.slice(f,p)),i.ext=n.slice(c,p)),f>0?i.dir=n.slice(0,f-1):a&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,gn=u,gn}var gn,$o,qo,iv=nt(()=>{le(),ce(),ue(),Wh(),gn={},$o=!1,qo=nv()}),Gh={};gr(Gh,{URL:()=>Jh,Url:()=>Yh,default:()=>Qe,fileURLToPath:()=>Vh,format:()=>Kh,parse:()=>Qh,pathToFileURL:()=>$h,resolve:()=>Xh,resolveObject:()=>zh});function ov(){if(Yo)return bn;Yo=!0;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,o=e&&Map.prototype.forEach,u=typeof Set=="function"&&Set.prototype,n=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=u&&n&&typeof n.get=="function"?n.get:null,s=u&&Set.prototype.forEach,a=typeof WeakMap=="function"&&WeakMap.prototype,l=a?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,f=c?WeakSet.prototype.has:null,p=typeof WeakRef=="function"&&WeakRef.prototype,m=p?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,w=String.prototype.match,b=String.prototype.slice,E=String.prototype.replace,T=String.prototype.toUpperCase,v=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,R=Array.prototype.join,P=Array.prototype.slice,L=Math.floor,B=typeof BigInt=="function"?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,F=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===F||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,X=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function q($,ie){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||A.call(/e/,ie))return ie;var Re=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var Oe=$<0?-L(-$):L($);if(Oe!==$){var Le=String(Oe),Pe=b.call(ie,Le.length+1);return E.call(Le,Re,"$&_")+"."+E.call(E.call(Pe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(ie,Re,"$&_")}var re=qh,j=re.custom,Z=K(j)?j:null;bn=function $(ie,Re,Oe,Le){var Pe=Re||{};if(oe(Pe,"quoteStyle")&&Pe.quoteStyle!=="single"&&Pe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(oe(Pe,"maxStringLength")&&(typeof Pe.maxStringLength=="number"?Pe.maxStringLength<0&&Pe.maxStringLength!==1/0:Pe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var pt=oe(Pe,"customInspect")?Pe.customInspect:!0;if(typeof pt!="boolean"&&pt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(oe(Pe,"indent")&&Pe.indent!==null&&Pe.indent!==" "&&!(parseInt(Pe.indent,10)===Pe.indent&&Pe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(oe(Pe,"numericSeparator")&&typeof Pe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var gt=Pe.numericSeparator;if(typeof ie>"u")return"undefined";if(ie===null)return"null";if(typeof ie=="boolean")return ie?"true":"false";if(typeof ie=="string")return se(ie,Pe);if(typeof ie=="number"){if(ie===0)return 1/0/ie>0?"0":"-0";var Ke=String(ie);return gt?q(ie,Ke):Ke}if(typeof ie=="bigint"){var bt=String(ie)+"n";return gt?q(ie,bt):bt}var or=typeof Pe.depth>"u"?5:Pe.depth;if(typeof Oe>"u"&&(Oe=0),Oe>=or&&or>0&&typeof ie=="object")return ye(ie)?"[Array]":"[Object]";var mt=J(Pe,Oe);if(typeof Le>"u")Le=[];else if(ee(Le,ie)>=0)return"[Circular]";function it(yt,xt,$t){if(xt&&(Le=P.call(Le),Le.push(xt)),$t){var vt={depth:Pe.depth};return oe(Pe,"quoteStyle")&&(vt.quoteStyle=Pe.quoteStyle),$(yt,vt,Oe+1,Le)}return $(yt,Pe,Oe+1,Le)}if(typeof ie=="function"&&!Ee(ie)){var Hr=W(ie),sr=Se(ie,it);return"[Function"+(Hr?": "+Hr:" (anonymous)")+"]"+(sr.length>0?" { "+R.call(sr,", ")+" }":"")}if(K(ie)){var vr=F?E.call(String(ie),/^(Symbol\(.*\))_[^)]*$/,"$1"):G.call(ie);return typeof ie=="object"&&!F?d(vr):vr}if(_e(ie)){for(var N="<"+v.call(String(ie.nodeName)),x=ie.attributes||[],we=0;we<x.length;we++)N+=" "+x[we].name+"="+M(Q(x[we].value),"double",Pe);return N+=">",ie.childNodes&&ie.childNodes.length&&(N+="..."),N+="</"+v.call(String(ie.nodeName))+">",N}if(ye(ie)){if(ie.length===0)return"[]";var Ae=Se(ie,it);return mt&&!U(Ae)?"["+fe(Ae,mt)+"]":"[ "+R.call(Ae,", ")+" ]"}if(Y(ie)){var Ie=Se(ie,it);return!("cause"in Error.prototype)&&"cause"in ie&&!ae.call(ie,"cause")?"{ ["+String(ie)+"] "+R.call(S.call("[cause]: "+it(ie.cause),Ie),", ")+" }":Ie.length===0?"["+String(ie)+"]":"{ ["+String(ie)+"] "+R.call(Ie,", ")+" }"}if(typeof ie=="object"&&pt){if(Z&&typeof ie[Z]=="function"&&re)return re(ie,{depth:or-Oe});if(pt!=="symbol"&&typeof ie.inspect=="function")return ie.inspect()}if(he(ie)){var Ge=[];return o&&o.call(ie,function(yt,xt){Ge.push(it(xt,ie,!0)+" => "+it(yt,ie))}),I("Map",r.call(ie),Ge,mt)}if(H(ie)){var Ze=[];return s&&s.call(ie,function(yt){Ze.push(it(yt,ie))}),I("Set",i.call(ie),Ze,mt)}if(de(ie))return _("WeakMap");if(ge(ie))return _("WeakSet");if(ve(ie))return _("WeakRef");if(ne(ie))return d(it(Number(ie)));if(z(ie))return d(it(B.call(ie)));if(V(ie))return d(h.call(ie));if(D(ie))return d(it(String(ie)));if(typeof window<"u"&&ie===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ie===globalThis||typeof mn<"u"&&ie===mn)return"{ [object globalThis] }";if(!te(ie)&&!Ee(ie)){var lt=Se(ie,it),_r=X?X(ie)===Object.prototype:ie instanceof Object||ie.constructor===Object,Er=ie instanceof Object?"":"null prototype",wr=!_r&&k&&Object(ie)===ie&&k in ie?b.call(C(ie),8,-1):Er?"Object":"",Vr=_r||typeof ie.constructor!="function"?"":ie.constructor.name?ie.constructor.name+" ":"",Vt=Vr+(wr||Er?"["+R.call(S.call([],wr||[],Er||[]),": ")+"] ":"");return lt.length===0?Vt+"{}":mt?Vt+"{"+fe(lt,mt)+"}":Vt+"{ "+R.call(lt,", ")+" }"}return String(ie)};function M($,ie,Re){var Oe=(Re.quoteStyle||ie)==="double"?'"':"'";return Oe+$+Oe}function Q($){return E.call(String($),/"/g,"&quot;")}function ye($){return C($)==="[object Array]"&&(!k||!(typeof $=="object"&&k in $))}function te($){return C($)==="[object Date]"&&(!k||!(typeof $=="object"&&k in $))}function Ee($){return C($)==="[object RegExp]"&&(!k||!(typeof $=="object"&&k in $))}function Y($){return C($)==="[object Error]"&&(!k||!(typeof $=="object"&&k in $))}function D($){return C($)==="[object String]"&&(!k||!(typeof $=="object"&&k in $))}function ne($){return C($)==="[object Number]"&&(!k||!(typeof $=="object"&&k in $))}function V($){return C($)==="[object Boolean]"&&(!k||!(typeof $=="object"&&k in $))}function K($){if(F)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!G)return!1;try{return G.call($),!0}catch{}return!1}function z($){if(!$||typeof $!="object"||!B)return!1;try{return B.call($),!0}catch{}return!1}var me=Object.prototype.hasOwnProperty||function($){return $ in(this||mn)};function oe($,ie){return me.call($,ie)}function C($){return g.call($)}function W($){if($.name)return $.name;var ie=w.call(y.call($),/^function\s*([\w$]+)/);return ie?ie[1]:null}function ee($,ie){if($.indexOf)return $.indexOf(ie);for(var Re=0,Oe=$.length;Re<Oe;Re++)if($[Re]===ie)return Re;return-1}function he($){if(!r||!$||typeof $!="object")return!1;try{r.call($);try{i.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function de($){if(!l||!$||typeof $!="object")return!1;try{l.call($,l);try{f.call($,f)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function ve($){if(!m||!$||typeof $!="object")return!1;try{return m.call($),!0}catch{}return!1}function H($){if(!i||!$||typeof $!="object")return!1;try{i.call($);try{r.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function ge($){if(!f||!$||typeof $!="object")return!1;try{f.call($,f);try{l.call($,l)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function _e($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function se($,ie){if($.length>ie.maxStringLength){var Re=$.length-ie.maxStringLength,Oe="... "+Re+" more character"+(Re>1?"s":"");return se(b.call($,0,ie.maxStringLength),ie)+Oe}var Le=E.call(E.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Me);return M(Le,"single",ie)}function Me($){var ie=$.charCodeAt(0),Re={8:"b",9:"t",10:"n",12:"f",13:"r"}[ie];return Re?"\\"+Re:"\\x"+(ie<16?"0":"")+T.call(ie.toString(16))}function d($){return"Object("+$+")"}function _($){return $+" { ? }"}function I($,ie,Re,Oe){var Le=Oe?fe(Re,Oe):R.call(Re,", ");return $+" ("+ie+") {"+Le+"}"}function U($){for(var ie=0;ie<$.length;ie++)if(ee($[ie],`
388
- `)>=0)return!1;return!0}function J($,ie){var Re;if($.indent===" ")Re=" ";else if(typeof $.indent=="number"&&$.indent>0)Re=R.call(Array($.indent+1)," ");else return null;return{base:Re,prev:R.call(Array(ie+1),Re)}}function fe($,ie){if($.length===0)return"";var Re=`
389
- `+ie.prev+ie.base;return Re+R.call($,","+Re)+`
390
- `+ie.prev}function Se($,ie){var Re=ye($),Oe=[];if(Re){Oe.length=$.length;for(var Le=0;Le<$.length;Le++)Oe[Le]=oe($,Le)?ie($[Le],$):""}var Pe=typeof O=="function"?O($):[],pt;if(F){pt={};for(var gt=0;gt<Pe.length;gt++)pt["$"+Pe[gt]]=Pe[gt]}for(var Ke in $)oe($,Ke)&&(Re&&String(Number(Ke))===Ke&&Ke<$.length||F&&pt["$"+Ke]instanceof Symbol||(A.call(/[^\w$]/,Ke)?Oe.push(ie(Ke,$)+": "+ie($[Ke],$)):Oe.push(Ke+": "+ie($[Ke],$))));if(typeof O=="function")for(var bt=0;bt<Pe.length;bt++)ae.call($,Pe[bt])&&Oe.push("["+ie(Pe[bt])+"]: "+ie($[Pe[bt]],$));return Oe}return bn}function sv(){if(Ko)return yn;Ko=!0;var e=yr(),t=$0(),r=ov(),o=Gr(),u=e("%WeakMap%",!0),n=e("%Map%",!0),i=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),a=t("WeakMap.prototype.has",!0),l=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),f=t("Map.prototype.has",!0),p=function(y,w){for(var b=y,E;(E=b.next)!==null;b=E)if(E.key===w)return b.next=E.next,E.next=y.next,y.next=E,E},m=function(y,w){var b=p(y,w);return b&&b.value},h=function(y,w,b){var E=p(y,w);E?E.value=b:y.next={key:w,next:y.next,value:b}},g=function(y,w){return!!p(y,w)};return yn=function(){var y,w,b,E={assert:function(T){if(!E.has(T))throw new o("Side channel does not contain "+r(T))},get:function(T){if(u&&T&&(typeof T=="object"||typeof T=="function")){if(y)return i(y,T)}else if(n){if(w)return l(w,T)}else if(b)return m(b,T)},has:function(T){if(u&&T&&(typeof T=="object"||typeof T=="function")){if(y)return a(y,T)}else if(n){if(w)return f(w,T)}else if(b)return g(b,T);return!1},set:function(T,v){u&&T&&(typeof T=="object"||typeof T=="function")?(y||(y=new u),s(y,T,v)):n?(w||(w=new n),c(w,T,v)):(b||(b={key:{},next:null}),h(b,T,v))}};return E},yn}function Ls(){if(Xo)return vn;Xo=!0;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return vn={default:r.RFC3986,formatters:{RFC1738:function(o){return e.call(o,t,"+")},RFC3986:function(o){return String(o)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},vn}function Hh(){if(zo)return _n;zo=!0;var e=Ls(),t=Object.prototype.hasOwnProperty,r=Array.isArray,o=(function(){for(var y=[],w=0;w<256;++w)y.push("%"+((w<16?"0":"")+w.toString(16)).toUpperCase());return y})(),u=function(y){for(;y.length>1;){var w=y.pop(),b=w.obj[w.prop];if(r(b)){for(var E=[],T=0;T<b.length;++T)typeof b[T]<"u"&&E.push(b[T]);w.obj[w.prop]=E}}},n=function(y,w){for(var b=w&&w.plainObjects?Object.create(null):{},E=0;E<y.length;++E)typeof y[E]<"u"&&(b[E]=y[E]);return b},i=function y(w,b,E){if(!b)return w;if(typeof b!="object"){if(r(w))w.push(b);else if(w&&typeof w=="object")(E&&(E.plainObjects||E.allowPrototypes)||!t.call(Object.prototype,b))&&(w[b]=!0);else return[w,b];return w}if(!w||typeof w!="object")return[w].concat(b);var T=w;return r(w)&&!r(b)&&(T=n(w,E)),r(w)&&r(b)?(b.forEach(function(v,A){if(t.call(w,A)){var S=w[A];S&&typeof S=="object"&&v&&typeof v=="object"?w[A]=y(S,v,E):w.push(v)}else w[A]=v}),w):Object.keys(b).reduce(function(v,A){var S=b[A];return t.call(v,A)?v[A]=y(v[A],S,E):v[A]=S,v},T)},s=function(y,w){return Object.keys(w).reduce(function(b,E){return b[E]=w[E],b},y)},a=function(y,w,b){var E=y.replace(/\+/g," ");if(b==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},l=1024,c=function(y,w,b,E,T){if(y.length===0)return y;var v=y;if(typeof y=="symbol"?v=Symbol.prototype.toString.call(y):typeof y!="string"&&(v=String(y)),b==="iso-8859-1")return escape(v).replace(/%u[0-9a-f]{4}/gi,function(O){return"%26%23"+parseInt(O.slice(2),16)+"%3B"});for(var A="",S=0;S<v.length;S+=l){for(var R=v.length>=l?v.slice(S,S+l):v,P=[],L=0;L<R.length;++L){var B=R.charCodeAt(L);if(B===45||B===46||B===95||B===126||B>=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||T===e.RFC1738&&(B===40||B===41)){P[P.length]=R.charAt(L);continue}if(B<128){P[P.length]=o[B];continue}if(B<2048){P[P.length]=o[192|B>>6]+o[128|B&63];continue}if(B<55296||B>=57344){P[P.length]=o[224|B>>12]+o[128|B>>6&63]+o[128|B&63];continue}L+=1,B=65536+((B&1023)<<10|R.charCodeAt(L)&1023),P[P.length]=o[240|B>>18]+o[128|B>>12&63]+o[128|B>>6&63]+o[128|B&63]}A+=P.join("")}return A},f=function(y){for(var w=[{obj:{o:y},prop:"o"}],b=[],E=0;E<w.length;++E)for(var T=w[E],v=T.obj[T.prop],A=Object.keys(v),S=0;S<A.length;++S){var R=A[S],P=v[R];typeof P=="object"&&P!==null&&b.indexOf(P)===-1&&(w.push({obj:v,prop:R}),b.push(P))}return u(w),y},p=function(y){return Object.prototype.toString.call(y)==="[object RegExp]"},m=function(y){return!y||typeof y!="object"?!1:!!(y.constructor&&y.constructor.isBuffer&&y.constructor.isBuffer(y))},h=function(y,w){return[].concat(y,w)},g=function(y,w){if(r(y)){for(var b=[],E=0;E<y.length;E+=1)b.push(w(y[E]));return b}return w(y)};return _n={arrayToObject:n,assign:s,combine:h,compact:f,decode:a,encode:c,isBuffer:m,isRegExp:p,maybeMap:g,merge:i},_n}function av(){if(Qo)return En;Qo=!0;var e=sv(),t=Hh(),r=Ls(),o=Object.prototype.hasOwnProperty,u={brackets:function(g){return g+"[]"},comma:"comma",indices:function(g,y){return g+"["+y+"]"},repeat:function(g){return g}},n=Array.isArray,i=Array.prototype.push,s=function(g,y){i.apply(g,n(y)?y:[y])},a=Date.prototype.toISOString,l=r.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:l,formatter:r.formatters[l],indices:!1,serializeDate:function(g){return a.call(g)},skipNulls:!1,strictNullHandling:!1},f=function(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"},p={},m=function g(y,w,b,E,T,v,A,S,R,P,L,B,O,G,F,k,ae,X){for(var q=y,re=X,j=0,Z=!1;(re=re.get(p))!==void 0&&!Z;){var M=re.get(y);if(j+=1,typeof M<"u"){if(M===j)throw new RangeError("Cyclic object value");Z=!0}typeof re.get(p)>"u"&&(j=0)}if(typeof P=="function"?q=P(w,q):q instanceof Date?q=O(q):b==="comma"&&n(q)&&(q=t.maybeMap(q,function(C){return C instanceof Date?O(C):C})),q===null){if(v)return R&&!k?R(w,c.encoder,ae,"key",G):w;q=""}if(f(q)||t.isBuffer(q)){if(R){var Q=k?w:R(w,c.encoder,ae,"key",G);return[F(Q)+"="+F(R(q,c.encoder,ae,"value",G))]}return[F(w)+"="+F(String(q))]}var ye=[];if(typeof q>"u")return ye;var te;if(b==="comma"&&n(q))k&&R&&(q=t.maybeMap(q,R)),te=[{value:q.length>0?q.join(",")||null:void 0}];else if(n(P))te=P;else{var Ee=Object.keys(q);te=L?Ee.sort(L):Ee}var Y=S?w.replace(/\./g,"%2E"):w,D=E&&n(q)&&q.length===1?Y+"[]":Y;if(T&&n(q)&&q.length===0)return D+"[]";for(var ne=0;ne<te.length;++ne){var V=te[ne],K=typeof V=="object"&&typeof V.value<"u"?V.value:q[V];if(!(A&&K===null)){var z=B&&S?V.replace(/\./g,"%2E"):V,me=n(q)?typeof b=="function"?b(D,z):D:D+(B?"."+z:"["+z+"]");X.set(y,j);var oe=e();oe.set(p,X),s(ye,g(K,me,b,E,T,v,A,S,b==="comma"&&k&&n(q)?null:R,P,L,B,O,G,F,k,ae,oe))}}return ye},h=function(g){if(!g)return c;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.encodeDotInKeys<"u"&&typeof g.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=g.charset||c.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var w=r.default;if(typeof g.format<"u"){if(!o.call(r.formatters,g.format))throw new TypeError("Unknown format option provided.");w=g.format}var b=r.formatters[w],E=c.filter;(typeof g.filter=="function"||n(g.filter))&&(E=g.filter);var T;if(g.arrayFormat in u?T=g.arrayFormat:"indices"in g?T=g.indices?"indices":"repeat":T=c.arrayFormat,"commaRoundTrip"in g&&typeof g.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=typeof g.allowDots>"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:v,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:T,charset:y,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:E,format:w,formatter:b,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return En=function(g,y){var w=g,b=h(y),E,T;typeof b.filter=="function"?(T=b.filter,w=T("",w)):n(b.filter)&&(T=b.filter,E=T);var v=[];if(typeof w!="object"||w===null)return"";var A=u[b.arrayFormat],S=A==="comma"&&b.commaRoundTrip;E||(E=Object.keys(w)),b.sort&&E.sort(b.sort);for(var R=e(),P=0;P<E.length;++P){var L=E[P];b.skipNulls&&w[L]===null||s(v,m(w[L],L,A,S,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,R))}var B=v.join(b.delimiter),O=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?O+="utf8=%26%2310003%3B&":O+="utf8=%E2%9C%93&"),B.length>0?O+B:""},En}function lv(){if(Jo)return wn;Jo=!0;var e=Hh(),t=Object.prototype.hasOwnProperty,r=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},u=function(p){return p.replace(/&#(\d+);/g,function(m,h){return String.fromCharCode(parseInt(h,10))})},n=function(p,m){return p&&typeof p=="string"&&m.comma&&p.indexOf(",")>-1?p.split(","):p},i="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",a=function(p,m){var h={__proto__:null},g=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;g=g.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var y=m.parameterLimit===1/0?void 0:m.parameterLimit,w=g.split(m.delimiter,y),b=-1,E,T=m.charset;if(m.charsetSentinel)for(E=0;E<w.length;++E)w[E].indexOf("utf8=")===0&&(w[E]===s?T="utf-8":w[E]===i&&(T="iso-8859-1"),b=E,E=w.length);for(E=0;E<w.length;++E)if(E!==b){var v=w[E],A=v.indexOf("]="),S=A===-1?v.indexOf("="):A+1,R,P;S===-1?(R=m.decoder(v,o.decoder,T,"key"),P=m.strictNullHandling?null:""):(R=m.decoder(v.slice(0,S),o.decoder,T,"key"),P=e.maybeMap(n(v.slice(S+1),m),function(B){return m.decoder(B,o.decoder,T,"value")})),P&&m.interpretNumericEntities&&T==="iso-8859-1"&&(P=u(P)),v.indexOf("[]=")>-1&&(P=r(P)?[P]:P);var L=t.call(h,R);L&&m.duplicates==="combine"?h[R]=e.combine(h[R],P):(!L||m.duplicates==="last")&&(h[R]=P)}return h},l=function(p,m,h,g){for(var y=g?m:n(m,h),w=p.length-1;w>=0;--w){var b,E=p[w];if(E==="[]"&&h.parseArrays)b=h.allowEmptyArrays&&(y===""||h.strictNullHandling&&y===null)?[]:[].concat(y);else{b=h.plainObjects?Object.create(null):{};var T=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,v=h.decodeDotInKeys?T.replace(/%2E/g,"."):T,A=parseInt(v,10);!h.parseArrays&&v===""?b={0:y}:!isNaN(A)&&E!==v&&String(A)===v&&A>=0&&h.parseArrays&&A<=h.arrayLimit?(b=[],b[A]=y):v!=="__proto__"&&(b[v]=y)}y=b}return y},c=function(p,m,h,g){if(p){var y=h.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,w=/(\[[^[\]]*])/,b=/(\[[^[\]]*])/g,E=h.depth>0&&w.exec(y),T=E?y.slice(0,E.index):y,v=[];if(T){if(!h.plainObjects&&t.call(Object.prototype,T)&&!h.allowPrototypes)return;v.push(T)}for(var A=0;h.depth>0&&(E=b.exec(y))!==null&&A<h.depth;){if(A+=1,!h.plainObjects&&t.call(Object.prototype,E[1].slice(1,-1))&&!h.allowPrototypes)return;v.push(E[1])}if(E){if(h.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+h.depth+" and strictDepth is true");v.push("["+y.slice(E.index)+"]")}return l(v,m,h,g)}},f=function(p){if(!p)return o;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=typeof p.charset>"u"?o.charset:p.charset,h=typeof p.duplicates>"u"?o.duplicates:p.duplicates;if(h!=="combine"&&h!=="first"&&h!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var g=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:o.allowDots:!!p.allowDots;return{allowDots:g,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:o.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:o.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:o.arrayLimit,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:o.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:o.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:o.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:o.decoder,delimiter:typeof p.delimiter=="string"||e.isRegExp(p.delimiter)?p.delimiter:o.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:o.depth,duplicates:h,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:o.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:o.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:o.strictDepth,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:o.strictNullHandling}};return wn=function(p,m){var h=f(m);if(p===""||p===null||typeof p>"u")return h.plainObjects?Object.create(null):{};for(var g=typeof p=="string"?a(p,h):p,y=h.plainObjects?Object.create(null):{},w=Object.keys(g),b=0;b<w.length;++b){var E=w[b],T=c(E,g[E],h,typeof p=="string");y=e.merge(y,T,h)}return h.allowSparse===!0?y:e.compact(y)},wn}function uv(){if(Zo)return Sn;Zo=!0;var e=av(),t=lv(),r=Ls();return Sn={formats:r,parse:t,stringify:e},Sn}function cv(){if(es)return jt;es=!0;var e=Ft;function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,n=["<",">",'"',"`"," ","\r",`
391
- `," "],i=["{","}","|","\\","^","`"].concat(n),s=["'"].concat(i),a=["%","/","?",";","#"].concat(s),l=["/","?","#"],c=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=uv();function w(v,A,S){if(v&&typeof v=="object"&&v instanceof t)return v;var R=new t;return R.parse(v,A,S),R}t.prototype.parse=function(v,A,S){if(typeof v!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof v);var R=v.indexOf("?"),P=R!==-1&&R<v.indexOf("#")?"?":"#",L=v.split(P),B=/\\/g;L[0]=L[0].replace(B,"/"),v=L.join(P);var O=v;if(O=O.trim(),!S&&v.split("#").length===1){var G=u.exec(O);if(G)return this.path=O,this.href=O,this.pathname=G[1],G[2]?(this.search=G[2],A?this.query=y.parse(this.search.substr(1)):this.query=this.search.substr(1)):A&&(this.search="",this.query={}),this}var F=r.exec(O);if(F){F=F[0];var k=F.toLowerCase();this.protocol=k,O=O.substr(F.length)}if(S||F||O.match(/^\/\/[^@/]+@[^@/]+/)){var ae=O.substr(0,2)==="//";ae&&!(F&&h[F])&&(O=O.substr(2),this.slashes=!0)}if(!h[F]&&(ae||F&&!g[F])){for(var X=-1,q=0;q<l.length;q++){var re=O.indexOf(l[q]);re!==-1&&(X===-1||re<X)&&(X=re)}var j,Z;X===-1?Z=O.lastIndexOf("@"):Z=O.lastIndexOf("@",X),Z!==-1&&(j=O.slice(0,Z),O=O.slice(Z+1),this.auth=decodeURIComponent(j)),X=-1;for(var q=0;q<a.length;q++){var re=O.indexOf(a[q]);re!==-1&&(X===-1||re<X)&&(X=re)}X===-1&&(X=O.length),this.host=O.slice(0,X),O=O.slice(X),this.parseHost(),this.hostname=this.hostname||"";var M=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!M)for(var Q=this.hostname.split(/\./),q=0,ye=Q.length;q<ye;q++){var te=Q[q];if(te&&!te.match(f)){for(var Ee="",Y=0,D=te.length;Y<D;Y++)te.charCodeAt(Y)>127?Ee+="x":Ee+=te[Y];if(!Ee.match(f)){var ne=Q.slice(0,q),V=Q.slice(q+1),K=te.match(p);K&&(ne.push(K[1]),V.unshift(K[2])),V.length&&(O="/"+V.join(".")+O),this.hostname=ne.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=e.toASCII(this.hostname));var z=this.port?":"+this.port:"",me=this.hostname||"";this.host=me+z,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),O[0]!=="/"&&(O="/"+O))}if(!m[k])for(var q=0,ye=s.length;q<ye;q++){var oe=s[q];if(O.indexOf(oe)!==-1){var C=encodeURIComponent(oe);C===oe&&(C=escape(oe)),O=O.split(oe).join(C)}}var W=O.indexOf("#");W!==-1&&(this.hash=O.substr(W),O=O.slice(0,W));var ee=O.indexOf("?");if(ee!==-1?(this.search=O.substr(ee),this.query=O.substr(ee+1),A&&(this.query=y.parse(this.query)),O=O.slice(0,ee)):A&&(this.search="",this.query={}),O&&(this.pathname=O),g[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var z=this.pathname||"",he=this.search||"";this.path=z+he}return this.href=this.format(),this};function b(v){return typeof v=="string"&&(v=w(v)),v instanceof t?v.format():t.prototype.format.call(v)}t.prototype.format=function(){var v=this.auth||"";v&&(v=encodeURIComponent(v),v=v.replace(/%3A/i,":"),v+="@");var A=this.protocol||"",S=this.pathname||"",R=this.hash||"",P=!1,L="";this.host?P=v+this.host:this.hostname&&(P=v+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(P+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(L=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var B=this.search||L&&"?"+L||"";return A&&A.substr(-1)!==":"&&(A+=":"),this.slashes||(!A||g[A])&&P!==!1?(P="//"+(P||""),S&&S.charAt(0)!=="/"&&(S="/"+S)):P||(P=""),R&&R.charAt(0)!=="#"&&(R="#"+R),B&&B.charAt(0)!=="?"&&(B="?"+B),S=S.replace(/[?#]/g,function(O){return encodeURIComponent(O)}),B=B.replace("#","%23"),A+P+S+B+R};function E(v,A){return w(v,!1,!0).resolve(A)}t.prototype.resolve=function(v){return this.resolveObject(w(v,!1,!0)).format()};function T(v,A){return v?w(v,!1,!0).resolveObject(A):A}return t.prototype.resolveObject=function(v){if(typeof v=="string"){var A=new t;A.parse(v,!1,!0),v=A}for(var S=new t,R=Object.keys(this),P=0;P<R.length;P++){var L=R[P];S[L]=this[L]}if(S.hash=v.hash,v.href==="")return S.href=S.format(),S;if(v.slashes&&!v.protocol){for(var B=Object.keys(v),O=0;O<B.length;O++){var G=B[O];G!=="protocol"&&(S[G]=v[G])}return g[S.protocol]&&S.hostname&&!S.pathname&&(S.pathname="/",S.path=S.pathname),S.href=S.format(),S}if(v.protocol&&v.protocol!==S.protocol){if(!g[v.protocol]){for(var F=Object.keys(v),k=0;k<F.length;k++){var ae=F[k];S[ae]=v[ae]}return S.href=S.format(),S}if(S.protocol=v.protocol,!v.host&&!h[v.protocol]){for(var ye=(v.pathname||"").split("/");ye.length&&!(v.host=ye.shift()););v.host||(v.host=""),v.hostname||(v.hostname=""),ye[0]!==""&&ye.unshift(""),ye.length<2&&ye.unshift(""),S.pathname=ye.join("/")}else S.pathname=v.pathname;if(S.search=v.search,S.query=v.query,S.host=v.host||"",S.auth=v.auth,S.hostname=v.hostname||v.host,S.port=v.port,S.pathname||S.search){var X=S.pathname||"",q=S.search||"";S.path=X+q}return S.slashes=S.slashes||v.slashes,S.href=S.format(),S}var re=S.pathname&&S.pathname.charAt(0)==="/",j=v.host||v.pathname&&v.pathname.charAt(0)==="/",Z=j||re||S.host&&v.pathname,M=Z,Q=S.pathname&&S.pathname.split("/")||[],ye=v.pathname&&v.pathname.split("/")||[],te=S.protocol&&!g[S.protocol];if(te&&(S.hostname="",S.port=null,S.host&&(Q[0]===""?Q[0]=S.host:Q.unshift(S.host)),S.host="",v.protocol&&(v.hostname=null,v.port=null,v.host&&(ye[0]===""?ye[0]=v.host:ye.unshift(v.host)),v.host=null),Z=Z&&(ye[0]===""||Q[0]==="")),j)S.host=v.host||v.host===""?v.host:S.host,S.hostname=v.hostname||v.hostname===""?v.hostname:S.hostname,S.search=v.search,S.query=v.query,Q=ye;else if(ye.length)Q||(Q=[]),Q.pop(),Q=Q.concat(ye),S.search=v.search,S.query=v.query;else if(v.search!=null){if(te){S.host=Q.shift(),S.hostname=S.host;var Ee=S.host&&S.host.indexOf("@")>0?S.host.split("@"):!1;Ee&&(S.auth=Ee.shift(),S.hostname=Ee.shift(),S.host=S.hostname)}return S.search=v.search,S.query=v.query,(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!Q.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var Y=Q.slice(-1)[0],D=(S.host||v.host||Q.length>1)&&(Y==="."||Y==="..")||Y==="",ne=0,V=Q.length;V>=0;V--)Y=Q[V],Y==="."?Q.splice(V,1):Y===".."?(Q.splice(V,1),ne++):ne&&(Q.splice(V,1),ne--);if(!Z&&!M)for(;ne--;ne)Q.unshift("..");Z&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),D&&Q.join("/").substr(-1)!=="/"&&Q.push("");var K=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(te){S.hostname=K?"":Q.length?Q.shift():"",S.host=S.hostname;var Ee=S.host&&S.host.indexOf("@")>0?S.host.split("@"):!1;Ee&&(S.auth=Ee.shift(),S.hostname=Ee.shift(),S.host=S.hostname)}return Z=Z||S.host&&Q.length,Z&&!K&&Q.unshift(""),Q.length>0?S.pathname=Q.join("/"):(S.pathname=null,S.path=null),(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=v.auth||S.auth,S.slashes=S.slashes||v.slashes,S.href=S.format(),S},t.prototype.parseHost=function(){var v=this.host,A=o.exec(v);A&&(A=A[0],A!==":"&&(this.port=A.substr(1)),v=v.substr(0,v.length-A.length)),v&&(this.hostname=v)},jt.parse=w,jt.resolve=E,jt.resolveObject=T,jt.format=b,jt.Url=t,jt}function Vh(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return In?fv(e):hv(e)}function fv(e){let t=e.hostname,r=e.pathname;for(let o=0;o<r.length;o++)if(r[o]==="%"){let u=r.codePointAt(o+2)||32;if(r[o+1]==="2"&&u===102||r[o+1]==="5"&&u===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(nd,"\\"),r=decodeURIComponent(r),t!=="")return`\\\\${t}${r}`;{let o=r.codePointAt(1)|32,u=r[2];if(o<td||o>rd||u!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function hv(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let o=t.codePointAt(r+2)||32;if(t[r+1]==="2"&&o===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function $h(e){let t=qo.resolve(e),r=e.charCodeAt(e.length-1);(r===ed||In&&r===Zh)&&t[t.length-1]!==qo.sep&&(t+="/");let o=new URL("file://");return t.includes("%")&&(t=t.replace(id,"%25")),!In&&t.includes("\\")&&(t=t.replace(od,"%5C")),t.includes(`
392
- `)&&(t=t.replace(sd,"%0A")),t.includes("\r")&&(t=t.replace(ad,"%0D")),t.includes(" ")&&(t=t.replace(ld,"%09")),o.pathname=t,o}var qh,bn,Yo,mn,yn,Ko,vn,Xo,_n,zo,En,Qo,wn,Jo,Sn,Zo,jt,es,Qe,il,Yh,Kh,Xh,zh,Qh,Jh,Zh,ed,td,rd,In,nd,id,od,sd,ad,ld,dv=nt(()=>{le(),ce(),ue(),L0(),q0(),iv(),Wh(),qh=Object.freeze(Object.create(null)),bn={},Yo=!1,mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,yn={},Ko=!1,vn={},Xo=!1,_n={},zo=!1,En={},Qo=!1,wn={},Jo=!1,Sn={},Zo=!1,jt={},es=!1,Qe=cv(),Qe.parse,Qe.resolve,Qe.resolveObject,Qe.format,Qe.Url,il=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Qe.URL=typeof URL<"u"?URL:null,Qe.pathToFileURL=$h,Qe.fileURLToPath=Vh,Yh=Qe.Url,Kh=Qe.format,Xh=Qe.resolve,zh=Qe.resolveObject,Qh=Qe.parse,Jh=Qe.URL,Zh=92,ed=47,td=97,rd=122,In=il==="win32",nd=/\//g,id=/%/g,od=/\\/g,sd=/\n/g,ad=/\r/g,ld=/\t/g}),pv=pe((e,t)=>{le(),ce(),ue(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Ms=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=o;var t=ir(),r=($e(),ke(Ve));function o(n,i){let s=new Array(n.length);for(let a=0;a<n.length;a++)typeof n[a].chunk=="string"?s[a]=r.Buffer.from(n[a].chunk,"utf8"):s[a]=n[a].chunk;this._write(r.Buffer.concat(s),"binary",i)}var u=class extends t.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(n,i,s){super({objectMode:!0}),this.proxy=i,this.socket=s,this.writeQueue=[],n.objectMode||(this._writev=o.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",a=>{!this.destroyed&&this.readable&&this.push(a)})}_read(n){this.proxy.read(n)}_write(n,i,s){this.isSocketOpen?this.writeToProxy(n,i,s):this.writeQueue.push({chunk:n,encoding:i,cb:s})}_final(n){this.writeQueue=[],this.proxy.end(n)}_destroy(n,i){this.writeQueue=[],this.proxy.destroy(),i(n)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(n,i,s){this.proxy.write(n,i)===!1?this.proxy.once("drain",s):s()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:n,encoding:i,cb:s}=this.writeQueue.shift();this.writeToProxy(n,i,s)}}};e.BufferedDuplex=u}),Kr=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=($e(),ke(Ve)),o=t(pv()),u=t(Lt()),n=ir(),i=t(Cn()),s=Ms(),a=(0,u.default)("mqttjs:ws"),l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(w,b){let E=`${w.protocol}://${w.hostname}:${w.port}${w.path}`;return typeof w.transformWsUrl=="function"&&(E=w.transformWsUrl(E,w,b)),E}function f(w){let b=w;return w.port||(w.protocol==="wss"?b.port=443:b.port=80),w.path||(b.path="/"),w.wsOptions||(b.wsOptions={}),!i.default&&!w.forceNativeWebSocket&&w.protocol==="wss"&&l.forEach(E=>{Object.prototype.hasOwnProperty.call(w,E)&&!Object.prototype.hasOwnProperty.call(w.wsOptions,E)&&(b.wsOptions[E]=w[E])}),b}function p(w){let b=f(w);if(b.hostname||(b.hostname=b.host),!b.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let E=new URL(document.URL);b.hostname=E.hostname,b.port||(b.port=Number(E.port))}return b.objectMode===void 0&&(b.objectMode=!(b.binary===!0||b.binary===void 0)),b}function m(w,b,E){a("createWebSocket"),a(`protocol: ${E.protocolId} ${E.protocolVersion}`);let T=E.protocolId==="MQIsdp"&&E.protocolVersion===3?"mqttv3.1":"mqtt";a(`creating new Websocket for url: ${b} and protocol: ${T}`);let v;return E.createWebsocket?v=E.createWebsocket(b,[T],E):v=new o.default(b,[T],E.wsOptions),v}function h(w,b){let E=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt",T=c(b,w),v;return b.createWebsocket?v=b.createWebsocket(T,[E],b):v=new WebSocket(T,[E]),v.binaryType="arraybuffer",v}var g=(w,b)=>{a("streamBuilder");let E=f(b);E.hostname=E.hostname||E.host||"localhost";let T=c(E,w),v=m(w,T,E),A=o.default.createWebSocketStream(v,E.wsOptions);return A.url=T,v.on("close",()=>{A.destroy()}),A};e.streamBuilder=g;var y=(w,b)=>{a("browserStreamBuilder");let E,T=p(b).browserBufferSize||1024*512,v=b.browserBufferTimeout||1e3,A=!b.objectMode,S=h(w,b),R=L(b,k,ae);b.objectMode||(R._writev=s.writev.bind(R)),R.on("close",()=>{S.close()});let P=typeof S.addEventListener<"u";S.readyState===S.OPEN?(E=R,E.socket=S):(E=new s.BufferedDuplex(b,R,S),P?S.addEventListener("open",B):S.onopen=B),P?(S.addEventListener("close",O),S.addEventListener("error",G),S.addEventListener("message",F)):(S.onclose=O,S.onerror=G,S.onmessage=F);function L(X,q,re){let j=new n.Transform({objectMode:X.objectMode});return j._write=q,j._flush=re,j}function B(){a("WebSocket onOpen"),E instanceof s.BufferedDuplex&&E.socketReady()}function O(X){a("WebSocket onClose",X),E.end(),E.destroy()}function G(X){a("WebSocket onError",X);let q=new Error("WebSocket error");q.event=X,E.destroy(q)}async function F(X){if(!R||!R.readable||!R.writable)return;let{data:q}=X;q instanceof ArrayBuffer?q=r.Buffer.from(q):q instanceof Blob?q=r.Buffer.from(await new Response(q).arrayBuffer()):q=r.Buffer.from(q,"utf8"),R.push(q)}function k(X,q,re){if(S.bufferedAmount>T){setTimeout(k,v,X,q,re);return}A&&typeof X=="string"&&(X=r.Buffer.from(X,"utf8"));try{S.send(X)}catch(j){return re(j)}re()}function ae(X){S.close(),X()}return E};e.browserStreamBuilder=y}),Ps={};gr(Ps,{Server:()=>Fe,Socket:()=>Fe,Stream:()=>Fe,_createServerHandle:()=>Fe,_normalizeArgs:()=>Fe,_setSimultaneousAccepts:()=>Fe,connect:()=>Fe,createConnection:()=>Fe,createServer:()=>Fe,default:()=>ud,isIP:()=>Fe,isIPv4:()=>Fe,isIPv6:()=>Fe});function Fe(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var ud,cd=nt(()=>{le(),ce(),ue(),ud={_createServerHandle:Fe,_normalizeArgs:Fe,_setSimultaneousAccepts:Fe,connect:Fe,createConnection:Fe,createServer:Fe,isIP:Fe,isIPv4:Fe,isIPv6:Fe,Server:Fe,Socket:Fe,Stream:Fe}}),fd=pe((e,t)=>{le(),ce(),ue(),t.exports={}}),ol=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((cd(),ke(Ps))),o=t(Lt()),u=t(fd()),n=(0,o.default)("mqttjs:tcp"),i=(s,a)=>{if(a.port=a.port||1883,a.hostname=a.hostname||a.host||"localhost",a.socksProxy)return(0,u.default)(a.hostname,a.port,a.socksProxy,{timeout:a.socksTimeout});let{port:l,path:c}=a,f=a.hostname;return n("port %d and host %s",l,f),r.default.createConnection({port:l,host:f,path:c})};e.default=i}),hd={};gr(hd,{default:()=>dd});var dd,gv=nt(()=>{le(),ce(),ue(),dd={}}),sl=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0});var r=(gv(),ke(hd)),o=t((cd(),ke(Ps))),u=t(Lt()),n=t(fd()),i=(0,u.default)("mqttjs:tls");function s(l){let{host:c,port:f,socksProxy:p,...m}=l;if(p!==void 0){let h=(0,n.default)(c,f,p,{timeout:l.socksTimeout});return(0,r.connect)({...m,socket:h})}return(0,r.connect)(l)}var a=(l,c)=>{c.port=c.port||8883,c.host=c.hostname||c.host||"localhost",o.default.isIP(c.host)===0&&(c.servername=c.host),c.rejectUnauthorized=c.rejectUnauthorized!==!1,delete c.path,i("port %d host %s rejectUnauthorized %b",c.port,c.host,c.rejectUnauthorized);let f=s(c);f.on("secureConnect",()=>{c.rejectUnauthorized&&!f.authorized?f.emit("error",new Error("TLS not authorized")):f.removeListener("error",p)});function p(m){c.rejectUnauthorized&&l.emit("error",m),f.end()}return f.on("error",p),f};e.default=a}),al=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=($e(),ke(Ve)),r=ir(),o=Ms(),u,n,i;function s(){let p=new r.Transform;return p._write=(m,h,g)=>{u.send({data:m.buffer,success(){g()},fail(y){g(new Error(y))}})},p._flush=m=>{u.close({success(){m()}})},p}function a(p){p.hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={})}function l(p,m){let h=p.protocol==="wxs"?"wss":"ws",g=`${h}://${p.hostname}${p.path}`;return p.port&&p.port!==80&&p.port!==443&&(g=`${h}://${p.hostname}:${p.port}${p.path}`),typeof p.transformWsUrl=="function"&&(g=p.transformWsUrl(g,p,m)),g}function c(){u.onOpen(()=>{i.socketReady()}),u.onMessage(p=>{let{data:m}=p;m instanceof ArrayBuffer?m=t.Buffer.from(m):m=t.Buffer.from(m,"utf8"),n.push(m)}),u.onClose(()=>{i.emit("close"),i.end(),i.destroy()}),u.onError(p=>{let m=new Error(p.errMsg);i.destroy(m)})}var f=(p,m)=>{if(m.hostname=m.hostname||m.host,!m.hostname)throw new Error("Could not determine host. Specify host manually.");let h=m.protocolId==="MQIsdp"&&m.protocolVersion===3?"mqttv3.1":"mqtt";a(m);let g=l(m,p);u=wx.connectSocket({url:g,protocols:[h]}),n=s(),i=new o.BufferedDuplex(m,n,u),i._destroy=(w,b)=>{u.close({success(){b&&b(w)}})};let y=i.destroy;return i.destroy=(w,b)=>(i.destroy=y,setTimeout(()=>{u.close({fail(){i._destroy(w,b)}})},0),i),c(),i};e.default=f}),ll=pe(e=>{le(),ce(),ue(),Object.defineProperty(e,"__esModule",{value:!0});var t=($e(),ke(Ve)),r=ir(),o=Ms(),u,n,i,s=!1;function a(){let m=new r.Transform;return m._write=(h,g,y)=>{u.sendSocketMessage({data:h.buffer,success(){y()},fail(){y(new Error)}})},m._flush=h=>{u.closeSocket({success(){h()}})},m}function l(m){m.hostname||(m.hostname="localhost"),m.path||(m.path="/"),m.wsOptions||(m.wsOptions={})}function c(m,h){let g=m.protocol==="alis"?"wss":"ws",y=`${g}://${m.hostname}${m.path}`;return m.port&&m.port!==80&&m.port!==443&&(y=`${g}://${m.hostname}:${m.port}${m.path}`),typeof m.transformWsUrl=="function"&&(y=m.transformWsUrl(y,m,h)),y}function f(){s||(s=!0,u.onSocketOpen(()=>{i.socketReady()}),u.onSocketMessage(m=>{if(typeof m.data=="string"){let h=t.Buffer.from(m.data,"base64");n.push(h)}else{let h=new FileReader;h.addEventListener("load",()=>{if(h.result instanceof ArrayBuffer){n.push(t.Buffer.from(h.result));return}n.push(t.Buffer.from(h.result,"utf-8"))}),h.readAsArrayBuffer(m.data)}}),u.onSocketClose(()=>{i.end(),i.destroy()}),u.onSocketError(m=>{i.destroy(m)}))}var p=(m,h)=>{if(h.hostname=h.hostname||h.host,!h.hostname)throw new Error("Could not determine host. Specify host manually.");let g=h.protocolId==="MQIsdp"&&h.protocolVersion===3?"mqttv3.1":"mqtt";l(h);let y=c(h,m);return u=h.my,u.connectSocket({url:y,protocols:g}),n=a(),i=new o.BufferedDuplex(h,n,u),f(),i};e.default=p}),bv=pe(e=>{le(),ce(),ue();var t=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=c;var r=t(Lt()),o=t((dv(),ke(Gh))),u=t(ho()),n=t(Cn());typeof Ue?.nextTick!="function"&&(Ue.nextTick=setImmediate);var i=(0,r.default)("mqttjs"),s=null;function a(f){let p;if(f.auth)if(p=f.auth.match(/^(.+):(.+)$/),p){let[,m,h]=p;f.username=m,f.password=h}else f.username=f.auth}function l(f,p){if(i("connecting to an MQTT broker..."),typeof f=="object"&&!p&&(p=f,f=""),p=p||{},f&&typeof f=="string"){let g=o.default.parse(f,!0),y={};if(g.port!=null&&(y.port=Number(g.port)),y.host=g.hostname,y.query=g.query,y.auth=g.auth,y.protocol=g.protocol,y.path=g.path,p={...y,...p},!p.protocol)throw new Error("Missing protocol");p.protocol=p.protocol.replace(/:$/,"")}if(p.unixSocket=p.unixSocket||p.protocol?.includes("+unix"),p.unixSocket?p.protocol=p.protocol.replace("+unix",""):!p.protocol?.startsWith("ws")&&!p.protocol?.startsWith("wx")&&delete p.path,a(p),p.query&&typeof p.query.clientId=="string"&&(p.clientId=p.query.clientId),n.default||p.unixSocket?p.socksProxy=void 0:p.socksProxy===void 0&&typeof Ue<"u"&&(p.socksProxy=Ue.env.MQTTJS_SOCKS_PROXY),p.cert&&p.key)if(p.protocol){if(["mqtts","wss","wxs","alis"].indexOf(p.protocol)===-1)switch(p.protocol){case"mqtt":p.protocol="mqtts";break;case"ws":p.protocol="wss";break;case"wx":p.protocol="wxs";break;case"ali":p.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${p.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(s||(s={},!n.default&&!p.forceNativeWebSocket?(s.ws=Kr().streamBuilder,s.wss=Kr().streamBuilder,s.mqtt=ol().default,s.tcp=ol().default,s.ssl=sl().default,s.tls=s.ssl,s.mqtts=sl().default):(s.ws=Kr().browserStreamBuilder,s.wss=Kr().browserStreamBuilder,s.wx=al().default,s.wxs=al().default,s.ali=ll().default,s.alis=ll().default)),!s[p.protocol]){let g=["mqtts","wss"].indexOf(p.protocol)!==-1;p.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((y,w)=>g&&w%2===0?!1:typeof s[y]=="function")[0]}if(p.clean===!1&&!p.clientId)throw new Error("Missing clientId for unclean clients");p.protocol&&(p.defaultProtocol=p.protocol);function m(g){return p.servers&&((!g._reconnectCount||g._reconnectCount===p.servers.length)&&(g._reconnectCount=0),p.host=p.servers[g._reconnectCount].host,p.port=p.servers[g._reconnectCount].port,p.protocol=p.servers[g._reconnectCount].protocol?p.servers[g._reconnectCount].protocol:p.defaultProtocol,p.hostname=p.host,g._reconnectCount++),i("calling streambuilder for",p.protocol),s[p.protocol](g,p)}let h=new u.default(m,p);return h.on("error",()=>{}),h}function c(f,p,m=!0){return new Promise((h,g)=>{let y=l(f,p),w={connect:E=>{b(),h(y)},end:()=>{b(),h(y)},error:E=>{b(),y.end(),g(E)}};m===!1&&(w.close=()=>{w.error(new Error("Couldn't connect to server"))});function b(){Object.keys(w).forEach(E=>{y.off(E,w[E])})}Object.keys(w).forEach(E=>{y.on(E,w[E])})})}e.default=l}),ul=pe(e=>{le(),ce(),ue();var t=e&&e.__createBinding||(Object.create?function(m,h,g,y){y===void 0&&(y=g);var w=Object.getOwnPropertyDescriptor(h,g);(!w||("get"in w?!h.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return h[g]}}),Object.defineProperty(m,y,w)}:function(m,h,g,y){y===void 0&&(y=g),m[y]=h[g]}),r=e&&e.__setModuleDefault||(Object.create?function(m,h){Object.defineProperty(m,"default",{enumerable:!0,value:h})}:function(m,h){m.default=h}),o=e&&e.__importStar||(function(){var m=function(h){return m=Object.getOwnPropertyNames||function(g){var y=[];for(var w in g)Object.prototype.hasOwnProperty.call(g,w)&&(y[y.length]=w);return y},m(h)};return function(h){if(h&&h.__esModule)return h;var g={};if(h!=null)for(var y=m(h),w=0;w<y.length;w++)y[w]!=="default"&&t(g,h,y[w]);return r(g,h),g}})(),u=e&&e.__exportStar||function(m,h){for(var g in m)g!=="default"&&!Object.prototype.hasOwnProperty.call(h,g)&&t(h,m,g)},n=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var i=n(ho());e.MqttClient=i.default;var s=n(Nh());e.DefaultMessageIdProvider=s.default;var a=n(O0());e.UniqueMessageIdProvider=a.default;var l=n(hh());e.Store=l.default;var c=o(bv());e.connect=c.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var f=n(kh());e.KeepaliveManager=f.default,e.Client=i.default,u(ho(),e),u(mr(),e),u(fh(),e);var p=Mn();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return p.ReasonCodes}})}),mv=pe(e=>{le(),ce(),ue();var t=e&&e.__createBinding||(Object.create?function(i,s,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(s,a);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,l,c)}:function(i,s,a,l){l===void 0&&(l=a),i[l]=s[a]}),r=e&&e.__setModuleDefault||(Object.create?function(i,s){Object.defineProperty(i,"default",{enumerable:!0,value:s})}:function(i,s){i.default=s}),o=e&&e.__importStar||(function(){var i=function(s){return i=Object.getOwnPropertyNames||function(a){var l=[];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(l[l.length]=c);return l},i(s)};return function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var l=i(s),c=0;c<l.length;c++)l[c]!=="default"&&t(a,s,l[c]);return r(a,s),a}})(),u=e&&e.__exportStar||function(i,s){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&t(s,i,a)};Object.defineProperty(e,"__esModule",{value:!0});var n=o(ul());e.default=n,u(ul(),e)});const yv=mv();class pd{instanceId;url;_client=null;_status=Je.DISCONNECTED;_subscriptions=new Map;_eventListeners={connect:new Set,disconnect:new Set,reconnect:new Set,error:new Set};_options;constructor(t,r,o){if(!t)throw new Error("MqttClient: instanceId 不能为空");if(!r)throw new Error("MqttClient: url 不能为空");if(!o.clientId)throw new Error("MqttClient: options.clientId 不能为空");this.instanceId=t,this.url=r,this._options={...o,keepalive:o.keepalive??Sr.keepalive,connectTimeout:o.connectTimeout??Sr.connectTimeout,reconnectPeriod:o.reconnectPeriod??Sr.reconnectPeriod,clean:o.clean??Sr.clean}}get status(){return this._status}connect(){this._status===Je.CONNECTED||this._status===Je.CONNECTING||(this._status=Je.CONNECTING,this._client=yv.connect(this.url,this._options),this._bindClientEvents())}disconnect(){if(!this._client){this._status=Je.DISCONNECTED;return}this._status=Je.DISCONNECTING,this._client.end(!1,{},()=>{this._status=Je.DISCONNECTED,this._emitEvent(St.DISCONNECT)})}subscribe(t,r){const o=Array.isArray(t)?t:[t];return o.forEach(u=>{this._subscriptions.has(u)||(this._subscriptions.set(u,new Set),this._client&&this._status===Je.CONNECTED&&this._client.subscribe(u)),this._subscriptions.get(u).add(r)}),()=>this.unsubscribe(o)}unsubscribe(t){(Array.isArray(t)?t:[t]).forEach(o=>{this._subscriptions.delete(o),this._client&&this._status===Je.CONNECTED&&this._client.unsubscribe(o)})}publish(t,r,o){return new Promise((u,n)=>{if(!this._client||this._status!==Je.CONNECTED){n(new Error(`MqttClient [${this.instanceId}]: 尚未建立连接,无法发布消息`));return}const i={qos:o?.qos??0,retain:o?.retain??!1};this._client.publish(t,r,i,s=>{s?n(s):u()})})}on(t,r){this._eventListeners[t].add(r)}off(t,r){this._eventListeners[t].delete(r)}_bindClientEvents(){this._client&&(this._client.on("connect",t=>{this._status=Je.CONNECTED,this._emitEvent(St.CONNECT)}),this._client.on("reconnect",()=>{this._status=Je.RECONNECTING,this._emitEvent(St.RECONNECT)}),this._client.on("error",t=>{this._emitEvent(St.ERROR,t)}),this._client.on("close",()=>{this._status!==Je.DISCONNECTING&&(this._status=Je.DISCONNECTED)}),this._client.on("message",(t,r)=>{this._dispatchMessage(t,r)}))}_dispatchMessage(t,r){const o=this._subscriptions.get(t);o&&o.forEach(u=>u(t,r)),this._subscriptions.forEach((u,n)=>{n!==t&&this._matchTopic(n,t)&&u.forEach(i=>i(t,r))})}_matchTopic(t,r){const o=t.split("/"),u=r.split("/");for(let n=0;n<o.length;n++){const i=o[n];if(i==="#")return!0;if(i!=="+"&&i!==u[n])return!1}return o.length===u.length}_emitEvent(t,r){t===St.ERROR&&r?this._eventListeners.error.forEach(o=>o(r)):t===St.CONNECT?this._eventListeners.connect.forEach(o=>o()):t===St.DISCONNECT?this._eventListeners.disconnect.forEach(o=>o()):t===St.RECONNECT&&this._eventListeners.reconnect.forEach(o=>o())}}class gd{uuid=pg();_clients=new Map;create(t,r){if(this._clients.has(t))return console.warn(`MqttManager: 实例 ${t} 已存在,返回已注册的实例`),this._clients.get(t);const o=new pd(t,`ws://${location.host}/mqtt`,{clientId:`gct_mqtt_${_gct.store.userInfo.userId}_${t}_${this.uuid}`,...r});return o.connect(),this._clients.set(t,o),o}get(t){return this._clients.get(t)}has(t){return this._clients.has(t)}destroy(t){const r=this._clients.get(t);r&&(r.disconnect(),this._clients.delete(t))}destroyAll(){this._clients.forEach(t=>{t.disconnect()}),this._clients.clear()}}class bd{i18n=Dd.createI18n({legacy:!1,locale:"zh-CN",fallbackLocale:"en",messages:{en:{message:{hello:"hello world"}},ja:{message:{hello:"こんにちは、世界"}}}});locale="zh-CN";constructor(){this.init()}async init(){await this.loadLocales();const t=this.getMessageUrl({locale:this.locale});await this.loadMessages(t)}async loadLocales(){const t=await(await fetch("/gct-platform/api/i18n-config/list")).json();if(t.code===200){const r=t.data.find(o=>o.defaultLanguage);this.locale=r.languageTag}}async loadMessages(t,r=this.locale){const n=(await(await fetch(t)).text()).split(`
393
- `).reduce((i,s)=>{const[a,...l]=s.split(":");return i[a]=l.join(":"),i},{});this.i18n.global.mergeLocaleMessage(r,n)}getMessageUrl(t){if("app"in t){const r=t.env==="dev"?`dev_${t.branch}`:t.env;return`minio/${t.app}/locale-js/${r}/${t.locale}__.json`}return`/minio/locale-js/${t.locale}__platform__.json`}}function md(e){e.use(_gct.i18n)}const vv=[];class _v{router;constructor(){this.router=ks.createRouter({history:ks.createWebHashHistory(),routes:vv})}async add(t){Array.isArray(t)?t.forEach(r=>this.add(r)):this.router.addRoute(t),await this.router.replace(this.router.currentRoute.value.fullPath)}}function Ev(e){e.use(_gct.router)}class yd{i18nUtil=new bd;i18n=this.i18nUtil.i18n;storeUtil=new Nf;store=this.storeUtil.store;routerUtil=new _v;router=this.routerUtil.router;message;dictionary=new jc;env=new kf;mqtt=new gd;register={};openUtil;async init(){await this.env.checkIsTestEnv(),await this.store.init()}}function wv(){return Ne.inject(cs)}function Sv(e){const t=Ne.inject("modal");return t&&e&&(t.ok=e),t}function Av(){const e=Ne.shallowRef({});return Ne.onMounted(()=>{const t=r=>{r.data?.type==="IFRAME_PROPS"&&(e.value=r.data.props)};window.addEventListener("message",t),window.parent.postMessage({type:"IFRAME_READY"},"*"),Ne.onUnmounted(()=>{window.removeEventListener("message",t)})}),Ne.computed(()=>e.value)}function Tv(){return Ne.computed(()=>window.$wujie?.props||{})}function Iv(){return Ne.computed(()=>window.$wujie?.bus)}function vd(e){return typeof e<"u"}function Rv(e){const t=Ne.ref(e||""),r=Ne.ref(!1),o=Ne.ref(!1);return Ne.watch(t,u=>{vd(u)&&(o.value=!0,r.value=_d(u))},{immediate:!!e,flush:"sync"}),{clipboardRef:t,isSuccessRef:r,copiedRef:o}}function _d(e,{target:t=document.body}={}){const r=document.createElement("textarea"),o=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const u=document.getSelection();let n;u&&u.rangeCount>0&&(n=u.getRangeAt(0)),t.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let i=!1;try{i=document.execCommand("copy")}catch(s){throw new Error(s)}return r.remove(),n&&u&&(u.removeAllRanges(),u.addRange(n)),o&&o.focus(),i}const Yt={UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504};class Ov{handle(t){console.error(t)}}class Nv{handle(t){console.error(t)}}class Lv{handle(t){if(t.type===ht.AJAX){new Ed().handle(t);return}console.error(t)}}class Ed{handle(t){const r=this._extractStatusCode(t.message);if(r)switch(r){case Yt.UNAUTHORIZED:this._handleUnauthorized();break;case Yt.FORBIDDEN:this._handleForbidden();break;case Yt.NOT_FOUND:this._handleNotFound();break;case Yt.INTERNAL_SERVER_ERROR:case Yt.BAD_GATEWAY:case Yt.SERVICE_UNAVAILABLE:case Yt.GATEWAY_TIMEOUT:this._handleServerError(r);break;default:this._handleGenericHttpError(t);break}else this._handleGenericHttpError(t)}_extractStatusCode(t){const r=t.match(/HTTP\s+(\d{3})|Business\s+Error\s+\[(\d+)\]/);return r?parseInt(r[1]||r[2],10):null}_handleGenericHttpError(t){t.message.includes("Business Error")?console.debug("Handling business error:",t.message):t.message.includes("Network")?console.debug("Handling network error:",t.message):console.debug("Handling HTTP error:",t.message)}_handleUnauthorized(){console.warn("Unauthorized access, redirecting to login...")}_handleForbidden(){console.warn("Access forbidden")}_handleNotFound(){console.warn("Resource not found")}_handleServerError(t){console.warn(`Server error: ${t}`)}}class ts{static _strategies=new Map;static init(){this.registerStrategy(ht.SCRIPT,new Ov),this.registerStrategy(ht.VUE,new Nv),this.registerStrategy(ht.PROMISE,new Lv),this.registerStrategy(ht.AJAX,new Ed)}static getStrategy(t){return this._strategies.get(t)}static registerStrategy(t,r){this._strategies.set(t,r)}}class ft{static _instance;constructor(){this._initializeStrategies()}static getInstance(){return ft._instance||(ft._instance=new ft),ft._instance}static init(){ft.getInstance()}static handleVueError(t,r,o){const u={type:ht.VUE,message:`Vue Error: ${t.message} | Info: ${o}`,stack:t.stack,timestamp:Date.now(),userAgent:navigator.userAgent};this._instance._processError(u)}static reportError(t,r=ht.SCRIPT){const o={type:r,message:t.message,stack:t.stack,timestamp:Date.now(),userAgent:navigator.userAgent};this._instance._processError(o)}_initializeStrategies(){ts.init()}_processError(t){ts.getStrategy(t.type)?.handle(t)}}async function wd(e){ft.init(),e.config.errorHandler=(t,r,o)=>{ft.handleVueError(t,r,o)},e.config.warnHandler=(t,r,o)=>{console.warn(`Vue Warning: ${t}`),o&&console.warn("Trace:",o)},window.addEventListener("error",t=>{ft.reportError(new Error(t.message),ht.SCRIPT)}),window.addEventListener("unhandledrejection",t=>{ft.reportError(t.reason,ht.PROMISE)})}var Wt=(e=>(e.SYSTEM="SYSTEM",e.THIRD_PARTY="THIRD_PARTY",e))(Wt||{}),De=(e=>(e.ACCOUNT="ACCOUNT",e.DOMAIN_ACCOUNT="DOMAIN_ACCOUNT",e.MOBILE="MOBILE",e.DINGDING="DINGDING",e.FEISHU="FEISHU",e.QIYEWEIXIN="QIYEWEIXIN",e))(De||{}),Sd=(e=>(e.NUMBER="NUMBER",e.LOWERCASE="LOWERCASE",e.UPPERCASE="UPPERCASE",e.SPECHARS="SPECHARS",e))(Sd||{}),Ad=(e=>(e.SAME_END="SAME_END",e.DIFFERENT_END="DIFFERENT_END",e))(Ad||{}),xn=(e=>(e.STANDARD="STANDARD",e.INDEPENDENT_APP="INDEPENDENT_APP",e))(xn||{});const Mv={[De.ACCOUNT]:{icon:"icon-a-Accountnumber",color:"#0E81EC"},[De.DOMAIN_ACCOUNT]:{icon:"icon-a-Domainaccount",color:"#FFAB06"},[De.MOBILE]:{icon:"icon-a-Cellphone",color:"#6A70FE"},[De.DINGDING]:{icon:"DingdingIcon"},[De.FEISHU]:{icon:"FeishuIcon"},[De.QIYEWEIXIN]:{icon:"QiyeweixinIcon"}},Cs=[De.ACCOUNT,De.DOMAIN_ACCOUNT,De.MOBILE],xs=[De.DINGDING,De.FEISHU,De.QIYEWEIXIN],kr=e=>e?e.map(t=>({id:t,label:t,value:t,...Mv[t]})):[],Td=[{label:"extString0_",value:"ext0",type:1},{label:"extString1_",value:"ext1",type:1},{label:"extString2_",value:"ext2",type:1},{label:"extString3_",value:"ext3",type:1},{label:"extString4_",value:"ext4",type:1},{label:"extInt5_",value:"ext5",type:0},{label:"extInt6_",value:"ext6",type:0},{label:"extInt7_",value:"ext7",type:0},{label:"extInt8_",value:"ext8",type:0},{label:"extInt9_",value:"ext9",type:0}],Id=46,Rd=[100,1e3],Od=["#026AC8","#0DAA9C"],Nd={openWatermark:!1,watermarkContent:"custom",fontSize:16,color:"#000000",verticalAlign:"middle",textAlign:"center",text:"${username}",transparent:15,width:1600,height:1080},Xr=Ne.reactive({copyright:'© 2016-<span class="ownInput">${当前年份}</span> 冠骋信息技术(苏州)有限公司 版权所有',description:"",icon:"",loadingImage:"",logo:"",name:"冠骋云PaaS平台",thumbnail:"",version:"暂未支持"});function Pv(e=!0){const t=()=>e?_api.platform.plat.postBase(qe.omit({...Xr},"version")):_api.apaas.plat.postBase(qe.omit({...Xr},"version"));function r(o,u=!0){const{value:n}=o;if(n)try{Object.assign(Xr,u?JSON.parse(n):n,{version:(void 0).version})}catch(i){console.warn(i)}}return{basicSetting:Xr,setBasicSetting:r,postBasicSetting:t}}const Ds=Ne.reactive({deployMode:xn.STANDARD}),Cv=Ne.computed(()=>Ds.deployMode===xn.INDEPENDENT_APP);function xv(e){const{value:t}=e;if(t)try{Object.assign(Ds,JSON.parse(t))}catch(r){console.warn(r)}}function Dv(){return{deploySetting:Ds,setDeploySetting:xv,isIndependentApp:Cv}}const Hn=Ne.ref([De.ACCOUNT]),Vn=Ne.ref([]),$n=Ne.ref(kr(Cs)),qn=Ne.ref(kr(xs)),ut=Ne.reactive({theme:"full",title:"欢迎登录冠骋云PaaS平台",subtitle:"让数字化赋能客户成功!",logo:"",banner:"",loginModeConfigs:[],openIDOAuthConfigs:[],sortJson:"",defaultAuthType:De.ACCOUNT}),cr=Ne.reactive(new Map([[De.ACCOUNT,{address:"",authType:De.ACCOUNT,relationField:"",enabled:0}],[De.DOMAIN_ACCOUNT,{address:"",authType:De.DOMAIN_ACCOUNT,relationField:"",domainSuffix:"",relationFieldName:"",enabled:0}],[De.MOBILE,{smsServiceProvider:"",smsKey:"",smsKeySecret:"",smsTemplateCode:"",smsSignName:"",phoneNumb:"",smsSdkAppId:"",authType:De.MOBILE,enabled:0}],[De.DINGDING,{appId:"",authType:De.DINGDING,secret:"",redirectURL:"",enabled:0}],[De.FEISHU,{appId:"",authType:De.FEISHU,secret:"",redirectURL:"",enabled:0}],[De.QIYEWEIXIN,{appId:"",agentId:"",authType:De.QIYEWEIXIN,secret:"",redirectURL:"",enabled:0,certFileName:""}]]));function kv(){return{loginSetting:ut,postLoginSetting:async()=>{[...Hn.value,...Vn.value].forEach(o=>{const u=cr.get(o);u&&(u.enabled=1)}),ut.loginModeConfigs=Cs.map(o=>cr.get(o)).filter(o=>o!==void 0),ut.openIDOAuthConfigs=xs.map(o=>cr.get(o)).filter(o=>o!==void 0),ut.sortJson=JSON.stringify({[Wt.SYSTEM]:$n.value.map(o=>o.id),[Wt.THIRD_PARTY]:qn.value.map(o=>o.id)}),await _api.platform.plat.postLogin(ut)},setLoginSetting:r=>{if(r&&r.value){const o=JSON.parse(r.value);for(const n in o)n in ut&&(ut[n]=o[n]);if(qe.has(o,"sortJson")&&!qe.isEmpty(o.sortJson)){const n=JSON.parse(o.sortJson);qe.has(n,Wt.SYSTEM)&&($n.value=kr(n[Wt.SYSTEM])),qe.has(n,Wt.THIRD_PARTY)&&(qn.value=kr(n[Wt.THIRD_PARTY]))}ut.loginModeConfigs?.forEach(n=>{cr.set(n.authType,{...n,enabled:0})});const u=ut.loginModeConfigs?.filter(n=>n.enabled).map(n=>n.authType)||[];u.push(De.ACCOUNT),Hn.value=[...new Set(u)],ut.openIDOAuthConfigs?.forEach(n=>{cr.set(n.authType,{...n,enabled:0})}),Vn.value=ut.openIDOAuthConfigs?.filter(n=>n.enabled).map(n=>n.authType)||[]}},loginModeAuthTypes:Hn,openIDOAuthAuthTypes:Vn,sysLoginSort:$n,openIDOAuthAuthSort:qn,loginModeConfig:cr}}const Kt=Ne.reactive({initialPassword:"123456",initialSignPassword:"12345678",enableIdentifier:1,enableDeleteAccount:1,enableDeleteUser:0,requiredFields:[],supportLoginFields:["username_"],extFieldConfigs:[],orgExtFieldConfigs:[]}),Yn=Ne.ref([...Td]),cl=Ne.ref([]);function Uv(e=!0){const t=async()=>{const o=JSON.parse(JSON.stringify(Kt));e?await _api.platform.plat.postOrg(o):await _api.apaas.plat.postOrg(o)};function r(o){const{value:u}=o;if(u)try{const n=JSON.parse(u);for(const i in n)i=="supportLoginFields"&&(n.supportLoginFields=n.supportLoginFields.filter(s=>s!=="username_"));Object.assign(Kt,n),Kt.extFieldConfigs&&Kt.extFieldConfigs.length&&Kt.extFieldConfigs.forEach(i=>{Yn.value=Yn.value.filter(s=>(s.value==i.relationField&&cl.value.push(s),s.value!==i.relationField))}),Kt.extFieldConfigs=JSON.parse(JSON.stringify(n.extFieldConfigs))}catch(n){console.warn(n)}}return{orgSetting:Kt,setOrgSetting:r,postOrgSetting:t,relationFields:Yn,relationFiledsCopy:cl}}const zr=Ne.reactive({durationHour:2,durationMinute:0,enableChangePassword:1,enableChangeSignPassword:0,enableSignPassword:0,enableKickOut:1,enablePassphrase:1,signEnablePassphrase:1,enableLockAccount:1,expiryDate:30,signExpiryDate:30,firstTimeChangePassword:0,signFirstTimeChangePassword:0,lockTimeout:0,loginKickOutMode:"SAME_END",maxErrorTimes:2,passMinLength:6,signPassMinLength:6,passRule:["NUMBER"],signPassRule:["NUMBER"],signRepeatNum:1,repeatNum:1,timeUnit:"DAYS",signTimeUnit:"DAYS",noOpRetainHour:8,noOpRetainMinute:0,earlyAlarmMinute:5,earlyAlarmSecond:0,inapplicablePerson:[],lockHourTimeout:0,lockMinTimeout:5});function Bv(e=!0){const t=async()=>{e?await _api.platform.plat.postSecurity(zr):await _api.apaas.plat.postSecurity(zr)};function r(o){const{value:u}=o;if(u)try{Object.assign(zr,JSON.parse(u))}catch(n){console.warn(n)}}return{securitySetting:zr,postSecuritySetting:t,setSecuritySetting:r}}const Rn=Ne.reactive({darkMode:"light",themeColor:"#026AC8",menuMode:"classic",menuWidth:232,menuCollapsible:!0,menuSearchable:!0,menuFilter:!1,showLogo:!0,showBreadcrumb:!1,showBreadcrumbIcon:!1,showTabs:!0,pageProgress:!0,pageLoading:!0,colorMode:"normal"}),Kn=Ne.ref(!1),Fv=Id,jv=Rd,Wv=Od,Gv=()=>{Rn.colorMode};Ne.watch(()=>Rn.colorMode,e=>{e&&Gv()});function Hv(){const e=async()=>{};function t(o){const{value:u}=o;if(u)try{Object.assign(Rn,JSON.parse(u))}catch(n){console.warn(n)}}function r(){Kn.value=!Kn.value}return{themeSetting:Rn,setThemeSetting:t,postThemeSetting:e,menuCollapsed:Kn,toggleMenuCollapsed:r,menuCollapsedWidth:Fv,menuWidthRange:jv,themeColors:Wv}}const Xn=Ne.reactive({...Nd});function Vv(){const e=async()=>{const r=JSON.stringify(Xn);await _api.platform.plat.postWatermark({value:r})};function t(r){const{value:o}=r;if(o)try{Object.assign(Xn,JSON.parse(o))}catch(u){console.warn(u)}}return{watermarkSetting:Xn,postWatermarkSetting:e,setWatermarkSetting:t}}const Ld=Ne.reactive({});function $v(e){Object.assign(Ld,e)}function qv(){return{projectSetting:Ld,setProjectConfig:$v}}const Md=Zt.defineStore("platform-config",()=>{const e=Pv(),t=kv(),r=Uv(),o=Bv(),u=Hv(),n=Vv(),i=Dv(),s=qv();async function a(){const c=await _api.platform.plat.getList(),f={};c&&c.length>0&&c.forEach(p=>{if(p.value)try{f[p.configEnum]=JSON.parse(p.value)}catch(m){console.warn(`${p.configEnum}配置解析失败`,m,p)}}),f[He.BASIC]&&e.setBasicSetting(f[He.BASIC]),f[He.LOGIN]&&t.setLoginSetting(f[He.LOGIN]),f[He.ORGANIZATION]&&r.setOrgSetting(f[He.ORGANIZATION]),f[He.SECURITY]&&o.setSecuritySetting(f[He.SECURITY]),f[He.THEME]&&u.setThemeSetting(f[He.THEME]),f[He.WATERMARK]&&n.setWatermarkSetting(f[He.WATERMARK]),f[He.DEPLOY]&&i.setDeploySetting(f[He.DEPLOY]),console.debug("平台配置初始化完成",f)}async function l(){const c=await _api.apaas.basicConfig.getDetail({configEnum:He.THEME});c&&u.setThemeSetting(c)}return{init:a,renderInit:l,...e,...t,...r,...o,...u,...n,...i,...s}}),Pd=Zt.defineStore("user",{state:()=>({userInfo:{},roleList:[],sessionTimeout:!1,lastUpdateTime:0,userPermissions:{}}),getters:{getUserInfo(e){return e.userInfo},getUserPermissions(e){return e.userPermissions}},actions:{async login(e,{hasError:t}={}){try{const r=await Yv(e,t),{token:o,signWay:u}=r;return sessionStorage.setItem("signWay",u),Jc(o),this.afterLoginAction()}catch(r){return Promise.reject(r)}},async getUserInfoAction(e){if(!Pr&&!e)return null;const t=await _api.platform.user.getInfo({headers:{Token:e}});return this.setUserInfo(t),this.userPermissions=(t?.platformManagerPermissions??[]).reduce((r,o)=>(r[o]=!0,r),{}),t},async afterLoginSingleApp(){},async afterLoginAction(){if(!Pr)return null},async logout(){await Kv()},async setUserInfo(e){this.userInfo={...e,minioDomain:"/minio"},this.lastUpdateTime=new Date().getTime(),_gct.store.userInfo=this.userInfo},async updateUserInfo(e){const t={...this.userInfo,...e};this.setUserInfo(t)}}});async function Yv(e,{hasError:t=!0}={}){const r=await ms();return await _api.platform.login.postSign(e,{headers:{browser:r,"Auth-Code":e.authCode,hasError:t}})}async function Kv(){const e=sessionStorage.getItem("currentPlatOrAppId"),t=_gct.env.getEnv(),r=await ms(),o={appId:e&&JSON.parse(e).appId,platform:e&&JSON.parse(e).type,env:t},u=_f();await _api.platform.login.getSignOut(o,{headers:{browser:r,pagetag:u}})}const Xv=Zt.defineStore("tenant",{state:()=>({tenantId:"",tenantUserInfo:{},tenantUserPermissions:{}}),actions:{setTenant(e){this.tenantId=e},async getTenantUserInfoAction(){if(!this.tenantId)return;const e=await _api.platform.tenant.getUserInfo();return this.tenantUserInfo=e,e}}}),zv=Zt.defineStore("permission",{state:()=>({userPermissions:{appSuperAdmin:0,permissions:{}}}),getters:{hasAllPermissions(e){return!!e.userPermissions.appSuperAdmin||!!e.userPermissions.permissions["POINT.*"]}},actions:{getPermissionByKey(e,t){if(this.hasAllPermissions)return!0;if(!t)return this.userPermissions.permissions[e];const r=`${e}.${t}`,o=`${e}.*`;return this.userPermissions.permissions[r]||this.userPermissions.permissions[o]},async initPermission(){const e=await _api.apaas.designerCommon.getUserInfo();Object.assign(this.userPermissions,{...e,permissions:Object.fromEntries((e?.permissions??[]).map(t=>[t,!0]))})}}});async function Qv(e){e.provide(cs,e),md(e),Ev(e)}async function Jv(e){await wd(e),zn.HttpUtil.use(nf),await _gct.init();const t=Pr();t&&await Pd().getUserInfoAction(t),await Md().init()}function Zv(){if(window._gct){console.warn("核心包已安装,请勿重复安装!");return}console.info("核心包安装成功!"),window._gct=new yd,Object.defineProperty(window._gct,"api",{get(){return zn.api}}),Object.defineProperty(window,"_api",{get(){return zn.api}})}Zv();exports.AGLINE_ENUMS=fc;exports.APP_DARK_MODE_KEY_=lp;exports.APP_INST=cs;exports.APP_LOCAL_CACHE_KEY=up;exports.APP_PREVIEW_PATH_REG=Cf;exports.APP_PROD_PATH_REG=Pf;exports.APP_RUN_PATH_REG=Mf;exports.APP_SESSION_CACHE_KEY=cp;exports.ARRAY_TYPE=Xp;exports.ASSIGNMENTSTRATEGY_ENUM=su;exports.AggTypes=Tl;exports.AppPublishStateEnum=rc;exports.BOOLEAN_TYPE=Yp;exports.BasicAction=nc;exports.BindCmpStyleEnum=Qu;exports.BindCmpStyleTypeEnum=Ju;exports.BizServiceEnum=yc;exports.BorderStyle=Wl;exports.BpmnNodeTypeEnum=xc;exports.BuiltOperators=Jn;exports.BuiltinType=cu;exports.ButtonColorTheme=Tu;exports.ButtonColorType=Au;exports.ButtonGroupType=Hd;exports.ButtonOpeEnum=hc;exports.ButtonSize=Ru;exports.ButtonStyle=Iu;exports.ButtonType=Nu;exports.ButtonTypeEnum=Pc;exports.ButtonTypeGroup=Ou;exports.ButtonType_vant=Lu;exports.CARD_TRIGGER_ENUM=Pl;exports.COLUMNS_TYPE=eu;exports.CURRENCY_ENUM=du;exports.CURRENCY_LANG_ENUM=bu;exports.CUSTOM_LANGUAGE=xp;exports.CUSTOM_THEME=Dp;exports.CacheTypeEnum=lc;exports.CategoryTypeEnum=uu;exports.Ch_BindCmpStyleEnum=Vd;exports.ContentEnum=fl;exports.ContentTypeEnum=mc;exports.CoreConst=er;exports.CreateType=El;exports.CustomAction=ic;exports.DESIGNER_SESSION_CACHE_KEY=fp;exports.DEV_SINGLE_PATH_REG=xf;exports.DataSetReturnTypeEnum=ls;exports.DatasourceTypeEnum=Uu;exports.DateRangeEnums=fu;exports.DefaultActions=zd;exports.DefaultDateTypeConst=qc;exports.Dependency_ENUM=au;exports.DeployModeEnum=xn;exports.DeviceParamsTypeEnum=_c;exports.DictionaryUtil=jc;exports.DisplayEnums=Su;exports.DisplayTagTypeEnum=Xl;exports.DisplayType=Ql;exports.EditorRegisterConst=Vc;exports.EntityFormulaReturnTypeEnum=Or;exports.EntityModelCategoryEnum=is;exports.EntityModelTypeEnum=xl;exports.EnvironmentManager=kf;exports.EnvironmentType=Nr;exports.ErrorHandler=ft;exports.ErrorStrategyFactory=ts;exports.ErrorTypeEnum=ht;exports.EventCategory=Vl;exports.ExamineAndApproveStateEnum=Mc;exports.ExceptionEnum=pc;exports.ExpressionModeEnum=Ce;exports.ExpressionTabEnum=Te;exports.FIELD_TYPE=be;exports.FIELD_TYPE_BASIC=yl;exports.FIELD_TYPE_CATEGORY=ml;exports.FIELD_TYPE_LOGIC=vl;exports.FIELD_TYPE_TRACE=_l;exports.FUNC_KEYS=jp;exports.FUN_BOL_TYPE=Jp;exports.FUN_NUM_TYPE=zp;exports.FUN_OBJ_OR_ARR_TYPE=Zp;exports.FUN_STR_TYPE=Qp;exports.FieldDefaultValueTypeEnum=Dl;exports.FieldIconMap=Fd;exports.FieldSysVarDefaultValueEnum=kl;exports.FieldTypeToJs=Bd;exports.FormComponents=Gu;exports.FormContainerType=$c;exports.GENDER_TYPE=Ll;exports.GLOBAL_TYPE=Zl;exports.GLOBAL_VAR_TYPE=Jl;exports.GctGlobal=yd;exports.GctMqttTopsEnum=Bc;exports.GlobalParamEnum=Fc;exports.GlobalStoreUtil=Nf;exports.HOST_REG=ri;exports.INNER_EVENT=tu;exports.IP_REG=Lf;exports.IdentifierAddon=Uc;exports.KeyMode=Eu;exports.KickRuleEnum=Ad;exports.LOCALE_KEY=ep;exports.LOCALE_LIST_KEY=tp;exports.LOCAL_I18N_TRANSLATE=rp;exports.LOCK_INFO_KEY=sp;exports.LinkedList=yp;exports.LinkedNode=Qn;exports.ListTreeSearchTypeEnum=ku;exports.LocaleUtil=bd;exports.LoginSortTypeEnum=Wt;exports.LoginTypeEnum=De;exports.MENU_COLLAPSED_WIDTH=Id;exports.MENU_WIDTH_RANGE=Rd;exports.MQTT_CLIENT_EVENT=St;exports.MQTT_DEFAULT_CONNECT_OPTIONS=Sr;exports.MULTIPLE_TABS_KEY=ap;exports.MaterialEnum=Al;exports.MenuModeEnum=Sc;exports.MenuSplitTyeEnum=Ac;exports.MenuType=wl;exports.MenuTypeEnum=Ec;exports.MessageType=jd;exports.MixSidebarTriggerEnum=Ic;exports.Modal=bg;exports.ModeFnMap=Tp;exports.ModeTabDict=Op;exports.ModeTabMap=Ip;exports.ModelTypeOptions=rg;exports.MqttClient=pd;exports.MqttConnectionStatus=Je;exports.MqttManager=gd;exports.NUMBER_TYPE=$p;exports.Namespace=Kc;exports.NodesConfigTypeEnum=Il;exports.OBJECT_TYPE=Kp;exports.OTHER_LOGIN_KEYS=xs;exports.OpenMode=Sl;exports.OperatorTypeEnum=je;exports.OpinionTypeEnum=Cc;exports.OverlayContainer=ds;exports.PLUGIN_BASE_URL=ng;exports.PROJ_CFG_KEY=op;exports.PageEnum=Rc;exports.PanelEnum=Fl;exports.PassRule=Sd;exports.PermissionModeEnum=gl;exports.PersonalCenterType=Nl;exports.Platform=os;exports.PlatformSettingActions=Qd;exports.PlatformSettingEnum=He;exports.PlatformType=vc;exports.PluginModeEnum=Dc;exports.PluginStaticResource=_g;exports.Postion=jl;exports.PrintModeEnums=vu;exports.PrintResourceEnum=tc;exports.ProcessStatusEnum=Lc;exports.ProgressTypeEnum=zl;exports.ProjectName=ns;exports.PropGroup=$l;exports.RELATION_FIELDS=Td;exports.RETURN_TYPE_MAP=eg;exports.ROLES_KEY=ip;exports.RdoButtonOpeEnum=dc;exports.RequestEnum=bc;exports.ResetRuleType=ju;exports.ResultEnum=gc;exports.ReturnTypeEnum=as;exports.ReturnTypeMaps=Rp;exports.RoleEnum=Oc;exports.RouterTransitionEnum=bl;exports.RowSelectionTypeEnums=mu;exports.SCOPE=Wu;exports.SCOPEINFO=ec;exports.SEARCH_SERVICE=uc;exports.SHOW_FIELDTYPES=Gd;exports.SIDE_BAR_MINI_WIDTH=kd;exports.SIDE_BAR_SHOW_TIT_MINI_WIDTH=Ud;exports.STRING_TYPE=qp;exports.STYLE_NAMESPACE_TAG=Yc;exports.SUB_TABLE_EDIT_MODE=ru;exports.SUB_TABLE_OPE_EVENT_TYPE=iu;exports.SUB_TABLE_OPE_EVENT_TYPE_INLINE=nu;exports.SYSTEM_LOGIN_KEYS=Cs;exports.SYSTEM_VAR_PREFIX=Wp;exports.SearchComponents=Hu;exports.SelectPickerEnums=hu;exports.SessionTimeoutProcessingEnum=pl;exports.SettingButtonPositionEnum=dl;exports.SignatureStyleEnum=Fu;exports.SignatureTypeEnum=Bu;exports.SizeEnum=Nc;exports.StatisticalMethodEnums=yu;exports.StyleGroup=ql;exports.TENANT_KEY=Jd;exports.TEST_SINGLE_PATH_REG=Df;exports.THEME_COLORS=Od;exports.TIMETYPE_ENUM=pu;exports.TIMETYPE_LANG_ENUM=gu;exports.TIMEZONE_KEY=ac;exports.TODO_TYPE=Ml;exports.TOKEN_KEY=Zd;exports.TableEditingMethodEnum=xu;exports.TableSearchTypeEnum=Pu;exports.TableTypeEnum=Cu;exports.TagTypeEnum=Kl;exports.TextAlign=Gl;exports.TextDecoration=Hl;exports.ThemeEnum=hl;exports.ToolkitEnum=lu;exports.TopMenuAlignEnum=Tc;exports.TransactionMode=wu;exports.TreeHelper=at;exports.TriggerEnum=wc;exports.USER_INFO_KEY=np;exports.UniqueConstraintType=Ol;exports.Uploader=ey;exports.UserServiceType=Cl;exports.VERIFICATIONCONDITIONS_TYPE=ou;exports.VITE_MINIO_PATH=ig;exports.VarTypeEnum=kc;exports.WATERMARK_INIT_DATA=Nd;exports.WidgetInScopeEnum=Du;exports.WinMsgTypeEnum=Hc;exports.WorkbenchType=Wd;exports.afterFieldSet=Og;exports.afterValueSet=Rg;exports.allOperator=Mp;exports.biBackFunctionGroup=Wc;exports.biBackFunctionMap=Fp;exports.bindCmpStyleMap=qd;exports.booleanOperator=Lp;exports.booleanTypes=Vp;exports.buildItemRules=_p;exports.buildShortUUID=Tg;exports.buildUUID=Ag;exports.buttonShowType=Zu;exports.cacheFnReturn=Pg;exports.calcFontStyle=Xm;exports.calcStyle=Km;exports.ch_ProcessStatusMap=dp;exports.computedEx=Mg;exports.controlConfigEnum=$u;exports.copyTextToClipboard=_d;exports.createAppVue=Qv;exports.dataURLtoBlob=Tf;exports.deepMerge=wg;exports.downloadByBase64=Rf;exports.downloadByData=Of;exports.downloadByOnlineUrl=ny;exports.downloadByUrl=oy;exports.emitFieldSet=Ng;exports.fixedAlignENUM=Yu;exports.functionGroup=us;exports.functionMap=kp;exports.gctMemoizeAsync=bp;exports.genUrl=Ef;exports.getDeviceFingerprint=ms;exports.getLoginTypeOptions=kr;exports.getOperatorList=Cp;exports.getPageIdentification=_f;exports.getTenant=Zc;exports.getTimezone=tf;exports.getToken=Pr;exports.hasEmojiAndSpecStr=Sf;exports.hasEmojiAndSpecStr1=Af;exports.innerVarIds=Gp;exports.innerVarList=Gc;exports.insertCustomCssToHead=vp;exports.interceptors=nf;exports.ipaasBackFunctionGroup=Up;exports.ipaasBackFunctionMap=Bp;exports.isDef=vd;exports.isMobile=ef;exports.isMultipleOperator=sy;exports.isSortFiled=zm;exports.mitt=wp;exports.mobileSearchListByFieldType=Kd;exports.modelLoader=Ap;exports.notSingleArr=cc;exports.nullDisplayEnum=ss;exports.numberOperator=Np;exports.numberTypes=Hp;exports.openWindow=wf;exports.openWindowEnums=_u;exports.operateSysEnums=Mu;exports.operator2FuncMap=tg;exports.padSearchListByFieldType=Xd;exports.pageLayoutModeEnum=Bl;exports.parseMatrixParams=rf;exports.parseValueUnit=Lg;exports.permission=uy;exports.presetColor=hp;exports.randomUUID=xr;exports.returnBolOperator=Pp;exports.screenEnum=sc;exports.screenMap=tr;exports.scriptTypeEnum=Ul;exports.searchListByFieldType=Yd;exports.selectionTypeEnums=Rl;exports.setTenant=Eg;exports.setToken=Jc;exports.setupApp=Jv;exports.setupErrorHandler=wd;exports.setupI18n=md;exports.sizeEnum=oc;exports.sortTypeEnum=zu;exports.statisticalMethodEnum=qu;exports.stringifyMatrixParams=Sg;exports.t=pr;exports.tableColumnTypeEnum=Ku;exports.tableColumnWidthEnum=Vu;exports.tabsTypeENUM=Xu;exports.tagEnum=Yl;exports.transformBindCmp2CmpType=$d;exports.uploaderFiles=iy;exports.urlToBase64=If;exports.useAppInst=wv;exports.useCopyToClipboard=Rv;exports.useIFrameProps=Av;exports.useModal=Sv;exports.useNamespace=sg;exports.usePermissionStore=zv;exports.usePlatformConfigStore=Md;exports.useTenantStore=Xv;exports.useUUid=Qm;exports.useUserStore=Pd;exports.useWuJieBus=Iv;exports.useWuJieProps=Tv;exports.uuid2=Ig;exports.validateEmoji=ys;exports.validateIsModelName=Zm;exports.validateModelName=Jm;exports.zeroWidthSpace=pp;