filecat 5.32.0 → 5.32.2
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.
- package/build/dist/{377.f1e5a0d0f7800c8306ee.js → 377.4047ae540e74884d3ff5.js} +2 -2
- package/build/dist/543.ac5d314a52e99934103c.js +2 -0
- package/build/dist/{943.7c72fe51510266a06ea6.js → 943.d055d58eee66f1ab0414.js} +2 -2
- package/build/dist/index.html +1 -1
- package/build/dist/{main.b593eb159b18a7b4eefa.js → main.494c8bcf15274aeca600.js} +2 -2
- package/build/server/common/DataUtil.js +7 -0
- package/build/server/common/DataUtil.js.map +1 -0
- package/build/server/common/FileMenuType.js +48 -0
- package/build/server/common/FileMenuType.js.map +1 -0
- package/build/server/common/ListUtil.js +224 -0
- package/build/server/common/ListUtil.js.map +1 -0
- package/build/server/common/Result.pojo.js +15 -0
- package/build/server/common/Result.pojo.js.map +1 -0
- package/build/server/common/RouterConfig.js +20 -0
- package/build/server/common/RouterConfig.js.map +1 -0
- package/build/server/common/StringUtil.js +223 -0
- package/build/server/common/StringUtil.js.map +1 -0
- package/build/server/common/ValueUtil.js +70 -0
- package/build/server/common/ValueUtil.js.map +1 -0
- package/build/server/common/common.util.js +32 -0
- package/build/server/common/common.util.js.map +1 -0
- package/build/server/common/event.js +48 -0
- package/build/server/common/event.js.map +1 -0
- package/build/server/common/file.pojo.js +65 -0
- package/build/server/common/file.pojo.js.map +1 -0
- package/build/server/common/frame/WsData.js +127 -0
- package/build/server/common/frame/WsData.js.map +1 -0
- package/build/server/common/frame/constant.js +6 -0
- package/build/server/common/frame/constant.js.map +1 -0
- package/build/server/common/frame/data.encode.js +115 -0
- package/build/server/common/frame/data.encode.js.map +1 -0
- package/build/server/common/frame/router.js +25 -0
- package/build/server/common/frame/router.js.map +1 -0
- package/build/server/common/frame/ws.client.js +173 -0
- package/build/server/common/frame/ws.client.js.map +1 -0
- package/build/server/common/frame/ws.server.js +145 -0
- package/build/server/common/frame/ws.server.js.map +1 -0
- package/build/server/common/fun.util.js +65 -0
- package/build/server/common/fun.util.js.map +1 -0
- package/build/server/common/node/Env.js +198 -0
- package/build/server/common/node/Env.js.map +1 -0
- package/build/server/common/node/childProcessUtil.js +209 -0
- package/build/server/common/node/childProcessUtil.js.map +1 -0
- package/build/server/common/node/findPort.js +38 -0
- package/build/server/common/node/findPort.js.map +1 -0
- package/build/server/common/node/http.js +38 -0
- package/build/server/common/node/http.js.map +1 -0
- package/build/server/common/node/install.js +132 -0
- package/build/server/common/node/install.js.map +1 -0
- package/build/server/common/node/value.util.js +8 -0
- package/build/server/common/node/value.util.js.map +1 -0
- package/build/server/common/path_util.js +86 -0
- package/build/server/common/path_util.js.map +1 -0
- package/build/server/common/req/common.pojo.js +42 -0
- package/build/server/common/req/common.pojo.js.map +1 -0
- package/build/server/common/req/customerRouter.pojo.js +9 -0
- package/build/server/common/req/customerRouter.pojo.js.map +1 -0
- package/build/server/common/req/data.pojo.js +3 -0
- package/build/server/common/req/data.pojo.js.map +1 -0
- package/build/server/common/req/ddns.pojo.js +39 -0
- package/build/server/common/req/ddns.pojo.js.map +1 -0
- package/build/server/common/req/file.req.js +49 -0
- package/build/server/common/req/file.req.js.map +1 -0
- package/build/server/common/req/http_controller_router.js +13 -0
- package/build/server/common/req/http_controller_router.js.map +1 -0
- package/build/server/common/req/net.pojo.js +71 -0
- package/build/server/common/req/net.pojo.js.map +1 -0
- package/build/server/common/req/setting.req.js +140 -0
- package/build/server/common/req/setting.req.js.map +1 -0
- package/build/server/common/req/ssh.pojo.js +13 -0
- package/build/server/common/req/ssh.pojo.js.map +1 -0
- package/build/server/common/req/sys.pojo.js +29 -0
- package/build/server/common/req/sys.pojo.js.map +1 -0
- package/build/server/common/req/user.req.js +117 -0
- package/build/server/common/req/user.req.js.map +1 -0
- package/build/server/common/word_detection_js.js +142 -0
- package/build/server/common/word_detection_js.js.map +1 -0
- package/build/server/main/domain/ai_agent/ai_agent.constant.js +142 -0
- package/build/server/main/domain/ai_agent/ai_agent.constant.js.map +1 -0
- package/build/server/main/domain/ai_agent/ai_agent.controller.js +136 -0
- package/build/server/main/domain/ai_agent/ai_agent.controller.js.map +1 -0
- package/build/server/main/domain/ai_agent/ai_agent.service.js +715 -0
- package/build/server/main/domain/ai_agent/ai_agent.service.js.map +1 -0
- package/build/server/main/domain/ai_agent/ai_agent.tools.js +79 -0
- package/build/server/main/domain/ai_agent/ai_agent.tools.js.map +1 -0
- package/build/server/main/domain/ai_agent/ai_agent.worker.js +169 -0
- package/build/server/main/domain/ai_agent/ai_agent.worker.js.map +1 -0
- package/build/server/main/domain/bin/bin.file.util.js +109 -0
- package/build/server/main/domain/bin/bin.file.util.js.map +1 -0
- package/build/server/main/domain/bin/bin.js +147 -0
- package/build/server/main/domain/bin/bin.js.map +1 -0
- package/build/server/main/domain/bin/get_bin_dependency.js +36 -0
- package/build/server/main/domain/bin/get_bin_dependency.js.map +1 -0
- package/build/server/main/domain/crypto/crypto.controller.js +50 -0
- package/build/server/main/domain/crypto/crypto.controller.js.map +1 -0
- package/build/server/main/domain/crypto/crypto.service.js +112 -0
- package/build/server/main/domain/crypto/crypto.service.js.map +1 -0
- package/build/server/main/domain/data/DataUtil.js +127 -0
- package/build/server/main/domain/data/DataUtil.js.map +1 -0
- package/build/server/main/domain/data/basedata/base_data_util.js +214 -0
- package/build/server/main/domain/data/basedata/base_data_util.js.map +1 -0
- package/build/server/main/domain/data/data_type.js +92 -0
- package/build/server/main/domain/data/data_type.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.ali.server.js +77 -0
- package/build/server/main/domain/ddns/ddns.ali.server.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.controller.js +88 -0
- package/build/server/main/domain/ddns/ddns.controller.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.dnspod.service.js +102 -0
- package/build/server/main/domain/ddns/ddns.dnspod.service.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.pre.js +104 -0
- package/build/server/main/domain/ddns/ddns.pre.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.service.js +161 -0
- package/build/server/main/domain/ddns/ddns.service.js.map +1 -0
- package/build/server/main/domain/ddns/ddns.tengxun.service.js +46 -0
- package/build/server/main/domain/ddns/ddns.tengxun.service.js.map +1 -0
- package/build/server/main/domain/ddns/tx/abstract_client.js +247 -0
- package/build/server/main/domain/ddns/tx/abstract_client.js.map +1 -0
- package/build/server/main/domain/ddns/tx/dnspod_client.js +38 -0
- package/build/server/main/domain/ddns/tx/dnspod_client.js.map +1 -0
- package/build/server/main/domain/ddns/tx/dnspod_models.js +3 -0
- package/build/server/main/domain/ddns/tx/dnspod_models.js.map +1 -0
- package/build/server/main/domain/ddns/tx/exception/tencent_cloud_sdk_exception.js +38 -0
- package/build/server/main/domain/ddns/tx/exception/tencent_cloud_sdk_exception.js.map +1 -0
- package/build/server/main/domain/ddns/tx/http/fetch.js +3 -0
- package/build/server/main/domain/ddns/tx/http/fetch.js.map +1 -0
- package/build/server/main/domain/ddns/tx/http/http_connection.js +181 -0
- package/build/server/main/domain/ddns/tx/http/http_connection.js.map +1 -0
- package/build/server/main/domain/ddns/tx/interface.js +5 -0
- package/build/server/main/domain/ddns/tx/interface.js.map +1 -0
- package/build/server/main/domain/ddns/tx/sdk_version.js +5 -0
- package/build/server/main/domain/ddns/tx/sdk_version.js.map +1 -0
- package/build/server/main/domain/ddns/tx/sign.js +142 -0
- package/build/server/main/domain/ddns/tx/sign.js.map +1 -0
- package/build/server/main/domain/ddns/tx/sse_response_model.js +89 -0
- package/build/server/main/domain/ddns/tx/sse_response_model.js.map +1 -0
- package/build/server/main/domain/file/FileUtil.js +230 -0
- package/build/server/main/domain/file/FileUtil.js.map +1 -0
- package/build/server/main/domain/file/file.compress.js +246 -0
- package/build/server/main/domain/file/file.compress.js.map +1 -0
- package/build/server/main/domain/file/file.controller.js +450 -0
- package/build/server/main/domain/file/file.controller.js.map +1 -0
- package/build/server/main/domain/file/file.service.js +1276 -0
- package/build/server/main/domain/file/file.service.js.map +1 -0
- package/build/server/main/domain/file/search/file.search.js +78 -0
- package/build/server/main/domain/file/search/file.search.js.map +1 -0
- package/build/server/main/domain/file/search/file.search.worker.js +107 -0
- package/build/server/main/domain/file/search/file.search.worker.js.map +1 -0
- package/build/server/main/domain/file/search/file.type.js +3 -0
- package/build/server/main/domain/file/search/file.type.js.map +1 -0
- package/build/server/main/domain/file/workflow/workflow.process.js +100 -0
- package/build/server/main/domain/file/workflow/workflow.process.js.map +1 -0
- package/build/server/main/domain/file/workflow/workflow.service.js +659 -0
- package/build/server/main/domain/file/workflow/workflow.service.js.map +1 -0
- package/build/server/main/domain/file/workflow/workflow.util.js +111 -0
- package/build/server/main/domain/file/workflow/workflow.util.js.map +1 -0
- package/build/server/main/domain/navindex/navindex.controller.js +73 -0
- package/build/server/main/domain/navindex/navindex.controller.js.map +1 -0
- package/build/server/main/domain/net/net.controller.js +318 -0
- package/build/server/main/domain/net/net.controller.js.map +1 -0
- package/build/server/main/domain/net/net.datautil.js +8 -0
- package/build/server/main/domain/net/net.datautil.js.map +1 -0
- package/build/server/main/domain/net/net.service.js +627 -0
- package/build/server/main/domain/net/net.service.js.map +1 -0
- package/build/server/main/domain/net/tcp.forward.client.service.js +223 -0
- package/build/server/main/domain/net/tcp.forward.client.service.js.map +1 -0
- package/build/server/main/domain/net/tcp.forward.controller.js +482 -0
- package/build/server/main/domain/net/tcp.forward.controller.js.map +1 -0
- package/build/server/main/domain/net/tcp.forward.server.service.js +407 -0
- package/build/server/main/domain/net/tcp.forward.server.service.js.map +1 -0
- package/build/server/main/domain/net/type.js +3 -0
- package/build/server/main/domain/net/type.js.map +1 -0
- package/build/server/main/domain/net/util/NetClientUtil.js +76 -0
- package/build/server/main/domain/net/util/NetClientUtil.js.map +1 -0
- package/build/server/main/domain/net/util/NetServerUtil.js +128 -0
- package/build/server/main/domain/net/util/NetServerUtil.js.map +1 -0
- package/build/server/main/domain/net/util/NetUtil.js +187 -0
- package/build/server/main/domain/net/util/NetUtil.js.map +1 -0
- package/build/server/main/domain/net/util/tcp.client.js +211 -0
- package/build/server/main/domain/net/util/tcp.client.js.map +1 -0
- package/build/server/main/domain/net/util/tcp_stream_util.js +69 -0
- package/build/server/main/domain/net/util/tcp_stream_util.js.map +1 -0
- package/build/server/main/domain/net/util/type.js +3 -0
- package/build/server/main/domain/net/util/type.js.map +1 -0
- package/build/server/main/domain/net/virtual/tcp_proxy.js +125 -0
- package/build/server/main/domain/net/virtual/tcp_proxy.js.map +1 -0
- package/build/server/main/domain/net/virtual/virtual.client.service.js +402 -0
- package/build/server/main/domain/net/virtual/virtual.client.service.js.map +1 -0
- package/build/server/main/domain/net/virtual/virtual.controller.js +211 -0
- package/build/server/main/domain/net/virtual/virtual.controller.js.map +1 -0
- package/build/server/main/domain/net/virtual/virtual.server.service.js +72 -0
- package/build/server/main/domain/net/virtual/virtual.server.service.js.map +1 -0
- package/build/server/main/domain/pre/lifeRecordService.js +79 -0
- package/build/server/main/domain/pre/lifeRecordService.js.map +1 -0
- package/build/server/main/domain/rdp/lib/asn1/ber.js +66 -0
- package/build/server/main/domain/rdp/lib/asn1/ber.js.map +1 -0
- package/build/server/main/domain/rdp/lib/asn1/index.js +9 -0
- package/build/server/main/domain/rdp/lib/asn1/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/asn1/spec.js +56 -0
- package/build/server/main/domain/rdp/lib/asn1/spec.js.map +1 -0
- package/build/server/main/domain/rdp/lib/asn1/univ.js +315 -0
- package/build/server/main/domain/rdp/lib/asn1/univ.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/error.js +25 -0
- package/build/server/main/domain/rdp/lib/core/error.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/index.js +13 -0
- package/build/server/main/domain/rdp/lib/core/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/layer.js +135 -0
- package/build/server/main/domain/rdp/lib/core/layer.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/log.js +25 -0
- package/build/server/main/domain/rdp/lib/core/log.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/rle.js +22699 -0
- package/build/server/main/domain/rdp/lib/core/rle.js.map +1 -0
- package/build/server/main/domain/rdp/lib/core/type.js +245 -0
- package/build/server/main/domain/rdp/lib/core/type.js.map +1 -0
- package/build/server/main/domain/rdp/lib/index.js +6 -0
- package/build/server/main/domain/rdp/lib/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/cert.js +115 -0
- package/build/server/main/domain/rdp/lib/protocol/cert.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/index.js +11 -0
- package/build/server/main/domain/rdp/lib/protocol/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/nla.js +549 -0
- package/build/server/main/domain/rdp/lib/protocol/nla.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/caps.js +486 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/caps.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/cliprdr.js +167 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/cliprdr.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/data.js +876 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/data.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/global.js +260 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/global.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/index.js +13 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/lic.js +199 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/lic.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/sec.js +333 -0
- package/build/server/main/domain/rdp/lib/protocol/pdu/sec.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/rdp.js +255 -0
- package/build/server/main/domain/rdp/lib/protocol/rdp.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/gcc.js +354 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/gcc.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/index.js +7 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/mcs.js +318 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/mcs.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/per.js +188 -0
- package/build/server/main/domain/rdp/lib/protocol/t125/per.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/tpkt.js +94 -0
- package/build/server/main/domain/rdp/lib/protocol/tpkt.js.map +1 -0
- package/build/server/main/domain/rdp/lib/protocol/x224.js +207 -0
- package/build/server/main/domain/rdp/lib/protocol/x224.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/index.js +7 -0
- package/build/server/main/domain/rdp/lib/security/index.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/jsbn.js +1372 -0
- package/build/server/main/domain/rdp/lib/security/jsbn.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/md4.js +401 -0
- package/build/server/main/domain/rdp/lib/security/md4.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/rc4.js +45 -0
- package/build/server/main/domain/rdp/lib/security/rc4.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/rsa.js +15 -0
- package/build/server/main/domain/rdp/lib/security/rsa.js.map +1 -0
- package/build/server/main/domain/rdp/lib/security/x509.js +106 -0
- package/build/server/main/domain/rdp/lib/security/x509.js.map +1 -0
- package/build/server/main/domain/rdp/rdp.controller.js +116 -0
- package/build/server/main/domain/rdp/rdp.controller.js.map +1 -0
- package/build/server/main/domain/rdp/rdp.service.js +117 -0
- package/build/server/main/domain/rdp/rdp.service.js.map +1 -0
- package/build/server/main/domain/setting/setting.controller.js +621 -0
- package/build/server/main/domain/setting/setting.controller.js.map +1 -0
- package/build/server/main/domain/setting/setting.prefile.js +69 -0
- package/build/server/main/domain/setting/setting.prefile.js.map +1 -0
- package/build/server/main/domain/setting/setting.service.js +763 -0
- package/build/server/main/domain/setting/setting.service.js.map +1 -0
- package/build/server/main/domain/shell/shell.controller.js +92 -0
- package/build/server/main/domain/shell/shell.controller.js.map +1 -0
- package/build/server/main/domain/shell/shell.service.js +448 -0
- package/build/server/main/domain/shell/shell.service.js.map +1 -0
- package/build/server/main/domain/shell/util.js +101 -0
- package/build/server/main/domain/shell/util.js.map +1 -0
- package/build/server/main/domain/ssh/ssh.controller.js +203 -0
- package/build/server/main/domain/ssh/ssh.controller.js.map +1 -0
- package/build/server/main/domain/ssh/ssh.service.js +238 -0
- package/build/server/main/domain/ssh/ssh.service.js.map +1 -0
- package/build/server/main/domain/ssh/ssh.ssh2.js +217 -0
- package/build/server/main/domain/ssh/ssh.ssh2.js.map +1 -0
- package/build/server/main/domain/sys/sys.controller.js +374 -0
- package/build/server/main/domain/sys/sys.controller.js.map +1 -0
- package/build/server/main/domain/sys/sys.docker.service.js +339 -0
- package/build/server/main/domain/sys/sys.docker.service.js.map +1 -0
- package/build/server/main/domain/sys/sys.process.service.js +218 -0
- package/build/server/main/domain/sys/sys.process.service.js.map +1 -0
- package/build/server/main/domain/sys/sys.service.js +85 -0
- package/build/server/main/domain/sys/sys.service.js.map +1 -0
- package/build/server/main/domain/sys/sys.sys.service.js +206 -0
- package/build/server/main/domain/sys/sys.sys.service.js.map +1 -0
- package/build/server/main/domain/sys/sys.systemd.service.js +276 -0
- package/build/server/main/domain/sys/sys.systemd.service.js.map +1 -0
- package/build/server/main/domain/sys/sys.utl.js +42 -0
- package/build/server/main/domain/sys/sys.utl.js.map +1 -0
- package/build/server/main/domain/user/user.controller.js +277 -0
- package/build/server/main/domain/user/user.controller.js.map +1 -0
- package/build/server/main/domain/user/user.hash.js +8 -0
- package/build/server/main/domain/user/user.hash.js.map +1 -0
- package/build/server/main/domain/user/user.service.js +584 -0
- package/build/server/main/domain/user/user.service.js.map +1 -0
- package/build/server/main/domain/video/video.controller.js +71 -0
- package/build/server/main/domain/video/video.controller.js.map +1 -0
- package/build/server/main/domain/video/video.service.js +45 -0
- package/build/server/main/domain/video/video.service.js.map +1 -0
- package/build/server/main/main.js +171 -0
- package/build/server/main/main.js.map +1 -0
- package/build/server/main/other/Result.js +25 -0
- package/build/server/main/other/Result.js.map +1 -0
- package/build/server/main/other/cache.js +50 -0
- package/build/server/main/other/cache.js.map +1 -0
- package/build/server/main/other/config.js +6 -0
- package/build/server/main/other/config.js.map +1 -0
- package/build/server/main/other/middleware/AuthMiddleware.js +101 -0
- package/build/server/main/other/middleware/AuthMiddleware.js.map +1 -0
- package/build/server/main/other/middleware/GlobalErrorHandler.js +23 -0
- package/build/server/main/other/middleware/GlobalErrorHandler.js.map +1 -0
- package/build/server/main/other/middleware/decorator.js +15 -0
- package/build/server/main/other/middleware/decorator.js.map +1 -0
- package/build/server/main/other/middleware/redirect.js +20 -0
- package/build/server/main/other/middleware/redirect.js.map +1 -0
- package/build/server/main/server.js +22 -0
- package/build/server/main/server.js.map +1 -0
- package/build/server/main/threads/filecat/threads.filecat.js +16 -0
- package/build/server/main/threads/filecat/threads.filecat.js.map +1 -0
- package/build/server/main/threads/filecat/threads.work.filecat.js +7 -0
- package/build/server/main/threads/filecat/threads.work.filecat.js.map +1 -0
- package/build/server/main/threads/threads.main.js +224 -0
- package/build/server/main/threads/threads.main.js.map +1 -0
- package/build/server/main/threads/threads.type.js +19 -0
- package/build/server/main/threads/threads.type.js.map +1 -0
- package/build/server/main/threads/threads.work.js +52 -0
- package/build/server/main/threads/threads.work.js.map +1 -0
- package/build/server/main/watch.js +187 -0
- package/build/server/main/watch.js.map +1 -0
- package/build/server/tsconfig.tsbuildinfo +1 -0
- package/build/server/web/project/util/noty.js +45 -0
- package/build/server/web/project/util/noty.js.map +1 -0
- package/build/threads.work.filecat.js +1 -1
- package/package.json +5 -4
- package/shell/build.js +8 -0
- package/build/dist/543.9305b93ceeffabfa9862.js +0 -2
- package/build/jieba_rs_wasm_bg.wasm +0 -0
- package/build/main.js +0 -2
- package/build/main.js.LICENSE.txt +0 -445
- package/build/unrar.wasm +0 -0
- /package/build/dist/{377.f1e5a0d0f7800c8306ee.js.LICENSE.txt → 377.4047ae540e74884d3ff5.js.LICENSE.txt} +0 -0
- /package/build/dist/{543.9305b93ceeffabfa9862.js.LICENSE.txt → 543.ac5d314a52e99934103c.js.LICENSE.txt} +0 -0
- /package/build/dist/{943.7c72fe51510266a06ea6.js.LICENSE.txt → 943.d055d58eee66f1ab0414.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.b593eb159b18a7b4eefa.js.LICENSE.txt → main.494c8bcf15274aeca600.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see threads.work.filecat.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={54(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.start_ai_agent_agent=function(){(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_init,async t=>{const{index_storage_type:e,db_path:i}=t.data;k=e,"memory"===e&&(b||(b=new o.default.Index({tokenize:"strict"}),x=new o.default.Index({tokenize:"strict"}))),"sqlite"===e&&(v=new u(i,{nativeBinding:a}),v.exec("\n CREATE VIRTUAL TABLE IF NOT EXISTS docs USING fts5(\n file_path UNINDEXED,\n content,\n mtime UNINDEXED,\n tokenize = 'unicode61'\n );\n \n CREATE VIRTUAL TABLE IF NOT EXISTS doc_names USING fts5(\n file_path UNINDEXED,\n name,\n mtime UNINDEXED,\n tokenize = 'unicode61'\n );\n "),w=v.prepare("\n SELECT mtime FROM docs WHERE file_path = ? LIMIT 1\n "),y=v.prepare("\n SELECT mtime FROM doc_names WHERE file_path = ? LIMIT 1\n "),f=v.prepare("INSERT INTO docs (file_path, content, mtime) VALUES (?, ?, ?)"),d=v.prepare("INSERT INTO doc_names (file_path, name, mtime) VALUES (?, ?, ?)"),g=v.prepare("DELETE FROM docs WHERE file_path = ?"),p=v.prepare("DELETE FROM doc_names WHERE file_path = ?"),m=v.prepare("\n SELECT file_path\n FROM docs\n WHERE docs MATCH ?\n ORDER BY bm25(docs)\n LIMIT 50\n "),_=v.prepare("\n SELECT file_path\n FROM doc_names\n WHERE doc_names MATCH ?\n ORDER BY bm25(doc_names)\n LIMIT 50\n "))}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_add,async t=>{let e,i,{use_zh_segmentation:n,file_path:s,mtime:r}=t.data;if("sqlite"===k&&v){r=r??(await c.FileUtil.statSync(s)).mtime;const t=w.get(s);if(t&&t.mtime===r)return{char_num:0};e=`${s} ${(await c.FileUtil.readFileSync(s)).toString()}。`,i=e.length;let o=e,l=s;n&&(o=(0,h.cut)(e,!0).join(" "),l=(0,h.cut)(s,!0).join(" ")),g.run(s),p.run(s),f.run(s,o,r),d.run(s,l,r)}if("memory"===k){e=`${s} ${(await c.FileUtil.readFileSync(s)).toString()}。`,i=e.length;let t=e.toLowerCase(),r=s.toLowerCase();n&&(t=(0,h.cut)(e,!0).join(" ").toLowerCase(),r=(0,h.cut)(s,!0).join(" ").toLowerCase()),b?.add(s,t),x?.add(s,r)}return{char_num:i}}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_del,async t=>{const{file_path:e}=t.data;"memory"===k&&(b?.remove(e),x?.remove(e)),"sqlite"===k&&v&&(g.run(e),p.run(e))}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_search,async t=>{const{key:e,use_zh_segmentation:i}=t.data;let n=e;if(i){n=(0,h.cut)(e,!0).map(t=>t+"*").join(" OR ")}if("memory"===k){const t={suggest:!0,resolution:9,context:!0,limit:50};return{ids:b?.search(n,t)||[],names_ids:x?.search(n,t)||[]}}if("sqlite"===k&&v){const t=(0,h.cut)(n,!0).filter(t=>""!==t.trim()).map(t=>t+"*").join(" OR "),e=m.all(t),i=_.all(t);return{ids:e.map(t=>t.file_path),names_ids:i.map(t=>t.file_path)}}return{ids:[],names_ids:[]}}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_close,async()=>{"memory"===k&&(b?.clear(),x?.clear(),b=null,x=null),"sqlite"===k&&v&&(v.close(),v=null)})};const s=i(324),r=i(525),o=n(i(474)),h=i(880),l=i(917),c=i(776),a=(0,l.get_bin_dependency)("sqlite3"),u=(0,l.get_bin_dependency)("better-sqlite3");let f,d,g,p,m,_,w,y,b=null,x=null,v=null,k="memory"},917(__unused_webpack_module,exports,__webpack_require__){"use strict";function get_bin_dependency(module,auto_throw=!1){try{return"sqlite3"===module?__webpack_require__(642):eval("require")(module)}catch(t){if(console.log(`npm 模块没有加载失败,请手动安装 npm 依赖( -g 安装的就尝试全局安装,本地仓库安装的就在仓库内安装):${module} error ${t.message}`),auto_throw)throw t}return{}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.get_bin_dependency=get_bin_dependency},776(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FileUtil=void 0;const s=n(i(896)),r=n(i(928));e.FileUtil=class{static async statSync(t){return s.default.promises.stat(t)}static async readdirSync(t){return s.default.promises.readdir(t)}static async readFileSync(t){return s.default.promises.readFile(t)}static async open(t,e,i){return s.default.promises.open(t,e,i)}static async access(t){try{return await s.default.promises.access(t,s.default.constants.F_OK),!0}catch{return!1}}static async access_all(t){let e=0;for(const i of t)try{await s.default.promises.access(i,s.default.constants.F_OK),e++}catch{}return e===t.length}static async appendFileSync(t,e,i){return s.default.promises.appendFile(t,e,i)}static async writeFileSync(t,e){return s.default.promises.writeFile(t,e)}static async writeFileSyncWithUtf8bom(t,e){return e.startsWith("\ufeff")||(e="\ufeff"+e),s.default.promises.writeFile(t,e,{encoding:"utf8"})}static async truncateSync(t){return s.default.promises.truncate(t)}static async unlinkSync(t){return s.default.promises.unlink(t)}static async mkdirSync(t,e){return s.default.promises.mkdir(t,e)}static async renameSync(t,e){return s.default.promises.rename(t,e)}static async getUniqueFileName(t){const e=r.default.dirname(t),i=r.default.extname(t),n=r.default.basename(t,i);let s=t,o=1;for(;await this.access(s);)s=r.default.join(e,`${n}(${o})${i}`),o++;return s}static async get_exe_path_by_env_dir(t,e){if(!await this.access(t))return null;if(!(await this.statSync(t)).isDirectory())return null;const i=await this.readdirSync(t);for(const n of i)if(n.startsWith(e))return r.default.join(t,`${n}`);return null}static async ensure_dir(t){await s.default.promises.mkdir(t,{recursive:!0})}static async copy_dir(t,e,i=[]){await this.ensure_dir(e);const n=await s.default.promises.readdir(t,{withFileTypes:!0});for(const o of n){const n=r.default.join(t,o.name),h=r.default.join(e,o.name);i.includes(o.name)||(o.isDirectory()?await this.copy_dir(n,h,i):o.isFile()&&await s.default.promises.copyFile(n,h))}}static async remove_dir(t){if(!await this.access(t))return;if((await s.default.promises.stat(t)).isFile())return void await s.default.promises.unlink(t);const e=await s.default.promises.readdir(t);for(const i of e){const e=r.default.join(t,i);(await s.default.promises.stat(e)).isDirectory()?await this.remove_dir(e):await s.default.promises.unlink(e)}await s.default.promises.rmdir(t)}static async find_max_numbered_version_file(t){const e=r.default.dirname(t),i=r.default.basename(t);if(!await this.access(e))return null;const n=await s.default.promises.readdir(e);let o=-1,h=null;const l=r.default.join(e,i);await this.access(l)&&(h=l,o=0);for(const t of n){if(!t.startsWith(i))continue;const n=t.slice(i.length);if(0===n.length)continue;let s=0,l=!1;for(const t of n){if(!(t>="0"&&t<="9")){l=!1;break}s=10*s+(t.charCodeAt(0)-48),l=!0}l&&(s>o&&(o=s,h=r.default.join(e,t)))}return h}static async get_next_numbered_name(t){const e=r.default.dirname(t),i=r.default.basename(t);if(!await this.access(e))return t;const n=await s.default.promises.readdir(e);let o=0;const h=r.default.join(e,i);if(!await this.access(h))return h;for(const t of n){if(!t.startsWith(i))continue;const e=t.slice(i.length);if(!e)continue;let n=0,s=!1;for(const t of e){if(!(t>="0"&&t<="9")){s=!1;break}n=10*n+(t.charCodeAt(0)-48),s=!0}s&&(n>o&&(o=n))}return r.default.join(e,`${i}${o+1}`)}}},285(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.file_search_start=function(){(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search,async t=>{const{start:e,end:i,file_path:c,query_text_buffer:a,ram_id:u}=t.data;let f=0,d=Buffer.alloc(0);const g=r.openSync(c,"r");let p=0;for(;f<i&&!l[u];){const t=Buffer.alloc(2097152);let e=r.readSync(g,t,0,t.length,f);if(0===e)break;f+=e,d=Buffer.concat([d,t.subarray(0,e)]),(0,n.threads_send)({type:s.threads_msg_type.search_file_progress,data:{progress:(100*f/i).toFixed(0),ram_id:u}});const l=[];if(h(d,a,l),l.length>0){for(let t=0;t<l.length;t++)l[t]+=p;(0,n.threads_send)({type:s.threads_msg_type.search_file_index,data:{find_index:l,ram_id:u}})}p+=d.length-a.length,d=o(d,d.length-a.length,d.length)}return(0,n.threads_send)({type:s.threads_msg_type.search_file_end,data:{ram_id:u}}),r.closeSync(g),"ok"}),(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search_close,async t=>{const{ram_id:e}=t.data;return l[e]=!0,"ok"}),(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search_start,async t=>{const{ram_id:e}=t.data;return delete l[e],"ok"})};const n=i(324),s=i(525),r=i(896);function o(t,e,i){const n=i-e,s=Buffer.alloc(n);return t.copy(s,0,e,i),s}function h(t,e,i){const n=function(t){const e={},i=t.length;for(let n=0;n<i;n++)e[t[n]]=n;return e}(e),s=t.length,r=e.length,o=s-r;let h=0;for(;h<=o;){let o=r-1;for(;o>=0&&t[h+o]===e[o];)o--;if(o<0)i.push(h),h+=h+r<s?r-n[t[h+r]]||r:1;else{const e=n[t[h+o]],i=void 0!==e?o-e:o+1;h+=Math.max(i,1)}}}const l={}},525(t,e){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.threads_msg_type=void 0,function(t){t[t.hello=1]="hello",t[t.file_search_start=2]="file_search_start",t[t.file_search=3]="file_search",t[t.file_search_close=4]="file_search_close",t[t.search_file_index=5]="search_file_index",t[t.search_file_progress=6]="search_file_progress",t[t.search_file_end=7]="search_file_end",t[t.docs_init=8]="docs_init",t[t.docs_add=9]="docs_add",t[t.docs_del=10]="docs_del",t[t.docs_close=11]="docs_close",t[t.docs_search=12]="docs_search"}(i||(e.threads_msg_type=i={}))},324(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.register_threads_worker_handler=o,e.threads_send=h;const n=i(167),s=i(525);console.log("[worker] 子线程启动, workerData=",n.workerData);const r=new Map;function o(t,e){r.set(t,e)}function h(t){try{n.parentPort?.postMessage(t)}catch(t){console.error("[worker] send failed:",t)}}n.parentPort?.on("message",t=>{(async function(t){try{const e=r.get(t.type);if(!e)return void h({id:t.id,type:t.type,data:`unknown type ${t.type}`});const i=await e(t);h({id:t.id,type:t.type,data:i})}catch(e){h({id:t.id,type:t.type,data:null,error:e?.message||String(e)}),console.error("[worker] task error:",e)}})(t).catch(console.error)}),o(s.threads_msg_type.hello,async t=>new Promise((e,i)=>setTimeout(()=>{if(Math.random()<.05)return i(new Error("模拟错误"));e(`done:${t.data}`)},500))),console.log("[worker] ready and waiting for messages..."),process.on("uncaughtException",t=>{console.error("子线程全局未捕获异常:",t)}),process.on("unhandledRejection",t=>{console.error("子线程未处理的 Promise 拒绝:",t)})},474(t,e,i){t=i.nmd(t),function e(n){"use strict";var s;function r(t,e,i){const n=typeof i,s=typeof t;if("undefined"!==n){if("undefined"!==s){if(i){if("function"===s&&n===s)return function(e){return t(i(e))};if((e=t.constructor)===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var r=new Map(i);for(var o of t)r.set(o[0],o[1]);return r}if(e===Set){for(r of(o=new Set(i),t.values()))o.add(r);return o}}}return t}return i}return"undefined"===s?e:t}function o(t,e){return void 0===t?e:t}function h(){return Object.create(null)}function l(t){return"string"==typeof t}function c(t){return"object"==typeof t}function a(t,e){if(l(e))t=t[e];else for(let i=0;t&&i<e.length;i++)t=t[e[i]];return t}(n=t)._factory=e;const u=/[^\p{L}\p{N}]+/u,f=/(\d{3})/g,d=/(\D)(\d{3})/g,g=/(\d{3})(\D)/g,p=/[\u0300-\u036f]/g;function m(t={}){if(!this||this.constructor!==m)return new m(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function _(t){t.F=null,t.B.clear(),t.D.clear()}function w(t,e,i){i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):i=t),i&&(t=i.query||t,e=i.limit||e);let n=""+(e||0);i&&(n+=(i.offset||0)+!!i.context+!!i.suggest+(!1!==i.resolve)+(i.resolution||this.resolution)+(i.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new y);let s=this.cache.get(t+n);if(!s){const r=i&&i.cache;r&&(i.cache=!1),s=this.search(t,e,i),r&&(i.cache=r),this.cache.set(t+n,s)}return s}function y(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}(s=m.prototype).assign=function(t){this.normalize=r(t.normalize,!0,this.normalize);let e,i=t.include,n=i||t.exclude||t.split;if(n||""===n){if("object"==typeof n&&n.constructor!==RegExp){let t="";e=!i,i||(t+="\\p{Z}"),n.letter&&(t+="\\p{L}"),n.number&&(t+="\\p{N}",e=!!i),n.symbol&&(t+="\\p{S}"),n.punctuation&&(t+="\\p{P}"),n.control&&(t+="\\p{C}"),(n=n.char)&&(t+="object"==typeof n?n.join(""):n);try{this.split=new RegExp("["+(i?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=n,e=!1===n||"a1a".split(n).length<2;this.numeric=r(t.numeric,e)}else{try{this.split=r(this.split,u)}catch(t){this.split=/\s+/}this.numeric=r(t.numeric,r(this.numeric,!0))}if(this.prepare=r(t.prepare,null,this.prepare),this.finalize=r(t.finalize,null,this.finalize),n=t.filter,this.filter="function"==typeof n?n:r(n&&new Set(n),null,this.filter),this.dedupe=r(t.dedupe,!0,this.dedupe),this.matcher=r((n=t.matcher)&&new Map(n),null,this.matcher),this.mapper=r((n=t.mapper)&&new Map(n),null,this.mapper),this.stemmer=r((n=t.stemmer)&&new Map(n),null,this.stemmer),this.replacer=r(t.replacer,null,this.replacer),this.minlength=r(t.minlength,1,this.minlength),this.maxlength=r(t.maxlength,1024,this.maxlength),this.rtl=r(t.rtl,!1,this.rtl),(this.cache=n=r(t.cache,!0,this.cache))&&(this.F=null,this.L="number"==typeof n?n:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},s.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&_(this),this},s.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_(this),this},s.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_(this),this)},s.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&_(this),this)},s.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_(this),this)},s.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(_,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):p?t.normalize("NFKD").replace(p,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(d,"$1 $2").replace(g,"$1 $2").replace(f,"$1 "));const i=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let n,s,r=[],o=h(),l=this.split||""===this.split?t.split(this.split):[t];for(let t,h,a=0;a<l.length;a++)if((t=h=l[a])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(n===t)continue;n=t}if(i)r.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.I)if(this.F){var c=this.D.get(t);if(c||""===c){c&&r.push(c);continue}}else this.F=setTimeout(_,50,this);if(this.stemmer){let e;for(this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));e!==t&&t.length>2;)e=t,t=t.replace(this.K,t=>this.stemmer.get(t))}if(t&&(this.mapper||this.dedupe&&t.length>1)){c="";for(let e,i,n=0,s="";n<t.length;n++)e=t.charAt(n),e===s&&this.dedupe||((i=this.mapper&&this.mapper.get(e))||""===i?i===s&&this.dedupe||!(s=i)||(c+=i):c+=s=e);t=c}if(this.matcher&&t.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),t=t.replace(this.J,t=>this.matcher.get(t))),t&&this.replacer)for(c=0;t&&c<this.replacer.length;c+=2)t=t.replace(this.replacer[c],this.replacer[c+1]);if(this.cache&&h.length<=this.I&&(this.D.set(h,t),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),t){if(t!==h)if(e){if(o[t])continue;o[t]=1}else{if(s===t)continue;s=t}r.push(t)}}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&t.length<=this.H&&(this.B.set(t,r),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),r},y.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},y.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},y.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}},y.prototype.clear=function(){this.cache.clear(),this.h=""};const b={normalize:!1,numeric:!1,dedupe:!1},x={},v=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),k=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),j=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],S={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var A={Exact:b,Default:x,Normalize:x,LatinBalance:{mapper:v},LatinAdvanced:{mapper:v,matcher:k,replacer:j},LatinExtra:{mapper:v,replacer:j.concat([/(?!^)[aeo]/g,""]),matcher:k},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;i<t.length;i++){var e=t[i];let n=e.charAt(0),s=S[n];for(let t,i=1;i<e.length&&(t=e.charAt(i),"h"===t||"w"===t||!(t=S[t])||t===s||(n+=t,s=t,4!==n.length));i++);t[i]=n}}},CJK:{split:""},LatinExact:b,LatinDefault:x,LatinSimple:x};function M(t,e,i,n){let s=[];for(let r,o=0;o<t.index.length;o++)if(r=t.index[o],e>=r.length)e-=r.length;else{const o=(e=r[n?"splice":"slice"](e,i)).length;if(o&&(s=s.length?s.concat(e):e,i-=o,n&&(t.length-=o),!i))break;e=0}return s}function E(t){if(!this||this.constructor!==E)return new E(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,i)=>"length"===i?e.length:"push"===i?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===i?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===i?function(t){let i=0;for(let n,s,r=0;r<e.index.length;r++){if(n=e.index[r],s=n.indexOf(t),s>=0)return i+s;i+=n.length}return-1}:"includes"===i?function(t){for(let i=0;i<e.index.length;i++)if(e.index[i].includes(t))return!0;return!1}:"slice"===i?function(t,i){return M(e,t||0,i||e.length,!1)}:"splice"===i?function(t,i){return M(e,t||0,i||e.length,!0)}:"constructor"===i?Array:"symbol"!=typeof i?(t=e.index[i/2**31|0])&&t[i]:void 0,set:(t,i,n)=>(t=i/2**31|0,(e.index[t]||(e.index[t]=[]))[i]=n,e.length++,!0)})}function z(t=8){if(!this||this.constructor!==z)return new z(t);this.index=h(),this.h=[],this.size=0,t>32?(this.B=I,this.A=BigInt(t)):(this.B=C,this.A=t)}function O(t=8){if(!this||this.constructor!==O)return new O(t);this.index=h(),this.h=[],this.size=0,t>32?(this.B=I,this.A=BigInt(t)):(this.B=C,this.A=t)}function C(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let i=0,n=this.A+1;for(let s=0;s<t.length;s++)i=(i*n^t.charCodeAt(s))&e;return 32===this.A?i+2**31:i}function I(t){let e=BigInt(2)**this.A-BigInt(1);var i=typeof t;if("bigint"===i)return t&e;if("number"===i)return BigInt(t)&e;i=BigInt(0);let n=this.A+BigInt(1);for(let s=0;s<t.length;s++)i=(i*n^BigInt(t.charCodeAt(s)))&e;return i}let B,F,D,q,L;async function T(t){var e=(t=t.data).task;const i=t.id;let s=t.args;if("init"===e)F=t.options||{},(e=t.factory)?(Function("return "+e)()(n),B=new n.FlexSearch.Index(F),delete n.FlexSearch):B=new Et(F),postMessage({id:i});else{let n;"export"===e&&(s[1]?(s[0]=F.export,s[2]=0,s[3]=1):s=null),"import"===e?s[0]&&(t=await F.import.call(B,s[0]),B.import(s[0],t)):((n=s&&B[e].apply(B,s))&&n.then&&(n=await n),n&&n.await&&(n=await n.await),"search"===e&&n.result&&(n=n.result)),postMessage("search"===e?{id:i,msg:n}:{id:i})}}function R(t){N.call(t,"add"),N.call(t,"append"),N.call(t,"search"),N.call(t,"update"),N.call(t,"remove"),N.call(t,"searchCache")}function $(){D=L=0}function N(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let n;if("function"==typeof i&&(n=i,delete e[e.length-1]),D?L||(L=Date.now()-q>=this.priority*this.priority*3):(D=setTimeout($,0),q=Date.now()),L){const i=this;return new Promise(n=>{setTimeout(function(){n(i[t+"Async"].apply(i,e))},0)})}const s=this[t].apply(this,e);return i=s.then?s:new Promise(t=>t(s)),n&&i.then(n),i}}E.prototype.clear=function(){this.index.length=0},E.prototype.push=function(){},z.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},z.prototype.set=function(t,e){var i=this.B(t);let n=this.index[i];n?(i=n.size,n.set(t,e),(i-=n.size)&&this.size++):(this.index[i]=n=new Map([[t,e]]),this.h.push(n),this.size++)},O.prototype.add=function(t){var e=this.B(t);let i=this.index[e];i?(e=i.size,i.add(t),(e-=i.size)&&this.size++):(this.index[e]=i=new Set([t]),this.h.push(i),this.size++)},(s=z.prototype).has=O.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},s.delete=O.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},s.clear=O.prototype.clear=function(){this.index=h(),this.h=[],this.size=0},s.values=O.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},s.keys=O.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},s.entries=O.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};let P=0;function U(t={},e){function s(i){function n(t){const e=(t=t.data||t).id,i=e&&l.h[e];i&&(i(t.msg),delete l.h[e])}if(this.worker=i,this.h=h(),this.worker)return o?this.worker.on("message",n):this.worker.onmessage=n,t.config?new Promise(function(e){P>1e9&&(P=0),l.h[++P]=function(){e(l)},l.worker.postMessage({id:P,task:"init",factory:r,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:r,options:t}),this)}if(!this||this.constructor!==U)return new U(t);let r=void 0!==n?n._factory:"undefined"!=typeof window?window._factory:null;r&&(r=r.toString());const o="undefined"==typeof window,l=this,c=function(t,e,n){return e?new(i(167).Worker)(__dirname+"/node/node.js"):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+T.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof n?n:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}(r,o,t.worker);return c.then?c.then(function(t){return s.call(l,t)}):s.call(this,c)}function W(t){U.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var n=i[i.length-1];let s;return"function"==typeof n&&(s=n,i.pop()),n=new Promise(function(n){"export"===t&&"function"==typeof i[0]&&(i[0]=null),P>1e9&&(P=0),e.h[++P]=n,e.worker.postMessage({task:t,id:P,args:i})}),s?(n.then(s),this):n}}function H(t,e,i,n,s,r){if(t=t[s],n===i.length-1)e[s]=r||t;else if(t)if(t.constructor===Array)for(e=e[s]=Array(t.length),s=0;s<t.length;s++)H(t,e,i,n,s);else e=e[s]||(e[s]=h()),s=i[++n],H(t,e,i,n,s)}function J(t,e,i,n,s,r,o,h){if(t=t[o])if(n===e.length-1){if(t.constructor===Array){if(i[n]){for(e=0;e<t.length;e++)s.add(r,t[e],!0,!0);return}t=t.join(" ")}s.add(r,t,h,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)J(t,e,i,n,s,r,o,h);else o=e[++n],J(t,e,i,n,s,r,o,h)}function K(t,e,i,n){if(!t.length)return t;if(1===t.length)return t=t[0],t=i||t.length>e?t.slice(i,i+e):t,n?lt.call(this,t):t;let s=[];for(let r,o,h=0;h<t.length;h++)if((r=t[h])&&(o=r.length)){if(i){if(i>=o){i-=o;continue}r=r.slice(i,i+e),o=r.length,i=0}if(o>e&&(r=r.slice(0,e),o=e),!s.length&&o>=e)return n?lt.call(this,r):r;if(s.push(r),!(e-=o))break}return s=s.length>1?[].concat.apply([],s):s[0],n?lt.call(this,s):s}function G(t,e,i,n){var s=n[0];if(s[0]&&s[0].query)return t[e].apply(t,s);if(!("and"!==e&&"not"!==e||t.result.length||t.await||s.suggest))return n.length>1&&(s=n[n.length-1]),(n=s.resolve)?t.await||t.result:t;let r,o,h,l,c,a=[],u=0,f=0;for(e=0;e<n.length;e++)if(s=n[e]){var d=void 0;if(s.constructor===et)d=s.await||s.result;else if(s.then||s.constructor===Array)d=s;else{u=s.limit||0,f=s.offset||0,h=s.suggest,o=s.resolve,r=((l=s.highlight||t.highlight)||s.enrich)&&o,d=s.queue;let i=s.async||d,n=s.index,g=s.query;if(n?t.index||(t.index=n):n=t.index,g||s.tag){const r=s.field||s.pluck;if(r&&(!g||t.query&&!l||(t.query=g,t.field=r,t.highlight=l),n=n.index.get(r)),d&&(c||t.await)){let r;c=1;const o=t.C.length,h=new Promise(function(t){r=t});(function(e,n){h.h=function(){n.index=null,n.resolve=!1;let s=i?e.searchAsync(n):e.search(n);return s.then?s.then(function(e){return t.C[o]=e=e.result||e,r(e),e}):(s=s.result||s,r(s),s)}})(n,Object.assign({},s)),t.C.push(h),a[e]=h;continue}s.resolve=!1,s.index=null,d=i?n.searchAsync(s):n.search(s),s.resolve=o,s.index=n}else if(s.and)d=X(s,"and",n);else if(s.or)d=X(s,"or",n);else if(s.not)d=X(s,"not",n);else{if(!s.xor)continue;d=X(s,"xor",n)}}d.await?(c=1,d=d.await):d.then?(c=1,d=d.then(function(t){return t.result||t})):d=d.result||d,a[e]=d}if(c&&!t.await&&(t.await=new Promise(function(e){t.return=e})),c){const e=Promise.all(a).then(function(n){for(let s=0;s<t.C.length;s++)if(t.C[s]===e){t.C[s]=function(){return i.call(t,n,u,f,r,o,h,l)};break}it(t)});t.C.push(e)}else{if(!t.await)return i.call(t,a,u,f,r,o,h,l);t.C.push(function(){return i.call(t,a,u,f,r,o,h,l)})}return o?t.await||t.result:t}function X(t,e,i){const n=(t=t[e])[0]||t;return n.index||(n.index=i),i=new et(n),t.length>1&&(i=i[e].apply(i,t.slice(1))),i}function V(t,e,i,n,s,r,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=st(t,e,i,!1,this.h),i=0)),s&&(this.await=null),s?this.resolve(e,i,n,o):this}function Y(t,e,i,n,s,r,o){if(!r&&!this.result.length)return s?this.result:this;let h;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let n=0;for(let e,i,s=0;s<t.length;s++)if((e=t[s])&&(i=e.length))n<i&&(n=i);else if(!r){n=0;break}n?(this.result=nt(t,n,e,i,r,this.h,s),h=!0):this.result=[]}else r||(this.result=t);return s&&(this.await=null),s?this.resolve(e,i,n,o,h):this}function Z(t,e,i,n,s,r,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{r=i;var l=this.h;const n=[],o=h();let c=0;for(let e,i=0;i<t.length;i++)if(e=t[i]){c<e.length&&(c=e.length);for(let t,i=0;i<e.length;i++)if(t=e[i])for(let e,i=0;i<t.length;i++)e=t[i],o[e]=o[e]?2:1}for(let i,h=0,a=0;h<c;h++)for(let c,u=0;u<t.length;u++)if((c=t[u])&&(i=c[h]))for(let c,f=0;f<i.length;f++)if(c=i[f],1===o[c])if(r)r--;else if(s){if(n.push(c),n.length===e){t=n;break t}}else{const i=h+(u?l:0);if(n[i]||(n[i]=[]),n[i].push(c),++a===e){t=n;break t}}t=n}this.result=t,l=!0}else r||(this.result=t);return s&&(this.await=null),s?this.resolve(e,i,n,o,l):this}function Q(t,e,i,n,s,r,o){if(!r&&!this.result.length)return s?this.result:this;if(t.length&&this.result.length){t:{r=i;var h=[];t=new Set(t.flat().flat());for(let i,n=0,o=0;n<this.result.length;n++)if(i=this.result[n])for(let l,c=0;c<i.length;c++)if(l=i[c],!t.has(l))if(r)r--;else if(s){if(h.push(l),h.length===e){t=h;break t}}else if(h[n]||(h[n]=[]),h[n].push(l),++o===e){t=h;break t}t=h}this.result=t,h=!0}return s&&(this.await=null),s?this.resolve(e,i,n,o,h):this}function tt(t,e,i,n,s){let r,o,h;"string"==typeof s?(r=s,s=""):r=s.template,o=r.indexOf("$1"),h=r.substring(o+2),o=r.substring(0,o);let l=s&&s.boundary,c=!s||!1!==s.clip,u=s&&s.merge&&h&&o&&new RegExp(h+" "+o,"g");var f=0;if("object"==typeof(s=s&&s.ellipsis)){var d=s.template;f=d.length-2,s=s.pattern}let g,p;"string"!=typeof s&&(s=!1===s?"":"..."),f&&(s=d.replace("$1",s)),d=s.length-f,"object"==typeof l&&(g=l.before,0===g&&(g=-1),p=l.after,0===p&&(p=-1),l=l.total||9e5),f=new Map;for(let F,D,q,L=0;L<e.length;L++){let T;if(n)T=e,q=n;else{var m=e[L];if(q=m.field,!q)continue;T=m.result}D=i.get(q),F=D.encoder,"string"!=typeof(m=f.get(F))&&(m=F.encode(t),f.set(F,m));for(let t=0;t<T.length;t++){var _=T[t].doc;if(!_)continue;if(!(_=a(_,q)))continue;var w=_.trim().split(/\s+/);if(!w.length)continue;_="";var y=[];let e=[];for(var b=-1,x=-1,v=0,k=0;k<w.length;k++){var j=w[k],S=F.encode(j);let t;if((S=S.length>1?S.join(" "):S[0])&&j){for(var A=j.length,M=(F.split?j.replace(F.split,""):j).length-S.length,E="",z=0,O=0;O<m.length;O++){var C=m[O];if(C){var I=C.length;I+=M<0?0:M,z&&I<=z||(C=S.indexOf(C))>-1&&(E=(C?j.substring(0,C):"")+o+j.substring(C,C+I)+h+(C+I<A?j.substring(C+I):""),z=I,t=!0)}}E&&(l&&(b<0&&(b=_.length+(_?1:0)),x=_.length+(_?1:0)+E.length,v+=A,e.push(y.length),y.push({match:E})),_+=(_?" ":"")+E)}if(t){if(l&&v>=l)break}else _+=(_?" ":"")+(j=w[k]),l&&y.push({text:j})}if(v=e.length*(r.length-2),g||p||l&&_.length-v>l)if(k=x-b,g>0&&(k+=g),p>0&&(k+=p),k<=(v=l+v-2*d))w=g?b-(g>0?g:0):b-((v-k)/2|0),y=p?x+(p>0?p:0):w+v,c||(w>0&&" "!==_.charAt(w)&&" "!==_.charAt(w-1)&&((w=_.indexOf(" ",w))<0&&(w=0)),y<_.length&&" "!==_.charAt(y-1)&&" "!==_.charAt(y)&&((y=_.lastIndexOf(" ",y))<x?y=x:++y)),_=(w?s:"")+_.substring(w,y)+(y<_.length?s:"");else{for(x=[],b={},v={},k={},j={},S={},E=M=A=0,O=z=1;;){var B=void 0;for(let t,i=0;i<e.length;i++){if(t=e[i],E)if(M!==E){if(k[i+1])continue;if(t+=E,b[t]){A-=d,v[i+1]=1,k[i+1]=1;continue}if(t>=y.length-1){if(t>=y.length){k[i+1]=1,t>=w.length&&(v[i+1]=1);continue}A-=d}if(_=y[t].text,I=p&&S[i]){if(!(I>0)){k[i+1]=1;continue}if(_.length>I){if(k[i+1]=1,!c)continue;_=_.substring(0,I)}(I-=_.length)||(I=-1),S[i]=I}if(A+_.length+1<=l)_=" "+_,x[i]+=_;else{if(!c){k[i+1]=1;continue}(B=l-A-1)>0&&(_=" "+_.substring(0,B),x[i]+=_),k[i+1]=1}}else{if(k[i])continue;if(t-=M,b[t]){A-=d,k[i]=1,v[i]=1;continue}if(t<=0){if(t<0){k[i]=1,v[i]=1;continue}A-=d}if(_=y[t].text,I=g&&j[i]){if(!(I>0)){k[i]=1;continue}if(_.length>I){if(k[i]=1,!c)continue;_=_.substring(_.length-I)}(I-=_.length)||(I=-1),j[i]=I}if(A+_.length+1<=l)_+=" ",x[i]=_+x[i];else{if(!c){k[i]=1;continue}(B=_.length+1-(l-A))>=0&&B<_.length&&(_=_.substring(B)+" ",x[i]=_+x[i]),k[i]=1}}else{let e;if(_=y[t].match,g&&(j[i]=g),p&&(S[i]=p),i&&A++,t?!i&&d&&(A+=d):(v[i]=1,k[i]=1),t>=w.length-1||t<y.length-1&&y[t+1].match?e=1:d&&(A+=d),A-=r.length-2,i&&!(A+_.length<=l)){B=z=O=v[i]=0;break}x[i]=_,e&&(v[i+1]=1,k[i+1]=1)}A+=_.length,B=b[t]=1}if(B)M===E?E++:M++;else{if(M===E?z=0:O=0,!z&&!O)break;z?E=++M:E++}}_="";for(let t,e=0;e<x.length;e++)t=(v[e]?e?" ":"":(e&&!s?" ":"")+s)+x[e],_+=t;s&&!v[x.length]&&(_+=s)}u&&(_=_.replace(u," ")),T[t].highlight=_}if(n)break}return e}function et(t,e){if(!this||this.constructor!==et)return new et(t,e);let i,n,s,r,o,h,l=0;if(t&&t.index){const i=t;if(e=i.index,l=i.boost||0,n=i.query){s=i.field||i.pluck,r=i.highlight;const n=i.resolve;t=i.async||i.queue,i.resolve=!1,i.index=null,t=t?e.searchAsync(i):e.search(i),i.resolve=n,i.index=e,t=t.result||t}else t=[]}if(t&&t.then){const e=this;i=[t=t.then(function(t){e.C[0]=e.result=t.result||t,it(e)})],t=[],o=new Promise(function(t){h=t})}this.index=e||null,this.result=t||[],this.h=l,this.C=i||[],this.await=o||null,this.return=h||null,this.highlight=r||null,this.query=n||"",this.field=s||""}function it(t,e){let i=t.result;var n=t.await;t.await=null;for(let e,s=0;s<t.C.length;s++)if(e=t.C[s])if("function"==typeof e)i=e(),t.C[s]=i=i.result||i,s--;else if(e.h)i=e.h(),t.C[s]=i=i.result||i,s--;else if(e.then)return t.await=n;return n=t.return,t.C=[],t.return=null,e||n(i),i}function nt(t,e,i,n,s,r,o){const l=t.length;let c,a,u=[];c=h();for(let h,f,d,g,p=0;p<e;p++)for(let e=0;e<l;e++)if(d=t[e],p<d.length&&(h=d[p]))for(let t=0;t<h.length;t++){if(f=h[t],(a=c[f])?c[f]++:(a=0,c[f]=1),g=u[a]||(u[a]=[]),!o){let t=p+(e||!s?0:r||0);g=g[t]||(g[t]=[])}if(g.push(f),o&&i&&a===l-1&&g.length-n===i)return n?g.slice(n):g}if(t=u.length)if(s)u=u.length>1?st(u,i,n,o,r):(u=u[0])&&i&&u.length>i||n?u.slice(n,i+n):u;else{if(t<l)return[];if(u=u[t-1],i||n)if(o)(u.length>i||n)&&(u=u.slice(n,i+n));else{s=[];for(let t,e=0;e<u.length;e++)if(t=u[e])if(n&&t.length>n)n-=t.length;else if((i&&t.length>i||n)&&(t=t.slice(n,i+n),i-=t.length,n&&(n-=t.length)),s.push(t),!i)break;u=s}}return u}function st(t,e,i,n,s){const r=[],o=h();let l;var c=t.length;let a;if(n){for(s=c-1;s>=0;s--)if(a=(n=t[s])&&n.length)for(c=0;c<a;c++)if(l=n[c],!o[l])if(o[l]=1,i)i--;else if(r.push(l),r.length===e)return r}else for(let h,u=c-1,f=0;u>=0;u--){h=t[u];for(let t=0;t<h.length;t++)if(a=(n=h[t])&&n.length)for(let h=0;h<a;h++)if(l=n[h],!o[l])if(o[l]=1,i)i--;else{let i=(t+(u<c-1&&s||0))/(u+1)|0;if((r[i]||(r[i]=[])).push(l),++f===e)return r}}return r}function rt(t,e,i,n,s){const r=h(),o=[];for(let t,i=0;i<e.length;i++){t=e[i];for(let e=0;e<t.length;e++)r[t[e]]=1}if(s){for(let e,s=0;s<t.length;s++)if(e=t[s],r[e])if(n)n--;else if(o.push(e),r[e]=0,i&&0===--i)break}else for(let i,n,s=0;s<t.result.length;s++)for(i=t.result[s],e=0;e<i.length;e++)n=i[e],r[n]&&((o[s]||(o[s]=[])).push(n),r[n]=0);return o}function ot(t){const e=[],i=h(),n=h();for(let s,r,o,h,l,c,a,u=0;u<t.length;u++){s=t[u],r=s.field,o=s.result;for(let t=0;t<o.length;t++)l=o[t],"object"!=typeof l?l={id:h=l}:h=l.id,(c=i[h])?c.push(r):(l.field=i[h]=[r],e.push(l)),(a=l.highlight)&&(c=n[h],c||(n[h]=c={},l.highlight=c),c[r]=a)}return e}function ht(t,e,i,n,s){return(t=this.tag.get(t))&&(t=t.get(e))?((e=t.length-n)>0&&((i&&e>i||n)&&(t=t.slice(n,n+i)),s&&(t=lt.call(this,t))),t):[]}function lt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const e=Array(t.length);for(let i,n=0;n<t.length;n++)i=t[n],e[n]={id:i,doc:this.store.get(i)};return e}function ct(t){if(!this||this.constructor!==ct)return new ct(t);const e=t.document||t.doc||t;let i,n;if(this.B=[],this.field=[],this.D=[],this.key=(i=e.key||e.id)&&ut(i,this.D)||"id",(n=t.keystore||0)&&(this.keystore=n),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?n?new O(n):new Set:n?new z(n):new Map,this.h=(i=e.store||null)&&i&&!0!==i&&[],this.store=i?n?new z(n):new Map:null,this.cache=(i=t.cache||null)&&new y(i),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=at.call(this,t,e),this.tag=null,(i=e.tag)&&("string"==typeof i&&(i=[i]),i.length)){this.tag=new Map,this.A=[],this.F=[];for(let t,e,n=0;n<i.length;n++){if(t=i[n],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.A[n]=t.custom:(this.A[n]=ut(e,this.D),t.filter&&("string"==typeof this.A[n]&&(this.A[n]=new String(this.A[n])),this.A[n].G=t.filter)),this.F[n]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then(function(t){let i=0;for(const n of e.index.entries()){const s=n[0];let r=n[1];r.then&&(r=t[i],e.index.set(s,r),i++)}return e})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function at(t,e){const i=new Map;let n=e.index||e.field||e;l(n)&&(n=[n]);for(let e,r,o=0;o<n.length;o++){if(e=n[o],l(e)||(r=e,e=e.field),r=c(r)?Object.assign({},t,r):t,this.worker){var s=void 0;s=new U(r,s=(s=r.encoder)&&s.encode?s:new m("string"==typeof s?A[s]:s||{})),i.set(e,s)}this.worker||i.set(e,new Et(r,this.reg)),r.custom?this.B[o]=r.custom:(this.B[o]=ut(e,this.D),r.filter&&("string"==typeof this.B[o]&&(this.B[o]=new String(this.B[o])),this.B[o].G=r.filter)),this.field[o]=e}if(this.h){l(t=e.store)&&(t=[t]);for(let e,i,n=0;n<t.length;n++)e=t[n],i=e.field||e,e.custom?(this.h[n]=e.custom,e.custom.O=i):(this.h[n]=ut(i,this.D),e.filter&&("string"==typeof this.h[n]&&(this.h[n]=new String(this.h[n])),this.h[n].G=e.filter))}return i}function ut(t,e){const i=t.split(":");let n=0;for(let s=0;s<i.length;s++)"]"===(t=i[s])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[n]=!0),t&&(i[n++]=t);return n<i.length&&(i.length=n),n>1?i:i[0]}function ft(t,e=0){let i=[],n=[];e&&(e=25e4/e*5e3|0);for(const s of t.entries())n.push(s),n.length===e&&(i.push(n),n=[]);return n.length&&i.push(n),i}function dt(t,e){e||(e=new Map);for(let i,n=0;n<t.length;n++)i=t[n],e.set(i[0],i[1]);return e}function gt(t,e=0){let i=[],n=[];e&&(e=25e4/e*1e3|0);for(const s of t.entries())n.push([s[0],ft(s[1])[0]||[]]),n.length===e&&(i.push(n),n=[]);return n.length&&i.push(n),i}function pt(t,e){e||(e=new Map);for(let i,n,s=0;s<t.length;s++)i=t[s],n=e.get(i[0]),e.set(i[0],dt(i[1],n));return e}function mt(t){let e=[],i=[];for(const n of t.keys())i.push(n),25e4===i.length&&(e.push(i),i=[]);return i.length&&e.push(i),e}function _t(t,e){e||(e=new Set);for(let i=0;i<t.length;i++)e.add(t[i]);return e}function wt(t,e,i,n,s,r,o=0){const h=n&&n.constructor===Array;var l=h?n.shift():n;if(!l)return this.export(t,e,s,r+1);if((l=t((e?e+".":"")+(o+1)+"."+i,JSON.stringify(l)))&&l.then){const c=this;return l.then(function(){return wt.call(c,t,e,i,h?n:null,s,r,o+1)})}return wt.call(this,t,e,i,h?n:null,s,r,o+1)}function yt(t,e){let i="";for(const n of t.entries()){t=n[0];const s=n[1];let r="";for(let t,i=0;i<s.length;i++){t=s[i]||[""];let n="";for(let i=0;i<t.length;i++)n+=(n?",":"")+("string"===e?'"'+t[i]+'"':t[i]);n="["+n+"]",r+=(r?",":"")+n}r='["'+t+'",['+r+"]]",i+=(i?",":"")+r}return i}function bt(t,e){let i=0;var n=void 0===e;if(t.constructor===Array){for(let s,r,o,h=0;h<t.length;h++)if((s=t[h])&&s.length){if(n)return 1;if(r=s.indexOf(e),r>=0){if(s.length>1)return s.splice(r,1),1;if(delete t[h],i)return 1;o=1}else{if(o)return 1;i++}}}else for(let s of t.entries())n=s[0],bt(s[1],e)?i++:t.delete(n);return i}W("add"),W("append"),W("search"),W("update"),W("remove"),W("clear"),W("export"),W("import"),U.prototype.searchCache=w,R(U.prototype),ct.prototype.add=function(t,e,i){if(c(t)&&(t=a(e=t,this.key)),e&&(t||0===t)){if(!i&&this.reg.has(t))return this.update(t,e);for(let r,o=0;o<this.field.length;o++){r=this.B[o];var n=this.index.get(this.field[o]);if("function"==typeof r){var s=r(e);s&&n.add(t,s,i,!0)}else(!(s=r.G)||s(e))&&(r.constructor===String?r=[""+r]:l(r)&&(r=[r]),J(e,r,this.D,0,n,t,r[0],i))}if(this.tag)for(n=0;n<this.A.length;n++){var r=this.A[n];s=this.tag.get(this.F[n]);let c=h();if("function"==typeof r){if(!(r=r(e)))continue}else{var o=r.G;if(o&&!o(e))continue;r.constructor===String&&(r=""+r),r=a(e,r)}if(s&&r){l(r)&&(r=[r]);for(let e,n,h=0;h<r.length;h++)if(e=r[h],!c[e]&&(c[e]=1,(o=s.get(e))?n=o:s.set(e,n=[]),!i||!n.includes(t))){if(n.length===2**31-1){if(o=new E(n),this.fastupdate)for(let t of this.reg.values())t.includes(n)&&(t[t.indexOf(n)]=o);s.set(e,n=o)}n.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(n):this.reg.set(t,[n]))}}}if(this.store&&(!i||!this.store.has(t))){let n;if(this.h){n=h();for(let t,s=0;s<this.h.length;s++){if(t=this.h[s],(i=t.G)&&!i(e))continue;let r;if("function"==typeof t){if(r=t(e),!r)continue;t=[t.O]}else if(l(t)||t.constructor===String){n[t]=e[t];continue}H(e,n,t,0,t[0],r)}}this.store.set(t,n||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},et.prototype.or=function(){return G(this,"or",V,arguments)},et.prototype.and=function(){return G(this,"and",Y,arguments)},et.prototype.xor=function(){return G(this,"xor",Z,arguments)},et.prototype.not=function(){return G(this,"not",Q,arguments)},(s=et.prototype).limit=function(t){if(this.await){const e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){const e=[];for(let i,n=0;n<this.result.length;n++)if(i=this.result[n]){if(!(i.length<=t)){e[n]=i.slice(0,t);break}if(e[n]=i,!(t-=i.length))break}this.result=e}return this},s.offset=function(t){if(this.await){const e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){const e=[];for(let i,n=0;n<this.result.length;n++)(i=this.result[n])&&(i.length<=t?t-=i.length:(e[n]=i.slice(t),t=0));this.result=e}return this},s.boost=function(t){if(this.await){const e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this},s.resolve=function(t,e,i,n,s){let r=this.await?it(this,!0):this.result;if(r.then){const o=this;return r.then(function(){return o.resolve(t,e,i,n,s)})}return r.length&&("object"==typeof t?(n=t.highlight||this.highlight,i=!!n||t.enrich,e=t.offset,t=t.limit):(n=n||this.highlight,i=!!n||i),r=s?i?lt.call(this.index,r):r:K.call(this.index,r,t||100,e,i)),this.finalize(r,n)},s.finalize=function(t,e){if(t.then){const i=this;return t.then(function(t){return i.finalize(t,e)})}e&&t.length&&this.query&&(t=tt(this.query,t,this.index.index,this.field,e));const i=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",i&&i(t),t},h(),ct.prototype.search=function(t,e,i,n){i||(!e&&c(t)?(i=t,t=""):c(e)&&(i=e,e=0));let s=[];var r=[];let h,a,u,f,d,g,p,m,_=0,w=!0;if(i){i.constructor===Array&&(i={index:i}),t=i.query||t,h=i.pluck,a=i.merge,f=i.boost,g=h||i.field||(g=i.index)&&(g.index?null:g);var y=this.tag&&i.tag;u=i.suggest,w=!1!==i.resolve,d=i.cache,p=w&&this.store&&i.highlight;var b=!!p||w&&this.store&&i.enrich;e=i.limit||e;var x=i.offset||0;if(e||(e=w?100:0),y&&(!this.db||!n)){y.constructor!==Array&&(y=[y]);var v=[];for(let t,e=0;e<y.length;e++)if(t=y[e],t.field&&t.tag){var k=t.tag;if(k.constructor===Array)for(var j=0;j<k.length;j++)v.push(t.field,k[j]);else v.push(t.field,k)}else{k=Object.keys(t);for(let e,i,n=0;n<k.length;n++)if(e=k[n],i=t[e],i.constructor===Array)for(j=0;j<i.length;j++)v.push(e,i[j]);else v.push(e,i)}if(y=v,!t){if(r=[],v.length)for(y=0;y<v.length;y+=2){if(this.db){if(!(n=this.index.get(v[y])))continue;r.push(n=n.db.tag(v[y+1],e,x,b))}else n=ht.call(this,v[y],v[y+1],e,x,b);s.push(w?{field:v[y],tag:v[y+1],result:n}:[n])}if(r.length){const t=this;return Promise.all(r).then(function(e){for(let t=0;t<e.length;t++)w?s[t].result=e[t]:s[t]=e[t];return w?s:new et(s.length>1?nt(s,1,0,0,u,f):s[0],t)})}return w?s:new et(s.length>1?nt(s,1,0,0,u,f):s[0],this)}}w||h||!(g=g||this.field)||(l(g)?h=g:(g.constructor===Array&&1===g.length&&(g=g[0]),h=g.field||g.index)),g&&g.constructor!==Array&&(g=[g])}g||(g=this.field),v=(this.worker||this.db)&&!n&&[];for(let h,c,a,f=0;f<g.length;f++){if(c=g[f],this.db&&this.tag&&!this.B[f])continue;let A;if(l(c)||(A=c,c=A.field,t=A.query||t,e=o(A.limit,e),x=o(A.offset,x),u=o(A.suggest,u),p=w&&this.store&&o(A.highlight,p),b=!!p||w&&this.store&&o(A.enrich,b),d=o(A.cache,d)),n)h=n[f];else{j=(k=A||i||{}).enrich;var S=this.index.get(c);if(y&&(this.db&&(k.tag=y,k.field=g,m=S.db.support_tag_search),!m&&j&&(k.enrich=!1),m||(k.limit=0,k.offset=0)),h=d?S.searchCache(t,y&&!m?0:e,k):S.search(t,y&&!m?0:e,k),y&&!m&&(k.limit=e,k.offset=x),j&&(k.enrich=j),v){v[f]=h;continue}}if(a=(h=h.result||h)&&h.length,y&&a){if(k=[],j=0,this.db&&n){if(!m)for(S=g.length;S<n.length;S++){let t=n[S];if(t&&t.length)j++,k.push(t);else if(!u)return w?s:new et(s,this)}}else for(let t,e,i=0;i<y.length;i+=2){if(t=this.tag.get(y[i]),!t){if(u)continue;return w?s:new et(s,this)}if(e=(t=t&&t.get(y[i+1]))&&t.length)j++,k.push(t);else if(!u)return w?s:new et(s,this)}if(j){if(h=rt(h,k,e,x,w),a=h.length,!a&&!u)return w?h:new et(h,this);j--}}if(a)r[_]=c,s.push(h),_++;else if(1===g.length)return w?s:new et(s,this)}if(v){if(this.db&&y&&y.length&&!m)for(b=0;b<y.length;b+=2){if(!(r=this.index.get(y[b]))){if(u)continue;return w?s:new et(s,this)}v.push(r.db.tag(y[b+1],e,x,!1))}const n=this;return Promise.all(v).then(function(s){return i&&(i.resolve=w),s.length&&(s=n.search(t,e,i,s)),s})}if(!_)return w?s:new et(s,this);if(h&&(!b||!this.store))return s=s[0],w?s:new et(s,this);for(v=[],x=0;x<r.length;x++){if(y=s[x],b&&y.length&&void 0===y[0].doc&&(this.db?v.push(y=this.index.get(this.field[0]).db.enrich(y)):y=lt.call(this,y)),h)return w?p?tt(t,y,this.index,h,p):y:new et(y,this);s[x]={field:r[x],result:y}}if(b&&this.db&&v.length){const e=this;return Promise.all(v).then(function(i){for(let t=0;t<i.length;t++)s[t].result=i[t];return p&&(s=tt(t,s,e.index,h,p)),a?ot(s):s})}return p&&(s=tt(t,s,this.index,h,p)),a?ot(s):s},(s=ct.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,n=0;n<this.F.length;n++){t=this.F[n];var i=void 0;this.index.set(t,i=new Et({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),i.tag=this.tag.get(t)}i=[];const n={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let s,r,o=0;o<e.length;o++){n.field=r=e[o],s=this.index.get(r);const h=new t.constructor(t.id,n);h.id=t.id,i[o]=h.mount(s),s.document=!0,o?s.bypass=!0:s.store=this.store}const s=this;return this.db=Promise.all(i).then(function(){s.db=!0})},s.commit=async function(){const t=[];for(const e of this.index.values())t.push(e.commit());await Promise.all(t),this.reg.clear()},s.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},s.append=function(t,e){return this.add(t,e,!0)},s.update=function(t,e){return this.remove(t).add(t,e)},s.remove=function(t){for(var e of(c(t)&&(t=a(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let i of this.tag.values())for(let n of i){e=n[0];const s=n[1],r=s.indexOf(t);r>-1&&(s.length>1?s.splice(r,1):i.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},s.clear=function(){const t=[];for(const e of this.index.values()){const i=e.clear();i.then&&t.push(i)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},s.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},s.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},s.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(t){return t[0]&&t[0].doc||null}):this.store.get(t)||null},s.set=function(t,e){return"object"==typeof t&&(t=a(e=t,this.key)),this.store.set(t,e),this},s.searchCache=w,s.export=function(t,e,i=0,n=0){if(i<this.field.length){const s=this.field[i];if((e=this.index.get(s).export(t,s,i,n=1))&&e.then){const n=this;return e.then(function(){return n.export(t,s,i+1)})}return this.export(t,s,i+1)}let s,r;switch(n){case 0:s="reg",r=mt(this.reg),e=null;break;case 1:s="tag",r=this.tag&>(this.tag,this.reg.size),e=null;break;case 2:s="doc",r=this.store&&ft(this.store),e=null;break;default:return}return wt.call(this,t,e,s,r||null,i,n)},s.import=function(t,e){var i=t.split(".");"json"===i[i.length-1]&&i.pop();const n=i.length>2?i[0]:"";if(i=i.length>2?i[2]:i[1],this.worker&&n)return this.index.get(n).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),n)return this.index.get(n).import(i,e);switch(i){case"reg":this.fastupdate=!1,this.reg=_t(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=pt(e,this.tag);break;case"doc":this.store=dt(e,this.store)}}},R(ct.prototype),Et.prototype.remove=function(t,e){const i=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(i){if(this.fastupdate){for(let e,n,s=0;s<i.length;s++)if((e=i[s])&&(n=e.length))if(e[n-1]===t)e.pop();else{const i=e.indexOf(t);i>=0&&e.splice(i,1)}}else bt(this.map,t),this.depth&&bt(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&zt(this)),this.cache&&this.cache.remove(t),this};const xt={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function vt(t,e,i,n,s,r,o){let l,c;if(!(l=e[i])||o&&!l[o]){if(o?((e=l||(e[i]=h()))[o]=1,c=t.ctx,(l=c.get(o))?c=l:c.set(o,c=t.keystore?new z(t.keystore):new Map)):(c=t.map,e[i]=1),(l=c.get(i))?c=l:c.set(i,c=l=[]),r)for(let i,r=0;r<l.length;r++)if((i=l[r])&&i.includes(s)){if(r<=n)return;i.splice(i.indexOf(s),1),t.fastupdate&&(e=t.reg.get(s))&&e.splice(e.indexOf(i),1);break}if(c=c[n]||(c[n]=[]),c.push(s),c.length===2**31-1){if(e=new E(c),t.fastupdate)for(let i of t.reg.values())i.includes(c)&&(i[i.indexOf(c)]=e);l[n]=c=e}t.fastupdate&&((n=t.reg.get(s))?n.push(c):t.reg.set(s,[c]))}}function kt(t,e,i,n,s){return i&&t>1?e+(n||0)<=t?i+(s||0):(t-1)/(e+(n||0))*(i+(s||0))+1|0:0}function jt(t,e,i,n,s,r,o){let h=t.length,l=t;if(h>1)l=nt(t,e,i,n,s,r,o);else if(1===h)return o?K.call(null,t[0],i,n):new et(t[0],this);return o?l:new et(l,this)}function St(t,e,i,n,s,r,o){return t=Mt(this,t,e,i,n,s,r,o),this.db?t.then(function(t){return s?t||[]:new et(t,this)}):t&&t.length?s?K.call(this,t,i,n):new et(t,this):s?[]:new et([],this)}function At(t,e,i,n){let s=[];if(t&&t.length){if(t.length<=n)return void e.push(t);for(let e,i=0;i<n;i++)(e=t[i])&&(s[i]=e);if(s.length)return void e.push(s)}if(!i)return s}function Mt(t,e,i,n,s,r,o,h){let l;return i&&(l=t.bidirectional&&e>i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,n,s,r,o,h):t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e)}function Et(t,e){if(!this||this.constructor!==Et)return new Et(t);if(t){var i=l(t)?t:t.preset;i&&(t=Object.assign({},xt[i],t))}else t={};const n=!0===(i=t.context)?{depth:1}:i||{},s=l(t.encoder)?A[t.encoder]:t.encode||t.encoder||{};this.encoder=s.encode?s:"object"==typeof s?new m(s):{encode:s},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&"default"!==i&&"exact"!==i&&i||"strict",this.depth="strict"===i&&n.depth||0,this.bidirectional=!1!==n.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new z(i):new Map,this.ctx=i?new z(i):new Map,this.reg=e||(this.fastupdate?i?new z(i):new Map:i?new O(i):new Set),this.N=n.resolution||3,this.rtl=s.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new y(i),this.resolve=!1!==t.resolve,(i=t.db)&&(this.db=this.mount(i)),this.M=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function zt(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}Et.prototype.add=function(t,e,i,n){if(e&&(t||0===t)){if(!n&&!i&&this.reg.has(t))return this.update(t,e);n=this.depth;const a=(e=this.encoder.encode(e,!n)).length;if(a){const u=h(),f=h(),d=this.resolution;for(let h=0;h<a;h++){let g=e[this.rtl?a-1-h:h];var s=g.length;if(s&&(n||!f[g])){var r=this.score?this.score(e,g,h,null,0):kt(d,a,h),o="";switch(this.tokenize){case"tolerant":if(vt(this,f,g,r,t,i),s>2){for(let e,n,h,l,c=1;c<s-1;c++)e=g.charAt(c),n=g.charAt(c+1),h=g.substring(0,c)+n,l=g.substring(c+2),vt(this,f,o=h+e+l,r,t,i),vt(this,f,o=h+l,r,t,i);vt(this,f,g.substring(0,g.length-1),r,t,i)}break;case"full":if(s>2){for(let n,c=0;c<s;c++)for(r=s;r>c;r--){o=g.substring(c,r),n=this.rtl?s-1-c:c;var l=this.score?this.score(e,g,h,o,n):kt(d,a,h,s,n);vt(this,f,o,l,t,i)}break}case"bidirectional":case"reverse":if(s>1){for(l=s-1;l>0;l--){o=g[this.rtl?s-1-l:l]+o;var c=this.score?this.score(e,g,h,o,l):kt(d,a,h,s,l);vt(this,f,o,c,t,i)}o=""}case"forward":if(s>1){for(l=0;l<s;l++)vt(this,f,o+=g[this.rtl?s-1-l:l],r,t,i);break}default:if(vt(this,f,g,r,t,i),n&&a>1&&h<a-1)for(s=this.N,o=g,r=Math.min(n+1,this.rtl?h+1:a-h),l=1;l<r;l++){g=e[this.rtl?a-1-h-l:h+l];vt(this,u,(c=this.bidirectional&&g>o)?o:g,this.score?this.score(e,o,h,g,l-1):kt(s+(a/2>s?0:1),a,h,r-1,l-1),t,i,c?g:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(i?{ins:t}:{del:t}),this.M&&zt(this)),this},Et.prototype.search=function(t,e,i){if(i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):(i=t,t="")),i&&i.cache)return i.cache=!1,t=this.searchCache(t,e,i),i.cache=!0,t;let n,s,r,o,l,c,a,u,f=[],d=0;i&&(t=i.query||t,e=i.limit||e,d=i.offset||0,s=i.context,r=i.suggest,u=(o=i.resolve)&&i.enrich,c=i.boost,a=i.resolution,l=this.db&&i.tag),void 0===o&&(o=this.resolve),s=this.depth&&!1!==s;let g=this.encoder.encode(t,!s);if(n=g.length,e=e||(o?100:0),1===n)return St.call(this,g[0],"",e,d,o,u,l);if(2===n&&s&&!r)return St.call(this,g[1],g[0],e,d,o,u,l);let p,m=h(),_=0;if(s&&(p=g[0],_=1),a||0===a||(a=p?this.N:this.resolution),this.db){if(this.db.search&&!1!==(i=this.db.search(this,g,e,d,r,o,u,l)))return i;const t=this;return async function(){for(let e,i;_<n;_++){if((i=g[_])&&!m[i]){if(m[i]=1,e=await Mt(t,i,p,0,0,!1,!1),e=At(e,f,r,a)){f=e;break}p&&(r&&e&&f.length||(p=i))}r&&p&&_===n-1&&!f.length&&(a=t.resolution,p="",_=-1,m=h())}return jt(f,a,e,d,r,c,o)}()}for(let t,e;_<n;_++){if((e=g[_])&&!m[e]){if(m[e]=1,t=Mt(this,e,p,0,0,!1,!1),t=At(t,f,r,a)){f=t;break}p&&(r&&t&&f.length||(p=e))}r&&p&&_===n-1&&!f.length&&(a=this.resolution,p="",_=-1,m=h())}return jt(f,a,e,d,r,c,o)},(s=Et.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},s.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},s.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},s.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},s.append=function(t,e){return this.add(t,e,!0)},s.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},s.update=function(t,e){const i=this,n=this.remove(t);return n&&n.then?n.then(()=>i.add(t,e)):this.add(t,e)},s.cleanup=function(){return this.fastupdate?(bt(this.map),this.depth&&bt(this.ctx),this):this},s.searchCache=w,s.export=function(t,e,i=0,n=0){let s,r;switch(n){case 0:s="reg",r=mt(this.reg);break;case 1:s="cfg",r=null;break;case 2:s="map",r=ft(this.map,this.reg.size);break;case 3:s="ctx",r=gt(this.ctx,this.reg.size);break;default:return}return wt.call(this,t,e,s,r,i,n)},s.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=_t(e,this.reg);break;case"map":this.map=dt(e,this.map);break;case"ctx":this.ctx=pt(e,this.ctx)}},s.serialize=function(t=!0){let e="",i="",n="";if(this.reg.size){let t;for(var s of this.reg.keys())t||(t=typeof s),e+=(e?",":"")+("string"===t?'"'+s+'"':s);e="index.reg=new Set(["+e+"]);",i=yt(this.map,t),i="index.map=new Map(["+i+"]);";for(const e of this.ctx.entries()){s=e[0];let i=yt(e[1],t);i="new Map(["+i+"])",i='["'+s+'",'+i+"]",n+=(n?",":"")+i}n="index.ctx=new Map(["+n+"]);"}return t?"function inject(index){"+e+i+n+"}":e+i+n},R(Et.prototype);const Ot="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Ct=["map","ctx","tag","reg","cfg"],It=h();function Bt(t,e={}){if(!this||this.constructor!==Bt)return new Bt(t,e);"object"==typeof t&&(e=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=e.field?e.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=e.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}function Ft(t,e,i){const n=t.value;let s,r=0;for(let t,o=0;o<n.length;o++){if(t=i?n:n[o]){for(let i,r,h=0;h<e.length;h++)if(r=e[h],i=t.indexOf(r),i>=0){if(s=1,!(t.length>1)){n[o]=[];break}t.splice(i,1)}r+=t.length}if(i)break}r?s&&t.update(n):t.delete(),t.continue()}function Dt(t,e){return new Promise((i,n)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=n,t=null})}(s=Bt.prototype).mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},s.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),It[t.id]||(It[t.id]=[]),It[t.id].push(t.field);const e=Ot.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let i,n=0;n<Ct.length;n++){i=Ct[n];for(let n,s=0;s<It[t.id].length;s++)n=It[t.id][s],e.objectStoreNames.contains(i+("reg"!==i&&n?":"+n:""))||e.createObjectStore(i+("reg"!==i&&n?":"+n:""))}},t.db=Dt(e,function(e){t.db=e,t.db.onversionchange=function(){t.close()}})},s.close=function(){this.db&&this.db.close(),this.db=null},s.destroy=function(){return Dt(Ot.deleteDatabase(this.id))},s.clear=function(){const t=[];for(let e,i=0;i<Ct.length;i++){e=Ct[i];for(let i,n=0;n<It[this.id].length;n++)i=It[this.id][n],t.push(e+("reg"!==e&&i?":"+i:""))}const e=this.db.transaction(t,"readwrite");for(let i=0;i<t.length;i++)e.objectStore(t[i]).clear();return Dt(e)},s.get=function(t,e,i=0,n=0,s=!0,r=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);const o=this;return Dt(t).then(function(t){let e=[];if(!t||!t.length)return e;if(s){if(!i&&!n&&1===t.length)return t[0];for(let s,r=0;r<t.length;r++)if((s=t[r])&&s.length){if(n>=s.length){n-=s.length;continue}const t=i?n+Math.min(s.length-n,i):s.length;for(let i=n;i<t;i++)e.push(s[i]);if(n=0,e.length===i)break}return r?o.enrich(e):e}return t})},s.tag=function(t,e=0,i=0,n=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const s=this;return Dt(t).then(function(t){return!t||!t.length||i>=t.length?[]:e||i?(t=t.slice(i,i+e),n?s.enrich(t):t):t})},s.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let n=0;n<t.length;n++)i[n]=Dt(e.get(t[n]));return Promise.all(i).then(function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e})},s.has=function(t){return Dt(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then(function(t){return!!t})},s.search=null,s.info=function(){},s.transaction=function(t,e,i){t+="reg"!==t&&this.field?":"+this.field:"";let n=this.h[t+":"+e];if(n)return i.call(this,n);let s=this.db.transaction(t,e);this.h[t+":"+e]=n=s.objectStore(t);const r=i.call(this,n);return this.h[t+":"+e]=null,Dt(s).finally(function(){return r})},s.commit=async function(t){let e=t.commit_task,i=[];t.commit_task=[];for(let t,n=0;n<e.length;n++)t=e[n],t.del&&i.push(t.del);i.length&&await this.remove(i),t.reg.size&&(await this.transaction("map","readwrite",function(e){for(const i of t.map){const t=i[0],n=i[1];n.length&&(e.get(t).onsuccess=function(){let i=this.result;var s;if(i&&i.length){const t=Math.max(i.length,n.length);for(let e,r,o=0;o<t;o++)if((r=n[o])&&r.length){if((e=i[o])&&e.length)for(s=0;s<r.length;s++)e.push(r[s]);else i[o]=r;s=1}}else i=n,s=1;s&&e.put(i,t)})}}),await this.transaction("ctx","readwrite",function(e){for(const i of t.ctx){const t=i[0],n=i[1];for(const i of n){const n=i[0],s=i[1];s.length&&(e.get(t+":"+n).onsuccess=function(){let i=this.result;var r;if(i&&i.length){const t=Math.max(i.length,s.length);for(let e,n,o=0;o<t;o++)if((n=s[o])&&n.length){if((e=i[o])&&e.length)for(r=0;r<n.length;r++)e.push(n[r]);else i[o]=n;r=1}}else i=s,r=1;r&&e.put(i,t+":"+n)})}}}),t.store?await this.transaction("reg","readwrite",function(e){for(const i of t.store){const t=i[0],n=i[1];e.put("object"==typeof n?JSON.stringify(n):1,t)}}):t.bypass||await this.transaction("reg","readwrite",function(e){for(const i of t.reg.keys())e.put(1,i)}),t.tag&&await this.transaction("tag","readwrite",function(e){for(const i of t.tag){const t=i[0],n=i[1];n.length&&(e.get(t).onsuccess=function(){let i=this.result;i=i&&i.length?i.concat(n):n,e.put(i,t)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},s.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Ft(e,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Ft(e,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Ft(e,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let i=0;i<t.length;i++)e.delete(t[i])})])};const qt={Index:Et,Charset:A,Encoder:m,Document:ct,Worker:U,Resolver:et,IndexedDB:Bt,Language:{}},Lt=void 0!==n?n:"undefined"!=typeof global?global:n;let Tt;(Tt=Lt.define)&&Tt.amd?Tt([],function(){return qt}):"object"==typeof Lt.exports?Lt.exports=qt:Lt.FlexSearch=qt}(this||self)},880(t,e,i){let n,s={};s.__wbindgen_placeholder__=t.exports;const{TextDecoder:r,TextEncoder:o}=i(23);let h=null;function l(){return null!==h&&0!==h.byteLength||(h=new Uint8Array(n.memory.buffer)),h}let c=new r("utf-8",{ignoreBOM:!0,fatal:!0});function a(t,e){return function(t,e){return c.decode(l().subarray(t,t+e))}(t>>>=0,e)}function u(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let i="[";e>0&&(i+=u(t[0]));for(let n=1;n<e;n++)i+=", "+u(t[n]);return i+="]",i}const i=/\[object ([^\]]+)\]/.exec(toString.call(t));let n;if(!(i&&i.length>1))return toString.call(t);if(n=i[1],"Object"==n)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:n}c.decode();let f=0;const d=new o("utf-8"),g="function"==typeof d.encodeInto?function(t,e){return d.encodeInto(t,e)}:function(t,e){const i=d.encode(t);return e.set(i),{read:t.length,written:i.length}};function p(t,e,i){if(void 0===i){const i=d.encode(t),n=e(i.length,1)>>>0;return l().subarray(n,n+i.length).set(i),f=i.length,n}let n=t.length,s=e(n,1)>>>0;const r=l();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;r[s+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),s=i(s,n,n=o+3*t.length,1)>>>0;const e=l().subarray(s+o,s+n);o+=g(t,e).written,s=i(s,n,o,1)>>>0}return f=o,s}let m=null;function _(){return(null===m||!0===m.buffer.detached||void 0===m.buffer.detached&&m.buffer!==n.memory.buffer)&&(m=new DataView(n.memory.buffer)),m}function w(t){return null==t}function y(t,e){t>>>=0;const i=_(),s=[];for(let r=t;r<t+4*e;r+=4)s.push(n.__wbindgen_export_2.get(i.getUint32(r,!0)));return n.__externref_drop_slice(t,e),s}function b(t){const e=n.__wbindgen_export_2.get(t);return n.__externref_table_dealloc(t),e}t.exports.cut=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.cut(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.cut_all=function(t){const e=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=f,s=n.cut_all(e,i);var r=y(s[0],s[1]).slice();return n.__wbindgen_free(s[0],4*s[1],4),r},t.exports.cut_for_search=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.cut_for_search(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.tokenize=function(t,e,i){const s=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),r=f,o=p(e,n.__wbindgen_malloc,n.__wbindgen_realloc),h=f,l=n.tokenize(s,r,o,h,w(i)?16777215:i?1:0);if(l[3])throw b(l[2]);var c=y(l[0],l[1]).slice();return n.__wbindgen_free(l[0],4*l[1],4),c},t.exports.add_word=function(t,e,i){const s=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),r=f;var o=w(i)?0:p(i,n.__wbindgen_malloc,n.__wbindgen_realloc),h=f;return n.add_word(s,r,w(e)?4294967297:e>>>0,o,h)>>>0},t.exports.tag=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.tag(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.with_dict=function(t){const e=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=f,s=n.with_dict(e,i);if(s[1])throw b(s[0])},t.exports.__wbg_Error_0497d5bdba9362e5=function(t,e){return Error(a(t,e))},t.exports.__wbg_new_07b483f72211fd66=function(){return new Object},t.exports.__wbg_set_3f1d0b984ed272ed=function(t,e,i){t[e]=i},t.exports.__wbindgen_bigint_from_u64=function(t){return BigInt.asUintN(64,t)},t.exports.__wbindgen_debug_string=function(t,e){const i=p(u(e),n.__wbindgen_malloc,n.__wbindgen_realloc),s=f;_().setInt32(t+4,s,!0),_().setInt32(t+0,i,!0)},t.exports.__wbindgen_init_externref_table=function(){const t=n.__wbindgen_export_2,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},t.exports.__wbindgen_number_new=function(t){return t},t.exports.__wbindgen_string_new=function(t,e){return a(t,e)},t.exports.__wbindgen_throw=function(t,e){throw new Error(a(t,e))};const x=i(928).join(__dirname,"jieba_rs_wasm_bg.wasm"),v=i(896).readFileSync(x),k=new WebAssembly.Module(v),j=new WebAssembly.Instance(k,s);n=j.exports,t.exports.__wasm=n,n.__wbindgen_start()},642(t){"use strict";t.exports=require("better-sqlite3/build/Release/better_sqlite3.node")},896(t){"use strict";t.exports=require("fs")},928(t){"use strict";t.exports=require("path")},23(t){"use strict";t.exports=require("util")},167(t){"use strict";t.exports=require("worker_threads")}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};(()=>{"use strict";const t=__webpack_require__(285),e=__webpack_require__(54);(0,t.file_search_start)(),(0,e.start_ai_agent_agent)()})()})();
|
|
2
|
+
(()=>{var __webpack_modules__={54(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.start_ai_agent_agent=function(){(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_init,async t=>{const{index_storage_type:e,db_path:i}=t.data;k=e,"memory"===e&&(b||(b=new o.default.Index({tokenize:"strict"}),x=new o.default.Index({tokenize:"strict"}))),"sqlite"===e&&(v=new u(i,{nativeBinding:a}),v.exec("\n CREATE VIRTUAL TABLE IF NOT EXISTS docs USING fts5(\n file_path UNINDEXED,\n content,\n mtime UNINDEXED,\n tokenize = 'unicode61'\n );\n \n CREATE VIRTUAL TABLE IF NOT EXISTS doc_names USING fts5(\n file_path UNINDEXED,\n name,\n mtime UNINDEXED,\n tokenize = 'unicode61'\n );\n "),w=v.prepare("\n SELECT mtime FROM docs WHERE file_path = ? LIMIT 1\n "),y=v.prepare("\n SELECT mtime FROM doc_names WHERE file_path = ? LIMIT 1\n "),f=v.prepare("INSERT INTO docs (file_path, content, mtime) VALUES (?, ?, ?)"),d=v.prepare("INSERT INTO doc_names (file_path, name, mtime) VALUES (?, ?, ?)"),g=v.prepare("DELETE FROM docs WHERE file_path = ?"),p=v.prepare("DELETE FROM doc_names WHERE file_path = ?"),m=v.prepare("\n SELECT file_path\n FROM docs\n WHERE docs MATCH ?\n ORDER BY bm25(docs)\n LIMIT 50\n "),_=v.prepare("\n SELECT file_path\n FROM doc_names\n WHERE doc_names MATCH ?\n ORDER BY bm25(doc_names)\n LIMIT 50\n "))}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_add,async t=>{let e,i,{use_zh_segmentation:n,file_path:s,mtime:r}=t.data;if("sqlite"===k&&v){r=r??(await c.FileUtil.statSync(s)).mtime;const t=w.get(s);if(t&&t.mtime===r)return{char_num:0};e=`${s} ${(await c.FileUtil.readFileSync(s)).toString()}。`,i=e.length;let o=e,l=s;n&&(o=(0,h.cut)(e,!0).join(" "),l=(0,h.cut)(s,!0).join(" ")),g.run(s),p.run(s),f.run(s,o,r),d.run(s,l,r)}if("memory"===k){e=`${s} ${(await c.FileUtil.readFileSync(s)).toString()}。`,i=e.length;let t=e.toLowerCase(),r=s.toLowerCase();n&&(t=(0,h.cut)(e,!0).join(" ").toLowerCase(),r=(0,h.cut)(s,!0).join(" ").toLowerCase()),b?.add(s,t),x?.add(s,r)}return{char_num:i}}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_del,async t=>{const{file_path:e}=t.data;"memory"===k&&(b?.remove(e),x?.remove(e)),"sqlite"===k&&v&&(g.run(e),p.run(e))}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_search,async t=>{const{key:e,use_zh_segmentation:i}=t.data;let n=e;if(i){n=(0,h.cut)(e,!0).map(t=>t+"*").join(" OR ")}if("memory"===k){const t={suggest:!0,resolution:9,context:!0,limit:50};return{ids:b?.search(n,t)||[],names_ids:x?.search(n,t)||[]}}if("sqlite"===k&&v){const t=(0,h.cut)(n,!0).filter(t=>""!==t.trim()).map(t=>t+"*").join(" OR "),e=m.all(t),i=_.all(t);return{ids:e.map(t=>t.file_path),names_ids:i.map(t=>t.file_path)}}return{ids:[],names_ids:[]}}),(0,s.register_threads_worker_handler)(r.threads_msg_type.docs_close,async()=>{"memory"===k&&(b?.clear(),x?.clear(),b=null,x=null),"sqlite"===k&&v&&(v.close(),v=null)})};const s=i(324),r=i(525),o=n(i(474)),h=i(880),l=i(917),c=i(776),a=(0,l.get_bin_dependency)("sqlite3"),u=(0,l.get_bin_dependency)("better-sqlite3");let f,d,g,p,m,_,w,y,b=null,x=null,v=null,k="memory"},917(__unused_webpack_module,exports,__webpack_require__){"use strict";function get_bin_dependency(module,auto_throw=!1){try{return"sqlite3"===module?__webpack_require__(642):eval("require")(module)}catch(t){if(console.log(`npm 模块没有加载失败,请手动安装 npm 依赖( -g 安装的就尝试全局安装,本地仓库安装的就在仓库内安装):${module} error ${t.message}`),auto_throw)throw t}return{}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.get_bin_dependency=get_bin_dependency},776(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FileUtil=void 0;const s=n(i(896)),r=n(i(928));e.FileUtil=class{static async statSync(t){return s.default.promises.stat(t)}static async readdirSync(t){return s.default.promises.readdir(t)}static async readFileSync(t){return s.default.promises.readFile(t)}static async open(t,e,i){return s.default.promises.open(t,e,i)}static async access(t){try{return await s.default.promises.access(t,s.default.constants.F_OK),!0}catch{return!1}}static async access_all(t){let e=0;for(const i of t)try{await s.default.promises.access(i,s.default.constants.F_OK),e++}catch{}return e===t.length}static async appendFileSync(t,e,i){return s.default.promises.appendFile(t,e,i)}static async writeFileSync(t,e){return s.default.promises.writeFile(t,e)}static async writeFileSyncWithUtf8bom(t,e){return e.startsWith("\ufeff")||(e="\ufeff"+e),s.default.promises.writeFile(t,e,{encoding:"utf8"})}static async truncateSync(t){return s.default.promises.truncate(t)}static async unlinkSync(t){return s.default.promises.unlink(t)}static async mkdirSync(t,e){return s.default.promises.mkdir(t,e)}static async renameSync(t,e){return s.default.promises.rename(t,e)}static async getUniqueFileName(t){const e=r.default.dirname(t),i=r.default.extname(t),n=r.default.basename(t,i);let s=t,o=1;for(;await this.access(s);)s=r.default.join(e,`${n}(${o})${i}`),o++;return s}static async get_exe_path_by_env_dir(t,e){if(!await this.access(t))return null;if(!(await this.statSync(t)).isDirectory())return null;const i=await this.readdirSync(t);for(const n of i)if(n.startsWith(e))return r.default.join(t,`${n}`);return null}static async ensure_dir(t){await s.default.promises.mkdir(t,{recursive:!0})}static async copy(t,e,i=[]){if((await s.default.promises.stat(t)).isFile()){if(await this.ensure_dir(r.default.dirname(e)),i.includes(r.default.basename(t)))return;return void await s.default.promises.copyFile(t,e)}await this.ensure_dir(e);const n=await s.default.promises.readdir(t,{withFileTypes:!0});for(const o of n){const n=r.default.join(t,o.name),h=r.default.join(e,o.name);i.includes(o.name)||(o.isDirectory()?await this.copy(n,h,i):o.isFile()&&await s.default.promises.copyFile(n,h))}}static async remove_dir(t){if(!await this.access(t))return;if((await s.default.promises.stat(t)).isFile())return void await s.default.promises.unlink(t);const e=await s.default.promises.readdir(t);for(const i of e){const e=r.default.join(t,i);(await s.default.promises.stat(e)).isDirectory()?await this.remove_dir(e):await s.default.promises.unlink(e)}await s.default.promises.rmdir(t)}static async find_max_numbered_version_file(t){const e=r.default.dirname(t),i=r.default.basename(t);if(!await this.access(e))return null;const n=await s.default.promises.readdir(e);let o=-1,h=null;const l=r.default.join(e,i);await this.access(l)&&(h=l,o=0);for(const t of n){if(!t.startsWith(i))continue;const n=t.slice(i.length);if(0===n.length)continue;let s=0,l=!1;for(const t of n){if(!(t>="0"&&t<="9")){l=!1;break}s=10*s+(t.charCodeAt(0)-48),l=!0}l&&(s>o&&(o=s,h=r.default.join(e,t)))}return h}static async get_next_numbered_name(t){const e=r.default.dirname(t),i=r.default.basename(t);if(!await this.access(e))return t;const n=await s.default.promises.readdir(e);let o=0;const h=r.default.join(e,i);if(!await this.access(h))return h;for(const t of n){if(!t.startsWith(i))continue;const e=t.slice(i.length);if(!e)continue;let n=0,s=!1;for(const t of e){if(!(t>="0"&&t<="9")){s=!1;break}n=10*n+(t.charCodeAt(0)-48),s=!0}s&&(n>o&&(o=n))}return r.default.join(e,`${i}${o+1}`)}}},285(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.file_search_start=function(){(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search,async t=>{const{start:e,end:i,file_path:c,query_text_buffer:a,ram_id:u}=t.data;let f=0,d=Buffer.alloc(0);const g=r.openSync(c,"r");let p=0;for(;f<i&&!l[u];){const t=Buffer.alloc(2097152);let e=r.readSync(g,t,0,t.length,f);if(0===e)break;f+=e,d=Buffer.concat([d,t.subarray(0,e)]),(0,n.threads_send)({type:s.threads_msg_type.search_file_progress,data:{progress:(100*f/i).toFixed(0),ram_id:u}});const l=[];if(h(d,a,l),l.length>0){for(let t=0;t<l.length;t++)l[t]+=p;(0,n.threads_send)({type:s.threads_msg_type.search_file_index,data:{find_index:l,ram_id:u}})}p+=d.length-a.length,d=o(d,d.length-a.length,d.length)}return(0,n.threads_send)({type:s.threads_msg_type.search_file_end,data:{ram_id:u}}),r.closeSync(g),"ok"}),(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search_close,async t=>{const{ram_id:e}=t.data;return l[e]=!0,"ok"}),(0,n.register_threads_worker_handler)(s.threads_msg_type.file_search_start,async t=>{const{ram_id:e}=t.data;return delete l[e],"ok"})};const n=i(324),s=i(525),r=i(896);function o(t,e,i){const n=i-e,s=Buffer.alloc(n);return t.copy(s,0,e,i),s}function h(t,e,i){const n=function(t){const e={},i=t.length;for(let n=0;n<i;n++)e[t[n]]=n;return e}(e),s=t.length,r=e.length,o=s-r;let h=0;for(;h<=o;){let o=r-1;for(;o>=0&&t[h+o]===e[o];)o--;if(o<0)i.push(h),h+=h+r<s?r-n[t[h+r]]||r:1;else{const e=n[t[h+o]],i=void 0!==e?o-e:o+1;h+=Math.max(i,1)}}}const l={}},525(t,e){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.threads_msg_type=void 0,function(t){t[t.hello=1]="hello",t[t.file_search_start=2]="file_search_start",t[t.file_search=3]="file_search",t[t.file_search_close=4]="file_search_close",t[t.search_file_index=5]="search_file_index",t[t.search_file_progress=6]="search_file_progress",t[t.search_file_end=7]="search_file_end",t[t.docs_init=8]="docs_init",t[t.docs_add=9]="docs_add",t[t.docs_del=10]="docs_del",t[t.docs_close=11]="docs_close",t[t.docs_search=12]="docs_search"}(i||(e.threads_msg_type=i={}))},324(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.register_threads_worker_handler=o,e.threads_send=h;const n=i(167),s=i(525);console.log("[worker] 子线程启动, workerData=",n.workerData);const r=new Map;function o(t,e){r.set(t,e)}function h(t){try{n.parentPort?.postMessage(t)}catch(t){console.error("[worker] send failed:",t)}}n.parentPort?.on("message",t=>{(async function(t){try{const e=r.get(t.type);if(!e)return void h({id:t.id,type:t.type,data:`unknown type ${t.type}`});const i=await e(t);h({id:t.id,type:t.type,data:i})}catch(e){h({id:t.id,type:t.type,data:null,error:e?.message||String(e)}),console.error("[worker] task error:",e)}})(t).catch(console.error)}),o(s.threads_msg_type.hello,async t=>new Promise((e,i)=>setTimeout(()=>{if(Math.random()<.05)return i(new Error("模拟错误"));e(`done:${t.data}`)},500))),console.log("[worker] ready and waiting for messages..."),process.on("uncaughtException",t=>{console.error("子线程全局未捕获异常:",t)}),process.on("unhandledRejection",t=>{console.error("子线程未处理的 Promise 拒绝:",t)})},474(t,e,i){t=i.nmd(t),function e(n){"use strict";var s;function r(t,e,i){const n=typeof i,s=typeof t;if("undefined"!==n){if("undefined"!==s){if(i){if("function"===s&&n===s)return function(e){return t(i(e))};if((e=t.constructor)===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var r=new Map(i);for(var o of t)r.set(o[0],o[1]);return r}if(e===Set){for(r of(o=new Set(i),t.values()))o.add(r);return o}}}return t}return i}return"undefined"===s?e:t}function o(t,e){return void 0===t?e:t}function h(){return Object.create(null)}function l(t){return"string"==typeof t}function c(t){return"object"==typeof t}function a(t,e){if(l(e))t=t[e];else for(let i=0;t&&i<e.length;i++)t=t[e[i]];return t}(n=t)._factory=e;const u=/[^\p{L}\p{N}]+/u,f=/(\d{3})/g,d=/(\D)(\d{3})/g,g=/(\d{3})(\D)/g,p=/[\u0300-\u036f]/g;function m(t={}){if(!this||this.constructor!==m)return new m(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function _(t){t.F=null,t.B.clear(),t.D.clear()}function w(t,e,i){i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):i=t),i&&(t=i.query||t,e=i.limit||e);let n=""+(e||0);i&&(n+=(i.offset||0)+!!i.context+!!i.suggest+(!1!==i.resolve)+(i.resolution||this.resolution)+(i.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new y);let s=this.cache.get(t+n);if(!s){const r=i&&i.cache;r&&(i.cache=!1),s=this.search(t,e,i),r&&(i.cache=r),this.cache.set(t+n,s)}return s}function y(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}(s=m.prototype).assign=function(t){this.normalize=r(t.normalize,!0,this.normalize);let e,i=t.include,n=i||t.exclude||t.split;if(n||""===n){if("object"==typeof n&&n.constructor!==RegExp){let t="";e=!i,i||(t+="\\p{Z}"),n.letter&&(t+="\\p{L}"),n.number&&(t+="\\p{N}",e=!!i),n.symbol&&(t+="\\p{S}"),n.punctuation&&(t+="\\p{P}"),n.control&&(t+="\\p{C}"),(n=n.char)&&(t+="object"==typeof n?n.join(""):n);try{this.split=new RegExp("["+(i?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=n,e=!1===n||"a1a".split(n).length<2;this.numeric=r(t.numeric,e)}else{try{this.split=r(this.split,u)}catch(t){this.split=/\s+/}this.numeric=r(t.numeric,r(this.numeric,!0))}if(this.prepare=r(t.prepare,null,this.prepare),this.finalize=r(t.finalize,null,this.finalize),n=t.filter,this.filter="function"==typeof n?n:r(n&&new Set(n),null,this.filter),this.dedupe=r(t.dedupe,!0,this.dedupe),this.matcher=r((n=t.matcher)&&new Map(n),null,this.matcher),this.mapper=r((n=t.mapper)&&new Map(n),null,this.mapper),this.stemmer=r((n=t.stemmer)&&new Map(n),null,this.stemmer),this.replacer=r(t.replacer,null,this.replacer),this.minlength=r(t.minlength,1,this.minlength),this.maxlength=r(t.maxlength,1024,this.maxlength),this.rtl=r(t.rtl,!1,this.rtl),(this.cache=n=r(t.cache,!0,this.cache))&&(this.F=null,this.L="number"==typeof n?n:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},s.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&_(this),this},s.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_(this),this},s.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_(this),this)},s.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&_(this),this)},s.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_(this),this)},s.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(_,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):p?t.normalize("NFKD").replace(p,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(d,"$1 $2").replace(g,"$1 $2").replace(f,"$1 "));const i=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let n,s,r=[],o=h(),l=this.split||""===this.split?t.split(this.split):[t];for(let t,h,a=0;a<l.length;a++)if((t=h=l[a])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(n===t)continue;n=t}if(i)r.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.I)if(this.F){var c=this.D.get(t);if(c||""===c){c&&r.push(c);continue}}else this.F=setTimeout(_,50,this);if(this.stemmer){let e;for(this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));e!==t&&t.length>2;)e=t,t=t.replace(this.K,t=>this.stemmer.get(t))}if(t&&(this.mapper||this.dedupe&&t.length>1)){c="";for(let e,i,n=0,s="";n<t.length;n++)e=t.charAt(n),e===s&&this.dedupe||((i=this.mapper&&this.mapper.get(e))||""===i?i===s&&this.dedupe||!(s=i)||(c+=i):c+=s=e);t=c}if(this.matcher&&t.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),t=t.replace(this.J,t=>this.matcher.get(t))),t&&this.replacer)for(c=0;t&&c<this.replacer.length;c+=2)t=t.replace(this.replacer[c],this.replacer[c+1]);if(this.cache&&h.length<=this.I&&(this.D.set(h,t),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),t){if(t!==h)if(e){if(o[t])continue;o[t]=1}else{if(s===t)continue;s=t}r.push(t)}}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&t.length<=this.H&&(this.B.set(t,r),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),r},y.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},y.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},y.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}},y.prototype.clear=function(){this.cache.clear(),this.h=""};const b={normalize:!1,numeric:!1,dedupe:!1},x={},v=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),k=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),j=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],S={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var A={Exact:b,Default:x,Normalize:x,LatinBalance:{mapper:v},LatinAdvanced:{mapper:v,matcher:k,replacer:j},LatinExtra:{mapper:v,replacer:j.concat([/(?!^)[aeo]/g,""]),matcher:k},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;i<t.length;i++){var e=t[i];let n=e.charAt(0),s=S[n];for(let t,i=1;i<e.length&&(t=e.charAt(i),"h"===t||"w"===t||!(t=S[t])||t===s||(n+=t,s=t,4!==n.length));i++);t[i]=n}}},CJK:{split:""},LatinExact:b,LatinDefault:x,LatinSimple:x};function M(t,e,i,n){let s=[];for(let r,o=0;o<t.index.length;o++)if(r=t.index[o],e>=r.length)e-=r.length;else{const o=(e=r[n?"splice":"slice"](e,i)).length;if(o&&(s=s.length?s.concat(e):e,i-=o,n&&(t.length-=o),!i))break;e=0}return s}function E(t){if(!this||this.constructor!==E)return new E(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,i)=>"length"===i?e.length:"push"===i?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===i?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===i?function(t){let i=0;for(let n,s,r=0;r<e.index.length;r++){if(n=e.index[r],s=n.indexOf(t),s>=0)return i+s;i+=n.length}return-1}:"includes"===i?function(t){for(let i=0;i<e.index.length;i++)if(e.index[i].includes(t))return!0;return!1}:"slice"===i?function(t,i){return M(e,t||0,i||e.length,!1)}:"splice"===i?function(t,i){return M(e,t||0,i||e.length,!0)}:"constructor"===i?Array:"symbol"!=typeof i?(t=e.index[i/2**31|0])&&t[i]:void 0,set:(t,i,n)=>(t=i/2**31|0,(e.index[t]||(e.index[t]=[]))[i]=n,e.length++,!0)})}function z(t=8){if(!this||this.constructor!==z)return new z(t);this.index=h(),this.h=[],this.size=0,t>32?(this.B=F,this.A=BigInt(t)):(this.B=C,this.A=t)}function O(t=8){if(!this||this.constructor!==O)return new O(t);this.index=h(),this.h=[],this.size=0,t>32?(this.B=F,this.A=BigInt(t)):(this.B=C,this.A=t)}function C(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let i=0,n=this.A+1;for(let s=0;s<t.length;s++)i=(i*n^t.charCodeAt(s))&e;return 32===this.A?i+2**31:i}function F(t){let e=BigInt(2)**this.A-BigInt(1);var i=typeof t;if("bigint"===i)return t&e;if("number"===i)return BigInt(t)&e;i=BigInt(0);let n=this.A+BigInt(1);for(let s=0;s<t.length;s++)i=(i*n^BigInt(t.charCodeAt(s)))&e;return i}let I,B,D,q,L;async function T(t){var e=(t=t.data).task;const i=t.id;let s=t.args;if("init"===e)B=t.options||{},(e=t.factory)?(Function("return "+e)()(n),I=new n.FlexSearch.Index(B),delete n.FlexSearch):I=new Et(B),postMessage({id:i});else{let n;"export"===e&&(s[1]?(s[0]=B.export,s[2]=0,s[3]=1):s=null),"import"===e?s[0]&&(t=await B.import.call(I,s[0]),I.import(s[0],t)):((n=s&&I[e].apply(I,s))&&n.then&&(n=await n),n&&n.await&&(n=await n.await),"search"===e&&n.result&&(n=n.result)),postMessage("search"===e?{id:i,msg:n}:{id:i})}}function R(t){N.call(t,"add"),N.call(t,"append"),N.call(t,"search"),N.call(t,"update"),N.call(t,"remove"),N.call(t,"searchCache")}function $(){D=L=0}function N(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let n;if("function"==typeof i&&(n=i,delete e[e.length-1]),D?L||(L=Date.now()-q>=this.priority*this.priority*3):(D=setTimeout($,0),q=Date.now()),L){const i=this;return new Promise(n=>{setTimeout(function(){n(i[t+"Async"].apply(i,e))},0)})}const s=this[t].apply(this,e);return i=s.then?s:new Promise(t=>t(s)),n&&i.then(n),i}}E.prototype.clear=function(){this.index.length=0},E.prototype.push=function(){},z.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},z.prototype.set=function(t,e){var i=this.B(t);let n=this.index[i];n?(i=n.size,n.set(t,e),(i-=n.size)&&this.size++):(this.index[i]=n=new Map([[t,e]]),this.h.push(n),this.size++)},O.prototype.add=function(t){var e=this.B(t);let i=this.index[e];i?(e=i.size,i.add(t),(e-=i.size)&&this.size++):(this.index[e]=i=new Set([t]),this.h.push(i),this.size++)},(s=z.prototype).has=O.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},s.delete=O.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},s.clear=O.prototype.clear=function(){this.index=h(),this.h=[],this.size=0},s.values=O.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},s.keys=O.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},s.entries=O.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};let P=0;function U(t={},e){function s(i){function n(t){const e=(t=t.data||t).id,i=e&&l.h[e];i&&(i(t.msg),delete l.h[e])}if(this.worker=i,this.h=h(),this.worker)return o?this.worker.on("message",n):this.worker.onmessage=n,t.config?new Promise(function(e){P>1e9&&(P=0),l.h[++P]=function(){e(l)},l.worker.postMessage({id:P,task:"init",factory:r,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:r,options:t}),this)}if(!this||this.constructor!==U)return new U(t);let r=void 0!==n?n._factory:"undefined"!=typeof window?window._factory:null;r&&(r=r.toString());const o="undefined"==typeof window,l=this,c=function(t,e,n){return e?new(i(167).Worker)(__dirname+"/node/node.js"):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+T.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof n?n:(0,eval)("import.meta.url").replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}(r,o,t.worker);return c.then?c.then(function(t){return s.call(l,t)}):s.call(this,c)}function W(t){U.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var n=i[i.length-1];let s;return"function"==typeof n&&(s=n,i.pop()),n=new Promise(function(n){"export"===t&&"function"==typeof i[0]&&(i[0]=null),P>1e9&&(P=0),e.h[++P]=n,e.worker.postMessage({task:t,id:P,args:i})}),s?(n.then(s),this):n}}function H(t,e,i,n,s,r){if(t=t[s],n===i.length-1)e[s]=r||t;else if(t)if(t.constructor===Array)for(e=e[s]=Array(t.length),s=0;s<t.length;s++)H(t,e,i,n,s);else e=e[s]||(e[s]=h()),s=i[++n],H(t,e,i,n,s)}function J(t,e,i,n,s,r,o,h){if(t=t[o])if(n===e.length-1){if(t.constructor===Array){if(i[n]){for(e=0;e<t.length;e++)s.add(r,t[e],!0,!0);return}t=t.join(" ")}s.add(r,t,h,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)J(t,e,i,n,s,r,o,h);else o=e[++n],J(t,e,i,n,s,r,o,h)}function K(t,e,i,n){if(!t.length)return t;if(1===t.length)return t=t[0],t=i||t.length>e?t.slice(i,i+e):t,n?lt.call(this,t):t;let s=[];for(let r,o,h=0;h<t.length;h++)if((r=t[h])&&(o=r.length)){if(i){if(i>=o){i-=o;continue}r=r.slice(i,i+e),o=r.length,i=0}if(o>e&&(r=r.slice(0,e),o=e),!s.length&&o>=e)return n?lt.call(this,r):r;if(s.push(r),!(e-=o))break}return s=s.length>1?[].concat.apply([],s):s[0],n?lt.call(this,s):s}function G(t,e,i,n){var s=n[0];if(s[0]&&s[0].query)return t[e].apply(t,s);if(!("and"!==e&&"not"!==e||t.result.length||t.await||s.suggest))return n.length>1&&(s=n[n.length-1]),(n=s.resolve)?t.await||t.result:t;let r,o,h,l,c,a=[],u=0,f=0;for(e=0;e<n.length;e++)if(s=n[e]){var d=void 0;if(s.constructor===et)d=s.await||s.result;else if(s.then||s.constructor===Array)d=s;else{u=s.limit||0,f=s.offset||0,h=s.suggest,o=s.resolve,r=((l=s.highlight||t.highlight)||s.enrich)&&o,d=s.queue;let i=s.async||d,n=s.index,g=s.query;if(n?t.index||(t.index=n):n=t.index,g||s.tag){const r=s.field||s.pluck;if(r&&(!g||t.query&&!l||(t.query=g,t.field=r,t.highlight=l),n=n.index.get(r)),d&&(c||t.await)){let r;c=1;const o=t.C.length,h=new Promise(function(t){r=t});(function(e,n){h.h=function(){n.index=null,n.resolve=!1;let s=i?e.searchAsync(n):e.search(n);return s.then?s.then(function(e){return t.C[o]=e=e.result||e,r(e),e}):(s=s.result||s,r(s),s)}})(n,Object.assign({},s)),t.C.push(h),a[e]=h;continue}s.resolve=!1,s.index=null,d=i?n.searchAsync(s):n.search(s),s.resolve=o,s.index=n}else if(s.and)d=X(s,"and",n);else if(s.or)d=X(s,"or",n);else if(s.not)d=X(s,"not",n);else{if(!s.xor)continue;d=X(s,"xor",n)}}d.await?(c=1,d=d.await):d.then?(c=1,d=d.then(function(t){return t.result||t})):d=d.result||d,a[e]=d}if(c&&!t.await&&(t.await=new Promise(function(e){t.return=e})),c){const e=Promise.all(a).then(function(n){for(let s=0;s<t.C.length;s++)if(t.C[s]===e){t.C[s]=function(){return i.call(t,n,u,f,r,o,h,l)};break}it(t)});t.C.push(e)}else{if(!t.await)return i.call(t,a,u,f,r,o,h,l);t.C.push(function(){return i.call(t,a,u,f,r,o,h,l)})}return o?t.await||t.result:t}function X(t,e,i){const n=(t=t[e])[0]||t;return n.index||(n.index=i),i=new et(n),t.length>1&&(i=i[e].apply(i,t.slice(1))),i}function V(t,e,i,n,s,r,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=st(t,e,i,!1,this.h),i=0)),s&&(this.await=null),s?this.resolve(e,i,n,o):this}function Y(t,e,i,n,s,r,o){if(!r&&!this.result.length)return s?this.result:this;let h;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let n=0;for(let e,i,s=0;s<t.length;s++)if((e=t[s])&&(i=e.length))n<i&&(n=i);else if(!r){n=0;break}n?(this.result=nt(t,n,e,i,r,this.h,s),h=!0):this.result=[]}else r||(this.result=t);return s&&(this.await=null),s?this.resolve(e,i,n,o,h):this}function Z(t,e,i,n,s,r,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{r=i;var l=this.h;const n=[],o=h();let c=0;for(let e,i=0;i<t.length;i++)if(e=t[i]){c<e.length&&(c=e.length);for(let t,i=0;i<e.length;i++)if(t=e[i])for(let e,i=0;i<t.length;i++)e=t[i],o[e]=o[e]?2:1}for(let i,h=0,a=0;h<c;h++)for(let c,u=0;u<t.length;u++)if((c=t[u])&&(i=c[h]))for(let c,f=0;f<i.length;f++)if(c=i[f],1===o[c])if(r)r--;else if(s){if(n.push(c),n.length===e){t=n;break t}}else{const i=h+(u?l:0);if(n[i]||(n[i]=[]),n[i].push(c),++a===e){t=n;break t}}t=n}this.result=t,l=!0}else r||(this.result=t);return s&&(this.await=null),s?this.resolve(e,i,n,o,l):this}function Q(t,e,i,n,s,r,o){if(!r&&!this.result.length)return s?this.result:this;if(t.length&&this.result.length){t:{r=i;var h=[];t=new Set(t.flat().flat());for(let i,n=0,o=0;n<this.result.length;n++)if(i=this.result[n])for(let l,c=0;c<i.length;c++)if(l=i[c],!t.has(l))if(r)r--;else if(s){if(h.push(l),h.length===e){t=h;break t}}else if(h[n]||(h[n]=[]),h[n].push(l),++o===e){t=h;break t}t=h}this.result=t,h=!0}return s&&(this.await=null),s?this.resolve(e,i,n,o,h):this}function tt(t,e,i,n,s){let r,o,h;"string"==typeof s?(r=s,s=""):r=s.template,o=r.indexOf("$1"),h=r.substring(o+2),o=r.substring(0,o);let l=s&&s.boundary,c=!s||!1!==s.clip,u=s&&s.merge&&h&&o&&new RegExp(h+" "+o,"g");var f=0;if("object"==typeof(s=s&&s.ellipsis)){var d=s.template;f=d.length-2,s=s.pattern}let g,p;"string"!=typeof s&&(s=!1===s?"":"..."),f&&(s=d.replace("$1",s)),d=s.length-f,"object"==typeof l&&(g=l.before,0===g&&(g=-1),p=l.after,0===p&&(p=-1),l=l.total||9e5),f=new Map;for(let B,D,q,L=0;L<e.length;L++){let T;if(n)T=e,q=n;else{var m=e[L];if(q=m.field,!q)continue;T=m.result}D=i.get(q),B=D.encoder,"string"!=typeof(m=f.get(B))&&(m=B.encode(t),f.set(B,m));for(let t=0;t<T.length;t++){var _=T[t].doc;if(!_)continue;if(!(_=a(_,q)))continue;var w=_.trim().split(/\s+/);if(!w.length)continue;_="";var y=[];let e=[];for(var b=-1,x=-1,v=0,k=0;k<w.length;k++){var j=w[k],S=B.encode(j);let t;if((S=S.length>1?S.join(" "):S[0])&&j){for(var A=j.length,M=(B.split?j.replace(B.split,""):j).length-S.length,E="",z=0,O=0;O<m.length;O++){var C=m[O];if(C){var F=C.length;F+=M<0?0:M,z&&F<=z||(C=S.indexOf(C))>-1&&(E=(C?j.substring(0,C):"")+o+j.substring(C,C+F)+h+(C+F<A?j.substring(C+F):""),z=F,t=!0)}}E&&(l&&(b<0&&(b=_.length+(_?1:0)),x=_.length+(_?1:0)+E.length,v+=A,e.push(y.length),y.push({match:E})),_+=(_?" ":"")+E)}if(t){if(l&&v>=l)break}else _+=(_?" ":"")+(j=w[k]),l&&y.push({text:j})}if(v=e.length*(r.length-2),g||p||l&&_.length-v>l)if(k=x-b,g>0&&(k+=g),p>0&&(k+=p),k<=(v=l+v-2*d))w=g?b-(g>0?g:0):b-((v-k)/2|0),y=p?x+(p>0?p:0):w+v,c||(w>0&&" "!==_.charAt(w)&&" "!==_.charAt(w-1)&&((w=_.indexOf(" ",w))<0&&(w=0)),y<_.length&&" "!==_.charAt(y-1)&&" "!==_.charAt(y)&&((y=_.lastIndexOf(" ",y))<x?y=x:++y)),_=(w?s:"")+_.substring(w,y)+(y<_.length?s:"");else{for(x=[],b={},v={},k={},j={},S={},E=M=A=0,O=z=1;;){var I=void 0;for(let t,i=0;i<e.length;i++){if(t=e[i],E)if(M!==E){if(k[i+1])continue;if(t+=E,b[t]){A-=d,v[i+1]=1,k[i+1]=1;continue}if(t>=y.length-1){if(t>=y.length){k[i+1]=1,t>=w.length&&(v[i+1]=1);continue}A-=d}if(_=y[t].text,F=p&&S[i]){if(!(F>0)){k[i+1]=1;continue}if(_.length>F){if(k[i+1]=1,!c)continue;_=_.substring(0,F)}(F-=_.length)||(F=-1),S[i]=F}if(A+_.length+1<=l)_=" "+_,x[i]+=_;else{if(!c){k[i+1]=1;continue}(I=l-A-1)>0&&(_=" "+_.substring(0,I),x[i]+=_),k[i+1]=1}}else{if(k[i])continue;if(t-=M,b[t]){A-=d,k[i]=1,v[i]=1;continue}if(t<=0){if(t<0){k[i]=1,v[i]=1;continue}A-=d}if(_=y[t].text,F=g&&j[i]){if(!(F>0)){k[i]=1;continue}if(_.length>F){if(k[i]=1,!c)continue;_=_.substring(_.length-F)}(F-=_.length)||(F=-1),j[i]=F}if(A+_.length+1<=l)_+=" ",x[i]=_+x[i];else{if(!c){k[i]=1;continue}(I=_.length+1-(l-A))>=0&&I<_.length&&(_=_.substring(I)+" ",x[i]=_+x[i]),k[i]=1}}else{let e;if(_=y[t].match,g&&(j[i]=g),p&&(S[i]=p),i&&A++,t?!i&&d&&(A+=d):(v[i]=1,k[i]=1),t>=w.length-1||t<y.length-1&&y[t+1].match?e=1:d&&(A+=d),A-=r.length-2,i&&!(A+_.length<=l)){I=z=O=v[i]=0;break}x[i]=_,e&&(v[i+1]=1,k[i+1]=1)}A+=_.length,I=b[t]=1}if(I)M===E?E++:M++;else{if(M===E?z=0:O=0,!z&&!O)break;z?E=++M:E++}}_="";for(let t,e=0;e<x.length;e++)t=(v[e]?e?" ":"":(e&&!s?" ":"")+s)+x[e],_+=t;s&&!v[x.length]&&(_+=s)}u&&(_=_.replace(u," ")),T[t].highlight=_}if(n)break}return e}function et(t,e){if(!this||this.constructor!==et)return new et(t,e);let i,n,s,r,o,h,l=0;if(t&&t.index){const i=t;if(e=i.index,l=i.boost||0,n=i.query){s=i.field||i.pluck,r=i.highlight;const n=i.resolve;t=i.async||i.queue,i.resolve=!1,i.index=null,t=t?e.searchAsync(i):e.search(i),i.resolve=n,i.index=e,t=t.result||t}else t=[]}if(t&&t.then){const e=this;i=[t=t.then(function(t){e.C[0]=e.result=t.result||t,it(e)})],t=[],o=new Promise(function(t){h=t})}this.index=e||null,this.result=t||[],this.h=l,this.C=i||[],this.await=o||null,this.return=h||null,this.highlight=r||null,this.query=n||"",this.field=s||""}function it(t,e){let i=t.result;var n=t.await;t.await=null;for(let e,s=0;s<t.C.length;s++)if(e=t.C[s])if("function"==typeof e)i=e(),t.C[s]=i=i.result||i,s--;else if(e.h)i=e.h(),t.C[s]=i=i.result||i,s--;else if(e.then)return t.await=n;return n=t.return,t.C=[],t.return=null,e||n(i),i}function nt(t,e,i,n,s,r,o){const l=t.length;let c,a,u=[];c=h();for(let h,f,d,g,p=0;p<e;p++)for(let e=0;e<l;e++)if(d=t[e],p<d.length&&(h=d[p]))for(let t=0;t<h.length;t++){if(f=h[t],(a=c[f])?c[f]++:(a=0,c[f]=1),g=u[a]||(u[a]=[]),!o){let t=p+(e||!s?0:r||0);g=g[t]||(g[t]=[])}if(g.push(f),o&&i&&a===l-1&&g.length-n===i)return n?g.slice(n):g}if(t=u.length)if(s)u=u.length>1?st(u,i,n,o,r):(u=u[0])&&i&&u.length>i||n?u.slice(n,i+n):u;else{if(t<l)return[];if(u=u[t-1],i||n)if(o)(u.length>i||n)&&(u=u.slice(n,i+n));else{s=[];for(let t,e=0;e<u.length;e++)if(t=u[e])if(n&&t.length>n)n-=t.length;else if((i&&t.length>i||n)&&(t=t.slice(n,i+n),i-=t.length,n&&(n-=t.length)),s.push(t),!i)break;u=s}}return u}function st(t,e,i,n,s){const r=[],o=h();let l;var c=t.length;let a;if(n){for(s=c-1;s>=0;s--)if(a=(n=t[s])&&n.length)for(c=0;c<a;c++)if(l=n[c],!o[l])if(o[l]=1,i)i--;else if(r.push(l),r.length===e)return r}else for(let h,u=c-1,f=0;u>=0;u--){h=t[u];for(let t=0;t<h.length;t++)if(a=(n=h[t])&&n.length)for(let h=0;h<a;h++)if(l=n[h],!o[l])if(o[l]=1,i)i--;else{let i=(t+(u<c-1&&s||0))/(u+1)|0;if((r[i]||(r[i]=[])).push(l),++f===e)return r}}return r}function rt(t,e,i,n,s){const r=h(),o=[];for(let t,i=0;i<e.length;i++){t=e[i];for(let e=0;e<t.length;e++)r[t[e]]=1}if(s){for(let e,s=0;s<t.length;s++)if(e=t[s],r[e])if(n)n--;else if(o.push(e),r[e]=0,i&&0===--i)break}else for(let i,n,s=0;s<t.result.length;s++)for(i=t.result[s],e=0;e<i.length;e++)n=i[e],r[n]&&((o[s]||(o[s]=[])).push(n),r[n]=0);return o}function ot(t){const e=[],i=h(),n=h();for(let s,r,o,h,l,c,a,u=0;u<t.length;u++){s=t[u],r=s.field,o=s.result;for(let t=0;t<o.length;t++)l=o[t],"object"!=typeof l?l={id:h=l}:h=l.id,(c=i[h])?c.push(r):(l.field=i[h]=[r],e.push(l)),(a=l.highlight)&&(c=n[h],c||(n[h]=c={},l.highlight=c),c[r]=a)}return e}function ht(t,e,i,n,s){return(t=this.tag.get(t))&&(t=t.get(e))?((e=t.length-n)>0&&((i&&e>i||n)&&(t=t.slice(n,n+i)),s&&(t=lt.call(this,t))),t):[]}function lt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const e=Array(t.length);for(let i,n=0;n<t.length;n++)i=t[n],e[n]={id:i,doc:this.store.get(i)};return e}function ct(t){if(!this||this.constructor!==ct)return new ct(t);const e=t.document||t.doc||t;let i,n;if(this.B=[],this.field=[],this.D=[],this.key=(i=e.key||e.id)&&ut(i,this.D)||"id",(n=t.keystore||0)&&(this.keystore=n),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?n?new O(n):new Set:n?new z(n):new Map,this.h=(i=e.store||null)&&i&&!0!==i&&[],this.store=i?n?new z(n):new Map:null,this.cache=(i=t.cache||null)&&new y(i),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=at.call(this,t,e),this.tag=null,(i=e.tag)&&("string"==typeof i&&(i=[i]),i.length)){this.tag=new Map,this.A=[],this.F=[];for(let t,e,n=0;n<i.length;n++){if(t=i[n],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.A[n]=t.custom:(this.A[n]=ut(e,this.D),t.filter&&("string"==typeof this.A[n]&&(this.A[n]=new String(this.A[n])),this.A[n].G=t.filter)),this.F[n]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then(function(t){let i=0;for(const n of e.index.entries()){const s=n[0];let r=n[1];r.then&&(r=t[i],e.index.set(s,r),i++)}return e})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function at(t,e){const i=new Map;let n=e.index||e.field||e;l(n)&&(n=[n]);for(let e,r,o=0;o<n.length;o++){if(e=n[o],l(e)||(r=e,e=e.field),r=c(r)?Object.assign({},t,r):t,this.worker){var s=void 0;s=new U(r,s=(s=r.encoder)&&s.encode?s:new m("string"==typeof s?A[s]:s||{})),i.set(e,s)}this.worker||i.set(e,new Et(r,this.reg)),r.custom?this.B[o]=r.custom:(this.B[o]=ut(e,this.D),r.filter&&("string"==typeof this.B[o]&&(this.B[o]=new String(this.B[o])),this.B[o].G=r.filter)),this.field[o]=e}if(this.h){l(t=e.store)&&(t=[t]);for(let e,i,n=0;n<t.length;n++)e=t[n],i=e.field||e,e.custom?(this.h[n]=e.custom,e.custom.O=i):(this.h[n]=ut(i,this.D),e.filter&&("string"==typeof this.h[n]&&(this.h[n]=new String(this.h[n])),this.h[n].G=e.filter))}return i}function ut(t,e){const i=t.split(":");let n=0;for(let s=0;s<i.length;s++)"]"===(t=i[s])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[n]=!0),t&&(i[n++]=t);return n<i.length&&(i.length=n),n>1?i:i[0]}function ft(t,e=0){let i=[],n=[];e&&(e=25e4/e*5e3|0);for(const s of t.entries())n.push(s),n.length===e&&(i.push(n),n=[]);return n.length&&i.push(n),i}function dt(t,e){e||(e=new Map);for(let i,n=0;n<t.length;n++)i=t[n],e.set(i[0],i[1]);return e}function gt(t,e=0){let i=[],n=[];e&&(e=25e4/e*1e3|0);for(const s of t.entries())n.push([s[0],ft(s[1])[0]||[]]),n.length===e&&(i.push(n),n=[]);return n.length&&i.push(n),i}function pt(t,e){e||(e=new Map);for(let i,n,s=0;s<t.length;s++)i=t[s],n=e.get(i[0]),e.set(i[0],dt(i[1],n));return e}function mt(t){let e=[],i=[];for(const n of t.keys())i.push(n),25e4===i.length&&(e.push(i),i=[]);return i.length&&e.push(i),e}function _t(t,e){e||(e=new Set);for(let i=0;i<t.length;i++)e.add(t[i]);return e}function wt(t,e,i,n,s,r,o=0){const h=n&&n.constructor===Array;var l=h?n.shift():n;if(!l)return this.export(t,e,s,r+1);if((l=t((e?e+".":"")+(o+1)+"."+i,JSON.stringify(l)))&&l.then){const c=this;return l.then(function(){return wt.call(c,t,e,i,h?n:null,s,r,o+1)})}return wt.call(this,t,e,i,h?n:null,s,r,o+1)}function yt(t,e){let i="";for(const n of t.entries()){t=n[0];const s=n[1];let r="";for(let t,i=0;i<s.length;i++){t=s[i]||[""];let n="";for(let i=0;i<t.length;i++)n+=(n?",":"")+("string"===e?'"'+t[i]+'"':t[i]);n="["+n+"]",r+=(r?",":"")+n}r='["'+t+'",['+r+"]]",i+=(i?",":"")+r}return i}function bt(t,e){let i=0;var n=void 0===e;if(t.constructor===Array){for(let s,r,o,h=0;h<t.length;h++)if((s=t[h])&&s.length){if(n)return 1;if(r=s.indexOf(e),r>=0){if(s.length>1)return s.splice(r,1),1;if(delete t[h],i)return 1;o=1}else{if(o)return 1;i++}}}else for(let s of t.entries())n=s[0],bt(s[1],e)?i++:t.delete(n);return i}W("add"),W("append"),W("search"),W("update"),W("remove"),W("clear"),W("export"),W("import"),U.prototype.searchCache=w,R(U.prototype),ct.prototype.add=function(t,e,i){if(c(t)&&(t=a(e=t,this.key)),e&&(t||0===t)){if(!i&&this.reg.has(t))return this.update(t,e);for(let r,o=0;o<this.field.length;o++){r=this.B[o];var n=this.index.get(this.field[o]);if("function"==typeof r){var s=r(e);s&&n.add(t,s,i,!0)}else(!(s=r.G)||s(e))&&(r.constructor===String?r=[""+r]:l(r)&&(r=[r]),J(e,r,this.D,0,n,t,r[0],i))}if(this.tag)for(n=0;n<this.A.length;n++){var r=this.A[n];s=this.tag.get(this.F[n]);let c=h();if("function"==typeof r){if(!(r=r(e)))continue}else{var o=r.G;if(o&&!o(e))continue;r.constructor===String&&(r=""+r),r=a(e,r)}if(s&&r){l(r)&&(r=[r]);for(let e,n,h=0;h<r.length;h++)if(e=r[h],!c[e]&&(c[e]=1,(o=s.get(e))?n=o:s.set(e,n=[]),!i||!n.includes(t))){if(n.length===2**31-1){if(o=new E(n),this.fastupdate)for(let t of this.reg.values())t.includes(n)&&(t[t.indexOf(n)]=o);s.set(e,n=o)}n.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(n):this.reg.set(t,[n]))}}}if(this.store&&(!i||!this.store.has(t))){let n;if(this.h){n=h();for(let t,s=0;s<this.h.length;s++){if(t=this.h[s],(i=t.G)&&!i(e))continue;let r;if("function"==typeof t){if(r=t(e),!r)continue;t=[t.O]}else if(l(t)||t.constructor===String){n[t]=e[t];continue}H(e,n,t,0,t[0],r)}}this.store.set(t,n||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},et.prototype.or=function(){return G(this,"or",V,arguments)},et.prototype.and=function(){return G(this,"and",Y,arguments)},et.prototype.xor=function(){return G(this,"xor",Z,arguments)},et.prototype.not=function(){return G(this,"not",Q,arguments)},(s=et.prototype).limit=function(t){if(this.await){const e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){const e=[];for(let i,n=0;n<this.result.length;n++)if(i=this.result[n]){if(!(i.length<=t)){e[n]=i.slice(0,t);break}if(e[n]=i,!(t-=i.length))break}this.result=e}return this},s.offset=function(t){if(this.await){const e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){const e=[];for(let i,n=0;n<this.result.length;n++)(i=this.result[n])&&(i.length<=t?t-=i.length:(e[n]=i.slice(t),t=0));this.result=e}return this},s.boost=function(t){if(this.await){const e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this},s.resolve=function(t,e,i,n,s){let r=this.await?it(this,!0):this.result;if(r.then){const o=this;return r.then(function(){return o.resolve(t,e,i,n,s)})}return r.length&&("object"==typeof t?(n=t.highlight||this.highlight,i=!!n||t.enrich,e=t.offset,t=t.limit):(n=n||this.highlight,i=!!n||i),r=s?i?lt.call(this.index,r):r:K.call(this.index,r,t||100,e,i)),this.finalize(r,n)},s.finalize=function(t,e){if(t.then){const i=this;return t.then(function(t){return i.finalize(t,e)})}e&&t.length&&this.query&&(t=tt(this.query,t,this.index.index,this.field,e));const i=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",i&&i(t),t},h(),ct.prototype.search=function(t,e,i,n){i||(!e&&c(t)?(i=t,t=""):c(e)&&(i=e,e=0));let s=[];var r=[];let h,a,u,f,d,g,p,m,_=0,w=!0;if(i){i.constructor===Array&&(i={index:i}),t=i.query||t,h=i.pluck,a=i.merge,f=i.boost,g=h||i.field||(g=i.index)&&(g.index?null:g);var y=this.tag&&i.tag;u=i.suggest,w=!1!==i.resolve,d=i.cache,p=w&&this.store&&i.highlight;var b=!!p||w&&this.store&&i.enrich;e=i.limit||e;var x=i.offset||0;if(e||(e=w?100:0),y&&(!this.db||!n)){y.constructor!==Array&&(y=[y]);var v=[];for(let t,e=0;e<y.length;e++)if(t=y[e],t.field&&t.tag){var k=t.tag;if(k.constructor===Array)for(var j=0;j<k.length;j++)v.push(t.field,k[j]);else v.push(t.field,k)}else{k=Object.keys(t);for(let e,i,n=0;n<k.length;n++)if(e=k[n],i=t[e],i.constructor===Array)for(j=0;j<i.length;j++)v.push(e,i[j]);else v.push(e,i)}if(y=v,!t){if(r=[],v.length)for(y=0;y<v.length;y+=2){if(this.db){if(!(n=this.index.get(v[y])))continue;r.push(n=n.db.tag(v[y+1],e,x,b))}else n=ht.call(this,v[y],v[y+1],e,x,b);s.push(w?{field:v[y],tag:v[y+1],result:n}:[n])}if(r.length){const t=this;return Promise.all(r).then(function(e){for(let t=0;t<e.length;t++)w?s[t].result=e[t]:s[t]=e[t];return w?s:new et(s.length>1?nt(s,1,0,0,u,f):s[0],t)})}return w?s:new et(s.length>1?nt(s,1,0,0,u,f):s[0],this)}}w||h||!(g=g||this.field)||(l(g)?h=g:(g.constructor===Array&&1===g.length&&(g=g[0]),h=g.field||g.index)),g&&g.constructor!==Array&&(g=[g])}g||(g=this.field),v=(this.worker||this.db)&&!n&&[];for(let h,c,a,f=0;f<g.length;f++){if(c=g[f],this.db&&this.tag&&!this.B[f])continue;let A;if(l(c)||(A=c,c=A.field,t=A.query||t,e=o(A.limit,e),x=o(A.offset,x),u=o(A.suggest,u),p=w&&this.store&&o(A.highlight,p),b=!!p||w&&this.store&&o(A.enrich,b),d=o(A.cache,d)),n)h=n[f];else{j=(k=A||i||{}).enrich;var S=this.index.get(c);if(y&&(this.db&&(k.tag=y,k.field=g,m=S.db.support_tag_search),!m&&j&&(k.enrich=!1),m||(k.limit=0,k.offset=0)),h=d?S.searchCache(t,y&&!m?0:e,k):S.search(t,y&&!m?0:e,k),y&&!m&&(k.limit=e,k.offset=x),j&&(k.enrich=j),v){v[f]=h;continue}}if(a=(h=h.result||h)&&h.length,y&&a){if(k=[],j=0,this.db&&n){if(!m)for(S=g.length;S<n.length;S++){let t=n[S];if(t&&t.length)j++,k.push(t);else if(!u)return w?s:new et(s,this)}}else for(let t,e,i=0;i<y.length;i+=2){if(t=this.tag.get(y[i]),!t){if(u)continue;return w?s:new et(s,this)}if(e=(t=t&&t.get(y[i+1]))&&t.length)j++,k.push(t);else if(!u)return w?s:new et(s,this)}if(j){if(h=rt(h,k,e,x,w),a=h.length,!a&&!u)return w?h:new et(h,this);j--}}if(a)r[_]=c,s.push(h),_++;else if(1===g.length)return w?s:new et(s,this)}if(v){if(this.db&&y&&y.length&&!m)for(b=0;b<y.length;b+=2){if(!(r=this.index.get(y[b]))){if(u)continue;return w?s:new et(s,this)}v.push(r.db.tag(y[b+1],e,x,!1))}const n=this;return Promise.all(v).then(function(s){return i&&(i.resolve=w),s.length&&(s=n.search(t,e,i,s)),s})}if(!_)return w?s:new et(s,this);if(h&&(!b||!this.store))return s=s[0],w?s:new et(s,this);for(v=[],x=0;x<r.length;x++){if(y=s[x],b&&y.length&&void 0===y[0].doc&&(this.db?v.push(y=this.index.get(this.field[0]).db.enrich(y)):y=lt.call(this,y)),h)return w?p?tt(t,y,this.index,h,p):y:new et(y,this);s[x]={field:r[x],result:y}}if(b&&this.db&&v.length){const e=this;return Promise.all(v).then(function(i){for(let t=0;t<i.length;t++)s[t].result=i[t];return p&&(s=tt(t,s,e.index,h,p)),a?ot(s):s})}return p&&(s=tt(t,s,this.index,h,p)),a?ot(s):s},(s=ct.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,n=0;n<this.F.length;n++){t=this.F[n];var i=void 0;this.index.set(t,i=new Et({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),i.tag=this.tag.get(t)}i=[];const n={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let s,r,o=0;o<e.length;o++){n.field=r=e[o],s=this.index.get(r);const h=new t.constructor(t.id,n);h.id=t.id,i[o]=h.mount(s),s.document=!0,o?s.bypass=!0:s.store=this.store}const s=this;return this.db=Promise.all(i).then(function(){s.db=!0})},s.commit=async function(){const t=[];for(const e of this.index.values())t.push(e.commit());await Promise.all(t),this.reg.clear()},s.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},s.append=function(t,e){return this.add(t,e,!0)},s.update=function(t,e){return this.remove(t).add(t,e)},s.remove=function(t){for(var e of(c(t)&&(t=a(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let i of this.tag.values())for(let n of i){e=n[0];const s=n[1],r=s.indexOf(t);r>-1&&(s.length>1?s.splice(r,1):i.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},s.clear=function(){const t=[];for(const e of this.index.values()){const i=e.clear();i.then&&t.push(i)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},s.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},s.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},s.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(t){return t[0]&&t[0].doc||null}):this.store.get(t)||null},s.set=function(t,e){return"object"==typeof t&&(t=a(e=t,this.key)),this.store.set(t,e),this},s.searchCache=w,s.export=function(t,e,i=0,n=0){if(i<this.field.length){const s=this.field[i];if((e=this.index.get(s).export(t,s,i,n=1))&&e.then){const n=this;return e.then(function(){return n.export(t,s,i+1)})}return this.export(t,s,i+1)}let s,r;switch(n){case 0:s="reg",r=mt(this.reg),e=null;break;case 1:s="tag",r=this.tag&>(this.tag,this.reg.size),e=null;break;case 2:s="doc",r=this.store&&ft(this.store),e=null;break;default:return}return wt.call(this,t,e,s,r||null,i,n)},s.import=function(t,e){var i=t.split(".");"json"===i[i.length-1]&&i.pop();const n=i.length>2?i[0]:"";if(i=i.length>2?i[2]:i[1],this.worker&&n)return this.index.get(n).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),n)return this.index.get(n).import(i,e);switch(i){case"reg":this.fastupdate=!1,this.reg=_t(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=pt(e,this.tag);break;case"doc":this.store=dt(e,this.store)}}},R(ct.prototype),Et.prototype.remove=function(t,e){const i=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(i){if(this.fastupdate){for(let e,n,s=0;s<i.length;s++)if((e=i[s])&&(n=e.length))if(e[n-1]===t)e.pop();else{const i=e.indexOf(t);i>=0&&e.splice(i,1)}}else bt(this.map,t),this.depth&&bt(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&zt(this)),this.cache&&this.cache.remove(t),this};const xt={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function vt(t,e,i,n,s,r,o){let l,c;if(!(l=e[i])||o&&!l[o]){if(o?((e=l||(e[i]=h()))[o]=1,c=t.ctx,(l=c.get(o))?c=l:c.set(o,c=t.keystore?new z(t.keystore):new Map)):(c=t.map,e[i]=1),(l=c.get(i))?c=l:c.set(i,c=l=[]),r)for(let i,r=0;r<l.length;r++)if((i=l[r])&&i.includes(s)){if(r<=n)return;i.splice(i.indexOf(s),1),t.fastupdate&&(e=t.reg.get(s))&&e.splice(e.indexOf(i),1);break}if(c=c[n]||(c[n]=[]),c.push(s),c.length===2**31-1){if(e=new E(c),t.fastupdate)for(let i of t.reg.values())i.includes(c)&&(i[i.indexOf(c)]=e);l[n]=c=e}t.fastupdate&&((n=t.reg.get(s))?n.push(c):t.reg.set(s,[c]))}}function kt(t,e,i,n,s){return i&&t>1?e+(n||0)<=t?i+(s||0):(t-1)/(e+(n||0))*(i+(s||0))+1|0:0}function jt(t,e,i,n,s,r,o){let h=t.length,l=t;if(h>1)l=nt(t,e,i,n,s,r,o);else if(1===h)return o?K.call(null,t[0],i,n):new et(t[0],this);return o?l:new et(l,this)}function St(t,e,i,n,s,r,o){return t=Mt(this,t,e,i,n,s,r,o),this.db?t.then(function(t){return s?t||[]:new et(t,this)}):t&&t.length?s?K.call(this,t,i,n):new et(t,this):s?[]:new et([],this)}function At(t,e,i,n){let s=[];if(t&&t.length){if(t.length<=n)return void e.push(t);for(let e,i=0;i<n;i++)(e=t[i])&&(s[i]=e);if(s.length)return void e.push(s)}if(!i)return s}function Mt(t,e,i,n,s,r,o,h){let l;return i&&(l=t.bidirectional&&e>i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,n,s,r,o,h):t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e)}function Et(t,e){if(!this||this.constructor!==Et)return new Et(t);if(t){var i=l(t)?t:t.preset;i&&(t=Object.assign({},xt[i],t))}else t={};const n=!0===(i=t.context)?{depth:1}:i||{},s=l(t.encoder)?A[t.encoder]:t.encode||t.encoder||{};this.encoder=s.encode?s:"object"==typeof s?new m(s):{encode:s},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&"default"!==i&&"exact"!==i&&i||"strict",this.depth="strict"===i&&n.depth||0,this.bidirectional=!1!==n.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new z(i):new Map,this.ctx=i?new z(i):new Map,this.reg=e||(this.fastupdate?i?new z(i):new Map:i?new O(i):new Set),this.N=n.resolution||3,this.rtl=s.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new y(i),this.resolve=!1!==t.resolve,(i=t.db)&&(this.db=this.mount(i)),this.M=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function zt(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}Et.prototype.add=function(t,e,i,n){if(e&&(t||0===t)){if(!n&&!i&&this.reg.has(t))return this.update(t,e);n=this.depth;const a=(e=this.encoder.encode(e,!n)).length;if(a){const u=h(),f=h(),d=this.resolution;for(let h=0;h<a;h++){let g=e[this.rtl?a-1-h:h];var s=g.length;if(s&&(n||!f[g])){var r=this.score?this.score(e,g,h,null,0):kt(d,a,h),o="";switch(this.tokenize){case"tolerant":if(vt(this,f,g,r,t,i),s>2){for(let e,n,h,l,c=1;c<s-1;c++)e=g.charAt(c),n=g.charAt(c+1),h=g.substring(0,c)+n,l=g.substring(c+2),vt(this,f,o=h+e+l,r,t,i),vt(this,f,o=h+l,r,t,i);vt(this,f,g.substring(0,g.length-1),r,t,i)}break;case"full":if(s>2){for(let n,c=0;c<s;c++)for(r=s;r>c;r--){o=g.substring(c,r),n=this.rtl?s-1-c:c;var l=this.score?this.score(e,g,h,o,n):kt(d,a,h,s,n);vt(this,f,o,l,t,i)}break}case"bidirectional":case"reverse":if(s>1){for(l=s-1;l>0;l--){o=g[this.rtl?s-1-l:l]+o;var c=this.score?this.score(e,g,h,o,l):kt(d,a,h,s,l);vt(this,f,o,c,t,i)}o=""}case"forward":if(s>1){for(l=0;l<s;l++)vt(this,f,o+=g[this.rtl?s-1-l:l],r,t,i);break}default:if(vt(this,f,g,r,t,i),n&&a>1&&h<a-1)for(s=this.N,o=g,r=Math.min(n+1,this.rtl?h+1:a-h),l=1;l<r;l++){g=e[this.rtl?a-1-h-l:h+l];vt(this,u,(c=this.bidirectional&&g>o)?o:g,this.score?this.score(e,o,h,g,l-1):kt(s+(a/2>s?0:1),a,h,r-1,l-1),t,i,c?g:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(i?{ins:t}:{del:t}),this.M&&zt(this)),this},Et.prototype.search=function(t,e,i){if(i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):(i=t,t="")),i&&i.cache)return i.cache=!1,t=this.searchCache(t,e,i),i.cache=!0,t;let n,s,r,o,l,c,a,u,f=[],d=0;i&&(t=i.query||t,e=i.limit||e,d=i.offset||0,s=i.context,r=i.suggest,u=(o=i.resolve)&&i.enrich,c=i.boost,a=i.resolution,l=this.db&&i.tag),void 0===o&&(o=this.resolve),s=this.depth&&!1!==s;let g=this.encoder.encode(t,!s);if(n=g.length,e=e||(o?100:0),1===n)return St.call(this,g[0],"",e,d,o,u,l);if(2===n&&s&&!r)return St.call(this,g[1],g[0],e,d,o,u,l);let p,m=h(),_=0;if(s&&(p=g[0],_=1),a||0===a||(a=p?this.N:this.resolution),this.db){if(this.db.search&&!1!==(i=this.db.search(this,g,e,d,r,o,u,l)))return i;const t=this;return async function(){for(let e,i;_<n;_++){if((i=g[_])&&!m[i]){if(m[i]=1,e=await Mt(t,i,p,0,0,!1,!1),e=At(e,f,r,a)){f=e;break}p&&(r&&e&&f.length||(p=i))}r&&p&&_===n-1&&!f.length&&(a=t.resolution,p="",_=-1,m=h())}return jt(f,a,e,d,r,c,o)}()}for(let t,e;_<n;_++){if((e=g[_])&&!m[e]){if(m[e]=1,t=Mt(this,e,p,0,0,!1,!1),t=At(t,f,r,a)){f=t;break}p&&(r&&t&&f.length||(p=e))}r&&p&&_===n-1&&!f.length&&(a=this.resolution,p="",_=-1,m=h())}return jt(f,a,e,d,r,c,o)},(s=Et.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},s.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},s.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},s.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},s.append=function(t,e){return this.add(t,e,!0)},s.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},s.update=function(t,e){const i=this,n=this.remove(t);return n&&n.then?n.then(()=>i.add(t,e)):this.add(t,e)},s.cleanup=function(){return this.fastupdate?(bt(this.map),this.depth&&bt(this.ctx),this):this},s.searchCache=w,s.export=function(t,e,i=0,n=0){let s,r;switch(n){case 0:s="reg",r=mt(this.reg);break;case 1:s="cfg",r=null;break;case 2:s="map",r=ft(this.map,this.reg.size);break;case 3:s="ctx",r=gt(this.ctx,this.reg.size);break;default:return}return wt.call(this,t,e,s,r,i,n)},s.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=_t(e,this.reg);break;case"map":this.map=dt(e,this.map);break;case"ctx":this.ctx=pt(e,this.ctx)}},s.serialize=function(t=!0){let e="",i="",n="";if(this.reg.size){let t;for(var s of this.reg.keys())t||(t=typeof s),e+=(e?",":"")+("string"===t?'"'+s+'"':s);e="index.reg=new Set(["+e+"]);",i=yt(this.map,t),i="index.map=new Map(["+i+"]);";for(const e of this.ctx.entries()){s=e[0];let i=yt(e[1],t);i="new Map(["+i+"])",i='["'+s+'",'+i+"]",n+=(n?",":"")+i}n="index.ctx=new Map(["+n+"]);"}return t?"function inject(index){"+e+i+n+"}":e+i+n},R(Et.prototype);const Ot="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Ct=["map","ctx","tag","reg","cfg"],Ft=h();function It(t,e={}){if(!this||this.constructor!==It)return new It(t,e);"object"==typeof t&&(e=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=e.field?e.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=e.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}function Bt(t,e,i){const n=t.value;let s,r=0;for(let t,o=0;o<n.length;o++){if(t=i?n:n[o]){for(let i,r,h=0;h<e.length;h++)if(r=e[h],i=t.indexOf(r),i>=0){if(s=1,!(t.length>1)){n[o]=[];break}t.splice(i,1)}r+=t.length}if(i)break}r?s&&t.update(n):t.delete(),t.continue()}function Dt(t,e){return new Promise((i,n)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=n,t=null})}(s=It.prototype).mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},s.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Ft[t.id]||(Ft[t.id]=[]),Ft[t.id].push(t.field);const e=Ot.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let i,n=0;n<Ct.length;n++){i=Ct[n];for(let n,s=0;s<Ft[t.id].length;s++)n=Ft[t.id][s],e.objectStoreNames.contains(i+("reg"!==i&&n?":"+n:""))||e.createObjectStore(i+("reg"!==i&&n?":"+n:""))}},t.db=Dt(e,function(e){t.db=e,t.db.onversionchange=function(){t.close()}})},s.close=function(){this.db&&this.db.close(),this.db=null},s.destroy=function(){return Dt(Ot.deleteDatabase(this.id))},s.clear=function(){const t=[];for(let e,i=0;i<Ct.length;i++){e=Ct[i];for(let i,n=0;n<Ft[this.id].length;n++)i=Ft[this.id][n],t.push(e+("reg"!==e&&i?":"+i:""))}const e=this.db.transaction(t,"readwrite");for(let i=0;i<t.length;i++)e.objectStore(t[i]).clear();return Dt(e)},s.get=function(t,e,i=0,n=0,s=!0,r=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);const o=this;return Dt(t).then(function(t){let e=[];if(!t||!t.length)return e;if(s){if(!i&&!n&&1===t.length)return t[0];for(let s,r=0;r<t.length;r++)if((s=t[r])&&s.length){if(n>=s.length){n-=s.length;continue}const t=i?n+Math.min(s.length-n,i):s.length;for(let i=n;i<t;i++)e.push(s[i]);if(n=0,e.length===i)break}return r?o.enrich(e):e}return t})},s.tag=function(t,e=0,i=0,n=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const s=this;return Dt(t).then(function(t){return!t||!t.length||i>=t.length?[]:e||i?(t=t.slice(i,i+e),n?s.enrich(t):t):t})},s.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let n=0;n<t.length;n++)i[n]=Dt(e.get(t[n]));return Promise.all(i).then(function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e})},s.has=function(t){return Dt(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then(function(t){return!!t})},s.search=null,s.info=function(){},s.transaction=function(t,e,i){t+="reg"!==t&&this.field?":"+this.field:"";let n=this.h[t+":"+e];if(n)return i.call(this,n);let s=this.db.transaction(t,e);this.h[t+":"+e]=n=s.objectStore(t);const r=i.call(this,n);return this.h[t+":"+e]=null,Dt(s).finally(function(){return r})},s.commit=async function(t){let e=t.commit_task,i=[];t.commit_task=[];for(let t,n=0;n<e.length;n++)t=e[n],t.del&&i.push(t.del);i.length&&await this.remove(i),t.reg.size&&(await this.transaction("map","readwrite",function(e){for(const i of t.map){const t=i[0],n=i[1];n.length&&(e.get(t).onsuccess=function(){let i=this.result;var s;if(i&&i.length){const t=Math.max(i.length,n.length);for(let e,r,o=0;o<t;o++)if((r=n[o])&&r.length){if((e=i[o])&&e.length)for(s=0;s<r.length;s++)e.push(r[s]);else i[o]=r;s=1}}else i=n,s=1;s&&e.put(i,t)})}}),await this.transaction("ctx","readwrite",function(e){for(const i of t.ctx){const t=i[0],n=i[1];for(const i of n){const n=i[0],s=i[1];s.length&&(e.get(t+":"+n).onsuccess=function(){let i=this.result;var r;if(i&&i.length){const t=Math.max(i.length,s.length);for(let e,n,o=0;o<t;o++)if((n=s[o])&&n.length){if((e=i[o])&&e.length)for(r=0;r<n.length;r++)e.push(n[r]);else i[o]=n;r=1}}else i=s,r=1;r&&e.put(i,t+":"+n)})}}}),t.store?await this.transaction("reg","readwrite",function(e){for(const i of t.store){const t=i[0],n=i[1];e.put("object"==typeof n?JSON.stringify(n):1,t)}}):t.bypass||await this.transaction("reg","readwrite",function(e){for(const i of t.reg.keys())e.put(1,i)}),t.tag&&await this.transaction("tag","readwrite",function(e){for(const i of t.tag){const t=i[0],n=i[1];n.length&&(e.get(t).onsuccess=function(){let i=this.result;i=i&&i.length?i.concat(n):n,e.put(i,t)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},s.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Bt(e,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Bt(e,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&Bt(e,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let i=0;i<t.length;i++)e.delete(t[i])})])};const qt={Index:Et,Charset:A,Encoder:m,Document:ct,Worker:U,Resolver:et,IndexedDB:It,Language:{}},Lt=void 0!==n?n:"undefined"!=typeof global?global:n;let Tt;(Tt=Lt.define)&&Tt.amd?Tt([],function(){return qt}):"object"==typeof Lt.exports?Lt.exports=qt:Lt.FlexSearch=qt}(this||self)},880(t,e,i){let n,s={};s.__wbindgen_placeholder__=t.exports;const{TextDecoder:r,TextEncoder:o}=i(23);let h=null;function l(){return null!==h&&0!==h.byteLength||(h=new Uint8Array(n.memory.buffer)),h}let c=new r("utf-8",{ignoreBOM:!0,fatal:!0});function a(t,e){return function(t,e){return c.decode(l().subarray(t,t+e))}(t>>>=0,e)}function u(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let i="[";e>0&&(i+=u(t[0]));for(let n=1;n<e;n++)i+=", "+u(t[n]);return i+="]",i}const i=/\[object ([^\]]+)\]/.exec(toString.call(t));let n;if(!(i&&i.length>1))return toString.call(t);if(n=i[1],"Object"==n)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:n}c.decode();let f=0;const d=new o("utf-8"),g="function"==typeof d.encodeInto?function(t,e){return d.encodeInto(t,e)}:function(t,e){const i=d.encode(t);return e.set(i),{read:t.length,written:i.length}};function p(t,e,i){if(void 0===i){const i=d.encode(t),n=e(i.length,1)>>>0;return l().subarray(n,n+i.length).set(i),f=i.length,n}let n=t.length,s=e(n,1)>>>0;const r=l();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;r[s+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),s=i(s,n,n=o+3*t.length,1)>>>0;const e=l().subarray(s+o,s+n);o+=g(t,e).written,s=i(s,n,o,1)>>>0}return f=o,s}let m=null;function _(){return(null===m||!0===m.buffer.detached||void 0===m.buffer.detached&&m.buffer!==n.memory.buffer)&&(m=new DataView(n.memory.buffer)),m}function w(t){return null==t}function y(t,e){t>>>=0;const i=_(),s=[];for(let r=t;r<t+4*e;r+=4)s.push(n.__wbindgen_export_2.get(i.getUint32(r,!0)));return n.__externref_drop_slice(t,e),s}function b(t){const e=n.__wbindgen_export_2.get(t);return n.__externref_table_dealloc(t),e}t.exports.cut=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.cut(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.cut_all=function(t){const e=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=f,s=n.cut_all(e,i);var r=y(s[0],s[1]).slice();return n.__wbindgen_free(s[0],4*s[1],4),r},t.exports.cut_for_search=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.cut_for_search(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.tokenize=function(t,e,i){const s=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),r=f,o=p(e,n.__wbindgen_malloc,n.__wbindgen_realloc),h=f,l=n.tokenize(s,r,o,h,w(i)?16777215:i?1:0);if(l[3])throw b(l[2]);var c=y(l[0],l[1]).slice();return n.__wbindgen_free(l[0],4*l[1],4),c},t.exports.add_word=function(t,e,i){const s=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),r=f;var o=w(i)?0:p(i,n.__wbindgen_malloc,n.__wbindgen_realloc),h=f;return n.add_word(s,r,w(e)?4294967297:e>>>0,o,h)>>>0},t.exports.tag=function(t,e){const i=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),s=f,r=n.tag(i,s,w(e)?16777215:e?1:0);var o=y(r[0],r[1]).slice();return n.__wbindgen_free(r[0],4*r[1],4),o},t.exports.with_dict=function(t){const e=p(t,n.__wbindgen_malloc,n.__wbindgen_realloc),i=f,s=n.with_dict(e,i);if(s[1])throw b(s[0])},t.exports.__wbg_Error_0497d5bdba9362e5=function(t,e){return Error(a(t,e))},t.exports.__wbg_new_07b483f72211fd66=function(){return new Object},t.exports.__wbg_set_3f1d0b984ed272ed=function(t,e,i){t[e]=i},t.exports.__wbindgen_bigint_from_u64=function(t){return BigInt.asUintN(64,t)},t.exports.__wbindgen_debug_string=function(t,e){const i=p(u(e),n.__wbindgen_malloc,n.__wbindgen_realloc),s=f;_().setInt32(t+4,s,!0),_().setInt32(t+0,i,!0)},t.exports.__wbindgen_init_externref_table=function(){const t=n.__wbindgen_export_2,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},t.exports.__wbindgen_number_new=function(t){return t},t.exports.__wbindgen_string_new=function(t,e){return a(t,e)},t.exports.__wbindgen_throw=function(t,e){throw new Error(a(t,e))};const x=i(928).join(__dirname,"jieba_rs_wasm_bg.wasm"),v=i(896).readFileSync(x),k=new WebAssembly.Module(v),j=new WebAssembly.Instance(k,s);n=j.exports,t.exports.__wasm=n,n.__wbindgen_start()},642(t){"use strict";t.exports=require("better-sqlite3/build/Release/better_sqlite3.node")},896(t){"use strict";t.exports=require("fs")},928(t){"use strict";t.exports=require("path")},23(t){"use strict";t.exports=require("util")},167(t){"use strict";t.exports=require("worker_threads")}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__={};(()=>{"use strict";const t=__webpack_require__(285),e=__webpack_require__(54);(0,t.file_search_start)(),(0,e.start_ai_agent_agent)()})()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "filecat",
|
|
3
|
-
"version": "5.32.
|
|
3
|
+
"version": "5.32.2",
|
|
4
4
|
"description": "FileCat Server Manager",
|
|
5
5
|
"author": "xiaobaidadada",
|
|
6
6
|
"scripts": {
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"build-ts": "tsc",
|
|
18
18
|
"web-build-test": "tsc && npx webpack --config shell/config/webpack.web.config.js",
|
|
19
19
|
"server-build-test": "tsc && npx webpack --config shell/config/webpack.npm.config.js",
|
|
20
|
-
"npm-build": "
|
|
21
|
-
"exe-build": "
|
|
20
|
+
"npm-build": "node shell/build.js npm",
|
|
21
|
+
"exe-build": "node shell/build.js exe",
|
|
22
22
|
"build-exe-linux-x64": "npm run exe-build && node --require ts-node/register shell/pkg.ts filecat-linux-x64.tar.gz",
|
|
23
23
|
"build-exe-win-x64": "npm run exe-build && node --require ts-node/register shell/pkg.ts filecat-win-x64.tar.gz",
|
|
24
|
+
"build-exe-mac-arm": "npm run exe-build && node --require ts-node/register shell/pkg.ts filecat-mac-arm.tar.gz",
|
|
24
25
|
"start": "node build/main.js",
|
|
25
26
|
"test": "prebuild --upload-files-gz filecat-linux --set-version \"\" -u 11234 ",
|
|
26
27
|
"server-debug-js2": "tsc && node build/server/main/server.js --env ./env2"
|
|
@@ -100,7 +101,7 @@
|
|
|
100
101
|
"normalize.css": "^8.0.1",
|
|
101
102
|
"noty": "^3.2.0-beta-deprecated",
|
|
102
103
|
"pinyin-pro": "^3.28.0",
|
|
103
|
-
"pty-shell": "^1.
|
|
104
|
+
"pty-shell": "^1.3.0",
|
|
104
105
|
"react": "^18.3.1",
|
|
105
106
|
"react-dom": "^18.3.1",
|
|
106
107
|
"react-i18next": "^15.7.3",
|
package/shell/build.js
CHANGED
|
@@ -21,6 +21,7 @@ const path = require("path");
|
|
|
21
21
|
const {rimraf} = require("rimraf");
|
|
22
22
|
const fse = require("fs-extra");
|
|
23
23
|
const {copy_wintun_dll} = require("./config/common-bin.config");
|
|
24
|
+
const {execSync} = require("child_process");
|
|
24
25
|
|
|
25
26
|
// const test_p = path.join(process.cwd(), "node_modules","node-process-watcher");
|
|
26
27
|
// const test_p2 = path.join(process.cwd(), "node_modules","better-sqlite3");
|
|
@@ -55,6 +56,13 @@ function copyFiles(sourceDir,destDir) {
|
|
|
55
56
|
|
|
56
57
|
const tasksLister = new Listr(
|
|
57
58
|
[
|
|
59
|
+
{
|
|
60
|
+
title:"清理build目录执行tsc",
|
|
61
|
+
task:async ()=>{
|
|
62
|
+
fse.removeSync(path.join(__dirname, "..", "build"));
|
|
63
|
+
execSync("npx tsc")
|
|
64
|
+
}
|
|
65
|
+
},
|
|
58
66
|
{
|
|
59
67
|
title:"子线程构建",
|
|
60
68
|
task:async ()=>{
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 543.9305b93ceeffabfa9862.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[543],{2543(n,t,r){var e;n=r.nmd(n),function(){var u,i="Expected a function",o="__lodash_hash_undefined__",f="__lodash_placeholder__",a=16,c=32,l=64,s=128,h=256,p=1/0,v=9007199254740991,_=NaN,g=4294967295,y=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",c],["partialRight",l],["rearg",h]],d="[object Arguments]",b="[object Array]",w="[object Boolean]",m="[object Date]",x="[object Error]",j="[object Function]",A="[object GeneratorFunction]",k="[object Map]",O="[object Number]",I="[object Object]",R="[object Promise]",z="[object RegExp]",E="[object Set]",S="[object String]",C="[object Symbol]",W="[object WeakMap]",L="[object ArrayBuffer]",U="[object DataView]",B="[object Float32Array]",T="[object Float64Array]",$="[object Int8Array]",D="[object Int16Array]",M="[object Int32Array]",F="[object Uint8Array]",N="[object Uint8ClampedArray]",P="[object Uint16Array]",q="[object Uint32Array]",Z=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,J=RegExp(G.source),Y=RegExp(H.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,on=RegExp(un.source),fn=/^\s+/,an=/\s/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,sn=/,? & /,hn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pn=/[()=,{}\[\]\/\s]/,vn=/\\(\\)?/g,_n=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gn=/\w*$/,yn=/^[-+]0x[0-9a-f]+$/i,dn=/^0b[01]+$/i,bn=/^\[object .+?Constructor\]$/,wn=/^0o[0-7]+$/i,mn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,An=/['\n\r\u2028\u2029\\]/g,kn="\\ud800-\\udfff",On="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",In="\\u2700-\\u27bf",Rn="a-z\\xdf-\\xf6\\xf8-\\xff",zn="A-Z\\xc0-\\xd6\\xd8-\\xde",En="\\ufe0e\\ufe0f",Sn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Cn="['’]",Wn="["+kn+"]",Ln="["+Sn+"]",Un="["+On+"]",Bn="\\d+",Tn="["+In+"]",$n="["+Rn+"]",Dn="[^"+kn+Sn+Bn+In+Rn+zn+"]",Mn="\\ud83c[\\udffb-\\udfff]",Fn="[^"+kn+"]",Nn="(?:\\ud83c[\\udde6-\\uddff]){2}",Pn="[\\ud800-\\udbff][\\udc00-\\udfff]",qn="["+zn+"]",Zn="\\u200d",Kn="(?:"+$n+"|"+Dn+")",Vn="(?:"+qn+"|"+Dn+")",Gn="(?:['’](?:d|ll|m|re|s|t|ve))?",Hn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jn="(?:"+Un+"|"+Mn+")"+"?",Yn="["+En+"]?",Qn=Yn+Jn+("(?:"+Zn+"(?:"+[Fn,Nn,Pn].join("|")+")"+Yn+Jn+")*"),Xn="(?:"+[Tn,Nn,Pn].join("|")+")"+Qn,nt="(?:"+[Fn+Un+"?",Un,Nn,Pn,Wn].join("|")+")",tt=RegExp(Cn,"g"),rt=RegExp(Un,"g"),et=RegExp(Mn+"(?="+Mn+")|"+nt+Qn,"g"),ut=RegExp([qn+"?"+$n+"+"+Gn+"(?="+[Ln,qn,"$"].join("|")+")",Vn+"+"+Hn+"(?="+[Ln,qn+Kn,"$"].join("|")+")",qn+"?"+Kn+"+"+Gn,qn+"+"+Hn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bn,Xn].join("|"),"g"),it=RegExp("["+Zn+kn+On+En+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ft=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ct={};ct[B]=ct[T]=ct[$]=ct[D]=ct[M]=ct[F]=ct[N]=ct[P]=ct[q]=!0,ct[d]=ct[b]=ct[L]=ct[w]=ct[U]=ct[m]=ct[x]=ct[j]=ct[k]=ct[O]=ct[I]=ct[z]=ct[E]=ct[S]=ct[W]=!1;var lt={};lt[d]=lt[b]=lt[L]=lt[U]=lt[w]=lt[m]=lt[B]=lt[T]=lt[$]=lt[D]=lt[M]=lt[k]=lt[O]=lt[I]=lt[z]=lt[E]=lt[S]=lt[C]=lt[F]=lt[N]=lt[P]=lt[q]=!0,lt[x]=lt[j]=lt[W]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ht=parseFloat,pt=parseInt,vt="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,_t="object"==typeof self&&self&&self.Object===Object&&self,gt=vt||_t||Function("return this")(),yt=t&&!t.nodeType&&t,dt=yt&&n&&!n.nodeType&&n,bt=dt&&dt.exports===yt,wt=bt&&vt.process,mt=function(){try{var n=dt&&dt.require&&dt.require("util").types;return n||wt&&wt.binding&&wt.binding("util")}catch(n){}}(),xt=mt&&mt.isArrayBuffer,jt=mt&&mt.isDate,At=mt&&mt.isMap,kt=mt&&mt.isRegExp,Ot=mt&&mt.isSet,It=mt&&mt.isTypedArray;function Rt(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function zt(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function Et(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function St(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function Ct(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function Wt(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function Lt(n,t){return!!(null==n?0:n.length)&&qt(n,t,0)>-1}function Ut(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function Bt(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function Tt(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function $t(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function Dt(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function Mt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}var Ft=Gt("length");function Nt(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function Pt(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function qt(n,t,r){return t==t?function(n,t,r){var e=r-1,u=n.length;for(;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):Pt(n,Kt,r)}function Zt(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function Kt(n){return n!=n}function Vt(n,t){var r=null==n?0:n.length;return r?Yt(n,t)/r:_}function Gt(n){return function(t){return null==t?u:t[n]}}function Ht(n){return function(t){return null==n?u:n[t]}}function Jt(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function Yt(n,t){for(var r,e=-1,i=n.length;++e<i;){var o=t(n[e]);o!==u&&(r=r===u?o:r+o)}return r}function Qt(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function Xt(n){return n?n.slice(0,gr(n)+1).replace(fn,""):n}function nr(n){return function(t){return n(t)}}function tr(n,t){return Bt(t,function(t){return n[t]})}function rr(n,t){return n.has(t)}function er(n,t){for(var r=-1,e=n.length;++r<e&&qt(t,n[r],0)>-1;);return r}function ur(n,t){for(var r=n.length;r--&&qt(t,n[r],0)>-1;);return r}var ir=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),or=Ht({"&":"&","<":"<",">":">",'"':""","'":"'"});function fr(n){return"\\"+st[n]}function ar(n){return it.test(n)}function cr(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function lr(n,t){return function(r){return n(t(r))}}function sr(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==f||(n[r]=f,i[u++]=r)}return i}function hr(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function pr(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function vr(n){return ar(n)?function(n){var t=et.lastIndex=0;for(;et.test(n);)++t;return t}(n):Ft(n)}function _r(n){return ar(n)?function(n){return n.match(et)||[]}(n):function(n){return n.split("")}(n)}function gr(n){for(var t=n.length;t--&&an.test(n.charAt(t)););return t}var yr=Ht({"&":"&","<":"<",">":">",""":'"',"'":"'"});var dr=function n(t){var r,e=(t=null==t?gt:dr.defaults(gt.Object(),t,dr.pick(gt,ft))).Array,an=t.Date,kn=t.Error,On=t.Function,In=t.Math,Rn=t.Object,zn=t.RegExp,En=t.String,Sn=t.TypeError,Cn=e.prototype,Wn=On.prototype,Ln=Rn.prototype,Un=t["__core-js_shared__"],Bn=Wn.toString,Tn=Ln.hasOwnProperty,$n=0,Dn=(r=/[^.]+$/.exec(Un&&Un.keys&&Un.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Mn=Ln.toString,Fn=Bn.call(Rn),Nn=gt._,Pn=zn("^"+Bn.call(Tn).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qn=bt?t.Buffer:u,Zn=t.Symbol,Kn=t.Uint8Array,Vn=qn?qn.allocUnsafe:u,Gn=lr(Rn.getPrototypeOf,Rn),Hn=Rn.create,Jn=Ln.propertyIsEnumerable,Yn=Cn.splice,Qn=Zn?Zn.isConcatSpreadable:u,Xn=Zn?Zn.iterator:u,nt=Zn?Zn.toStringTag:u,et=function(){try{var n=hi(Rn,"defineProperty");return n({},"",{}),n}catch(n){}}(),it=t.clearTimeout!==gt.clearTimeout&&t.clearTimeout,st=an&&an.now!==gt.Date.now&&an.now,vt=t.setTimeout!==gt.setTimeout&&t.setTimeout,_t=In.ceil,yt=In.floor,dt=Rn.getOwnPropertySymbols,wt=qn?qn.isBuffer:u,mt=t.isFinite,Ft=Cn.join,Ht=lr(Rn.keys,Rn),br=In.max,wr=In.min,mr=an.now,xr=t.parseInt,jr=In.random,Ar=Cn.reverse,kr=hi(t,"DataView"),Or=hi(t,"Map"),Ir=hi(t,"Promise"),Rr=hi(t,"Set"),zr=hi(t,"WeakMap"),Er=hi(Rn,"create"),Sr=zr&&new zr,Cr={},Wr=$i(kr),Lr=$i(Or),Ur=$i(Ir),Br=$i(Rr),Tr=$i(zr),$r=Zn?Zn.prototype:u,Dr=$r?$r.valueOf:u,Mr=$r?$r.toString:u;function Fr(n){if(rf(n)&&!Zo(n)&&!(n instanceof Zr)){if(n instanceof qr)return n;if(Tn.call(n,"__wrapped__"))return Di(n)}return new qr(n)}var Nr=function(){function n(){}return function(t){if(!tf(t))return{};if(Hn)return Hn(t);n.prototype=t;var r=new n;return n.prototype=u,r}}();function Pr(){}function qr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=u}function Zr(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Kr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Vr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Gr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Hr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Gr;++t<r;)this.add(n[t])}function Jr(n){var t=this.__data__=new Vr(n);this.size=t.size}function Yr(n,t){var r=Zo(n),e=!r&&qo(n),u=!r&&!e&&Ho(n),i=!r&&!e&&!u&&sf(n),o=r||e||u||i,f=o?Qt(n.length,En):[],a=f.length;for(var c in n)!t&&!Tn.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bi(c,a))||f.push(c);return f}function Qr(n){var t=n.length;return t?n[He(0,t-1)]:u}function Xr(n,t){return Ui(Eu(n),ae(t,0,n.length))}function ne(n){return Ui(Eu(n))}function te(n,t,r){(r!==u&&!Fo(n[t],r)||r===u&&!(t in n))&&oe(n,t,r)}function re(n,t,r){var e=n[t];Tn.call(n,t)&&Fo(e,r)&&(r!==u||t in n)||oe(n,t,r)}function ee(n,t){for(var r=n.length;r--;)if(Fo(n[r][0],t))return r;return-1}function ue(n,t,r,e){return pe(n,function(n,u,i){t(e,n,r(n),i)}),e}function ie(n,t){return n&&Su(t,Wf(t),n)}function oe(n,t,r){"__proto__"==t&&et?et(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function fe(n,t){for(var r=-1,i=t.length,o=e(i),f=null==n;++r<i;)o[r]=f?u:Rf(n,t[r]);return o}function ae(n,t,r){return n==n&&(r!==u&&(n=n<=r?n:r),t!==u&&(n=n>=t?n:t)),n}function ce(n,t,r,e,i,o){var f,a=1&t,c=2&t,l=4&t;if(r&&(f=i?r(n,e,i,o):r(n)),f!==u)return f;if(!tf(n))return n;var s=Zo(n);if(s){if(f=function(n){var t=n.length,r=new n.constructor(t);t&&"string"==typeof n[0]&&Tn.call(n,"index")&&(r.index=n.index,r.input=n.input);return r}(n),!a)return Eu(n,f)}else{var h=_i(n),p=h==j||h==A;if(Ho(n))return Au(n,a);if(h==I||h==d||p&&!i){if(f=c||p?{}:yi(n),!a)return c?function(n,t){return Su(n,vi(n),t)}(n,function(n,t){return n&&Su(t,Lf(t),n)}(f,n)):function(n,t){return Su(n,pi(n),t)}(n,ie(f,n))}else{if(!lt[h])return i?n:{};f=function(n,t,r){var e=n.constructor;switch(t){case L:return ku(n);case w:case m:return new e(+n);case U:return function(n,t){var r=t?ku(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,r);case B:case T:case $:case D:case M:case F:case N:case P:case q:return Ou(n,r);case k:return new e;case O:case S:return new e(n);case z:return function(n){var t=new n.constructor(n.source,gn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case E:return new e;case C:return u=n,Dr?Rn(Dr.call(u)):{}}var u}(n,h,a)}}o||(o=new Jr);var v=o.get(n);if(v)return v;o.set(n,f),af(n)?n.forEach(function(e){f.add(ce(e,t,r,e,n,o))}):ef(n)&&n.forEach(function(e,u){f.set(u,ce(e,t,r,u,n,o))});var _=s?u:(l?c?ii:ui:c?Lf:Wf)(n);return Et(_||n,function(e,u){_&&(e=n[u=e]),re(f,u,ce(e,t,r,u,n,o))}),f}function le(n,t,r){var e=r.length;if(null==n)return!e;for(n=Rn(n);e--;){var i=r[e],o=t[i],f=n[i];if(f===u&&!(i in n)||!o(f))return!1}return!0}function se(n,t,r){if("function"!=typeof n)throw new Sn(i);return Si(function(){n.apply(u,r)},t)}function he(n,t,r,e){var u=-1,i=Lt,o=!0,f=n.length,a=[],c=t.length;if(!f)return a;r&&(t=Bt(t,nr(r))),e?(i=Ut,o=!1):t.length>=200&&(i=rr,o=!1,t=new Hr(t));n:for(;++u<f;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s==s){for(var h=c;h--;)if(t[h]===s)continue n;a.push(l)}else i(t,s,e)||a.push(l)}return a}Fr.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:Fr}},Fr.prototype=Pr.prototype,Fr.prototype.constructor=Fr,qr.prototype=Nr(Pr.prototype),qr.prototype.constructor=qr,Zr.prototype=Nr(Pr.prototype),Zr.prototype.constructor=Zr,Kr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Kr.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Kr.prototype.get=function(n){var t=this.__data__;if(Er){var r=t[n];return r===o?u:r}return Tn.call(t,n)?t[n]:u},Kr.prototype.has=function(n){var t=this.__data__;return Er?t[n]!==u:Tn.call(t,n)},Kr.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Er&&t===u?o:t,this},Vr.prototype.clear=function(){this.__data__=[],this.size=0},Vr.prototype.delete=function(n){var t=this.__data__,r=ee(t,n);return!(r<0)&&(r==t.length-1?t.pop():Yn.call(t,r,1),--this.size,!0)},Vr.prototype.get=function(n){var t=this.__data__,r=ee(t,n);return r<0?u:t[r][1]},Vr.prototype.has=function(n){return ee(this.__data__,n)>-1},Vr.prototype.set=function(n,t){var r=this.__data__,e=ee(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Or||Vr),string:new Kr}},Gr.prototype.delete=function(n){var t=li(this,n).delete(n);return this.size-=t?1:0,t},Gr.prototype.get=function(n){return li(this,n).get(n)},Gr.prototype.has=function(n){return li(this,n).has(n)},Gr.prototype.set=function(n,t){var r=li(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Hr.prototype.add=Hr.prototype.push=function(n){return this.__data__.set(n,o),this},Hr.prototype.has=function(n){return this.__data__.has(n)},Jr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Jr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},Jr.prototype.get=function(n){return this.__data__.get(n)},Jr.prototype.has=function(n){return this.__data__.has(n)},Jr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Vr){var e=r.__data__;if(!Or||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Gr(e)}return r.set(n,t),this.size=r.size,this};var pe=Lu(me),ve=Lu(xe,!0);function _e(n,t){var r=!0;return pe(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ge(n,t,r){for(var e=-1,i=n.length;++e<i;){var o=n[e],f=t(o);if(null!=f&&(a===u?f==f&&!lf(f):r(f,a)))var a=f,c=o}return c}function ye(n,t){var r=[];return pe(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function de(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=di),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?de(f,t-1,r,e,u):Tt(u,f):e||(u[u.length]=f)}return u}var be=Uu(),we=Uu(!0);function me(n,t){return n&&be(n,t,Wf)}function xe(n,t){return n&&we(n,t,Wf)}function je(n,t){return Wt(t,function(t){return Qo(n[t])})}function Ae(n,t){for(var r=0,e=(t=wu(t,n)).length;null!=n&&r<e;)n=n[Ti(t[r++])];return r&&r==e?n:u}function ke(n,t,r){var e=t(n);return Zo(n)?e:Tt(e,r(n))}function Oe(n){return null==n?n===u?"[object Undefined]":"[object Null]":nt&&nt in Rn(n)?function(n){var t=Tn.call(n,nt),r=n[nt];try{n[nt]=u;var e=!0}catch(n){}var i=Mn.call(n);e&&(t?n[nt]=r:delete n[nt]);return i}(n):function(n){return Mn.call(n)}(n)}function Ie(n,t){return n>t}function Re(n,t){return null!=n&&Tn.call(n,t)}function ze(n,t){return null!=n&&t in Rn(n)}function Ee(n,t,r){for(var i=r?Ut:Lt,o=n[0].length,f=n.length,a=f,c=e(f),l=1/0,s=[];a--;){var h=n[a];a&&t&&(h=Bt(h,nr(t))),l=wr(h.length,l),c[a]=!r&&(t||o>=120&&h.length>=120)?new Hr(a&&h):u}h=n[0];var p=-1,v=c[0];n:for(;++p<o&&s.length<l;){var _=h[p],g=t?t(_):_;if(_=r||0!==_?_:0,!(v?rr(v,g):i(s,g,r))){for(a=f;--a;){var y=c[a];if(!(y?rr(y,g):i(n[a],g,r)))continue n}v&&v.push(g),s.push(_)}}return s}function Se(n,t,r){var e=null==(n=Ri(n,t=wu(t,n)))?n:n[Ti(Ji(t))];return null==e?u:Rt(e,n,r)}function Ce(n){return rf(n)&&Oe(n)==d}function We(n,t,r,e,i){return n===t||(null==n||null==t||!rf(n)&&!rf(t)?n!=n&&t!=t:function(n,t,r,e,i,o){var f=Zo(n),a=Zo(t),c=f?b:_i(n),l=a?b:_i(t),s=(c=c==d?I:c)==I,h=(l=l==d?I:l)==I,p=c==l;if(p&&Ho(n)){if(!Ho(t))return!1;f=!0,s=!1}if(p&&!s)return o||(o=new Jr),f||sf(n)?ri(n,t,r,e,i,o):function(n,t,r,e,u,i,o){switch(r){case U:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case L:return!(n.byteLength!=t.byteLength||!i(new Kn(n),new Kn(t)));case w:case m:case O:return Fo(+n,+t);case x:return n.name==t.name&&n.message==t.message;case z:case S:return n==t+"";case k:var f=cr;case E:var a=1&e;if(f||(f=hr),n.size!=t.size&&!a)return!1;var c=o.get(n);if(c)return c==t;e|=2,o.set(n,t);var l=ri(f(n),f(t),e,u,i,o);return o.delete(n),l;case C:if(Dr)return Dr.call(n)==Dr.call(t)}return!1}(n,t,c,r,e,i,o);if(!(1&r)){var v=s&&Tn.call(n,"__wrapped__"),_=h&&Tn.call(t,"__wrapped__");if(v||_){var g=v?n.value():n,y=_?t.value():t;return o||(o=new Jr),i(g,y,r,e,o)}}if(!p)return!1;return o||(o=new Jr),function(n,t,r,e,i,o){var f=1&r,a=ui(n),c=a.length,l=ui(t),s=l.length;if(c!=s&&!f)return!1;var h=c;for(;h--;){var p=a[h];if(!(f?p in t:Tn.call(t,p)))return!1}var v=o.get(n),_=o.get(t);if(v&&_)return v==t&&_==n;var g=!0;o.set(n,t),o.set(t,n);var y=f;for(;++h<c;){var d=n[p=a[h]],b=t[p];if(e)var w=f?e(b,d,p,t,n,o):e(d,b,p,n,t,o);if(!(w===u?d===b||i(d,b,r,e,o):w)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var m=n.constructor,x=t.constructor;m==x||!("constructor"in n)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof x&&x instanceof x||(g=!1)}return o.delete(n),o.delete(t),g}(n,t,r,e,i,o)}(n,t,r,e,We,i))}function Le(n,t,r,e){var i=r.length,o=i,f=!e;if(null==n)return!o;for(n=Rn(n);i--;){var a=r[i];if(f&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<o;){var c=(a=r[i])[0],l=n[c],s=a[1];if(f&&a[2]){if(l===u&&!(c in n))return!1}else{var h=new Jr;if(e)var p=e(l,s,c,n,t,h);if(!(p===u?We(s,l,3,e,h):p))return!1}}return!0}function Ue(n){return!(!tf(n)||(t=n,Dn&&Dn in t))&&(Qo(n)?Pn:bn).test($i(n));var t}function Be(n){return"function"==typeof n?n:null==n?ia:"object"==typeof n?Zo(n)?Ne(n[0],n[1]):Fe(n):va(n)}function Te(n){if(!Ai(n))return Ht(n);var t=[];for(var r in Rn(n))Tn.call(n,r)&&"constructor"!=r&&t.push(r);return t}function $e(n){if(!tf(n))return function(n){var t=[];if(null!=n)for(var r in Rn(n))t.push(r);return t}(n);var t=Ai(n),r=[];for(var e in n)("constructor"!=e||!t&&Tn.call(n,e))&&r.push(e);return r}function De(n,t){return n<t}function Me(n,t){var r=-1,u=Vo(n)?e(n.length):[];return pe(n,function(n,e,i){u[++r]=t(n,e,i)}),u}function Fe(n){var t=si(n);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(r){return r===n||Le(r,n,t)}}function Ne(n,t){return mi(n)&&ki(t)?Oi(Ti(n),t):function(r){var e=Rf(r,n);return e===u&&e===t?zf(r,n):We(t,e,3)}}function Pe(n,t,r,e,i){n!==t&&be(t,function(o,f){if(i||(i=new Jr),tf(o))!function(n,t,r,e,i,o,f){var a=zi(n,r),c=zi(t,r),l=f.get(c);if(l)return void te(n,r,l);var s=o?o(a,c,r+"",n,t,f):u,h=s===u;if(h){var p=Zo(c),v=!p&&Ho(c),_=!p&&!v&&sf(c);s=c,p||v||_?Zo(a)?s=a:Go(a)?s=Eu(a):v?(h=!1,s=Au(c,!0)):_?(h=!1,s=Ou(c,!0)):s=[]:of(c)||qo(c)?(s=a,qo(a)?s=bf(a):tf(a)&&!Qo(a)||(s=yi(c))):h=!1}h&&(f.set(c,s),i(s,c,e,o,f),f.delete(c));te(n,r,s)}(n,t,f,r,Pe,e,i);else{var a=e?e(zi(n,f),o,f+"",n,t,i):u;a===u&&(a=o),te(n,f,a)}},Lf)}function qe(n,t){var r=n.length;if(r)return bi(t+=t<0?r:0,r)?n[t]:u}function Ze(n,t,r){t=t.length?Bt(t,function(n){return Zo(n)?function(t){return Ae(t,1===n.length?n[0]:n)}:n}):[ia];var e=-1;t=Bt(t,nr(ci()));var u=Me(n,function(n,r,u){var i=Bt(t,function(t){return t(n)});return{criteria:i,index:++e,value:n}});return function(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}(u,function(n,t){return function(n,t,r){var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;for(;++e<o;){var a=Iu(u[e],i[e]);if(a)return e>=f?a:a*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)})}function Ke(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=Ae(n,o);r(f,o)&&nu(i,wu(o,n),f)}return i}function Ve(n,t,r,e){var u=e?Zt:qt,i=-1,o=t.length,f=n;for(n===t&&(t=Eu(t)),r&&(f=Bt(n,nr(r)));++i<o;)for(var a=0,c=t[i],l=r?r(c):c;(a=u(f,l,a,e))>-1;)f!==n&&Yn.call(f,a,1),Yn.call(n,a,1);return n}function Ge(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;bi(u)?Yn.call(n,u,1):hu(n,u)}}return n}function He(n,t){return n+yt(jr()*(t-n+1))}function Je(n,t){var r="";if(!n||t<1||t>v)return r;do{t%2&&(r+=n),(t=yt(t/2))&&(n+=n)}while(t);return r}function Ye(n,t){return Ci(Ii(n,t,ia),n+"")}function Qe(n){return Qr(Nf(n))}function Xe(n,t){var r=Nf(n);return Ui(r,ae(t,0,r.length))}function nu(n,t,r,e){if(!tf(n))return n;for(var i=-1,o=(t=wu(t,n)).length,f=o-1,a=n;null!=a&&++i<o;){var c=Ti(t[i]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(i!=f){var s=a[c];(l=e?e(s,c,a):u)===u&&(l=tf(s)?s:bi(t[i+1])?[]:{})}re(a,c,l),a=a[c]}return n}var tu=Sr?function(n,t){return Sr.set(n,t),n}:ia,ru=et?function(n,t){return et(n,"toString",{configurable:!0,enumerable:!1,value:ra(t),writable:!0})}:ia;function eu(n){return Ui(Nf(n))}function uu(n,t,r){var u=-1,i=n.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=e(i);++u<i;)o[u]=n[u+t];return o}function iu(n,t){var r;return pe(n,function(n,e,u){return!(r=t(n,e,u))}),!!r}function ou(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!lf(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return fu(n,t,ia,r)}function fu(n,t,r,e){var i=0,o=null==n?0:n.length;if(0===o)return 0;for(var f=(t=r(t))!=t,a=null===t,c=lf(t),l=t===u;i<o;){var s=yt((i+o)/2),h=r(n[s]),p=h!==u,v=null===h,_=h==h,g=lf(h);if(f)var y=e||_;else y=l?_&&(e||p):a?_&&p&&(e||!v):c?_&&p&&!v&&(e||!g):!v&&!g&&(e?h<=t:h<t);y?i=s+1:o=s}return wr(o,4294967294)}function au(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Fo(f,a)){var a=f;i[u++]=0===o?0:o}}return i}function cu(n){return"number"==typeof n?n:lf(n)?_:+n}function lu(n){if("string"==typeof n)return n;if(Zo(n))return Bt(n,lu)+"";if(lf(n))return Mr?Mr.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function su(n,t,r){var e=-1,u=Lt,i=n.length,o=!0,f=[],a=f;if(r)o=!1,u=Ut;else if(i>=200){var c=t?null:Ju(n);if(c)return hr(c);o=!1,u=rr,a=new Hr}else a=t?[]:f;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s==s){for(var h=a.length;h--;)if(a[h]===s)continue n;t&&a.push(s),f.push(l)}else u(a,s,r)||(a!==f&&a.push(s),f.push(l))}return f}function hu(n,t){return null==(n=Ri(n,t=wu(t,n)))||delete n[Ti(Ji(t))]}function pu(n,t,r,e){return nu(n,t,r(Ae(n,t)),e)}function vu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?uu(n,e?0:i,e?i+1:u):uu(n,e?i+1:0,e?u:i)}function _u(n,t){var r=n;return r instanceof Zr&&(r=r.value()),$t(t,function(n,t){return t.func.apply(t.thisArg,Tt([n],t.args))},r)}function gu(n,t,r){var u=n.length;if(u<2)return u?su(n[0]):[];for(var i=-1,o=e(u);++i<u;)for(var f=n[i],a=-1;++a<u;)a!=i&&(o[i]=he(o[i]||f,n[a],t,r));return su(de(o,1),t,r)}function yu(n,t,r){for(var e=-1,i=n.length,o=t.length,f={};++e<i;){var a=e<o?t[e]:u;r(f,n[e],a)}return f}function du(n){return Go(n)?n:[]}function bu(n){return"function"==typeof n?n:ia}function wu(n,t){return Zo(n)?n:mi(n,t)?[n]:Bi(wf(n))}var mu=Ye;function xu(n,t,r){var e=n.length;return r=r===u?e:r,!t&&r>=e?n:uu(n,t,r)}var ju=it||function(n){return gt.clearTimeout(n)};function Au(n,t){if(t)return n.slice();var r=n.length,e=Vn?Vn(r):new n.constructor(r);return n.copy(e),e}function ku(n){var t=new n.constructor(n.byteLength);return new Kn(t).set(new Kn(n)),t}function Ou(n,t){var r=t?ku(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Iu(n,t){if(n!==t){var r=n!==u,e=null===n,i=n==n,o=lf(n),f=t!==u,a=null===t,c=t==t,l=lf(t);if(!a&&!l&&!o&&n>t||o&&f&&c&&!a&&!l||e&&f&&c||!r&&c||!i)return 1;if(!e&&!o&&!l&&n<t||l&&r&&i&&!e&&!o||a&&r&&i||!f&&i||!c)return-1}return 0}function Ru(n,t,r,u){for(var i=-1,o=n.length,f=r.length,a=-1,c=t.length,l=br(o-f,0),s=e(c+l),h=!u;++a<c;)s[a]=t[a];for(;++i<f;)(h||i<o)&&(s[r[i]]=n[i]);for(;l--;)s[a++]=n[i++];return s}function zu(n,t,r,u){for(var i=-1,o=n.length,f=-1,a=r.length,c=-1,l=t.length,s=br(o-a,0),h=e(s+l),p=!u;++i<s;)h[i]=n[i];for(var v=i;++c<l;)h[v+c]=t[c];for(;++f<a;)(p||i<o)&&(h[v+r[f]]=n[i++]);return h}function Eu(n,t){var r=-1,u=n.length;for(t||(t=e(u));++r<u;)t[r]=n[r];return t}function Su(n,t,r,e){var i=!r;r||(r={});for(var o=-1,f=t.length;++o<f;){var a=t[o],c=e?e(r[a],n[a],a,r,n):u;c===u&&(c=n[a]),i?oe(r,a,c):re(r,a,c)}return r}function Cu(n,t){return function(r,e){var u=Zo(r)?zt:ue,i=t?t():{};return u(r,n,ci(e,2),i)}}function Wu(n){return Ye(function(t,r){var e=-1,i=r.length,o=i>1?r[i-1]:u,f=i>2?r[2]:u;for(o=n.length>3&&"function"==typeof o?(i--,o):u,f&&wi(r[0],r[1],f)&&(o=i<3?u:o,i=1),t=Rn(t);++e<i;){var a=r[e];a&&n(t,a,e,o)}return t})}function Lu(n,t){return function(r,e){if(null==r)return r;if(!Vo(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=Rn(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function Uu(n){return function(t,r,e){for(var u=-1,i=Rn(t),o=e(t),f=o.length;f--;){var a=o[n?f:++u];if(!1===r(i[a],a,i))break}return t}}function Bu(n){return function(t){var r=ar(t=wf(t))?_r(t):u,e=r?r[0]:t.charAt(0),i=r?xu(r,1).join(""):t.slice(1);return e[n]()+i}}function Tu(n){return function(t){return $t(Xf(Zf(t).replace(tt,"")),n,"")}}function $u(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Nr(n.prototype),e=n.apply(r,t);return tf(e)?e:r}}function Du(n){return function(t,r,e){var i=Rn(t);if(!Vo(t)){var o=ci(r,3);t=Wf(t),r=function(n){return o(i[n],n,i)}}var f=n(t,r,e);return f>-1?i[o?t[f]:f]:u}}function Mu(n){return ei(function(t){var r=t.length,e=r,o=qr.prototype.thru;for(n&&t.reverse();e--;){var f=t[e];if("function"!=typeof f)throw new Sn(i);if(o&&!a&&"wrapper"==fi(f))var a=new qr([],!0)}for(e=a?e:r;++e<r;){var c=fi(f=t[e]),l="wrapper"==c?oi(f):u;a=l&&xi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[fi(l[0])].apply(a,l[3]):1==f.length&&xi(f)?a[c]():a.thru(f)}return function(){var n=arguments,e=n[0];if(a&&1==n.length&&Zo(e))return a.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function Fu(n,t,r,i,o,f,a,c,l,h){var p=t&s,v=1&t,_=2&t,g=24&t,y=512&t,d=_?u:$u(n);return function s(){for(var b=arguments.length,w=e(b),m=b;m--;)w[m]=arguments[m];if(g)var x=ai(s),j=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(w,x);if(i&&(w=Ru(w,i,o,g)),f&&(w=zu(w,f,a,g)),b-=j,g&&b<h){var A=sr(w,x);return Gu(n,t,Fu,s.placeholder,r,w,A,c,l,h-b)}var k=v?r:this,O=_?k[n]:n;return b=w.length,c?w=function(n,t){var r=n.length,e=wr(t.length,r),i=Eu(n);for(;e--;){var o=t[e];n[e]=bi(o,r)?i[o]:u}return n}(w,c):y&&b>1&&w.reverse(),p&&l<b&&(w.length=l),this&&this!==gt&&this instanceof s&&(O=d||$u(O)),O.apply(k,w)}}function Nu(n,t){return function(r,e){return function(n,t,r,e){return me(n,function(n,u,i){t(e,r(n),u,i)}),e}(r,n,t(e),{})}}function Pu(n,t){return function(r,e){var i;if(r===u&&e===u)return t;if(r!==u&&(i=r),e!==u){if(i===u)return e;"string"==typeof r||"string"==typeof e?(r=lu(r),e=lu(e)):(r=cu(r),e=cu(e)),i=n(r,e)}return i}}function qu(n){return ei(function(t){return t=Bt(t,nr(ci())),Ye(function(r){var e=this;return n(t,function(n){return Rt(n,e,r)})})})}function Zu(n,t){var r=(t=t===u?" ":lu(t)).length;if(r<2)return r?Je(t,n):t;var e=Je(t,_t(n/vr(t)));return ar(t)?xu(_r(e),0,n).join(""):e.slice(0,n)}function Ku(n){return function(t,r,i){return i&&"number"!=typeof i&&wi(t,r,i)&&(r=i=u),t=_f(t),r===u?(r=t,t=0):r=_f(r),function(n,t,r,u){for(var i=-1,o=br(_t((t-n)/(r||1)),0),f=e(o);o--;)f[u?o:++i]=n,n+=r;return f}(t,r,i=i===u?t<r?1:-1:_f(i),n)}}function Vu(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=df(t),r=df(r)),n(t,r)}}function Gu(n,t,r,e,i,o,f,a,s,h){var p=8&t;t|=p?c:l,4&(t&=~(p?l:c))||(t&=-4);var v=[n,t,i,p?o:u,p?f:u,p?u:o,p?u:f,a,s,h],_=r.apply(u,v);return xi(n)&&Ei(_,v),_.placeholder=e,Wi(_,n,t)}function Hu(n){var t=In[n];return function(n,r){if(n=df(n),(r=null==r?0:wr(gf(r),292))&&mt(n)){var e=(wf(n)+"e").split("e");return+((e=(wf(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}var Ju=Rr&&1/hr(new Rr([,-0]))[1]==p?function(n){return new Rr(n)}:la;function Yu(n){return function(t){var r=_i(t);return r==k?cr(t):r==E?pr(t):function(n,t){return Bt(t,function(t){return[t,n[t]]})}(t,n(t))}}function Qu(n,t,r,o,p,v,_,g){var y=2&t;if(!y&&"function"!=typeof n)throw new Sn(i);var d=o?o.length:0;if(d||(t&=-97,o=p=u),_=_===u?_:br(gf(_),0),g=g===u?g:gf(g),d-=p?p.length:0,t&l){var b=o,w=p;o=p=u}var m=y?u:oi(n),x=[n,t,r,o,p,b,w,v,_,g];if(m&&function(n,t){var r=n[1],e=t[1],u=r|e,i=u<131,o=e==s&&8==r||e==s&&r==h&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!i&&!o)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var a=t[3];if(a){var c=n[3];n[3]=c?Ru(c,a,t[4]):a,n[4]=c?sr(n[3],f):t[4]}(a=t[5])&&(c=n[5],n[5]=c?zu(c,a,t[6]):a,n[6]=c?sr(n[5],f):t[6]);(a=t[7])&&(n[7]=a);e&s&&(n[8]=null==n[8]?t[8]:wr(n[8],t[8]));null==n[9]&&(n[9]=t[9]);n[0]=t[0],n[1]=u}(x,m),n=x[0],t=x[1],r=x[2],o=x[3],p=x[4],!(g=x[9]=x[9]===u?y?0:n.length:br(x[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)j=8==t||t==a?function(n,t,r){var i=$u(n);return function o(){for(var f=arguments.length,a=e(f),c=f,l=ai(o);c--;)a[c]=arguments[c];var s=f<3&&a[0]!==l&&a[f-1]!==l?[]:sr(a,l);return(f-=s.length)<r?Gu(n,t,Fu,o.placeholder,u,a,s,u,u,r-f):Rt(this&&this!==gt&&this instanceof o?i:n,this,a)}}(n,t,g):t!=c&&33!=t||p.length?Fu.apply(u,x):function(n,t,r,u){var i=1&t,o=$u(n);return function t(){for(var f=-1,a=arguments.length,c=-1,l=u.length,s=e(l+a),h=this&&this!==gt&&this instanceof t?o:n;++c<l;)s[c]=u[c];for(;a--;)s[c++]=arguments[++f];return Rt(h,i?r:this,s)}}(n,t,r,o);else var j=function(n,t,r){var e=1&t,u=$u(n);return function t(){return(this&&this!==gt&&this instanceof t?u:n).apply(e?r:this,arguments)}}(n,t,r);return Wi((m?tu:Ei)(j,x),n,t)}function Xu(n,t,r,e){return n===u||Fo(n,Ln[r])&&!Tn.call(e,r)?t:n}function ni(n,t,r,e,i,o){return tf(n)&&tf(t)&&(o.set(t,n),Pe(n,t,u,ni,o),o.delete(t)),n}function ti(n){return of(n)?u:n}function ri(n,t,r,e,i,o){var f=1&r,a=n.length,c=t.length;if(a!=c&&!(f&&c>a))return!1;var l=o.get(n),s=o.get(t);if(l&&s)return l==t&&s==n;var h=-1,p=!0,v=2&r?new Hr:u;for(o.set(n,t),o.set(t,n);++h<a;){var _=n[h],g=t[h];if(e)var y=f?e(g,_,h,t,n,o):e(_,g,h,n,t,o);if(y!==u){if(y)continue;p=!1;break}if(v){if(!Mt(t,function(n,t){if(!rr(v,t)&&(_===n||i(_,n,r,e,o)))return v.push(t)})){p=!1;break}}else if(_!==g&&!i(_,g,r,e,o)){p=!1;break}}return o.delete(n),o.delete(t),p}function ei(n){return Ci(Ii(n,u,Zi),n+"")}function ui(n){return ke(n,Wf,pi)}function ii(n){return ke(n,Lf,vi)}var oi=Sr?function(n){return Sr.get(n)}:la;function fi(n){for(var t=n.name+"",r=Cr[t],e=Tn.call(Cr,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function ai(n){return(Tn.call(Fr,"placeholder")?Fr:n).placeholder}function ci(){var n=Fr.iteratee||oa;return n=n===oa?Be:n,arguments.length?n(arguments[0],arguments[1]):n}function li(n,t){var r,e,u=n.__data__;return("string"==(e=typeof(r=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?u["string"==typeof t?"string":"hash"]:u.map}function si(n){for(var t=Wf(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,ki(u)]}return t}function hi(n,t){var r=function(n,t){return null==n?u:n[t]}(n,t);return Ue(r)?r:u}var pi=dt?function(n){return null==n?[]:(n=Rn(n),Wt(dt(n),function(t){return Jn.call(n,t)}))}:ya,vi=dt?function(n){for(var t=[];n;)Tt(t,pi(n)),n=Gn(n);return t}:ya,_i=Oe;function gi(n,t,r){for(var e=-1,u=(t=wu(t,n)).length,i=!1;++e<u;){var o=Ti(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&nf(u)&&bi(o,u)&&(Zo(n)||qo(n))}function yi(n){return"function"!=typeof n.constructor||Ai(n)?{}:Nr(Gn(n))}function di(n){return Zo(n)||qo(n)||!!(Qn&&n&&n[Qn])}function bi(n,t){var r=typeof n;return!!(t=null==t?v:t)&&("number"==r||"symbol"!=r&&mn.test(n))&&n>-1&&n%1==0&&n<t}function wi(n,t,r){if(!tf(r))return!1;var e=typeof t;return!!("number"==e?Vo(r)&&bi(t,r.length):"string"==e&&t in r)&&Fo(r[t],n)}function mi(n,t){if(Zo(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!lf(n))||(rn.test(n)||!tn.test(n)||null!=t&&n in Rn(t))}function xi(n){var t=fi(n),r=Fr[t];if("function"!=typeof r||!(t in Zr.prototype))return!1;if(n===r)return!0;var e=oi(r);return!!e&&n===e[0]}(kr&&_i(new kr(new ArrayBuffer(1)))!=U||Or&&_i(new Or)!=k||Ir&&_i(Ir.resolve())!=R||Rr&&_i(new Rr)!=E||zr&&_i(new zr)!=W)&&(_i=function(n){var t=Oe(n),r=t==I?n.constructor:u,e=r?$i(r):"";if(e)switch(e){case Wr:return U;case Lr:return k;case Ur:return R;case Br:return E;case Tr:return W}return t});var ji=Un?Qo:da;function Ai(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||Ln)}function ki(n){return n==n&&!tf(n)}function Oi(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==u||n in Rn(r)))}}function Ii(n,t,r){return t=br(t===u?n.length-1:t,0),function(){for(var u=arguments,i=-1,o=br(u.length-t,0),f=e(o);++i<o;)f[i]=u[t+i];i=-1;for(var a=e(t+1);++i<t;)a[i]=u[i];return a[t]=r(f),Rt(n,this,a)}}function Ri(n,t){return t.length<2?n:Ae(n,uu(t,0,-1))}function zi(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Ei=Li(tu),Si=vt||function(n,t){return gt.setTimeout(n,t)},Ci=Li(ru);function Wi(n,t,r){var e=t+"";return Ci(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+t+"] */\n")}(e,function(n,t){return Et(y,function(r){var e="_."+r[0];t&r[1]&&!Lt(n,e)&&n.push(e)}),n.sort()}(function(n){var t=n.match(ln);return t?t[1].split(sn):[]}(e),r)))}function Li(n){var t=0,r=0;return function(){var e=mr(),i=16-(e-r);if(r=e,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(u,arguments)}}function Ui(n,t){var r=-1,e=n.length,i=e-1;for(t=t===u?e:t;++r<t;){var o=He(r,i),f=n[o];n[o]=n[r],n[r]=f}return n.length=t,n}var Bi=function(n){var t=Uo(n,function(n){return 500===r.size&&r.clear(),n}),r=t.cache;return t}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(en,function(n,r,e,u){t.push(e?u.replace(vn,"$1"):r||n)}),t});function Ti(n){if("string"==typeof n||lf(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function $i(n){if(null!=n){try{return Bn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Di(n){if(n instanceof Zr)return n.clone();var t=new qr(n.__wrapped__,n.__chain__);return t.__actions__=Eu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Mi=Ye(function(n,t){return Go(n)?he(n,de(t,1,Go,!0)):[]}),Fi=Ye(function(n,t){var r=Ji(t);return Go(r)&&(r=u),Go(n)?he(n,de(t,1,Go,!0),ci(r,2)):[]}),Ni=Ye(function(n,t){var r=Ji(t);return Go(r)&&(r=u),Go(n)?he(n,de(t,1,Go,!0),u,r):[]});function Pi(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:gf(r);return u<0&&(u=br(e+u,0)),Pt(n,ci(t,3),u)}function qi(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var i=e-1;return r!==u&&(i=gf(r),i=r<0?br(e+i,0):wr(i,e-1)),Pt(n,ci(t,3),i,!0)}function Zi(n){return(null==n?0:n.length)?de(n,1):[]}function Ki(n){return n&&n.length?n[0]:u}var Vi=Ye(function(n){var t=Bt(n,du);return t.length&&t[0]===n[0]?Ee(t):[]}),Gi=Ye(function(n){var t=Ji(n),r=Bt(n,du);return t===Ji(r)?t=u:r.pop(),r.length&&r[0]===n[0]?Ee(r,ci(t,2)):[]}),Hi=Ye(function(n){var t=Ji(n),r=Bt(n,du);return(t="function"==typeof t?t:u)&&r.pop(),r.length&&r[0]===n[0]?Ee(r,u,t):[]});function Ji(n){var t=null==n?0:n.length;return t?n[t-1]:u}var Yi=Ye(Qi);function Qi(n,t){return n&&n.length&&t&&t.length?Ve(n,t):n}var Xi=ei(function(n,t){var r=null==n?0:n.length,e=fe(n,t);return Ge(n,Bt(t,function(n){return bi(n,r)?+n:n}).sort(Iu)),e});function no(n){return null==n?n:Ar.call(n)}var to=Ye(function(n){return su(de(n,1,Go,!0))}),ro=Ye(function(n){var t=Ji(n);return Go(t)&&(t=u),su(de(n,1,Go,!0),ci(t,2))}),eo=Ye(function(n){var t=Ji(n);return t="function"==typeof t?t:u,su(de(n,1,Go,!0),u,t)});function uo(n){if(!n||!n.length)return[];var t=0;return n=Wt(n,function(n){if(Go(n))return t=br(n.length,t),!0}),Qt(t,function(t){return Bt(n,Gt(t))})}function io(n,t){if(!n||!n.length)return[];var r=uo(n);return null==t?r:Bt(r,function(n){return Rt(t,u,n)})}var oo=Ye(function(n,t){return Go(n)?he(n,t):[]}),fo=Ye(function(n){return gu(Wt(n,Go))}),ao=Ye(function(n){var t=Ji(n);return Go(t)&&(t=u),gu(Wt(n,Go),ci(t,2))}),co=Ye(function(n){var t=Ji(n);return t="function"==typeof t?t:u,gu(Wt(n,Go),u,t)}),lo=Ye(uo);var so=Ye(function(n){var t=n.length,r=t>1?n[t-1]:u;return r="function"==typeof r?(n.pop(),r):u,io(n,r)});function ho(n){var t=Fr(n);return t.__chain__=!0,t}function po(n,t){return t(n)}var vo=ei(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,i=function(t){return fe(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Zr&&bi(r)?((e=e.slice(r,+r+(t?1:0))).__actions__.push({func:po,args:[i],thisArg:u}),new qr(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(u),n})):this.thru(i)});var _o=Cu(function(n,t,r){Tn.call(n,r)?++n[r]:oe(n,r,1)});var go=Du(Pi),yo=Du(qi);function bo(n,t){return(Zo(n)?Et:pe)(n,ci(t,3))}function wo(n,t){return(Zo(n)?St:ve)(n,ci(t,3))}var mo=Cu(function(n,t,r){Tn.call(n,r)?n[r].push(t):oe(n,r,[t])});var xo=Ye(function(n,t,r){var u=-1,i="function"==typeof t,o=Vo(n)?e(n.length):[];return pe(n,function(n){o[++u]=i?Rt(t,n,r):Se(n,t,r)}),o}),jo=Cu(function(n,t,r){oe(n,r,t)});function Ao(n,t){return(Zo(n)?Bt:Me)(n,ci(t,3))}var ko=Cu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]});var Oo=Ye(function(n,t){if(null==n)return[];var r=t.length;return r>1&&wi(n,t[0],t[1])?t=[]:r>2&&wi(t[0],t[1],t[2])&&(t=[t[0]]),Ze(n,de(t,1),[])}),Io=st||function(){return gt.Date.now()};function Ro(n,t,r){return t=r?u:t,t=n&&null==t?n.length:t,Qu(n,s,u,u,u,u,t)}function zo(n,t){var r;if("function"!=typeof t)throw new Sn(i);return n=gf(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=u),r}}var Eo=Ye(function(n,t,r){var e=1;if(r.length){var u=sr(r,ai(Eo));e|=c}return Qu(n,e,t,r,u)}),So=Ye(function(n,t,r){var e=3;if(r.length){var u=sr(r,ai(So));e|=c}return Qu(t,e,n,r,u)});function Co(n,t,r){var e,o,f,a,c,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new Sn(i);function _(t){var r=e,i=o;return e=o=u,s=t,a=n.apply(i,r)}function g(n){var r=n-l;return l===u||r>=t||r<0||p&&n-s>=f}function y(){var n=Io();if(g(n))return d(n);c=Si(y,function(n){var r=t-(n-l);return p?wr(r,f-(n-s)):r}(n))}function d(n){return c=u,v&&e?_(n):(e=o=u,a)}function b(){var n=Io(),r=g(n);if(e=arguments,o=this,l=n,r){if(c===u)return function(n){return s=n,c=Si(y,t),h?_(n):a}(l);if(p)return ju(c),c=Si(y,t),_(l)}return c===u&&(c=Si(y,t)),a}return t=df(t)||0,tf(r)&&(h=!!r.leading,f=(p="maxWait"in r)?br(df(r.maxWait)||0,t):f,v="trailing"in r?!!r.trailing:v),b.cancel=function(){c!==u&&ju(c),s=0,e=l=o=c=u},b.flush=function(){return c===u?a:d(Io())},b}var Wo=Ye(function(n,t){return se(n,1,t)}),Lo=Ye(function(n,t,r){return se(n,df(t)||0,r)});function Uo(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new Sn(i);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Uo.Cache||Gr),r}function Bo(n){if("function"!=typeof n)throw new Sn(i);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Uo.Cache=Gr;var To=mu(function(n,t){var r=(t=1==t.length&&Zo(t[0])?Bt(t[0],nr(ci())):Bt(de(t,1),nr(ci()))).length;return Ye(function(e){for(var u=-1,i=wr(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return Rt(n,this,e)})}),$o=Ye(function(n,t){var r=sr(t,ai($o));return Qu(n,c,u,t,r)}),Do=Ye(function(n,t){var r=sr(t,ai(Do));return Qu(n,l,u,t,r)}),Mo=ei(function(n,t){return Qu(n,h,u,u,u,t)});function Fo(n,t){return n===t||n!=n&&t!=t}var No=Vu(Ie),Po=Vu(function(n,t){return n>=t}),qo=Ce(function(){return arguments}())?Ce:function(n){return rf(n)&&Tn.call(n,"callee")&&!Jn.call(n,"callee")},Zo=e.isArray,Ko=xt?nr(xt):function(n){return rf(n)&&Oe(n)==L};function Vo(n){return null!=n&&nf(n.length)&&!Qo(n)}function Go(n){return rf(n)&&Vo(n)}var Ho=wt||da,Jo=jt?nr(jt):function(n){return rf(n)&&Oe(n)==m};function Yo(n){if(!rf(n))return!1;var t=Oe(n);return t==x||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!of(n)}function Qo(n){if(!tf(n))return!1;var t=Oe(n);return t==j||t==A||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xo(n){return"number"==typeof n&&n==gf(n)}function nf(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=v}function tf(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function rf(n){return null!=n&&"object"==typeof n}var ef=At?nr(At):function(n){return rf(n)&&_i(n)==k};function uf(n){return"number"==typeof n||rf(n)&&Oe(n)==O}function of(n){if(!rf(n)||Oe(n)!=I)return!1;var t=Gn(n);if(null===t)return!0;var r=Tn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Bn.call(r)==Fn}var ff=kt?nr(kt):function(n){return rf(n)&&Oe(n)==z};var af=Ot?nr(Ot):function(n){return rf(n)&&_i(n)==E};function cf(n){return"string"==typeof n||!Zo(n)&&rf(n)&&Oe(n)==S}function lf(n){return"symbol"==typeof n||rf(n)&&Oe(n)==C}var sf=It?nr(It):function(n){return rf(n)&&nf(n.length)&&!!ct[Oe(n)]};var hf=Vu(De),pf=Vu(function(n,t){return n<=t});function vf(n){if(!n)return[];if(Vo(n))return cf(n)?_r(n):Eu(n);if(Xn&&n[Xn])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Xn]());var t=_i(n);return(t==k?cr:t==E?hr:Nf)(n)}function _f(n){return n?(n=df(n))===p||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function gf(n){var t=_f(n),r=t%1;return t==t?r?t-r:t:0}function yf(n){return n?ae(gf(n),0,g):0}function df(n){if("number"==typeof n)return n;if(lf(n))return _;if(tf(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=tf(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Xt(n);var r=dn.test(n);return r||wn.test(n)?pt(n.slice(2),r?2:8):yn.test(n)?_:+n}function bf(n){return Su(n,Lf(n))}function wf(n){return null==n?"":lu(n)}var mf=Wu(function(n,t){if(Ai(t)||Vo(t))Su(t,Wf(t),n);else for(var r in t)Tn.call(t,r)&&re(n,r,t[r])}),xf=Wu(function(n,t){Su(t,Lf(t),n)}),jf=Wu(function(n,t,r,e){Su(t,Lf(t),n,e)}),Af=Wu(function(n,t,r,e){Su(t,Wf(t),n,e)}),kf=ei(fe);var Of=Ye(function(n,t){n=Rn(n);var r=-1,e=t.length,i=e>2?t[2]:u;for(i&&wi(t[0],t[1],i)&&(e=1);++r<e;)for(var o=t[r],f=Lf(o),a=-1,c=f.length;++a<c;){var l=f[a],s=n[l];(s===u||Fo(s,Ln[l])&&!Tn.call(n,l))&&(n[l]=o[l])}return n}),If=Ye(function(n){return n.push(u,ni),Rt(Bf,u,n)});function Rf(n,t,r){var e=null==n?u:Ae(n,t);return e===u?r:e}function zf(n,t){return null!=n&&gi(n,t,ze)}var Ef=Nu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Mn.call(t)),n[t]=r},ra(ia)),Sf=Nu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Mn.call(t)),Tn.call(n,t)?n[t].push(r):n[t]=[r]},ci),Cf=Ye(Se);function Wf(n){return Vo(n)?Yr(n):Te(n)}function Lf(n){return Vo(n)?Yr(n,!0):$e(n)}var Uf=Wu(function(n,t,r){Pe(n,t,r)}),Bf=Wu(function(n,t,r,e){Pe(n,t,r,e)}),Tf=ei(function(n,t){var r={};if(null==n)return r;var e=!1;t=Bt(t,function(t){return t=wu(t,n),e||(e=t.length>1),t}),Su(n,ii(n),r),e&&(r=ce(r,7,ti));for(var u=t.length;u--;)hu(r,t[u]);return r});var $f=ei(function(n,t){return null==n?{}:function(n,t){return Ke(n,t,function(t,r){return zf(n,r)})}(n,t)});function Df(n,t){if(null==n)return{};var r=Bt(ii(n),function(n){return[n]});return t=ci(t),Ke(n,r,function(n,r){return t(n,r[0])})}var Mf=Yu(Wf),Ff=Yu(Lf);function Nf(n){return null==n?[]:tr(n,Wf(n))}var Pf=Tu(function(n,t,r){return t=t.toLowerCase(),n+(r?qf(t):t)});function qf(n){return Qf(wf(n).toLowerCase())}function Zf(n){return(n=wf(n))&&n.replace(xn,ir).replace(rt,"")}var Kf=Tu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vf=Tu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gf=Bu("toLowerCase");var Hf=Tu(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()});var Jf=Tu(function(n,t,r){return n+(r?" ":"")+Qf(t)});var Yf=Tu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qf=Bu("toUpperCase");function Xf(n,t,r){return n=wf(n),(t=r?u:t)===u?function(n){return ot.test(n)}(n)?function(n){return n.match(ut)||[]}(n):function(n){return n.match(hn)||[]}(n):n.match(t)||[]}var na=Ye(function(n,t){try{return Rt(n,u,t)}catch(n){return Yo(n)?n:new kn(n)}}),ta=ei(function(n,t){return Et(t,function(t){t=Ti(t),oe(n,t,Eo(n[t],n))}),n});function ra(n){return function(){return n}}var ea=Mu(),ua=Mu(!0);function ia(n){return n}function oa(n){return Be("function"==typeof n?n:ce(n,1))}var fa=Ye(function(n,t){return function(r){return Se(r,n,t)}}),aa=Ye(function(n,t){return function(r){return Se(n,r,t)}});function ca(n,t,r){var e=Wf(t),u=je(t,e);null!=r||tf(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=je(t,Wf(t)));var i=!(tf(r)&&"chain"in r&&!r.chain),o=Qo(n);return Et(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Eu(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,Tt([this.value()],arguments))})}),n}function la(){}var sa=qu(Bt),ha=qu(Ct),pa=qu(Mt);function va(n){return mi(n)?Gt(Ti(n)):function(n){return function(t){return Ae(t,n)}}(n)}var _a=Ku(),ga=Ku(!0);function ya(){return[]}function da(){return!1}var ba=Pu(function(n,t){return n+t},0),wa=Hu("ceil"),ma=Pu(function(n,t){return n/t},1),xa=Hu("floor");var ja,Aa=Pu(function(n,t){return n*t},1),ka=Hu("round"),Oa=Pu(function(n,t){return n-t},0);return Fr.after=function(n,t){if("function"!=typeof t)throw new Sn(i);return n=gf(n),function(){if(--n<1)return t.apply(this,arguments)}},Fr.ary=Ro,Fr.assign=mf,Fr.assignIn=xf,Fr.assignInWith=jf,Fr.assignWith=Af,Fr.at=kf,Fr.before=zo,Fr.bind=Eo,Fr.bindAll=ta,Fr.bindKey=So,Fr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Zo(n)?n:[n]},Fr.chain=ho,Fr.chunk=function(n,t,r){t=(r?wi(n,t,r):t===u)?1:br(gf(t),0);var i=null==n?0:n.length;if(!i||t<1)return[];for(var o=0,f=0,a=e(_t(i/t));o<i;)a[f++]=uu(n,o,o+=t);return a},Fr.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Fr.concat=function(){var n=arguments.length;if(!n)return[];for(var t=e(n-1),r=arguments[0],u=n;u--;)t[u-1]=arguments[u];return Tt(Zo(r)?Eu(r):[r],de(t,1))},Fr.cond=function(n){var t=null==n?0:n.length,r=ci();return n=t?Bt(n,function(n){if("function"!=typeof n[1])throw new Sn(i);return[r(n[0]),n[1]]}):[],Ye(function(r){for(var e=-1;++e<t;){var u=n[e];if(Rt(u[0],this,r))return Rt(u[1],this,r)}})},Fr.conforms=function(n){return function(n){var t=Wf(n);return function(r){return le(r,n,t)}}(ce(n,1))},Fr.constant=ra,Fr.countBy=_o,Fr.create=function(n,t){var r=Nr(n);return null==t?r:ie(r,t)},Fr.curry=function n(t,r,e){var i=Qu(t,8,u,u,u,u,u,r=e?u:r);return i.placeholder=n.placeholder,i},Fr.curryRight=function n(t,r,e){var i=Qu(t,a,u,u,u,u,u,r=e?u:r);return i.placeholder=n.placeholder,i},Fr.debounce=Co,Fr.defaults=Of,Fr.defaultsDeep=If,Fr.defer=Wo,Fr.delay=Lo,Fr.difference=Mi,Fr.differenceBy=Fi,Fr.differenceWith=Ni,Fr.drop=function(n,t,r){var e=null==n?0:n.length;return e?uu(n,(t=r||t===u?1:gf(t))<0?0:t,e):[]},Fr.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?uu(n,0,(t=e-(t=r||t===u?1:gf(t)))<0?0:t):[]},Fr.dropRightWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!0,!0):[]},Fr.dropWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!0):[]},Fr.fill=function(n,t,r,e){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&wi(n,t,r)&&(r=0,e=i),function(n,t,r,e){var i=n.length;for((r=gf(r))<0&&(r=-r>i?0:i+r),(e=e===u||e>i?i:gf(e))<0&&(e+=i),e=r>e?0:yf(e);r<e;)n[r++]=t;return n}(n,t,r,e)):[]},Fr.filter=function(n,t){return(Zo(n)?Wt:ye)(n,ci(t,3))},Fr.flatMap=function(n,t){return de(Ao(n,t),1)},Fr.flatMapDeep=function(n,t){return de(Ao(n,t),p)},Fr.flatMapDepth=function(n,t,r){return r=r===u?1:gf(r),de(Ao(n,t),r)},Fr.flatten=Zi,Fr.flattenDeep=function(n){return(null==n?0:n.length)?de(n,p):[]},Fr.flattenDepth=function(n,t){return(null==n?0:n.length)?de(n,t=t===u?1:gf(t)):[]},Fr.flip=function(n){return Qu(n,512)},Fr.flow=ea,Fr.flowRight=ua,Fr.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Fr.functions=function(n){return null==n?[]:je(n,Wf(n))},Fr.functionsIn=function(n){return null==n?[]:je(n,Lf(n))},Fr.groupBy=mo,Fr.initial=function(n){return(null==n?0:n.length)?uu(n,0,-1):[]},Fr.intersection=Vi,Fr.intersectionBy=Gi,Fr.intersectionWith=Hi,Fr.invert=Ef,Fr.invertBy=Sf,Fr.invokeMap=xo,Fr.iteratee=oa,Fr.keyBy=jo,Fr.keys=Wf,Fr.keysIn=Lf,Fr.map=Ao,Fr.mapKeys=function(n,t){var r={};return t=ci(t,3),me(n,function(n,e,u){oe(r,t(n,e,u),n)}),r},Fr.mapValues=function(n,t){var r={};return t=ci(t,3),me(n,function(n,e,u){oe(r,e,t(n,e,u))}),r},Fr.matches=function(n){return Fe(ce(n,1))},Fr.matchesProperty=function(n,t){return Ne(n,ce(t,1))},Fr.memoize=Uo,Fr.merge=Uf,Fr.mergeWith=Bf,Fr.method=fa,Fr.methodOf=aa,Fr.mixin=ca,Fr.negate=Bo,Fr.nthArg=function(n){return n=gf(n),Ye(function(t){return qe(t,n)})},Fr.omit=Tf,Fr.omitBy=function(n,t){return Df(n,Bo(ci(t)))},Fr.once=function(n){return zo(2,n)},Fr.orderBy=function(n,t,r,e){return null==n?[]:(Zo(t)||(t=null==t?[]:[t]),Zo(r=e?u:r)||(r=null==r?[]:[r]),Ze(n,t,r))},Fr.over=sa,Fr.overArgs=To,Fr.overEvery=ha,Fr.overSome=pa,Fr.partial=$o,Fr.partialRight=Do,Fr.partition=ko,Fr.pick=$f,Fr.pickBy=Df,Fr.property=va,Fr.propertyOf=function(n){return function(t){return null==n?u:Ae(n,t)}},Fr.pull=Yi,Fr.pullAll=Qi,Fr.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Ve(n,t,ci(r,2)):n},Fr.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Ve(n,t,u,r):n},Fr.pullAt=Xi,Fr.range=_a,Fr.rangeRight=ga,Fr.rearg=Mo,Fr.reject=function(n,t){return(Zo(n)?Wt:ye)(n,Bo(ci(t,3)))},Fr.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ci(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return Ge(n,u),r},Fr.rest=function(n,t){if("function"!=typeof n)throw new Sn(i);return Ye(n,t=t===u?t:gf(t))},Fr.reverse=no,Fr.sampleSize=function(n,t,r){return t=(r?wi(n,t,r):t===u)?1:gf(t),(Zo(n)?Xr:Xe)(n,t)},Fr.set=function(n,t,r){return null==n?n:nu(n,t,r)},Fr.setWith=function(n,t,r,e){return e="function"==typeof e?e:u,null==n?n:nu(n,t,r,e)},Fr.shuffle=function(n){return(Zo(n)?ne:eu)(n)},Fr.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&wi(n,t,r)?(t=0,r=e):(t=null==t?0:gf(t),r=r===u?e:gf(r)),uu(n,t,r)):[]},Fr.sortBy=Oo,Fr.sortedUniq=function(n){return n&&n.length?au(n):[]},Fr.sortedUniqBy=function(n,t){return n&&n.length?au(n,ci(t,2)):[]},Fr.split=function(n,t,r){return r&&"number"!=typeof r&&wi(n,t,r)&&(t=r=u),(r=r===u?g:r>>>0)?(n=wf(n))&&("string"==typeof t||null!=t&&!ff(t))&&!(t=lu(t))&&ar(n)?xu(_r(n),0,r):n.split(t,r):[]},Fr.spread=function(n,t){if("function"!=typeof n)throw new Sn(i);return t=null==t?0:br(gf(t),0),Ye(function(r){var e=r[t],u=xu(r,0,t);return e&&Tt(u,e),Rt(n,this,u)})},Fr.tail=function(n){var t=null==n?0:n.length;return t?uu(n,1,t):[]},Fr.take=function(n,t,r){return n&&n.length?uu(n,0,(t=r||t===u?1:gf(t))<0?0:t):[]},Fr.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?uu(n,(t=e-(t=r||t===u?1:gf(t)))<0?0:t,e):[]},Fr.takeRightWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!1,!0):[]},Fr.takeWhile=function(n,t){return n&&n.length?vu(n,ci(t,3)):[]},Fr.tap=function(n,t){return t(n),n},Fr.throttle=function(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new Sn(i);return tf(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Co(n,t,{leading:e,maxWait:t,trailing:u})},Fr.thru=po,Fr.toArray=vf,Fr.toPairs=Mf,Fr.toPairsIn=Ff,Fr.toPath=function(n){return Zo(n)?Bt(n,Ti):lf(n)?[n]:Eu(Bi(wf(n)))},Fr.toPlainObject=bf,Fr.transform=function(n,t,r){var e=Zo(n),u=e||Ho(n)||sf(n);if(t=ci(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:tf(n)&&Qo(i)?Nr(Gn(n)):{}}return(u?Et:me)(n,function(n,e,u){return t(r,n,e,u)}),r},Fr.unary=function(n){return Ro(n,1)},Fr.union=to,Fr.unionBy=ro,Fr.unionWith=eo,Fr.uniq=function(n){return n&&n.length?su(n):[]},Fr.uniqBy=function(n,t){return n&&n.length?su(n,ci(t,2)):[]},Fr.uniqWith=function(n,t){return t="function"==typeof t?t:u,n&&n.length?su(n,u,t):[]},Fr.unset=function(n,t){return null==n||hu(n,t)},Fr.unzip=uo,Fr.unzipWith=io,Fr.update=function(n,t,r){return null==n?n:pu(n,t,bu(r))},Fr.updateWith=function(n,t,r,e){return e="function"==typeof e?e:u,null==n?n:pu(n,t,bu(r),e)},Fr.values=Nf,Fr.valuesIn=function(n){return null==n?[]:tr(n,Lf(n))},Fr.without=oo,Fr.words=Xf,Fr.wrap=function(n,t){return $o(bu(t),n)},Fr.xor=fo,Fr.xorBy=ao,Fr.xorWith=co,Fr.zip=lo,Fr.zipObject=function(n,t){return yu(n||[],t||[],re)},Fr.zipObjectDeep=function(n,t){return yu(n||[],t||[],nu)},Fr.zipWith=so,Fr.entries=Mf,Fr.entriesIn=Ff,Fr.extend=xf,Fr.extendWith=jf,ca(Fr,Fr),Fr.add=ba,Fr.attempt=na,Fr.camelCase=Pf,Fr.capitalize=qf,Fr.ceil=wa,Fr.clamp=function(n,t,r){return r===u&&(r=t,t=u),r!==u&&(r=(r=df(r))==r?r:0),t!==u&&(t=(t=df(t))==t?t:0),ae(df(n),t,r)},Fr.clone=function(n){return ce(n,4)},Fr.cloneDeep=function(n){return ce(n,5)},Fr.cloneDeepWith=function(n,t){return ce(n,5,t="function"==typeof t?t:u)},Fr.cloneWith=function(n,t){return ce(n,4,t="function"==typeof t?t:u)},Fr.conformsTo=function(n,t){return null==t||le(n,t,Wf(t))},Fr.deburr=Zf,Fr.defaultTo=function(n,t){return null==n||n!=n?t:n},Fr.divide=ma,Fr.endsWith=function(n,t,r){n=wf(n),t=lu(t);var e=n.length,i=r=r===u?e:ae(gf(r),0,e);return(r-=t.length)>=0&&n.slice(r,i)==t},Fr.eq=Fo,Fr.escape=function(n){return(n=wf(n))&&Y.test(n)?n.replace(H,or):n},Fr.escapeRegExp=function(n){return(n=wf(n))&&on.test(n)?n.replace(un,"\\$&"):n},Fr.every=function(n,t,r){var e=Zo(n)?Ct:_e;return r&&wi(n,t,r)&&(t=u),e(n,ci(t,3))},Fr.find=go,Fr.findIndex=Pi,Fr.findKey=function(n,t){return Nt(n,ci(t,3),me)},Fr.findLast=yo,Fr.findLastIndex=qi,Fr.findLastKey=function(n,t){return Nt(n,ci(t,3),xe)},Fr.floor=xa,Fr.forEach=bo,Fr.forEachRight=wo,Fr.forIn=function(n,t){return null==n?n:be(n,ci(t,3),Lf)},Fr.forInRight=function(n,t){return null==n?n:we(n,ci(t,3),Lf)},Fr.forOwn=function(n,t){return n&&me(n,ci(t,3))},Fr.forOwnRight=function(n,t){return n&&xe(n,ci(t,3))},Fr.get=Rf,Fr.gt=No,Fr.gte=Po,Fr.has=function(n,t){return null!=n&&gi(n,t,Re)},Fr.hasIn=zf,Fr.head=Ki,Fr.identity=ia,Fr.includes=function(n,t,r,e){n=Vo(n)?n:Nf(n),r=r&&!e?gf(r):0;var u=n.length;return r<0&&(r=br(u+r,0)),cf(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&qt(n,t,r)>-1},Fr.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:gf(r);return u<0&&(u=br(e+u,0)),qt(n,t,u)},Fr.inRange=function(n,t,r){return t=_f(t),r===u?(r=t,t=0):r=_f(r),function(n,t,r){return n>=wr(t,r)&&n<br(t,r)}(n=df(n),t,r)},Fr.invoke=Cf,Fr.isArguments=qo,Fr.isArray=Zo,Fr.isArrayBuffer=Ko,Fr.isArrayLike=Vo,Fr.isArrayLikeObject=Go,Fr.isBoolean=function(n){return!0===n||!1===n||rf(n)&&Oe(n)==w},Fr.isBuffer=Ho,Fr.isDate=Jo,Fr.isElement=function(n){return rf(n)&&1===n.nodeType&&!of(n)},Fr.isEmpty=function(n){if(null==n)return!0;if(Vo(n)&&(Zo(n)||"string"==typeof n||"function"==typeof n.splice||Ho(n)||sf(n)||qo(n)))return!n.length;var t=_i(n);if(t==k||t==E)return!n.size;if(Ai(n))return!Te(n).length;for(var r in n)if(Tn.call(n,r))return!1;return!0},Fr.isEqual=function(n,t){return We(n,t)},Fr.isEqualWith=function(n,t,r){var e=(r="function"==typeof r?r:u)?r(n,t):u;return e===u?We(n,t,u,r):!!e},Fr.isError=Yo,Fr.isFinite=function(n){return"number"==typeof n&&mt(n)},Fr.isFunction=Qo,Fr.isInteger=Xo,Fr.isLength=nf,Fr.isMap=ef,Fr.isMatch=function(n,t){return n===t||Le(n,t,si(t))},Fr.isMatchWith=function(n,t,r){return r="function"==typeof r?r:u,Le(n,t,si(t),r)},Fr.isNaN=function(n){return uf(n)&&n!=+n},Fr.isNative=function(n){if(ji(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ue(n)},Fr.isNil=function(n){return null==n},Fr.isNull=function(n){return null===n},Fr.isNumber=uf,Fr.isObject=tf,Fr.isObjectLike=rf,Fr.isPlainObject=of,Fr.isRegExp=ff,Fr.isSafeInteger=function(n){return Xo(n)&&n>=-9007199254740991&&n<=v},Fr.isSet=af,Fr.isString=cf,Fr.isSymbol=lf,Fr.isTypedArray=sf,Fr.isUndefined=function(n){return n===u},Fr.isWeakMap=function(n){return rf(n)&&_i(n)==W},Fr.isWeakSet=function(n){return rf(n)&&"[object WeakSet]"==Oe(n)},Fr.join=function(n,t){return null==n?"":Ft.call(n,t)},Fr.kebabCase=Kf,Fr.last=Ji,Fr.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var i=e;return r!==u&&(i=(i=gf(r))<0?br(e+i,0):wr(i,e-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,i):Pt(n,Kt,i,!0)},Fr.lowerCase=Vf,Fr.lowerFirst=Gf,Fr.lt=hf,Fr.lte=pf,Fr.max=function(n){return n&&n.length?ge(n,ia,Ie):u},Fr.maxBy=function(n,t){return n&&n.length?ge(n,ci(t,2),Ie):u},Fr.mean=function(n){return Vt(n,ia)},Fr.meanBy=function(n,t){return Vt(n,ci(t,2))},Fr.min=function(n){return n&&n.length?ge(n,ia,De):u},Fr.minBy=function(n,t){return n&&n.length?ge(n,ci(t,2),De):u},Fr.stubArray=ya,Fr.stubFalse=da,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Aa,Fr.nth=function(n,t){return n&&n.length?qe(n,gf(t)):u},Fr.noConflict=function(){return gt._===this&&(gt._=Nn),this},Fr.noop=la,Fr.now=Io,Fr.pad=function(n,t,r){n=wf(n);var e=(t=gf(t))?vr(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Zu(yt(u),r)+n+Zu(_t(u),r)},Fr.padEnd=function(n,t,r){n=wf(n);var e=(t=gf(t))?vr(n):0;return t&&e<t?n+Zu(t-e,r):n},Fr.padStart=function(n,t,r){n=wf(n);var e=(t=gf(t))?vr(n):0;return t&&e<t?Zu(t-e,r)+n:n},Fr.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),xr(wf(n).replace(fn,""),t||0)},Fr.random=function(n,t,r){if(r&&"boolean"!=typeof r&&wi(n,t,r)&&(t=r=u),r===u&&("boolean"==typeof t?(r=t,t=u):"boolean"==typeof n&&(r=n,n=u)),n===u&&t===u?(n=0,t=1):(n=_f(n),t===u?(t=n,n=0):t=_f(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var i=jr();return wr(n+i*(t-n+ht("1e-"+((i+"").length-1))),t)}return He(n,t)},Fr.reduce=function(n,t,r){var e=Zo(n)?$t:Jt,u=arguments.length<3;return e(n,ci(t,4),r,u,pe)},Fr.reduceRight=function(n,t,r){var e=Zo(n)?Dt:Jt,u=arguments.length<3;return e(n,ci(t,4),r,u,ve)},Fr.repeat=function(n,t,r){return t=(r?wi(n,t,r):t===u)?1:gf(t),Je(wf(n),t)},Fr.replace=function(){var n=arguments,t=wf(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Fr.result=function(n,t,r){var e=-1,i=(t=wu(t,n)).length;for(i||(i=1,n=u);++e<i;){var o=null==n?u:n[Ti(t[e])];o===u&&(e=i,o=r),n=Qo(o)?o.call(n):o}return n},Fr.round=ka,Fr.runInContext=n,Fr.sample=function(n){return(Zo(n)?Qr:Qe)(n)},Fr.size=function(n){if(null==n)return 0;if(Vo(n))return cf(n)?vr(n):n.length;var t=_i(n);return t==k||t==E?n.size:Te(n).length},Fr.snakeCase=Hf,Fr.some=function(n,t,r){var e=Zo(n)?Mt:iu;return r&&wi(n,t,r)&&(t=u),e(n,ci(t,3))},Fr.sortedIndex=function(n,t){return ou(n,t)},Fr.sortedIndexBy=function(n,t,r){return fu(n,t,ci(r,2))},Fr.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=ou(n,t);if(e<r&&Fo(n[e],t))return e}return-1},Fr.sortedLastIndex=function(n,t){return ou(n,t,!0)},Fr.sortedLastIndexBy=function(n,t,r){return fu(n,t,ci(r,2),!0)},Fr.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=ou(n,t,!0)-1;if(Fo(n[r],t))return r}return-1},Fr.startCase=Jf,Fr.startsWith=function(n,t,r){return n=wf(n),r=null==r?0:ae(gf(r),0,n.length),t=lu(t),n.slice(r,r+t.length)==t},Fr.subtract=Oa,Fr.sum=function(n){return n&&n.length?Yt(n,ia):0},Fr.sumBy=function(n,t){return n&&n.length?Yt(n,ci(t,2)):0},Fr.template=function(n,t,r){var e=Fr.templateSettings;r&&wi(n,t,r)&&(t=u),n=wf(n),t=jf({},t,e,Xu);var i,o,f=jf({},t.imports,e.imports,Xu),a=Wf(f),c=tr(f,a),l=0,s=t.interpolate||jn,h="__p += '",p=zn((t.escape||jn).source+"|"+s.source+"|"+(s===nn?_n:jn).source+"|"+(t.evaluate||jn).source+"|$","g"),v="//# sourceURL="+(Tn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";n.replace(p,function(t,r,e,u,f,a){return e||(e=u),h+=n.slice(l,a).replace(An,fr),r&&(i=!0,h+="' +\n__e("+r+") +\n'"),f&&(o=!0,h+="';\n"+f+";\n__p += '"),e&&(h+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),l=a+t.length,t}),h+="';\n";var _=Tn.call(t,"variable")&&t.variable;if(_){if(pn.test(_))throw new kn("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(Z,""):h).replace(K,"$1").replace(V,"$1;"),h="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=na(function(){return On(a,v+"return "+h).apply(u,c)});if(g.source=h,Yo(g))throw g;return g},Fr.times=function(n,t){if((n=gf(n))<1||n>v)return[];var r=g,e=wr(n,g);t=ci(t),n-=g;for(var u=Qt(e,t);++r<n;)t(r);return u},Fr.toFinite=_f,Fr.toInteger=gf,Fr.toLength=yf,Fr.toLower=function(n){return wf(n).toLowerCase()},Fr.toNumber=df,Fr.toSafeInteger=function(n){return n?ae(gf(n),-9007199254740991,v):0===n?n:0},Fr.toString=wf,Fr.toUpper=function(n){return wf(n).toUpperCase()},Fr.trim=function(n,t,r){if((n=wf(n))&&(r||t===u))return Xt(n);if(!n||!(t=lu(t)))return n;var e=_r(n),i=_r(t);return xu(e,er(e,i),ur(e,i)+1).join("")},Fr.trimEnd=function(n,t,r){if((n=wf(n))&&(r||t===u))return n.slice(0,gr(n)+1);if(!n||!(t=lu(t)))return n;var e=_r(n);return xu(e,0,ur(e,_r(t))+1).join("")},Fr.trimStart=function(n,t,r){if((n=wf(n))&&(r||t===u))return n.replace(fn,"");if(!n||!(t=lu(t)))return n;var e=_r(n);return xu(e,er(e,_r(t))).join("")},Fr.truncate=function(n,t){var r=30,e="...";if(tf(t)){var i="separator"in t?t.separator:i;r="length"in t?gf(t.length):r,e="omission"in t?lu(t.omission):e}var o=(n=wf(n)).length;if(ar(n)){var f=_r(n);o=f.length}if(r>=o)return n;var a=r-vr(e);if(a<1)return e;var c=f?xu(f,0,a).join(""):n.slice(0,a);if(i===u)return c+e;if(f&&(a+=c.length-a),ff(i)){if(n.slice(a).search(i)){var l,s=c;for(i.global||(i=zn(i.source,wf(gn.exec(i))+"g")),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===u?a:h)}}else if(n.indexOf(lu(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+e},Fr.unescape=function(n){return(n=wf(n))&&J.test(n)?n.replace(G,yr):n},Fr.uniqueId=function(n){var t=++$n;return wf(n)+t},Fr.upperCase=Yf,Fr.upperFirst=Qf,Fr.each=bo,Fr.eachRight=wo,Fr.first=Ki,ca(Fr,(ja={},me(Fr,function(n,t){Tn.call(Fr.prototype,t)||(ja[t]=n)}),ja),{chain:!1}),Fr.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Fr[n].placeholder=Fr}),Et(["drop","take"],function(n,t){Zr.prototype[n]=function(r){r=r===u?1:br(gf(r),0);var e=this.__filtered__&&!t?new Zr(this):this.clone();return e.__filtered__?e.__takeCount__=wr(r,e.__takeCount__):e.__views__.push({size:wr(r,g),type:n+(e.__dir__<0?"Right":"")}),e},Zr.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Et(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Zr.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ci(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),Et(["head","last"],function(n,t){var r="take"+(t?"Right":"");Zr.prototype[n]=function(){return this[r](1).value()[0]}}),Et(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Zr.prototype[n]=function(){return this.__filtered__?new Zr(this):this[r](1)}}),Zr.prototype.compact=function(){return this.filter(ia)},Zr.prototype.find=function(n){return this.filter(n).head()},Zr.prototype.findLast=function(n){return this.reverse().find(n)},Zr.prototype.invokeMap=Ye(function(n,t){return"function"==typeof n?new Zr(this):this.map(function(r){return Se(r,n,t)})}),Zr.prototype.reject=function(n){return this.filter(Bo(ci(n)))},Zr.prototype.slice=function(n,t){n=gf(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Zr(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==u&&(r=(t=gf(t))<0?r.dropRight(-t):r.take(t-n)),r)},Zr.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Zr.prototype.toArray=function(){return this.take(g)},me(Zr.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),i=Fr[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);i&&(Fr.prototype[t]=function(){var t=this.__wrapped__,f=e?[1]:arguments,a=t instanceof Zr,c=f[0],l=a||Zo(t),s=function(n){var t=i.apply(Fr,Tt([n],f));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(a=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=a&&!p;if(!o&&l){t=_?t:new Zr(this);var g=n.apply(t,f);return g.__actions__.push({func:po,args:[s],thisArg:u}),new qr(g,h)}return v&&_?n.apply(this,f):(g=this.thru(s),v?e?g.value()[0]:g.value():g)})}),Et(["pop","push","shift","sort","splice","unshift"],function(n){var t=Cn[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Fr.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Zo(u)?u:[],n)}return this[r](function(r){return t.apply(Zo(r)?r:[],n)})}}),me(Zr.prototype,function(n,t){var r=Fr[t];if(r){var e=r.name+"";Tn.call(Cr,e)||(Cr[e]=[]),Cr[e].push({name:t,func:r})}}),Cr[Fu(u,2).name]=[{name:"wrapper",func:u}],Zr.prototype.clone=function(){var n=new Zr(this.__wrapped__);return n.__actions__=Eu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Eu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Eu(this.__views__),n},Zr.prototype.reverse=function(){if(this.__filtered__){var n=new Zr(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Zr.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Zo(n),e=t<0,u=r?n.length:0,i=function(n,t,r){var e=-1,u=r.length;for(;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=wr(t,n+o);break;case"takeRight":n=br(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,a=f-o,c=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=wr(a,this.__takeCount__);if(!r||!e&&u==a&&p==a)return _u(n,this.__actions__);var v=[];n:for(;a--&&h<p;){for(var _=-1,g=n[c+=t];++_<s;){var y=l[_],d=y.iteratee,b=y.type,w=d(g);if(2==b)g=w;else if(!w){if(1==b)continue n;break n}}v[h++]=g}return v},Fr.prototype.at=vo,Fr.prototype.chain=function(){return ho(this)},Fr.prototype.commit=function(){return new qr(this.value(),this.__chain__)},Fr.prototype.next=function(){this.__values__===u&&(this.__values__=vf(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?u:this.__values__[this.__index__++]}},Fr.prototype.plant=function(n){for(var t,r=this;r instanceof Pr;){var e=Di(r);e.__index__=0,e.__values__=u,t?i.__wrapped__=e:t=e;var i=e;r=r.__wrapped__}return i.__wrapped__=n,t},Fr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Zr){var t=n;return this.__actions__.length&&(t=new Zr(this)),(t=t.reverse()).__actions__.push({func:po,args:[no],thisArg:u}),new qr(t,this.__chain__)}return this.thru(no)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return _u(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,Xn&&(Fr.prototype[Xn]=function(){return this}),Fr}();gt._=dr,(e=function(){return dr}.call(t,r,t,n))===u||(n.exports=e)}.call(this)}}]);
|