diff --git a/applicationFE/scripts/test-ingress-preflight.mjs b/applicationFE/scripts/test-ingress-preflight.mjs index 21ddf37..fdee032 100644 --- a/applicationFE/scripts/test-ingress-preflight.mjs +++ b/applicationFE/scripts/test-ingress-preflight.mjs @@ -176,7 +176,7 @@ assert.match(between('const runInstall =', 'const buildIngressPayload ='), /spec for (const provider of ['ibm', 'IBM', 'ibm-jp-osa', 'ibmcloud', 'ibm-vpc', 'aws', 'tencent']) { await test(`provider ${provider} selects its effective Ingress class`, async () => { const h = harness({ provider }); await h.specCheck() - assert.equal(h.calls[0][1].ingressClass, provider.toLowerCase().startsWith('ibm') ? 'public-iks-k8s-nginx' : 'nginx') + assert.equal(h.calls[0][1].ingressClass, 'nginx') assert.equal(h.ingressData.value.ingressClass, 'nginx', 'catalog defaults remain unchanged') if (provider.toLowerCase().startsWith('ibm')) { h.ingressData.value.ingressTlsEnabled = false @@ -191,7 +191,7 @@ const statusSource = await readFile(new URL('../src/views/softwareCatalog/compon const endpointSource = statusSource.slice(statusSource.indexOf('const getEndpoint ='), statusSource.indexOf('const displayValue =')) const getEndpoint = new Function(ts.transpileModule(endpointSource + '\nreturn getEndpoint', { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText)() await test('IBM endpoint uses Ingress Host and scheme, not the worker IP or backend port', async () => { - for (const ingressClass of ['public-iks-k8s-nginx', 'private-iks-k8s-nginx']) { + for (const ingressClass of ['public-iks-k8s-nginx', 'private-iks-k8s-nginx', 'public-iks-traefik', 'private-iks-traefik']) { for (const ingressTlsEnabled of [false, true]) { assert.equal(getEndpoint({ ingressEnabled: true, ingressClass, ingressTlsEnabled, ingressHost: 'app.example.com', ingressPath: '/test' }, { publicIp: '10.150.0.8', servicePort: 3000 }), `${ingressTlsEnabled ? 'https' : 'http'}://app.example.com/test`) diff --git a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue index 8e08ec9..c7f87b3 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue @@ -713,7 +713,7 @@ type="text" class="form-control" placeholder="nginx" - :value="effectiveIngressClass" + :value="isIbmCluster ? 'IBM managed (auto: NGINX / Traefik)' : effectiveIngressClass" disabled> @@ -2272,7 +2272,7 @@ const selectedClusterProvider = computed(() => { const isIbmCluster = computed(() => /^(ibm|ibmcloud|ibm-cloud|ibm-vpc|ibmvpc)(-|$)/i.test(selectedClusterProvider.value)) const isNhnCluster = computed(() => selectedClusterProvider.value === 'nhn') -const effectiveIngressClass = computed(() => isIbmCluster.value ? 'public-iks-k8s-nginx' : 'nginx') +const effectiveIngressClass = computed(() => 'nginx') const selectedVmProvider = computed(() => { const selectedVmId = selectedVmList.value[0] diff --git a/applicationFE/src/views/softwareCatalog/components/softwareCatalogList.vue b/applicationFE/src/views/softwareCatalog/components/softwareCatalogList.vue index 8a7fc98..9229611 100644 --- a/applicationFE/src/views/softwareCatalog/components/softwareCatalogList.vue +++ b/applicationFE/src/views/softwareCatalog/components/softwareCatalogList.vue @@ -524,7 +524,7 @@ const getEndpoint = (history: any, status: any) => { const ingressHost = history?.ingressHost const ingressPath = history?.ingressPath - if (history?.ingressEnabled && ['public-iks-k8s-nginx', 'private-iks-k8s-nginx'].includes(history?.ingressClass) && ingressHost) { + if (history?.ingressEnabled && ['public-iks-k8s-nginx', 'private-iks-k8s-nginx', 'public-iks-traefik', 'private-iks-traefik'].includes(history?.ingressClass) && ingressHost) { return `${history?.ingressTlsEnabled ? 'https' : 'http'}://${ingressHost}${ingressPath || '/'}` } if (history?.releaseName?.startsWith('mcmp-jupyter-') && ingressHost) { diff --git a/doc/examples/ibm-ingress-automation/docker-compose.ibm-openbao.yaml b/doc/examples/ibm-ingress-automation/docker-compose.ibm-openbao.yaml new file mode 100644 index 0000000..f17a738 --- /dev/null +++ b/doc/examples/ibm-ingress-automation/docker-compose.ibm-openbao.yaml @@ -0,0 +1,25 @@ +# Merge with the environment's AM/mc-admin-cli Compose file. +# Use an AM image built from the source that includes IBM Traefik and OpenBao support. +services: + mc-application-manager: + environment: + IBM_INGRESS_OPEN_BAO_URL: ${IBM_INGRESS_OPEN_BAO_URL:-http://mc-infra-manager-openbao:8200} + IBM_INGRESS_OPEN_BAO_TOKEN_FILE: /run/secrets/am-ibm-openbao-token + IBM_INGRESS_NAMESPACE: ${IBM_INGRESS_NAMESPACE:-default} + IBM_INGRESS_CONNECTION_NAME: ${IBM_INGRESS_CONNECTION_NAME:-ibm-jp-tok} + IBM_INGRESS_REGION: ${IBM_INGRESS_REGION:-jp-tok} + IBM_INGRESS_SECRET_PATH: ${IBM_INGRESS_SECRET_PATH:-secret/data/csp/ibm} + IBM_INGRESS_ALLOW_SHARED_LB_CHANGES: ${IBM_INGRESS_ALLOW_SHARED_LB_CHANGES:-true} + volumes: + - type: bind + source: ${IBM_INGRESS_OPEN_BAO_TOKEN_HOST_FILE:?Set the absolute scoped IBM OpenBao token file} + target: /run/secrets/am-ibm-openbao-token + read_only: true + bind: + create_host_path: false + networks: + ibm-openbao: {} +networks: + ibm-openbao: + external: true + name: ${IBM_INGRESS_OPEN_BAO_NETWORK:?Set the existing OpenBao Docker network name} diff --git a/doc/ibm-ingress-automation.md b/doc/ibm-ingress-automation.md index aa87352..6c3202c 100644 --- a/doc/ibm-ingress-automation.md +++ b/doc/ibm-ingress-automation.md @@ -1,12 +1,46 @@ # IBM Ingress 및 자체 도메인 인증서 자동 준비 -> 현재 HTTP 경로는 문서 하단 **2026-09-11: hosts 파일 기반 HTTP 배포**를 따릅니다. 아래 IBM API 키/프로필 및 인증서 준비 항목은 기존 HTTPS 자동화 경로에만 해당하며, HTTP 배포에는 필요하지 않습니다. +> 2026-10-15: IBM 관리형 NGINX와 Traefik을 모두 지원합니다. Traefik은 HTTP 배포도 IBM 공식 API를 통한 PROXY protocol 준비가 필요합니다. 아래 OpenBao 연결을 구성하면 AM이 Deploy 준비 단계에서 자동 활성화합니다. 문서 하단의 2026-09-11 검증 기록은 당시 NGINX 환경의 기록입니다. + +## OpenBao를 사용하는 HTTP 자동 준비 (환경 공통) + +공통 `application.yaml`의 `app.ibm-ingress.automation`을 사용합니다. AM은 선택한 클러스터의 실제 ID와 connectionName을 Tumblebug에서 조회하며 특정 서버나 클러스터 ID를 사용하지 않습니다. 일치하는 Project/connection 프로필의 `allow-shared-lb-changes=true`이면 필요한 PROXY protocol을 자동 활성화하고 실제 Controller/Service 준비 후 앱을 배포합니다. 이미 준비된 클러스터에는 같은 변경을 반복하지 않습니다. Spec Check는 변경 없이 검사만 합니다. + +IBM 키 원문은 OpenBao의 `IC_API_KEY`에서 읽어 메모리에서만 사용합니다. AM 서버 파일이나 배포 요청에 IBM 키를 넣지 않습니다. OpenBao용 읽기 토큰은 별도로 필요하며 AM이 관리자 토큰으로 자기 권한을 발급하지는 않습니다. + +다른 환경도 다음 최초 연결을 설정해야 합니다. 소스/이미지만 교체하고 인증 연결을 생략하면 자동 준비는 동작하지 않습니다. + +1. 해당 환경의 OpenBao에 IBM 자격증명이 등록되어 있어야 합니다. +2. `secret/data/csp/ibm` 읽기만 허용하는 토큰 파일을 준비합니다. 30일 토큰이면 만료 전에 새 토큰으로 교체합니다. 토큰 파일은 Git 밖의 절대 경로, 소유자 전용 권한으로 관리합니다. +3. [docker-compose.ibm-openbao.yaml](examples/ibm-ingress-automation/docker-compose.ibm-openbao.yaml)을 기존 Compose 파일에 추가합니다. 이 파일은 원래 AM 네트워크를 유지하며 OpenBao 네트워크와 토큰 읽기 전용 마운트를 추가합니다. +4. 환경변수에 실제 Project/connection/region 및 OpenBao 주소·네트워크·토큰 파일 경로를 지정하고 최신 AM 이미지를 사용해 AM만 다시 생성합니다. + +| 환경변수 | 기본값 / 의미 | +| --- | --- | +| `IBM_INGRESS_NAMESPACE` | `default` — Tumblebug Project namespace | +| `IBM_INGRESS_CONNECTION_NAME` | `ibm-jp-tok` — 등록된 IBM connectionName | +| `IBM_INGRESS_REGION` | `jp-tok` | +| `IBM_INGRESS_ALLOW_SHARED_LB_CHANGES` | `true` — 자동 PROXY 변경 허용; `false`로 끄기 | +| `IBM_INGRESS_SECRET_PATH` | `secret/data/csp/ibm` — 해당 환경의 등록 IBM 자격증명 | +| `IBM_INGRESS_OPEN_BAO_URL` | `http://mc-infra-manager-openbao:8200` | +| `IBM_INGRESS_OPEN_BAO_NETWORK` | OpenBao가 연결된 실제 Docker 네트워크 이름; override 사용 시 필수 | +| `IBM_INGRESS_OPEN_BAO_TOKEN_HOST_FILE` | 읽기 전용 토큰 파일의 호스트 절대 경로; override 사용 시 필수 | + +예를 들어 Compose project 이름이 `mcc`이면 OpenBao 네트워크는 `mcc_mc-infra-manager-network`일 수 있습니다. 다른 환경에서는 실제 이름을 사용합니다. 여러 Project/connection에는 추가 Spring 설정 파일의 `profiles` 배열로 각각의 namespace, connection-name, region, secret-path, allow-shared-lb-changes를 지정합니다. 프로필은 정확히 일치해야 하며 자격증명을 다른 연결에 자동으로 공유하지 않습니다. + +```bash +docker compose -f /absolute/path/docker-compose.yaml \ + -f /absolute/path/docker-compose.ibm-openbao.yaml \ + up -d --no-deps mc-application-manager +``` + +실제 IBM 계정에는 클러스터 조회, 해당 리전의 LB/서브넷 조회와 Ingress LB 설정 변경 권한이 있어야 합니다. 준비 시 공유 LB가 재구성되어 기존 연결이 잠시 끊길 수 있습니다. HTTP 배포에는 인증서나 cert-manager 설정은 필요하지 않습니다. NGINX의 기존 Kubernetes 기반 HTTP 준비와 명시적 `api-key-file` 방식도 유지합니다. ## 적용 범위 SW Catalog의 Deploy에서 **선택한 Project/클러스터와 입력한 Host**를 사용한다. 특정 IBM 클러스터 ID나 도메인을 코드에 고정하지 않는다. 실제 CSP ID와 connectionName은 -Tumblebug에서 조회하며, IBM VPC Kubernetes의 관리형 NGINX ALB를 대상으로 한다. +Tumblebug에서 조회하며, IBM VPC Kubernetes의 관리형 NGINX 또는 Traefik ALB를 대상으로 한다. AWS 등 다른 CSP의 기존 배포 흐름에는 이 자동화가 개입하지 않는다. 기능 구현은 끝났지만 운영 계정/DNS 권한이 자동으로 생기지는 않는다. 관리자가 AM 서버에 @@ -119,9 +153,13 @@ bash ./gradlew bootJar -PincludeFrontend ## 재시도·중단·수명 +- PROXY 요청 기록은 `SUBMITTED` → `ACCEPTED`로 갱신됩니다. IBM이 HTTP 400/401/403/404/405/406/415/422로 명확히 거절하면 `REJECTED`와 안전한 HTTP 상태/오류 코드가 저장되고, 다음 Deploy에서 실제 IBM 상태·LB 준비·서브넷을 다시 검사한 뒤 재시도합니다. 응답 본문이나 인증정보는 기록하지 않습니다. +- 타임아웃, 408/409/429/5xx 또는 요청 결과를 확인할 수 없는 오류는 `UNKNOWN`으로 남기며 자동 재전송하지 않습니다. 이전 버전의 `SUBMITTED` 기록도 같은 보호 대상입니다. 코드 재배포만으로 이런 기록을 삭제하거나 성공으로 바꾸지 않습니다. +- 운영자가 기존 요청이 반영되지 않았고 진행 중인 LB 작업/AM 잠금이 없음을 확인한 경우에만, 해당 클러스터의 AM 소유 `am-ibm-proxy-intent`를 백업하고 `state=OPERATOR_REVIEWED_RETRY`로 갱신할 수 있습니다. 이후 사용자의 Deploy가 잠금을 획득하고 다시 확인한 뒤 한 번 요청합니다. 이전 요청 시각·상태·오류는 새 기록에 남습니다. `proxyProtocol=false` 조회 한 번만으로 결과 불명확 기록을 지우지 않습니다. + - 동일 클러스터의 같은 준비 요청은 실행 중 job ID를 재사용한다. 다른 설정은 중복 실행을 거부한다. AM 내부 작업자 2개/대기 4개, 클러스터 ConfigMap 잠금으로 공유 변경을 직렬화한다. -- IBM PATCH 전에 변경 의도를 영속 기록한다. 응답 유실/실패 뒤 IBM 설정이 여전히 false이면 +- IBM PATCH 전에 변경 의도를 영속 기록한다. 응답 유실/결과 불명확 오류 뒤 IBM 설정이 여전히 false이면 자동 재전송하지 않는다. 운영자가 실제 IBM 작업 결과를 확인한 뒤에만 `kube-system/am-ibm-proxy-intent` 재시도 여부를 판단한다. 무조건 삭제해서 우회하면 안 된다. - 잠금은 정상 종료 시 해당 작업의 것만 해제한다. 프로세스 비정상 종료 시 최대 3.5시간 만료를 기다리거나, diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java index 0023fa8..0b11c0b 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmChartService.java @@ -83,7 +83,7 @@ public Release deployHelmChart(KubernetesClient client, String namespace, Softwa try { // 1. 클러스터 정보 조회 K8sClusterDto clusterDto = cbtumblebugRestApi.getK8sClusterByName(namespace, clusterName); - config = IbmIngressSupport.resolve(clusterDto, config); + config = IbmIngressSupport.resolveAvailable(client, IbmIngressSupport.resolve(clusterDto, config)); config = IbmIngressTlsResolver.resolve(client, KubernetesNamespaces.APPLICATION_WORKLOAD, config); String kubeconfigYaml = kubeconfigResolver.getKubeconfigYaml(namespace, clusterName); @@ -289,6 +289,8 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp Path tempKubeconfigPath = null; Path tempValuesPath = null; Path tempChartPath = null; + io.fabric8.kubernetes.api.model.GenericKubernetesResource traefikPolicy = null; + boolean installed = false; try { // 1. 클러스터 정보 조회 @@ -296,7 +298,7 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp if (clusterDto == null) { throw new RuntimeException("K8s cluster not found: " + clusterName); } - config = IbmIngressSupport.resolve(clusterDto, config); + config = IbmIngressSupport.resolveAvailable(client, IbmIngressSupport.resolve(clusterDto, config)); config = IbmIngressTlsResolver.resolve(client, KubernetesNamespaces.APPLICATION_WORKLOAD, config); IbmIngressTlsResolver.apply(request, config); if (config.isIngressEnabled() && IbmIngressSupport.managed(config.getIngressClass())) { @@ -386,6 +388,7 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp } // Helm CLI로 설치 실행 + traefikPolicy = IbmTraefikIngress.create(client, config, ingressCidr); runHelmInstallCli( releaseName, chartRef, @@ -397,6 +400,13 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp ingressCidr, config.getIngressHost(), config.getIngressClass()); + try { IbmTraefikIngress.bind(client, traefikPolicy, releaseName); } + catch (RuntimeException e) { + try { uninstallRelease(namespace, clusterName, releaseName); } + catch (RuntimeException cleanup) { e.addSuppressed(cleanup); } + throw e; + } + installed = true; // 간단한 Release 스텁 반환 - null 반환으로 변경 Release result = null; @@ -414,6 +424,10 @@ public Release deployHelmChartWithRequest(KubernetesClient client, String namesp throw new RuntimeException("Helm Chart 배포 실패", e); } finally { // 8. 임시 kubeconfig 파일 삭제 + if (!installed && traefikPolicy != null) { + client.genericKubernetesResources(IbmTraefikIngress.CONTEXT).inNamespace(KubernetesNamespaces.APPLICATION_WORKLOAD) + .withName(traefikPolicy.getMetadata().getName()).delete(); + } if (tempChartPath != null) { try { Files.deleteIfExists(tempChartPath); } catch (IOException e) { log.warn("Failed to delete temporary built-in chart: {}", e.getMessage()); } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApi.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApi.java index 9731db4..c97f383 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApi.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApi.java @@ -16,19 +16,43 @@ @Component public class IbmCloudIngressApi { private final HttpClient http; + private final IbmOpenBaoCredentials credentials; private final ObjectMapper json = new ObjectMapper(); public IbmCloudIngressApi() { this(HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(15)) .followRedirects(HttpClient.Redirect.NEVER).build()); } - IbmCloudIngressApi(HttpClient http) { this.http = http; } + @org.springframework.beans.factory.annotation.Autowired + public IbmCloudIngressApi(IbmOpenBaoCredentials credentials) { + this(HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(15)) + .followRedirects(HttpClient.Redirect.NEVER).build(), credentials); + } + IbmCloudIngressApi(HttpClient http) { this(http, null); } + IbmCloudIngressApi(HttpClient http, IbmOpenBaoCredentials credentials) { + this.http = http; + this.credentials = credentials; + } record Session(String token, URI containers, URI vpc) { @Override public String toString() { return "IBM session (credentials withheld)"; } } + static final class RequestFailure extends IllegalArgumentException { + final int status; + RequestFailure(String method, int status, String code) { + super("IBM " + method + " request failed (HTTP " + status + ")" + + (code.isBlank() ? "" : " [" + code + "]") + ". Check automation account permissions and IBM service status."); + this.status = status; + } + boolean definitelyRejected() { return Set.of(400,401,403,404,405,406,415,422).contains(status); } + } + Session login(IbmIngressAutomationProperties.Profile profile) { if (profile.getRegion() == null || !profile.getRegion().matches("[a-z]{2}-[a-z]+")) throw new IllegalArgumentException("Configure the IBM region in the automation profile."); - String key = IbmIngressAutomationProperties.readOperatorFile(profile.getApiKeyFile(), "IBM API key").trim(); + String key; + if (profile.getApiKeyFile() != null && !profile.getApiKeyFile().isBlank()) + key = IbmIngressAutomationProperties.readOperatorFile(profile.getApiKeyFile(), "IBM API key").trim(); + else if (credentials != null) key = credentials.read(profile); + else throw new IllegalArgumentException("Configure IBM OpenBao credentials or a server-side IBM API key file."); if (key.isEmpty()) throw new IllegalArgumentException("The IBM automation API key is empty."); var response = request("POST", URI.create("https://iam.cloud.ibm.com/identity/token"), null, "grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=" + encode(key), "application/x-www-form-urlencoded"); @@ -50,6 +74,13 @@ JsonNode proxyConfig(Session session, String id, String type) { requireId(id); if (!Set.of("public","private").contains(type)) throw new IllegalArgumentException("Invalid IBM LB type."); var result = get(session, session.containers.resolve("ingress/v2/load-balancer/configuration?cluster=" + encode(id) + "&type=" + type)); + // IBM's current API omits the optional PROXY configuration on a new Traefik LB. + // Accept that schema only for the requested cluster and recognized backend. + if (!result.has("proxyProtocol") && id.equals(result.path("cluster").asText()) + && "traefik".equals(result.path("backend").path(type).asText()) && result.isObject()) { + result = result.deepCopy(); + ((com.fasterxml.jackson.databind.node.ObjectNode) result).putObject("proxyProtocol").put("enable", false); + } if (!result.path("proxyProtocol").path("enable").isBoolean()) throw new IllegalArgumentException("IBM returned an unknown PROXY configuration. AM will not infer that it is disabled or change the LB."); return result; @@ -61,7 +92,7 @@ void enableProxy(Session session, String id, List cidrs) { cidrs.forEach(K8sIngressAccessService::validateCidr); try { String body = json.writeValueAsString(Map.of("cluster", id, - "proxyProtocol", Map.of("enable", true, "cidr", cidrs, "headerTimeout", 5))); + "proxyProtocol", Map.of("enable", true, "cidr", cidrs))); request("PATCH", session.containers.resolve("ingress/v2/load-balancer/configuration"), session.token, body, "application/json"); } catch (com.fasterxml.jackson.core.JsonProcessingException e) { throw new IllegalStateException("Cannot encode IBM LB configuration."); } } @@ -112,8 +143,15 @@ JsonNode request(String method, URI uri, String token, String body, String conte if (token != null) builder.header("Authorization", "Bearer " + token); builder.header("Content-Type", contentType).method(method, body == null ? HttpRequest.BodyPublishers.noBody() : HttpRequest.BodyPublishers.ofString(body)); var response = http.send(builder.build(), HttpResponse.BodyHandlers.ofString()); - if (response.statusCode() < 200 || response.statusCode() >= 300) - throw new IllegalArgumentException("IBM " + method + " request failed (HTTP " + response.statusCode() + "). Check automation account permissions and IBM service status."); + if (response.statusCode() < 200 || response.statusCode() >= 300) { + String code = ""; + try { + var error = json.readTree(response.body()); + String value = error.path("code").asText(error.path("errors").path(0).path("code").asText()); + if (value.matches("[A-Za-z0-9_.-]{1,80}")) code = value; + } catch (Exception ignored) { } + throw new RequestFailure(method, response.statusCode(), code); + } return response.body().isBlank() ? json.createObjectNode() : json.readTree(response.body()); } catch (IllegalArgumentException e) { throw e; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("IBM request interrupted; check live configuration before retrying."); } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationProperties.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationProperties.java index ba2a62e..e910070 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationProperties.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationProperties.java @@ -19,6 +19,8 @@ public class IbmIngressAutomationProperties { private int pollSeconds = 10; private String certManagerVersion = "v1.20.2"; private String helmExecutable = "helm"; + private String openBaoUrl; + private String openBaoTokenFile; @Getter @Setter public static class Profile { @@ -26,6 +28,7 @@ public static class Profile { private String connectionName; private String region; private String apiKeyFile; + private String secretPath; private boolean allowSharedLbChanges; private boolean installCertManager; private List allowedDomains = new ArrayList<>(); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationService.java index 74bc577..e2ee11d 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationService.java @@ -35,10 +35,11 @@ private Target target(String ns, String name) { public List check(KubernetesClient client, String ns, String name, String workload, DeploymentConfigDTO config) { if (!config.isIngressEnabled() || !IbmIngressSupport.managed(config.getIngressClass())) return List.of(); + config = IbmIngressSupport.resolveAvailable(client, config); Target target = target(ns, name); - if (!config.isTlsEnabled()) return kubernetesSetup.check(client, ns, target.cluster, config); + if (!config.isTlsEnabled() && !IbmIngressSupport.traefik(config.getIngressClass())) return kubernetesSetup.check(client, ns, target.cluster, config); var warnings = new ArrayList(); - certificatePlan(client, target.profile, workload, config, warnings); + if (config.isTlsEnabled()) certificatePlan(client, target.profile, workload, config, warnings); try { warnings.addAll(IbmIngressSupport.verify(client, https(config))); } catch (IbmIngressSupport.MissingProxyException missing) { requireProxyProfile(target.profile); @@ -48,21 +49,36 @@ public List check(KubernetesClient client, String ns, String name, Strin verifyRegion(cluster.path("region").asText(), target.profile); if (!proxyEnabled(client, session, target.cluster.getCspResourceId())) { cloud.trustedSubnets(session, cluster, managedHostnames(client), true); - if (client.configMaps().inNamespace("kube-system").withName(INTENT).get() != null) - throw new IllegalArgumentException("An earlier IBM PROXY update has an unresolved outcome. Ask an operator to inspect am-ibm-proxy-intent before retrying."); + rejectUnresolvedIntent(client, target.cluster.getCspResourceId()); warnings.add("Deploy will enable PROXY protocol on the selected cluster's shared IBM LBs. Existing applications may briefly lose connectivity while the LBs are replaced."); } else warnings.add("IBM PROXY protocol is configured; Deploy will wait for the managed LBs and controllers to become ready."); } + if (!config.isTlsEnabled()) warnings.addAll(kubernetesSetup.check(client, ns, target.cluster, config)); return warnings; } public DeploymentConfigDTO prepare(KubernetesClient client, String ns, String name, String workload, DeploymentConfigDTO config, Consumer progress) { if (!config.isIngressEnabled() || !IbmIngressSupport.managed(config.getIngressClass())) return config; + config = IbmIngressSupport.resolveAvailable(client, config); Target target = target(ns, name); if (!config.isTlsEnabled()) { var resolved = IbmIngressTlsResolver.resolve(client, workload, config); KubernetesIngressRouteValidator.assertAvailable(client, resolved); + if (IbmIngressSupport.traefik(resolved.getIngressClass())) { + try { IbmIngressSupport.verify(client, https(resolved)); } + catch (IbmIngressSupport.MissingProxyException missing) { + check(client, ns, name, workload, resolved); + ConfigMap proxyLock = acquire(client, target.cluster.getCspResourceId()); + try { + // IBM's API updates Traefik's entrypoints; the NGINX controller ConfigMap does not. + enableProxy(client, target, https(resolved), progress); + kubernetesSetup.prepare(client, ns, target.cluster, resolved, progress); + IbmIngressSupport.verify(client, resolved); + return resolved; + } finally { release(client, proxyLock); } + } + } var plan = kubernetesSetup.plan(client, ns, target.cluster, resolved); if (plan.ready()) return resolved; ConfigMap lock = acquire(client, target.cluster.getCspResourceId()); @@ -140,11 +156,33 @@ private void enableProxy(KubernetesClient client, Target target, DeploymentConfi List cidrs = cloud.trustedSubnets(session, cluster, managedHostnames(client), true); // A durable write-ahead marker prevents blind repetition after an HTTP timeout or AM restart. var maps = client.configMaps().inNamespace("kube-system"); - if (maps.withName(INTENT).get() != null) throw new IllegalArgumentException("Previous PROXY update outcome is unresolved. Operator review is required before another LB update."); - maps.resource(new ConfigMapBuilder().withNewMetadata().withName(INTENT).withLabels(Map.of(IbmCertificateManager.OWNER,"true")).endMetadata() - .withData(Map.of("clusterId",id,"requestedAt",Instant.now().toString(),"trustedCidrs",String.join(",",cidrs),"state","SUBMITTED")).build()).create(); + rejectUnresolvedIntent(client, id); + var previous = maps.withName(INTENT).get(); + var data = new LinkedHashMap(); + data.put("clusterId",id); data.put("requestedAt",Instant.now().toString()); + data.put("trustedCidrs",String.join(",",cidrs)); data.put("state","SUBMITTED"); + if (previous != null) { + data.put("previousRequestedAt",previous.getData().getOrDefault("requestedAt","")); + data.put("previousState",previous.getData().getOrDefault("state","")); + data.put("previousError",previous.getData().getOrDefault("error","")); + } + var intent = new ConfigMapBuilder().withNewMetadata().withName(INTENT).withLabels(Map.of(IbmCertificateManager.OWNER,"true")).endMetadata().withData(data).build(); + if (previous == null) intent = maps.resource(intent).create(); + else { + intent.getMetadata().setResourceVersion(previous.getMetadata().getResourceVersion()); + intent = maps.resource(intent).lockResourceVersion(previous.getMetadata().getResourceVersion()).replace(); + } progress.accept("Enabling PROXY protocol; IBM is replacing shared load balancers…"); - cloud.enableProxy(session, id, cidrs); + try { + cloud.enableProxy(session, id, cidrs); + } catch (IbmCloudIngressApi.RequestFailure error) { + recordIntent(client, intent, error.definitelyRejected() ? "REJECTED" : "UNKNOWN", error.getMessage()); + throw error; + } catch (RuntimeException error) { + recordIntent(client, intent, "UNKNOWN", "IBM request outcome could not be confirmed."); + throw error; + } + recordIntent(client, intent, "ACCEPTED", ""); } else progress.accept("Waiting for IBM load balancer and controller readiness…"); certificates.await(() -> { try { IbmIngressSupport.verify(client, config); return true; } @@ -153,6 +191,27 @@ private void enableProxy(KubernetesClient client, Target target, DeploymentConfi // Keep the marker as an audit/replay guard. A later disable must be reviewed explicitly. } + private void rejectUnresolvedIntent(KubernetesClient client, String id) { + var intent = client.configMaps().inNamespace("kube-system").withName(INTENT).get(); + if (intent == null) return; + if (!IbmCertificateManager.owned(intent) || intent.getData() == null || !id.equals(intent.getData().get("clusterId"))) + throw new IllegalArgumentException("IBM PROXY update record does not match this cluster. Operator review is required."); + if (!Set.of("REJECTED", "OPERATOR_REVIEWED_RETRY").contains(intent.getData().getOrDefault("state",""))) + throw new IllegalArgumentException("An earlier IBM PROXY update has an unresolved outcome. Ask an operator to inspect am-ibm-proxy-intent before retrying."); + } + + private void recordIntent(KubernetesClient client, ConfigMap submitted, String state, String error) { + var maps = client.configMaps().inNamespace("kube-system"); + var current = maps.withName(INTENT).get(); + if (current == null || !IbmCertificateManager.owned(current) || current.getData() == null + || !Objects.equals(current.getData().get("requestedAt"), submitted.getData().get("requestedAt"))) + throw new IllegalArgumentException("IBM PROXY request record changed concurrently. Inspect the live configuration before retrying."); + var data = new LinkedHashMap<>(current.getData()); + data.put("state",state); data.put("error",error); data.put("updatedAt",Instant.now().toString()); + current.setData(data); + maps.resource(current).lockResourceVersion(current.getMetadata().getResourceVersion()).replace(); + } + private ConfigMap acquire(KubernetesClient client, String clusterId) { IbmCloudIngressApi.requireId(clusterId); var maps = client.configMaps().inNamespace("kube-system"); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressSupport.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressSupport.java index 1587e08..1156783 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressSupport.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressSupport.java @@ -14,6 +14,8 @@ final class IbmIngressSupport { static final String PUBLIC_CLASS = "public-iks-k8s-nginx"; static final String PRIVATE_CLASS = "private-iks-k8s-nginx"; + static final String PUBLIC_TRAEFIK_CLASS = "public-iks-traefik"; + static final String PRIVATE_TRAEFIK_CLASS = "private-iks-traefik"; static final String PROXY_FEATURE = "service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features"; private IbmIngressSupport() {} @@ -29,7 +31,29 @@ static boolean isIbm(String provider) { } static boolean managed(String ingressClass) { - return PUBLIC_CLASS.equals(ingressClass) || PRIVATE_CLASS.equals(ingressClass); + return PUBLIC_CLASS.equals(ingressClass) || PRIVATE_CLASS.equals(ingressClass) || traefik(ingressClass); + } + + static boolean traefik(String clazz) { return PUBLIC_TRAEFIK_CLASS.equals(clazz) || PRIVATE_TRAEFIK_CLASS.equals(clazz); } + static boolean privateClass(String clazz) { return PRIVATE_CLASS.equals(clazz) || PRIVATE_TRAEFIK_CLASS.equals(clazz); } + static String prefix(String clazz) { return privateClass(clazz) ? "private-" : "public-"; } + static boolean controllerMatches(String clazz, String controller) { + return traefik(clazz) ? "traefik.io/ingress-controller".equals(controller) : ("cloud.ibm.com/" + clazz).equals(controller); + } + + /** Legacy nginx selections also work on clusters provisioned with IBM's Traefik default. */ + static DeploymentConfigDTO resolveAvailable(KubernetesClient client, DeploymentConfigDTO config) { + String clazz = config.getIngressClass(); + if (!config.isIngressEnabled() || !managed(clazz) || traefik(clazz)) return config; + var classes = client.network().v1().ingressClasses(); + var nginx = classes.withName(clazz).get(); + String alternative = privateClass(clazz) ? PRIVATE_TRAEFIK_CLASS : PUBLIC_TRAEFIK_CLASS; + var candidate = classes.withName(alternative).get(); + boolean preferred = candidate != null && candidate.getMetadata() != null && candidate.getMetadata().getAnnotations() != null + && "true".equals(candidate.getMetadata().getAnnotations().get("ingressclass.kubernetes.io/is-default-class")); + if (candidate != null && candidate.getSpec() != null && controllerMatches(alternative, candidate.getSpec().getController()) + && (nginx == null || preferred)) return config.toBuilder().ingressClass(alternative).build(); + return config; } static DeploymentConfigDTO resolve(K8sClusterDto cluster, DeploymentConfigDTO config) { @@ -38,7 +62,7 @@ static DeploymentConfigDTO resolve(K8sClusterDto cluster, DeploymentConfigDTO co if (isIbm(cluster)) { // Existing catalogs and API clients use nginx; select IBM's public managed entry by default. if (clazz == null || "nginx".equals(clazz)) clazz = PUBLIC_CLASS; - if (!managed(clazz)) throw new IllegalArgumentException("IBM requires a managed NGINX Ingress class: " + PUBLIC_CLASS + " or " + PRIVATE_CLASS); + if (!managed(clazz)) throw new IllegalArgumentException("IBM requires a managed NGINX or Traefik Ingress class: " + PUBLIC_CLASS + " or " + PRIVATE_CLASS + ", " + PUBLIC_TRAEFIK_CLASS + " or " + PRIVATE_TRAEFIK_CLASS); } else if (managed(clazz)) { throw new IllegalArgumentException("IBM managed Ingress classes require an IBM cluster."); } @@ -48,9 +72,9 @@ static DeploymentConfigDTO resolve(K8sClusterDto cluster, DeploymentConfigDTO co /** Read-only, fail closed before deploying a CIDR-restricted route. */ static List verify(KubernetesClient client, DeploymentConfigDTO config) { var warnings = verify(client, config.getIngressClass()); - String prefix = PUBLIC_CLASS.equals(config.getIngressClass()) ? "public-" : "private-"; + String prefix = prefix(config.getIngressClass()); int port = config.isTlsEnabled() ? 443 : 80; - boolean available = managedServices(client, prefix).stream() + boolean available = servicesForClass(client, config.getIngressClass()).stream() .allMatch(s -> s.getSpec().getPorts() != null && s.getSpec().getPorts().stream().anyMatch(p -> Integer.valueOf(port).equals(p.getPort()))); if (!available) throw new MissingPortException("IBM managed ALB does not expose port " + port + ". Ask the cluster administrator to check the managed ALB listener configuration."); @@ -59,8 +83,9 @@ static List verify(KubernetesClient client, DeploymentConfigDTO config) static List verify(KubernetesClient client, String clazz) { verifyBase(client, clazz); - String prefix = PUBLIC_CLASS.equals(clazz) ? "public-" : "private-"; - var services = managedServices(client, prefix); + String prefix = prefix(clazz); + var services = servicesForClass(client, clazz); + if (traefik(clazz)) return IbmTraefikIngress.verify(client, clazz, services); var cm = client.configMaps().inNamespace("kube-system").withName("ibm-k8s-controller-config").get(); Map data = cm == null || cm.getData() == null ? Map.of() : cm.getData(); if (!"true".equalsIgnoreCase(data.get("use-proxy-protocol"))) { @@ -96,11 +121,11 @@ static List verify(KubernetesClient client, String clazz) { static void verifyBase(KubernetesClient client, String clazz) { var ingressClass = client.network().v1().ingressClasses().withName(clazz).get(); if (ingressClass == null || ingressClass.getSpec() == null - || !("cloud.ibm.com/" + clazz).equals(ingressClass.getSpec().getController())) { - throw new IllegalArgumentException("IBM managed NGINX IngressClass " + clazz + " is unavailable. Enable the IBM NGINX ALB first."); + || !controllerMatches(clazz, ingressClass.getSpec().getController())) { + throw new IllegalArgumentException("IBM managed IngressClass " + clazz + " is unavailable. Enable the corresponding IBM NGINX or Traefik ALB first."); } - String prefix = PUBLIC_CLASS.equals(clazz) ? "public-" : "private-"; - var services = managedServices(client, prefix); + String prefix = prefix(clazz); + var services = servicesForClass(client, clazz); if (services.isEmpty()) throw new IllegalArgumentException("No active IBM " + prefix + "ALB LoadBalancer Service was found."); var deployments = client.apps().deployments().inNamespace("kube-system") .withLabel("ingress-class", clazz).list().getItems(); @@ -110,6 +135,22 @@ static void verifyBase(KubernetesClient client, String clazz) { } } + static List servicesForClass(KubernetesClient client, String clazz) { + if (!traefik(clazz)) return managedServices(client, prefix(clazz)).stream() + .filter(s -> s.getSpec().getSelector() == null || s.getSpec().getSelector().values().stream().noneMatch(v -> v.contains("traefik"))).toList(); + var controllers = client.apps().deployments().inNamespace("kube-system").withLabel("ingress-class", clazz).list().getItems(); + var published = new java.util.HashSet(); + for (var deployment : controllers) if (deployment.getSpec() != null && deployment.getSpec().getTemplate() != null + && deployment.getSpec().getTemplate().getSpec() != null) + for (var container : deployment.getSpec().getTemplate().getSpec().getContainers()) + for (String arg : container.getArgs() == null ? List.of() : container.getArgs()) + if (arg.toLowerCase(Locale.ROOT).startsWith("--providers.kubernetesingress.ingressendpoint.publishedservice=kube-system/")) + published.add(arg.substring(arg.indexOf("=") + 1).substring("kube-system/".length())); + var services = managedServices(client, prefix(clazz)); + // IBM Traefik publishes its Service explicitly; do not mix NGINX and Traefik endpoints. + return published.isEmpty() ? services : services.stream().filter(s -> published.contains(s.getMetadata().getName())).toList(); + } + static List managedServices(KubernetesClient client, String prefix) { return client.services().inNamespace("kube-system").list().getItems().stream() .filter(s -> s.getMetadata() != null && s.getMetadata().getName() != null diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressTlsResolver.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressTlsResolver.java index e76f632..93c140b 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressTlsResolver.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressTlsResolver.java @@ -113,9 +113,28 @@ static String selectBinding(Map entries, String host) { private static String defaultSecretReference(KubernetesClient client, String clazz) { try { var ingressClass = client.network().v1().ingressClasses().withName(clazz).get(); - if (ingressClass == null || ingressClass.getSpec() == null || !("cloud.ibm.com/" + clazz).equals(ingressClass.getSpec().getController())) { + if (ingressClass == null || ingressClass.getSpec() == null || !IbmIngressSupport.controllerMatches(clazz, ingressClass.getSpec().getController())) { throw new IllegalArgumentException("IBM managed Ingress class is unavailable."); } + if (IbmIngressSupport.traefik(clazz)) { + var context = new io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext.Builder() + .withGroup("traefik.io").withVersion("v1alpha1").withPlural("tlsstores").withKind("TLSStore").withNamespaced(true).build(); + Set references = new HashSet<>(); + for (var store : client.genericKubernetesResources(context).inAnyNamespace().list().getItems()) { + if (!"default".equals(store.getMetadata().getName())) continue; + var spec = JSON.valueToTree(store.getAdditionalProperties().get("spec")); + String secret = spec.path("defaultCertificate").path("secretName").asText(); + if (validSecretName(secret)) references.add(store.getMetadata().getNamespace() + "/" + secret); + } + // IBM also publishes its generated certificate through the default-server Ingress. + if (references.isEmpty()) { + var server = client.network().v1().ingresses().inNamespace("kube-system").withName("alb-default-server").get(); + if (server != null && server.getSpec() != null && server.getSpec().getTls() != null) + for (var tls : server.getSpec().getTls()) if (validSecretName(tls.getSecretName())) references.add("kube-system/" + tls.getSecretName()); + } + if (references.size() != 1) throw new IllegalArgumentException("Cannot identify the IBM Traefik default TLS Secret. Register a certificate in " + BINDINGS_CONFIG_MAP + "."); + return references.iterator().next(); + } var deployments = client.apps().deployments().inNamespace("kube-system").withLabel("ingress-class", clazz).list().getItems(); Set references = new HashSet<>(); for (var deployment : deployments) { diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmKubernetesIngressSetup.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmKubernetesIngressSetup.java index d93dfd1..07d75a1 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmKubernetesIngressSetup.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmKubernetesIngressSetup.java @@ -33,8 +33,11 @@ Plan plan(KubernetesClient client, String ns, K8sClusterDto cluster, DeploymentC throw new IllegalArgumentException("Kubernetes Ingress preparation requires the selected IBM cluster."); IbmIngressSupport.verifyBase(client, config.getIngressClass()); var services = new ArrayList(); - services.addAll(IbmIngressSupport.managedServices(client, "public-")); - services.addAll(IbmIngressSupport.managedServices(client, "private-")); + if (IbmIngressSupport.traefik(config.getIngressClass())) services.addAll(IbmIngressSupport.servicesForClass(client, config.getIngressClass())); + else { + services.addAll(IbmIngressSupport.managedServices(client, "public-")); + services.addAll(IbmIngressSupport.managedServices(client, "private-")); + } var cm = client.configMaps().inNamespace("kube-system").withName(CONFIG).get(); try { IbmIngressSupport.verify(client, config); @@ -46,7 +49,7 @@ Plan plan(KubernetesClient client, String ns, K8sClusterDto cluster, DeploymentC rejectUnresolved(client.configMaps().inNamespace("kube-system").withName(JOURNAL).get()); // One controller ConfigMap affects every ALB. Never silently repair an operator's mixed configuration. boolean proxy = "true".equalsIgnoreCase(data(cm).get("use-proxy-protocol")); - if (services.stream().anyMatch(s -> hasProxy(s) != proxy)) + if (!IbmIngressSupport.traefik(config.getIngressClass()) && services.stream().anyMatch(s -> hasProxy(s) != proxy)) throw new IllegalArgumentException("IBM ALBs and controller have mixed PROXY settings. Operator review is required before shared configuration changes."); for (Service s : services) { String lbName = annotations(s).get("service.kubernetes.io/ibm-load-balancer-cloud-provider-vpc-lb-name"); @@ -55,10 +58,16 @@ Plan plan(KubernetesClient client, String ns, K8sClusterDto cluster, DeploymentC if (s.getSpec().getPorts() == null || s.getSpec().getPorts().stream().anyMatch(p -> !Set.of(80,443).contains(p.getPort()))) throw new IllegalArgumentException("Automatic IBM preparation supports existing HTTP/HTTPS listeners only; custom listeners require operator review."); String prefix = s.getMetadata().getName().startsWith("public-") ? "public-" : "private-"; - String clazz = prefix.equals("public-") ? IbmIngressSupport.PUBLIC_CLASS : IbmIngressSupport.PRIVATE_CLASS; + String legacyClass = prefix.equals("public-") ? IbmIngressSupport.PUBLIC_CLASS : IbmIngressSupport.PRIVATE_CLASS; + String clazz = IbmIngressSupport.resolveAvailable(client, config.toBuilder().ingressClass(legacyClass).build()).getIngressClass(); IbmIngressSupport.verifyBase(client, clazz); var controllers = client.apps().deployments().inNamespace("kube-system").withLabel("ingress-class", clazz).list().getItems(); - if (controllers.stream().anyMatch(d -> d.getSpec() == null || d.getSpec().getTemplate().getSpec().getContainers().stream() + if (IbmIngressSupport.traefik(clazz)) { + if (controllers.stream().anyMatch(d -> d.getSpec() == null || d.getSpec().getTemplate().getSpec().getContainers().stream() + .noneMatch(c -> ":80/tcp".equals(IbmTraefikIngress.arguments(c).get("entrypoints.web.address")) + && ":443/tcp".equals(IbmTraefikIngress.arguments(c).get("entrypoints.websecure.address"))))) + throw new IllegalArgumentException("IBM Traefik controllers must already listen on ports 80/443."); + } else if (controllers.stream().anyMatch(d -> d.getSpec() == null || d.getSpec().getTemplate().getSpec().getContainers().stream() .noneMatch(c -> c.getArgs() != null && c.getArgs().contains("--configmap=kube-system/" + CONFIG) && c.getArgs().contains("--http-port=80") && c.getArgs().contains("--https-port=443")))) throw new IllegalArgumentException("IBM controllers must already listen on ports 80/443 and use the managed ConfigMap. AM will not replace controllers."); @@ -105,9 +114,11 @@ void prepare(KubernetesClient client, String ns, K8sClusterDto cluster, Deployme client.services().inNamespace("kube-system").resource(desired) .lockResourceVersion(s.getMetadata().getResourceVersion()).replace(); } - updated = desiredController(plan.controller, plan.cidrs); - if (plan.controller == null) maps.resource(updated).create(); - else maps.resource(updated).lockResourceVersion(plan.controller.getMetadata().getResourceVersion()).replace(); + if (!IbmIngressSupport.traefik(config.getIngressClass())) { + updated = desiredController(plan.controller, plan.cidrs); + if (plan.controller == null) maps.resource(updated).create(); + else maps.resource(updated).lockResourceVersion(plan.controller.getMetadata().getResourceVersion()).replace(); + } awaitReady(client, config, plan.services, Instant.parse(backup.get("startedAt"))); state(client, "READY"); progress.accept("IBM HTTP entry and source-IP preservation are ready."); @@ -125,7 +136,7 @@ static Service desired(Service original, DeploymentConfigDTO config) { var s = new ServiceBuilder(original).build(); var annotations = new LinkedHashMap<>(annotations(s)); annotations.put(IbmIngressSupport.PROXY_FEATURE, append(annotations.get(IbmIngressSupport.PROXY_FEATURE), "proxy-protocol")); - boolean selected = s.getMetadata().getName().startsWith(IbmIngressSupport.PUBLIC_CLASS.equals(config.getIngressClass()) ? "public-" : "private-"); + boolean selected = s.getMetadata().getName().startsWith(IbmIngressSupport.prefix(config.getIngressClass())); if (selected && !config.isTlsEnabled() && s.getSpec().getPorts().stream().noneMatch(p -> Integer.valueOf(80).equals(p.getPort()))) { if (s.getSpec().getPorts().stream().anyMatch(p -> "http".equals(p.getName()))) throw new IllegalArgumentException("The existing http Service port has a nonstandard number."); @@ -200,7 +211,7 @@ void awaitReady(KubernetesClient client, DeploymentConfigDTO config, List= 3) return; } else stable = 0; } catch (RuntimeException ignored) { stable = 0; } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentials.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentials.java new file mode 100644 index 0000000..99cde8a --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentials.java @@ -0,0 +1,56 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.net.URI; +import java.net.http.*; +import java.time.Duration; +import org.springframework.stereotype.Component; + +/** Reads the existing registered IBM key into memory; never persists it or returns it to API clients. */ +@Component +public class IbmOpenBaoCredentials { + private final IbmIngressAutomationProperties properties; + private final HttpClient http; + private final ObjectMapper json = new ObjectMapper(); + + @org.springframework.beans.factory.annotation.Autowired + public IbmOpenBaoCredentials(IbmIngressAutomationProperties properties) { + this(properties, HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)) + .followRedirects(HttpClient.Redirect.NEVER).build()); + } + IbmOpenBaoCredentials(IbmIngressAutomationProperties properties, HttpClient http) { + this.properties = properties; + this.http = http; + } + + String read(IbmIngressAutomationProperties.Profile profile) { + try { + String path = profile.getSecretPath(); + if (path == null || !path.matches("secret/data/(?:csp/ibm|users/[a-z0-9][a-z0-9-]{0,63}/csp/ibm)")) + throw new IllegalArgumentException(); + URI base = URI.create(properties.getOpenBaoUrl()); + if (!("https".equals(base.getScheme()) || "http".equals(base.getScheme())) || base.getHost() == null + || base.getUserInfo() != null || base.getQuery() != null || base.getFragment() != null + || !(base.getPath().isEmpty() || "/".equals(base.getPath()))) throw new IllegalArgumentException(); + String token = IbmIngressAutomationProperties.readOperatorFile(properties.getOpenBaoTokenFile(), "OpenBao token").trim(); + if (token.isEmpty()) throw new IllegalArgumentException(); + var request = HttpRequest.newBuilder(base.resolve("/v1/" + path)).timeout(Duration.ofSeconds(15)) + .header("X-Vault-Token", token).header("Accept", "application/json").GET().build(); + var response = http.send(request, HttpResponse.BodyHandlers.ofString()); + if (response.statusCode() != 200 || response.body().length() > 65536) throw new IllegalArgumentException(); + var field = json.readTree(response.body()).path("data").path("data").path("IC_API_KEY"); + String key = field.isTextual() ? field.asText() : ""; + if (key.isBlank() || key.equals("Hidden for security.") || key.matches("\\*+")) throw new IllegalArgumentException(); + return key; + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw unavailable(); + } catch (Exception e) { + throw unavailable(); + } + } + + private static IllegalArgumentException unavailable() { + return new IllegalArgumentException("AM could not read the registered IBM credential. Check the IBM OpenBao token file, read policy and Project/connection binding."); + } +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngress.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngress.java new file mode 100644 index 0000000..60575b4 --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngress.java @@ -0,0 +1,119 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.fabric8.kubernetes.api.model.*; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.*; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentConfigDTO; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubernetesNamespaces; + +/** Native Traefik routes: never rely on disabled-by-default NGINX annotation compatibility. */ +final class IbmTraefikIngress { + static final String MIDDLEWARES = "traefik.ingress.kubernetes.io/router.middlewares"; + static final String OWNER = "am.mcmp.io/traefik-policy"; + static final ResourceDefinitionContext CONTEXT = new ResourceDefinitionContext.Builder() + .withGroup("traefik.io").withVersion("v1alpha1").withKind("Middleware") + .withPlural("middlewares").withNamespaced(true).build(); + private static final ObjectMapper JSON = new ObjectMapper(); + private IbmTraefikIngress() {} + + static String name(String host, String clazz, String cidr) { + try { + byte[] hash = MessageDigest.getInstance("SHA-256").digest((host + "\n" + clazz + "\n" + cidr).getBytes(StandardCharsets.UTF_8)); + return "am-ingress-" + HexFormat.of().formatHex(hash).substring(0, 24); + } catch (java.security.NoSuchAlgorithmException e) { throw new IllegalStateException(e); } + } + + static String reference(String namespace, String host, String clazz, String cidr) { + return namespace + "-" + name(host, clazz, cidr) + "@kubernetescrd"; + } + + static Map annotations(DeploymentConfigDTO config, String cidr) { + var result = new LinkedHashMap(); + result.put(MIDDLEWARES, reference(KubernetesNamespaces.APPLICATION_WORKLOAD, config.getIngressHost(), config.getIngressClass(), cidr)); + result.put("traefik.ingress.kubernetes.io/router.entrypoints", config.isTlsEnabled() ? "websecure" : "web"); + result.put("traefik.ingress.kubernetes.io/router.tls", String.valueOf(config.isTlsEnabled())); + return result; + } + + static GenericKubernetesResource middleware(String namespace, DeploymentConfigDTO config, String cidr) { + K8sIngressAccessService.validateCidr(cidr); + return JSON.convertValue(Map.of("apiVersion", "traefik.io/v1alpha1", "kind", "Middleware", + "metadata", Map.of("name", name(config.getIngressHost(), config.getIngressClass(), cidr), + "namespace", namespace, "labels", Map.of(OWNER, "true"), + "annotations", Map.of("kubernetes.io/ingress.class", config.getIngressClass())), + "spec", Map.of("ipAllowList", Map.of("sourceRange", List.of(cidr)))), GenericKubernetesResource.class); + } + + static List verify(KubernetesClient client, String clazz, List services) { + var deployments = client.apps().deployments().inNamespace("kube-system").withLabel("ingress-class", clazz).list().getItems(); + if (deployments.stream().anyMatch(d -> d.getSpec().getTemplate().getSpec().getContainers().stream() + .noneMatch(c -> c.getImage() != null && c.getImage().contains("traefik")))) + throw new IllegalArgumentException("Cannot identify the managed IBM Traefik controller."); + for (var deployment : deployments) for (var container : deployment.getSpec().getTemplate().getSpec().getContainers()) { + if (container.getImage() == null || !container.getImage().contains("traefik")) continue; + Map args = arguments(container); + if (!"true".equals(args.get("providers.kubernetesingress")) || !"true".equals(args.get("providers.kubernetescrd")) + || "true".equals(args.get("providers.kubernetesingressnginx"))) + throw new IllegalArgumentException("IBM Traefik must enable native Ingress and Middleware processing for CIDR access."); + for (String entry : List.of("web", "websecure")) { + String prefix = "entrypoints." + entry + ".proxyprotocol."; + if ("true".equalsIgnoreCase(args.get(prefix + "insecure"))) + throw new IllegalArgumentException("IBM Traefik must restrict trusted PROXY protocol sources."); + String trusted = args.getOrDefault(prefix + "trustedips", ""); + if (trusted.isBlank()) throw new IbmIngressSupport.MissingProxyException("IBM Traefik source IP preservation is disabled. Enable PROXY protocol before deploying CIDR-restricted applications."); + for (String cidr : trusted.split(",", -1)) K8sIngressAccessService.validateCidr(cidr.trim()); + } + } + var endpoints = new ArrayList(); + for (var service : services) { + String features = service.getMetadata().getAnnotations() == null ? "" : service.getMetadata().getAnnotations().getOrDefault(IbmIngressSupport.PROXY_FEATURE, ""); + if (Arrays.stream(features.split(",")).map(String::trim).noneMatch("proxy-protocol"::equals)) + throw new IbmIngressSupport.MissingProxyException("IBM Traefik ALB Service does not enable PROXY protocol."); + if (service.getStatus() == null || service.getStatus().getLoadBalancer() == null || service.getStatus().getLoadBalancer().getIngress() == null + || service.getStatus().getLoadBalancer().getIngress().isEmpty()) throw new IllegalArgumentException("IBM Traefik ALB has no ready external endpoint yet."); + for (var address : service.getStatus().getLoadBalancer().getIngress()) { + String endpoint = address.getHostname() != null ? address.getHostname() : address.getIp(); + if (endpoint == null || endpoint.isBlank()) throw new IllegalArgumentException("IBM Traefik ALB endpoint is empty."); + endpoints.add(endpoint); + } + } + // An API read verifies that the Middleware CRD exists and is accessible without changing shared ALB configuration. + client.genericKubernetesResources(CONTEXT).inNamespace(KubernetesNamespaces.APPLICATION_WORKLOAD).list(); + return List.of("IBM managed Traefik ALB endpoint: " + String.join(", ", endpoints)); + } + + static Map arguments(Container container) { + Map result = new HashMap<>(); + for (String arg : container.getArgs() == null ? List.of() : container.getArgs()) { + int split = arg.indexOf('='); + if (arg.startsWith("--")) result.put(arg.substring(2, split < 0 ? arg.length() : split).toLowerCase(Locale.ROOT), split < 0 ? "true" : arg.substring(split + 1)); + } + return result; + } + + /** A dedicated immutable policy for one route; never overwrite operator-owned resources. */ + static GenericKubernetesResource create(KubernetesClient client, DeploymentConfigDTO config, String cidr) { + if (cidr == null || !IbmIngressSupport.traefik(config.getIngressClass())) return null; + var desired = middleware(KubernetesNamespaces.APPLICATION_WORKLOAD, config, cidr); + var ops = client.genericKubernetesResources(CONTEXT).inNamespace(KubernetesNamespaces.APPLICATION_WORKLOAD); + var existing = ops.withName(desired.getMetadata().getName()).get(); + if (existing != null) throw new IllegalArgumentException("A Traefik policy already exists for this route. Inspect the existing installation before retrying."); + return ops.resource(desired).create(); + } + + static void bind(KubernetesClient client, GenericKubernetesResource middleware, String release) { + if (middleware == null) return; + var ingresses = client.network().v1().ingresses().inNamespace(KubernetesNamespaces.APPLICATION_WORKLOAD).list().getItems().stream() + .filter(i -> i.getMetadata().getAnnotations() != null && Objects.equals(i.getMetadata().getAnnotations().get(MIDDLEWARES), + KubernetesNamespaces.APPLICATION_WORKLOAD + "-" + middleware.getMetadata().getName() + "@kubernetescrd")) + .filter(i -> i.getMetadata().getAnnotations() != null && release.equals(i.getMetadata().getAnnotations().get("meta.helm.sh/release-name"))).toList(); + if (ingresses.isEmpty()) throw new IllegalArgumentException("The installed Helm release has no protected Traefik Ingress."); + middleware.getMetadata().setOwnerReferences(ingresses.stream().map(i -> new OwnerReferenceBuilder().withApiVersion(i.getApiVersion()) + .withKind("Ingress").withName(i.getMetadata().getName()).withUid(i.getMetadata().getUid()).withBlockOwnerDeletion(false).build()).toList()); + client.genericKubernetesResources(CONTEXT).inNamespace(KubernetesNamespaces.APPLICATION_WORKLOAD).resource(middleware).update(); + } +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java index d2d18e2..328b2c1 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java @@ -54,8 +54,8 @@ public Endpoint getEndpoint(DeploymentHistory history, Boolean enabled, String i List resolvePorts(KubernetesClient client, String namespace, String provider, String ingressClass, boolean tls) { boolean ibm = IbmIngressSupport.isIbm(provider) || IbmIngressSupport.managed(ingressClass); - if (ibm && IbmIngressSupport.PRIVATE_CLASS.equals(ingressClass)) return List.of(); - var services = ibm ? IbmIngressSupport.managedServices(client, "public-") + if (ibm && IbmIngressSupport.privateClass(ingressClass)) return List.of(); + var services = ibm ? IbmIngressSupport.servicesForClass(client, ingressClass) : client.services().inNamespace("default") .withLabel("app.kubernetes.io/instance", "nginx-ingress-" + namespace) .withLabel("app.kubernetes.io/component", "controller").list().getItems(); @@ -80,8 +80,8 @@ List resolve(KubernetesClient client, String namespace, String provider, var addresses = new TreeSet(); if (IbmIngressSupport.isIbm(provider) || IbmIngressSupport.managed(ingressClass)) { // Private IBM ingress has no public entry point. - if (IbmIngressSupport.PRIVATE_CLASS.equals(ingressClass)) return List.of(); - for (var service : IbmIngressSupport.managedServices(client, "public-")) { + if (IbmIngressSupport.privateClass(ingressClass)) return List.of(); + for (var service : IbmIngressSupport.servicesForClass(client, ingressClass)) { if (service.getStatus() != null && service.getStatus().getLoadBalancer() != null && service.getStatus().getLoadBalancer().getIngress() != null) { for (var entry : service.getStatus().getLoadBalancer().getIngress()) { diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressAccessService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressAccessService.java index ac74ea2..842dcc4 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressAccessService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressAccessService.java @@ -32,6 +32,12 @@ public void resolveTarget(DeploymentRequest request, kr.co.mcmp.softwarecatalog. request.setIngressClass(IbmIngressSupport.resolve(cluster, config).getIngressClass()); } + public void resolveTarget(KubernetesClient client, DeploymentRequest request, kr.co.mcmp.softwarecatalog.SoftwareCatalog catalog) { + resolveTarget(request, catalog); + request.setIngressClass(IbmIngressSupport.resolveAvailable(client, + kr.co.mcmp.softwarecatalog.application.dto.DeploymentConfigDTO.from(request, catalog)).getIngressClass()); + } + public void open(DeploymentRequest request, DeploymentHistory history) { if (!Boolean.TRUE.equals(request.getOpenServicePort())) return; var cluster = tumblebug.getK8sClusterByName(request.getNamespace(), request.getClusterName()); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPolicy.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPolicy.java index 2460e80..10e9296 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPolicy.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPolicy.java @@ -16,7 +16,7 @@ static String validate(DeploymentRequest request, DeploymentConfigDTO config) { return null; } if (!"nginx".equals(config.getIngressClass()) && !IbmIngressSupport.managed(config.getIngressClass())) - throw new IllegalArgumentException("CIDR access requires nginx or an IBM managed NGINX ingress class."); + throw new IllegalArgumentException("CIDR access requires nginx or an IBM managed NGINX or Traefik ingress class."); if (config.getIngressHost() == null || config.getIngressHost().isBlank() || "localhost".equals(config.getIngressHost())) throw new IllegalArgumentException("Enter an Ingress hostname for external access."); return K8sIngressAccessService.validateCidr(request.getServicePortCidr()); @@ -56,9 +56,12 @@ static void configureValues(String chart, Map values, Map annotations = new LinkedHashMap<>((Map) map(ingress.get("annotations"))); - annotations.put(K8sIngressAccessService.CIDR_ANNOTATION, cidr); + if (IbmIngressSupport.traefik(config.getIngressClass())) { + annotations.keySet().removeIf(k -> k.toString().startsWith("nginx.ingress.kubernetes.io/")); + annotations.putAll(IbmTraefikIngress.annotations(config, cidr)); + } else annotations.put(K8sIngressAccessService.CIDR_ANNOTATION, cidr); annotations.put("kubernetes.io/ingress.class", config.getIngressClass()); - if (IbmIngressSupport.managed(config.getIngressClass()) && !config.isTlsEnabled()) { + if (IbmIngressSupport.managed(config.getIngressClass()) && !IbmIngressSupport.traefik(config.getIngressClass()) && !config.isTlsEnabled()) { // Per application only: leave the shared controller and existing HTTPS routes unchanged. annotations.put("nginx.ingress.kubernetes.io/ssl-redirect", "false"); annotations.put("nginx.ingress.kubernetes.io/force-ssl-redirect", "false"); @@ -106,8 +109,11 @@ static void verifyManifest(String manifest, String cidr, String expectedHost, St if (clazz == null) clazz = annotations.get("kubernetes.io/ingress.class"); if (!Objects.equals(expectedClass, clazz) || (annotations.containsKey("kubernetes.io/ingress.class") && !Objects.equals(expectedClass, annotations.get("kubernetes.io/ingress.class"))) - || !cidr.equals(annotations.get(K8sIngressAccessService.CIDR_ANNOTATION))) - throw new IllegalArgumentException("Helm chart did not render the required nginx Ingress CIDR restriction."); + || !(IbmIngressSupport.traefik(expectedClass) + ? IbmTraefikIngress.reference(kr.co.mcmp.softwarecatalog.kubernetes.config.KubernetesNamespaces.APPLICATION_WORKLOAD, + expectedHost, expectedClass, cidr).equals(annotations.get(IbmTraefikIngress.MIDDLEWARES)) + : cidr.equals(annotations.get(K8sIngressAccessService.CIDR_ANNOTATION)))) + throw new IllegalArgumentException("Helm chart did not render the required Ingress CIDR restriction."); } if ("Service".equals(resource.get("kind")) && Set.of("LoadBalancer", "NodePort").contains(Objects.toString(spec.get("type"), ""))) throw new IllegalArgumentException("Application Services must use ClusterIP to avoid bypassing Ingress CIDR restrictions."); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPreparationJobs.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPreparationJobs.java index f3ebf7d..d2c3770 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPreparationJobs.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sIngressPreparationJobs.java @@ -72,9 +72,7 @@ private void run(Job job) { var config = DeploymentConfigDTO.from(target,catalog); if (!config.isIngressEnabled() || !IbmIngressSupport.managed(config.getIngressClass())) throw new IllegalArgumentException("This preparation endpoint requires IBM managed Ingress."); - String workload = catalog.getPackageInfo() != null && catalog.getPackageInfo().getPackageName() != null - && catalog.getPackageInfo().getPackageName().toLowerCase(Locale.ROOT).contains("jupyter") - ? target.getNamespace() : KubernetesNamespaces.APPLICATION_WORKLOAD; + String workload = KubernetesNamespaces.APPLICATION_WORKLOAD; try (var client = clients.getClient(target.getNamespace(),target.getClusterName())) { automation.prepare(client,target.getNamespace(),target.getClusterName(),workload,config, message -> job.message=message); } diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sJupyterService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sJupyterService.java index af3fa28..b7321c0 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sJupyterService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/K8sJupyterService.java @@ -67,7 +67,7 @@ static void validate(DeploymentRequest r, String gateway, boolean allowHttp) { if (r.getServicePort() != null && r.getServicePort() != 8888) throw new IllegalArgumentException("K8s Jupyter uses service port 8888 and external Ingress port 30880."); if (!Boolean.TRUE.equals(r.getIngressEnabled())) throw new IllegalArgumentException("K8s Jupyter requires Ingress."); - if (!"nginx".equals(r.getIngressClass()) && !IbmIngressSupport.managed(r.getIngressClass())) throw new IllegalArgumentException("Use nginx or an IBM managed NGINX Ingress class."); + if (!"nginx".equals(r.getIngressClass()) && !IbmIngressSupport.managed(r.getIngressClass())) throw new IllegalArgumentException("Use nginx or an IBM managed NGINX or Traefik Ingress class."); String host = r.getIngressHost(); if (host == null || host.length() > 253 || !host.matches("(?=.{1,253}$)[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?") || host.contains("..") || host.contains("*") || host.matches("[0-9.]+")) @@ -94,10 +94,10 @@ static void validate(DeploymentRequest r, String gateway, boolean allowHttp) { public synchronized DeploymentHistory deploy(DeploymentRequest request, SoftwareCatalog catalog) { boolean prepareCinderVolume; try (var client = clients.getClient(request.getNamespace(), request.getClusterName())) { + access.resolveTarget(client, request, catalog); var storageClass = JupyterStorageValidation.validate(client, request.getAdditionalConfig()); prepareCinderVolume = NhnStorageClassService.DRIVER.equals(storageClass.getProvisioner()); } catch (RuntimeException e) { throw StorageOperationException.translate(e); } - access.resolveTarget(request, catalog); boolean sshTunnel = useSshTunnel(); // Routing/CIDR requirements are identical; only DIRECT needs an external URL. validate(request, sshTunnel ? "https://unused.internal" : gatewayUrl, allowHttp); @@ -257,6 +257,15 @@ List resources(DeploymentRequest r, SoftwareCatalog catalog, String ingressAnnotations.put("nginx.ingress.kubernetes.io/ssl-redirect", "false"); ingressAnnotations.put("nginx.ingress.kubernetes.io/force-ssl-redirect", "false"); } + if (IbmIngressSupport.traefik(r.getIngressClass())) { + String cidr = K8sIngressAccessService.validateCidr(r.getServicePortCidr()); + var routeConfig = DeploymentConfigDTO.from(r, catalog); + ingressAnnotations.clear(); + ingressAnnotations.putAll(IbmTraefikIngress.annotations(routeConfig, cidr)); + var middleware = IbmTraefikIngress.middleware(ns, routeConfig, cidr); + middleware.getMetadata().getLabels().putAll(labels); + result.add(middleware); + } ingressMeta.put("annotations", ingressAnnotations); Map ingressSpec = new LinkedHashMap<>(Map.of("ingressClassName", r.getIngressClass(), "rules", List.of(Map.of("host", r.getIngressHost(), "http", Map.of("paths", List.of(Map.of("path", "/", "pathType", "Prefix", "backend", Map.of( @@ -367,6 +376,8 @@ public void uninstall(String ns, String cluster, Long catalog) { client.services().inNamespace(workloadNamespace).withLabel(OWNER, name).delete(); client.secrets().inNamespace(workloadNamespace).withLabel(OWNER, name).delete(); client.configMaps().inNamespace(workloadNamespace).withLabel(OWNER, name).delete(); + if (IbmIngressSupport.traefik(history.getIngressClass())) + client.genericKubernetesResources(IbmTraefikIngress.CONTEXT).inNamespace(workloadNamespace).withLabel(OWNER, name).delete(); access.release(history.getId()); history.setStatus("UNINSTALLED"); history.setUpdatedAt(LocalDateTime.now()); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java index a4eee50..c20ecdd 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployService.java @@ -103,7 +103,7 @@ public DeploymentHistory deployApplication(String namespace, String clusterName, try (KubernetesClient client = clientFactory.getClient(namespace, clusterName)) { BuiltInHelmPolicy.validateStorage(helmChart, client, request); - if (isIngressEnabled(request, catalog)) ingressAccess.resolveTarget(request, catalog); + if (isIngressEnabled(request, catalog)) ingressAccess.resolveTarget(client, request, catalog); // namespaceService.ensureNamespaceExists(client, namespace); // 불필요한 코드 제거 boolean ingressEnabled = isIngressEnabled(request, catalog); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightService.java index ff07d09..a5be798 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightService.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightService.java @@ -36,6 +36,7 @@ public K8sIngressTlsSettings tlsSettings(String namespace, String clusterName) { ingressAccess.resolveTarget(target, new kr.co.mcmp.softwarecatalog.SoftwareCatalog()); if (!IbmIngressSupport.managed(target.getIngressClass())) return new K8sIngressTlsSettings(false, null, List.of(), List.of()); try (var client = clients.getClient(namespace, clusterName)) { + target.setIngressClass(IbmIngressSupport.resolveAvailable(client, DeploymentConfigDTO.from(target, new kr.co.mcmp.softwarecatalog.SoftwareCatalog())).getIngressClass()); return IbmIngressTlsResolver.describe(client, KubernetesNamespaces.APPLICATION_WORKLOAD, target.getIngressClass()); } catch (IllegalArgumentException e) { throw e; } catch (RuntimeException e) { throw new IllegalArgumentException("Cannot discover IBM HTTPS settings. Check cluster connectivity and read permissions."); } @@ -66,7 +67,7 @@ public K8sIngressCheckResult check(K8sIngressCheckRequest request) { try (var client = clients.getClient(request.getNamespace(), request.getClusterName())) { var target = request.toDeploymentRequest(); - ingressAccess.resolveTarget(target, catalog); + ingressAccess.resolveTarget(client, target, catalog); config = DeploymentConfigDTO.from(target, catalog); if (nativeJupyter && config.isTlsEnabled() && !IbmIngressSupport.managed(config.getIngressClass())) { return invalid("K8s Jupyter uses HTTP NodePort 30880; configure a separate HTTPS entry before enabling TLS."); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index d185346..6d32703 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -4,6 +4,19 @@ config: config-string: application,manager,m-cmp app: + ibm-ingress: + automation: + # true: IBM Ingress 준비 시 AM이 필요한 PROXY protocol을 공식 IBM API로 자동 활성화. + # 공유 LB가 재구성되므로 기존 연결이 잠시 끊길 수 있음. 실제 변경은 배포/준비 요청 시에만 실행. + # IBM 키는 OpenBao에서 읽어 메모리에서만 사용. IBM 경로 읽기 전용 토큰을 파일로 마운트해야 함. + open-bao-url: ${IBM_INGRESS_OPEN_BAO_URL:http://mc-infra-manager-openbao:8200} + open-bao-token-file: ${IBM_INGRESS_OPEN_BAO_TOKEN_FILE:/run/secrets/am-ibm-openbao-token} + profiles: + - namespace: ${IBM_INGRESS_NAMESPACE:default} + connection-name: ${IBM_INGRESS_CONNECTION_NAME:ibm-jp-tok} + region: ${IBM_INGRESS_REGION:jp-tok} + allow-shared-lb-changes: ${IBM_INGRESS_ALLOW_SHARED_LB_CHANGES:true} + secret-path: ${IBM_INGRESS_SECRET_PATH:secret/data/csp/ibm} nhn-cinder-addon: # true: NHN Cinder CSI addon 설치 기능 활성화, false: 설치 기능 비활성화 (다른 CSP에는 적용하지 않음). # 환경변수 NHN_CINDER_ADDON_ENABLED로 재정의 가능. 변경 후 AM 재시작 필요. diff --git a/src/main/resources/static/assets/ApplicationRepository-DIXbaB2_.js b/src/main/resources/static/assets/ApplicationRepository-DIXbaB2_.js new file mode 100644 index 0000000..a4c9dc6 --- /dev/null +++ b/src/main/resources/static/assets/ApplicationRepository-DIXbaB2_.js @@ -0,0 +1 @@ +import{I as _}from"./IconPlus-CfVojf7j.js";import{d as u,D as m,r as v,g as y,c as i,a as e,b as n,u as r,e as f,m as g,E as h,o,s as b,G as w,R}from"./index-B9L3o1bN.js";import"./createVueComponent-DGcjOmEh.js";const x={class:"page"},k={class:"page-wrapper"},C={key:0,class:"page-header d-print-none"},V={class:"container-xxl"},N={class:"row g-2 align-items-center"},B={class:"col-auto ms-auto"},D={class:"btn-list"},E={class:"page-body"},I={class:"container-xxl"},L={class:"row"},z={class:"col-lg-12"},T=u({__name:"ApplicationRepository",setup(A){const c=m(),a=v(null),l=y(()=>c.name==="repositoryList"),d=()=>{var t,s;(s=(t=a.value)==null?void 0:t.startCreate)==null||s.call(t)};return(t,s)=>(o(),i("div",x,[e("div",k,[l.value?(o(),i("div",C,[e("div",V,[e("div",N,[s[1]||(s[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Repository")],-1)),e("div",B,[e("div",D,[e("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn","data-bs-toggle":"modal","data-bs-target":"#repositoryForm",onClick:d},[n(r(_),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),s[0]||(s[0]=f(" New Repository "))])])])])])])):g("",!0),e("div",E,[e("div",I,[e("div",L,[e("div",z,[n(r(R),null,{default:h(({Component:p})=>[(o(),b(w(p),{ref_key:"repositoryViewRef",ref:a},null,512))]),_:1})])])])])])]))}});export{T as default}; diff --git a/src/main/resources/static/assets/ApplicationStatus-DR0-O9-6.js b/src/main/resources/static/assets/ApplicationStatus-DR0-O9-6.js new file mode 100644 index 0000000..5fd971f --- /dev/null +++ b/src/main/resources/static/assets/ApplicationStatus-DR0-O9-6.js @@ -0,0 +1,57 @@ +import{d as F,f as B,g as U,r,c as A,a as t,e as j,t as x,m as at,j as N,v as z,F as q,k as G,l as E,o as $,w as ot,p as st,n as nt,i as it,x as lt,h as dt,b as T,q as rt,u as ct}from"./index-B9L3o1bN.js";import{I as pt}from"./IconRefresh-vvjw0GrU.js";import{_ as ut}from"./Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js";import{p as mt,r as vt,q as bt,t as ft,v as W,w as gt,l as yt,o as _t,A as St}from"./applicationDetailModal-DlYeJQEs.js";import{_ as ht}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createVueComponent-DGcjOmEh.js";import"./bootstrap.esm-Ceob_0pG.js";import"./request-BQy8ZIMN.js";const wt={class:"modal",id:"action-confirm",tabindex:"-1"},It={class:"modal-dialog modal-lg",role:"document"},Rt={class:"modal-content"},At={class:"modal-header"},$t={class:"modal-title"},Ct={key:0},kt={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},xt={class:"mb-3"},Nt=["value"],Tt={class:"mb-3"},Dt={class:"modal-footer d-flex justify-content-between"},Lt=F({__name:"applicationActionConfirm",props:{title:{},applicationStatusId:{},type:{},applicationName:{}},emits:["getApplicationsStatusList"],setup(k,{expose:C,emit:I}){const y=B(),c=k,s=I,p=U(()=>c.title),u=U(()=>c.applicationStatusId),b=U(()=>c.type),f=r(""),S=r(""),n=()=>{f.value="",S.value=""},a=r([]),l=async h=>{const{data:d}=await mt(h);a.value=d},R=async()=>{var d,m;const h={operation:p.value,applicationStatusId:u.value,reason:f.value,detailReason:S.value};try{const{data:g}=await vt(h),_=g;_&&_.success!==!1&&!_.error?y.success(`${p.value} Action SUCCESS`):y.error((_==null?void 0:_.error)||`${p.value} Action FAIL`)}catch(g){y.error(((m=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:m.message)||(g==null?void 0:g.message)||`${p.value} Action FAIL`)}finally{s("getApplicationsStatusList")}};return C({setInit:n,_getReasonList:l}),(h,d)=>($(),A("div",wt,[t("div",It,[t("div",Rt,[t("div",At,[t("h5",$t,[j(x(h.applicationName)+" "+x(p.value)+" ",1),b.value?($(),A("span",Ct,"("+x(b.value)+")",1)):at("",!0)]),t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:n})]),t("div",kt,[t("div",xt,[d[3]||(d[3]=t("label",{class:"form-label"},"Reason",-1)),N(t("select",{class:"form-select","onUpdate:modelValue":d[0]||(d[0]=m=>f.value=m)},[d[2]||(d[2]=t("option",{value:""},"Select Reason",-1)),($(!0),A(q,null,G(a.value,m=>($(),A("option",{value:m.label,key:m.label},x(m.label),9,Nt))),128))],512),[[z,f.value]])]),t("div",Tt,[d[4]||(d[4]=t("label",{class:"form-label"},"Detail Reason",-1)),d[5]||(d[5]=t("p",{class:"text-muted"}," Please enter a detail reason ",-1)),N(t("textarea",{class:"form-control",rows:"10",placeholder:"Detail Reason","onUpdate:modelValue":d[1]||(d[1]=m=>S.value=m)},null,512),[[E,S.value]])])]),t("div",Dt,[t("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:n}," Cancel "),t("div",null,[t("button",{class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:R},x(p.value),1)])])])])]))}}),Mt={class:"modal modal-blur fade",id:"rating-modal",tabindex:"-1",role:"dialog","aria-hidden":"true"},Ut={class:"modal-dialog modal-dialog-centered",role:"document"},Vt={class:"modal-content"},Et={class:"modal-body"},Ft={class:"mb-3"},Bt={class:"rating-stars"},qt=["onClick"],Pt={class:"mb-3"},Ot={class:"mb-3"},Wt={class:"mb-3"},jt={class:"mb-3"},zt={class:"modal-footer"},Gt=["disabled"],Kt=F({__name:"applicationRatingModal",props:{catalogId:{},applicationName:{}},emits:["ratingSubmitted"],setup(k,{emit:C}){const I=k,y=C,c=B(),s=r({rating:0,category:"",detailedComments:"",name:"",email:""}),p=n=>{s.value.rating=n},u=U(()=>s.value.rating>0&&s.value.category&&s.value.detailedComments&&s.value.name&&s.value.email),b=()=>{s.value={rating:0,category:"",detailedComments:"",name:"",email:""}},f=()=>{const n=document.getElementById("rating-modal");if(n)try{if(window.bootstrap&&window.bootstrap.Modal){const a=window.bootstrap.Modal.getInstance(n);a?a.hide():new window.bootstrap.Modal(n).hide()}else n.style.display="none",n.classList.remove("show"),n.setAttribute("aria-hidden","true"),n.removeAttribute("aria-modal"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(l=>l.remove()),document.body.style.overflow="",document.body.style.paddingRight=""}catch(a){console.error("Error closing modal:",a),n.style.display="none",n.classList.remove("show"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(R=>R.remove())}},S=async()=>{if(!u.value){c.error("Please fill in all fields");return}try{const n={catalogId:I.catalogId,rating:s.value.rating,category:s.value.category,detailedComments:s.value.detailedComments,name:s.value.name,email:s.value.email,metadata:JSON.stringify({version:"1.0.0",environment:"production",applicationName:I.applicationName})};await bt(n)&&(c.success("Rating submitted successfully"),b(),y("ratingSubmitted"),f())}catch(n){console.error("Rating submission error:",n),c.error("Failed to submit rating")}};return(n,a)=>($(),A("div",Mt,[t("div",Ut,[t("div",Vt,[a[11]||(a[11]=t("div",{class:"modal-header"},[t("h5",{class:"modal-title"},"Application Rating"),t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),t("div",Et,[t("form",{onSubmit:ot(S,["prevent"])},[t("div",Ft,[a[4]||(a[4]=t("label",{class:"form-label"},"Overall Rating",-1)),t("div",Bt,[($(),A(q,null,G(5,l=>t("span",{key:l,class:nt(["star",{active:l<=s.value.rating}]),onClick:R=>p(l)}," ★ ",10,qt)),64))])]),t("div",Pt,[a[6]||(a[6]=t("label",{class:"form-label"},"Category",-1)),N(t("select",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value.category=l),class:"form-select",required:""},a[5]||(a[5]=[st('',6)]),512),[[z,s.value.category]])]),t("div",Ot,[a[7]||(a[7]=t("label",{class:"form-label"},"Detailed Comments",-1)),N(t("textarea",{"onUpdate:modelValue":a[1]||(a[1]=l=>s.value.detailedComments=l),class:"form-control",rows:"4",placeholder:"Enter detailed comments",required:""},null,512),[[E,s.value.detailedComments]])]),t("div",Wt,[a[8]||(a[8]=t("label",{class:"form-label"},"Name",-1)),N(t("input",{"onUpdate:modelValue":a[2]||(a[2]=l=>s.value.name=l),type:"text",class:"form-control",placeholder:"Enter your name",required:""},null,512),[[E,s.value.name]])]),t("div",jt,[a[9]||(a[9]=t("label",{class:"form-label"},"Email",-1)),N(t("input",{"onUpdate:modelValue":a[3]||(a[3]=l=>s.value.email=l),type:"email",class:"form-control",placeholder:"Enter your email",required:""},null,512),[[E,s.value.email]])])],32)]),t("div",zt,[a[10]||(a[10]=t("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Cancel",-1)),t("button",{type:"button",class:"btn btn-primary",onClick:S,disabled:!u.value},"Submit",8,Gt)])])])]))}}),Ht=ht(Kt,[["__scopeId","data-v-6565f21d"]]),Jt={class:"card w-100"},Qt="application-status-detail-modal",Xt=F({__name:"applicationStatusList",props:{nsId:{default:""}},emits:["refresh-time-updated"],setup(k,{expose:C,emit:I}){const y=B(),c=k,s=I,p=window.self!==window.top;let u=!1,b=0;const f=r([]),S=r([]),n=r(""),a=r(""),l=r(0),R=r(""),h=r(""),d=r(0);r(!1);const m=r(0),g=r(),_=r();it(async()=>{u=!0,H(),await D()}),lt(()=>{b+=1}),dt(()=>c.nsId,async(e,o)=>{var i;e!==o&&(b+=1,f.value=[],l.value=0,m.value=0,R.value="",h.value="",d.value=0,(i=g.value)==null||i.resetData(),u&&await D())});const D=async()=>{const e=++b,o=String(c.nsId||"").trim();try{if(K(),p&&!o){f.value=[];return}const{data:i}=await ft(o||void 0);if(e!==b||o!==String(c.nsId||"").trim())return;i?f.value=i:f.value=[]}catch{if(e!==b)return;y.error("Unable to retrieve data")}},K=()=>{const e=new Date,o={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};n.value=e.toLocaleDateString("ko-KR",o),s("refresh-time-updated",n.value)},H=()=>{S.value=[{title:"Infra",width:230,minWidth:180,formatter:J,cellClick:function(e,o){V(o)}},{title:"Application",field:"applicationName",width:180,minWidth:150,cellClick:function(e,o){V(o)},formatter:function(e){return`
${e.getValue()}
`}},{title:"Status",width:210,minWidth:190,formatter:X,cellClick:function(e,o){V(o)}},{title:"CheckedAt",field:"checkedAt",width:210,minWidth:190,cellClick:function(e,o){V(o)},formatter:function(e){return`
${e.getValue()}
`}},{title:"Action",width:320,minWidth:300,headerSort:!1,formatter:Y,cellClick:async function(e,o){const i=e.target,v=i==null?void 0:i.getAttribute("id"),M=o.getRow().getData().status;if(v==="uninstall-btn"?W(M):P(M))return;const O=o.getRow().getData().id,tt=o.getRow().getData().deploymentType,et=o.getRow().getData().applicationName,w={operation:"",applicationStatusId:O,deploymentType:tt,applicationName:et};v==="start-btn"?(w.operation="START",await L(w)):v==="restart-btn"?(w.operation="RESTART",await L(w)):v==="stop-btn"?(w.operation="STOP",await L(w)):v==="uninstall-btn"?(w.operation="UNINSTALL",await L(w)):v==="rating-btn"&&(w.operation="RATING",d.value=o.getRow().getData().catalogId||1,await L(w))}}]},L=async e=>{a.value=e.operation,l.value=e.applicationStatusId,R.value=e.deploymentType,h.value=e.applicationName,_.value&&(_.value.setInit(),_.value._getReasonList(e.operation))},V=e=>{var v;const o=e.getRow().getData(),i=o.deploymentHistoryId||o.deploymentId;if(!i){y.warning("Deployment logs are not available for this record.");return}m.value=i,(v=g.value)==null||v.open(i)},J=e=>{const o=e.getRow().getData(),i=o.deploymentType,v=Q(o);return` +
+

+ ${i} (${v}) +

+
+ `},Q=e=>e.deploymentType==="VM"?[e.namespace,e.mciId,e.vmId].filter(Boolean).join(" / ")||"-":e.deploymentType==="K8S"?[e.namespace,e.clusterName].filter(Boolean).join(" / ")||"-":e.vmId||e.clusterName||"-",P=e=>gt(e),X=e=>{const o=e.getRow().getData().status,i=yt(o);return` +
+ + ${i} + +
`},Y=e=>{const o=e.getRow().getData().status,i=P(o)?"disabled":"",v=W(o)?"disabled":"",M=String(o||"").trim().toUpperCase();return` +
+ ${M==="STOP"||M==="STOPPED"?` + + `:` + + + `} + + +
`};return C({refresh:D}),(e,o)=>($(),A(q,null,[t("div",Jt,[T(ut,{columns:S.value,"table-data":f.value},null,8,["columns","table-data"])]),T(Lt,{ref_key:"applicationActionConfirmModalRef",ref:_,title:a.value,applicationStatusId:l.value,type:R.value,applicationName:h.value,onGetApplicationsStatusList:D},null,8,["title","applicationStatusId","type","applicationName"]),T(Ht,{catalogId:d.value,applicationName:h.value,onRatingSubmitted:D},null,8,["catalogId","applicationName"]),T(St,{ref_key:"applicationDetailModalRef",ref:g,"modal-id":Qt,deploymentId:m.value},null,8,["deploymentId"])],64))}}),Yt={class:"page"},Zt={class:"page-wrapper"},te={class:"page-header d-print-none"},ee={class:"container-xxl"},ae={class:"row g-2 align-items-center"},oe={class:"col-auto ms-auto"},se={class:"btn-list"},ne={class:"me-2 d-none d-md-inline"},ie={class:"page-body"},le={class:"container-xxl"},de={class:"row"},re={class:"col-lg-12"},ye=F({__name:"ApplicationStatus",setup(k){const C=rt(),I=U(()=>C.getNsId()||""),y=r(""),c=r(null),s=()=>{var p;(p=c.value)==null||p.refresh()};return(p,u)=>($(),A("div",Yt,[t("div",Zt,[t("div",te,[t("div",ee,[t("div",ae,[u[2]||(u[2]=t("div",{class:"col d-flex"},[t("h2",{class:"page-title"},"App Status")],-1)),t("div",oe,[t("div",se,[t("span",ne,x(y.value),1),t("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn",onClick:s},[T(ct(pt),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),u[1]||(u[1]=j(" Refresh "))])])])])])]),t("div",ie,[t("div",le,[t("div",de,[t("div",re,[T(Xt,{ref_key:"applicationStatusListRef",ref:c,"ns-id":I.value,onRefreshTimeUpdated:u[0]||(u[0]=b=>y.value=b)},null,8,["ns-id"])])])])])])]))}});export{ye as default}; diff --git a/src/main/resources/static/assets/IconPlus-CfVojf7j.js b/src/main/resources/static/assets/IconPlus-CfVojf7j.js new file mode 100644 index 0000000..ee80d2e --- /dev/null +++ b/src/main/resources/static/assets/IconPlus-CfVojf7j.js @@ -0,0 +1,6 @@ +import{c as e}from"./createVueComponent-DGcjOmEh.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var s=e("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);export{s as I}; diff --git a/src/main/resources/static/assets/IconRefresh-vvjw0GrU.js b/src/main/resources/static/assets/IconRefresh-vvjw0GrU.js new file mode 100644 index 0000000..a9629a1 --- /dev/null +++ b/src/main/resources/static/assets/IconRefresh-vvjw0GrU.js @@ -0,0 +1,6 @@ +import{c as e}from"./createVueComponent-DGcjOmEh.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var a=e("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);export{a as I}; diff --git a/src/main/resources/static/assets/InstallSoftwareIframe-56DCha6l.js b/src/main/resources/static/assets/InstallSoftwareIframe-56DCha6l.js new file mode 100644 index 0000000..a8450ab --- /dev/null +++ b/src/main/resources/static/assets/InstallSoftwareIframe-56DCha6l.js @@ -0,0 +1 @@ +import{d as k,q as E,g as m,h as w,i as M,c as i,a,u as o,t as p,F as N,s as A,o as n}from"./index-B9L3o1bN.js";import{p as R,A as b}from"./applicationInstallationForm-CmPX1mlj.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./bootstrap.esm-Ceob_0pG.js";import"./lodash-PecLoxXt.js";import"./request-BQy8ZIMN.js";import"./applicationDetailModal-DlYeJQEs.js";import"./createVueComponent-DGcjOmEh.js";const S={class:"install-page"},x={key:0,class:"alert alert-danger",role:"alert"},L={class:"target-summary","aria-label":"Fixed deployment target"},V={key:0},h={class:"target-label"},G={key:1},F={key:0,class:"alert alert-info",role:"status"},B="MCMP_AM_INSTALL_EVENT",D=k({__name:"InstallSoftwareIframe",setup(O){const l=E(),t=R(window.location.search),g=e=>{const r=String(e??"").trim();return["undefined","null"].includes(r.toLowerCase())?"":r},u=m(()=>g(l.getNsId())),c=m(()=>{var e,r,s,I;return!!(g(l.accessToken)&&g(((e=l.workspaceInfo)==null?void 0:e.id)??((r=l.workspaceInfo)==null?void 0:r.Id))&&g(((s=l.projectInfo)==null?void 0:s.id)??((I=l.projectInfo)==null?void 0:I.Id))&&u.value)}),f=m(()=>!t.ok||t.target.targetType!=="VM"?"":[t.target.mciId,t.target.nodeGroupId,t.target.vmId].filter(Boolean).join(" / ")),v=m(()=>!t.ok||t.target.targetType!=="VM"?"":t.target.vmId?t.target.nodeGroupId?"Infra / NodeGroup / VM":"Infra / VM":"Infra / NodeGroup"),y=()=>{if(!t.ok)return;const e=t.target;return e.targetType==="VM"?{targetType:e.targetType,mciId:e.mciId,...e.nodeGroupId?{nodeGroupId:e.nodeGroupId}:{},...e.vmId?{vmId:e.vmId}:{}}:{targetType:e.targetType,clusterId:e.clusterId}},d=(e,r={})=>{window.parent!==window&&window.parent.postMessage({type:B,version:1,requestId:t.ok?t.target.requestId:"",status:e,target:y(),...r},"*")},_=()=>{d("FORM_READY")},T=e=>{const r=g(e.status);if(!r)return;const s={};e.deploymentId&&(s.deploymentId=e.deploymentId),e.message&&(s.message=e.message),d(r,s)};return w(c,(e,r)=>{e&&!r&&d("CONTEXT_READY")},{immediate:!0}),M(()=>{d("IFRAME_READY"),t.ok||d("CONFIGURATION_ERROR",{message:t.error})}),(e,r)=>(n(),i("main",S,[r[4]||(r[4]=a("header",{class:"install-page-header"},[a("div",null,[a("p",{class:"text-uppercase text-muted small mb-1"},"MC Application Manager"),a("h1",{class:"h2 mb-1"},"Install Software"),a("p",{class:"text-muted mb-0"},"The target is fixed by the calling Workload screen.")])],-1)),o(t).ok?(n(),i(N,{key:1},[a("section",L,[a("div",null,[r[2]||(r[2]=a("span",{class:"target-label"},"Target type",-1)),a("strong",null,p(o(t).target.targetType),1)]),o(t).target.targetType==="VM"?(n(),i("div",V,[a("span",h,p(v.value),1),a("strong",null,p(f.value),1)])):(n(),i("div",G,[r[3]||(r[3]=a("span",{class:"target-label"},"Cluster",-1)),a("strong",null,p(o(t).target.clusterId),1)]))]),c.value?(n(),A(b,{key:1,"form-id":"install-sw-iframe-form",title:"Application Installation","ns-id":u.value,embedded:!0,"target-type":o(t).target.targetType,"target-mci-id":o(t).target.mciId,"target-vm-id":o(t).target.vmId,"target-node-group-id":o(t).target.nodeGroupId,"target-cluster-id":o(t).target.clusterId,onReady:_,onDeploymentEvent:T,onCancel:r[0]||(r[0]=s=>d("CANCELLED"))},null,8,["ns-id","target-type","target-mci-id","target-vm-id","target-node-group-id","target-cluster-id"])):(n(),i("div",F," Waiting for Workspace and Project context from MC-WEB-CONSOLE… "))],64)):(n(),i("div",x,[r[1]||(r[1]=a("strong",null,"Invalid installation request.",-1)),a("div",null,p(o(t).error),1)]))]))}}),$=C(D,[["__scopeId","data-v-5183bd18"]]);export{$ as default}; diff --git a/src/main/resources/static/assets/OssList-CKt67AF3.js b/src/main/resources/static/assets/OssList-CKt67AF3.js new file mode 100644 index 0000000..675815f --- /dev/null +++ b/src/main/resources/static/assets/OssList-CKt67AF3.js @@ -0,0 +1,17 @@ +import{d as T,o as u,c as m,a as s,t as k,w as P,b as O,u as $,e as L,r as p,f as D,g as G,h as F,i as B,j as h,v as H,F as W,k as J,l as x}from"./index-B9L3o1bN.js";import{I as E}from"./IconPlus-CfVojf7j.js";import{_ as K}from"./Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js";import{s as f}from"./request-BQy8ZIMN.js";import{M as Q}from"./bootstrap.esm-Ceob_0pG.js";import"./createVueComponent-DGcjOmEh.js";const X={class:"page-header page-wrapper"},Y={class:"row align-items-center"},Z={class:"card-header d-flex",style:{"justify-content":"space-between"}},ss={class:"card-title"},es={class:"btn-list"},ts=["data-bs-target"],os=T({__name:"TableHeader",props:{headerTitle:{},newBtnTitle:{},popupFlag:{type:Boolean},popupTarget:{}},emits:["click-new-btn"],setup(l,{emit:w}){const i=l,c=w,o=()=>{c("click-new-btn")};return(n,g)=>(u(),m("div",X,[s("div",Y,[s("div",Z,[s("h3",ss,[s("strong",null,k(i.headerTitle),1)]),s("div",es,[i.popupFlag?(u(),m("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":i.popupTarget,onClick:P(o,["prevent","stop"])},[O($(E),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),L(" "+k(i.newBtnTitle),1)],8,ts)):(u(),m("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:P(o,["prevent","stop"])},[O($(E),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),L(" "+k(i.newBtnTitle),1)]))])])])]))}}),as=()=>f.get("/ossType/list"),ls=()=>f.get("/ossType/filter/list"),ns=()=>f.get("/oss/list");function rs(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function is(l){return f.post("/oss/connection-check",l)}function ds(l){return f.get("/oss/"+l)}function cs(l){return f.post("/oss",l)}function us(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ms(l){return f.delete(`/oss/${l}`)}const ps={class:"modal-dialog modal-xl",role:"document"},vs={class:"modal-content"},bs={class:"modal-body text-left py-4"},fs={class:"mb-5"},gs={class:"mb-3"},ys={class:"grid gap-0 column-gap-3"},ws=["value"],Ss={class:"row mb-3"},_s={class:"grid gap-0 column-gap-3"},ks={class:"mb-3"},hs={class:"mb-3"},Os={class:"row"},Cs={class:"col"},xs={class:"col"},Ts={class:"col mt-4 row"},Us={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},Is={key:3,class:"btn btn-success col"},Ds={class:"modal-footer"},Ns=T({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:w}){const i=p(),c=p(),o=D(),n=l,g=w,d=G(()=>n.ossIdx);F(d,async()=>{await y()}),F(()=>n.mode,async()=>{await b(n.mode)}),B(async()=>{i.value&&(c.value=new Q(i.value)),await b("init"),await y()});const t=p({}),y=async()=>{if(n.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",v.value=!1,_.value=!1;else{const{data:a}=await ds(n.ossIdx);t.value=a,t.value.ossPassword=j(t.value.ossPassword),v.value=!0,_.value=!0}},C=p([]),b=async a=>{try{if(a==="new"||a==="init"){const{data:e}=await ls();C.value=e}else{const{data:e}=await as();C.value=e}}catch(e){console.log(e)}},S=()=>{t.value.ossPassword="",_.value=!1},v=p(!1),U=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:e}=await rs(a);e?o.error("The name is already in use."):(o.success("The name is available."),v.value=!0)},_=p(!1),R=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:N(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:e}=await is(a);e?(o.success("The OSS is available."),_.value=!0):o.error("The OSS is unavailable.")},V=()=>{v.value=!1},I=()=>{_.value=!1},A=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!v.value){o.error("Please perform duplicate check.");return}if(!_.value){o.error("Please perform connection check.");return}t.value.ossPassword=N(t.value.ossPassword);let a=!1;n.mode==="new"?a=await q():a=await M(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const e=document.querySelector(".modal-backdrop");e==null||e.remove()},150)))},q=async()=>{try{const{data:a}=await cs(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},M=async()=>{try{const{data:a}=await us(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},N=a=>btoa(a),j=a=>atob(a);return(a,e)=>(u(),m("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:i},[s("div",ps,[s("div",vs,[e[15]||(e[15]=s("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),s("div",bs,[s("h3",fs,k(n.mode==="new"?"New":"Edit")+" OSS ",1),s("div",null,[s("div",gs,[e[9]||(e[9]=s("label",{class:"form-label required"},"OSS Type",-1)),s("div",ys,[h(s("select",{"onUpdate:modelValue":e[0]||(e[0]=r=>t.value.ossTypeIdx=r),class:"form-select p-2 g-col-12"},[e[8]||(e[8]=s("option",{value:0},"Select OSS Type",-1)),(u(!0),m(W,null,J(C.value,(r,z)=>(u(),m("option",{value:r.ossTypeIdx,key:z},k(r.ossTypeName),9,ws))),128))],512),[[H,t.value.ossTypeIdx]])])]),s("div",Ss,[e[10]||(e[10]=s("label",{class:"form-label required"},"OSS Name",-1)),s("div",_s,[h(s("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":e[1]||(e[1]=r=>t.value.ossName=r),onChange:V},null,544),[[x,t.value.ossName]])])]),s("div",ks,[e[11]||(e[11]=s("label",{class:"form-label required"},"OSS Description",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":e[2]||(e[2]=r=>t.value.ossDesc=r)},null,512),[[x,t.value.ossDesc]])]),s("div",hs,[e[12]||(e[12]=s("label",{class:"form-label required"},"URL",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":e[3]||(e[3]=r=>t.value.ossUrl=r),onFocus:I},null,544),[[x,t.value.ossUrl]])]),s("div",Os,[s("div",Cs,[e[13]||(e[13]=s("label",{class:"form-label required"},"OSS ID",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":e[4]||(e[4]=r=>t.value.ossUsername=r),onFocus:I},null,544),[[x,t.value.ossUsername]])]),s("div",xs,[e[14]||(e[14]=s("label",{class:"form-label required"},"OSS PW",-1)),h(s("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":e[5]||(e[5]=r=>t.value.ossPassword=r),onClick:S,onFocus:I},null,544),[[x,t.value.ossPassword]])]),s("div",Ts,[v.value?(u(),m("button",Us,"Duplicate Check")):(u(),m("button",{key:0,class:"btn btn-primary col",onClick:U,style:{"margin-right":"3px"}},"Duplicate Check")),_.value?(u(),m("button",Is,"Connection Check")):(u(),m("button",{key:2,class:"btn btn-primary col",onClick:R},"Connection Check"))])])])]),s("div",Ds,[s("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:e[6]||(e[6]=r=>y())}," Cancel "),s("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:e[7]||(e[7]=r=>A())},k(n.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),Ps={class:"modal fade",id:"deleteOss",tabindex:"-1"},$s={class:"modal-dialog modal-lg",role:"document"},Ls={class:"modal-content"},Fs={class:"modal-body text-left py-4"},Es={class:"modal-footer"},Bs=T({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:w}){const i=D(),c=l,o=w,n=async()=>{const{data:g}=await ms(c.ossIdx);g?i.success("Deleted successfully."):i.error("Failed to delete."),o("get-oss-list")};return(g,d)=>(u(),m("div",Ps,[s("div",$s,[s("div",Ls,[d[3]||(d[3]=s("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),d[4]||(d[4]=s("div",{class:"modal-status bg-danger"},null,-1)),s("div",Fs,[d[1]||(d[1]=s("h3",{class:"mb-5"}," Delete OSS ",-1)),s("h4",null,"Are you sure you want to delete "+k(c.ossName)+"?",1)]),s("div",Es,[d[2]||(d[2]=s("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),s("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:d[0]||(d[0]=t=>n())}," Delete ")])])])]))}}),Rs={class:"card card-flush w-100"},Vs={ref:"table-responsive"},Hs=T({__name:"OssList",setup(l){const w=D(),i=p([]),c=p([]);B(async()=>{d(),await o()});const o=async()=>{try{const{data:b}=await ns();i.value=b}catch(b){console.log(b),w.error("데이터를 가져올 수 없습니다.")}},n=p(0),g=p(""),d=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(b,S){const v=b.target,U=v==null?void 0:v.getAttribute("id");n.value=S.getRow().getData().ossIdx,U==="edit-btn"?y.value="edit":g.value=S.getRow().getData().ossName}}]},t=()=>` +
+ + +
`,y=p("new"),C=()=>{n.value=0,y.value="new"};return(b,S)=>(u(),m("div",Rs,[O(os,{"header-title":"OSS","new-btn-title":"New OSS","popup-flag":!0,"popup-target":"#ossForm",onClickNewBtn:C}),O(K,{columns:c.value,"table-data":i.value},null,8,["columns","table-data"]),s("div",Vs,S[0]||(S[0]=[s("div",{class:"table table-vcenter table-bordered table-nowrap card-table"},null,-1)]),512),O(Ns,{mode:y.value,"oss-idx":n.value,onGetOssList:o},null,8,["mode","oss-idx"]),O(Bs,{"oss-name":g.value,"oss-idx":n.value,onGetOssList:o},null,8,["oss-name","oss-idx"])]))}});export{Hs as default}; diff --git a/src/main/resources/static/assets/RepositoryDetail-Bjm5j-jk.js b/src/main/resources/static/assets/RepositoryDetail-Bjm5j-jk.js new file mode 100644 index 0000000..af4e955 --- /dev/null +++ b/src/main/resources/static/assets/RepositoryDetail-Bjm5j-jk.js @@ -0,0 +1,15 @@ +import{d as C,f as D,c as $,a as t,t as V,o as N,i as x,r as u,j as y,l as w,D as B,I as L,h as A,b as _}from"./index-B9L3o1bN.js";import{b as S,c as z,g as P,e as q}from"./repository-CExw8hce.js";import{_ as E}from"./lodash-PecLoxXt.js";import{_ as T}from"./Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js";import"./request-BQy8ZIMN.js";const G={class:"modal fade",id:"deleteComponent",tabindex:"-1"},M={class:"modal-dialog modal-lg",role:"document"},j={class:"modal-content"},K={class:"modal-body text-left py-4"},H={class:"modal-footer"},J=C({__name:"deleteComponent",props:{componentName:{},componentId:{}},emits:["get-detail"],setup(b,{emit:f}){const d=D(),r=b,i=f,m=async()=>{const{data:l}=await S("nexus",r.componentId);l?d.success("Deleted successfully."):d.error("Failed to delete."),i("get-detail")};return(l,a)=>(N(),$("div",G,[t("div",M,[t("div",j,[a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),a[4]||(a[4]=t("div",{class:"modal-status bg-danger"},null,-1)),t("div",K,[a[1]||(a[1]=t("h3",{class:"mb-5"}," Delete Component ",-1)),t("h4",null,"Are you sure you want to delete "+V(r.componentName)+"?",1)]),t("div",H,[a[2]||(a[2]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[0]||(a[0]=v=>m())}," Delete ")])])])]))}}),O={class:"modal fade",id:"uploadComponent",tabindex:"-1"},Q={class:"modal-dialog modal-lg",role:"document"},W={class:"modal-content"},X={class:"modal-body text-left py-4"},Y={class:"mb-3"},Z=["value"],tt={class:"mb-3"},et=["disabled"],ot={class:"mb-3"},st={class:"grid gap-0 column-gap-3"},lt={class:"modal-footer"},at=C({__name:"uploadComponent",props:{repositoryName:{},format:{}},emits:["get-detail"],setup(b,{emit:f}){const d=D(),r=b,i=f;x(()=>{p()});const m=u("/"),l=u([]),a=c=>{l.value=c.target.files[0]},v=async()=>{if(r.format=="raw"&&E.isEmpty(m.value)){d.error("Please enter the path.");return}if(l.value.length==0){d.error("No file selected.");return}const c=new FormData;c.append("assets",l.value),c.append("directory",m.value);const{data:s}=await z("nexus",r.repositoryName,c);s?d.success("Uploaded successfully."):d.error("Failed to upload."),i("get-detail")},p=()=>{m.value="/",l.value=[]};return(c,s)=>(N(),$("div",O,[t("div",Q,[t("div",W,[s[7]||(s[7]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),t("div",X,[s[5]||(s[5]=t("h3",{class:"mb-5"}," File Upload ",-1)),t("div",null,[t("div",Y,[s[2]||(s[2]=t("label",{class:"form-label"},"Name",-1)),t("input",{type:"text",class:"form-control p-2 g-col-11",value:r.repositoryName,readonly:""},null,8,Z)]),t("div",tt,[s[3]||(s[3]=t("label",{class:"form-label"},"Path",-1)),y(t("input",{type:"text",class:"form-control p-2 g-col-11","onUpdate:modelValue":s[0]||(s[0]=g=>m.value=g),disabled:r.format!="raw"},null,8,et),[[w,m.value]])]),t("div",ot,[s[4]||(s[4]=t("label",{class:"form-label required"},"File",-1)),t("div",st,[t("input",{type:"file",class:"form-control p-2 g-col-11",onChange:a},null,32)])])])]),t("div",lt,[s[6]||(s[6]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:s[1]||(s[1]=g=>v())}," Upload ")])])])]))}}),nt={class:"card w-100",ref:"workflowForm"},it={class:"card-body"},dt={class:"card-title"},rt={class:"mb-3"},mt={class:"grid gap-0 column-gap-3"},ct={class:"mb-3"},ut={class:"grid gap-0 column-gap-3"},pt={class:"mb-3"},bt={class:"grid gap-0 column-gap-3"},ft={class:"mb-3"},vt={class:"grid gap-0 column-gap-3"},gt={class:"mb-3"},$t=C({__name:"RepositoryDetail",props:{embedded:{type:Boolean},repositoryName:{}},emits:["back-to-list"],setup(b,{emit:f}){D();const d=B(),r=L(),i=b,m=f,l=u({}),a=u([]),v=u([]);x(async()=>{h(),i.embedded||await p()});const p=async n=>{const e=d.params.repositoryName,o=n??(i.embedded?i.repositoryName:e);if(!o)return;const{data:k}=await P("nexus",o);l.value=k,await c()};A(()=>i.repositoryName,async n=>{i.embedded&&n&&await p(n)},{immediate:!0});const c=async()=>{const{data:n}=await q("nexus",l.value.name);a.value=n},s=u(""),g=u(""),h=()=>{v.value=[{title:"Name",field:"name",width:"15%"},{title:"URL(Path)",field:"assets",width:"50%",formatter:function(n){const e=n.getValue();return e&&e.length>0?e[0].downloadUrl:"N/A"}},{title:"Size",field:"assets",width:"15%",formatter:function(n){const e=n.getValue();return e&&e.length>0?`${(e[0].fileSize/1024).toFixed(2)} KB`:"N/A"}},{title:"Action",width:"20%",formatter:U,cellClick:function(n,e){const o=n.target;if((o==null?void 0:o.getAttribute("id"))==="download-btn"){console.log("download");let I=e.getRow().getData();F(I)}else s.value=e.getRow().getData().id,g.value=e.getRow().getData().name}}]},U=()=>` +
+ + +
`,F=n=>{const e=n.assets[0].downloadUrl,o=document.createElement("a");o.href=e,o.download="",document.body.appendChild(o),o.click(),document.body.removeChild(o)},R=()=>{i.embedded?m("back-to-list"):r.push({name:"repositoryList"})};return(n,e)=>(N(),$("div",nt,[e[9]||(e[9]=t("div",{class:"card-header"},[t("div",{class:"card-title"},[t("h1",null,"Repository Detail")])],-1)),t("div",it,[t("div",dt,[t("div",rt,[e[4]||(e[4]=t("label",{class:"form-label"},"Name",-1)),t("div",mt,[y(t("input",{type:"text",ref:"repositoryName",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[0]||(e[0]=o=>l.value.name=o),disabled:""},null,512),[[w,l.value.name]])])]),t("div",ct,[e[5]||(e[5]=t("label",{class:"form-label"},"Format",-1)),t("div",ut,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[1]||(e[1]=o=>l.value.format=o),disabled:""},null,512),[[w,l.value.format]])])]),t("div",pt,[e[6]||(e[6]=t("label",{class:"form-label required"},"URL(Path)",-1)),t("div",bt,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[2]||(e[2]=o=>l.value.url=o),disabled:""},null,512),[[w,l.value.url]])])]),t("div",ft,[e[7]||(e[7]=t("label",{class:"form-label required"},"Type(hosted)",-1)),t("div",vt,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[3]||(e[3]=o=>l.value.type=o),disabled:""},null,512),[[w,l.value.type]])])]),t("div",gt,[_(T,{columns:v.value,"table-data":a.value},null,8,["columns","table-data"])]),t("div",{class:"row align-items-center"},[e[8]||(e[8]=t("div",{id:"gap",class:"col"},null,-1)),t("div",{class:"col-auto ms-auto"},[t("div",{class:"btn-list"},[t("button",{class:"btn btn-outline-primary",onClick:R}," Back to List ")])])])]),_(J,{"component-name":g.value,"component-id":s.value,onGetDetail:p},null,8,["component-name","component-id"]),_(at,{"repository-name":l.value.name,format:l.value.format,onGetDetail:p},null,8,["repository-name","format"])])],512))}});export{$t as default}; diff --git a/src/main/resources/static/assets/RepositoryList-j_fxhQrY.js b/src/main/resources/static/assets/RepositoryList-j_fxhQrY.js new file mode 100644 index 0000000..453c146 --- /dev/null +++ b/src/main/resources/static/assets/RepositoryList-j_fxhQrY.js @@ -0,0 +1,17 @@ +import{_ as $}from"./Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js";import{g as P,r as V,u as B,d as L,a as M}from"./repository-CExw8hce.js";import{d as C,f as D,r as p,g as q,h as A,i as N,c as x,a as t,t as _,j as c,l as E,z as y,o as F,b as R,H as T}from"./index-B9L3o1bN.js";import{M as S}from"./bootstrap.esm-Ceob_0pG.js";import"./request-BQy8ZIMN.js";const I={class:"modal-dialog modal-lg",role:"document"},G={class:"modal-content"},O={class:"modal-header"},j={class:"modal-title"},z={class:"modal-body py-4"},H={class:"row mb-3"},J=["disabled"],K={class:"mb-3"},Q={class:"form-check form-check-inline"},W=["disabled"],X={class:"form-check form-check-inline"},Y=["disabled"],Z={class:"mb-3"},ee={class:"form-check form-check-inline"},te={class:"form-check form-check-inline"},oe={class:"form-check form-check-inline"},le={class:"mb-3"},se={class:"form-check form-check-inline"},ae={class:"form-check form-check-inline"},ne={class:"modal-footer"},ie=C({__name:"repositoryForm",props:{mode:{},repositoryName:{}},emits:["get-repository-list"],setup(v,{emit:b}){const s=D(),m=p(),f=p(),r=v,u=b,a=q(()=>r.repositoryName);A(a,async()=>{await d()}),N(async()=>{m.value&&(f.value=new S(m.value)),await d()});const o=p({}),n=p(""),d=async()=>{if(r.mode==="new")o.value.name="",o.value.format="helm",o.value.type="hosted",o.value.url="",o.value.online=!0,n.value="allow";else{const{data:i}=await P("nexus",r.repositoryName);o.value=i,n.value=i.storage.writePolicy}},w=async()=>{if(!o.value.name||o.value.name.trim()===""){s.error("Please enter repository name.");return}if(!o.value.format){s.error("Please select format.");return}if(!n.value){s.error("Please select allow policy.");return}if(o.value.online===void 0||o.value.online===null){s.error("Please select online/offline status.");return}if(o.value.storage={blobStoreName:"default",strictContentTypeValidation:!0,writePolicy:n.value},o.value.format!="docker")o.value.docker={};else{const e={v1Enabled:!1,forceBasicAuth:!0};o.value.docker=e}let i=!1;r.mode==="new"?i=await g():i=await k(),i&&(u("get-repository-list"),d(),f.value&&(f.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const e=document.querySelector(".modal-backdrop");e==null||e.remove()},150)))},g=async()=>{try{const{data:i}=await V("nexus",o.value);return i?(s.success("Repository created successfully."),!0):(s.error("Failed to create repository."),!1)}catch{return s.error("Failed to create repository."),!1}},k=async()=>{try{const{data:i}=await B("nexus",o.value);return i?(s.success("Repository updated successfully."),!0):(s.error("Failed to update repository."),!1)}catch{return s.error("Failed to update repository."),!1}};return(i,e)=>(F(),x("div",{class:"modal fade",id:"repositoryForm",tabindex:"-1",ref_key:"modalElement",ref:m},[t("div",I,[t("div",G,[t("div",O,[t("h3",j,"Repository "+_(r.mode==="new"?"Create":"Update"),1),e[10]||(e[10]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",z,[t("div",null,[t("div",H,[e[11]||(e[11]=t("label",{class:"form-label required"},"Name",-1)),c(t("input",{type:"text",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[0]||(e[0]=l=>o.value.name=l),disabled:r.mode!="new",placeholder:"Enter repository name"},null,8,J),[[E,o.value.name]])]),t("div",K,[e[14]||(e[14]=t("label",{class:"form-label required"},"Format",-1)),t("div",null,[t("label",Q,[c(t("input",{class:"form-check-input",type:"radio",name:"format",value:"helm","onUpdate:modelValue":e[1]||(e[1]=l=>o.value.format=l),disabled:r.mode!="new"},null,8,W),[[y,o.value.format]]),e[12]||(e[12]=t("span",{class:"form-check-label"},"helm",-1))]),t("label",X,[c(t("input",{class:"form-check-input",type:"radio",name:"format",value:"docker","onUpdate:modelValue":e[2]||(e[2]=l=>o.value.format=l),disabled:r.mode!="new"},null,8,Y),[[y,o.value.format]]),e[13]||(e[13]=t("span",{class:"form-check-label"},"docker",-1))])])]),t("div",Z,[e[18]||(e[18]=t("label",{class:"form-label required"},"Allow",-1)),t("div",null,[t("label",ee,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"allow","onUpdate:modelValue":e[3]||(e[3]=l=>n.value=l)},null,512),[[y,n.value]]),e[15]||(e[15]=t("span",{class:"form-check-label"},"allow",-1))]),t("label",te,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"allow_once","onUpdate:modelValue":e[4]||(e[4]=l=>n.value=l)},null,512),[[y,n.value]]),e[16]||(e[16]=t("span",{class:"form-check-label"},"allow_once",-1))]),t("label",oe,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"deny","onUpdate:modelValue":e[5]||(e[5]=l=>n.value=l)},null,512),[[y,n.value]]),e[17]||(e[17]=t("span",{class:"form-check-label"},"deny",-1))])])]),t("div",le,[e[21]||(e[21]=t("label",{class:"form-label required"},"On/Offline",-1)),t("div",null,[t("label",se,[c(t("input",{class:"form-check-input",type:"radio",name:"online",value:"true","onUpdate:modelValue":e[6]||(e[6]=l=>o.value.online=l)},null,512),[[y,o.value.online]]),e[19]||(e[19]=t("span",{class:"form-check-label"},"true",-1))]),t("label",ae,[c(t("input",{class:"form-check-input",type:"radio",name:"online",value:"false","onUpdate:modelValue":e[7]||(e[7]=l=>o.value.online=l)},null,512),[[y,o.value.online]]),e[20]||(e[20]=t("span",{class:"form-check-label"},"false",-1))])])])])]),t("div",ne,[t("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:e[8]||(e[8]=l=>d())}," Cancel "),t("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:e[9]||(e[9]=l=>w())},_(r.mode==="new"?"Create":"Update"),513)])])])],512))}}),re={class:"modal fade",id:"deleteRepository",tabindex:"-1"},de={class:"modal-dialog modal-lg",role:"document"},ue={class:"modal-content"},me={class:"modal-body text-left py-4"},ce={class:"modal-footer"},pe=C({__name:"deleteRepository",props:{repositoryName:{}},emits:["get-repository-list"],setup(v,{emit:b}){const s=D(),m=v,f=b,r=async()=>{const{data:u}=await L("nexus",m.repositoryName);u?s.success("Deleted successfully."):s.error("Failed to delete."),f("get-repository-list")};return(u,a)=>(F(),x("div",re,[t("div",de,[t("div",ue,[a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),a[4]||(a[4]=t("div",{class:"modal-status bg-danger"},null,-1)),t("div",me,[a[1]||(a[1]=t("h3",{class:"mb-5"}," Delete Repository ",-1)),t("h4",null,"Are you sure you want to delete "+_(m.repositoryName)+"?",1)]),t("div",ce,[a[2]||(a[2]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[0]||(a[0]=o=>r())}," Delete ")])])])]))}}),fe={class:"card w-100"},ge=C({__name:"RepositoryList",props:{embedded:{type:Boolean}},emits:["open-detail"],setup(v,{expose:b,emit:s}){const m=D(),f=v,r=s,u=e=>{if(d.value=e,f.embedded){r("open-detail",e);return}T.push({name:"repositoryDetail",params:{repositoryName:e}})},a=p([]),o=p([]);N(async()=>{w(),await n()});const n=async()=>{try{const{data:e}=await M("nexus");a.value=e}catch(e){console.log(e),m.error("Unable to fetch data.")}},d=p(""),w=()=>{o.value=[{title:"Name",field:"name",width:"15%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Format",field:"format",width:"10%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"URL",field:"url",width:"40%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Type(hosted)",field:"type",width:"15%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Action",width:"20%",formatter:g,cellClick:function(e,l){const h=e.target,U=h==null?void 0:h.getAttribute("id");d.value=l.getRow().getData().name,U==="edit-btn"?k.value="edit":d.value=l.getRow().getData().name}}]},g=()=>` +
+ + +
`,k=p("new");return b({startCreate:()=>{d.value="",k.value="new"}}),(e,l)=>(F(),x("div",fe,[R($,{columns:o.value,"table-data":a.value},null,8,["columns","table-data"]),R(ie,{mode:k.value,"repository-name":d.value,onGetRepositoryList:n},null,8,["mode","repository-name"]),R(pe,{"repository-name":d.value,onGetRepositoryList:n},null,8,["repository-name"])]))}});export{ge as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalog-C_LrmSvx.js b/src/main/resources/static/assets/SoftwareCatalog-C_LrmSvx.js new file mode 100644 index 0000000..0e018bc --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalog-C_LrmSvx.js @@ -0,0 +1,21 @@ +import{g as oa,l as sa,A as na}from"./applicationInstallationForm-CmPX1mlj.js";import{d as Te,f as Ve,r as c,i as Ge,x as ze,g as q,h as Se,o as d,c as u,a as e,t as v,n as te,j as b,y as Me,z as Ae,m as x,F as E,k as O,v as ne,e as ve,w as ie,l as D,p as ia,A as ra,B as Pe,b as F,u as le,C as da,q as ua}from"./index-B9L3o1bN.js";import{M as je}from"./bootstrap.esm-Ceob_0pG.js";import{c as Ee}from"./createVueComponent-DGcjOmEh.js";import{g as xe,s as ca,a as va,b as pa,c as ma,d as ga,u as fa,e as ba,f as ya,h as _a,i as ka,j as ha,k as qe,l as Ye,m as Ca,n as wa,I as Ia,o as Sa,A as Ma}from"./applicationDetailModal-DlYeJQEs.js";import{I as Aa}from"./IconRefresh-vvjw0GrU.js";import{_ as Ta}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Ea}from"./lodash-PecLoxXt.js";import"./request-BQy8ZIMN.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Na=Ee("outline","cloud-download","IconCloudDownload",[["path",{d:"M19 18a3.5 3.5 0 0 0 0 -7h-1a5 4.5 0 0 0 -11 -2a4.6 4.4 0 0 0 -2.1 8.4",key:"svg-0"}],["path",{d:"M12 13l0 9",key:"svg-1"}],["path",{d:"M9 19l3 3l3 -3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Ra=Ee("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Da=Ee("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var $a=Ee("filled","star-filled","IconStarFilled",[["path",{d:"M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z",key:"svg-0"}]]);const Ua={class:"modal-dialog modal-lg",role:"document"},La={class:"modal-content"},xa={class:"modal-header"},Pa={class:"modal-title"},Va=["disabled"],Ga={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},Oa={class:"nav nav-tabs mb-3"},Ha={class:"nav-item"},Ba={class:"nav-item"},Ka={class:"nav-item"},Fa={class:"nav-item"},za={key:0,class:"mb-4"},ja={class:"row g-3"},qa={class:"col-md-6"},Ya=["disabled"],Wa={class:"col-md-6"},Ja=["disabled"],Za={class:"mb-3"},Qa={class:"d-flex align-items-center"},Xa={class:"form-check me-3"},el=["disabled"],al={class:"form-check"},ll=["disabled"],tl={class:"mb-3"},ol=["disabled"],sl=["value"],nl={class:"row g-3"},il={class:"col-md-6"},rl=["disabled"],dl=["value"],ul={class:"col-md-6"},cl=["disabled"],vl=["value"],pl={class:"alert alert-info py-2 mb-3",role:"status"},ml={class:"form-label required",for:"registrySearchInput"},gl={class:"input-group"},fl=["placeholder","disabled"],bl=["disabled"],yl={key:0,class:"text-danger small mt-2"},_l={key:0,class:"text-center text-muted py-4"},kl={key:1,class:"text-muted py-3"},hl={key:2,class:"registry-results list-group mb-3"},Cl=["disabled","onClick"],wl={class:"d-flex align-items-start gap-3"},Il=["src"],Sl={class:"flex-fill text-start"},Ml={class:"fw-semibold"},Al={class:"small registry-description"},Tl={key:3,class:"row g-3"},El={class:"col-md-6"},Nl=["disabled"],Rl={value:""},Dl=["value"],$l={class:"col-md-6"},Ul=["disabled"],Ll=["value"],xl={class:"mb-3"},Pl={class:"mb-3"},Vl={class:"mb-3"},Gl={class:"mb-3"},Ol={class:"col-5"},Hl=["onUpdate:modelValue"],Bl={class:"col-6"},Kl=["onUpdate:modelValue"],Fl={class:"col-1 d-flex gap-2"},zl=["onClick","disabled"],jl={class:"row"},ql={class:"col-md-6"},Yl={class:"row"},Wl={class:"col-6"},Jl={class:"input-group"},Zl={class:"col-6"},Ql={class:"input-group"},Xl={class:"row mt-3"},et={class:"col-md-6"},at={class:"row"},lt={class:"col-6"},tt={class:"input-group"},ot={class:"col-6"},st={class:"input-group"},nt={class:"row mt-3"},it={class:"col-md-6"},rt={class:"row"},dt={class:"col-6"},ut={class:"input-group"},ct={class:"col-6"},vt={class:"input-group"},pt={key:0,class:"card mt-3"},mt={class:"card-body"},gt={class:"d-flex align-items-center mb-2"},ft={class:"form-check form-switch"},bt={class:"row"},yt={class:"col-md-3"},_t=["disabled"],kt={class:"col-md-3"},ht=["disabled"],Ct={class:"col-md-3"},wt=["disabled"],It={class:"col-md-3"},St=["disabled"],Mt={key:0},At={class:"card"},Tt={class:"card-body"},Et={class:"mb-3"},Nt={key:1},Rt={class:"card"},Dt={class:"card-body"},$t={class:"mb-3"},Ut={class:"col-4"},Lt=["onUpdate:modelValue"],xt={class:"col-3"},Pt=["onUpdate:modelValue"],Vt={class:"col-4"},Gt=["onUpdate:modelValue"],Ot={class:"col-1 d-flex align-items-end gap-2"},Ht=["onClick","disabled"],Bt={class:"modal-footer"},Kt=["disabled"],Ft={class:"ms-auto d-flex gap-2"},zt=["disabled"],jt=["disabled"],qt=["disabled"],Yt=Te({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(pe,{expose:oe,emit:X}){const m=pe,K=X,L=Ve(),f=c(1),I=c(!1),M=c(!1),S=c(0),y=c({}),Y=["AI_MACHINE_LEARNING","DATABASE","INTEGRATION_AND_DELIVERY","MONITORING_AND_LOGGING","NETWORKING","SECURITY","STORAGE","STREAMING_AND_MESSAGING"],G={1:"AI_MACHINE_LEARNING",2:"DATABASE",3:"INTEGRATION_AND_DELIVERY",4:"MONITORING_AND_LOGGING",5:"NETWORKING",6:"SECURITY",7:"STORAGE",8:"STREAMING_AND_MESSAGING"},ee={"AI / MACHINE LEARNING":"AI_MACHINE_LEARNING","AI MACHINE LEARNING":"AI_MACHINE_LEARNING",DATABASE:"DATABASE","INTEGRATION AND DELIVERY":"INTEGRATION_AND_DELIVERY","MONITORING AND LOGGING":"MONITORING_AND_LOGGING","MONITORING & LOGGING":"MONITORING_AND_LOGGING",NETWORKING:"NETWORKING",SECURITY:"SECURITY",STORAGE:"STORAGE","STREAMING AND MESSAGING":"STREAMING_AND_MESSAGING"},N=c("existing"),W=c(""),H=c([]),P=c(!1),z=c(!1),R=c(""),$=c(null),B=c([]),j=c(!1),ae=c(Y.map(l=>({key:l,value:l}))),k=c(!1),r=c(!1),p=c(""),C=c(null),re=c(!1);Ge(()=>{C.value&&(C.value.addEventListener("show.bs.modal",de),C.value.addEventListener("hide.bs.modal",ye)),Ce()}),ze(()=>{C.value&&(C.value.removeEventListener("show.bs.modal",de),C.value.removeEventListener("hide.bs.modal",ye))});const de=()=>{M.value=!0,m.mode==="new"&&$e()},ye=()=>{M.value=!1,re.value=!1},t=c({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),U=c([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),A=c([{targetPort:80,hostPort:8080,protocol:"TCP"}]),J=q(()=>m.mode==="update"||N.value==="existing"),se=q(()=>t.value.target==="VM"?"Docker Hub":"Artifact Hub"),_e=q(()=>t.value.target==="VM"?"Search official container images":"Search official Helm charts"),Ne=q(()=>m.mode==="update"?k.value?"Updating...":"Update":r.value?"Importing...":k.value?"Creating...":N.value==="public"?"Import & Create":"Create"),ue=q(()=>f.value===1?t.value.target&&t.value.category&&t.value.packageName&&t.value.version:f.value===2?t.value.name.trim().length>0&&t.value.summary.trim().length>0&&t.value.description.trim().length>0:f.value===3?t.value.minCpu>0&&t.value.minMemory>0&&t.value.minDisk>0&&t.value.recommendedCpu>0&&t.value.recommendedMemory>0&&t.value.recommendedDisk>0:f.value===3&&t.value.hpaEnabled?t.value.minReplicas>0&&t.value.maxReplicas>0&&t.value.cpuThreshold>0&&t.value.memoryThreshold>0:(console.log(A.value),f.value===3&&t.value.target==="VM"?t.value.defaultPort>0:f.value===4&&t.value.target==="K8S"?(console.log(A.value.length),A.value.length>0?A.value.every(l=>l.targetPort>0&&l.hostPort>0&&l.protocol):!1):f.value===4&&t.value.ingressEnabled?t.value.ingressUrl.trim().length>0:!0)),Re=()=>{ue.value&&f.value<4&&(f.value+=1)},ke=()=>{f.value>1&&(f.value-=1)},me=(l=!0)=>{l&&(W.value=""),H.value=[],z.value=!1,R.value="",$.value=null,B.value=[],P.value=!1,j.value=!1,r.value=!1,p.value=""},ge=l=>{if(l==null)return"";if(typeof l=="object")return ge(l.value||l.key||l.name||l.displayName||l.display_name||l.category);const a=String(l).trim();if(!a)return"";if(G[a])return G[a];const s=a.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toUpperCase();return ee[s]?ee[s]:a.replace(/&/g,"AND").replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_+/g,"_").toUpperCase()},fe=(l=[])=>{const a=new Map;[...Y,...ae.value,...l].forEach(s=>{const h=ge((s==null?void 0:s.value)||(s==null?void 0:s.key)||s);h&&a.set(h,{key:h,value:h})}),ae.value=Array.from(a.values()).sort((s,h)=>s.value.localeCompare(h.value))},o=async()=>{fe();const a=(await Promise.allSettled([xe({target:"DOCKER",availableOnly:!1}),xe({target:"HELM",availableOnly:!1})])).flatMap(s=>s.status==="fulfilled"?s.value.data||[]:[]);fe(a)},n=(l,a=0)=>{var s;return String((l==null?void 0:l.id)||(l==null?void 0:l.packageId)||`${((s=l==null?void 0:l.repository)==null?void 0:s.name)||"registry"}-${(l==null?void 0:l.name)||a}`)},i=l=>!!$.value&&n($.value)===n(l),_=l=>{var a,s;return((a=l==null?void 0:l.logo_url)==null?void 0:a.small)||((s=l==null?void 0:l.logo_url)==null?void 0:s.large)||""},T=l=>(l==null?void 0:l.short_description)||(l==null?void 0:l.description)||"",g=(l,a)=>{const s=String(l||"");return s.length>a?`${s.substring(0,a)}...`:s},V=async()=>{const l=W.value.trim();if(R.value="",z.value=!1,H.value=[],$.value=null,B.value=[],t.value.packageName="",t.value.version="",!l){R.value="Enter a search keyword.";return}W.value=l,P.value=!0;try{const{data:a}=t.value.target==="VM"?await ca(l):await va(l),s=t.value.target==="VM"?a==null?void 0:a.results:a==null?void 0:a.packages;H.value=(Array.isArray(s)?s:[]).filter(Boolean).slice(0,8),z.value=!0}catch(a){console.log(a),R.value=`Unable to search ${se.value}.`}finally{P.value=!1}},De=async l=>{var w,be,Z,Fe;$.value=l,t.value.packageName=(l==null?void 0:l.name)||"",t.value.version="",t.value.sourceType=t.value.target==="VM"?"DOCKERHUB":"ARTIFACTHUB",B.value=[],R.value="",p.value="";const a=T(l);t.value.name=(l==null?void 0:l.name)||t.value.name,t.value.summary=a||(l==null?void 0:l.name)||"",t.value.description=a||(l==null?void 0:l.name)||"",t.value.logoUrlLarge=((w=l==null?void 0:l.logo_url)==null?void 0:w.large)||"",t.value.logoUrlSmall=((be=l==null?void 0:l.logo_url)==null?void 0:be.small)||"";const s=ge((l==null?void 0:l.category)||((Z=l==null?void 0:l.categories)==null?void 0:Z[0]));fe(s?[s]:[]),t.value.category=s;const h=n(l);j.value=!0;try{const{data:Ie}=t.value.target==="VM"?await pa({path:(l==null?void 0:l.id)||""}):await ma({kind:"helm",repository:((Fe=l==null?void 0:l.repository)==null?void 0:Fe.name)||"",packageName:(l==null?void 0:l.name)||""});if(n($.value)!==h)return;const Le=(Array.isArray(Ie)?Ie:[]).map(Q=>t.value.target==="VM"?Q==null?void 0:Q.name:Q==null?void 0:Q.version).filter(Boolean);Le.length===0&&(l!=null&&l.version)&&Le.push(l.version),B.value=Array.from(new Set(Le)).map(Q=>({key:Q,value:Q})),B.value.length===1&&(t.value.version=B.value[0].value)}catch(Ie){if(console.log(Ie),n($.value)!==h)return;l!=null&&l.version?(B.value=[{key:l.version,value:l.version}],t.value.version=l.version):R.value="Unable to retrieve package versions."}finally{n($.value)===h&&(j.value=!1)}},$e=()=>{f.value=1,N.value="existing",k.value=!1,me(),ae.value=Y.map(l=>({key:l,value:l})),t.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},U.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],A.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},We=()=>{U.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},Je=l=>{U.value.length>1&&U.value.splice(l,1)},Ze=()=>{A.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},Qe=l=>{A.value.length>1&&A.value.splice(l,1)},Oe=()=>{if(C.value){M.value=!1;const l=C.value.querySelector('[data-bs-dismiss="modal"]');if(l)l.click();else try{const a=window.bootstrap;if(a!=null&&a.Modal)(a.Modal.getInstance(C.value)||new a.Modal(C.value)).hide();else{C.value.classList.remove("show"),C.value.style.display="none",document.body.classList.remove("modal-open");const s=document.querySelector(".modal-backdrop");s==null||s.remove()}}catch(a){console.warn("Modal close failed:",a)}}},Xe=()=>[t.value.target,n($.value),t.value.version].join("|"),ea=async()=>{var a,s;if(N.value!=="public")return;if(!$.value)throw new Error("Select a package to import.");const l=Xe();if(p.value!==l){r.value=!0;try{const h=JSON.parse(JSON.stringify($.value));let w;if(t.value.target==="VM"){const be=t.value.category,Z={...h,tag:t.value.version,sourceType:"DockerHub",createdAt:h.created_at,updatedAt:h.updated_at,shortDescription:h.short_description,starCount:h.star_count,ratePlans:h.rate_plans,categories:[{name:be,slug:be.toLowerCase().replace(/_/g,"-")}]};delete Z.created_at,delete Z.updated_at,delete Z.short_description,delete Z.star_count,delete Z.rate_plans,w=await ka(Z)}else w=await ha({...h,packageId:h.packageId,tag:t.value.version,version:t.value.version,category:t.value.category,sourceType:"ArtifactHub"});if(((a=w==null?void 0:w.data)==null?void 0:a.success)!==!0)throw new Error(((s=w==null?void 0:w.data)==null?void 0:s.message)||`${se.value} import failed.`);p.value=l}finally{r.value=!1}}},aa=async()=>{if(!k.value){k.value=!0;try{await ea(),t.value.catalogRefs=U.value.filter(l=>l.refValue.trim()),t.value.target==="K8S"&&(t.value.ports=A.value.filter(l=>l.targetPort&&l.hostPort)),t.value.target==="VM"?t.value.sourceType="DOCKERHUB":t.value.target==="K8S"&&(t.value.sourceType="ARTIFACTHUB"),await ga(t.value),L.success("Registration Success"),Oe(),K("created")}catch(l){console.log(l),L.error((l==null?void 0:l.message)||"Registration Failed")}finally{k.value=!1}}},la=async()=>{if(!k.value){k.value=!0;try{t.value.catalogRefs=U.value.filter(l=>l.refValue.trim()),t.value.target==="K8S"&&(t.value.ports=A.value.filter(l=>l.targetPort&&l.hostPort)),t.value.target==="VM"?t.value.sourceType="DOCKERHUB":t.value.target==="K8S"&&(t.value.sourceType="ARTIFACTHUB"),await fa(t.value),L.success("Update Success"),Oe(),K("updated")}catch{L.error("Update Failed")}finally{k.value=!1}}},He=async()=>{try{if(!S.value)return;y.value&&y.value.category&&(I.value=!0,t.value.target=y.value.packageInfo!==null?"VM":"K8S",t.value.category=y.value.category,y.value.packageInfo!==null?(t.value.packageName=y.value.packageInfo.packageName,t.value.version=y.value.packageInfo.packageVersion):y.value.helmChart!==null&&(t.value.packageName=y.value.helmChart.chartName,t.value.version=y.value.helmChart.chartVersion),I.value=!1),await ta()}catch{L.error("Failed to load catalog data"),I.value=!1}},ta=async()=>{try{if(!S.value)return;const{data:l}=await ba(S.value);I.value=!0,t.value={...t.value,...l,target:l.packageInfo!==null?"VM":"K8S"},l.packageInfo!==null&&(t.value.packageName=l.packageInfo.packageName,t.value.version=l.packageInfo.packageVersion),l.helmChart!==null&&(t.value.packageName=l.helmChart.chartName,t.value.version=l.helmChart.chartVersion),l.catalogRefs&&l.catalogRefs.length>0?U.value=l.catalogRefs.map(a=>({refId:a.id||0,refValue:a.refValue||"",refDesc:a.refDesc||"",refType:a.refType||"URL"})):U.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],l.ports&&l.ports.length>0?A.value=l.ports.map(a=>({targetPort:a.targetPort||80,hostPort:a.hostPort||8080,protocol:a.protocol||"TCP"})):A.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await Ce(),t.value.category&&(await Be(),t.value.packageName&&await Ke()),I.value=!1}catch{L.error("Failed to load catalog data"),I.value=!1}},he=l=>{!k.value&&ue.value&&(f.value=l)};Se(N,async()=>{m.mode!=="new"||I.value||(t.value.category="",t.value.packageName="",t.value.version="",t.value.name="",t.value.summary="",t.value.description="",t.value.logoUrlLarge="",t.value.logoUrlSmall="",me(),N.value==="existing"?await Ce():(t.value.sourceType=t.value.target==="VM"?"DOCKERHUB":"ARTIFACTHUB",await o()))}),Se(()=>t.value.target,async(l,a)=>{!l||I.value||l===a||(m.mode==="new"&&(t.value.category="",t.value.packageName="",t.value.version=""),J.value?await Ce():(t.value.sourceType=l==="VM"?"DOCKERHUB":"ARTIFACTHUB",me(),await o()))});const Ue=c([]),Ce=async()=>{if(m.mode==="new"&&J.value&&(Ue.value=[],we.value=[],ce.value=[],t.value.category="",t.value.packageName="",t.value.version=""),t.value.target){const l={target:t.value.target==="VM"?"DOCKER":"HELM",availableOnly:m.mode==="new"},{data:a}=await xe(l);Ue.value=a}};Se(()=>t.value.category,l=>{l&&J.value&&!I.value&&(m.mode==="new"&&(t.value.packageName="",t.value.version=""),Be())});const we=c([]),Be=async()=>{m.mode==="new"&&J.value&&(we.value=[],ce.value=[],t.value.packageName="",t.value.version="");const l={target:t.value.target==="VM"?"DOCKER":"HELM",category:t.value.category||"",availableOnly:m.mode==="new"},{data:a}=await ya(l);we.value=a};Se(()=>t.value.packageName,l=>{l&&J.value&&!I.value&&(m.mode==="new"&&(t.value.version=""),Ke())});const ce=c([]),Ke=async()=>{m.mode==="new"&&J.value&&(ce.value=[],t.value.version="");const l={target:t.value.target==="VM"?"DOCKER":"HELM",packageName:t.value.packageName||"",availableOnly:m.mode==="new"},{data:a}=await _a(l);m.mode==="new"?a.forEach(s=>{s.isUsed||ce.value.push(s)}):ce.value=a};return oe({loadCatalogDataWithCategoryInit:He,initForCreate:()=>{$e(),f.value=1},initForUpdate:(l,a)=>{S.value=l,y.value=a,f.value=1,He()}}),(l,a)=>(d(),u("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:C},[e("div",Ua,[e("div",La,[e("div",xa,[e("h5",Pa,v(m.mode==="update"?"Application Update":"Application Registration"),1),e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",disabled:k.value},null,8,Va)]),e("div",Ga,[e("ul",Oa,[e("li",Ha,[e("a",{class:te(["nav-link",{active:f.value===1}]),href:"javascript:void(0);",onClick:a[0]||(a[0]=s=>he(1))},"1. "+v(m.mode==="update"?"Package":"Source & Package"),3)]),e("li",Ba,[e("a",{class:te(["nav-link",{active:f.value===2}]),href:"javascript:void(0);",onClick:a[1]||(a[1]=s=>he(2))},"2. General",2)]),e("li",Ka,[e("a",{class:te(["nav-link",{active:f.value===3}]),href:"javascript:void(0);",onClick:a[2]||(a[2]=s=>he(3))},"3. Resource Requirements",2)]),e("li",Fa,[e("a",{class:te(["nav-link",{active:f.value===4}]),href:"javascript:void(0);",onClick:a[3]||(a[3]=s=>he(4))},"4. Network",2)])]),b(e("div",null,[m.mode!=="update"?(d(),u("div",za,[a[32]||(a[32]=e("label",{class:"form-label required"},"Registration Source",-1)),e("div",ja,[e("div",qa,[e("label",{class:te(["source-option",{selected:N.value==="existing"}]),for:"sourceExisting"},[b(e("input",{id:"sourceExisting","onUpdate:modelValue":a[4]||(a[4]=s=>N.value=s),class:"form-check-input",type:"radio",name:"registrationSource",value:"existing",disabled:k.value},null,8,Ya),[[Ae,N.value]]),a[30]||(a[30]=e("span",null,[e("strong",null,"Existing Package"),e("small",null,"Register a package already available in MCMP.")],-1))],2)]),e("div",Wa,[e("label",{class:te(["source-option",{selected:N.value==="public"}]),for:"sourcePublic"},[b(e("input",{id:"sourcePublic","onUpdate:modelValue":a[5]||(a[5]=s=>N.value=s),class:"form-check-input",type:"radio",name:"registrationSource",value:"public",disabled:k.value},null,8,Ja),[[Ae,N.value]]),a[31]||(a[31]=e("span",null,[e("strong",null,"Public Registry"),e("small",null,"Search, import, and register in one flow.")],-1))],2)])])])):x("",!0),e("div",Za,[a[35]||(a[35]=e("label",{class:"form-label required"},"Target",-1)),e("div",Qa,[e("div",Xa,[b(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":a[6]||(a[6]=s=>t.value.target=s),id:"targetVM",disabled:m.mode==="update"||k.value},null,8,el),[[Ae,t.value.target]]),a[33]||(a[33]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",al,[b(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":a[7]||(a[7]=s=>t.value.target=s),id:"targetK8S",disabled:m.mode==="update"||k.value},null,8,ll),[[Ae,t.value.target]]),a[34]||(a[34]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),J.value?(d(),u(E,{key:1},[e("div",tl,[a[37]||(a[37]=e("label",{class:"form-label required"},"Category",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[8]||(a[8]=s=>t.value.category=s),disabled:m.mode==="update"},[a[36]||(a[36]=e("option",{value:""},"Select Category",-1)),(d(!0),u(E,null,O(Ue.value,s=>(d(),u("option",{value:s.value,key:s.key},v(s.value),9,sl))),128))],8,ol),[[ne,t.value.category]])]),e("div",nl,[e("div",il,[a[39]||(a[39]=e("label",{class:"form-label required"},"Package",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[9]||(a[9]=s=>t.value.packageName=s),disabled:m.mode==="update"},[a[38]||(a[38]=e("option",{value:""},"Select Package",-1)),(d(!0),u(E,null,O(we.value,s=>(d(),u("option",{value:s.value,key:s.key},v(s.value),9,dl))),128))],8,rl),[[ne,t.value.packageName]])]),e("div",ul,[a[41]||(a[41]=e("label",{class:"form-label required"},"Version",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[10]||(a[10]=s=>t.value.version=s),disabled:m.mode==="update"},[a[40]||(a[40]=e("option",{value:""},"Select Version",-1)),(d(!0),u(E,null,O(ce.value,s=>(d(),u("option",{value:s.value,key:s.key},v(s.value),9,vl))),128))],8,cl),[[ne,t.value.version]])])])],64)):(d(),u(E,{key:2},[e("div",pl,[e("strong",null,v(se.value),1),a[42]||(a[42]=ve(" will be searched for the selected target. The package is imported only when you complete registration. "))]),e("form",{class:"mb-3",onSubmit:ie(V,["prevent"])},[e("label",ml,"Search "+v(se.value),1),e("div",gl,[b(e("input",{id:"registrySearchInput","onUpdate:modelValue":a[11]||(a[11]=s=>W.value=s),type:"search",class:"form-control",placeholder:_e.value,disabled:P.value||k.value},null,8,fl),[[D,W.value]]),e("button",{class:"btn btn-outline-primary",type:"submit",disabled:P.value||k.value},v(P.value?"Searching...":"Search"),9,bl)]),R.value?(d(),u("div",yl,v(R.value),1)):x("",!0)],32),P.value?(d(),u("div",_l,"Searching "+v(se.value)+"...",1)):z.value&&H.value.length===0?(d(),u("div",kl," No matching packages found. ")):H.value.length>0?(d(),u("div",hl,[(d(!0),u(E,null,O(H.value,(s,h)=>(d(),u("button",{key:n(s,h),type:"button",class:te(["list-group-item list-group-item-action",{active:i(s)}]),disabled:j.value||k.value,onClick:w=>De(s)},[e("div",wl,[_(s)?(d(),u("img",{key:0,src:_(s),class:"rounded registry-logo",alt:"",width:"40",height:"40"},null,8,Il)):x("",!0),e("div",Sl,[e("div",Ml,v((s==null?void 0:s.name)||(s==null?void 0:s.packageId)||"Unnamed package"),1),e("div",Al,v(g(T(s),120)),1)])])],10,Cl))),128))])):x("",!0),$.value?(d(),u("div",Tl,[e("div",El,[a[43]||(a[43]=e("label",{class:"form-label required"},"Version",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[12]||(a[12]=s=>t.value.version=s),disabled:j.value||k.value},[e("option",Rl,v(j.value?"Loading versions...":"Select Version"),1),(d(!0),u(E,null,O(B.value,s=>(d(),u("option",{value:s.value,key:s.key},v(s.value),9,Dl))),128))],8,Nl),[[ne,t.value.version]])]),e("div",$l,[a[45]||(a[45]=e("label",{class:"form-label required"},"Category",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[13]||(a[13]=s=>t.value.category=s),disabled:k.value},[a[44]||(a[44]=e("option",{value:""},"Select Category",-1)),(d(!0),u(E,null,O(ae.value,s=>(d(),u("option",{value:s.value,key:s.key},v(s.value),9,Ll))),128))],8,Ul),[[ne,t.value.category]])])])):x("",!0)],64))],512),[[Me,f.value===1]]),b(e("div",null,[e("div",xl,[a[46]||(a[46]=e("label",{class:"form-label required"},"Application Name",-1)),b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":a[14]||(a[14]=s=>t.value.name=s),placeholder:"Application name"},null,512),[[D,t.value.name]])]),e("div",Pl,[a[47]||(a[47]=e("label",{class:"form-label required"},"Summary",-1)),b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":a[15]||(a[15]=s=>t.value.summary=s),placeholder:"Application summary"},null,512),[[D,t.value.summary]])]),e("div",Vl,[a[48]||(a[48]=e("label",{class:"form-label required"},"Description",-1)),b(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":a[16]||(a[16]=s=>t.value.description=s),placeholder:"Application description"},null,512),[[D,t.value.description]])]),e("div",Gl,[a[50]||(a[50]=e("label",{class:"form-label"},"Reference",-1)),(d(!0),u(E,null,O(U.value,(s,h)=>(d(),u("div",{class:"row g-2 mb-2",key:h},[e("div",Ol,[b(e("select",{class:"form-select","onUpdate:modelValue":w=>s.refType=w},a[49]||(a[49]=[ia('',6)]),8,Hl),[[ne,s.refType]])]),e("div",Bl,[b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":w=>s.refValue=w,placeholder:"Ref Value"},null,8,Kl),[[D,s.refValue]])]),e("div",Fl,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:w=>Je(h),disabled:U.value.length<=1},"-",8,zl)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:We,style:{color:"gray"}},"+ Add Reference")])],512),[[Me,f.value===2]]),b(e("div",null,[e("div",jl,[e("div",ql,[a[55]||(a[55]=e("label",{class:"form-label"},"CPU",-1)),e("div",Yl,[e("div",Wl,[a[52]||(a[52]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",Jl,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[17]||(a[17]=s=>t.value.minCpu=s),placeholder:"1"},null,512),[[D,t.value.minCpu,void 0,{number:!0}]]),a[51]||(a[51]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Zl,[a[54]||(a[54]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Ql,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[18]||(a[18]=s=>t.value.recommendedCpu=s),placeholder:"2"},null,512),[[D,t.value.recommendedCpu,void 0,{number:!0}]]),a[53]||(a[53]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Xl,[e("div",et,[a[60]||(a[60]=e("label",{class:"form-label"},"Memory",-1)),e("div",at,[e("div",lt,[a[57]||(a[57]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",tt,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[19]||(a[19]=s=>t.value.minMemory=s),placeholder:"4"},null,512),[[D,t.value.minMemory,void 0,{number:!0}]]),a[56]||(a[56]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",ot,[a[59]||(a[59]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",st,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[20]||(a[20]=s=>t.value.recommendedMemory=s),placeholder:"8"},null,512),[[D,t.value.recommendedMemory,void 0,{number:!0}]]),a[58]||(a[58]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",nt,[e("div",it,[a[65]||(a[65]=e("label",{class:"form-label"},"Storage",-1)),e("div",rt,[e("div",dt,[a[62]||(a[62]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",ut,[b(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":a[21]||(a[21]=s=>t.value.minDisk=s),placeholder:"10"},null,512),[[D,t.value.minDisk,void 0,{number:!0}]]),a[61]||(a[61]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",ct,[a[64]||(a[64]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",vt,[b(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":a[22]||(a[22]=s=>t.value.recommendedDisk=s),placeholder:"20"},null,512),[[D,t.value.recommendedDisk,void 0,{number:!0}]]),a[63]||(a[63]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),t.value.target==="K8S"?(d(),u("div",pt,[e("div",mt,[e("div",gt,[a[66]||(a[66]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",ft,[b(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[23]||(a[23]=s=>t.value.hpaEnabled=s)},null,512),[[ra,t.value.hpaEnabled]])])]),e("div",bt,[e("div",yt,[a[67]||(a[67]=e("label",{class:"form-label"},"minReplicas",-1)),b(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":a[24]||(a[24]=s=>t.value.minReplicas=s),disabled:!t.value.hpaEnabled,placeholder:"1"},null,8,_t),[[D,t.value.minReplicas,void 0,{number:!0}]])]),e("div",kt,[a[68]||(a[68]=e("label",{class:"form-label"},"maxReplicas",-1)),b(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":a[25]||(a[25]=s=>t.value.maxReplicas=s),disabled:!t.value.hpaEnabled,placeholder:"10"},null,8,ht),[[D,t.value.maxReplicas,void 0,{number:!0}]])]),e("div",Ct,[a[69]||(a[69]=e("label",{class:"form-label"},"CPU (%)",-1)),b(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":a[26]||(a[26]=s=>t.value.cpuThreshold=s),disabled:!t.value.hpaEnabled,placeholder:"80"},null,8,wt),[[D,t.value.cpuThreshold,void 0,{number:!0}]])]),e("div",It,[a[70]||(a[70]=e("label",{class:"form-label"},"Memory (%)",-1)),b(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":a[27]||(a[27]=s=>t.value.memoryThreshold=s),disabled:!t.value.hpaEnabled,placeholder:"80"},null,8,St),[[D,t.value.memoryThreshold,void 0,{number:!0}]])])])])])):x("",!0)],512),[[Me,f.value===3]]),b(e("div",null,[t.value.target==="VM"?(d(),u("div",Mt,[e("div",At,[a[72]||(a[72]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Tt,[e("div",Et,[a[71]||(a[71]=e("label",{class:"form-label"},"Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":a[28]||(a[28]=s=>t.value.defaultPort=s),placeholder:"80"},null,512),[[D,t.value.defaultPort,void 0,{number:!0}]])])])])])):x("",!0),t.value.target==="K8S"?(d(),u("div",Nt,[e("div",Rt,[a[78]||(a[78]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Dt,[e("div",$t,[a[77]||(a[77]=e("label",{class:"form-label"},"Port",-1)),(d(!0),u(E,null,O(A.value,(s,h)=>(d(),u("div",{class:"row g-2 mb-2",key:h},[e("div",Ut,[a[73]||(a[73]=e("label",{class:"form-label small"},"Target Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":w=>s.targetPort=w,placeholder:"80"},null,8,Lt),[[D,s.targetPort,void 0,{number:!0}]])]),e("div",xt,[a[75]||(a[75]=e("label",{class:"form-label small"},"Protocol",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":w=>s.protocol=w},a[74]||(a[74]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,Pt),[[ne,s.protocol]])]),e("div",Vt,[a[76]||(a[76]=e("label",{class:"form-label small"},"Host Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":w=>s.hostPort=w,placeholder:"8080"},null,8,Gt),[[D,s.hostPort,void 0,{number:!0}]])]),e("div",Ot,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:w=>Qe(h),disabled:A.value.length<=1},"-",8,Ht)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:Ze,style:{color:"gray"}},"+ Add Port Mapping")])])])])):x("",!0)],512),[[Me,f.value===4]])]),e("div",Bt,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",disabled:k.value,onClick:$e}," Cancel ",8,Kt),e("div",Ft,[e("button",{class:"btn btn-outline-secondary",disabled:f.value===1||k.value,onClick:ke},"Prev",8,zt),f.value<4?(d(),u("button",{key:0,class:"btn btn-primary",disabled:!ue.value||k.value,onClick:Re},"Next",8,jt)):(d(),u("button",{key:1,class:"btn btn-primary",disabled:!ue.value||k.value,onClick:a[29]||(a[29]=s=>m.mode==="update"?la():aa())},v(Ne.value),9,qt))])])])])],512))}}),Wt=Ta(Yt,[["__scopeId","data-v-b5a9b02f"]]),Jt={class:"modal-dialog",role:"document"},Zt={class:"modal-content"},Qt={class:"modal-body"},Xt={key:0,class:"text-muted"},eo={key:1,class:"alert alert-warning mb-0"},ao={key:2,class:"alert alert-warning mb-0"},lo={class:"mb-0 mt-2 ps-3"},to={key:0,class:"mt-1"},oo={key:3,class:"text-muted"},so={class:"modal-footer"},no=["disabled"],io=["disabled"],ro={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},uo=Te({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(pe,{expose:oe,emit:X}){const m=pe,K=X,L=Ve(),f=c(!1),I=c(!1),M=c(!1),S=c([]),y=c(null),Y=new Set(["UNINSTALLED","DELETED","DELETE_COMPLETED"]),G=q(()=>S.value.length>0),ee=q(()=>S.value.slice(0,3)),N=q(()=>Math.max(S.value.length-ee.value.length,0)),W=q(()=>f.value||I.value||M.value||G.value),H=async()=>{if(await Pe(),R(),y.value)try{const r=window.bootstrap;if(r&&r.Modal)new r.Modal(y.value).show();else{y.value.classList.add("show"),y.value.style.display="block",document.body.classList.add("modal-open");const p=document.createElement("div");p.className="modal-backdrop fade show",p.id="delete-modal-backdrop",document.body.appendChild(p)}}catch(r){console.warn("Failed to show modal with Bootstrap, using fallback:",r),y.value.classList.add("show"),y.value.style.display="block",document.body.classList.add("modal-open")}},P=()=>{if(y.value)try{const r=window.bootstrap;if(r&&r.Modal){const p=r.Modal.getInstance(y.value);p?p.hide():z()}else z()}catch(r){console.warn("Failed to hide modal with Bootstrap, using fallback:",r),z()}},z=()=>{if(y.value){y.value.classList.remove("show"),y.value.style.display="none",document.body.classList.remove("modal-open");const r=document.getElementById("delete-modal-backdrop");r&&r.remove(),K("close")}},R=async()=>{var r;if(S.value=[],M.value=!1,!!((r=m.targetCatalog)!=null&&r.id)){I.value=!0;try{const{data:p}=await qe(m.targetCatalog.id),C=Array.isArray(p==null?void 0:p.applicationStatuses)?p.applicationStatuses:[];S.value=C.filter($).map(B)}catch(p){console.log(p),M.value=!0}finally{I.value=!1}}},$=r=>{const p=j((r==null?void 0:r.status)||(r==null?void 0:r.podStatus));return!Y.has(p)},B=(r,p)=>{const C=[r==null?void 0:r.namespace,r==null?void 0:r.mciId,(r==null?void 0:r.vmId)||(r==null?void 0:r.clusterName)].filter(Boolean).join(" / "),re=(r==null?void 0:r.deploymentType)||"Deployment",de=Ye((r==null?void 0:r.status)||(r==null?void 0:r.podStatus));return{key:(r==null?void 0:r.id)||`${re}-${C}-${p}`,label:`${re}${C?` - ${C}`:""} (${de})`}},j=r=>String(r||"").trim().toUpperCase(),ae=async()=>{var r;if((r=m.targetCatalog)!=null&&r.id){if(W.value){G.value&&L.warning("This catalog has deployed applications. Please delete them first.");return}f.value=!0;try{await Ca(m.targetCatalog.id),L.success(`${m.targetCatalog.name} catalog has been successfully deleted.`),P(),K("deleted",m.targetCatalog.id)}catch(p){console.error("Delete failed:",p),L.error("Failed to delete catalog.")}finally{f.value=!1}}},k=()=>{K("close")};return Ge(()=>{y.value&&y.value.addEventListener("hidden.bs.modal",k)}),ze(()=>{y.value&&y.value.removeEventListener("hidden.bs.modal",k)}),oe({show:H,hide:P}),(r,p)=>(d(),u("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:y,onClick:ie(P,["self"])},[e("div",Jt,[e("div",Zt,[e("div",{class:"modal-header"},[p[0]||(p[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:P,"aria-label":"Close"})]),e("div",Qt,[e("p",null,[p[1]||(p[1]=ve("Are you sure you want to delete ")),e("strong",null,v(r.targetCatalog.name),1),ve(" ("+v(r.targetCatalog.category)+") catalog?",1)]),I.value?(d(),u("div",Xt,p[2]||(p[2]=[e("span",{class:"spinner-border spinner-border-sm me-2",role:"status"},null,-1),ve(" Checking deployed applications... ")]))):M.value?(d(),u("div",eo," Unable to verify deployed applications. Try again before deleting this catalog. ")):G.value?(d(),u("div",ao,[p[3]||(p[3]=e("div",{class:"fw-semibold"},"This catalog has deployed applications.",-1)),p[4]||(p[4]=e("div",null,"Please delete the deployed applications first.",-1)),e("ul",lo,[(d(!0),u(E,null,O(ee.value,C=>(d(),u("li",{key:C.key},v(C.label),1))),128))]),N.value>0?(d(),u("div",to," and "+v(N.value)+" more... ",1)):x("",!0)])):(d(),u("p",oo,"This action cannot be undone."))]),e("div",so,[M.value?(d(),u("button",{key:0,type:"button",class:"btn btn-outline-secondary",disabled:I.value,onClick:R}," Retry ",8,no)):x("",!0),e("button",{type:"button",class:"btn btn-secondary",onClick:P},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:ae,disabled:W.value},[f.value?(d(),u("span",ro)):x("",!0),ve(" "+v(f.value?"Deleting...":"Delete"),1)],8,io)])])])],512))}}),co={ref:"sofwareCatalog"},vo={class:"row"},po={class:"col-lg-12"},mo={class:"card"},go={class:"list-group card-list-group",id:"sc-list-group"},fo={class:"row g-2 align-items-center"},bo={class:"col-auto me-3"},yo=["src","onError"],_o={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},ko=["onClick"],ho={class:"text-muted"},Co=["onClick"],wo={class:"text-muted",style:{width:"auto","text-align":"right"}},Io={style:{color:"#e5b942"}},So={style:{color:"#e5b942"}},Mo={class:"text-muted",style:{width:"80px","text-align":"right"}},Ao={style:{color:"gray"}},To={class:"col-3 text-muted"},Eo={class:"d-flex justify-content-end"},No={class:"mouse-hover"},Ro=["onClick"],Do=["onClick"],$o={class:"text-muted"},Uo=["id"],Lo={class:"accordion-body pt-0"},xo=["innerHTML"],Po=["id"],Vo=["onClick"],Go=["id"],Oo=["id"],Ho={class:"btn btn-sm",style:{"margin-right":"5px"}},Bo={class:"btn btn-sm",style:{"margin-right":"5px"}},Ko={class:"btn btn-sm",style:{"margin-right":"5px"}},Fo={class:"mt-4"},zo={class:"d-flex justify-content-between align-items-center mb-2"},jo=["disabled","onClick"],qo={key:0,class:"text-center text-muted py-3"},Yo={key:1,class:"table-responsive"},Wo={class:"table table-sm table-vcenter"},Jo={key:0},Zo={class:"text-end"},Qo=["disabled","onClick"],Xo=Te({__name:"softwareCatalogList",setup(pe,{expose:oe}){const X=Ve(),m=c([]),K=c(null),L=c(null),f=c({}),I=c("new"),M=c({}),S=c(""),y=c({}),Y=c(null),G=c(null),ee=c(0),N=c(null);Ge(async()=>{H()}),oe({startRegistration:()=>{I.value="new",L.value=null,f.value={},K.value=0,M.value={},S.value="",setTimeout(()=>{G.value&&typeof G.value.initForCreate=="function"&&G.value.initForCreate()},100)}});const H=async()=>{try{await wa("").then(({data:o})=>{const n=oa(o);Ea.forEach(n,function(i){i.refData=P(i.catalogRefs),i.isShow=!1,i.deploymentStatuses=[],i.deploymentStatusLoaded=!1,i.deploymentStatusLoading=!1,i.resolvedLogoUrl=me(i),i.logoLoadFailed=!1}),m.value=n})}catch(o){console.log(o),X.error("Unable to retrieve data.")}},P=o=>o.reduce((n,i)=>(n[i.refType]||(n[i.refType]=[]),n[i.refType].push(i),n),{}),z=o=>{const n=m.value.flatMap(i=>i.catalogMembers||[i]).find(i=>i.id===o);L.value=o,f.value=n||{},I.value="update",setTimeout(()=>{G.value&&typeof G.value.initForUpdate=="function"&&G.value.initForUpdate(o,n)},100)},R=c(null),$=(o,n)=>{R.value={catalogId:o.id,action:n},o.catalogMembers.length===1&&B(o.catalogMembers[0])},B=o=>{var i;const n=(i=R.value)==null?void 0:i.action;if(R.value=null,n==="edit"){z(o.id);const _=document.getElementById("modal-wizard");_&&je.getOrCreateInstance(_).show()}else n==="delete"&&j(o)},j=o=>{y.value=o,Y.value&&Y.value.show()},ae=async()=>{await H()},k=()=>{y.value={}},r=async o=>{const n=m.value[o];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await p(n)},p=async o=>{if(o!=null&&o.id){o.deploymentStatusLoading=!0;try{const n=await sa(o.deploymentCatalogIds||[o.id],qe);o.deploymentStatuses=C(n),o.deploymentStatusLoaded=!0}catch(n){console.log(n),o.deploymentStatuses=[],X.error("Unable to retrieve deployment status.")}finally{o.deploymentStatusLoading=!1}}},C=o=>{const n=Array.isArray(o==null?void 0:o.deploymentHistories)?o.deploymentHistories:[];return(Array.isArray(o==null?void 0:o.applicationStatuses)?o.applicationStatuses:[]).map((_,T)=>{const g=re(_,n);return de(g,_,`status-${_.id||T}`)})},re=(o,n)=>{if(!o)return null;const i=n.find(_=>o.deploymentHistoryId&&String(o.deploymentHistoryId)===String(_.id));return i||n.find(_=>A(o.deploymentType,_.deploymentType)&&A(o.namespace,_.namespace)&&(A(o.vmId,_.vmId)||A(o.clusterName,_.clusterName)))},de=(o,n,i)=>({rowKey:i,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(o==null?void 0:o.id)||null,deploymentType:U((n==null?void 0:n.deploymentType)||(o==null?void 0:o.deploymentType)),target:U(ye(o,n)),csp:U(o==null?void 0:o.cloudProvider),status:U((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:U(t(o,n)),lastCheckedOrDeployedAt:U(J(n==null?void 0:n.checkedAt))}),ye=(o,n)=>{const i=(n==null?void 0:n.deploymentType)||(o==null?void 0:o.deploymentType),_=(n==null?void 0:n.namespace)||(o==null?void 0:o.namespace),T=(n==null?void 0:n.mciId)||(o==null?void 0:o.mciId),g=(n==null?void 0:n.vmId)||(o==null?void 0:o.vmId),V=(n==null?void 0:n.clusterName)||(o==null?void 0:o.clusterName);return i==="VM"?[_,T,g].filter(Boolean).join(" / "):i==="K8S"?[_,V].filter(Boolean).join(" / "):[_,T,g,V].filter(Boolean).join(" / ")},t=(o,n)=>{var V;const i=(n==null?void 0:n.publicIp)||(o==null?void 0:o.publicIp),_=(n==null?void 0:n.servicePort)||(o==null?void 0:o.servicePort),T=o==null?void 0:o.ingressHost,g=o==null?void 0:o.ingressPath;return o!=null&&o.ingressEnabled&&["public-iks-k8s-nginx","private-iks-k8s-nginx","public-iks-traefik","private-iks-traefik"].includes(o==null?void 0:o.ingressClass)&&T?`${o!=null&&o.ingressTlsEnabled?"https":"http"}://${T}${g||"/"}`:(V=o==null?void 0:o.releaseName)!=null&&V.startsWith("mcmp-jupyter-")&&T?`http://${T}:30880/`:i&&_?`${i}:${_}`:i||(T&&g?`${T}${g}`:T||"")},U=o=>o==null||o===""?"-":o,A=(o,n)=>!o||!n?!1:String(o)===String(n),J=o=>{if(!o)return"";const n=new Date(o);return Number.isNaN(n.getTime())?o:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},se=o=>{var n;o&&(ee.value=o,(n=N.value)==null||n.open(o))},_e=(o,n)=>Object.prototype.hasOwnProperty.call(o,n),Ne=o=>{window.open(o)},ue={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Re=o=>String(o||"").trim().toLowerCase(),ke=o=>ue[Re(o==null?void 0:o.name)]||"",me=o=>ke(o)||(o==null?void 0:o.logoUrlLarge)||(o==null?void 0:o.logoUrlSmall)||"",ge=o=>{const n=ke(o);if(n&&o.resolvedLogoUrl!==n){o.resolvedLogoUrl=n,o.logoLoadFailed=!1;return}o.logoLoadFailed=!0},fe=o=>o.replace(/\\n|\n/g,"
");return(o,n)=>(d(),u(E,null,[e("div",co,[e("div",vo,[e("div",po,[e("div",mo,[e("div",go,[(d(!0),u(E,null,O(m.value,(i,_)=>{var T;return d(),u("div",{class:"list-group-item pe-1",key:_},[e("div",fo,[e("div",bo,[i.resolvedLogoUrl&&!i.logoLoadFailed?(d(),u("img",{key:0,src:i.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:g=>ge(i)},null,40,yo)):(d(),u("div",_o,[F(le(Ia),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:g=>r(_)},[ve(v(i.name)+" ",1),e("div",ho,v(i.summary),1)],8,ko),e("div",{class:"col-3 d-flex justify-content-end",onClick:g=>r(_)},[e("span",wo,[F(le($a),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Io,v(i.averageRating||0),1),e("span",So," ("+v(i.ratingCount||0)+") ",1)]),e("span",Mo,[F(le(Na),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",Ao,v(i.downloadCount||0),1)])],8,Co),e("div",To,[e("div",Eo,[e("div",No,[F(le(Ra),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2",onClick:ie(g=>$(i,"edit"),["stop"])},null,8,["onClick"]),F(le(Da),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:ie(g=>$(i,"delete"),["stop"])},null,8,["onClick"])])]),((T=R.value)==null?void 0:T.catalogId)===i.id?(d(),u("div",{key:0,class:"d-flex justify-content-end gap-1 my-1",onClick:n[1]||(n[1]=ie(()=>{},["stop"]))},[(d(!0),u(E,null,O(i.catalogMembers,g=>{var V;return d(),u("button",{key:g.id,type:"button",class:"btn btn-sm btn-outline-secondary",onClick:De=>B(g)},v(((V=R.value)==null?void 0:V.action)==="edit"?"Edit":"Delete")+" "+v(g.helmChart?"K8s":"VM"),9,Ro)}),128)),e("button",{type:"button",class:"btn btn-sm btn-ghost-secondary","aria-label":"Cancel catalog action",onClick:n[0]||(n[0]=g=>R.value=null)},"Cancel")])):x("",!0),e("div",{class:"d-flex justify-content-end",onClick:g=>r(_)},[e("span",$o,v(i.category.length>25?i.category.substring(0,25)+"...":i.category),1)],8,Do)]),e("div",{id:"accordion_"+i.id,class:"accordion-collapse collapse",style:da([i.isShow?{display:"block"}:{display:"none"}])},[e("div",Lo,[e("div",{class:"mt-3 mb-5",innerHTML:fe(i.description)},null,8,xo),e("div",null,[n[5]||(n[5]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${_}-entity-ul`},[_e(i.refData,"HOMEPAGE")?(d(!0),u(E,{key:0},O(i.refData.HOMEPAGE,(g,V)=>(d(),u("li",{key:V},[e("a",{class:"btn",onClick:De=>Ne(g.refValue)},v(g.refValue),9,Vo)]))),128)):x("",!0)],8,Po),n[6]||(n[6]=e("strong",null,"TAGS",-1)),e("ul",{id:`${_}-tag-ul`},[_e(i.refData,"TAG")?(d(!0),u(E,{key:0},O(i.refData.TAG,(g,V)=>(d(),u("span",{key:V},"#"+v(g.refValue)+"  ",1))),128)):x("",!0)],8,Go),n[7]||(n[7]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${_}-tag-ul`},[i.recommendedCpu&&i.recommendedMemory&&i.recommendedDisk?(d(),u(E,{key:0},[e("button",Ho," CPU : "+v(i.recommendedCpu)+" Core ",1),e("button",Bo," MEMORY : "+v(i.recommendedMemory)+" GB ",1),e("button",Ko," DISK : "+v(i.recommendedDisk)+" GB ",1)],64)):x("",!0)],8,Oo),e("div",Fo,[e("div",zo,[n[2]||(n[2]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:i.deploymentStatusLoading,onClick:ie(g=>p(i),["stop"])},[F(le(Aa),{class:"icon",size:"18","stroke-width":"1.75"})],8,jo)]),i.deploymentStatusLoading?(d(),u("div",qo," Loading deployment status... ")):(d(),u("div",Yo,[e("table",Wo,[n[4]||(n[4]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[i.deploymentStatuses.length===0?(d(),u("tr",Jo,n[3]||(n[3]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):x("",!0),(d(!0),u(E,null,O(i.deploymentStatuses,g=>(d(),u("tr",{key:g.rowKey},[e("td",null,v(g.deploymentType),1),e("td",null,v(g.target),1),e("td",null,v(g.csp),1),e("td",null,[e("span",{class:te(le(Sa)(g.status))},v(le(Ye)(g.status)),3)]),e("td",null,v(g.ipOrEndpoint),1),e("td",null,v(g.lastCheckedOrDeployedAt),1),e("td",Zo,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!g.deploymentId,onClick:ie(V=>se(g.deploymentId),["stop"])}," Detail ",8,Qo)])]))),128))])])]))])])])],12,Uo)])])}),128))])])])])],512),F(uo,{ref_key:"deleteConfirmModal",ref:Y,"target-catalog":y.value,onDeleted:ae,onClose:k},null,8,["target-catalog"]),F(Wt,{ref_key:"wizardModal",ref:G,mode:I.value,onCreated:H,onUpdated:H},null,8,["mode"]),F(Ma,{ref_key:"applicationDetailModalRef",ref:N,"deployment-id":ee.value},null,8,["deployment-id"])],64))}}),es={class:"page",ref:"sofwareCatalog"},as={class:"page-wrapper"},ls={class:"page-header d-print-none"},ts={class:"container-xxl"},os={class:"row g-2 align-items-center"},ss={class:"col-auto ms-auto"},ns={class:"btn-list"},is={class:"page-body"},rs={class:"container-xxl"},ds={class:"row"},us={class:"col-lg-12"},Cs=Te({__name:"SoftwareCatalog",setup(pe){const oe=ua(),X=q(()=>oe.getNsId()||""),m=c(""),K=c(null),L=M=>{const S=document.getElementById(M);S&&je.getOrCreateInstance(S).show()},f=async M=>{m.value=M,await Pe(),L("install-form")},I=async()=>{var M;(M=K.value)==null||M.startRegistration(),await Pe(),L("modal-wizard")};return(M,S)=>(d(),u(E,null,[e("div",es,[e("div",as,[e("div",ls,[e("div",ts,[e("div",os,[S[1]||(S[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",ss,[e("div",ns,[e("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn",onClick:I}," Register "),e("button",{type:"button",class:"btn btn-primary page-header-action-btn",onClick:S[0]||(S[0]=y=>f("Application Installation"))}," Deploy ")])])])])]),e("div",is,[e("div",rs,[e("div",ds,[e("div",us,[F(Xo,{ref_key:"softwareCatalogListRef",ref:K},null,512)])])])])])],512),F(na,{"ns-id":X.value,title:m.value},null,8,["ns-id","title"])],64))}});export{Cs as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalogListTest-Bv1oxm_T.js b/src/main/resources/static/assets/SoftwareCatalogListTest-Bv1oxm_T.js new file mode 100644 index 0000000..38f1e39 --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalogListTest-Bv1oxm_T.js @@ -0,0 +1,11 @@ +import{I as B}from"./IconPlus-CfVojf7j.js";import{c as L}from"./createVueComponent-DGcjOmEh.js";import{d as D,g as I,o as l,c as n,a as t,t as _,r as c,h as M,i as N,J as j,b as w,u as T,F as x,k as S,m as $,f as A,e as E}from"./index-B9L3o1bN.js";import{e as P,x as O,n as U}from"./applicationDetailModal-DlYeJQEs.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as V}from"./lodash-PecLoxXt.js";import{A as H}from"./applicationInstallationForm-CmPX1mlj.js";import"./bootstrap.esm-Ceob_0pG.js";import"./request-BQy8ZIMN.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var z=L("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var F=L("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);const J={class:"card mb-3"},K={class:"grid"},Y={class:"g-col-5"},q=["src"],Q={class:"col-auto text-muted",style:{"align-items":"center"}},W={class:"col g-col-7"},X={class:"text-muted mt-3",style:{height:"50px"}},Z=D({__name:"softwareCatalogCard",props:{catalogInfo:{},idx:{}},emits:["set-software-catalog-refrence"],setup(C,{emit:y}){const d=C,g=y,e=I(()=>d.catalogInfo),o=I(()=>d.idx),b=async r=>{g("set-software-catalog-refrence",r)};return(r,p)=>(l(),n("div",J,[t("div",{class:"card-body cursor-pointer",onClick:p[0]||(p[0]=m=>b(o.value))},[t("div",K,[t("div",Y,[t("img",{src:e.value.catalogIcon,class:"rounded mb-3",alt:"Catalog Icon",width:"50",height:"50",style:{"margin-left":"5px"}},null,8,q),t("div",Q,_(e.value.catalogCategory),1)]),t("div",W,[t("div",null,[t("b",null,_(e.value.catalogTitle),1),t("div",X,_(e.value.catalogSummary),1)])])])])]))}}),tt={class:"modal",id:"software-card-detail",tabindex:"-1"},st={class:"modal-dialog modal-lg",role:"document"},at={class:"modal-content"},ot={class:"modal-header"},et={class:"modal-title"},lt={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},nt={class:"datagrid"},dt={class:"datagrid-item"},it={class:"d-flex justify-content-space-between"},ct={class:"col-lg-11 d-flex justify-content-start mb-5"},rt={class:"me-30",style:{"margin-right":"30px"}},ut=["src"],vt={class:"col-auto text-muted",style:{"align-items":"center"}},_t={class:"mt-3"},mt={class:"text-muted"},gt={class:"col-lg-1 lh-1"},pt={class:"dropdown"},ht={href:"#",class:"link-secondary","data-bs-toggle":"dropdown"},ft={class:"dropdown-menu dropdown-menu-end"},bt={class:"pt-0"},yt=["innerHTML"],wt={class:"datagrid"},Ct={class:"datagrid-item mb-5"},kt={class:"datagrid-content"},xt=["onClick"],$t={class:"datagrid-item"},It={class:"datagrid-content"},St={key:0},Dt={class:"d-inline"},Tt={class:"datagrid"},Lt={class:"datagrid-item mb-5"},Mt={class:"datagrid-content"},Nt={class:"btn btn-sm",style:{"margin-right":"5px"}},jt={class:"btn btn-sm",style:{"margin-right":"5px"}},At={class:"btn btn-sm",style:{"margin-right":"5px"}},Et={class:"footer"},Rt={class:"col-auto me-auto fs-3"},Bt={class:"d-flex justify-content-center"},Pt=D({__name:"softwareCatalogCardDetail",props:{catalogIdx:{}},emits:["set-software-catalog-refrence","on-click-deploy"],setup(C,{emit:y}){const d=C,g=y,e=I(()=>d.catalogIdx),o=c({});M(()=>e.value,async()=>{await b(e.value)}),N(async()=>{await b(e.value)});const b=async i=>{await P(Number(i)).then(({data:s})=>{s.catalogIcon=j(s.catalogIcon),o.value=s})},r=c("new"),p=i=>{r.value="update"},m=i=>i===void 0?"":i.replace(/\\n|\n/g,"
"),u=(i,s)=>i===void 0?null:Object.prototype.hasOwnProperty.call(i,s),h=i=>{window.open(i)},k=i=>{g("on-click-deploy",i)};return(i,s)=>{var a,f;return l(),n("div",tt,[t("div",st,[t("div",at,[t("div",ot,[t("h5",et,_(o.value.catalogTitle),1),s[3]||(s[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",lt,[t("div",nt,[t("div",dt,[t("div",it,[t("div",ct,[t("div",rt,[t("img",{src:o.value.catalogIcon,class:"rounded mb-3",alt:"Catalog Icon",width:"50",height:"50",style:{"margin-left":"5px"}},null,8,ut),t("div",vt,_(o.value.catalogCategory),1)]),t("div",_t,[t("b",null,_(o.value.catalogTitle),1),t("div",mt,_(o.value.catalogSummary),1)])]),t("div",gt,[t("div",pt,[t("a",ht,[w(T(z),{class:"icon icon-tabler",color:"black",size:20,"stroke-width":"2"})]),t("div",ft,[t("a",{class:"dropdown-item",onClick:s[0]||(s[0]=v=>p(o.value.catalogIdx||0)),"data-bs-toggle":"modal","data-bs-target":"#modal-form"},"Update")])])])])])]),t("div",bt,[t("div",{class:"mb-5",style:{"white-space":"pre-wrap"},innerHTML:m(o.value.catalogDescription||"")},null,8,yt),t("div",wt,[t("div",Ct,[s[4]||(s[4]=t("div",{class:"datagrid-title"},"Ref Information",-1)),t("div",kt,[u(o.value.refData,"HOMEPAGE")?(l(!0),n(x,{key:0},S((a=o.value.refData)==null?void 0:a.HOMEPAGE,v=>(l(),n("div",{key:v},[t("a",{onClick:R=>h(v),class:"btn"},_(v),9,xt)]))),128)):$("",!0)])]),t("div",$t,[s[5]||(s[5]=t("div",{class:"datagrid-title"},"TAGS",-1)),t("div",It,[u(o.value.refData,"TAG")?(l(),n("div",St,[(l(!0),n(x,null,S((f=o.value.refData)==null?void 0:f.TAG,v=>(l(),n("div",{class:"d-inline",key:v},[t("div",Dt,[t("span",null,"#"+_(v)+"  ",1)])]))),128))])):$("",!0)])])]),t("div",Tt,[t("div",Lt,[s[6]||(s[6]=t("div",{class:"datagrid-title"},"Recommended Spec",-1)),t("div",Mt,[o.value.recommendedCpu&&o.value.recommendedMemory&&o.value.recommendedDisk?(l(),n(x,{key:0},[t("button",Nt," CPU : "+_(o.value.recommendedCpu),1),t("button",jt," MEMORY : "+_(o.value.recommendedMemory),1),t("button",At," DISK : "+_(o.value.recommendedDisk),1)],64)):$("",!0)])])])])]),t("div",Et,[t("div",Rt,[t("div",Bt,[t("button",{class:"btn btn-primary me-md-2 mb-2","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:s[1]||(s[1]=v=>k("Application Installation"))},"INSTALL"),t("button",{class:"btn btn-danger me-md-2 mb-2","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:s[2]||(s[2]=v=>k("Application Uninstallation"))},"UNINSTALL")])])])])])])}}}),Ot=G(Pt,[["__scopeId","data-v-964f7356"]]),Ut={class:"modal fade",id:"softwareCatalogLog",tabindex:"-1"},Gt={class:"modal-dialog modal-xl",role:"document"},Vt={class:"modal-content"},Ht={class:"modal-body text-left py-4"},zt={class:"mb-5"},Ft={key:0,class:"spinner-border",role:"status"},Jt={key:0},Kt={class:"card mb-3"},Yt=["onClick"],qt={class:"card-title"},Qt={key:0,class:"card-body"},Wt=["value"],Xt=D({__name:"softwareCatalogLog",props:{jobName:{}},setup(C){A();const y=C,d=c(!1),g=I(()=>y.jobName);M(g,async()=>{d.value=!1,await o()});const e=c([]),o=async()=>{e.value=[];const m=await O(g.value);e.value=m.data.data,d.value=!0},b=()=>{e.value=[],r.value=1},r=c(1),p=m=>{r.value===m?r.value=0:r.value=m};return(m,u)=>(l(),n("div",Ut,[t("div",Gt,[t("div",Vt,[u[3]||(u[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),t("div",Ht,[t("h3",zt,[u[1]||(u[1]=E(" Build Log ")),d.value?$("",!0):(l(),n("div",Ft,u[0]||(u[0]=[t("span",{class:"visually-hidden"},"Loading...",-1)])))]),t("div",null,[e.value.length<=0?(l(),n("div",Jt,u[2]||(u[2]=[t("p",{class:"text-secondary"},"No Data",-1)]))):(l(!0),n(x,{key:1},S(e.value,h=>(l(),n("div",{key:h.buildIdx},[t("div",Kt,[t("div",{class:"card-header",onClick:k=>p(h.buildIdx),style:{cursor:"pointer"}},[t("h3",qt,_(h.buildIdx),1)],8,Yt),r.value===h.buildIdx?(l(),n("div",Qt,[t("textarea",{value:h.buildLog,disabled:"",style:{width:"100%"},rows:"20"},null,8,Wt)])):$("",!0)])]))),128))])]),t("div",{class:"modal-footer"},[t("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:b}," Cancel ")])])])]))}}),Zt={class:"page",ref:"sofwareCatalog"},ts={class:"page-wrapper"},ss={class:"page-header d-print-none"},as={class:"container-xl"},os={class:"row g-2 align-items-center"},es={class:"col-auto ms-auto d-print-none"},ls={class:"d-flex"},ns={class:"me-3 d-none d-md-block"},ds={class:"input-icon"},is={class:"input-icon-addon"},cs={class:"col-auto ms-auto"},rs={class:"btn-list"},us={class:"page-body"},vs={class:"container-xl"},_s={class:"row"},ms={class:"col-auto"},gs={class:"card bg-color-white"},ps={class:"card-body"},hs={class:"row row-deck"},fs={class:"w-100"},Ds=D({__name:"SoftwareCatalogListTest",setup(C){const y=A(),d=c([]),g=c("");c([]),c([]);const e=c(0),o=c(""),b=c("new"),r=c("");c("ns01");const p=c("");N(async()=>{g.value="",window.addEventListener("message",async function(s){const a=s.data;a.projectInfo&&(r.value=a.projectInfo.ns_id)}),await m()});const m=async()=>{try{const s=await U(g.value);V.forEach(s.data,function(a){a.catalogIcon=j(a.catalogIcon),a.refData=u(a.catalogRefData),a.isShow=!1}),d.value=s.data}catch(s){console.log(s),y.error("데이터를 가져올 수 없습니다.")}},u=s=>s.reduce((a,f)=>(a[f.referenceType]||(a[f.referenceType]=[]),a[f.referenceType].push(f),a),{}),h=async s=>{e.value=s,d.value.forEach(a=>{a.isShow=!1}),d.value[s].isShow=!d.value[s].isShow},k=()=>{b.value="new",e.value=0},i=s=>{p.value=s};return(s,a)=>(l(),n("div",Zt,[t("div",ts,[t("div",ss,[t("div",as,[t("div",os,[a[2]||(a[2]=t("div",{class:"col d-flex"},[t("h2",{class:"page-title"},"Software catalog")],-1)),t("div",es,[t("div",ls,[t("div",ns,[t("div",ds,[a[0]||(a[0]=t("input",{type:"text",class:"form-control",placeholder:"Search…"},null,-1)),t("span",is,[w(T(F),{class:"icon icon-tabler icon-tabler-search",size:24})])])])])]),t("div",cs,[t("div",rs,[t("a",{class:"btn btn-primary d-none d-sm-inline-block",onClick:k,"data-bs-toggle":"modal","data-bs-target":"#modal-form"},[w(T(B),{class:"icon icon-tabler icon-tabler-plus",color:"white",size:20,"stroke-width":"2"}),a[1]||(a[1]=E(" New "))])])])])])]),t("div",us,[t("div",vs,[t("div",_s,[t("div",ms,[t("div",gs,[t("div",ps,[t("div",hs,[(l(!0),n(x,null,S(d.value,(f,v)=>(l(),n("div",{class:"col-md-4",key:v,style:{width:"33%",display:"flex","justify-content":"space-between"}},[t("div",fs,[w(Z,{"catalog-info":f,idx:v,"data-bs-toggle":"modal","data-bs-target":"#software-card-detail",onSetSoftwareCatalogRefrence:R=>h(v)},null,8,["catalog-info","idx","onSetSoftwareCatalogRefrence"])])]))),128))])])])])])])])]),w(Xt,{"job-name":o.value},null,8,["job-name"]),w(H,{"ns-id":r.value,title:p.value,"catalog-list":d.value},null,8,["ns-id","title","catalog-list"]),w(Ot,{"catalog-idx":e.value+1,onOnClickDeploy:i},null,8,["catalog-idx"])],512))}});export{Ds as default}; diff --git a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js new file mode 100644 index 0000000..c07f824 --- /dev/null +++ b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js @@ -0,0 +1,22 @@ +var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,h as je,i as Et,B as yt,x as Rt,c as xt,o as Tt}from"./index-B9L3o1bN.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` +`),l.forEach(function(r){e.push(r.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(r){var o=i.find(function(a){return r&&a.definition.title&&r.trim()&&a.definition.title.trim()===r.trim()});o?s.push(o):t=!1}),t||(t=!0,s=[],e[0].forEach(function(r){var o=i.find(function(a){return r&&a.field&&r.trim()&&a.field.trim()===r.trim()});o?s.push(o):t=!1}),t||(s=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(r){var o={};r.forEach(function(a,h){s[h]&&(o[s[h].field]=a)}),n.push(o)}),n):!1}},Pt={copyToClipboard:["ctrl + 67","meta + 67"]},Ot={copyToClipboard:function(l){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},At={keybindings:{bindings:Pt,actions:Ot}};const _=class _ extends w{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(s),t=i?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var s=[];i.columns.forEach(n=>{var r="";if(n)if(i.type==="group"&&(n.value=n.component.getKey()),n.value===null)r="";else switch(typeof n.value){case"object":r=JSON.stringify(n.value);break;case"undefined":r="";break;default:r=n.value}s.push(r)}),t.push(s.join(" "))}),t.join(` +`)}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(s=document.body.createTextRange(),s.moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=_.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=_.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);return(i||!["DIV","SPAN"].includes(e.target.tagName))&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}};b(_,"moduleName","clipboard"),b(_,"moduleExtensions",At),b(_,"pasteActions",Ht),b(_,"pasteParsers",Ft);let ge=_;class _t{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Ye{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class ne extends M{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=s[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var n=this.column.definition.cssClass.split(" ");n.forEach(r=>{e.classList.add(r)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var s=this.setValueProcessData(e,t,i);s&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Ye(this)),this.component}}class $e{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var Qe={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};const W=class W extends M{constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((s,n)=>{var r=new W(s,this);this.attachColumn(r)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(W.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{W.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",s=>{s.stopPropagation(),i.focus()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,s=>{i.value=s||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,s=>{this._formatColumnHeaderTitle(t,s||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,s=i.length,n;for(let r=0;r{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach(function(s){s.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let s=0;s-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(s=>{s.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(s=>{var n=s.getWidth();n>t&&(t=n)}),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new $e(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof W?this.parent.getComponent():!1}};b(W,"defaultOptionList",Qe);let U=W;class oe{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class S extends M{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&x.elVisible(this.element),i={},s;return new Promise((n,r)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),s=this.chain("row-data-changing",[this,i,e],null,e);for(let o in s)this.data[o]=s[o];this.dispatch("row-data-save-after",this);for(let o in e)this.table.columnManager.getColumnsByFieldRoot(o).forEach(h=>{let d=this.getCell(h.getField());if(d){let u=h.getFieldValue(s);d.getValue()!==u&&(d.setValueProcessData(u),t&&d.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new oe(this)),this.component}}var Bt={avg:function(l,e,t){var i=0,s=typeof t.precision<"u"?t.precision:2;return l.length&&(i=l.reduce(function(n,r){return Number(n)+Number(r)}),i=i/l.length,i=s!==!1?i.toFixed(s):i),parseFloat(i).toString()},max:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n>i||i===null)&&(i=n)}),i!==null?s!==!1?i.toFixed(s):i:""},min:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n(l||s===0)&&l.indexOf(s)===n);return i.length}};const B=class B extends w{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new U({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":B.calculations[t.topCalc]?i.topCalc=B.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":B.calculations[t.bottomCalc]?i.botCalc=B.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach(n=>{var r;t.push(n.getData()),i&&((r=n.modules.dataTree)!=null&&r.open)&&this.rowsToData(s.getFilteredTreeChildren(n)).forEach(o=>{t.push(n)})}),t}generateRow(e,t){var i=this.generateRowData(e,t),s;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),s=new S(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),s.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),s.component=!1,s.getComponent=()=>(s.component||(s.component=new _t(s)),s.component),s.generateCells=()=>{var n=[];this.table.columnManager.columnsByIndex.forEach(r=>{this.genColumn.setField(r.getField()),this.genColumn.hozAlign=r.hozAlign,r.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(r.definition[e+"CalcFormatter"]),params:r.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=r.definition.cssClass;var o=new ne(this.genColumn,s);o.getElement(),o.column=r,o.setWidth(),r.cells.push(o),n.push(o),r.visible||o.hide()}),s.cells=n},s}generateRowData(e,t){var i={},s=e=="top"?this.topCalcs:this.botCalcs,n=e=="top"?"topCalc":"botCalc",r,o;return s.forEach(function(a){var h=[];a.modules.columnCalcs&&a.modules.columnCalcs[n]&&(t.forEach(function(d){h.push(a.getFieldValue(d))}),o=n+"Params",r=typeof a.modules.columnCalcs[o]=="function"?a.modules.columnCalcs[o](h,t):a.modules.columnCalcs[o],a.setFieldValue(i,a.modules.columnCalcs[n](h,t,r)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={},n={};return i.forEach(r=>{s[r.getKey()]=this.getGroupResults(r)}),n={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s},n}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}};b(B,"moduleName","columnCalcs"),b(B,"calculations",Bt);let be=B;class Ze extends w{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,s){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,s){return t.dataTreeStartExpanded[s]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&typeof t=="object"&&t!==null;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:s?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&s?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&s?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:s}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),s=e.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(s.branchEl,i.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",n=>{n.stopPropagation()}),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,s)=>{var n,r;t.push(i),i instanceof S&&(i.create(),n=i.modules.dataTree,!n.index&&n.children!==!1&&(r=this.getChildren(i,!1,!0),r.forEach(o=>{o.create(),t.push(o)})))}),t}getChildren(e,t,i){var s=e.modules.dataTree,n=[],r=[];return s.children!==!1&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(s.children):n=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(o=>{r.push(o);var a=this.getChildren(o,!1,!0);a.forEach(h=>{r.push(h)})})),r}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(s=>{var n=new S(s||{},this.table.rowManager);n.create(),n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),t.push(n)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],s;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(t.children):s=t.children,s.forEach(n=>{n instanceof S&&i.push(n)})),i}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var n=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof s<"u"&&(n=this.findChildIndex(s,e),n!==!1&&e.data[this.field].splice(i?n:n+1,0,t)),n===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof S?i=e.data:e instanceof oe?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(s=>s instanceof S?s.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(s=>s.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach(r=>{r instanceof S&&(n.push(t?r.getComponent():r),i&&this.getTreeChildren(r,t,i).forEach(o=>{n.push(o)}))})),n}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}b(Ze,"moduleName","dataTree");function Vt(l,e={},t){var i=e.delimiter?e.delimiter:",",s=[],n=[];l.forEach(r=>{var o=[];switch(r.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":r.columns.forEach((a,h)=>{a&&a.depth===1&&(n[h]=typeof a.value>"u"||a.value===null?"":'"'+String(a.value).split('"').join('""')+'"')});break;case"row":r.columns.forEach(a=>{if(a){switch(typeof a.value){case"object":a.value=a.value!==null?JSON.stringify(a.value):"";break;case"undefined":a.value="";break}o.push('"'+String(a.value).split('"').join('""')+'"')}}),s.push(o.join(i));break}}),n.length&&s.unshift(n.join(i)),s=s.join(` +`),e.bom&&(s="\uFEFF"+s),t(s,"text/csv")}function It(l,e,t){var i=[];l.forEach(s=>{var n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(n);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function Nt(l,e={},t){var i=[],s=[],n={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},o=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},a=e.jsPDF||{},h=e.title?e.title:"";a.orientation||(a.orientation=e.orientation||"landscape"),a.unit||(a.unit="pt"),l.forEach(c=>{switch(c.type){case"header":i.push(d(c));break;case"group":s.push(d(c,r));break;case"calc":s.push(d(c,o));break;case"row":s.push(d(c));break}});function d(c,f){var g=[];return c.columns.forEach(p=>{var v;if(p){switch(typeof p.value){case"object":p.value=p.value!==null?JSON.stringify(p.value):"";break;case"undefined":p.value="";break}v={content:p.value,colSpan:p.width,rowSpan:p.height},f&&(v.styles=f),g.push(v)}}),g}var u=new jspdf.jsPDF(a);e.autoTable&&(typeof e.autoTable=="function"?n=e.autoTable(u)||{}:n=e.autoTable),h&&(n.didDrawPage=function(c){u.text(h,40,30)}),n.head=i,n.body=s,u.autoTable(n),e.documentProcessing&&e.documentProcessing(u),t(u.output("arraybuffer"),"application/pdf")}function Wt(l,e,t){var i=this,s=e.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new M(this),o="compress"in e?e.compress:!0,a=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:o},h;a.type="binary",n.SheetNames=[],n.Sheets={};function d(){var f=[],g=[],p={},v={s:{c:0,r:0},e:{c:l[0]?l[0].columns.reduce((m,C)=>m+(C&&C.width?C.width:1),0):0,r:l.length}};return l.forEach((m,C)=>{var T=[];m.columns.forEach(function(y,k){y?(T.push(!(y.value instanceof Date)&&typeof y.value=="object"?JSON.stringify(y.value):y.value),(y.width>1||y.height>-1)&&(y.height>1||y.width>1)&&g.push({s:{r:C,c:k},e:{r:C+y.height-1,c:k+y.width-1}})):T.push("")}),f.push(T)}),XLSX.utils.sheet_add_aoa(p,f),p["!ref"]=XLSX.utils.encode_range(v),g.length&&(p["!merges"]=g),p}if(e.sheetOnly){t(d());return}if(e.sheets)for(var u in e.sheets)e.sheets[u]===!0?(n.SheetNames.push(u),n.Sheets[u]=d()):(n.SheetNames.push(u),r.commsSend(e.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(f){n.Sheets[u]=f}}));else n.SheetNames.push(s),n.Sheets[s]=d();e.documentProcessing&&(n=e.documentProcessing(n));function c(f){for(var g=new ArrayBuffer(f.length),p=new Uint8Array(g),v=0;v!=f.length;++v)p[v]=f.charCodeAt(v)&255;return g}h=XLSX.write(n,a),t(c(h),"application/octet-stream")}function Gt(l,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(l),"text/html")}function jt(l,e,t){const i=[];l.forEach(s=>{const n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(JSON.stringify(n));break}}),t(i.join(` +`),"application/x-ndjson")}var Ut={csv:Vt,json:It,jsonLines:jt,pdf:Nt,xlsx:Wt,html:Gt};const q=class q extends w{constructor(e){super(e),this.registerTableOption("downloadEncoder",function(t,i){return new Blob([t],{type:i})}),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,n){var r=!1;function o(h,d){n?n===!0?this.triggerDownload(h,d,e,t,!0):n(h):this.triggerDownload(h,d,e,t)}if(typeof e=="function"?r=e:q.downloaders[e]?r=q.downloaders[e]:console.warn("Download Error - No such download type found: ",e),r){var a=this.generateExportList(s);r.call(this.table,a,i||{},o.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach(s=>{var n;s.type==="group"&&(n=s.columns[0],i&&i[s.indent]&&(n.value=i[s.indent](n.value,s.component._group.getRowCount(),s.component._group.getData(),s.component)))}),t}triggerDownload(e,t,i,s,n){var r=document.createElement("a"),o=this.table.options.downloadEncoder(e,t);o&&(n?window.open(window.URL.createObjectURL(o)):(s=s||"Tabulator."+(typeof i=="function"?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(o,s):(r.setAttribute("href",window.URL.createObjectURL(o)),r.setAttribute("download",s),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept);break}}};b(q,"moduleName","download"),b(q,"downloaders",Ut);let ve=q;function ae(l,e){var t=e.mask,i=typeof e.maskLetterChar<"u"?e.maskLetterChar:"A",s=typeof e.maskNumberChar<"u"?e.maskNumberChar:"9",n=typeof e.maskWildcardChar<"u"?e.maskWildcardChar:"*";function r(o){var a=t[o];typeof a<"u"&&a!==n&&a!==i&&a!==s&&(l.value=l.value+""+a,r(o+1))}l.addEventListener("keydown",o=>{var a=l.value.length,h=o.key;if(o.keyCode>46&&!o.ctrlKey&&!o.metaKey){if(a>=t.length)return o.preventDefault(),o.stopPropagation(),!1;switch(t[a]){case i:if(h.toUpperCase()==h.toLowerCase())return o.preventDefault(),o.stopPropagation(),!1;break;case s:if(isNaN(h))return o.preventDefault(),o.stopPropagation(),!1;break;case n:break;default:if(h!==t[a])return o.preventDefault(),o.stopPropagation(),!1}}}),l.addEventListener("keyup",o=>{o.keyCode>46&&e.maskAutoFill&&r(l.value.length)}),l.placeholder||(l.placeholder=t),e.maskAutoFill&&r(l.value.length)}function Xt(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input");if(r.setAttribute("type",s.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let a in s.elementAttributes)a.charAt(0)=="+"?(a=a.slice(1),r.setAttribute(a,r.getAttribute(a)+s.elementAttributes["+"+a])):r.setAttribute(a,s.elementAttributes[a]);r.value=typeof n<"u"?n:"",e(function(){l.getType()==="cell"&&(r.focus({preventScroll:!0}),r.style.height="100%",s.selectContents&&r.select())});function o(a){(n===null||typeof n>"u")&&r.value!==""||r.value!==n?t(r.value)&&(n=r.value):i()}return r.addEventListener("change",o),r.addEventListener("blur",o),r.addEventListener("keydown",function(a){switch(a.keyCode){case 13:o();break;case 27:i();break;case 35:case 36:a.stopPropagation();break}}),s.mask&&ae(r,s),r}function Jt(l,e,t,i,s){var n=l.getValue(),r=s.verticalNavigation||"hybrid",o=String(n!==null&&typeof n<"u"?n:""),a=document.createElement("textarea"),h=0;if(a.style.display="block",a.style.padding="2px",a.style.height="100%",a.style.width="100%",a.style.boxSizing="border-box",a.style.whiteSpace="pre-wrap",a.style.resize="none",s.elementAttributes&&typeof s.elementAttributes=="object")for(let u in s.elementAttributes)u.charAt(0)=="+"?(u=u.slice(1),a.setAttribute(u,a.getAttribute(u)+s.elementAttributes["+"+u])):a.setAttribute(u,s.elementAttributes[u]);a.value=o,e(function(){l.getType()==="cell"&&(a.focus({preventScroll:!0}),a.style.height="100%",a.scrollHeight,a.style.height=a.scrollHeight+"px",l.getRow().normalizeHeight(),s.selectContents&&a.select())});function d(u){(n===null||typeof n>"u")&&a.value!==""||a.value!==n?(t(a.value)&&(n=a.value),setTimeout(function(){l.getRow().normalizeHeight()},300)):i()}return a.addEventListener("change",d),a.addEventListener("blur",d),a.addEventListener("keyup",function(){a.style.height="";var u=a.scrollHeight;a.style.height=u+"px",u!=h&&(h=u,l.getRow().normalizeHeight())}),a.addEventListener("keydown",function(u){switch(u.keyCode){case 13:u.shiftKey&&s.shiftEnterSubmit&&d();break;case 27:i();break;case 38:(r=="editor"||r=="hybrid"&&a.selectionStart)&&(u.stopImmediatePropagation(),u.stopPropagation());break;case 40:(r=="editor"||r=="hybrid"&&a.selectionStart!==a.value.length)&&(u.stopImmediatePropagation(),u.stopPropagation());break;case 35:case 36:u.stopPropagation();break}}),s.mask&&ae(a,s),a}function Kt(l,e,t,i,s){var n=l.getValue(),r=s.verticalNavigation||"editor",o=document.createElement("input");if(o.setAttribute("type","number"),typeof s.max<"u"&&o.setAttribute("max",s.max),typeof s.min<"u"&&o.setAttribute("min",s.min),typeof s.step<"u"&&o.setAttribute("step",s.step),o.style.padding="4px",o.style.width="100%",o.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let d in s.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),o.setAttribute(d,o.getAttribute(d)+s.elementAttributes["+"+d])):o.setAttribute(d,s.elementAttributes[d]);o.value=n;var a=function(d){h()};e(function(){l.getType()==="cell"&&(o.removeEventListener("blur",a),o.focus({preventScroll:!0}),o.style.height="100%",o.addEventListener("blur",a),s.selectContents&&o.select())});function h(){var d=o.value;!isNaN(d)&&d!==""&&(d=Number(d)),d!==n?t(d)&&(n=d):i()}return o.addEventListener("keydown",function(d){switch(d.keyCode){case 13:h();break;case 27:i();break;case 38:case 40:r=="editor"&&(d.stopImmediatePropagation(),d.stopPropagation());break;case 35:case 36:d.stopPropagation();break}}),s.mask&&ae(o,s),o}function qt(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),typeof s.max<"u"&&r.setAttribute("max",s.max),typeof s.min<"u"&&r.setAttribute("min",s.min),typeof s.step<"u"&&r.setAttribute("step",s.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let a in s.elementAttributes)a.charAt(0)=="+"?(a=a.slice(1),r.setAttribute(a,r.getAttribute(a)+s.elementAttributes["+"+a])):r.setAttribute(a,s.elementAttributes[a]);r.value=n,e(function(){l.getType()==="cell"&&(r.focus({preventScroll:!0}),r.style.height="100%")});function o(){var a=r.value;!isNaN(a)&&a!==""&&(a=Number(a)),a!=n?t(a)&&(n=a):i()}return r.addEventListener("blur",function(a){o()}),r.addEventListener("keydown",function(a){switch(a.keyCode){case 13:o();break;case 27:i();break}}),r}function Yt(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a=l.getValue(),h=document.createElement("input");function d(c){var f;return o.isDateTime(c)?f=c:n==="iso"?f=o.fromISO(String(c)):f=o.fromFormat(String(c),n),f.toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",s.max&&h.setAttribute("max",n?d(s.max):s.max),s.min&&h.setAttribute("min",n?d(s.min):s.min),s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),h.setAttribute(c,h.getAttribute(c)+s.elementAttributes["+"+c])):h.setAttribute(c,s.elementAttributes[c]);a=typeof a<"u"?a:"",n&&(o?a=d(a):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=a,e(function(){l.getType()==="cell"&&(h.focus({preventScroll:!0}),h.style.height="100%",s.selectContents&&h.select())});function u(){var c=h.value,f;if((a===null||typeof a>"u")&&c!==""||c!==a){if(c&&n)switch(f=o.fromFormat(String(c),"yyyy-MM-dd"),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(a=h.value)}else i()}return h.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==h)&&u()}),h.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),h}function $t(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a,h=l.getValue(),d=document.createElement("input");if(d.type="time",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+s.elementAttributes["+"+c])):d.setAttribute(c,s.elementAttributes[c]);h=typeof h<"u"?h:"",n&&(o?(o.isDateTime(h)?a=h:n==="iso"?a=o.fromISO(String(h)):a=o.fromFormat(String(h),n),h=a.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,e(function(){l.getType()=="cell"&&(d.focus({preventScroll:!0}),d.style.height="100%",s.selectContents&&d.select())});function u(){var c=d.value,f;if((h===null||typeof h>"u")&&c!==""||c!==h){if(c&&n)switch(f=o.fromFormat(String(c),"hh:mm"),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(h=d.value)}else i()}return d.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==d)&&u()}),d.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),d}function Qt(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a,h=l.getValue(),d=document.createElement("input");if(d.type="datetime-local",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+s.elementAttributes["+"+c])):d.setAttribute(c,s.elementAttributes[c]);h=typeof h<"u"?h:"",n&&(o?(o.isDateTime(h)?a=h:n==="iso"?a=o.fromISO(String(h)):a=o.fromFormat(String(h),n),h=a.toFormat("yyyy-MM-dd")+"T"+a.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,e(function(){l.getType()==="cell"&&(d.focus({preventScroll:!0}),d.style.height="100%",s.selectContents&&d.select())});function u(){var c=d.value,f;if((h===null||typeof h>"u")&&c!==""||c!==h){if(c&&n)switch(f=o.fromISO(String(c)),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(h=d.value)}else i()}return d.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==d)&&u()}),d.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),d}let Zt=class{constructor(e,t,i,s,n,r){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(r),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=t.getType()==="header",this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:n},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var e=this.cell.getValue();typeof e>"u"&&typeof this.params.defaultValue<"u"&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(i){i.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),e.addEventListener("click",t),setTimeout(()=>{e.removeEventListener("click",t)},1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(this.params.maxWidth===!0?this.listEl.style.maxWidth=e.offsetWidth+"px":typeof this.params.maxWidth=="number"?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&typeof e=="object")for(let i in e)i.charAt(0)=="+"?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&ae(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t=["values","valuesURL","valuesLookup"],i;return e=Object.assign({},e),e.verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=typeof e.placeholderLoading>"u"?"Searching ...":e.placeholderLoading,e.placeholderEmpty=typeof e.placeholderEmpty>"u"?"No Results Found":e.placeholderEmpty,e.filterDelay=typeof e.filterDelay>"u"?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",i=Object.keys(e).filter(s=>t.includes(s)).length,i?i>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&!(typeof e.valuesLookup=="function"||e.valuesURL)&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:this._keyTab(e);break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout(()=>{this.popup&&this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(e){this.params.autocomplete&&this.lastAction==="typing"?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find(s=>typeof s.label<"u"&&s.label.toLowerCase().startsWith(this.filterTerm));i&&this._focusItem(i),this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch(e=>{Number.isInteger(e)||console.error("List generation error",e)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):typeof this.params.valuesLookup=="function"?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then(s=>this.listIteration===i?this._parseList(s):Promise.reject(i))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");typeof e=="function"&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){var i=this.params.filterRemote?{term:t}:{};return e=qe(e,{},i),fetch(e).then(s=>s.ok?s.json().catch(n=>(console.warn("List Ajax Load Error - Invalid JSON returned",n),Promise.reject(n))):(console.error("List Ajax Load Error - Connection Error: "+s.status,s.statusText),Promise.reject(s))).catch(s=>(console.error("List Ajax Load Error - Connection Error: ",s),Promise.reject(s)))}_uniqueColumnValues(e){var t={},i=this.table.getData(this.params.valuesLookup),s;return e?s=this.table.columnManager.getColumnByField(e):s=this.cell.getColumn()._getSelf(),s?i.forEach(n=>{var r=s.getFieldValue(n);r!==null&&typeof r<"u"&&r!==""&&(t[r]=!0)}):(console.warn("unable to find matching column to create select lookup list:",e),t=[]),Object.keys(t)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({label:s,value:i}))),e.forEach(i=>{typeof i!="object"&&(i={label:i,value:i}),this._parseListItem(i,t,0)}),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach(s=>{this._parseListItem(s,i.options,t)}),i}_sortOptions(e){var t;return this.params.sort&&(t=typeof this.params.sort=="function"?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort((i,s)=>e(i.label,s.label,i.value,s.value,i.original,s.original)),t.forEach(i=>{i.group&&this._sortGroup(e,i.options)})}_defaultSortFunction(e,t){var i,s,n,r,o=0,a,h=/(\d+)|(\D+)/g,d=/\d/,u=0;if(this.params.sort==="desc"&&([e,t]=[t,e]),!e&&e!==0)u=!t&&t!==0?0:-1;else if(!t&&t!==0)u=1;else{if(isFinite(e)&&isFinite(t))return e-t;if(i=String(e).toLowerCase(),s=String(t).toLowerCase(),i===s)return 0;if(!(d.test(i)&&d.test(s)))return i>s?1:-1;for(i=i.match(h),s=s.match(h),a=i.length>s.length?s.length:i.length;or?1:-1;return i.length>s.length}return u}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach(i=>{this._filterItem(e,t,i)})):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach(n=>{this._filterItem(e,t,n)&&(s=!0)}),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),t!==null&&typeof t<"u"&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach(t=>{this._buildItem(t)}),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t=e.element,i;if(!this.filtered||e.visible){if(!t){if(t=document.createElement("div"),t.tabIndex=0,i=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,t):e.label,i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i,e.group?t.classList.add("tabulator-edit-list-group"):t.classList.add("tabulator-edit-list-item"),t.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&typeof e.elementAttributes=="object")for(let s in e.elementAttributes)s.charAt(0)=="+"?(s=s.slice(1),t.setAttribute(s,this.input.getAttribute(s)+e.elementAttributes["+"+s])):t.setAttribute(s,e.elementAttributes[s]);e.group?t.addEventListener("click",this._groupClick.bind(this,e)):t.addEventListener("click",this._itemClick.bind(this,e)),t.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=t}this._styleItem(e),this.listEl.appendChild(t),e.group?e.options.forEach(s=>{this._buildItem(s)}):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&this.input.value===""&&!this.params.listOnEmpty){this.popup&&this.popup.hide(!0);return}this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach(e=>{e.selected=!1,this._styleItem(e)}),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?(i=this.currentItems.indexOf(e),i>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map(s=>s.label).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map(s=>s.value);else if(e&&this.params.autocomplete&&this.typing)if(this.params.freetext||this.params.allowEmpty&&this.input.value==="")t=this.input.value;else{this.actions.cancel();return}else this.currentItems[0]?t=this.currentItems[0].value:(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues,i===null||typeof i>"u"||i===""?t=i:t=this.params.emptyValue);t===""&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}};function ei(l,e,t,i,s){var n=new Zt(this,l,e,t,i,s);return n.input}function ti(l,e,t,i,s){var n=this,r=l.getElement(),o=l.getValue(),a=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],u=document.createElement("div"),c=document.createElementNS("http://www.w3.org/2000/svg","svg");function f(m){d.forEach(function(C,T){T'):(n.table.browser=="ie"?C.setAttribute("class","tabulator-star-inactive"):C.classList.replace("tabulator-star-active","tabulator-star-inactive"),C.innerHTML='')})}function g(m){var C=document.createElement("span"),T=c.cloneNode(!0);d.push(T),C.addEventListener("mouseenter",function(y){y.stopPropagation(),y.stopImmediatePropagation(),f(m)}),C.addEventListener("mousemove",function(y){y.stopPropagation(),y.stopImmediatePropagation()}),C.addEventListener("click",function(y){y.stopPropagation(),y.stopImmediatePropagation(),t(m),r.blur()}),C.appendChild(T),u.appendChild(C)}function p(m){o=m,f(m)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",u.style.verticalAlign="middle",u.style.display="inline-block",u.style.padding="4px",c.setAttribute("width",h),c.setAttribute("height",h),c.setAttribute("viewBox","0 0 512 512"),c.setAttribute("xml:space","preserve"),c.style.padding="0 1px",s.elementAttributes&&typeof s.elementAttributes=="object")for(let m in s.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),u.setAttribute(m,u.getAttribute(m)+s.elementAttributes["+"+m])):u.setAttribute(m,s.elementAttributes[m]);for(var v=1;v<=a;v++)g(v);return o=Math.min(parseInt(o),a),f(o),u.addEventListener("mousemove",function(m){f(0)}),u.addEventListener("click",function(m){t(0)}),r.addEventListener("blur",function(m){i()}),r.addEventListener("keydown",function(m){switch(m.keyCode){case 39:p(o+1);break;case 37:p(o-1);break;case 13:t(o);break;case 27:i();break}}),u}function ii(l,e,t,i,s){var n=l.getElement(),r=typeof s.max>"u"?n.getElementsByTagName("div")[0]&&n.getElementsByTagName("div")[0].getAttribute("max")||100:s.max,o=typeof s.min>"u"?n.getElementsByTagName("div")[0]&&n.getElementsByTagName("div")[0].getAttribute("min")||0:s.min,a=(r-o)/100,h=l.getValue()||0,d=document.createElement("div"),u=document.createElement("div"),c,f;function g(){var p=window.getComputedStyle(n,null),v=a*Math.round(u.offsetWidth/((n.clientWidth-parseInt(p.getPropertyValue("padding-left"))-parseInt(p.getPropertyValue("padding-right")))/100))+o;t(v),n.setAttribute("aria-valuenow",v),n.setAttribute("aria-label",h)}if(d.style.position="absolute",d.style.right="0",d.style.top="0",d.style.bottom="0",d.style.width="5px",d.classList.add("tabulator-progress-handle"),u.style.display="inline-block",u.style.position="relative",u.style.height="100%",u.style.backgroundColor="#488CE9",u.style.maxWidth="100%",u.style.minWidth="0%",s.elementAttributes&&typeof s.elementAttributes=="object")for(let p in s.elementAttributes)p.charAt(0)=="+"?(p=p.slice(1),u.setAttribute(p,u.getAttribute(p)+s.elementAttributes["+"+p])):u.setAttribute(p,s.elementAttributes[p]);return n.style.padding="4px 4px",h=Math.min(parseFloat(h),r),h=Math.max(parseFloat(h),o),h=Math.round((h-o)/a),u.style.width=h+"%",n.setAttribute("aria-valuemin",o),n.setAttribute("aria-valuemax",r),u.appendChild(d),d.addEventListener("mousedown",function(p){c=p.screenX,f=u.offsetWidth}),d.addEventListener("mouseover",function(){d.style.cursor="ew-resize"}),n.addEventListener("mousemove",function(p){c&&(u.style.width=f+p.screenX-c+"px")}),n.addEventListener("mouseup",function(p){c&&(p.stopPropagation(),p.stopImmediatePropagation(),c=!1,f=!1,g())}),n.addEventListener("keydown",function(p){switch(p.keyCode){case 39:p.preventDefault(),u.style.width=u.clientWidth+n.clientWidth/100+"px";break;case 37:p.preventDefault(),u.style.width=u.clientWidth-n.clientWidth/100+"px";break;case 9:case 13:g();break;case 27:i();break}}),n.addEventListener("blur",function(){i()}),u}function si(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input"),o=s.tristate,a=typeof s.indeterminateValue>"u"?null:s.indeterminateValue,h=!1,d=Object.keys(s).includes("trueValue"),u=Object.keys(s).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let f in s.elementAttributes)f.charAt(0)=="+"?(f=f.slice(1),r.setAttribute(f,r.getAttribute(f)+s.elementAttributes["+"+f])):r.setAttribute(f,s.elementAttributes[f]);r.value=n,o&&(typeof n>"u"||n===a||n==="")&&(h=!0,r.indeterminate=!0),this.table.browser!="firefox"&&this.table.browser!="safari"&&e(function(){l.getType()==="cell"&&r.focus({preventScroll:!0})}),r.checked=d?n===s.trueValue:n===!0||n==="true"||n==="True"||n===1;function c(f){var g=r.checked;return d&&g?g=s.trueValue:u&&!g&&(g=s.falseValue),o?f?h?a:g:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,a):(h=!1,g):g}return r.addEventListener("change",function(f){t(c())}),r.addEventListener("blur",function(f){t(c(!0))}),r.addEventListener("keydown",function(f){f.keyCode==13&&t(c()),f.keyCode==27&&i()}),r}var ni={input:Xt,textarea:Jt,number:Kt,range:qt,date:Yt,time:$t,datetime:Qt,list:ei,star:ti,progress:ii,tickCross:si};const Z=class Z extends w{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=Z.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(e){if(this.currentCell)return!0}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),this.invalidEdit||(i===!0?i=this.table.addRow({}):typeof i=="function"?i=this.table.addRow(i(t.row.getComponent())):i=this.table.addRow(Object.assign({},i)),i.then(()=>{setTimeout(()=>{t.getComponent().navigateNext()})}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(t=>{this.table.modules.edit.clearEdited(t._getSelf())})}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft(),i)return!0;if(s=this.table.rowManager.prevDisplayRow(e.row,!0),s&&(i=this.findPrevEditableCell(s,s.cells.length),i))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight(),i)return!0;if(s=this.table.rowManager.nextDisplayRow(e.row,!0),s&&(i=this.findNextEditableCell(s,-1),i))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i),s)?(s.getComponent().edit(),!0):!1}navigateRight(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i),s)?(s.getComponent().edit(),!0):!1}navigateUp(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0),s)?(s.cells[i].getComponent().edit(),!0):!1}navigateDown(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0),s)?(s.cells[i].getComponent().edit(),!0):!1}findNextEditableCell(e,t){var i=!1;if(t0)for(var s=t-1;s>=0;s--){let n=e.cells[s];if(n.column.modules.edit&&x.elVisible(n.getElement())&&this.allowEdit(n)){i=n;break}}return i}initializeColumnCheck(e){typeof e.definition.editor<"u"&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}rowEditableCheck(e){e.getCells().forEach(t=>{t.column.modules.edit&&typeof t.column.modules.edit.check=="function"&&this.updateCellClass(t)})}initializeColumn(e){var t=Object.keys(e.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{},convertEmptyValues:t,editorEmptyValue:e.definition.editorEmptyValue,editorEmptyValueFunc:e.definition.editorEmptyValueFunc};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?i.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":e.definition.editor===!0&&(typeof e.definition.formatter!="function"?this.editors[e.definition.formatter]?i.editor=this.editors[e.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter));break}i.editor&&(e.modules.edit=i)}getCurrentCell(){return this.currentCell?this.currentCell.getComponent():!1}clearEditor(e){var t=this.currentCell,i;if(this.invalidEdit=!1,t){for(this.currentCell=!1,i=t.getElement(),this.dispatch("edit-editor-clear",t,e),i.classList.remove("tabulator-editing");i.firstChild;)i.removeChild(i.firstChild);t.row.getElement().classList.remove("tabulator-editing"),t.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),(e.column.definition.editor=="textarea"||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("mousedown",function(s){s.button===2?s.preventDefault():t.mouseClick=!0}),this.options("editTriggerEvent")==="dblclick"&&i.addEventListener("dblclick",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),(this.options("editTriggerEvent")==="focus"||this.options("editTriggerEvent")==="click")&&i.addEventListener("click",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),this.options("editTriggerEvent")==="focus"&&i.addEventListener("focus",function(s){t.recursionBlock||t.edit(e,s,!1)})}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&this.table.browser==="ie"||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if(this.table.rowManager.getRenderMode()=="virtual"){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var n=this.table.rowManager.element.scrollLeft,r=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,o=e.getElement();this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin||0),r-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),this.table.options.renderHorizontal==="virtual"&&(n-=parseInt(this.table.columnManager.renderer.vDomPadLeft),r-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),o.offsetLeftr&&(this.table.rowManager.element.scrollLeft+=o.offsetLeft+o.offsetWidth-r)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":e.row.initialized&&(t=e.column.modules.edit.check(e.getComponent()));break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check;break}return t}edit(e,t,i){var s=this,n=!0,r=function(){},o=e.getElement(),a=!1,h,d,u;if(this.currentCell){!this.invalidEdit&&this.currentCell!==e&&this.cancelEdit();return}function c(m){if(s.currentCell===e&&!a){var C=s.chain("edit-success",[e,m],!0,!0);return C===!0||s.table.options.validationMode==="highlight"?(a=!0,s.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,s.editedCells.indexOf(e)==-1&&s.editedCells.push(e),m=s.transformEmptyValues(m,e),e.setValue(m,!0),C===!0):(a=!0,s.invalidEdit=!0,s.focusCellNoEvent(e,!0),r(),setTimeout(()=>{a=!1},10),!1)}}function f(){s.currentCell===e&&!a&&s.cancelEdit()}function g(m){r=m}if(e.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(o),!1;if(t&&t.stopPropagation(),n=this.allowEdit(e),n||i){if(s.cancelEdit(),s.currentCell=e,this.focusScrollAdjust(e),d=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,d)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,d),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",d),u=typeof e.column.modules.edit.params=="function"?e.column.modules.edit.params(d):e.column.modules.edit.params,h=e.column.modules.edit.editor.call(s,d,g,c,f,u),this.currentCell&&h!==!1)if(h instanceof Node){for(o.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");o.firstChild;)o.removeChild(o.firstChild);o.appendChild(h),r();for(var p=o.children,v=0;v"u"}transformEmptyValues(e,t){var i=t.column.modules.edit,s=i.convertEmptyValues||this.convertEmptyValues,n;return s&&(n=i.editorEmptyValueFunc||this.options("editorEmptyValueFunc"),n&&n(e)&&(e=i.convertEmptyValues?i.editorEmptyValue:this.options("editorEmptyValue"))),e}blur(e){this.confirm("edit-blur",[e])||e.blur()}getEditedCells(){var e=[];return this.editedCells.forEach(t=>{e.push(t.getComponent())}),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),t=this.editedCells.indexOf(e),t>-1&&this.editedCells.splice(t,1)}};b(Z,"moduleName","edit"),b(Z,"editors",ni);let we=Z;class Ue{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class de{constructor(e,t,i,s,n){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=n}}var ri={},oi={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};const V=class V extends w{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){var n,r,o,a;return this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),a=V.columnLookups[i],a&&(o=a.call(this.table),o=o.filter(h=>this.columnVisCheck(h))),n=this.config.columnHeaders!==!1?this.headersToExportRows(this.generateColumnGroupHeaders(o)):[],o&&(o=o.map(h=>h.getComponent())),r=this.bodyToExportRows(this.rowLookup(i),o),n.concat(r)}generateTable(e,t,i,s){var n=this.generateExportList(e,t,i,s);return this.generateTableElement(n)}rowLookup(e){var t=[],i;return typeof e=="function"?e.call(this.table).forEach(s=>{s=this.table.rowManager.findRow(s),s&&t.push(s)}):(i=V.rowLookups[e]||V.rowLookups.active,t=i.call(this.table)),Object.assign([],t)}generateColumnGroupHeaders(e){var t=[];return e||(e=this.config.columnGroups!==!1?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),e.forEach(i=>{var s=this.processColumnGroup(i);s&&t.push(s)}),t}processColumnGroup(e){var t=e.columns,i=0,s=e.definition["title"+this.colVisPropAttach]||e.definition.title,n={title:s,column:e,depth:1};if(t.length){if(n.subGroups=[],n.width=0,t.forEach(r=>{var o=this.processColumnGroup(r);o&&(n.width+=o.width,n.subGroups.push(o),o.depth>i&&(i=o.depth))}),n.depth+=i,!n.width)return!1}else if(this.columnVisCheck(e))n.width=1;else return!1;return n}columnVisCheck(e){var t=e.definition[this.colVisProp];return this.config.rowHeaders===!1&&e.isRowHeader?!1:(typeof t=="function"&&(t=t.call(this.table,e.getComponent())),t===!1||t===!0?t:e.visible&&e.field)}headersToExportRows(e){var t=[],i=0,s=[];function n(r,o){var a=i-o;if(typeof t[o]>"u"&&(t[o]=[]),r.height=r.subGroups?1:a-r.depth+1,t[o].push(r),r.height>1)for(let h=1;h"u"&&(t[o+h]=[]),t[o+h].push(!1);if(r.width>1)for(let h=1;hi&&(i=r.depth)}),e.forEach(function(r){n(r,0)}),t.forEach(r=>{var o=[];r.forEach(a=>{if(a){let h=typeof a.title>"u"?"":a.title;o.push(new de(h,a.column.getComponent(),a.width,a.height,a.depth))}else o.push(null)}),s.push(new Ue("header",o))}),s}bodyToExportRows(e,t=[]){var i=[];return t.length===0&&this.table.columnManager.columnsByIndex.forEach(s=>{this.columnVisCheck(s)&&t.push(s.getComponent())}),this.config.columnCalcs!==!1&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter(s=>{switch(s.type){case"group":return this.config.rowGroups!==!1;case"calc":return this.config.columnCalcs!==!1;case"row":return!(this.table.options.dataTree&&this.config.dataTree===!1&&s.modules.dataTree.parent)}return!0}),e.forEach((s,n)=>{var r=s.getData(this.colVisProp),o=[],a=0;switch(s.type){case"group":a=s.level,o.push(new de(s.key,s.getComponent(),t.length,1));break;case"calc":case"row":t.forEach(h=>{o.push(new de(h._column.getFieldValue(r),h,1,1))}),this.table.options.dataTree&&this.config.dataTree!==!1&&(a=s.modules.dataTree.index);break}i.push(new Ue(s.type,o,s.getComponent(),a))}),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),n=this.lookupTableStyles(),r=this.table.options["rowFormatter"+this.colVisPropAttach],o={};return o.rowFormatter=r!==null?r:this.table.options.rowFormatter,this.table.options.dataTree&&this.config.dataTree!==!1&&this.table.modExists("columnCalcs")&&(o.treeElementField=this.table.modules.dataTree.elementField),o.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],o.groupHeader&&!Array.isArray(o.groupHeader)&&(o.groupHeader=[o.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((a,h)=>{let d;switch(a.type){case"header":i.appendChild(this.generateHeaderElement(a,o,n));break;case"group":s.appendChild(this.generateGroupElement(a,o,n));break;case"calc":s.appendChild(this.generateCalcElement(a,o,n));break;case"row":d=this.generateRowElement(a,o,n),this.mapElementStyles(h%2&&n.evenRow?n.evenRow:n.oddRow,d,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(d);break}}),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.styleRowHeader=e.firstRow.getElementsByClassName("tabulator-row-header")[0],e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach(n=>{if(n){var r=document.createElement("th"),o=n.component._column.definition.cssClass?n.component._column.definition.cssClass.split(" "):[];r.colSpan=n.width,r.rowSpan=n.height,r.innerHTML=n.value,this.cloneTableStyle&&(r.style.boxSizing="border-box"),o.forEach(function(a){r.classList.add(a)}),this.mapElementStyles(n.component.getElement(),r,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(n.component._column.contentElement,r,["padding-top","padding-left","padding-right","padding-bottom"]),n.component._column.visible?this.mapElementStyles(n.component.getElement(),r,["width"]):n.component._column.definition.width&&(r.style.width=n.component._column.definition.width+"px"),n.component._column.parent&&n.component._column.parent.isGroup?this.mapElementStyles(n.component._column.parent.groupElement,r,["border-top"]):this.mapElementStyles(n.component.getElement(),r,["border-top"]),n.component._column.isGroup?this.mapElementStyles(n.component.getElement(),r,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),r,["border-bottom"]),s.appendChild(r)}}),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),n=document.createElement("td"),r=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?r.value=t.groupHeader[e.indent](r.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):t.groupHeader!==!1&&(r.value=e.component._group.generator(r.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),n.colSpan=r.width,n.innerHTML=r.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),r.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(n),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");if(s.classList.add("tabulator-print-table-row"),e.columns.forEach((n,r)=>{if(n){var o=document.createElement("td"),a=n.component._column,h=this.table,d=h.columnManager.findColumnIndex(a),u=n.value,c,f,g={modules:{},getValue:function(){return u},getField:function(){return a.definition.field},getElement:function(){return o},getType:function(){return"cell"},getColumn:function(){return a.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getTable:function(){return h},getComponent:function(){return g},column:a},p=a.definition.cssClass?a.definition.cssClass.split(" "):[];if(p.forEach(function(v){o.classList.add(v)}),this.table.modExists("format")&&this.config.formatCells!==!1)u=this.table.modules.format.formatExportValue(g,this.colVisProp);else switch(typeof u){case"object":u=u!==null?JSON.stringify(u):"";break;case"undefined":u="";break}u instanceof Node?o.appendChild(u):o.innerHTML=u,f=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],a.isRowHeader?(c=i.styleRowHeader,f.push("background-color")):c=i.styleCells&&i.styleCells[d]?i.styleCells[d]:i.firstCell,c&&(this.mapElementStyles(c,o,f),a.definition.align&&(o.style.textAlign=a.definition.align)),this.table.options.dataTree&&this.config.dataTree!==!1&&(t.treeElementField&&t.treeElementField==a.field||!t.treeElementField&&r==0)&&(e.component._row.modules.dataTree.controlEl&&o.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),o.firstChild),e.component._row.modules.dataTree.branchEl&&o.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),o.firstChild)),s.appendChild(o),g.modules.format&&g.modules.format.renderedCallback&&g.modules.format.renderedCallback()}}),t.rowFormatter&&e.type==="row"&&this.config.formatCells!==!1){let n=Object.assign(e.component);n.getElement=function(){return s},t.rowFormatter(e.component)}return s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var n=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(n)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(e);i.forEach(function(r){t.style[s[r]]||(t.style[s[r]]=n.getPropertyValue(r))})}}}};b(V,"moduleName","export"),b(V,"columnLookups",ri),b(V,"rowLookups",oi);let Ce=V;var ai={"=":function(l,e,t,i){return e==l},"<":function(l,e,t,i){return e":function(l,e,t,i){return e>l},">=":function(l,e,t,i){return e>=l},"!=":function(l,e,t,i){return e!=l},regex:function(l,e,t,i){return typeof l=="string"&&(l=new RegExp(l)),l.test(e)},like:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().indexOf(l.toLowerCase())>-1:!1},keywords:function(l,e,t,i){var s=l.toLowerCase().split(typeof i.separator>"u"?" ":i.separator),n=String(e===null||typeof e>"u"?"":e).toLowerCase(),r=[];return s.forEach(o=>{n.includes(o)&&r.push(!0)}),i.matchAll?r.length===s.length:!!r.length},starts:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().startsWith(l.toLowerCase()):!1},ends:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().endsWith(l.toLowerCase()):!1},in:function(l,e,t,i){return Array.isArray(l)?l.length?l.indexOf(e)>-1:!0:(console.warn("Filter Error - filter value is not an array:",l),!1)}};const O=class O extends w{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),this.table.options.filterMode==="remote"&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach(e=>{var t=this.table.columnManager.findColumn(e.field);if(t)this.setHeaderFilterValue(t,e.value);else return console.warn("Column Filter Error - No matching column found:",e.field),!1}),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}generatePlaceholder(e){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(t)this.setHeaderFilterFocus(t);else return console.warn("Column Filter Focus Error - No matching column found:",e),!1}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(i)this.setHeaderFilterValue(i,t);else return console.warn("Column Filter Error - No matching column found:",e),!1}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&this.initializeColumn(e)}initializeColumn(e,t){var i=this,s=e.getField();function n(r){var o=e.modules.filter.tagType=="input"&&e.modules.filter.attrType=="text"||e.modules.filter.tagType=="textarea"?"partial":"match",a="",h="",d;if(typeof e.modules.filter.prevSuccess>"u"||e.modules.filter.prevSuccess!==r){if(e.modules.filter.prevSuccess=r,e.modules.filter.emptyFunc(r))delete i.headerFilters[s];else{switch(e.modules.filter.value=r,typeof e.definition.headerFilterFunc){case"string":O.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,d=function(u){var c=e.definition.headerFilterFuncParams||{},f=e.getFieldValue(u);return c=typeof c=="function"?c(r,f,u):c,O.filters[e.definition.headerFilterFunc](r,f,u,c)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":d=function(u){var c=e.definition.headerFilterFuncParams||{},f=e.getFieldValue(u);return c=typeof c=="function"?c(r,f,u):c,e.definition.headerFilterFunc(r,f,u,c)},a=d;break}if(!d)switch(o){case"partial":d=function(u){var c=e.getFieldValue(u);return typeof c<"u"&&c!==null?String(c).toLowerCase().indexOf(String(r).toLowerCase())>-1:!1},a="like";break;default:d=function(u){return e.getFieldValue(u)==r},a="="}i.headerFilters[s]={value:r,func:d,type:a}}e.modules.filter.value=r,h=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==h&&(i.prevHeaderFilterChangeCheck=h,i.trackChanges(),i.refreshFilter())}return!0}e.modules.filter={success:n,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s=this,n=e.modules.filter.success,r=e.getField(),o,a,h,d,u,c,f,g;e.modules.filter.value=t;function p(){}function v(m){g=m}if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),r){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(m){return!m&&m!==0},o=document.createElement("div"),o.classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":s.table.modules.edit.editors[e.definition.headerFilter]?(a=s.table.modules.edit.editors[e.definition.headerFilter],(e.definition.headerFilter==="tick"||e.definition.headerFilter==="tickCross")&&!e.definition.headerFilterEmptyCheck&&(e.modules.filter.emptyFunc=function(m){return m!==!0&&m!==!1})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":a=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?a=e.modules.edit.editor:e.definition.formatter&&s.table.modules.edit.editors[e.definition.formatter]?(a=s.table.modules.edit.editors[e.definition.formatter],(e.definition.formatter==="tick"||e.definition.formatter==="tickCross")&&!e.definition.headerFilterEmptyCheck&&(e.modules.filter.emptyFunc=function(m){return m!==!0&&m!==!1})):a=s.table.modules.edit.editors.input;break}if(a){if(d={getValue:function(){return typeof t<"u"?t:""},getField:function(){return e.definition.field},getElement:function(){return o},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},f=e.definition.headerFilterParams||{},f=typeof f=="function"?f.call(s.table,d):f,h=a.call(this.table.modules.edit,d,v,n,p,f),!h){console.warn("Filter Error - Cannot add filter to "+r+" column, editor returned a value of false");return}if(!(h instanceof Node)){console.warn("Filter Error - Cannot add filter to "+r+" column, editor should return an instance of Node, the editor returned:",h);return}s.langBind("headerFilters|columns|"+e.definition.field,function(m){h.setAttribute("placeholder",typeof m<"u"&&m?m:e.definition.headerFilterPlaceholder||s.langText("headerFilters|default"))}),h.addEventListener("click",function(m){m.stopPropagation(),h.focus()}),h.addEventListener("focus",m=>{var C=this.table.columnManager.contentsElement.scrollLeft,T=this.table.rowManager.element.scrollLeft;C!==T&&(this.table.rowManager.scrollHorizontal(C),this.table.columnManager.scrollHorizontal(C))}),u=!1,c=function(m){u&&clearTimeout(u),u=setTimeout(function(){n(h.value)},s.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=h,e.modules.filter.attrType=h.hasAttribute("type")?h.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=h.tagName.toLowerCase(),e.definition.headerFilterLiveFilter!==!1&&(e.definition.headerFilter==="autocomplete"||e.definition.headerFilter==="tickCross"||(e.definition.editor==="autocomplete"||e.definition.editor==="tickCross")&&e.definition.headerFilter===!0||(h.addEventListener("keyup",c),h.addEventListener("search",c),e.modules.filter.attrType=="number"&&h.addEventListener("change",function(m){n(h.value)}),e.modules.filter.attrType=="text"&&this.table.browser!=="ie"&&h.setAttribute("type","search")),(e.modules.filter.tagType=="input"||e.modules.filter.tagType=="select"||e.modules.filter.tagType=="textarea")&&h.addEventListener("mousedown",function(m){m.stopPropagation()})),o.appendChild(h),e.contentElement.appendChild(o),i||s.headerFilterColumns.push(e),g&&g()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})}showHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&(this.table.options.filterMode==="remote"?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var n=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach(r=>{r=this.findFilter(r),r&&(this.filterList.push(r),n=!0)}),n&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return typeof e.field=="function"?i=function(s){return e.field(s,e.type||{})}:O.filters[e.type]?(t=this.table.columnManager.getColumnByField(e.field),t?i=function(s){return O.filters[e.type](e.value,t.getFieldValue(s),s,e.params||{})}:i=function(s){return O.filters[e.type](e.value,s[e.field],s,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,e.func?e:!1}findSubFilters(e){var t=[];return e.forEach(i=>{i=this.findFilter(i),i&&t.push(i)}),t.length?t:!1}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach(function(s){typeof s.type=="function"&&(s.type="function")}),i=i.concat(this.filtersToArray(this.filterList,t)),i}filtersToArray(e,t){var i=[];return e.forEach(s=>{var n;Array.isArray(s)?i.push(this.filtersToArray(s,t)):(n={field:s.field,type:s.type,value:s.value},t&&typeof n.type=="function"&&(n.type="function"),i.push(n))}),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach(s=>{var n=-1;typeof s.field=="object"?n=this.filterList.findIndex(r=>s===r):n=this.filterList.findIndex(r=>s.field===r.field&&s.type===r.type&&s.value===r.value),n>-1?this.filterList.splice(n,1):console.warn("Filter Error - No matching filter type found, ignoring: ",s.type)}),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(e=>{typeof e.modules.filter.value<"u"&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)}),this.trackChanges()}search(e,t,i,s){var n=[],r=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach(o=>{o=this.findFilter(o),o&&r.push(o)}),this.table.rowManager.rows.forEach(o=>{var a=!0;r.forEach(h=>{this.filterRecurse(h,o.getData())||(a=!1)}),a&&n.push(e==="data"?o.getData("data"):o.getComponent())}),n}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),this.table.options.filterMode!=="remote"&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach(n=>{this.filterRow(n)&&i.push(n)}):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach(n=>{s.push(n.getComponent())}),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();this.filterList.forEach(r=>{this.filterRecurse(r,s)||(i=!1)});for(var n in this.headerFilters)this.headerFilters[n].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach(s=>{this.filterRecurse(s,t)&&(i=!0)}):i=e.func(t),i}};b(O,"moduleName","filter"),b(O,"filters",ai);let Ee=O;function li(l,e,t){return this.emptyToSpace(this.sanitizeHTML(l.getValue()))}function hi(l,e,t){return l.getValue()}function di(l,e,t){return l.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(l.getValue()))}function ui(l,e,t){var i=parseFloat(l.getValue()),s="",n,r,o,a,h,d=e.decimal||".",u=e.thousand||",",c=e.negativeSign||"-",f=e.symbol||"",g=!!e.symbolAfter,p=typeof e.precision<"u"?e.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(l.getValue()));if(i<0&&(i=Math.abs(i),s=c),n=p!==!1?i.toFixed(p):i,n=String(n).split("."),r=n[0],o=n.length>1?d+n[1]:"",e.thousand!==!1)for(a=/(\d+)(\d{3})/;a.test(r);)r=r.replace(a,"$1"+u+"$2");return h=r+o,s===!0?(h="("+h+")",g?h+f:f+h):g?s+h+f:s+f+h}function ci(l,e,t){var i=l.getValue(),s=e.urlPrefix||"",n=e.download,r=i,o=document.createElement("a"),a;function h(d,u){var c=d.shift(),f=u[c];return d.length&&typeof f=="object"?h(d,f):f}if(e.labelField&&(a=l.getData(),r=h(e.labelField.split(this.table.options.nestedFieldSeparator),a)),e.label)switch(typeof e.label){case"string":r=e.label;break;case"function":r=e.label(l);break}if(r){if(e.urlField&&(a=l.getData(),i=x.retrieveNestedData(this.table.options.nestedFieldSeparator,e.urlField,a)),e.url)switch(typeof e.url){case"string":i=e.url;break;case"function":i=e.url(l);break}return o.setAttribute("href",s+i),e.target&&o.setAttribute("target",e.target),e.download&&(typeof n=="function"?n=n(l):n=n===!0?"":n,o.setAttribute("download",n)),o.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),o}else return" "}function fi(l,e,t){var i=document.createElement("img"),s=l.getValue();switch(e.urlPrefix&&(s=e.urlPrefix+l.getValue()),e.urlSuffix&&(s=s+e.urlSuffix),i.setAttribute("src",s),typeof e.height){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height;break}switch(typeof e.width){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width;break}return i.addEventListener("load",function(){l.getRow().normalizeHeight()}),i}function pi(l,e,t){var i=l.getValue(),s=l.getElement(),n=e.allowEmpty,r=e.allowTruthy,o=Object.keys(e).includes("trueValue"),a=typeof e.tickElement<"u"?e.tickElement:'',h=typeof e.crossElement<"u"?e.crossElement:'';return o&&i===e.trueValue||!o&&(r&&i||i===!0||i==="true"||i==="True"||i===1||i==="1")?(s.setAttribute("aria-checked",!0),a||""):n&&(i==="null"||i===""||i===null||typeof i>"u")?(s.setAttribute("aria-checked","mixed"),""):(s.setAttribute("aria-checked",!1),h||"")}function mi(l,e,t){var i=window.DateTime||luxon.DateTime,s=e.inputFormat||"yyyy-MM-dd HH:mm:ss",n=e.outputFormat||"dd/MM/yyyy HH:mm:ss",r=typeof e.invalidPlaceholder<"u"?e.invalidPlaceholder:"",o=l.getValue();if(typeof i<"u"){var a;return i.isDateTime(o)?a=o:s==="iso"?a=i.fromISO(String(o)):a=i.fromFormat(String(o),s),a.isValid?(e.timezone&&(a=a.setZone(e.timezone)),a.toFormat(n)):r===!0||!o?o:typeof r=="function"?r(o):r}else console.error("Format Error - 'datetime' formatter is dependant on luxon.js")}function gi(l,e,t){var i=window.DateTime||luxon.DateTime,s=e.inputFormat||"yyyy-MM-dd HH:mm:ss",n=typeof e.invalidPlaceholder<"u"?e.invalidPlaceholder:"",r=typeof e.suffix<"u"?e.suffix:!1,o=typeof e.unit<"u"?e.unit:"days",a=typeof e.humanize<"u"?e.humanize:!1,h=typeof e.date<"u"?e.date:i.now(),d=l.getValue();if(typeof i<"u"){var u;return i.isDateTime(d)?u=d:s==="iso"?u=i.fromISO(String(d)):u=i.fromFormat(String(d),s),u.isValid?a?u.diff(h,o).toHuman()+(r?" "+r:""):parseInt(u.diff(h,o)[o])+(r?" "+r:""):n===!0?d:typeof n=="function"?n(d):n}else console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")}function bi(l,e,t){var i=l.getValue();return typeof e[i]>"u"?(console.warn("Missing display value for "+i),i):e[i]}function vi(l,e,t){var i=l.getValue(),s=l.getElement(),n=e&&e.stars?e.stars:5,r=document.createElement("span"),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),a='',h='';r.style.verticalAlign="middle",o.setAttribute("width","14"),o.setAttribute("height","14"),o.setAttribute("viewBox","0 0 512 512"),o.setAttribute("xml:space","preserve"),o.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,n));for(var d=1;d<=n;d++){var u=o.cloneNode(!0);u.innerHTML=d<=i?a:h,r.appendChild(u)}return s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.setAttribute("aria-label",i),r}function wi(l,e,t){var i=this.sanitizeHTML(l.getValue())||0,s=document.createElement("span"),n=e&&e.max?e.max:100,r=e&&e.min?e.min:0,o=e&&typeof e.color<"u"?e.color:["red","orange","green"],a="#666666",h,d;if(!(isNaN(i)||typeof l.getValue()>"u")){switch(s.classList.add("tabulator-traffic-light"),d=parseFloat(i)<=n?parseFloat(i):n,d=parseFloat(d)>=r?parseFloat(d):r,h=(n-r)/100,d=Math.round((d-r)/h),typeof o){case"string":a=o;break;case"function":a=o(i);break;case"object":if(Array.isArray(o)){var u=100/o.length,c=Math.floor(d/u);c=Math.min(c,o.length-1),c=Math.max(c,0),a=o[c];break}}return s.style.backgroundColor=a,s}}function Ci(l,e={},t){var i=this.sanitizeHTML(l.getValue())||0,s=l.getElement(),n=e.max?e.max:100,r=e.min?e.min:0,o=e.legendAlign?e.legendAlign:"center",a,h,d,u,c;switch(h=parseFloat(i)<=n?parseFloat(i):n,h=parseFloat(h)>=r?parseFloat(h):r,a=(n-r)/100,h=Math.round((h-r)/a),typeof e.color){case"string":d=e.color;break;case"function":d=e.color(i);break;case"object":if(Array.isArray(e.color)){let v=100/e.color.length,m=Math.floor(h/v);m=Math.min(m,e.color.length-1),m=Math.max(m,0),d=e.color[m];break}default:d="#2DC214"}switch(typeof e.legend){case"string":u=e.legend;break;case"function":u=e.legend(i);break;case"boolean":u=i;break;default:u=!1}switch(typeof e.legendColor){case"string":c=e.legendColor;break;case"function":c=e.legendColor(i);break;case"object":if(Array.isArray(e.legendColor)){let v=100/e.legendColor.length,m=Math.floor(h/v);m=Math.min(m,e.legendColor.length-1),m=Math.max(m,0),c=e.legendColor[m]}break;default:c="#000"}s.style.minWidth="30px",s.style.position="relative",s.setAttribute("aria-label",h);var f=document.createElement("div");f.style.display="inline-block",f.style.width=h+"%",f.style.backgroundColor=d,f.style.height="100%",f.setAttribute("data-max",n),f.setAttribute("data-min",r);var g=document.createElement("div");if(g.style.position="relative",g.style.width="100%",g.style.height="100%",u){var p=document.createElement("div");p.style.position="absolute",p.style.top=0,p.style.left=0,p.style.textAlign=o,p.style.width="100%",p.style.color=c,p.innerHTML=u}return t(function(){if(!(l instanceof Ye)){var v=document.createElement("div");v.style.position="absolute",v.style.top="4px",v.style.bottom="4px",v.style.left="4px",v.style.right="4px",s.appendChild(v),s=v}s.appendChild(g),g.appendChild(f),u&&g.appendChild(p)}),""}function Ei(l,e,t){return l.getElement().style.backgroundColor=this.sanitizeHTML(l.getValue()),""}function yi(l,e,t){return''}function Ri(l,e,t){return''}function xi(l,e,t){var i=l.getValue(),s=e.size||15,n=s+"px",r,o,a=e.hasOwnProperty("onValue")?e.onValue:!0,h=e.hasOwnProperty("offValue")?e.offValue:!1,d=e.onTruthy?i:i===a;return r=document.createElement("div"),r.classList.add("tabulator-toggle"),d?(r.classList.add("tabulator-toggle-on"),r.style.flexDirection="row-reverse",e.onColor&&(r.style.background=e.onColor)):e.offColor&&(r.style.background=e.offColor),r.style.width=2.5*s+"px",r.style.borderRadius=n,e.clickable&&r.addEventListener("click",u=>{l.setValue(d?h:a)}),o=document.createElement("div"),o.classList.add("tabulator-toggle-switch"),o.style.height=n,o.style.width=n,o.style.borderRadius=n,r.appendChild(o),r}function Ti(l,e,t){var i=document.createElement("span"),s=l.getRow(),n=l.getTable();return s.watchPosition(r=>{e.relativeToPage&&(r+=n.modules.page.getPageSize()*(n.modules.page.getPage()-1)),i.innerText=r}),i}function ki(l,e,t){return l.getElement().classList.add("tabulator-row-handle"),"
"}var Mi={plaintext:li,html:hi,textarea:di,money:ui,link:ci,image:fi,tickCross:pi,datetime:mi,datetimediff:gi,lookup:bi,star:vi,traffic:wi,progress:Ci,color:Ei,buttonTick:yi,buttonCross:Ri,toggle:xi,rownum:Ti,handle:ki};const H=class H extends w{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),typeof e.definition.formatterPrint<"u"&&(e.modules.format.print=this.lookupFormatter(e,"Print")),typeof e.definition.formatterClipboard<"u"&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),typeof e.definition.formatterHtmlOutput<"u"&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":H.formatters[s]?i.formatter=H.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=H.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=H.formatters.plaintext;break}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,n,r,o;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),r=a=>{e.titleFormatterRendered=a},o={getValue:function(){return t},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return e.getComponent()},getTable:()=>this.table},n=e.definition.titleFormatterParams||{},n=typeof n=="function"?n():n,s.call(this,o,n,r)):t}formatValue(e){var t=e.getComponent(),i=typeof e.column.modules.format.params=="function"?e.column.modules.format.params(t):e.column.modules.format.params;function s(n){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=n,e.modules.format.rendered=!1}return e.column.modules.format.formatter.call(this,t,i,s)}formatExportValue(e,t){var i=e.column.modules.format[t],s;if(i){let n=function(r){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=r,e.modules.format.rendered=!1};return s=typeof i.params=="function"?i.params(e.getComponent()):i.params,i.formatter.call(this,e.getComponent(),s,n)}else return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,function(i){return t[i]})}else return e}emptyToSpace(e){return e===null||typeof e>"u"||e===""?" ":e}getFormatter(e){switch(typeof e){case"string":H.formatters[e]?e=H.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=H.formatters.plaintext);break;case"function":break;default:e=H.formatters.plaintext;break}return e}};b(H,"moduleName","format"),b(H,"formatters",Mi);let ye=H;class et extends w{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach(e=>{this.initializeColumn(e)}),this.layout()}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,this.initializationMode=="left"?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach(t=>{t.calcs.top&&this.layoutRow(t.calcs.top),t.calcs.bottom&&this.layoutRow(t.calcs.bottom),t.groupList&&t.groupList.length&&this.layoutGroupCalcs(t.groupList)})}layoutColumnPosition(e){var t=[],i=0,s=0;this.leftColumns.forEach((n,r)=>{if(n.modules.frozen.marginValue=i,n.modules.frozen.margin=n.modules.frozen.marginValue+"px",n.visible&&(i+=n.getWidth()),r==this.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var o=this.getColGroupParentElement(n);t.includes(o)||(this.layoutElement(o,n),t.push(o)),o.classList.toggle("tabulator-frozen-left",n.modules.frozen.edge&&n.modules.frozen.position==="left"),o.classList.toggle("tabulator-frozen-right",n.modules.frozen.edge&&n.modules.frozen.position==="right")}else this.layoutElement(n.getElement(),n);e&&n.cells.forEach(a=>{this.layoutElement(a.getElement(!0),n)})}),this.rightColumns.forEach((n,r)=>{n.modules.frozen.marginValue=s,n.modules.frozen.margin=n.modules.frozen.marginValue+"px",n.visible&&(s+=n.getWidth()),r==this.rightColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup?this.layoutElement(this.getColGroupParentElement(n),n):this.layoutElement(n.getElement(),n),e&&n.cells.forEach(o=>{this.layoutElement(o.getElement(!0),n)})})}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0),t=this.table.rowManager.getRows().filter(i=>!e.includes(i));t.forEach(i=>{i.deinitialize()}),e.forEach(i=>{i.type==="row"&&this.layoutRow(i)})}layoutRow(e){this.table.options.layout==="fitDataFill"&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}),this.rightColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})}layoutElement(e,t){var i;t.modules.frozen&&e&&(e.style.position="sticky",this.table.rtl?i=t.modules.frozen.position==="left"?"right":"left":i=t.modules.frozen.position,e.style[i]=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),e.classList.toggle("tabulator-frozen-left",t.modules.frozen.edge&&t.modules.frozen.position==="left"),e.classList.toggle("tabulator-frozen-right",t.modules.frozen.edge&&t.modules.frozen.position==="right"))}adjustForScrollbar(e){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+e+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(e,t){var i=0;for(let s=0;s{this.initializeRow(e)})}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;i==="number"?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):i==="function"?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){var t=this.rows.indexOf(e);return t>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach(i=>{t.push(i)}),t}getRows(e){var t=e.slice(0);return this.rows.forEach(function(i){var s=t.indexOf(i);s>-1&&t.splice(s,1)}),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach((t,i)=>{this.table.rowManager.styleRow(t,i)})}}b(tt,"moduleName","frozenRows");class Li{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._group.groupManager.table.componentFunctionBinder.handle("group",t._group,i)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return this._group.parent?this._group.parent.getComponent():!1}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(e,t){return this._group.groupManager.table.rowManager.scrollToRow(this._group,e,t)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class J{constructor(e,t,i,s,n,r,o){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=n,this.hasSubGroups=i{t.modules&&delete t.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),this.groupManager.table.options.movableRows!==!1&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach(t=>{this._createGroup(t,e)})}addBindings(){var e;this.groupManager.table.options.groupToggleElement&&(e=this.groupManager.table.options.groupToggleElement=="arrow"?this.arrowElement:this.element,e.addEventListener("click",t=>{this.groupManager.table.options.groupToggleElement==="arrow"&&(t.stopPropagation(),t.stopImmediatePropagation()),setTimeout(()=>{this.toggleVisibility()})}))}_createGroup(e,t){var i=t+"_"+e,s=new J(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],this.old?this.old.groups[i]:!1);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var n=this.rows.indexOf(t);n>-1?i?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)}))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),!this.groupManager.table.options.groupValues&&!this.rows.length?(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0)):(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)))}removeGroup(e){var t=e.level+"_"+e.key,i;this.groups[t]&&(delete this.groups[t],i=this.groupList.indexOf(e),i>-1&&this.groupList.splice(i,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var e=[];return e.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}):(this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):!this.groupList.length&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(s=>{i.push(s.getData(t||"data"))}),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach(t=>{e+=t.getRowCount()}):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination?(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(e=>{var t=e.getHeadersAndRows();t.forEach(i=>{i.detachElement()})}):this.rows.forEach(e=>{var t=e.getElement();t.parentNode.removeChild(t)}),this.groupManager.updateGroupRows(!0)):this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination){this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach(t=>{var i=t.getHeadersAndRows();i.forEach(s=>{var n=s.getElement();e.parentNode.insertBefore(n,e.nextSibling),s.initialize(),e=n})}):this.rows.forEach(t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}),this.groupManager.updateGroupRows(!0)}else this.groupManager.updateGroupRows(!0);this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];typeof this.visible=="function"&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(i){var s=i.getRowGroup(e);s&&(t=s)}):this.rows.find(function(i){return i===e})&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getRows(e,t){var i=[];return t&&this.groupList.length?this.groupList.forEach(s=>{i=i.concat(s.getRows(e,t))}):this.rows.forEach(function(s){i.push(e?s.getComponent():s)}),i}generateGroupHeaderContents(){var e=[],t=this.getRows(!1,!0);for(t.forEach(function(i){e.push(i.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);typeof this.elementContents=="string"?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(n,r)=>{this.headerGenerator[0]=(o,a,h)=>(typeof o>"u"?"":o)+"("+a+" "+(a===1?n:r.groups.items)+")"}),this.groupIDLookups=[],e)this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="table"&&this.table.options.columnCalcs!="both"&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="group"){var s=this.table.columnManager.getRealColumns();s.forEach(n=>{n.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),n.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(e)||(e=[e]),e.forEach((n,r)=>{var o,a;typeof n=="function"?o=n:(a=this.table.columnManager.getColumnByField(n),a?o=function(h){return a.getFieldValue(h)}:o=function(h){return h[n]}),this.groupIDLookups.push({field:typeof n=="function"?!1:n,func:o,values:this.allowedValues?this.allowedValues[r]:!1})}),t&&(Array.isArray(t)||(t=[t]),t.forEach(n=>{}),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(this.table.options.groupBy)t=t.filter(i=>i.type!=="group"),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px";else return t}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&s.indexOf(t)==-1?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),!e&&this.table.modExists("columnCalcs")&&this.table.options.columnCalcs===!0&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return e.modules.group?e.modules.group.getComponent():!1}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof J&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof J?t:t.modules.group,n=e instanceof J?e:e.modules.group;s===n?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(n&&n.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach(i=>{i.groupList.length?t=t.concat(this.getChildGroups(i)):t.push(i)}),t}wipe(){this.table.options.groupBy&&(this.groupList.forEach(function(e){e.wipe()}),this.groupList=[],this.groups={})}pullGroupListData(e){var t=[];return e.forEach(i=>{var s={};s.level=0,s.rowCount=0,s.headerContent="";var n=[];i.hasSubGroups?(n=this.pullGroupListData(i.groupList),s.level=i.level,s.rowCount=n.length-i.groupList.length,s.headerContent=i.generator(i.key,s.rowCount,i.rows,i),t.push(s),t=t.concat(n)):(s.level=i.level,s.headerContent=i.generator(i.key,i.rows.length,i.rows,i),s.rowCount=i.getRows().length,t.push(s),i.getRows().forEach(r=>{t.push(r.getData("data"))}))}),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach(i=>{var s=i.getRowGroup(e);s&&(t=s)}),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(i=>{this.createGroup(i,0,t)}),e.forEach(i=>{this.assignRowToExistingGroup(i,t)})):e.forEach(i=>{this.assignRowToGroup(i,t)}),Object.values(t).forEach(i=>{i.wipe(!0)})}createGroup(e,t,i){var s=t+"_"+e,n;i=i||[],n=new J(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[s]),this.groups[s]=n,this.groupList.push(n)}assignRowToExistingGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s="0_"+i;this.groups[s]&&this.groups[s].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if(e.type==="row"){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e),n;n=i.length==s.length&&i.every((r,o)=>r===s[o]),n||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach(s=>{t.push(s.func(i))}),t}updateGroupRows(e){var t=[];return this.blockRedraw||(this.groupList.forEach(i=>{t=t.concat(i.getHeadersAndRows())}),e&&this.refreshData(!0)),t}scrollHeaders(e){this.table.options.groupBy&&(this.table.options.renderHorizontal==="virtual"&&(e-=this.table.columnManager.renderer.vDomPadLeft),e=e+"px",this.groupList.forEach(t=>{t.scrollHeader(e)}))}removeGroup(e){var t=e.level+"_"+e.key,i;this.groups[t]&&(delete this.groups[t],i=this.groupList.indexOf(e),i>-1&&this.groupList.splice(i,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),i.type!=="group"&&(t=!1)}),t?e.style.minWidth=this.table.columnManager.getWidth()+"px":e.style.minWidth=""}}b(it,"moduleName","groupRows");var Si={cellEdit:function(l){l.component.setValueProcessData(l.data.oldValue),l.component.cellRendered()},rowAdd:function(l){l.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowDelete:function(l){var e=this.table.rowManager.addRowActual(l.data.data,l.data.pos,l.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(l.component,e),this.table.rowManager.checkPlaceholder()},rowMove:function(l){var e=l.data.posFrom-l.data.posTo>0;this.table.rowManager.moveRowActual(l.component,this.table.rowManager.getRowFromPosition(l.data.posFrom),e),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Di={cellEdit:function(l){l.component.setValueProcessData(l.data.newValue),l.component.cellRendered()},rowAdd:function(l){var e=this.table.rowManager.addRowActual(l.data.data,l.data.pos,l.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(l.component,e),this.table.rowManager.checkPlaceholder()},rowDelete:function(l){l.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(l){this.table.rowManager.moveRowActual(l.component,this.table.rowManager.getRowFromPosition(l.data.posTo),l.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},zi={undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},Hi={undo:function(l){var e=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell,e||(l.preventDefault(),this.table.modules.history.undo()))},redo:function(l){var e=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell,e||(l.preventDefault(),this.table.modules.history.redo()))}},Fi={keybindings:{bindings:zi,actions:Hi}};const I=class I extends w{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(i=e.getComponent().getGroup()._getSelf().rows,t=i.indexOf(e),t&&(t=i[t-1])):(t=e.table.rowManager.getRowIndex(e),t&&(t=e.table.rowManager.rows[t-1])),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex(function(i){return i.component===e});t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return I.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}else return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return I.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}else return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(e,t){this.history.forEach(function(i){if(i.component instanceof S)i.component===e&&(i.component=t);else if(i.component instanceof ne&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}})}};b(I,"moduleName","history"),b(I,"moduleExtensions",Fi),b(I,"undoers",Si),b(I,"redoers",Di);let Re=I;class st extends w{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&this.table.originalElement.tagName==="TABLE"&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],n=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var r=0;r{r[d.toLowerCase()]=d});for(var o in s){var a=s[o],h;a&&typeof a=="object"&&a.name&&a.name.indexOf("tabulator-")===0&&(h=a.name.replace("tabulator-",""),typeof r[h]<"u"&&(t[r[h]]=this._attribValue(a.value)))}}_attribValue(e){return e==="true"?!0:e==="false"?!1:e}_findCol(e){var t=this.table.options.columns.find(i=>i.title===e);return t||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",r||"Unable to import data"),Promise.reject(r)))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),typeof e=="string"?t=ee.importers[e]:t=e,t||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t,i){var s=this.lookupImporter(e);if(s)return this.pickFile(t,i).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch(n=>(this.dispatch("import-error",n),this.dispatchExternal("importError",n),console.error("Import Error:",n||"Unable to import file"),Promise.reject(n)))}pickFile(e,t){return new Promise((i,s)=>{var n=document.createElement("input");n.type="file",n.accept=e,n.addEventListener("change",r=>{var o=n.files[0],a=new FileReader;switch(this.dispatch("import-importing",n.files),this.dispatchExternal("importImporting",n.files),t||this.table.options.importReader){case"buffer":a.readAsArrayBuffer(o);break;case"binary":a.readAsBinaryString(o);break;case"url":a.readAsDataURL(o);break;case"text":default:a.readAsText(o)}a.onload=h=>{i(a.result)},a.onerror=h=>{console.warn("File Load Error - Unable to read file"),s()}}),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),n.click()})}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){var t=[];return Array.isArray(e)&&e.length&&Array.isArray(e[0])?(this.table.options.autoColumns?t=this.structureArrayToObject(e):t=this.structureArrayToColumns(e),t):e}structureArrayToObject(e){var t=e.shift(),i=e.map(s=>{var n={};return t.forEach((r,o)=>{n[r]=s[o]}),n});return i}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach(s=>{var n={};s.forEach((r,o)=>{var a=i[o];a&&(n[a.getField()]=r)}),t.push(n)}),t}setData(e){return this.dispatch("import-imported",e),this.dispatchExternal("importImported",e),this.table.setData(e)}};b(ee,"moduleName","import"),b(ee,"importers",Bi);let xe=ee;class nt extends w{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){var e=Object.values(this.touchWatchers);e.forEach(t=>{for(let i in t)t[i]=null})}cellContentsSelectionFixer(e,t){var i;if(!(this.table.modExists("edit")&&this.table.modules.edit.currentCell===t)){e.preventDefault();try{document.selection?(i=document.body.createTextRange(),i.moveToElementText(t.getElement()),i.select()):window.getSelection&&(i=document.createRange(),i.selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch{}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?this.subscribers[e]&&!this.columnSubscribers[e]&&!this.subscribedExternal(e)&&(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let s in this.eventMap)this.eventMap[s]===i&&this.subscribers[s]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var n=this.touchWatchers[e];switch(e==="column"&&(e="header"),t){case"start":n.tap=!0,clearTimeout(n.tapHold),n.tapHold=setTimeout(()=>{clearTimeout(n.tapHold),n.tapHold=null,n.tap=null,clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)},1e3);break;case"end":n.tap&&(n.tap=null,this.dispatchEvent(e+"Tap",i,s)),n.tapDbl?(clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):n.tapDbl=setTimeout(()=>{clearTimeout(n.tapDbl),n.tapDbl=null},300),clearTimeout(n.tapHold),n.tapHold=null;break}}dispatchEvent(e,t,i){var s=i.getComponent(),n;this.columnSubscribers[e]&&(i instanceof ne?n=i.column.definition[e]:i instanceof U&&(n=i.definition[e]),n&&n(t,s)),this.dispatchExternal(e,t,s)}}b(nt,"moduleName","interaction");var Vi={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},Ii={keyBlock:function(l){l.stopPropagation(),l.preventDefault()},scrollPageUp:function(l){var e=this.table.rowManager,t=e.scrollTop-e.element.clientHeight;l.preventDefault(),e.displayRowsCount&&(t>=0?e.element.scrollTop=t:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(l){var e=this.table.rowManager,t=e.scrollTop+e.element.clientHeight,i=e.element.scrollHeight;l.preventDefault(),e.displayRowsCount&&(t<=i?e.element.scrollTop=t:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(l){var e=this.table.rowManager;l.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(l){var e=this.table.rowManager;l.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(l){this.dispatch("keybinding-nav-prev",l)},navNext:function(l){this.dispatch("keybinding-nav-next",l)},navLeft:function(l){this.dispatch("keybinding-nav-left",l)},navRight:function(l){this.dispatch("keybinding-nav-right",l)},navUp:function(l){this.dispatch("keybinding-nav-up",l)},navDown:function(l){this.dispatch("keybinding-nav-down",l)}};const N=class N extends w{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],e!==!1&&(Object.assign(t,N.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)N.actions[t]?e[t]&&(typeof e[t]!="object"&&(e[t]=[e[t]]),e[t].forEach(i=>{var s=Array.isArray(i)?i:[i];s.forEach(n=>{this.mapBinding(t,n)})})):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:N.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1},s=t.toString().toLowerCase().split(" ").join("").split("+");s.forEach(n=>{switch(n){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:n=isNaN(n)?n.toUpperCase().charCodeAt(0):parseInt(n),i.keys.push(n),this.watchKeys[n]||(this.watchKeys[n]=[]),this.watchKeys[n].push(i)}})}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach(function(n){e.checkBinding(t,n)}))},this.keydownBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];if(s){var n=e.pressedKeys.indexOf(i);n>-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta?(t.keys.forEach(s=>{var n=this.pressedKeys.indexOf(s);n==-1&&(i=!1)}),i&&t.action.call(this,e),!0):!1}};b(N,"moduleName","keybindings"),b(N,"bindings",Vi),b(N,"actions",Ii);let Te=N;class rt extends w{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),t.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(e){var t=e.definition.headerMenuIcon,i;i=document.createElement("span"),i.classList.add("tabulator-header-popup-button"),t?(typeof t=="function"&&(t=t(e.getComponent())),t instanceof HTMLElement?i.appendChild(t):i.innerHTML=t):i.innerHTML="⋮",i.addEventListener("click",s=>{s.stopPropagation(),s.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,s,e)}),e.titleElement.insertBefore(i,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e=typeof e=="function"?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,n){var r=!(e instanceof MouseEvent),o=document.createElement("div"),a;if(o.classList.add("tabulator-menu"),r||e.preventDefault(),!(!i||!i.length)){if(s)a=n.child(o);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout(()=>{this.nestedMenuBlock=!1},100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(o)}i.forEach(h=>{var d=document.createElement("div"),u=h.label,c=h.disabled;h.separator?d.classList.add("tabulator-menu-separator"):(d.classList.add("tabulator-menu-item"),typeof u=="function"&&(u=u.call(this.table,t.getComponent())),u instanceof Node?d.appendChild(u):d.innerHTML=u,typeof c=="function"&&(c=c.call(this.table,t.getComponent())),c?(d.classList.add("tabulator-menu-item-disabled"),d.addEventListener("click",f=>{f.stopPropagation()})):h.menu&&h.menu.length?d.addEventListener("click",f=>{f.stopPropagation(),this.loadMenu(f,t,h.menu,d,a)}):h.action&&d.addEventListener("click",f=>{h.action(f,t.getComponent())}),h.menu&&h.menu.length&&d.classList.add("tabulator-menu-item-submenu")),o.appendChild(d)}),o.addEventListener("click",h=>{this.rootPopup&&this.rootPopup.hide()}),a.show(s||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur(()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,a),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)}),this.currentComponent=t,this.dispatch("menu-opened",i,a),this.dispatchExternal("menuOpened",t.getComponent()))}}}b(rt,"moduleName","menu");class ot extends w{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(e){var t=this,i={},s;!e.modules.frozen&&!e.isGroup&&!e.isRowHeader&&(s=e.getElement(),i.mousemove=(function(n){e.parent===t.moving.parent&&((t.touchMove?n.touches[0].pageX:n.pageX)-x.elOffset(s).left+t.table.columnManager.contentsElement.scrollLeft>e.getWidth()/2?(t.toCol!==e||!t.toColAfter)&&(s.parentNode.insertBefore(t.placeholderElement,s.nextSibling),t.moveColumn(e,!0)):(t.toCol!==e||t.toColAfter)&&(s.parentNode.insertBefore(t.placeholderElement,s),t.moveColumn(e,!1)))}).bind(t),s.addEventListener("mousedown",function(n){t.touchMove=!1,n.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(n,e)},t.checkPeriod))}),s.addEventListener("mouseup",function(n){n.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),t.bindTouchEvents(e)),e.modules.moveColumn=i}bindTouchEvents(e){var t=e.getElement(),i=!1,s,n,r,o,a,h;t.addEventListener("touchstart",d=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,s=e.nextColumn(),r=s?s.getWidth()/2:0,n=e.prevColumn(),o=n?n.getWidth()/2:0,a=0,h=0,i=!1,this.startMove(d,e)},this.checkPeriod)},{passive:!0}),t.addEventListener("touchmove",d=>{var u,c;this.moving&&(this.moveHover(d),i||(i=d.touches[0].pageX),u=d.touches[0].pageX-i,u>0?s&&u-a>r&&(c=s,c!==e&&(i=d.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0))):n&&-u-h>o&&(c=n,c!==e&&(i=d.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1))),c&&(s=c.nextColumn(),a=r,r=s?s.getWidth()/2:0,n=c.prevColumn(),h=o,o=n?n.getWidth()/2:0))},{passive:!0}),t.addEventListener("touchend",d=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(d)})}startMove(e,t){var i=t.getElement(),s=this.table.columnManager.getContentsElement(),n=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&this.table.modules.selectRange.selecting==="column"||(this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-x.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),s.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=s.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e),this.dispatch("column-moving",e,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(s,n){var r=s.getElement(!0);r.parentNode&&i[n]&&r.parentNode.insertBefore(i[n].getElement(),r.nextSibling)}):e.getCells().forEach(function(s,n){var r=s.getElement(!0);r.parentNode&&i[n]&&r.parentNode.insertBefore(i[n].getElement(),r)})}endMove(e){(e.which===1||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var t=this.table.columnManager.getContentsElement(),i=t.scrollLeft,s=(this.touchMove?e.touches[0].pageX:e.pageX)-x.elOffset(t).left+i,n;this.hoverElement.style.left=s-this.startX+"px",s-i{n=Math.max(0,i-5),this.table.rowManager.getElement().scrollLeft=n,this.autoScrollTimeout=!1},1))),i+t.clientWidth-s{n=Math.min(t.clientWidth,i+5),this.table.rowManager.getElement().scrollLeft=n,this.autoScrollTimeout=!1},1)))}}b(ot,"moduleName","moveColumn");var Ni={delete:function(l,e,t){l.delete()}},Wi={insert:function(l,e,t){return this.table.addRow(l.getData(),void 0,e),!0},add:function(l,e,t){return this.table.addRow(l.getData()),!0},update:function(l,e,t){return e?(e.update(l.getData()),!0):!1},replace:function(l,e,t){return e?(this.table.addRow(l.getData(),void 0,e),e.delete(),!0):!1}};const G=class G extends w{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var t=this,i={};i.mouseup=(function(s){t.tableRowDrop(s,e)}).bind(t),i.mousemove=(function(s){var n;s.pageY-x.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?(t.toRow!==e||!t.toRowAfter)&&(n=e.getElement(),n.parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement(),n.previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1)))}).bind(t),e.modules.moveRow=i}initializeRow(e){var t=this,i={},s;i.mouseup=(function(n){t.tableRowDrop(n,e)}).bind(t),i.mousemove=(function(n){var r=e.getElement();n.pageY-x.elOffset(r).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?(t.toRow!==e||!t.toRowAfter)&&(r.parentNode.insertBefore(t.placeholderElement,r.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(r.parentNode.insertBefore(t.placeholderElement,r),t.moveRow(e,!1))}).bind(t),this.hasHandle||(s=e.getElement(),s.addEventListener("mousedown",function(n){n.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(n,e)},t.checkPeriod))}),s.addEventListener("mouseup",function(n){n.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i}initializeColumn(e){e.definition.rowHandle&&this.table.options.movableRows!==!1&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&this.table.options.movableRows!==!1){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",function(s){s.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(s,e.row)},t.checkPeriod))}),i.addEventListener("mouseup",function(s){s.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i=!1,s,n,r,o,a,h;t.addEventListener("touchstart",d=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,s=e.nextRow(),r=s?s.getHeight()/2:0,n=e.prevRow(),o=n?n.getHeight()/2:0,a=0,h=0,i=!1,this.startMove(d,e)},this.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",d=>{var u,c;this.moving&&(d.preventDefault(),this.moveHover(d),i||(i=d.touches[0].pageY),u=d.touches[0].pageY-i,u>0?s&&u-a>r&&(c=s,c!==e&&(i=d.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0))):n&&-u-h>o&&(c=n,c!==e&&(i=d.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1))),c&&(s=c.nextRow(),a=r,r=s?s.getHeight()/2:0,n=c.prevRow(),h=o,o=n?n.getHeight()/2:0))}),t.addEventListener("touchend",d=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(d),this.touchMove=!1)})}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{(e.type==="row"||e.type==="group")&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{(e.type==="row"||e.type==="group")&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY,n,r;n=t.getElement(),this.connection?(r=n.getBoundingClientRect(),this.startX=r.left-i+window.pageXOffset,this.startY=r.top-s+window.pageYOffset):this.startY=s-n.getBoundingClientRect().top}endMove(e){(!e||e.which===1||this.touchMove)&&(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,i?i.getComponent():!1)}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(i=>{typeof i=="string"?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(i))):this.connectionElements.push(i)}),this.connectionElements.forEach(i=>{var s=n=>{this.elementRowDrop(n,i,this.moving)};i.addEventListener("mouseup",s),i.tabulatorElementDropEvent=s,i.classList.add("tabulator-movingrow-receiving")}))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(t=>{t.classList.remove("tabulator-movingrow-receiving"),t.removeEventListener("mouseup",t.tabulatorElementDropEvent),delete t.tabulatorElementDropEvent})}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(i=>{i.type==="row"&&i.modules.moveRow&&i.modules.moveRow.mouseup&&i.getElement().addEventListener("mouseup",i.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{t.type==="row"&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=G.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender;break}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=G.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver;break}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}};b(G,"moduleName","moveRow"),b(G,"senders",Ni),b(G,"receivers",Wi);let ke=G;var Gi={};const Y=class Y extends w{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupMutator(e.definition[n]),r&&(t=!0,i[n]={mutator:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Y.mutators[e]?t=Y.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t,i){var s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1)),n;return this.enabled&&this.table.columnManager.traverse(r=>{var o,a,h;r.modules.mutate&&(o=r.modules.mutate[s]||r.modules.mutate.mutator||!1,o&&(n=r.getFieldValue(typeof i<"u"?i:e),(t=="data"&&!i||typeof n<"u")&&(h=r.getComponent(),a=typeof o.params=="function"?o.params(n,e,t,h):o.params,r.setFieldValue(e,o.mutator(n,e,t,a,h)))))}),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach(i=>{var s=e.row.getCell(i);s&&s.setValue(s.getValue(),!0,!0)}))}enable(){this.enabled=!0}disable(){this.enabled=!1}};b(Y,"moduleName","mutator"),b(Y,"mutators",Gi);let Me=Y;function ji(l,e,t,i,s){var n=document.createElement("span"),r=document.createElement("span"),o=document.createElement("span"),a=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",u=>{r.innerHTML=u}),this.table.modules.localize.langBind("pagination|counter|of",u=>{a.innerHTML=u}),this.table.modules.localize.langBind("pagination|counter|rows",u=>{d.innerHTML=u}),i?(o.innerHTML=" "+e+"-"+Math.min(e+l-1,i)+" ",h.innerHTML=" "+i+" ",n.appendChild(r),n.appendChild(o),n.appendChild(a),n.appendChild(h),n.appendChild(d)):(o.innerHTML=" 0 ",n.appendChild(r),n.appendChild(o),n.appendChild(d)),n}function Ui(l,e,t,i,s){var n=document.createElement("span"),r=document.createElement("span"),o=document.createElement("span"),a=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",u=>{r.innerHTML=u}),o.innerHTML=" "+t+" ",this.table.modules.localize.langBind("pagination|counter|of",u=>{a.innerHTML=u}),h.innerHTML=" "+s+" ",this.table.modules.localize.langBind("pagination|counter|pages",u=>{d.innerHTML=u}),n.appendChild(r),n.appendChild(o),n.appendChild(a),n.appendChild(h),n.appendChild(d),n}var Xi={rows:ji,pages:Ui};const te=class te extends w{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),this.table.options.paginationAddRow=="page"&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),this.table.options.paginationMode==="remote"&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),this.table.options.progressiveLoad==="scroll"&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i=this.table.rowManager,s=i.getDisplayRows(),n;return t?s.length?n=s[0]:i.activeRows.length&&(n=i.activeRows[i.activeRows.length-1],t=!1):s.length&&(n=s[s.length-1],t=!(s.length{}))}restOnRenderBefore(e,t){return t||this.mode==="local"&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,this.pageSizes.indexOf(this.size)==-1&&e.unshift(this.size);else if(this.pageSizes.indexOf(this.size)==-1){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(t=>{var i=document.createElement("option");i.value=t,t===!0?this.langBind("pagination|all",function(s){i.innerHTML=s}):i.innerHTML=t,this.pageSizeSelect.appendChild(i)}),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&(typeof e=="function"?t=e:t=te.pageCounters[e],t?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",s=>{this.firstBut.innerHTML=s}),this.langBind("pagination|first_title",s=>{this.firstBut.setAttribute("aria-label",s),this.firstBut.setAttribute("title",s)}),this.langBind("pagination|prev",s=>{this.prevBut.innerHTML=s}),this.langBind("pagination|prev_title",s=>{this.prevBut.setAttribute("aria-label",s),this.prevBut.setAttribute("title",s)}),this.langBind("pagination|next",s=>{this.nextBut.innerHTML=s}),this.langBind("pagination|next_title",s=>{this.nextBut.setAttribute("aria-label",s),this.nextBut.setAttribute("title",s)}),this.langBind("pagination|last",s=>{this.lastBut.innerHTML=s}),this.langBind("pagination|last_title",s=>{this.lastBut.setAttribute("aria-label",s),this.lastBut.setAttribute("title",s)}),this.firstBut.addEventListener("click",()=>{this.setPage(1)}),this.prevBut.addEventListener("click",()=>{this.previousPage()}),this.nextBut.addEventListener("click",()=>{this.nextPage()}),this.lastBut.addEventListener("click",()=>{this.setPage(this.max)}),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",s=>{this.pageSizeSelect.setAttribute("aria-label",s),this.pageSizeSelect.setAttribute("title",s),t.innerHTML=s}),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",s=>{this.setPageSize(this.pageSizeSelect.value=="true"?!0:this.pageSizeSelect.value),this.setPage(1)})),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):typeof this.table.options.paginationCounterElement=="string"&&(i=document.querySelector(this.table.options.paginationCounterElement),i?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){e?this.max=this.size===!0?1:Math.ceil(e/this.size):this.max=1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||(this.mode=="local"||e)&&(this.page=1,this.trackChanges())}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return e=parseInt(e),e>0&&e<=this.max||this.mode!=="local"?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1),i=t.indexOf(e);if(i>-1){var s=this.size===!0?1:Math.ceil((i+1)/this.size);return this.setPage(s)}else return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){e!==!0&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch(this.mode==="remote"&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),s=this.pageCounter.call(this,t,i,this.page,e,this.max),typeof s){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",s!=null&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&n<=this.max&&this.pagesElement.appendChild(this._generatePageButton(n));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)}),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",i=>{this.setPage(e)}),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.pagea.type==="row");if(this.mode=="local"){i=[],this.setMaxRows(e.length),this.size===!0?(s=0,n=e.length):(s=this.size*(this.page-1),n=s+parseInt(this.size)),this._setPageButtons();for(let a=s;a{this.dataChanging=!1});case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(typeof e.last_page>"u"&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data)if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=typeof e.last_row<"u"?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":this.page==1?this.table.rowManager.setData(e.data,!1,this.page==1):this.table.rowManager.addRows(e.data),this.page{this.nextPage()},this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=this.page===1?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,this.page!==1,this.page==1),t=this.table.options.progressiveLoadScrollMargin||this.table.rowManager.element.clientHeight*2,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()});break}return!1}else this.dispatchExternal("pageLoaded",this.getPage());else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}};b(te,"moduleName","page"),b(te,"pageCounters",Xi);let Le=te;var Ji={local:function(l,e){var t=localStorage.getItem(l+"-"+e);return t?JSON.parse(t):!1},cookie:function(l,e){var t=document.cookie,i=l+"-"+e,s=t.indexOf(i+"="),n,r;return s>-1&&(t=t.slice(s),n=t.indexOf(";"),n>-1&&(t=t.slice(0,n)),r=t.replace(i+"=","")),r?JSON.parse(r):!1}},Ki={local:function(l,e,t){localStorage.setItem(l+"-"+e,JSON.stringify(t))},cookie:function(l,e,t){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=l+"-"+e+"="+JSON.stringify(t)+"; expires="+i.toUTCString()}};const D=class D extends w{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}initialize(){if(this.table.options.persistence){var e=this.table.options.persistenceMode,t=this.table.options.persistenceID,i;this.mode=e!==!0?e:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?typeof this.table.options.persistenceReaderFunc=="function"?this.readFunc=this.table.options.persistenceReaderFunc:D.readers[this.table.options.persistenceReaderFunc]?this.readFunc=D.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):D.readers[this.mode]?this.readFunc=D.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?typeof this.table.options.persistenceWriterFunc=="function"?this.writeFunc=this.table.options.persistenceWriterFunc:D.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=D.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):D.writers[this.mode]?this.writeFunc=D.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(t||this.table.element.getAttribute("id")||""),this.config={sort:this.table.options.persistence===!0||this.table.options.persistence.sort,filter:this.table.options.persistence===!0||this.table.options.persistence.filter,headerFilter:this.table.options.persistence===!0||this.table.options.persistence.headerFilter,group:this.table.options.persistence===!0||this.table.options.persistence.group,page:this.table.options.persistence===!0||this.table.options.persistence.page,columns:this.table.options.persistence===!0?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(i=this.retrieveData("page"),i&&(typeof i.paginationSize<"u"&&(this.config.page===!0||this.config.page.size)&&(this.table.options.paginationSize=i.paginationSize),typeof i.paginationInitialPage<"u"&&(this.config.page===!0||this.config.page.page)&&(this.table.options.paginationInitialPage=i.paginationInitialPage))),this.config.group&&(i=this.retrieveData("group"),i&&(typeof i.groupBy<"u"&&(this.config.group===!0||this.config.group.groupBy)&&(this.table.options.groupBy=i.groupBy),typeof i.groupStartOpen<"u"&&(this.config.group===!0||this.config.group.groupStartOpen)&&(this.table.options.groupStartOpen=i.groupStartOpen),typeof i.groupHeader<"u"&&(this.config.group===!0||this.config.group.groupHeader)&&(this.table.options.groupHeader=i.groupHeader))),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t,i;this.config.sort&&(e=this.load("sort"),e&&(this.table.options.initialSort=e)),this.config.filter&&(t=this.load("filter"),t&&(this.table.options.initialFilter=t)),this.config.headerFilter&&(i=this.load("headerFilter"),i&&(this.table.options.initialHeaderFilter=i))}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e,!0)),!0}initializeColumn(e){var t,i;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),i=this.config.columns===!0?Object.keys(t):this.config.columns,i.forEach(s=>{var n=Object.getOwnPropertyDescriptor(t,s),r=t[s];n&&Object.defineProperty(t,s,{set:o=>{r=o,this.defWatcherBlock||this.save("columns"),n.set&&n.set(o)},get:()=>(n.get&&n.get(),r)})}),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return this.readFunc?this.readFunc(this.id,e):!1}mergeDefinition(e,t,i){var s=[];return t=t||[],t.forEach((n,r)=>{var o=this._findColumn(e,n),a;o&&(i?a=Object.keys(n):this.config.columns===!0||this.config.columns==null?(a=Object.keys(o),a.push("width")):a=this.config.columns,a.forEach(h=>{h!=="columns"&&typeof n[h]<"u"&&(o[h]=n[h])}),o.columns&&(o.columns=this.mergeDefinition(o.columns,n.columns)),s.push(o))}),e.forEach((n,r)=>{var o=this._findColumn(t,n);o||(s.length>r?s.splice(r,0,n):s.push(n))}),s}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(s){switch(i){case"group":return s.title===t.title&&s.columns.length===t.columns.length;case"field":return s.field===t.field;case"object":return s===t}})}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"headerFilter":t=this.table.modules.filter.getHeaderFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach(function(t){t.column=t.field,delete t.field}),e}getGroupConfig(){var e={};return this.config.group&&((this.config.group===!0||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(this.config.group===!0||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(this.config.group===!0||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((this.config.page===!0||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(this.config.page===!0||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach(s=>{var n={},r=s.getDefinition(),o;s.isGroup?(n.title=r.title,n.columns=this.parseColumns(s.getColumns())):(n.field=s.getField(),this.config.columns===!0||this.config.columns==null?(o=Object.keys(r),o.push("width"),o.push("visible")):o=this.config.columns,o.forEach(a=>{switch(a){case"width":n.width=s.getWidth();break;case"visible":n.visible=s.visible;break;default:typeof r[a]!="function"&&i.indexOf(a)===-1&&(n[a]=r[a])}})),t.push(n)}),t}};b(D,"moduleName","persistence"),b(D,"moduleInitOrder",-10),b(D,"readers",Ji),b(D,"writers",Ki);let Se=D;class at extends w{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(e,t,i){this.loadPopupEvent(t,null,e,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),t.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(e){var t=e.definition.headerPopupIcon,i;i=document.createElement("span"),i.classList.add("tabulator-header-popup-button"),t?(typeof t=="function"&&(t=t(e.getComponent())),t instanceof HTMLElement?i.appendChild(t):i.innerHTML=t):i.innerHTML="⋮",i.addEventListener("click",s=>{s.stopPropagation(),s.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,s,e)}),e.titleElement.insertBefore(i,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i,s){var n;function r(o){n=o}i._group?i=i._group:i._row&&(i=i._row),e=typeof e=="function"?e.call(this.table,t,i.getComponent(),r):e,this.loadPopup(t,i,e,n,s)}loadPopup(e,t,i,s,n){var r=!(e instanceof MouseEvent),o,a;i instanceof HTMLElement?o=i:(o=document.createElement("div"),o.innerHTML=i),o.classList.add("tabulator-popup"),o.addEventListener("click",h=>{h.stopPropagation()}),r||e.preventDefault(),a=this.popup(o),typeof s=="function"&&a.renderCallback(s),e?a.show(e):a.show(t.getElement(),n||"center"),a.hideOnBlur(()=>{this.dispatchExternal("popupClosed",t.getComponent())}),this.dispatchExternal("popupOpened",t.getComponent())}}b(at,"moduleName","popup");class lt extends w{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s=window.scrollX,n=window.scrollY,r=document.createElement("div"),o=document.createElement("div"),a=this.table.modules.export.generateTable(typeof i<"u"?i:this.table.options.printConfig,typeof t<"u"?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print"),h,d;this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),h=typeof this.table.options.printHeader=="function"?this.table.options.printHeader.call(this.table):this.table.options.printHeader,typeof h=="string"?r.innerHTML=h:r.appendChild(h),this.element.appendChild(r)),this.element.appendChild(a),this.table.options.printFooter&&(o.classList.add("tabulator-print-footer"),d=typeof this.table.options.printFooter=="function"?this.table.options.printFooter.call(this.table):this.table.options.printFooter,typeof d=="string"?o.innerHTML=d:o.appendChild(d),this.element.appendChild(o)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,a),window.print(),this.cleanup(),window.scrollTo(s,n),this.manualBlock=!1}}b(lt,"moduleName","print");class ht extends w{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t=this,i;this.currentVersion++,i=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n;return!t.blocked&&i===t.currentVersion&&(t.block("data-push"),s.forEach(r=>{t.table.rowManager.addRowActual(r,!1)}),n=t.origFuncs.push.apply(e,arguments),t.unblock("data-push")),n}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n;return!t.blocked&&i===t.currentVersion&&(t.block("data-unshift"),s.forEach(r=>{t.table.rowManager.addRowActual(r,!0)}),n=t.origFuncs.unshift.apply(e,arguments),t.unblock("data-unshift")),n}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,n;return!t.blocked&&i===t.currentVersion&&(t.block("data-shift"),t.data.length&&(s=t.table.rowManager.getRowFromDataObject(t.data[0]),s&&s.deleteActual()),n=t.origFuncs.shift.call(e),t.unblock("data-shift")),n}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,n;return!t.blocked&&i===t.currentVersion&&(t.block("data-pop"),t.data.length&&(s=t.table.rowManager.getRowFromDataObject(t.data[t.data.length-1]),s&&s.deleteActual()),n=t.origFuncs.pop.call(e),t.unblock("data-pop")),n}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n=s[0]<0?e.length+s[0]:s[0],r=s[1],o=s[2]?s.slice(2):!1,a,h;if(!t.blocked&&i===t.currentVersion){if(t.block("data-splice"),o&&(a=e[n]?t.table.rowManager.getRowFromDataObject(e[n]):!1,a?o.forEach(u=>{t.table.rowManager.addRowActual(u,!0,a,!0)}):(o=o.slice().reverse(),o.forEach(u=>{t.table.rowManager.addRowActual(u,!0,!1,!0)}))),r!==0){var d=e.slice(n,typeof s[1]>"u"?s[1]:n+r);d.forEach((u,c)=>{var f=t.table.rowManager.getRowFromDataObject(u);f&&f.deleteActual(c!==d.length-1)})}(o||r!==0)&&t.table.rowManager.reRenderInPosition(),h=t.origFuncs.splice.apply(e,arguments),t.unblock("data-splice")}return h}})}unwatchData(){if(this.data!==!1)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var n=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return n}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var n=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return n}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var n=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return n}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var n=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return n}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var n=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return n}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,n=Object.getOwnPropertyDescriptor(t,i),r=t[i],o=this.currentVersion;Object.defineProperty(t,i,{set:a=>{if(r=a,!s.blocked&&o===s.currentVersion){s.block("key");var h={};h[i]=a,e.updateData(h),s.unblock("key")}n.set&&n.set(a)},get:()=>(n.get&&n.get(),r)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}b(ht,"moduleName","reactiveData");class dt extends w{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){e.row.type==="row"&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.reinitializeColumn(t)}):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.reinitializeColumn(t)}))}frozenColumnOffset(e){var t=!1;return e.modules.frozen&&(t=e.modules.frozen.marginValue,e.modules.frozen.position==="left"?t+=e.getWidth()-3:t&&(t-=3)),t!==!1?t+"px":!1}reinitializeColumn(e){var t=this.frozenColumnOffset(e);e.cells.forEach(i=>{i.modules.resize&&i.modules.resize.handleEl&&(t&&(i.modules.resize.handleEl.style[e.modules.frozen.position]=t,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))}),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style[e.modules.frozen.position]=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var n=this,r=!1,o=i.definition.resizable,a={},h=i.getLastColumn();if(e==="header"&&(r=i.definition.formatter=="textarea"||i.definition.variableHeight,a={variableHeight:r}),(o===!0||o==e)&&this._checkResizability(h)){var d=document.createElement("span");d.className="tabulator-col-resize-handle",d.addEventListener("click",function(c){c.stopPropagation()});var u=function(c){n.startColumn=i,n.initialNextColumn=n.nextColumn=h.nextColumn(),n._mouseDown(c,h,d)};d.addEventListener("mousedown",u),d.addEventListener("touchstart",u,{passive:!0}),d.addEventListener("dblclick",c=>{var f=h.getWidth();c.stopPropagation(),h.reinitializeWidth(!0),f!==h.getWidth()&&(n.dispatch("column-resized",h),n.dispatchExternal("columnResized",h.getComponent()))}),i.modules.frozen&&(d.style.position="sticky",d.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),a.handleEl=d,s.parentNode&&i.visible&&s.after(d)}t.modules.resize=a}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach(t=>{this.deInitializeComponent(t)})}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl,t&&t.parentElement&&t.parentElement.removeChild(t))}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}resize(e,t){var i=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,s=i-this.startX,n=i-this.latestX,r,o;if(this.latestX=i,this.table.rtl&&(s=-s,n=-n),r=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(this.startWidth+s),o=t.width==t.minWidth||t.width==t.maxWidth,n<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&!(r&&o)){let a=this.nextColumn.getWidth();n>0&&a<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-n)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}calcGuidePosition(e,t,i){var s=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,n=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,r=this.table.element.getBoundingClientRect().x,o=t.element.getBoundingClientRect().left-r,a=s-this.startX,h=Math.max(n+a,o+t.minWidth);return t.maxWidth&&(h=Math.min(h,o+t.maxWidth)),h}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this,n;this.dispatchExternal("columnResizing",t.getComponent()),s.table.options.resizableColumnGuide&&(n=document.createElement("span"),n.classList.add("tabulator-col-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.left=s.calcGuidePosition(e,t,i)+"px"})),s.table.element.classList.add("tabulator-block-select");function r(a){s.table.options.resizableColumnGuide?n.style.left=s.calcGuidePosition(a,t,i)+"px":s.resize(a,t)}function o(a){s.table.options.resizableColumnGuide&&(s.resize(a,t),n.remove()),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",r),i.removeEventListener("touchmove",r),i.removeEventListener("touchend",o),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.table.columnManager.verticalAlignHeaders(),s.dispatch("column-resized",t),s.dispatchExternal("columnResized",t.getComponent()))}e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),i.addEventListener("touchmove",r,{passive:!0}),i.addEventListener("touchend",o)}}b(dt,"moduleName","resizeColumns");class ut extends w{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(a){a.stopPropagation()});var r=function(a){t.startRow=e,t._mouseDown(a,e,s)};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r,{passive:!0}),n.addEventListener("click",function(a){a.stopPropagation()});var o=function(a){var h=t.table.rowManager.prevDisplayRow(e);h&&(t.startRow=h,t._mouseDown(a,h,n))};n.addEventListener("mousedown",o),n.addEventListener("touchstart",o,{passive:!0}),i.appendChild(s),i.appendChild(n)}resize(e,t){t.setHeight(this.startHeight+((typeof e.screenY>"u"?e.touches[0].screenY:e.screenY)-this.startY))}calcGuidePosition(e,t,i){var s=typeof e.screenY>"u"?e.touches[0].screenY:e.screenY,n=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,r=this.table.element.getBoundingClientRect().y,o=t.element.getBoundingClientRect().top-r,a=s-this.startY;return Math.max(n+a,o)}_mouseDown(e,t,i){var s=this,n;s.dispatchExternal("rowResizing",t.getComponent()),s.table.options.resizableRowGuide&&(n=document.createElement("span"),n.classList.add("tabulator-row-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.top=s.calcGuidePosition(e,t,i)+"px"})),s.table.element.classList.add("tabulator-block-select");function r(a){s.table.options.resizableRowGuide?n.style.top=s.calcGuidePosition(a,t,i)+"px":s.resize(a,t)}function o(a){s.table.options.resizableRowGuide&&(s.resize(a,t),n.remove()),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",r),i.removeEventListener("touchmove",r),i.removeEventListener("touchend",o),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}e.stopPropagation(),s.startY=typeof e.screenY>"u"?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),i.addEventListener("touchmove",r,{passive:!0}),i.addEventListener("touchend",o)}}b(ut,"moduleName","resizeRows");class ct extends w{constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e=this.table,t;this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),typeof IntersectionObserver<"u"&&typeof ResizeObserver<"u"&&e.rowManager.getRenderMode()==="virtual"?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver(i=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var s=Math.floor(i[0].contentRect.height),n=Math.floor(i[0].contentRect.width);(this.tableHeight!=s||this.tableWidth!=n)&&(this.tableHeight=s,this.tableWidth=n,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),this.redrawTable())}}),this.resizeObserver.observe(e.element),t=window.getComputedStyle(e.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(i=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var s=Math.floor(i[0].contentRect.height),n=Math.floor(i[0].contentRect.width);(this.containerHeight!=s||this.containerWidth!=n)&&(this.containerHeight=s,this.containerWidth=n,this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth),this.redrawTable()}}),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell))&&(e.columnManager.rerenderColumns(!0),e.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver(e=>{this.visible=e[0].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)}),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}b(ct,"moduleName","resizeTable");function qi(l,e,t){var i=document.createElement("div"),s=l.getRow()._row.modules.responsiveLayout;i.classList.add("tabulator-responsive-collapse-toggle"),i.innerHTML=` + + + + + + +`,l.getElement().classList.add("tabulator-row-handle");function n(r){var o=s.element;s.open=r,o&&(s.open?(i.classList.add("open"),o.style.display=""):(i.classList.remove("open"),o.style.display="none"))}return i.addEventListener("click",function(r){r.stopImmediatePropagation(),n(!s.open),l.getTable().rowManager.adjustTableSize()}),n(s.open),i}var Yi={format:{formatters:{responsiveCollapse:qi}}};class De extends w{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),this.table.options.responsiveLayout==="collapse"&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){["fitColumns","fitDataStretch"].indexOf(this.layoutMode())===-1&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),!t.visible&&this.mode==="collapse"&&this.hiddenColumns.push(t))}),e=e.reverse(),e=e.sort((t,i)=>{var s=i.modules.responsive.order-t.modules.responsive.order;return s||i.modules.responsive.index-t.modules.responsive.index}),this.columns=e,this.mode==="collapse"&&this.generateCollapsedContent();for(let t of this.table.columnManager.columnsByIndex)if(t.definition.formatter=="responsiveCollapse"){this.collapseHandleColumn=t;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:typeof t.responsive>"u"?1:t.responsive,visible:t.visible!==!1}}initializeRow(e){var t;e.type!=="calc"&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),this.mode==="collapse"&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),this.mode==="collapse"&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=!0;e;){let t=this.table.modules.layout.getMode()=="fitColumns"?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-t;if(i<0){let s=this.columns[this.index];s?(this.hideColumn(s),this.index++):e=!1}else{let s=this.columns[this.index-1];s&&i>0&&i>=s.getWidth()?(this.showColumn(s),this.index--):e=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this.table.rowManager.getDisplayRows();e.forEach(t=>{this.generateCollapsedRowContent(t)})}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);i=this.collapseFormatter(this.generateCollapsedRowData(e)),i&&t.appendChild(i),e.calcHeight(!0)}}generateCollapsedRowData(e){var t=e.getData(),i=[],s;return this.hiddenColumns.forEach(n=>{var r=n.getFieldValue(t);if(n.definition.title&&n.field)if(n.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){let o=function(a){a()};s={value:!1,data:{},getValue:function(){return r},getData:function(){return t},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()},getTable:()=>this.table},i.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(this.table.modules.format,s,n.modules.format.params,o)})}else i.push({field:n.field,title:n.definition.title,value:r})}),i}formatCollapsedData(e){var t=document.createElement("table");return e.forEach(i=>{var s=document.createElement("tr"),n=document.createElement("td"),r=document.createElement("td"),o,a=document.createElement("strong");n.appendChild(a),this.modules.localize.bind("columns|"+i.field,function(h){a.innerHTML=h||i.title}),i.value instanceof Node?(o=document.createElement("div"),o.appendChild(i.value),r.appendChild(o)):r.innerHTML=i.value,s.appendChild(n),s.appendChild(r),t.appendChild(s)}),Object.keys(e).length?t:""}}b(De,"moduleName","responsiveLayout"),b(De,"moduleExtensions",Yi);function $i(l,e,t){var i=document.createElement("input"),s=!1;if(i.type="checkbox",i.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(i.addEventListener("click",r=>{r.stopPropagation()}),typeof l.getRow=="function"){var n=l.getRow();n instanceof oe?(i.addEventListener("change",r=>{this.table.options.selectableRowsRangeMode==="click"&&s?s=!1:n.toggleSelect()}),this.table.options.selectableRowsRangeMode==="click"&&i.addEventListener("click",r=>{s=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,r)}),i.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,i)):i=""}else i.addEventListener("change",r=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(e.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(i);return i}var Qi={format:{formatters:{rowSelection:$i}}};class ze extends w{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",function(t,i){return!0}),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),this.table.options.selectableRows==="highlight"&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),this.table.options.selectableRows!==!1&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(e,t){return e==="selected"?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){var t=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t&&e!==!0&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=t.checkRowSelectability(e),s=e.getElement(),n=function(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",n)};e.modules.select={selected:!1},s.classList.toggle("tabulator-selectable",i),s.classList.toggle("tabulator-unselectable",!i),t.checkRowSelectability(e)&&t.table.options.selectableRows&&t.table.options.selectableRows!="highlight"&&(t.table.options.selectableRowsRangeMode==="click"?s.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(s.addEventListener("click",function(r){(!t.table.modExists("edit")||!t.table.modules.edit.getCurrentCell())&&t.table._clearSelection(),t.selecting||t.toggleRow(e)}),s.addEventListener("mousedown",function(r){if(r.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1}),s.addEventListener("mouseenter",function(r){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),s.addEventListener("mouseout",function(r){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),n=i<=s?i:s,r=i>=s?i:s,o=this.table.rowManager.getDisplayRows().slice(0),a=o.splice(n,r-n+1);t.ctrlKey||t.metaKey?(a.forEach(h=>{h!==this.lastClickedRow&&(this.table.options.selectableRows!==!0&&!this.isRowSelected(e)?this.selectedRows.lengththis.table.options.selectableRows&&(a=a.slice(0,this.table.options.selectableRows)),this.selectRows(a)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}checkRowSelectability(e){return e&&e.type==="row"?this.table.options.selectableRowsCheck.call(this.table,e.getComponent()):!1}toggleRow(e){this.checkRowSelectability(e)&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t=[],i,s;switch(typeof e){case"undefined":i=this.table.rowManager.rows;break;case"number":i=this.table.rowManager.findRow(e);break;case"string":i=this.table.rowManager.findRow(e),i||(i=this.table.rowManager.getRows(e));break;default:i=e;break}Array.isArray(i)?i.length&&(i.forEach(n=>{s=this._selectRow(n,!0,!0),s&&t.push(s)}),this._rowSelectionChanged(!1,t)):i&&this._selectRow(i,!1,!0)}_selectRow(e,t,i){if(!isNaN(this.table.options.selectableRows)&&this.table.options.selectableRows!==!0&&!i&&this.selectedRows.length>=this.table.options.selectableRows)if(this.table.options.selectableRowsRollingSelection)this._deselectRow(this.selectedRows[0]);else return!1;var s=this.table.rowManager.findRow(e);if(s){if(this.selectedRows.indexOf(s)==-1)return s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t,s),s}else t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return this.selectedRows.indexOf(e)!==-1}deselectRows(e,t){var i=[],s,n;switch(typeof e){case"undefined":s=Object.assign([],this.selectedRows);break;case"number":s=this.table.rowManager.findRow(e);break;case"string":s=this.table.rowManager.findRow(e),s||(s=this.table.rowManager.getRows(e));break;default:s=e;break}Array.isArray(s)?s.length&&(s.forEach(r=>{n=this._deselectRow(r,!0,!0),n&&i.push(n)}),this._rowSelectionChanged(t,[],i)):s&&this._deselectRow(s,t,!0)}_deselectRow(e,t){var i=this,s=i.table.rowManager.findRow(e),n,r;if(s){if(n=i.selectedRows.findIndex(function(o){return o==s}),n>-1)return r=s.getElement(),r&&r.classList.remove("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),i.selectedRows.splice(n,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),this.dispatchExternal("rowDeselected",s.getComponent()),i._rowSelectionChanged(t,void 0,s),s}else t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e}getSelectedRows(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e}_rowSelectionChanged(e,t=[],i=[]){this.headerCheckboxElement&&(this.selectedRows.length===0?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||(Array.isArray(t)||(t=[t]),t=t.map(s=>s.getComponent()),Array.isArray(i)||(i=[i]),i=i.map(s=>s.getComponent()),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),t,i))}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0,!0);if(t)for(let s of i)this._selectRow(s,!0);else for(let s of i)this._deselectRow(s,!0)}}b(ze,"moduleName","selectRow"),b(ze,"moduleExtensions",Qi);class Zi{constructor(e){return this._range=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._range.table.componentFunctionBinder.handle("range",t._range,i)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map(e=>e.getComponent())}getColumns(){return this._range.getColumns().map(e=>e.getComponent())}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(e,t){this._range.destroyedGuard("setBounds")&&this._range.setBounds(e&&e._cell,t&&t._cell)}setStartBound(e){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(e&&e._cell),this._range.rangeManager.layoutElement())}setEndBound(e){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(e&&e._cell),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class es extends M{constructor(e,t,i,s){super(e),this.rangeManager=t,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=e,this.start={row:0,col:0},this.end={row:0,col:0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout(()=>{this.initBounds(i,s)})}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(e,t){this._updateMinMax(),e&&this.setBounds(e,t||e)}setStart(e,t){(this.start.row!==e||this.start.col!==t)&&(this.start.row=e,this.start.col=t,this.initializing.start=!0,this._updateMinMax())}setEnd(e,t){(this.end.row!==e||this.end.col!==t)&&(this.end.row=e,this.end.col=t,this.initializing.end=!0,this._updateMinMax())}setBounds(e,t,i){e&&this.setStartBound(e),this.setEndBound(t||e),this.rangeManager.layoutElement(i)}setStartBound(e){var t,i;e.type==="column"?this.rangeManager.columnSelection&&this.setStart(0,e.getPosition()-1):(t=e.row.position-1,i=e.column.getPosition()-1,e.column===this.rangeManager.rowHeader?this.setStart(t,1):this.setStart(t,i))}setEndBound(e){var t=this._getTableRows().length,i,s,n;e.type==="column"?this.rangeManager.columnSelection&&(this.rangeManager.selecting==="column"?this.setEnd(t-1,e.getPosition()-1):this.rangeManager.selecting==="cell"&&this.setEnd(0,e.getPosition()-1)):(i=e.row.position-1,s=e.column.getPosition()-1,n=e.column===this.rangeManager.rowHeader,this.rangeManager.selecting==="row"?this.setEnd(i,this._getTableColumns().length-1):this.rangeManager.selecting!=="row"&&n?this.setEnd(i,0):this.rangeManager.selecting==="column"?this.setEnd(t-1,s):this.setEnd(i,s))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>e.type==="row")}layout(){var e=this.table.rowManager.renderer.vDomTop,t=this.table.rowManager.renderer.vDomBottom,i=this.table.columnManager.renderer.leftCol,s=this.table.columnManager.renderer.rightCol,n,r,o,a,h,d,u,c,f,g;this.table.options.renderHorizontal==="virtual"&&this.rangeManager.rowHeader&&(s+=1),e==null&&(e=0),t==null&&(t=1/0),i==null&&(i=0),s==null&&(s=1/0),this.overlaps(i,e,s,t)&&(n=Math.max(this.top,e),r=Math.min(this.bottom,t),o=Math.max(this.left,i),a=Math.min(this.right,s),h=this.rangeManager.getCell(n,o),d=this.rangeManager.getCell(r,a),u=h.getElement(),c=d.getElement(),f=h.row.getElement(),g=d.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=f.offsetWidth-u.offsetLeft-u.offsetWidth+"px",this.element.style.width=u.offsetLeft+u.offsetWidth-c.offsetLeft+"px"):(this.element.style.left=f.offsetLeft+u.offsetLeft+"px",this.element.style.width=c.offsetLeft+c.offsetWidth-u.offsetLeft+"px"),this.element.style.top=f.offsetTop+"px",this.element.style.height=g.offsetTop+g.offsetHeight-f.offsetTop+"px")}atTopLeft(e){return e.row.position-1===this.top&&e.column.getPosition()-1===this.left}atBottomRight(e){return e.row.position-1===this.bottom&&e.column.getPosition()-1===this.right}occupies(e){return this.occupiesRow(e.row)&&this.occupiesColumn(e.column)}occupiesRow(e){return this.top<=e.position-1&&e.position-1<=this.bottom}occupiesColumn(e){return this.left<=e.getPosition()-1&&e.getPosition()-1<=this.right}overlaps(e,t,i,s){return!(this.left>i||e>this.right||this.top>s||t>this.bottom)}getData(){var e=[],t=this.getRows(),i=this.getColumns();return t.forEach(s=>{var n=s.getData(),r={};i.forEach(o=>{r[o.field]=n[o.field]}),e.push(r)}),e}getCells(e,t){var i=[],s=this.getRows(),n=this.getColumns();return e?i=s.map(r=>{var o=[];return r.getCells().forEach(a=>{n.includes(a.column)&&o.push(t?a.getComponent():a)}),o}):s.forEach(r=>{r.getCells().forEach(o=>{n.includes(o.column)&&i.push(t?o.getComponent():o)})}),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var e=this.getCells(),t=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),e.forEach(i=>{i.setValue(t)}),this.table.restoreRedraw()}getBounds(e){var t=this.getCells(!1,e),i={start:null,end:null};return t.length?(i.start=t[0],i.end=t[t.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new Zi(this)),this.component}destroy(e){this.destroyed=!0,this.element.remove(),e&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(e){return this.destroyed&&console.warn("You cannot call the "+e+" function on a destroyed range"),!this.destroyed}}var ts={rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},is={rangeJumpLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!0,!1)},rangeJumpRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!0,!1)},rangeJumpUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!0,!1)},rangeJumpDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!0,!1)},rangeExpandLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!1,!0)},rangeExpandRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!1,!0)},rangeExpandUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!1,!0)},rangeExpandDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!1,!0)},rangeExpandJumpLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!0,!0)},rangeExpandJumpRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!0,!0)},rangeExpandJumpUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!0,!0)},rangeExpandJumpDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!0,!0)}},ss={range:function(l){var e=[],t=this.table.modules.selectRange.activeRange,i=!1,s,n,r,o,a;return a=l.length,t&&(s=t.getBounds(),n=s.start,s.start===s.end&&(i=!0),n&&(e=this.table.rowManager.activeRows.slice(),r=e.indexOf(n.row),i?o=l.length:o=e.indexOf(s.end.row)-r+1,r>-1&&(this.table.blockRedraw(),e=e.slice(r,r+o),e.forEach((h,d)=>{h.updateData(l[d%a])}),this.table.restoreRedraw()))),e}},ns={range:function(l){var e=[],t=[],i=this.table.modules.selectRange.activeRange,s=!1,n,r,o,a,h;return i&&(n=i.getBounds(),r=n.start,n.start===n.end&&(s=!0),r&&(l=l.split(` +`),l.forEach(function(d){e.push(d.split(" "))}),e.length&&(a=this.table.columnManager.getVisibleColumnsByIndex(),h=a.indexOf(r.column),h>-1)))?(s?o=e[0].length:o=a.indexOf(n.end.column)-h+1,a=a.slice(h,h+o),e.forEach(d=>{var u={},c=d.length;a.forEach(function(f,g){u[f.field]=d[g%c]}),t.push(u)}),t):!1}},rs={range:function(){var l=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&l.unshift(this.columnManager.rowHeader),l}},os={range:function(){return this.modules.selectRange.selectedRows()}},as={keybindings:{bindings:ts,actions:is},clipboard:{pasteActions:ss,pasteParsers:ns},export:{columnLookups:rs,rowLookups:os}};class re extends w{constructor(e){super(e),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex(e=>e.frozen)>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter(e=>e.frozen)>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior."))}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.resetRanges(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.resetRanges.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(e){this.columnSelection&&e.definition.headerSort&&this.options("headerSortClickElement")!=="icon"&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'."),e.modules.edit}updateHeaderColumn(){var e;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&(e=this.table.modules.frozenColumns.getFrozenColumns(),(e.length>1||e.length===1&&e[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior"))}getRanges(){return this.ranges.map(e=>e.getComponent())}getRangesData(){return this.ranges.map(e=>e.getData())}addRangeFromComponent(e,t){return e=e?e._cell:null,t=t?t._cell:null,this.addRange(e,t)}cellGetRanges(e){var t=[];return e.column===this.rowHeader?t=this.ranges.filter(i=>i.occupiesRow(e.row)):t=this.ranges.filter(i=>i.occupies(e)),t.map(i=>i.getComponent())}rowGetRanges(e){var t=this.ranges.filter(i=>i.occupiesRow(e));return t.map(i=>i.getComponent())}colGetRanges(e){var t=this.ranges.filter(i=>i.occupiesColumn(e));return t.map(i=>i.getComponent())}_handleMouseUp(e){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(e){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if(e.key==="Enter"){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;this.table.modules.edit.editCell(this.getActiveCell()),e.preventDefault()}(e.key==="Backspace"||e.key==="Delete")&&this.options("selectableRangeClearCells")&&this.activeRange&&this.activeRange.clearValues()}}initializeFocus(e){var t;this.restoreFocus();try{document.selection?(t=document.body.createTextRange(),t.moveToElementText(e.getElement()),t.select()):window.getSelection&&(t=document.createRange(),t.selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(t))}catch{}}restoreFocus(e){return this.table.rowManager.element.focus(),!0}handleColumnResized(e){var t;this.selecting!=="column"&&this.selecting!=="all"||(t=this.ranges.some(i=>i.occupiesColumn(e)),t&&this.ranges.forEach(i=>{var s=i.getColumns(!0);s.forEach(n=>{n!==e&&n.setWidth(e.width)})}))}handleColumnMoving(e,t){this.resetRanges().setBounds(t),this.overlay.style.visibility="hidden"}handleColumnMoved(e,t,i){this.activeRange.setBounds(e),this.layoutElement()}handleColumnMouseDown(e,t){e.button===2&&(this.selecting==="column"||this.selecting==="all")&&this.activeRange.occupiesColumn(t)||this.table.options.movableColumns&&this.selecting==="column"&&this.activeRange.occupiesColumn(t)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleColumnMouseMove(e,t){t===this.rowHeader||!this.mousedown||this.selecting==="all"||this.activeRange.setBounds(!1,t,!0)}renderCell(e){var t=e.getElement(),i=this.ranges.findIndex(s=>s.occupies(e));t.classList.toggle("tabulator-range-selected",i!==-1),t.classList.toggle("tabulator-range-only-cell-selected",this.ranges.length===1&&this.ranges[0].atTopLeft(e)&&this.ranges[0].atBottomRight(e)),t.dataset.range=i}handleCellMouseDown(e,t){e.button===2&&(this.activeRange.occupies(t)||(this.selecting==="row"||this.selecting==="all")&&this.activeRange.occupiesRow(t.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleCellMouseMove(e,t){!this.mousedown||this.selecting==="all"||this.activeRange.setBounds(!1,t,!0)}handleCellClick(e,t){this.initializeFocus(t)}handleEditingCell(e){this.activeRange&&this.activeRange.setBounds(e)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout(()=>{this.blockKeydown=!1},10)}keyNavigate(e,t){this.navigate(!1,!1,e),t.preventDefault()}keyNavigateRange(e,t,i,s){this.navigate(i,s,t),e.preventDefault()}navigate(e,t,i){var s=!1,n,r,o,a,h,d;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter(u=>u===this.activeRange?(u.setEnd(u.start.row,u.start.col),!0):(u.destroy(),!1))),n=this.activeRange,r=t?n.end:n.start,o=r.row,a=r.col,e)switch(i){case"left":a=this.findJumpCellLeft(n.start.row,r.col);break;case"right":a=this.findJumpCellRight(n.start.row,r.col);break;case"up":o=this.findJumpCellUp(r.row,n.start.col);break;case"down":o=this.findJumpCellDown(r.row,n.start.col);break}else{if(t&&(this.selecting==="row"&&(i==="left"||i==="right")||this.selecting==="column"&&(i==="up"||i==="down")))return;switch(i){case"left":a=Math.max(a-1,0);break;case"right":a=Math.min(a+1,this.getTableColumns().length-1);break;case"up":o=Math.max(o-1,0);break;case"down":o=Math.min(o+1,this.getTableRows().length-1);break}}if(this.rowHeader&&a===0&&(a=1),s=a!==r.col||o!==r.row,t||n.setStart(o,a),n.setEnd(o,a),t||(this.selecting="cell"),s)return h=this.getRowByRangePos(n.end.row),d=this.getColumnByRangePos(n.end.col),(i==="left"||i==="right")&&d.getElement().parentNode===null?d.getComponent().scrollTo(void 0,!1):(i==="up"||i==="down")&&h.getElement().parentNode===null?h.getComponent().scrollTo(void 0,!1):this.autoScroll(n,h.getElement(),d.getElement()),this.layoutElement(),!0}rangeRemoved(e){this.ranges=this.ranges.filter(t=>t!==e),this.activeRange===e&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement()}findJumpRow(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(r){return r.getData()[e.getField()]})}findJumpCol(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(r){return e.getData()[r.getField()]})}findJumpItem(e,t,i,s){var n;for(let r of i){let o=s(r);if(e){if(n=r,o)break}else if(t){if(n=r,o)break}else if(o)n=r;else break}return n}findJumpCellLeft(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),r=s[t-1]?this.isEmpty(i.getData()[s[t-1].getField()]):!1,o=this.rowHeader?s.slice(1,t):s.slice(0,t),a=this.findJumpCol(i,o,!0,n,r);return a?a.getPosition()-1:t}findJumpCellRight(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),r=s[t+1]?this.isEmpty(i.getData()[s[t+1].getField()]):!1,o=this.findJumpCol(i,s.slice(t+1,s.length),!1,n,r);return o?o.getPosition()-1:t}findJumpCellUp(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),r=s[e-1]?this.isEmpty(s[e-1].getData()[i.getField()]):!1,o=this.findJumpRow(i,s.slice(0,e),!0,n,r);return o?o.position-1:e}findJumpCellDown(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),r=s[e+1]?this.isEmpty(s[e+1].getData()[i.getField()]):!1,o=this.findJumpRow(i,s.slice(e+1,s.length),!1,n,r);return o?o.position-1:e}newSelection(e,t){var i;if(t.type==="column"){if(!this.columnSelection)return;if(t===this.rowHeader){i=this.resetRanges(),this.selecting="all";var s,n=this.getCell(-1,-1);this.rowHeader?s=this.getCell(0,1):s=this.getCell(0,0),i.setBounds(s,n);return}else this.selecting="column"}else t.column===this.rowHeader?this.selecting="row":this.selecting="cell";e.shiftKey?this.activeRange.setBounds(!1,t):e.ctrlKey?this.addRange().setBounds(t):this.resetRanges().setBounds(t)}autoScroll(e,t,i){var s=this.table.rowManager.element,n,r,o,a,h;typeof t>"u"&&(t=this.getRowByRangePos(e.end.row).getElement()),typeof i>"u"&&(i=this.getColumnByRangePos(e.end.col).getElement()),this.rowHeader&&(n=this.rowHeader.getElement()),r={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight},o={left:s.scrollLeft,right:Math.ceil(s.scrollLeft+s.clientWidth),top:s.scrollTop,bottom:s.scrollTop+s.offsetHeight-this.table.rowManager.scrollbarWidth},n&&(o.left+=n.offsetWidth),a=o.lefto.right&&(s.scrollLeft=r.right-s.clientWidth)),h||(r.topo.bottom&&(s.scrollTop=r.bottom-s.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(e){e&&(this.selecting="cell",this.resetRanges(),this.layoutElement())}layoutElement(e){var t;e?t=this.table.rowManager.getVisibleRows(!0):t=this.table.rowManager.getRows(),t.forEach(i=>{i.type==="row"&&(this.layoutRow(i),i.cells.forEach(s=>this.renderCell(s)))}),this.getTableColumns().forEach(i=>{this.layoutColumn(i)}),this.layoutRanges()}layoutRow(e){var t=e.getElement(),i=!1,s=this.ranges.some(n=>n.occupiesRow(e));this.selecting==="row"?i=s:this.selecting==="all"&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutColumn(e){var t=e.getElement(),i=!1,s=this.ranges.some(n=>n.occupiesColumn(e));this.selecting==="column"?i=s:this.selecting==="all"&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var e,t,i;this.table.initialized&&(e=this.getActiveCell(),e&&(t=e.getElement(),i=e.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-t.offsetLeft-t.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+t.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=t.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach(s=>s.layout()),this.overlay.style.visibility="visible"))}getCell(e,t){var i;return t<0&&(t=this.getTableColumns().length+t,t<0)?null:(e<0&&(e=this.getTableRows().length+e),i=this.table.rowManager.getRowFromPosition(e+1),i?i.getCells(!1,!0).filter(s=>s.column.visible)[t]:null)}getActiveCell(){return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(e){return this.getTableRows()[e]}getColumnByRangePos(e){return this.getTableColumns()[e]}getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>e.type==="row")}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(e,t){var i;return this.maxRanges!==!0&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new es(this.table,this,e,t),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}resetRanges(){var e,t,i;return this.ranges.forEach(s=>s.destroy()),this.ranges=[],e=this.addRange(),this.table.rowManager.activeRows.length&&(i=this.table.rowManager.activeRows[0].cells.filter(s=>s.column.visible),t=i[this.rowHeader?1:0],t&&(e.setBounds(t),this.initializeFocus(t))),e}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(e){return e?this.activeRange.getRows().map(t=>t.getComponent()):this.activeRange.getRows()}selectedColumns(e){return e?this.activeRange.getColumns().map(t=>t.getComponent()):this.activeRange.getColumns()}isEmpty(e){return e==null||e===""}}b(re,"moduleName","selectRange"),b(re,"moduleInitOrder",1),b(re,"moduleExtensions",as);function ls(l,e,t,i,s,n,r){var o=r.alignEmptyValues,a=r.decimalSeparator,h=r.thousandSeparator,d=0;if(l=String(l),e=String(e),h&&(l=l.split(h).join(""),e=e.split(h).join("")),a&&(l=l.split(a).join("."),e=e.split(a).join(".")),l=parseFloat(l),e=parseFloat(e),isNaN(l))d=isNaN(e)?0:-1;else if(isNaN(e))d=1;else return l-e;return(o==="top"&&n==="desc"||o==="bottom"&&n==="asc")&&(d*=-1),d}function hs(l,e,t,i,s,n,r){var o=r.alignEmptyValues,a=0,h;if(!l)a=e?-1:0;else if(!e)a=1;else{switch(typeof r.locale){case"boolean":r.locale&&(h=this.langLocale());break;case"string":h=r.locale;break}return String(l).toLowerCase().localeCompare(String(e).toLowerCase(),h)}return(o==="top"&&n==="desc"||o==="bottom"&&n==="asc")&&(a*=-1),a}function Ve(l,e,t,i,s,n,r){var o=window.DateTime||luxon.DateTime,a=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(typeof o<"u"){if(o.isDateTime(l)||(a==="iso"?l=o.fromISO(String(l)):l=o.fromFormat(String(l),a)),o.isDateTime(e)||(a==="iso"?e=o.fromISO(String(e)):e=o.fromFormat(String(e),a)),!l.isValid)d=e.isValid?-1:0;else if(!e.isValid)d=1;else return l-e;return(h==="top"&&n==="desc"||h==="bottom"&&n==="asc")&&(d*=-1),d}else console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}function ds(l,e,t,i,s,n,r){return r.format||(r.format="dd/MM/yyyy"),Ve.call(this,l,e,t,i,s,n,r)}function us(l,e,t,i,s,n,r){return r.format||(r.format="HH:mm"),Ve.call(this,l,e,t,i,s,n,r)}function cs(l,e,t,i,s,n,r){var o=l===!0||l==="true"||l==="True"||l===1?1:0,a=e===!0||e==="true"||e==="True"||e===1?1:0;return o-a}function fs(l,e,t,i,s,n,r){var o=r.type||"length",a=r.alignEmptyValues,h=0;function d(u){var c;switch(o){case"length":c=u.length;break;case"sum":c=u.reduce(function(f,g){return f+g});break;case"max":c=Math.max.apply(null,u);break;case"min":c=Math.min.apply(null,u);break;case"avg":c=u.reduce(function(f,g){return f+g})/u.length;break}return c}if(!Array.isArray(l))h=Array.isArray(e)?-1:0;else if(!Array.isArray(e))h=1;else return d(e)-d(l);return(a==="top"&&n==="desc"||a==="bottom"&&n==="asc")&&(h*=-1),h}function ps(l,e,t,i,s,n,r){var o=typeof l>"u"?0:1,a=typeof e>"u"?0:1;return o-a}function ms(l,e,t,i,s,n,r){var o,a,h,d,u=0,c,f=/(\d+)|(\D+)/g,g=/\d/,p=r.alignEmptyValues,v=0;if(!l&&l!==0)v=!e&&e!==0?0:-1;else if(!e&&e!==0)v=1;else{if(isFinite(l)&&isFinite(e))return l-e;if(o=String(l).toLowerCase(),a=String(e).toLowerCase(),o===a)return 0;if(!(g.test(o)&&g.test(a)))return o>a?1:-1;for(o=o.match(f),a=a.match(f),c=o.length>a.length?a.length:o.length;ud?1:-1;return o.length>a.length}return(p==="top"&&n==="desc"||p==="bottom"&&n==="asc")&&(v*=-1),v}var gs={number:ls,string:hs,date:ds,time:us,datetime:Ve,boolean:cs,array:fs,exists:ps,alphanum:ms};const j=class j extends w{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),this.table.options.sortMode==="remote"&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var n=this.getSort();return n.forEach(r=>{delete r.column}),s.sort=n,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t=!1,i,s;switch(typeof e.definition.sorter){case"string":j.sorters[e.definition.sorter]?t=j.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":t=e.definition.sorter;break}if(e.modules.sort={sorter:t,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},e.definition.headerSort!==!1){switch(i=e.getElement(),i.classList.add("tabulator-sortable"),s=document.createElement("div"),s.classList.add("tabulator-col-sorter"),this.table.options.headerSortClickElement){case"icon":s.classList.add("tabulator-col-sorter-element");break;case"header":i.classList.add("tabulator-col-sorter-element");break;default:i.classList.add("tabulator-col-sorter-element");break}switch(this.table.options.headerSortElement){case"function":break;case"object":s.appendChild(this.table.options.headerSortElement);break;default:s.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(s),e.modules.sort.element=s,this.setColumnHeaderSortIcon(e,"none"),this.table.options.headerSortClickElement==="icon"&&s.addEventListener("mousedown",n=>{n.stopPropagation()}),(this.table.options.headerSortClickElement==="icon"?s:i).addEventListener("click",n=>{var r="",o=[],a=!1;if(e.modules.sort){if(e.modules.sort.tristate)e.modules.sort.dir=="none"?r=e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?r=e.modules.sort.dir=="asc"?"desc":"asc":r="none";else switch(e.modules.sort.dir){case"asc":r="desc";break;case"desc":r="asc";break;default:r=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(n.shiftKey||n.ctrlKey)?(o=this.getSort(),a=o.findIndex(h=>h.field===e.getField()),a>-1?(o[a].dir=r,a=o.splice(a,1)[0],r!="none"&&o.push(a)):r!="none"&&o.push({column:e,dir:r}),this.setSort(o)):r=="none"?this.clear():this.setSort(e,r),this.refreshSort()}})}}refreshSort(){this.table.options.sortMode==="remote"?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=this,t=[];return e.sortList.forEach(function(i){i.column&&t.push({column:i.column.getComponent(),field:i.column.getField(),dir:i.dir})}),t}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(n){var r;r=i.table.columnManager.findColumn(n.column),r?(n.column=r,s.push(n),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",n.column)}),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t=this.table.rowManager.activeRows[0],i="string",s,n;if(t&&(t=t.getData(),s=e.getField(),s))switch(n=e.getFieldValue(t),typeof n){case"undefined":i="string";break;case"boolean":i="boolean";break;default:!isNaN(n)&&n!==""?i="number":n.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum");break}return j.sorters[i]}sort(e,t){var i=this,s=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,n=[],r=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),t||i.clearColumnHeaders(),this.table.options.sortMode!=="remote"?(s.forEach(function(o,a){var h;o.column&&(h=o.column.modules.sort,h&&(h.sorter||(h.sorter=i.findSorter(o.column)),o.params=typeof h.params=="function"?h.params(o.column.getComponent(),o.dir):h.params,n.push(o)),t||i.setColumnHeader(o.column,o.dir))}),n.length&&i._sortItems(e,n)):t||s.forEach(function(o,a){i.setColumnHeader(o.column,o.dir)}),this.subscribedExternal("dataSorted")&&(e.forEach(o=>{r.push(o.getComponent())}),this.dispatchExternal("dataSorted",i.getSort(),r)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach(e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))})}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t==="asc"?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i=e.modules.sort.element,s;if(e.definition.headerSort&&typeof this.table.options.headerSortElement=="function"){for(;i.firstChild;)i.removeChild(i.firstChild);s=this.table.options.headerSortElement.call(this.table,e.getComponent(),t),typeof s=="object"?i.appendChild(s):i.innerHTML=s}}_sortItems(e,t){var i=t.length-1;e.sort((s,n)=>{for(var r,o=i;o>=0;o--){let a=t[o];if(r=this._sortRow(s,n,a.column,a.dir,a.params),r!==0)break}return r})}_sortRow(e,t,i,s,n){var r,o,a=s=="asc"?e:t,h=s=="asc"?t:e;return e=i.getFieldValue(a.getData()),t=i.getFieldValue(h.getData()),e=typeof e<"u"?e:"",t=typeof t<"u"?t:"",r=a.getComponent(),o=h.getComponent(),i.modules.sort.sorter.call(this,e,t,r,o,i.getComponent(),s,n)}};b(j,"moduleName","sort"),b(j,"sorters",gs);let He=j;class bs{constructor(e,t){this.columnCount=e,this.rowCount=t,this.columnString=[],this.columns=[],this.rows=[]}genColumns(e){var t=Math.max(this.columnCount,Math.max(...e.map(i=>i.length)));this.columnString=[],this.columns=[];for(let i=1;i<=t;i++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(e){var t=Math.max(this.rowCount,e.length);this.rows=[];for(let i=1;i<=t;i++)this.rows.push(i);return this.rows}incrementChar(e){let t=this.columnString[e];t?t!=="Z"?this.columnString[e]=String.fromCharCode(this.columnString[e].charCodeAt(0)+1):(this.columnString[e]="A",e?this.incrementChar(e-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(e){this.rowCount=e}setColumnCount(e){this.columnCount=e}}class ft{constructor(e){return this._sheet=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._sheet.table.componentFunctionBinder.handle("sheet",t._sheet,i)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(e){return this._sheet.setData(e)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(e){return this._sheet.setTitle(e)}setRows(e){return this._sheet.setRows(e)}setColumns(e){return this._sheet.setColumns(e)}}class Xe extends M{constructor(e,t){super(e.table),this.spreadsheetManager=e,this.definition=t,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new bs(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",()=>{this.spreadsheetManager.loadSheet(this)})}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach(e=>{var t=Object.assign({},this.columnDefinition);t.field=e,t.title=e,this.columnDefs.push(t)})}initializeRows(){var e;this.grid.setRowCount(this.rowCount),e=this.grid.genRows(this.data),this.rowDefs=[],e.forEach((t,i)=>{var s={_id:t},n=this.data[i];n&&n.forEach((r,o)=>{var a=this.columnFields[o];a&&(s[a]=r)}),this.rowDefs.push(s)})}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var e=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),e&&this.scrollTop!==null&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new ft(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(e){var t=[],i,s,n;return this.rowDefs.forEach(r=>{var o=[];this.columnFields.forEach(a=>{o.push(r[a])}),t.push(o)}),!e&&!this.options("spreadsheetOutputFull")&&(i=t.map(r=>r.findLastIndex(o=>typeof o<"u")+1),s=Math.max(...i),n=i.findLastIndex(r=>r>0)+1,t=t.slice(0,n),t=t.map(r=>r.slice(0,s))),t}setData(e){this.data=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(e){this.title=e,this.element.innerText=e,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(e){this.rowCount=e,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(e){this.columnCount=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}class pt extends w{constructor(e){super(e),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var e=this.options("spreadsheetSheetTabsElement");e&&!(e instanceof HTMLElement)&&(e=document.querySelector(e),e||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement"))),e?e.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(e,t,i){return console.log("data",e,t,i),Array.isArray(e)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",e),!e.length||Array.isArray(e[0])?this.loadData(e):this.loadSheets(e)):console.error(`Spreadsheet Loading Error - Unable to process remote data due to invalid data type +Expecting: array +Received: `,typeof e,` +Data: `,e),!1}loadData(e){var t={data:e};this.loadSheet(this.newSheet(t))}destroySheets(){this.sheets.forEach(e=>{e.destroy()}),this.sheets=[],this.activeSheet=null}loadSheets(e){Array.isArray(e)||(e=[]),this.destroySheets(),e.forEach(t=>{this.newSheet(t)}),this.loadSheet(this.sheets[0])}loadSheet(e){this.activeSheet!==e&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=e,e.load())}newSheet(e={}){var t;return e.rows||(e.rows=this.options("spreadsheetRows")),e.columns||(e.columns=this.options("spreadsheetColumns")),t=new Xe(this,e),this.sheets.push(t),this.element&&this.element.appendChild(t.element),t}removeSheet(e){var t=this.sheets.indexOf(e),i;this.sheets.length>1?t>-1&&(this.sheets.splice(t,1),e.destroy(),this.activeSheet===e&&(i=this.sheets[t-1]||this.sheets[0],i?this.loadSheet(i):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(e){return e?e instanceof Xe?e:e instanceof ft?e._sheet:this.sheets.find(t=>t.key===e)||!1:this.activeSheet}setSheets(e){return this.loadSheets(e),this.getSheets()}addSheet(e){return this.newSheet(e).getComponent()}getSheetDefinitions(){return this.sheets.map(e=>e.getDefinition())}getSheets(){return this.sheets.map(e=>e.getComponent())}getSheet(e){var t=this.lookupSheet(e);return t?t.getComponent():!1}setSheetData(e,t){e&&!t&&(t=e,e=!1);var i=this.lookupSheet(e);return i?i.setData(t):!1}getSheetData(e){var t=this.lookupSheet(e);return t?t.getData():!1}clearSheet(e){var t=this.lookupSheet(e);return t?t.clear():!1}removeSheetFunc(e){var t=this.lookupSheet(e);t&&this.removeSheet(t)}activeSheetFunc(e){var t=this.lookupSheet(e);return t?this.loadSheet(t):!1}}b(pt,"moduleName","spreadsheet");class mt extends w{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s=e==="tooltip"?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,n,r;function o(a){n=a}typeof i=="function"&&(i=i(e,t.getComponent(),o)),i instanceof HTMLElement?s=i:(s=document.createElement("div"),i===!0&&(t instanceof ne?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,a=>{s.innerHTML=i=a||t.definition.title}):i=t.definition.title),s.innerHTML=i),(i||i===0||i===!1)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",a=>a.preventDefault()),this.popupInstance=this.popup(s),typeof n=="function"&&this.popupInstance.renderCallback(n),r=this.popupInstance.containerEventCoords(e),this.popupInstance.show(r.x+15,r.y+15).hideOnBlur(()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null}),this.dispatchExternal("TooltipOpened",t.getComponent()))}}b(mt,"moduleName","tooltip");var vs={integer:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(e=Number(e),!isNaN(e)&&isFinite(e)&&Math.floor(e)===e)},float:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(e=Number(e),!isNaN(e)&&isFinite(e)&&e%1!==0)},numeric:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:!isNaN(e)},string:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:isNaN(e)},alphanumeric:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=new RegExp(/^[a-z0-9]+$/i);return i.test(e)},max:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:parseFloat(e)<=t},min:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:parseFloat(e)>=t},starts:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).toLowerCase().startsWith(String(t).toLowerCase())},ends:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).toLowerCase().endsWith(String(t).toLowerCase())},minLength:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).length>=t},maxLength:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).length<=t},in:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(typeof t=="string"&&(t=t.split("|")),t.indexOf(e)>-1)},regex:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=new RegExp(t);return i.test(e)},unique:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=!0,s=l.getData(),n=l.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(r){var o=r.getData();o!==s&&e==n.getFieldValue(o)&&(i=!1)}),i},required:function(l,e,t){return e!==""&&e!==null&&typeof e<"u"}};const ie=class ie extends w{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s=this.table.options.validationMode!=="manual"?this.validate(e.column.modules.validate,e,t):!0;return s!==!0&&setTimeout(()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)}),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach(i=>{this.cellValidate(i)!==!0&&t.push(i.getComponent())}),t.length?t:!0}rowValidate(e){var t=[];return e.cells.forEach(i=>{this.cellValidate(i)!==!0&&t.push(i.getComponent())}),t.length?t:!0}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(t=>{this.clearValidation(t._getSelf())})}userValidate(e){var t=[];return this.table.rowManager.rows.forEach(i=>{i=i.getComponent();var s=i.validate();s!==!0&&(t=t.concat(s))}),t.length?t:!0}initializeColumnCheck(e){typeof e.definition.validator<"u"&&this.initializeColumn(e)}initializeColumn(e){var t=this,i=[],s;e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(n=>{s=t._extractValidator(n),s&&i.push(s)}):(s=this._extractValidator(e.definition.validator),s&&i.push(s)),e.modules.validate=i.length?i:!1)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return s=e.indexOf(":"),s>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i=typeof e=="function"?e:ie.validators[e];return i?{type:typeof e=="function"?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,n=[],r=this.invalidCells.indexOf(t);return e&&e.forEach(o=>{o.func.call(s,t.getComponent(),i,o.params)||n.push({type:o.type,parameters:o.params})}),t.modules.validate||(t.modules.validate={}),n.length?(t.modules.validate.invalid=n,this.table.options.validationMode!=="manual"&&t.getElement().classList.add("tabulator-validation-fail"),r==-1&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),r>-1&&this.invalidCells.splice(r,1)),n.length?n:!0}getInvalidCells(){var e=[];return this.invalidCells.forEach(t=>{e.push(t.getComponent())}),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,t=this.invalidCells.indexOf(e),t>-1&&this.invalidCells.splice(t,1))}};b(ie,"moduleName","validate"),b(ie,"validators",vs);let Fe=ie;var ue=Object.freeze({__proto__:null,AccessorModule:ce,AjaxModule:me,ClipboardModule:ge,ColumnCalcsModule:be,DataTreeModule:Ze,DownloadModule:ve,EditModule:we,ExportModule:Ce,FilterModule:Ee,FormatModule:ye,FrozenColumnsModule:et,FrozenRowsModule:tt,GroupRowsModule:it,HistoryModule:Re,HtmlTableImportModule:st,ImportModule:xe,InteractionModule:nt,KeybindingsModule:Te,MenuModule:rt,MoveColumnsModule:ot,MoveRowsModule:ke,MutatorModule:Me,PageModule:Le,PersistenceModule:Se,PopupModule:at,PrintModule:lt,ReactiveDataModule:ht,ResizeColumnsModule:dt,ResizeRowsModule:ut,ResizeTableModule:ct,ResponsiveLayoutModule:De,SelectRangeModule:re,SelectRowModule:ze,SortModule:He,SpreadsheetModule:pt,TooltipModule:mt,ValidateModule:Fe}),ws={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}};class gt{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||t.debugInvalidOptions===!0;Object.assign(i,e);for(let n in t)i.hasOwnProperty(n)||(s&&console.warn("Invalid "+this.msgType+" option:",n),i[n]=t.key);for(let n in i)n in t?i[n]=t[n]:Array.isArray(i[n])?i[n]=Object.assign([],i[n]):typeof i[n]=="object"&&i[n]!==null?i[n]=Object.assign({},i[n]):typeof i[n]>"u"&&delete i[n];return i}}class le extends M{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,t,i){var s=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise((o,a)=>{if(s>-1){if(typeof i>"u"&&(i=this.table.options.scrollToRowIfVisible),!i&&x.elVisible(n)&&(r=x.elOffset(n).top-x.elOffset(this.elementVertical).top,r>0&&r"u"&&(t=this.table.options.scrollToRowPosition),t==="nearest"&&(t=this.scrollToRowNearestTop(e)?"top":"bottom"),this.scrollToRow(e),t){case"middle":case"center":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop+(n.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-n.offsetTop)/2:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2;break;case"bottom":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-n.offsetTop)+n.offsetHeight:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+n.offsetHeight;break;case"top":this.elementVertical.scrollTop=n.offsetTop;break}o()}else console.warn("Scroll Error - Row not visible"),a("Scroll Error - Row not visible")})}}class Cs extends le{constructor(e){super(e)}renderRowCells(e,t){const i=document.createDocumentFragment();e.cells.forEach(s=>{i.appendChild(s.getElement())}),e.element.appendChild(i),t||e.cells.forEach(s=>{s.cellRendered()})}reinitializeColumnWidths(e){e.forEach(function(t){t.reinitializeWidth()})}}class Es extends le{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){this.options("layout")=="fitDataTable"&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach(t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}}),this.windowBuffer=e*2}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach(n=>{var r={},o;n.visible&&(n.modules.frozen||(o=n.getWidth(),r.leftPos=s,r.rightPos=s+o,r.width=o,this.isFitData&&(r.fitDataCheck=n.modules.vdomHoz?n.modules.vdomHoz.fitDataCheck:!0),s+o>this.vDomScrollPosLeft&&s{t.appendChild(i.getElement())}),e.element.appendChild(t),e.cells.forEach(i=>{i.cellRendered()})}}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let t=this.leftCol;t<=this.rightCol;t++)this.columns[t].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e=!1,t,i;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach(s=>{!s.definition.width&&s.visible&&(e=!0)}),e&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],()=>this.table.rowManager.getDisplayRows())[0],t)){i=t.getElement(),t.generateCells(),this.tableElement.appendChild(i);for(let s=0;s{i!==this.columns[s]&&(t=!1)}),!t)}reinitializeRows(){var e=this.getVisibleRows(),t=this.table.rowManager.getRows().filter(i=>!e.includes(i));e.forEach(i=>{this.reinitializeRow(i,!0)}),t.forEach(i=>{i.deinitialize()})}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if(s.type!=="group"){var n=s.getCell(i);s.getElement().insertBefore(n.getElement(),s.getCell(this.columns[this.rightCol]).getElement().nextSibling),n.cellRendered()}}),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.rightCol=this.rightCol)}),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach(n=>{if(n.type!=="group"){var r=n.getCell(i);n.getElement().insertBefore(r.getElement(),n.getCell(this.columns[this.leftCol]).getElement()),r.cellRendered()}}),this.leftCol--,this.getVisibleRows().forEach(n=>{n.type!=="group"&&(n.modules.vdomHoz.leftCol=this.leftCol)}),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let s=this.fitDataColActualWidthCheck(i);s&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+s,this.vDomPadRight-=s)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach(s=>{if(s.type!=="group"){var n=s.getCell(i);try{s.getElement().removeChild(n.getElement())}catch(r){console.warn("Could not removeColRight",r.message)}}}),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.rightCol=this.rightCol)})):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if(s.type!=="group"){var n=s.getCell(i);try{s.getElement().removeChild(n.getElement())}catch(r){console.warn("Could not removeColLeft",r.message)}}}),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.leftCol=this.leftCol)})):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),t=e.getWidth(),i=t-e.modules.vdomHoz.width,i&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if(e.type!=="group"){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.appendCell(e,t)});for(let t=this.leftCol;t<=this.rightCol;t++)this.appendCell(e,this.columns[t]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.appendCell(e,t)})}}appendCell(e,t){if(t&&t.visible){let i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(e,t){if(e.type!=="group"&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class ys extends M{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new gt(this.table,"column definition",Qe),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(e){this.table.rtl?this.headersElement.style.marginLeft=e+"px":this.headersElement.style.marginRight=e+"px"}initializeRenderer(){var e,t={virtual:Es,basic:Cs};typeof this.table.options.renderHorizontal=="string"?e=t[this.table.options.renderHorizontal]:e=this.table.options.renderHorizontal,e?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderContentsElement(){var e=document.createElement("div");return e.classList.add("tabulator-header-contents"),e.setAttribute("role","rowgroup"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(e){this.contentsElement.scrollLeft=e,this.scrollLeft=e,this.renderer.scrollColumns(e)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",e=>{var t;e.deltaX&&(t=this.contentsElement.scrollLeft+e.deltaX,this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})}generateColumnsFromRowData(e){var t=[],i={},s=this.table.options.autoColumns==="full"?e:[e[0]],n=this.table.options.autoColumnsDefinitions;if(e&&e.length){if(s.forEach(r=>{Object.keys(r).forEach((o,a)=>{let h=r[o],d;i[o]?i[o]!==!0&&typeof h<"u"&&(i[o].sorter=this.calculateSorterFromValue(h),i[o]=!0):(d={field:o,title:o,sorter:this.calculateSorterFromValue(h)},t.splice(a,0,d),i[o]=typeof h>"u"?d:!0)})}),n)switch(typeof n){case"function":this.table.options.columns=n.call(this.table,t);break;case"object":Array.isArray(n)?t.forEach(r=>{var o=n.find(a=>a.field===r.field);o&&Object.assign(r,o)}):t.forEach(r=>{n[r.field]&&Object.assign(r,n[r.field])}),this.table.options.columns=t;break}else this.table.options.columns=t;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(e){var t;switch(typeof e){case"undefined":t="string";break;case"boolean":t="boolean";break;case"number":t="number";break;case"object":Array.isArray(e)?t="array":t="string";break;default:!isNaN(e)&&e!==""?t="number":e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?t="alphanum":t="string";break}return t}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new U(this.table.options.rowHeader===!0?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),e.forEach((i,s)=>{this._addColumn(i)}),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new U(e,this),n=s.getElement(),r=i&&this.findColumnIndex(i);if(t&&this.rowHeader&&(!i||i===this.rowHeader)&&(t=!1,i=this.rowHeader,r=0),i&&r>-1){var o=i.getTopColumn(),a=this.columns.indexOf(o),h=o.getElement();t?(this.columns.splice(a,0,s),h.parentNode.insertBefore(n,h)):(this.columns.splice(a+1,0,s),h.parentNode.insertBefore(n,h.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach(t=>{t.clearVerticalAlign()}),this.columns.forEach(t=>{var i=t.getHeight();i>e&&(e=i)}),this.headersElement.style.height=e+"px",this.columns.forEach(t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)}),this.table.rowManager.adjustTableSize())}findColumn(e){var t;if(typeof e=="object"){if(e instanceof U)return e;if(e instanceof $e)return e._getSelf()||!1;if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return t=[],this.columns.forEach(s=>{t.push(s),t=t.concat(s.getColumns(!0))}),t.find(s=>s.element===e)||!1}else return this.columnsByField[e]||!1;return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach(i=>{var s=this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i;s===e&&t.push(this.columnsByField[i])}),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex(t=>t.visible);return e>-1?this.columnsByIndex[e]:!1}getVisibleColumnsByIndex(){return this.columnsByIndex.filter(e=>e.visible)}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex(t=>e===t)}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach((t,i)=>{e(t,i)})}getDefinitions(e){var t=[];return this.columnsByIndex.forEach(i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())}),t}getDefinitionTree(){var e=[];return this.columns.forEach(t=>{e.push(t.getDefinition(!0))}),e}getComponents(e){var t=[],i=e?this.columns:this.columnsByIndex;return i.forEach(s=>{t.push(s.getComponent())}),t}getWidth(){var e=0;return this.columnsByIndex.forEach(t=>{t.visible&&(e+=t.getWidth())}),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,n){var r=e.indexOf(t),o,a=[];r>-1&&(e.splice(r,1),o=e.indexOf(i),o>-1?s&&(o=o+1):o=r,e.splice(o,0,t),n&&(a=this.chain("column-moving-rows",[t,i,s],null,[])||[],a=a.concat(this.table.rowManager.rows),a.forEach(function(h){if(h.cells.length){var d=h.cells.splice(r,1)[0];h.cells.splice(o,0,d)}})))}scrollToColumn(e,t,i){var s=0,n=e.getLeftOffset(),r=0,o=e.getElement();return new Promise((a,h)=>{if(typeof t>"u"&&(t=this.table.options.scrollToColumnPosition),typeof i>"u"&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-this.element.clientWidth/2;break;case"right":r=o.clientWidth-this.headersElement.clientWidth;break}if(!i&&n>0&&n+o.offsetWidth{t.push(i.generateCell(e))}),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var s,n,r;i.visible&&(s=i.definition.width||0,n=parseInt(i.minWidth),typeof s=="string"?s.indexOf("%")>-1?r=e/100*parseInt(s):r=parseInt(s):r=s,t+=r>n?r:n)}),t}addColumn(e,t,i){return new Promise((s,n)=>{var r=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),this.layoutMode()!="fitColumns"&&r.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(r)})}deregisterColumn(e){var t=e.getField(),i;t&&delete this.columnsByField[t],i=this.columnsByIndex.indexOf(e),i>-1&&this.columnsByIndex.splice(i,1),i=this.columns.indexOf(e),i>-1&&this.columns.splice(i,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(e===!1||e===!0&&this.redrawBlockUpdate===null)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){x.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class Rs extends le{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0,i=document.createDocumentFragment(),s=this.rows();s.forEach((n,r)=>{this.styleRow(n,r),n.initialize(!1,!0),n.type!=="group"&&(t=!1),i.appendChild(n.getElement())}),e.appendChild(i),s.forEach(n=>{n.rendered(),n.heightInitialized||n.calcHeight(!0)}),s.forEach(n=>{n.heightInitialized||n.setCellHeight()}),t?e.style.minWidth=this.table.columnManager.getWidth()+"px":e.style.minWidth=""}rerenderRows(e){this.clearRows(),e&&e(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(e){var t=x.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-t)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}scrollToRow(e){var t=e.getElement();this.elementVertical.scrollTop=x.elOffset(t).top-x.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class xs extends le{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,n=this.table.rowManager.scrollLeft,r=this.rows(),o=this.vDomTop;o<=this.vDomBottom;o++)if(r[o]){var a=t-r[o].getElement().offsetTop;if(s===!1||Math.abs(a){h.deinitializeHeight()}),e&&e(),this.rows().length?this._virtualRenderFill(i===!1?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(n)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,n=this.vDomWindowBuffer*2,r=this.rows();if(this.scrollTop=e,-i>n||s>n){var o=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*r.length)),this.scrollColumns(o)}else t?(i<0&&this._addTopRow(r,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(r,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(r,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(r,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,n=0,r=0,o=this.rows();if(e)n=this.vDomTop,r=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(o[a])if(s)if(i-o[a].getElement().offsetTop>=0)r=a;else break;else if(t-o[a].getElement().offsetTop>=0)n=a;else if(s=!0,i-o[a].getElement().offsetTop>=0)r=a;else break;return o.slice(n,r+1)}_virtualRenderFill(e,t,i){var s=this.tableElement,n=this.elementVertical,r=0,o=0,a=0,h=0,d=0,u=0,c=this.rows(),f=c.length,g=0,p,v,m=[],C=0,T=0,y=this.table.rowManager.fixedHeight,k=this.elementVertical.clientHeight,P=this.table.options.rowHeight,X=!0;if(e=e||0,i=i||0,!e)this.clear();else{for(;s.firstChild;)s.removeChild(s.firstChild);h=(f-e+1)*this.vDomRowHeight,h{L.rendered(),L.heightInitialized||L.calcHeight(!0)}),m.forEach(L=>{L.heightInitialized||L.setCellHeight()}),m.forEach(L=>{a=L.getHeight(),Cthis.vDomWindowBuffer&&(this.vDomWindowBuffer=a*2),C++}),X=this.table.rowManager.adjustTableSize(),k=this.elementVertical.clientHeight,X&&(y||this.table.options.maxHeight)&&(P=o/C,T=Math.max(this.vDomWindowMinTotalRows,Math.ceil(k/P+this.vDomWindowBuffer/P)))}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-d,this.vDomBottomPad=this.vDomBottom==f-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-o-d,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((o+d)/C),this.vDomBottomPad=this.vDomRowHeight*(f-this.vDomBottom-1),this.vDomScrollHeight=d+o+this.vDomBottomPad-k),s.style.paddingTop=this.vDomTopPad+"px",s.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+d+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-k:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-k),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-k),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],n=0,r=this.vDomTop-1,o=0,a=!0;a;)if(this.vDomTop){let h=e[r],d,u;h&&o=d?(this.styleRow(h,r),i.insertBefore(h.getElement(),i.firstChild),(!h.initialized||!h.heightInitialized)&&s.push(h),h.initialize(),u||(d=h.getElement().offsetHeight,d>this.vDomWindowBuffer&&(this.vDomWindowBuffer=d*2)),t-=d,n+=d,this.vDomTop--,r--,o++):a=!1):a=!1}else a=!1;for(let h of s)h.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomTopPad-=n,this.vDomTopPad<0&&(this.vDomTopPad=r*this.vDomRowHeight),r<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=n)}_removeTopRow(e,t){for(var i=[],s=0,n=0,r=!0;r;){let o=e[this.vDomTop],a;o&&n=a?(this.vDomTop++,t-=a,s+=a,i.push(o),n++):r=!1):r=!1}for(let o of i){let a=o.getElement();a.parentNode&&a.parentNode.removeChild(a)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],n=0,r=this.vDomBottom+1,o=0,a=!0;a;){let h=e[r],d,u;h&&o=d?(this.styleRow(h,r),i.appendChild(h.getElement()),(!h.initialized||!h.heightInitialized)&&s.push(h),h.initialize(),u||(d=h.getElement().offsetHeight,d>this.vDomWindowBuffer&&(this.vDomWindowBuffer=d*2)),t-=d,n+=d,this.vDomBottom++,r++,o++):a=!1):a=!1}for(let h of s)h.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomBottomPad-=n,(this.vDomBottomPad<0||r==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=n)}_removeBottomRow(e,t){for(var i=[],s=0,n=0,r=!0;r;){let o=e[this.vDomBottom],a;o&&n=a?(this.vDomBottom--,t-=a,s+=a,i.push(o),n++):r=!1):r=!1}for(let o of i){let a=o.getElement();a.parentNode&&a.parentNode.removeChild(a)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class Ts extends M{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){var e=this.table.options.placeholder;if(typeof e=="function"&&(e=e.call(this.table)),e=this.chain("placeholder",[e],e,e)||e,e){let t=document.createElement("div");if(t.classList.add("tabulator-placeholder"),typeof e=="string"){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=e,t.appendChild(i),this.placeholderContents=i}else typeof HTMLElement<"u"&&e instanceof HTMLElement?(t.appendChild(e),this.placeholderContents=e):(console.warn("Invalid placeholder provided, must be string or HTML Element",e),this.el=null);this.placeholder=t}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))})}findRow(e){if(typeof e=="object"){if(e instanceof S)return e;if(e instanceof oe)return e._getSelf()||!1;if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return this.rows.find(i=>i.getElement()===e)||!1;if(e===null)return!1}else return typeof e>"u"?!1:this.rows.find(i=>i.data[this.table.options.index]==e)||!1;return!1}getRowFromDataObject(e){var t=this.rows.find(i=>i.data===e);return t||!1}getRowFromPosition(e){return this.getDisplayRows().find(t=>t.type==="row"&&t.getPosition()===e&&t.isDisplayed())}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise((s,n)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition(()=>{this._setDataActual(e)}):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()})}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach((i,s)=>{if(i&&typeof i=="object"){var n=new S(i,this);this.rows.push(n)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",i)}),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error(`Data Loading Error - Unable to process data due to invalid data type +Expecting: array +Received: `,typeof e,` +Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(e=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(n=>{var r=n.indexOf(e);r>-1&&n.splice(r,1)}),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){var n=this.addRowActual(e,t,i,s);return n}addRows(e,t,i,s){var n=[];return new Promise((r,o)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(typeof i>"u"&&t||typeof i<"u"&&!t)&&e.reverse(),e.forEach((a,h)=>{var d=this.addRow(a,t,i,!0);n.push(d),this.dispatch("row-added",d,a,t,i)}),this.refreshActiveData(s?"displayPipeline":!1,!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),r(n)})}findAddRowPos(e){return typeof e>"u"&&(e=this.table.options.addRowPos),e==="pos"&&(e=!0),e==="bottom"&&(e=!1),e}addRowActual(e,t,i,s){var n=e instanceof S?e:new S(e||{},this),r=this.findAddRowPos(t),o=-1,a,h;return i||(h=this.chain("row-adding-position",[n,r],null,{index:i,top:r}),i=h.index,r=h.top),typeof i<"u"&&(i=this.findRow(i)),i=this.chain("row-adding-index",[n,i,r],null,i),i&&(o=this.rows.indexOf(i)),i&&o>-1?(a=this.activeRows.indexOf(i),this.displayRowIterator(function(d){var u=d.indexOf(i);u>-1&&d.splice(r?u:u+1,0,n)}),a>-1&&this.activeRows.splice(r?a:a+1,0,n),this.rows.splice(r?o:o+1,0,n)):r?(this.displayRowIterator(function(d){d.unshift(n)}),this.activeRows.unshift(n),this.rows.unshift(n)):(this.displayRowIterator(function(d){d.push(n)}),this.activeRows.push(n),this.rows.push(n)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",n.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),n}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator(s=>{this.moveRowInArray(s,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var n,r,o,a;if(t!==i&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),r=e.indexOf(i),r>-1?s?e.splice(r+1,0,t):e.splice(r,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){o=nn?r:n+1;for(let h=o;h<=a;h++)e[h]&&this.styleRow(e[h],h)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1?t:!1}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return i!==!1&&i-1)?i:!1}getData(e,t){var i=[],s=this.getRows(e);return s.forEach(function(n){n.type=="row"&&i.push(n.getData(t||"data"))}),i}getComponents(e){var t=[],i=this.getRows(e);return i.forEach(function(s){t.push(s.getComponent())}),t}getDataCount(e){var t=this.getRows(e);return t.length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){typeof t<"u"?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((i,s)=>i.priority-s.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){typeof t<"u"?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((i,s)=>i.priority-s.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var s=this.table,n="",r=0,o=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof e=="function")if(r=this.dataPipeline.findIndex(a=>a.handler===e),r>-1)n="dataPipeline",t&&(r==this.dataPipeline.length-1?n="display":r++);else if(r=this.displayPipeline.findIndex(a=>a.handler===e),r>-1)n="displayPipeline",t&&(r==this.displayPipeline.length-1?n="end":r++);else{console.error("Unable to refresh data, invalid handler provided",e);return}else n=e||"all",r=0;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{i.type==="row"&&(i.setPosition(t),t++)})}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return typeof e>"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:xs,basic:Rs};typeof this.table.options.renderVertical=="string"?e=t[this.table.options.renderVertical]:e=this.table.options.renderVertical,e?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach(function(e){e.normalizeHeight()})}adjustTableSize(){let e=this.element.clientHeight,t,i=!1;if(this.renderer.verticalFillMode==="fill"){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const n="calc(100% - "+s+"px)";this.element.style.minHeight=t||"calc(100% - "+s+"px)",this.element.style.height=n,this.element.style.maxHeight=n}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-s+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),!this.fixedHeight&&e!=this.element.clientHeight&&(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class ks extends M{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":this.table.options.footerElement[0]==="<"?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){(!this.element.firstChild||e)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Ms extends M{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach(t=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};i=i.filter(n=>{var r=s[e];return n!==e&&(!r||r&&!r.includes(n))}),i.forEach(n=>{var r=this.pseudoTrackers[n].target;this.pseudoTrackers[n].target&&(this.dispatch(n+"-mouseleave",t,r),this.pseudoTrackers[n].target=null)})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let s of e){let n=i+"-"+s;this.subscriptionChange(n,this.subscriptionChanged.bind(this,i,s))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,n=s.indexOf(e),r=!1;i?n===-1&&(s.push(e),r=!0):this.subscribed(e+"-"+t)||n>-1&&(s.splice(n,1),r=!0),(t==="mouseenter"||t==="mouseleave")&&!this.pseudoTracking&&this.bindPseudoEvents(),r&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),this.pseudoTracking&&(e=="mouseover"||e=="mouseleave")&&!Object.keys(s).length&&this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let n=s.classList?[...s.classList]:[];if(n.filter(a=>this.abortClasses.includes(a)).length)break;let o=n.filter(a=>i.includes(a));for(let a of o)t[this.componentMap[a]]||(t[this.componentMap[a]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],n={},r={};for(let o of i){let a,h=t[o],d=this.previousTargets[o];if(d&&d.target===h)a=d.component;else switch(o){case"row":case"group":(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group"))&&(a=this.table.rowManager.getVisibleRows(!0).find(c=>c.getElement()===h),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[o]=!1));break;case"column":s.components.includes("column")&&(a=this.table.columnManager.findColumn(h));break;case"cell":s.components.includes("cell")&&(n.row instanceof S?a=n.row.findCell(h):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"));break}a&&(n[o]=a,r[o]={target:h,component:a})}return this.previousTargets=r,n}triggerEvents(e,t,i){var s=this.listeners[e];for(let n in i)i[n]&&s.components.includes(n)&&this.dispatch(n+"-"+e,t,i[n])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Ls{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&typeof this.bindings[e][i].bind=="function")return this.bindings[e][i].bind(null,t);i!=="then"&&typeof i=="string"&&!i.startsWith("_")&&this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Ss extends M{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,n,r){var o=++this.requestOrder;if(this.table.destroyed)return Promise.resolve();if(this.dispatchExternal("dataLoading",e),e&&(e.indexOf("{")==0||e.indexOf("[")==0)&&(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,n])){this.loading=!0,n||this.alertLoader(),t=this.chain("data-params",[e,i,n],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams);var a=this.chain("data-load",[e,t,i,n],!1,Promise.resolve([]));return a.then(h=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{!Array.isArray(h)&&typeof h=="object"&&(h=this.mapParams(h,this.objectInvert(this.table.options.dataReceiveParams)));var d=this.chain("data-loaded",[h],null,h);o==this.requestOrder?(this.clearAlert(),d!==!1&&(this.dispatchExternal("dataLoaded",d),this.table.rowManager.setData(d,s,typeof r>"u"?!s:r))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(h=>{console.error("Data Load Error: ",h),this.dispatchExternal("dataLoadError",h),n||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})}else return this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,typeof r>"u"?!s:r),Promise.resolve()}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){var e=typeof this.table.options.dataLoader=="function"?this.table.options.dataLoader():this.table.options.dataLoader;e&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Ds{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e])if(t)if(i=this.events[e].findIndex(s=>s===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}else delete this.events[e];else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(s=>{s(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift(),i;return this.events[t]&&this.events[t].forEach((s,n)=>{let r=s.apply(this.table,e);n||(i=r)}),i}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class zs{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((s,n)=>s.priority-n.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t)if(i=this.events[e].findIndex(s=>s.callback===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}}else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var n=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((r,o)=>{n=r.callback.apply(this,t.concat([n]))}),n):typeof s=="function"?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((s,n)=>{s.callback.apply(this,t)&&(i=!0)}),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(s=>{s(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach(i=>{i.callback.apply(this,e)})}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Hs extends M{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t,i){var s="";return typeof this.options(e)<"u"?(s="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(s=s+", Please use the %c"+t+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[t]=this.table.options[e])):this._warnUser(s,"font-weight: bold;","font-weight: normal;"),!1):!0}checkMsg(e,t){return typeof this.options(e)<"u"?(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1):!0}msg(e){this._warnUser(e)}}function Fs(l,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(l),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Je(l,e){l.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Ps(l,e){var t=0,i=this.table.rowManager.element.clientWidth,s=0,n=!1;l.forEach((r,o)=>{r.widthFixed||r.reinitializeWidth(),(this.table.options.responsiveLayout?r.modules.responsive.visible:r.visible)&&(n=r),r.visible&&(t+=r.getWidth())}),n?(s=i-t+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),s>0?n.setWidth(s):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Os(l,e){var t=this.table.rowManager.element.getBoundingClientRect().width,i=0,s=0,n=0,r=0,o=[],a=[],h=0,d=0,u=0;function c(g){var p;return typeof g=="string"?g.indexOf("%")>-1?p=t/100*parseInt(g):p=parseInt(g):p=g,p}function f(g,p,v,m){var C=[],T=0,y=0,k=0,P=n,X=0,L=0,he=[];function Ie(E){return v*(E.column.definition.widthGrow||1)}function Ne(E){return c(E.width)-v*(E.column.definition.widthShrink||0)}return g.forEach(function(E,Ws){var We=m?Ne(E):Ie(E);E.column.minWidth>=We?C.push(E):E.column.maxWidth&&E.column.maxWidththis.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),l.forEach(function(g){var p,v,m;g.visible&&(p=g.definition.width,v=parseInt(g.minWidth),p?(m=c(p),i+=m>v?m:v,g.definition.widthShrink&&(a.push({column:g,width:m>v?m:v}),h+=g.definition.widthShrink)):(o.push({column:g,width:0}),n+=g.definition.widthGrow||1))}),s=t-i,r=Math.floor(s/n),u=f(o,s,r,!1),o.length&&u>0&&(o[o.length-1].width+=u),o.forEach(function(g){s-=g.width}),d=Math.abs(u)+s,d>0&&h&&(u=f(a,d,Math.floor(d/h),!0)),u&&a.length&&(a[a.length-1].width-=u),o.forEach(function(g){g.column.setWidth(g.width)}),a.forEach(function(g){g.column.setWidth(g.width)})}var As={fitData:Fs,fitDataFill:Je,fitDataTable:Je,fitDataStretch:Ps,fitColumns:Os};const $=class $ extends w{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;$.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){e.definition.widthGrow&&(e.definition.widthGrow=Number(e.definition.widthGrow)),e.definition.widthShrink&&(e.definition.widthShrink=Number(e.definition.widthShrink))}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),$.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}};b($,"moduleName","layout"),b($,"modes",As);let Pe=$;var _s={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};const se=class se extends w{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=x.deepClone(se.langs),this.table.options.columnDefaults.headerFilterPlaceholder!==!1&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&typeof e[i]=="object"?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){e=e||"default";function t(i,s){for(var n in i)typeof i[n]=="object"?(s[n]||(s[n]={}),t(i[n],s[n])):s[n]=i[n]}if(e===!0&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let i=e.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=x.deepClone(this.langList.default||{}),e!="default"&&t(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=t?e+"|"+t:e,s=i.split("|"),n=this._getLangElement(s,this.locale);return n||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(s){var n;i&&(n=i[s],typeof n<"u"?i=n:i=!1)}),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach(t=>{t(this.getText(e),this.lang)})}};b(se,"moduleName","localize"),b(se,"langs",_s);let Oe=se;class bt extends w{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[],i;return i=this.table.constructor.registry.lookupTable(e),i.forEach(s=>{this.table!==s&&t.push(s)}),t}send(e,t,i,s){var n=this.getConnections(e);n.forEach(r=>{r.tableComms(this.table.element,t,i,s)}),!n.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}b(bt,"moduleName","comms");var Bs=Object.freeze({__proto__:null,CommsModule:bt,LayoutModule:Pe,LocalizeModule:Oe});const z=class z{static findTable(e){var t=z.registry.lookupTable(e,!0);return Array.isArray(t)&&!t.length?!1:t}};b(z,"registry",{tables:[],register(e){z.registry.tables.push(e)},deregister(e){var t=z.registry.tables.indexOf(e);t>-1&&z.registry.tables.splice(t,1)},lookupTable(e,t){var i=[],s,n;if(typeof e=="string"){if(s=document.querySelectorAll(e),s.length)for(var r=0;r{s.prototype.moduleCore=!0}),R._registerModule(i)}static _registerModule(e){Array.isArray(e)||(e=[e]),e.forEach(t=>{R._registerModuleBinding(t),R._registerModuleExtensions(t)})}static _registerModuleBinding(e){e.moduleName?R.moduleBindings[e.moduleName]=e:console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let i in t){let s=t[i];if(R.moduleBindings[i])for(let n in s)R._extendModule(i,n,s[n]);else{R.moduleExtensions[i]||(R.moduleExtensions[i]={});for(let n in s)R.moduleExtensions[i][n]||(R.moduleExtensions[i][n]={}),Object.assign(R.moduleExtensions[i][n],s[n])}}R._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=R.moduleExtensions[e.moduleName];if(t)for(let i in t)R._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];this.modules={};for(var s in R.moduleBindings){let n=R.moduleBindings[s],r=new n(this);this.modules[s]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?e.push(r):t.push(r):i.push(r)}e.sort((n,r)=>n.moduleInitOrder>r.moduleInitOrder?1:-1),t.sort((n,r)=>n.moduleInitOrder>r.moduleInitOrder?1:-1),this.modulesRegular=e.concat(i.concat(t))}};b(R,"moduleBindings",{}),b(R,"moduleExtensions",{}),b(R,"modulesRegistered",!1),b(R,"defaultModules",!1);let _e=R;class Vs extends M{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.dispatch("alert-show",t),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),typeof e=="function"&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}const A=class A extends _e{static extendModule(){A.initializeModuleBinder(),A._extendModule(...arguments)}static registerModule(){A.initializeModuleBinder(),A._registerModule(...arguments)}constructor(e,t,i){super(),A.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Ls(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Hs(this),this.optionsList=new gt(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement?(this.element=e,!0):typeof e=="string"?(this.element=document.querySelector(e),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new ys(this),this.rowManager=new Ts(this),this.footerManager=new ks(this),this.dataLoader=new Ss(this),this.alertManager=new Vs(this),this._bindModules(),this.options=this.optionsList.generate(A.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Ds(this,this.options,this.options.debugEventsExternal),this.eventBus=new zs(this.options.debugEventsInternal),this.interactionMonitor=new Ms(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(e.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e=this.element,t=this.options,i;if(e.tagName==="TABLE"){this.originalElement=this.element,i=document.createElement("div");var s=e.attributes;for(var n in s)typeof s[n]=="object"&&i.setAttribute(s[n].name,s[n].value);e.parentNode.replaceChild(i,e),this.element=e=i}for(e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);t.height&&(t.height=isNaN(t.height)?t.height:t.height+"px",e.style.height=t.height),t.minHeight!==!1&&(t.minHeight=isNaN(t.minHeight)?t.minHeight:t.minHeight+"px",e.style.minHeight=t.minHeight),t.maxHeight!==!1&&(t.maxHeight=isNaN(t.maxHeight)?t.maxHeight:t.maxHeight+"px",e.style.maxHeight=t.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(i=>{i.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(i=>{i.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var e=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(i=new Error().stack.split(` +`),s=i[0]=="Error"?i[2]:i[1],s[0]==" "?e=s.trim().split(" ")[1].split(".")[1]:e=s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(n=>{var r=this.rowManager.findRow(n[this.options.index]);r?(t++,r.updateData(n).then(()=>{t--,t||i()}).catch(o=>{s("Update Error - Unable to update row",n,o)})):s("Update Error - Unable to find row",n)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(r=>{var o=[];r.forEach(function(a){o.push(a.getComponent())}),s(o)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(r=>{var o=this.rowManager.findRow(r[this.options.index]);i++,o?o.updateData(r).then(()=>{i--,t.push(o.getComponent()),i||s(t)}):this.rowManager.addRows(r).then(a=>{i--,t.push(a[0].getComponent()),i||s(t)})}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let s=this.rowManager.findRow(i,!0);if(s)t.push(s);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,s)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(s)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(s=>s[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(s=>s[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then(n=>n.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);this.initGuard(),s?n?this.columnManager.moveColumn(s,n,i):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((s,n)=>{var r=this.columnManager.findColumn(e);return r?this.columnManager.scrollToColumn(r,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}};b(A,"defaultOptions",ws);let Be=A;var Q=Be;class Is extends Q{static extendModule(){Q.initializeModuleBinder(ue),Q._extendModule(...arguments)}static registerModule(){Q.initializeModuleBinder(ue),Q._registerModule(...arguments)}constructor(e,t,i){super(e,t,ue)}}var Ns=Is;const Xs=Ct({__name:"Tabulator",props:{columns:{},tableData:{}},setup(l){const e=l,t=Ge(null),i=Ge(null);je(()=>e.columns,()=>{i.value?i.value.setColumns(e.columns):s()}),je(()=>e.tableData,()=>{n()}),Et(async()=>{await yt(),s()}),Rt(()=>{i.value&&(i.value.destroy(),i.value=null)});const s=()=>{!t.value||i.value||(i.value=new Ns(t.value,{data:e.tableData??[],reactiveData:!0,columns:e.columns,height:"auto",pagination:!0,paginationSize:6,paginationSizeSelector:[3,6,8,10],movableColumns:!0,paginationCounter:"rows"}))},n=()=>{if(!i.value){s();return}i.value.replaceData(e.tableData??[])};return(r,o)=>(Tt(),xt("div",{ref_key:"table",ref:t},null,512))}});export{Xs as _}; diff --git a/src/main/resources/static/assets/YamlGenerate-CouOuHXH.js b/src/main/resources/static/assets/YamlGenerate-CouOuHXH.js new file mode 100644 index 0000000..ff6e221 --- /dev/null +++ b/src/main/resources/static/assets/YamlGenerate-CouOuHXH.js @@ -0,0 +1 @@ +import{d as B,g as A,h as I,r as f,o as n,c as a,a as e,t as F,f as O,i as G,j as c,l as m,F as D,k as j,m as W,n as K,b as N,p as X}from"./index-B9L3o1bN.js";import{s as J}from"./request-BQy8ZIMN.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; diff --git a/src/main/resources/static/assets/applicationDetailModal-DlYeJQEs.js b/src/main/resources/static/assets/applicationDetailModal-DlYeJQEs.js new file mode 100644 index 0000000..ff39329 --- /dev/null +++ b/src/main/resources/static/assets/applicationDetailModal-DlYeJQEs.js @@ -0,0 +1,6 @@ +var Kt=Object.defineProperty;var Wt=(a,l,g)=>l in a?Kt(a,l,{enumerable:!0,configurable:!0,writable:!0,value:g}):a[l]=g;var At=(a,l,g)=>Wt(a,typeof l!="symbol"?l+"":l,g);import{K as Xt,L as Jt,d as qt,f as Qt,r as w,g as E,i as Zt,x as te,c as d,a as t,F as L,k,m as P,b as ee,u as se,t as o,e as Z,n as S,o as p,J as ae}from"./index-B9L3o1bN.js";import{c as ne}from"./createVueComponent-DGcjOmEh.js";import{M as le}from"./bootstrap.esm-Ceob_0pG.js";import{s as u,g as Rt}from"./request-BQy8ZIMN.js";import{_ as oe}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var re=ne("outline","package","IconPackage",[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]]);function ie(a=globalThis.crypto){const l=a.getRandomValues(new Uint8Array(16));l[6]=l[6]&15|64,l[8]=l[8]&63|128;const g=Array.from(l).map(c=>c.toString(16).padStart(2,"0")).join("");return`${g.slice(0,8)}-${g.slice(8,12)}-${g.slice(12,16)}-${g.slice(16,20)}-${g.slice(20)}`}class C extends Error{constructor(g,c){super(g);At(this,"deploymentStatusUnknown",!0);this.interruptedOperation=c}}class ue extends Error{constructor(l,g,c="FAILED"){super(l),this.deploymentId=g,this.state=c}}async function ce(a,l,g,c,D=()=>!0,R=()=>new Promise(n=>setTimeout(n,2e3)),_=3600,I=()=>{}){var U;let n;try{n=await g()}catch(h){const A=(U=h==null?void 0:h.response)==null?void 0:U.status;if(A===409){let y;try{y=await c()}catch{throw h}throw y.id!==a||y.namespace!==l?new C("Existing operation did not match this target. Check Apps Status."):["SUCCEEDED","FAILED","PARTIAL_SUCCESS","ABANDONED"].includes(y.state)?(I(),new Error("The previous operation finished. Review Apps Status, then click Deploy again if you intend to use the changed settings. No new installation was started.")):y.state==="INTERRUPTED"?new C(y.message,{id:a,namespace:l}):new C("An installation with the previous settings is still active. Check Apps Status before changing settings; no new installation was started.")}if(A&&A>=400&&A<500&&A!==408&&A!==429)throw h}let O=0;for(let h=0;h<_;h++){if(!D())throw new C("Tracking stopped because the form or project changed. Installation may continue; check Apps Status.");if(n){if(n.id!==a||n.namespace!==l)throw new C("Deployment response did not match this operation. Check Apps Status before retrying.");if(n.state==="SUCCEEDED")return I(),{data:{id:n.deploymentId,status:"SUCCESS"}};if(n.state==="FAILED"||n.state==="PARTIAL_SUCCESS"||n.state==="ABANDONED")throw I(),new ue(n.message||"Installation failed. Open Apps Status for details.",n.deploymentId,n.state);if(n.state==="INTERRUPTED")throw new C(n.message,{id:a,namespace:l});if(!["QUEUED","RUNNING"].includes(n.state))throw new C("Unknown deployment state. Check Apps Status before retrying.")}if(await R(),!D())throw new C("Tracking stopped. Closing the dialog does not cancel the installation; check Apps Status.");try{n=await c(),O=0}catch{if(++O>=5)throw new C("Could not retrieve installation status. The operation may still be running. Check Apps Status or retry tracking; do not start a second installation.")}}throw new C("Installation is taking longer than expected. Check Apps Status; no replacement installation was submitted.")}const de=Xt("http://localhost:18084").replace(/\/$/,""),pe=[90,30,7],ge=a=>{const l=String((a==null?void 0:a.detail)||"");return l.includes("No static resource")&&l.includes("/policy-recommendation/analyze")},fa=a=>u.get(`/catalog/software?name=${a}`),Aa=a=>u.get(`/catalog/software/${a}`),Ia=a=>u.get(`/search/dockerhub/${a}`),Ea=a=>u.get(`/search/artifacthub/${a}`);async function _t(a,l,g){const c=Rt(),D="am-deployment:"+JSON.stringify([c["X-MCMP-Workspace-ID"],c["X-MCMP-Project-ID"],l.namespace,a,l.catalogId,a==="VM"?l.mciId:l.clusterName,a==="VM"?l.vmNodeGroupId||[...l.vmIds||[]].sort():null]);let R=sessionStorage.getItem(D);R||(R=ie(),sessionStorage.setItem(D,R));const _=R;return ce(_,l.namespace,async()=>(await u.post(`/applications/deployment-submissions/${a}`,l,{headers:{"Idempotency-Key":_},timeout:3e4})).data,async()=>(await u.get(`/applications/deployment-submissions/${_}`,{params:{namespace:l.namespace},timeout:3e4})).data,g,void 0,void 0,()=>sessionStorage.removeItem(D))}async function Ra(a,l){const g=await u.post(`/applications/deployment-submissions/${a}/close-interrupted`,null,{params:{namespace:l}});for(const c of Object.keys(sessionStorage))c.startsWith("am-deployment:")&&sessionStorage.getItem(c)===a&&sessionStorage.removeItem(c);return g}const _a=(a,l)=>_t("VM",a,l),Ta=a=>u.post("/applications/action",a),Pa=(a,l)=>_t("K8S",a,l),Ca=a=>{const l=a.targetType==="VM"?"/applications/vm/object-storage/smoke-check":"/applications/k8s/object-storage/smoke-check",{targetType:g,...c}=a;return u.post(l,c)},Da=a=>u.get(`/applications/object-storages?namespace=${encodeURIComponent(a)}`),wa=a=>u.get(`/applications/k8s/storage-classes?namespace=${a.namespace}&clusterName=${a.clusterName}`),La=a=>u.get(`/applications/vm/check?namespace=${a.namespace}&mciId=${a.mciName}&vmId=${a.vmName}&catalogId=${a.catalogId}`),ka=a=>u.get(`/applications/k8s/check?namespace=${a.namespace}&clusterName=${a.clusterName}&catalogId=${a.catalogId}`),Ua=a=>u.post("/applications/k8s/ingress/preparations",a),Ma=(a,l)=>u.get(`/applications/k8s/ingress/preparations/${encodeURIComponent(l)}?${new URLSearchParams({namespace:a})}`),xa=a=>u.post("/applications/k8s/ingress/check",a),$a=a=>u.get(`/ape/log/${a}`);function Oa(a){return u.post("/catalog/software",a)}function Ga(a){return u.put(`/catalog/software/${a.id}`,a)}function Fa(a){return u.delete(`/catalog/software/${a}`)}function Ba(a){return u.get("/api/applications/status/groups",{params:a?{namespace:a}:void 0})}function za(a){return u.get(`/api/applications/integrated/catalog/${a}`)}function Va(a){return u.post("/catalog/application/category",a)}function Ha(a){return u.post("/catalog/application/package",a)}function Ya(a){const l={target:a.target,applicationName:a.packageName,availableOnly:a.availableOnly};return u.post("/catalog/application/package/version",l)}function ja(a){return u.get(`/search/dockerhub/tag/${a.path}`)}function Ka(a){return u.get(`/search/artifacthub/version/${a.kind}/${a.repository}/${a.packageName}`)}function Wa(a){return u.post("/catalog/docker/register",a)}function Xa(a){return u.post("/catalog/helm/register",a)}function Ja(a){return u.post("/catalog/rating/overall",a)}function me(a){return u.get(`/api/applications/integrated/deployment/${a}`)}function ve(a,l=14){return u.post(`/api/applications/${a}/operation-profile/analyze?days=${l}`)}async function he(a){var l;try{const c=(await Jt.post(`${de}/api/applications/${a}/policy-recommendation/analyze`,void 0,{headers:Rt()})).data;return(c==null?void 0:c.code)===200?c:ge(c)?It(a):Promise.reject(new Error((c==null?void 0:c.detail)||(c==null?void 0:c.message)||"Failed to analyze policy recommendation"))}catch(g){return((l=g==null?void 0:g.response)==null?void 0:l.status)===404?It(a):Promise.reject(g)}}async function It(a){const l=[];for(const g of pe){const c=await ve(a,g);l.push(c.data)}return{code:200,data:l,detail:null,message:"OK"}}function Et(a,l){const g=l?`?days=${l}`:"";return u.get(`/api/applications/${a}/operation-profile${g}`)}function ye(a){return u.get(`/api/applications/${a}/policy-recommendation`)}function qa(a){return u.get(`/catalog/selectbox/options?type=${a}`)}const Qa=a=>u.get("/applications/k8s/storage-classes/nhn-capability",{params:a}),Za=(a,l)=>u.post("/applications/k8s/storage-classes/nhn",l,{params:a}),tn=a=>u.get("/applications/k8s/nhn-cinder-addon",{params:a}),en=a=>u.post("/applications/k8s/nhn-cinder-addon",null,{params:a}),sn=(a,l)=>u.get("/applications/k8s/nhn-cinder-addon/jobs/"+encodeURIComponent(l),{params:a}),be={PREPARING_RUNTIME:"Initializing",PREPARING_METRICS_SERVER:"Initializing",PREPARING_INGRESS_NGINX:"Initializing",DEPLOYING:"Deploying",INSTALL:"Installing",IN_PROGRESS:"In Progress",PENDING:"Pending",START:"Starting",STARTING:"Starting",RESTART:"Restarting",RESTARTING:"Restarting",RUN:"Running",RUNNING:"Running",SUCCESS:"Running",COMPLETED:"Completed",STOP:"Stopped",STOPPED:"Stopped",UNINSTALL:"Uninstalling",UNINSTALLED:"Uninstalled",NOT_FOUND:"Not Found",UNKNOWN:"Unknown",IMAGE_PULL_ERROR:"Image Pull Error",FAILED:"Failed",ERROR:"Error"},Se=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING"]),Ne=new Set(["RUN","RUNNING","SUCCESS","COMPLETED"]),fe=new Set(["NOT_FOUND","PENDING","UNKNOWN"]),Ae=new Set(["STOP","STOPPED","UNINSTALL","UNINSTALLED"]),Ie=new Set(["FAILED","ERROR","IMAGE_PULL_ERROR"]),Ee=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING","UNINSTALL","UNINSTALLED","FAILED"]),Re=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","INSTALL","IN_PROGRESS","PENDING","START","STARTING","RESTART","RESTARTING","RUN","RUNNING","SUCCESS"]),$=a=>String(a||"").trim().toUpperCase(),_e=a=>{const l=$(a);return l&&(be[l]||a)||"-"},Te=a=>{const l=$(a);return Ne.has(l)?"badge bg-success":Se.has(l)?"badge bg-primary":fe.has(l)?"badge bg-warning":Ae.has(l)?"badge bg-secondary":Ie.has(l)?"badge bg-danger":"badge bg-secondary"},Pe=a=>Ee.has($(a)),an=a=>$(a)!=="FAILED"&&Pe(a),Ce=(a,l)=>a===!0?{label:"Healthy",className:"text-success"}:a===!1?{label:"Unhealthy",className:"text-danger"}:Re.has($(l))?{label:"Checking",className:"text-warning"}:{label:"Unknown",className:"text-muted"},De=["id"],we={class:"modal-dialog modal-xl modal-dialog-centered",role:"document"},Le={class:"modal-content"},ke={class:"modal-body",style:{"max-height":"80vh","overflow-y":"auto"}},Ue={key:0,class:"text-center"},Me={key:1},xe={key:0,class:"alert alert-danger py-2 text-break",role:"alert"},$e={key:0,class:"mb-0"},Oe={class:"mb-4"},Ge={class:"row"},Fe={class:"col-md-2 text-center"},Be=["src","alt"],ze={key:1,class:"application-detail-logo-fallback d-inline-flex align-items-center justify-content-center"},Ve={class:"col-md-10"},He={class:"text-muted"},Ye={class:"row"},je={class:"col-md-3"},Ke={class:"col-md-3"},We={class:"col-md-3"},Xe={class:"col-md-3"},Je={class:"mb-4"},qe={key:0,class:"text-muted small mb-2"},Qe={class:"row"},Ze={class:"col-md-3"},ts={class:"card text-center"},es={class:"card-body"},ss={class:"card-title"},as={class:"col-md-3"},ns={class:"card text-center"},ls={class:"card-body"},os={class:"card-title"},rs={class:"col-md-3"},is={class:"card text-center"},us={class:"card-body"},cs={class:"card-title"},ds={class:"col-md-3"},ps={class:"card text-center"},gs={class:"card-body"},ms={class:"card-title"},vs={class:"mb-4"},hs={class:"d-flex justify-content-between align-items-center mb-2"},ys={class:"text-muted small"},bs={class:"btn-list"},Ss=["disabled"],Ns={key:0,class:"text-center text-muted py-3"},fs={key:1,class:"border rounded p-3"},As={key:0,class:"alert alert-light border text-muted py-2 mb-3"},Is={class:"d-flex justify-content-between flex-wrap gap-2 mb-3"},Es={class:"badge bg-secondary"},Rs={class:"badge bg-info"},_s={class:"table-responsive mb-3"},Ts={class:"table table-sm mb-0"},Ps={key:1,class:"row g-2 mb-3"},Cs={class:"col-md-3"},Ds={class:"col-md-3"},ws={class:"col-md-3"},Ls={class:"col-md-3"},ks={class:"mb-3"},Us={class:"mb-3"},Ms={key:2,class:"mb-3"},xs={class:"policy-evidence-list mb-0"},$s={key:2,class:"text-muted border rounded p-3"},Os={class:"mb-4"},Gs={class:"table-responsive"},Fs={class:"table table-sm"},Bs={key:0},zs={class:"mb-4"},Vs={class:"table-responsive"},Hs={class:"table table-sm"},Ys={key:1},js={class:"mb-4"},Ks={class:"mb-3"},Ws={class:"table-responsive"},Xs={class:"table table-sm"},Js={class:"mb-3"},qs={class:"table-responsive"},Qs={class:"table table-sm"},Zs={class:"mb-3"},ta={class:"table-responsive"},ea={class:"table table-sm"},sa={key:0,class:"mb-3"},aa={class:"table-responsive"},na={class:"table table-sm"},la={key:1,class:"mb-3"},oa={class:"table-responsive"},ra={class:"table table-sm"},ia={key:1,class:"mb-4"},ua={class:"table-responsive"},ca={class:"table table-sm"},da={key:2,class:"text-center text-muted"},pa=qt({__name:"applicationDetailModal",props:{deploymentId:{},modalId:{default:"application-detail-modal"}},emits:["close"],setup(a,{expose:l,emit:g}){const c=a,D=g,R=Qt(),_=w(!1),I=w(!1),n=w(null),O=E(()=>{var s;return["FAILED","PARTIAL_SUCCESS","DELETE_PENDING"].includes((s=n.value)==null?void 0:s.status)}),U=E(()=>{var s;return(((s=n.value)==null?void 0:s.deploymentLogs)||[]).filter(e=>e.logType==="ERROR")}),h=w(null),A=w([]),y=w(null),G=w(!1),tt=[7,30,90],T=w(0);let N=0,v=null,b=null,M=!1,F=!1,j=!0;const K=()=>{T.value=0,n.value=null,h.value=null,A.value=[],y.value=null,G.value=!1,_.value=!1,I.value=!1},et=()=>{M=!0},st=()=>{F&&(b==null||b.hide())},at=()=>{N++},nt=()=>{v==null||v.removeEventListener("show.bs.modal",et),v==null||v.removeEventListener("shown.bs.modal",st),v==null||v.removeEventListener("hide.bs.modal",at),v==null||v.removeEventListener("hidden.bs.modal",lt)},lt=()=>{M=!1,F=!1,K(),j?D("close"):(nt(),b==null||b.dispose(),b=null)};Zt(()=>{v=document.getElementById(c.modalId),v==null||v.addEventListener("show.bs.modal",et),v==null||v.addEventListener("shown.bs.modal",st),v==null||v.addEventListener("hide.bs.modal",at),v==null||v.addEventListener("hidden.bs.modal",lt)}),te(()=>{j=!1,N++,M?H():(nt(),b==null||b.dispose(),b=null)});const Tt={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Pt=s=>String(s||"").trim().toLowerCase(),Ct=s=>Tt[Pt(s)]||"",ot=E(()=>{const s=n.value;return s?ae(Ct(s.catalogName)||s.logoUrlLarge||s.logoUrlSmall||""):""}),rt=s=>{const e=++N;T.value=s,n.value=null,h.value=null,A.value=[],y.value=null,T.value&&(Dt(s,e),it(s,e))};l({open:s=>{!j||!v||!s||(F=!1,b=le.getOrCreateInstance(v),rt(s),b.show())},refreshData:rt,resetData:()=>{N+=1,M?H():K()}});const Dt=async(s,e)=>{if(s){_.value=!0;try{G.value=!1;const{data:i}=await me(s);e===N&&s===T.value&&i&&(n.value=i.integratedInfo)}catch(i){if(e!==N)return;console.error("Failed to load application detail:",i),R.error("Failed to load application detail")}finally{e===N&&(_.value=!1)}}},it=async(s,e)=>{if(s){I.value=!0;try{const i=await Et(s);if(e!==N||s!==T.value)return;h.value=i.data||null;const m=await Promise.all(tt.map(async f=>{try{return(await Et(s,f)).data||null}catch{return null}}));if(e!==N||s!==T.value)return;A.value=m.filter(Boolean);const r=await ye(s);if(e!==N||s!==T.value)return;y.value=r.data||null}catch(i){if(e!==N)return;console.error("Failed to load policy recommendation:",i),h.value=null,A.value=[],y.value=null}finally{e===N&&(I.value=!1)}}},x=s=>{if(!s)return null;const e=new Date(String(s).replace(" ","T"));return Number.isNaN(e.getTime())?null:e},wt=s=>{const e=s instanceof Date?s:x(s);if(!e)return"-";const i=m=>String(m).padStart(2,"0");return`${e.getFullYear()}-${i(e.getMonth()+1)}-${i(e.getDate())} ${i(e.getHours())}:${i(e.getMinutes())}:${i(e.getSeconds())}`},W=s=>String(s||"").trim().toUpperCase(),Lt=new Set(["RUN","RUNNING","SUCCESS"]),kt=new Set(["UNINSTALL","UNINSTALLED","NOT_FOUND","STOP","STOPPED","FAILED","ERROR"]),X=E(()=>{var s,e,i;return W(((s=n.value)==null?void 0:s.applicationStatus)||((e=n.value)==null?void 0:e.podStatus)||((i=n.value)==null?void 0:i.status))}),ut=E(()=>{var s;return Ce((s=n.value)==null?void 0:s.healthCheck,X.value)}),Ut=E(()=>{var i,m;const s=x((i=n.value)==null?void 0:i.executedAt);return(Array.isArray((m=n.value)==null?void 0:m.operationHistories)?n.value.operationHistories:[]).some(r=>{if(W(r==null?void 0:r.operationType)!=="UNINSTALL")return!1;const f=x((r==null?void 0:r.executedAt)||(r==null?void 0:r.createdAt));return!s||!f?!0:f.getTime()>=s.getTime()})}),B=E(()=>Ut.value||kt.has(X.value)?!1:Lt.has(X.value)),J=E(()=>B.value),Mt=E(()=>{var f;const s=x((f=n.value)==null?void 0:f.executedAt);if(!s)return 0;const e=new Date,i=new Date(s.getFullYear(),s.getMonth(),s.getDate()),r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-i.getTime();return Math.max(Math.floor(r/(1e3*60*60*24)),0)}),xt=E(()=>{const s=new Map;return A.value.forEach(e=>{const i=vt(e);typeof i=="number"&&s.set(i,e)}),s}),$t=E(()=>tt.map(s=>{const e=xt.value.get(s)||null,i=Mt.value>=s,m=(e==null?void 0:e.dataStatus)||(i?"PENDING_ANALYSIS":"ACCUMULATING");return{period:s,profile:e,eligible:i,dataStatus:m,dimmed:!i||["INSUFFICIENT_DATA","PENDING_ANALYSIS","ACCUMULATING"].includes(m)}})),Ot=E(()=>{var e,i,m;const s=[(e=y.value)==null?void 0:e.updatedAt,(i=y.value)==null?void 0:i.createdAt,(m=h.value)==null?void 0:m.createdAt,...A.value.map(r=>r==null?void 0:r.createdAt)].map(x).filter(r=>!!r).sort((r,f)=>f.getTime()-r.getTime());return s.length?wt(s[0]):"분석 이력 없음"}),Gt=async()=>{if(T.value){if(!J.value){R.info("현재 실행 중인 배포만 정책 추천을 분석할 수 있습니다.");return}I.value=!0;try{await he(T.value),await it(T.value,N),R.success("Policy recommendation analyzed")}catch(s){console.error("Failed to analyze policy recommendation:",s),R.error("Failed to analyze policy recommendation")}finally{I.value=!1}}},z=s=>Te(s),V=s=>_e(s),Ft=s=>{switch(s==null?void 0:s.toLowerCase()){case"critical":return"badge bg-danger";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";default:return"badge bg-info"}},Bt=s=>{switch(s==null?void 0:s.toLowerCase()){case"info":return"badge bg-info";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";case"debug":return"badge bg-secondary";default:return"badge bg-primary"}},zt=s=>{switch(s){case"CPU_INTENSIVE":return"badge bg-primary";case"MEMORY_INTENSIVE":return"badge bg-purple";case"CPU_MEMORY_INTENSIVE":return"badge bg-warning";case"GENERAL_PURPOSE":return"badge bg-success";default:return"badge bg-secondary"}},q=s=>{switch(s){case"CPU_INTENSIVE":return"CPU 중심";case"MEMORY_INTENSIVE":return"Memory 중심";case"CPU_MEMORY_INTENSIVE":return"CPU/Memory 복합";case"GENERAL_PURPOSE":return"현행/범용";default:return s||"N/A"}},ct=s=>{switch(W(s)){case"UNDER_PROVISIONED":return"용량 부족";case"OVER_PROVISIONED":return"사용률 낮음";case"RIGHT_SIZED":return"적정";default:return s||"N/A"}},dt=s=>{switch(s){case"SUFFICIENT":return"badge bg-success";case"PARTIAL_DATA":return"badge bg-warning";case"INSUFFICIENT_DATA":case"ACCUMULATING":case"PENDING_ANALYSIS":return"badge bg-secondary";default:return"badge bg-secondary"}},pt=s=>{switch(s){case"SUFFICIENT":return"충분";case"PARTIAL_DATA":return"부분 데이터";case"INSUFFICIENT_DATA":case"ACCUMULATING":return"데이터 축적 중";case"PENDING_ANALYSIS":return"분석 대기";default:return s||"N/A"}},Vt=s=>s?s.split(",").map(e=>e.trim()).filter(Boolean):["NO_ACTION"],Ht=s=>{switch(s){case"INCREASE_CPU":return"CPU 정책 검토";case"INCREASE_MEMORY":return"Memory 정책 검토";case"REVIEW_CPU_MEMORY_POLICY":return"CPU/Memory 복합 검토";case"CHANGE_RESOURCE_TYPE":return"운영 유형 검토";case"DOWNSIZE":return"현행/하향 검토";case"INVESTIGATE_STABILITY":return"안정성 점검";case"NO_ACTION":return"현행 유지";default:return s}},gt=s=>{if(s==null)return"N/A";const e=Math.round(s*100);return e>=80?`높음 ${e}%`:e>=60?`보통 ${e}%`:e>=40?`낮음 ${e}%`:`판단 보류 ${e}%`},mt=s=>{if(!s)return[];try{const e=JSON.parse(s);return Array.isArray(e)?e:[]}catch{return s.split(",").map(e=>e.trim()).filter(Boolean)}},Yt=s=>{const e=s.match(/^validDays=(\d+) is below (\d+)$/);if(e)return`유효 분석일이 ${e[1]}일로 최소 기준 ${e[2]}일에 미달합니다.`;const i=s.match(/^cpuPressureP95=([\d.]+)$/);if(i)return`CPU p95 사용률이 ${i[1]}%입니다.`;const m=s.match(/^memoryPressureP95=([\d.]+)$/);if(m)return`Memory p95 사용률이 ${m[1]}%입니다.`;const r=s.match(/^oomCount=(\d+)$/);if(r)return`OOM 이벤트가 ${r[1]}건 발생했습니다.`;const f=s.match(/^restartCount=(\d+), crashLoopCount=(\d+)$/);if(f)return`재시작 이벤트 ${f[1]}건, CrashLoop 이벤트 ${f[2]}건이 확인되었습니다.`;const Y=s.match(/^networkEvidence=maxInBytes=(\d+), maxOutBytes=(\d+)$/);if(Y)return`네트워크 최대 수신 ${Q(Number(Y[1]))}, 최대 송신 ${Q(Number(Y[2]))}가 확인되었습니다.`;const St=s.match(/^errorLogCount=(\d+)$/);if(St)return`ERROR 로그가 ${St[1]}건 확인되었습니다.`;const Nt=s.match(/^oomRelatedLogCount=(\d+)$/);if(Nt)return`OOM 관련 로그가 ${Nt[1]}건 확인되었습니다.`;const ft=s.match(/^networkOrTimeoutLogCount=(\d+)$/);return ft?`네트워크 또는 timeout 관련 로그가 ${ft[1]}건 확인되었습니다.`:s==="cpuPressureP95 and memoryPressureP95 are below 40"?"CPU와 Memory p95 사용률이 모두 40% 미만입니다.":s==="CPU/Memory pressure is within right-sized range"?"CPU와 Memory 사용률이 적정 범위입니다.":s==="K8s percentage metrics require request/limit normalization; confidence capped at 0.60"?"K8s 백분율 지표는 request/limit 기준 정규화가 필요하여 신뢰도가 60%로 제한됩니다.":s},vt=s=>{if(!(s!=null&&s.analysisStartDate)||!(s!=null&&s.analysisEndDate))return"-";const e=new Date(s.analysisStartDate),i=new Date(s.analysisEndDate);return Math.round((i.getTime()-e.getTime())/(1e3*60*60*24))+1},jt=(s,e)=>{const i=vt(s);if(typeof i=="number")return i;const m=(s==null?void 0:s.validDays)??0,r=(s==null?void 0:s.missingDays)??0;return m+r||e||0},ht=(s,e)=>{const i=(s==null?void 0:s.validDays)??0,m=jt(s,e);return m?`${i}일 확보 / ${m}일 기준`:`${i}일 확보`},yt=s=>!B.value||s===null||s===void 0?"-":`${s}%`,bt=s=>B.value?Q(s):"-",Q=s=>{if(s===0)return"0 Bytes";if(!s)return"N/A";const e=1024,i=["Bytes","KB","MB","GB","TB"],m=Math.floor(Math.log(s)/Math.log(e));return parseFloat((s/Math.pow(e,m)).toFixed(2))+" "+i[m]},H=()=>{N++,F=!0,M?b==null||b.hide():K()};return(s,e)=>{var i,m;return p(),d("div",{class:"modal modal-blur fade",id:c.modalId,tabindex:"-1",role:"dialog","aria-hidden":"true"},[t("div",we,[t("div",Le,[t("div",{class:"modal-header"},[e[1]||(e[1]=t("h5",{class:"modal-title"},"Application Detail",-1)),t("button",{type:"button",class:"btn-close","aria-label":"Close",onClick:H})]),t("div",ke,[_.value?(p(),d("div",Ue,e[2]||(e[2]=[t("div",{class:"spinner-border",role:"status"},[t("span",{class:"visually-hidden"},"Loading...")],-1)]))):n.value?(p(),d("div",Me,[O.value?(p(),d("div",xe,[e[3]||(e[3]=t("strong",null,"Deployment failed.",-1)),(p(!0),d(L,null,k(U.value,r=>(p(),d("p",{class:"mb-0",key:r.id},o(r.logMessage),1))),128)),U.value.length?P("",!0):(p(),d("p",$e,"No failure log was recorded for this deployment."))])):P("",!0),t("div",Oe,[e[8]||(e[8]=t("h6",{class:"text-primary"},"Application Overview",-1)),t("div",Ge,[t("div",Fe,[ot.value&&!G.value?(p(),d("img",{key:0,src:ot.value,alt:n.value.catalogName,class:"img-fluid application-detail-logo",onError:e[0]||(e[0]=r=>G.value=!0)},null,40,Be)):(p(),d("div",ze,[ee(se(re),{class:"icon",size:"32","stroke-width":"1.75"})]))]),t("div",Ve,[t("h5",null,o(n.value.catalogName),1),t("p",He,o(n.value.catalogDescription),1),t("div",Ye,[t("div",je,[e[4]||(e[4]=t("strong",null,"Category:",-1)),Z(" "+o(n.value.catalogCategory),1)]),t("div",Ke,[e[5]||(e[5]=t("strong",null,"Default Port:",-1)),Z(" "+o(n.value.defaultPort),1)]),t("div",We,[e[6]||(e[6]=t("strong",{class:"me-2"},"Status:",-1)),t("span",{class:S(z(n.value.applicationStatus))},o(V(n.value.applicationStatus)),3)]),t("div",Xe,[e[7]||(e[7]=t("strong",{class:"me-2"},"Health Check:",-1)),t("span",{class:S(ut.value.className)},o(ut.value.label),3)])])])])]),t("div",Je,[e[13]||(e[13]=t("h6",{class:"text-primary"},"성능 지표",-1)),B.value?P("",!0):(p(),d("div",qe," 현재 실행 중인 상태가 아니므로 최신 성능 지표를 표시하지 않습니다. ")),t("div",Qe,[t("div",Ze,[t("div",ts,[t("div",es,[t("h5",ss,o(yt(n.value.cpuUsage)),1),e[9]||(e[9]=t("p",{class:"card-text"},"CPU 사용률",-1))])])]),t("div",as,[t("div",ns,[t("div",ls,[t("h5",os,o(yt(n.value.memoryUsage)),1),e[10]||(e[10]=t("p",{class:"card-text"},"Memory 사용률",-1))])])]),t("div",rs,[t("div",is,[t("div",us,[t("h5",cs,o(bt(n.value.networkIn)),1),e[11]||(e[11]=t("p",{class:"card-text"},"네트워크 수신",-1))])])]),t("div",ds,[t("div",ps,[t("div",gs,[t("h5",ms,o(bt(n.value.networkOut)),1),e[12]||(e[12]=t("p",{class:"card-text"},"네트워크 송신",-1))])])])])]),t("div",vs,[t("div",hs,[t("div",null,[e[14]||(e[14]=t("h6",{class:"text-primary mb-0"},"정책 추천",-1)),t("div",ys,"최근 분석 시각: "+o(Ot.value),1)]),t("div",bs,[t("button",{type:"button",class:"btn btn-outline-primary",disabled:I.value||!n.value.deploymentId||!J.value,onClick:Gt},o(I.value?"Analyzing...":"Analyze"),9,Ss)])]),I.value?(p(),d("div",Ns,e[15]||(e[15]=[t("div",{class:"spinner-border spinner-border-sm me-2",role:"status"},null,-1),Z(" 정책 추천 정보를 불러오는 중입니다. ")]))):y.value?(p(),d("div",fs,[J.value?P("",!0):(p(),d("div",As," 운영 종료 또는 미확인 상태의 배포는 정책 추천 분석을 실행하지 않습니다. 아래 내용은 마지막으로 저장된 분석 결과입니다. ")),t("div",Is,[t("div",null,[e[16]||(e[16]=t("div",{class:"text-muted small"},"현재 설정 유형",-1)),t("span",Es,o(q(y.value.selectedResourceType)),1)]),t("div",null,[e[17]||(e[17]=t("div",{class:"text-muted small"},"추천 운영 유형",-1)),t("span",{class:S(zt(y.value.recommendedResourceType))},o(q(y.value.recommendedResourceType)),3)]),t("div",null,[e[18]||(e[18]=t("div",{class:"text-muted small"},"정책 차이",-1)),t("span",{class:S(y.value.mismatch?"badge bg-warning":"badge bg-success")},o(y.value.mismatch?"검토 필요":"일치"),3)]),t("div",null,[e[19]||(e[19]=t("div",{class:"text-muted small"},"분석 신뢰도",-1)),t("span",Rs,o(gt(y.value.confidence)),1)])]),t("div",_s,[t("table",Ts,[e[20]||(e[20]=t("thead",null,[t("tr",null,[t("th",null,"분석 기간"),t("th",null,"추천 유형"),t("th",null,"데이터 상태"),t("th",null,"신뢰도"),t("th",null,"분석 데이터")])],-1)),t("tbody",null,[(p(!0),d(L,null,k($t.value,r=>(p(),d("tr",{key:r.period,class:S({"policy-period-muted":r.dimmed})},[t("td",null,o(r.period)+"d",1),t("td",null,o(r.profile?q(r.profile.recommendedResourceType):"-"),1),t("td",null,[t("span",{class:S(dt(r.dataStatus))},o(pt(r.dataStatus)),3)]),t("td",null,o(r.profile?gt(r.profile.confidence):"-"),1),t("td",null,o(ht(r.profile,r.period)),1)],2))),128))])])]),h.value?(p(),d("div",Ps,[t("div",Cs,[e[21]||(e[21]=t("div",{class:"text-muted small"},"데이터 상태",-1)),t("span",{class:S(dt(h.value.dataStatus))},o(pt(h.value.dataStatus)),3)]),t("div",Ds,[e[22]||(e[22]=t("div",{class:"text-muted small"},"CPU 상태",-1)),t("span",null,o(ct(h.value.cpuSizingStatus)),1)]),t("div",ws,[e[23]||(e[23]=t("div",{class:"text-muted small"},"Memory 상태",-1)),t("span",null,o(ct(h.value.memorySizingStatus)),1)]),t("div",Ls,[e[24]||(e[24]=t("div",{class:"text-muted small"},"분석 데이터",-1)),t("span",null,o(ht(h.value)),1)])])):P("",!0),t("div",ks,[e[25]||(e[25]=t("div",{class:"text-muted small"},"검토 항목",-1)),(p(!0),d(L,null,k(Vt(y.value.actions),r=>(p(),d("span",{key:r,class:"badge bg-light text-dark me-1"},o(Ht(r)),1))),128))]),t("p",Us,o(y.value.message),1),h.value&&mt(h.value.reasons).length?(p(),d("div",Ms,[e[26]||(e[26]=t("div",{class:"text-muted small"},"분석 근거",-1)),t("ul",xs,[(p(!0),d(L,null,k(mt(h.value.reasons),r=>(p(),d("li",{key:r},o(Yt(r)),1))),128))])])):P("",!0)])):(p(),d("div",$s," 정책 추천 정보가 없습니다. "))]),t("div",Os,[e[29]||(e[29]=t("h6",{class:"text-primary"},"Action History",-1)),t("div",Gs,[t("table",Fs,[e[28]||(e[28]=t("thead",null,[t("tr",null,[t("th",null,"Action"),t("th",null,"Timestamp"),t("th",null,"User"),t("th",null,"Status"),t("th",null,"Description")])],-1)),t("tbody",null,[n.value.operationHistories.length===0?(p(),d("tr",Bs,e[27]||(e[27]=[t("td",{colspan:"5",class:"text-center text-muted"},"No action history available",-1)]))):P("",!0),(p(!0),d(L,null,k(n.value.operationHistories,r=>(p(),d("tr",{key:r.id},[t("td",null,o(r.operationType),1),t("td",null,o(r.executedAt),1),t("td",null,o(r.executedBy||"system"),1),t("td",null,[t("span",{class:S(z(r.status))},o(V(r.status)),3)]),t("td",null,o(r.detailReason||r.reason),1)]))),128))])])])]),t("div",zs,[e[32]||(e[32]=t("h6",{class:"text-primary"},"Error Logs",-1)),t("div",Vs,[t("table",Hs,[e[31]||(e[31]=t("thead",null,[t("tr",null,[t("th",null,"Timestamp"),t("th",null,"Error Code"),t("th",null,"Severity"),t("th",null,"Module"),t("th",null,"Description")])],-1)),t("tbody",null,[n.value.errorLogs.length>0?(p(!0),d(L,{key:0},k(n.value.errorLogs,r=>(p(),d("tr",{key:r.errorCode},[t("td",null,o(r.loggedAt),1),t("td",null,o(r.errorCode),1),t("td",null,[t("span",{class:S(Ft(r.severity))},o(r.severity),3)]),t("td",null,o(r.module),1),t("td",null,o(r.logMessage),1)]))),128)):(p(),d("tr",Ys,e[30]||(e[30]=[t("td",{colspan:"5",class:"text-center text-muted"},"No error logs available",-1)])))])])])]),t("div",js,[e[43]||(e[43]=t("h6",{class:"text-primary"},"Deployment History",-1)),t("div",Ks,[e[34]||(e[34]=t("h6",null,"Basic Deployment Information",-1)),t("div",Ws,[t("table",Xs,[e[33]||(e[33]=t("thead",null,[t("tr",null,[t("th",null,"ID"),t("th",null,"Action Type"),t("th",null,"Executed At"),t("th",null,"Executed By"),t("th",null,"Status")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,o(n.value.deploymentId),1),t("td",null,o(n.value.actionType),1),t("td",null,o(n.value.executedAt),1),t("td",null,o(n.value.executedBy||"system"),1),t("td",null,[t("span",{class:S(z(n.value.status))},o(V(n.value.status)),3)])])])])])]),t("div",Js,[e[36]||(e[36]=t("h6",null,"Cloud & Cluster Information",-1)),t("div",qs,[t("table",Qs,[e[35]||(e[35]=t("thead",null,[t("tr",null,[t("th",null,"Cloud Provider"),t("th",null,"Cloud Region"),t("th",null,"Cluster Name"),t("th",null,"Deployment Type"),t("th",null,"MCI ID"),t("th",null,"UID")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,o(n.value.cloudProvider),1),t("td",null,o(n.value.cloudRegion),1),t("td",null,o(n.value.clusterName||"N/A"),1),t("td",null,o(n.value.deploymentType),1),t("td",null,o(n.value.mciId),1),t("td",null,o(n.value.vmId),1)])])])])]),t("div",Zs,[e[38]||(e[38]=t("h6",null,"Network & Service Information",-1)),t("div",ta,[t("table",ea,[e[37]||(e[37]=t("thead",null,[t("tr",null,[t("th",null,"Namespace"),t("th",null,"Pod Status"),t("th",null,"Public IP"),t("th",null,"Service Port"),t("th",null,"VM ID"),t("th",null,"Catalog ID")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,o(n.value.namespace),1),t("td",null,[t("span",{class:S(z(n.value.podStatus||n.value.applicationStatus))},o(V(n.value.podStatus||n.value.applicationStatus)),3)]),t("td",null,o(n.value.publicIp),1),t("td",null,o(n.value.servicePort||n.value.defaultPort),1),t("td",null,o(n.value.vmId),1),t("td",null,o(n.value.catalogName),1)])])])])]),n.value.deploymentType==="K8S"?(p(),d("div",sa,[e[40]||(e[40]=t("h6",null,"Deployment Options",-1)),t("div",aa,[t("table",na,[e[39]||(e[39]=t("thead",null,[t("tr",null,[t("th",null,"Resource Type"),t("th",null,"HPA"),t("th",null,"Rebalancing"),t("th",null,"Min Replicas"),t("th",null,"Max Replicas"),t("th",null,"CPU Threshold"),t("th",null,"Memory Threshold")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,o(n.value.resourceType||"N/A"),1),t("td",null,[t("span",{class:S(n.value.hpaEnabled?"text-success":"text-muted")},o(n.value.hpaEnabled?"Enabled":"Disabled"),3)]),t("td",null,[t("span",{class:S(n.value.workloadRebalancingEnabled?"text-success":"text-muted")},o(n.value.workloadRebalancingEnabled?"Enabled":"Disabled"),3)]),t("td",null,o(n.value.minReplicas||"N/A"),1),t("td",null,o(n.value.maxReplicas||"N/A"),1),t("td",null,o(n.value.cpuThreshold?`${n.value.cpuThreshold}%`:"N/A"),1),t("td",null,o(n.value.memoryThreshold?`${n.value.memoryThreshold}%`:"N/A"),1)])])])])])):P("",!0),n.value.ingressEnabled?(p(),d("div",la,[e[42]||(e[42]=t("h6",null,"Ingress Information",-1)),t("div",oa,[t("table",ra,[e[41]||(e[41]=t("thead",null,[t("tr",null,[t("th",null,"Enabled"),t("th",null,"Host"),t("th",null,"Access Port"),t("th",null,"Public IP (Worker / IBM Load Balancer)"),t("th",null,"Path"),t("th",null,"Class"),t("th",null,"TLS Enabled"),t("th",null,"TLS Secret")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,[t("span",{class:S(n.value.ingressEnabled?"text-success":"text-danger")},o(n.value.ingressEnabled?"Yes":"No"),3)]),t("td",null,o(n.value.ingressHost||"N/A"),1),t("td",null,o(((i=n.value.ingressAccessPorts)==null?void 0:i.join(", "))||"-"),1),t("td",null,o(((m=n.value.ingressPublicIps)==null?void 0:m.join(", "))||"-"),1),t("td",null,o(n.value.ingressPath||"N/A"),1),t("td",null,o(n.value.ingressClass||"N/A"),1),t("td",null,[t("span",{class:S(n.value.ingressTlsEnabled?"text-success":"text-danger")},o(n.value.ingressTlsEnabled?"Yes":"No"),3)]),t("td",null,o(n.value.ingressTlsSecret||"N/A"),1)])])])])])):P("",!0)]),n.value.deploymentLogs&&n.value.deploymentLogs.length>0?(p(),d("div",ia,[e[45]||(e[45]=t("h6",{class:"text-primary"},"Deployment Logs",-1)),t("div",ua,[t("table",ca,[e[44]||(e[44]=t("thead",null,[t("tr",null,[t("th",null,"Timestamp"),t("th",null,"Type"),t("th",null,"Message")])],-1)),t("tbody",null,[(p(!0),d(L,null,k(n.value.deploymentLogs,r=>(p(),d("tr",{key:r.id},[t("td",null,o(r.loggedAt),1),t("td",null,[t("span",{class:S(["me-4 mt-2",Bt(r.logType)])},o(r.logType),3)]),t("td",null,o(r.logMessage),1)]))),128))])])])])):P("",!0)])):(p(),d("div",da," No data available "))]),t("div",{class:"modal-footer"},[t("button",{type:"button",class:"btn btn-secondary",onClick:H},"Close")])])])],8,De)}}}),nn=oe(pa,[["__scopeId","data-v-ffd54526"]]);export{nn as A,tn as B,Ra as C,Da as D,en as E,sn as F,Za as G,_a as H,re as I,Ua as J,Ma as K,Pa as L,ue as M,xa as N,La as O,ka as P,Ca as Q,Ea as a,ja as b,Ka as c,Oa as d,Aa as e,Ha as f,Va as g,Ya as h,Wa as i,Xa as j,za as k,_e as l,Fa as m,fa as n,Te as o,qa as p,Ja as q,Ta as r,Ia as s,Ba as t,Ga as u,an as v,Pe as w,$a as x,wa as y,Qa as z}; diff --git a/src/main/resources/static/assets/applicationDetailModal-pbHnfNb7.css b/src/main/resources/static/assets/applicationDetailModal-pbHnfNb7.css new file mode 100644 index 0000000..0ee10ce --- /dev/null +++ b/src/main/resources/static/assets/applicationDetailModal-pbHnfNb7.css @@ -0,0 +1 @@ +.table th[data-v-ffd54526]{font-weight:600;background-color:#f8f9fa}.table-responsive[data-v-ffd54526]{border-radius:6px;border:1px solid #dee2e6}.badge[data-v-ffd54526]{font-size:.75rem}h6[data-v-ffd54526]{color:#495057;font-weight:600;margin-bottom:.75rem}.text-primary[data-v-ffd54526]{color:#0d6efd!important}.card[data-v-ffd54526]{border:1px solid #dee2e6;border-radius:8px;margin-bottom:1rem}.card-body[data-v-ffd54526]{padding:1rem}.card-title[data-v-ffd54526]{font-size:1.5rem;font-weight:600;margin-bottom:.5rem}.card-text[data-v-ffd54526]{color:#6c757d;font-size:.875rem;margin-bottom:0}.img-fluid[data-v-ffd54526]{border-radius:8px}.application-detail-logo[data-v-ffd54526],.application-detail-logo-fallback[data-v-ffd54526]{width:80px;height:80px}.application-detail-logo[data-v-ffd54526]{object-fit:contain}.application-detail-logo-fallback[data-v-ffd54526]{border:1px solid #dee2e6;border-radius:8px;color:#6c757d;background-color:#f8f9fa}.row[data-v-ffd54526]{margin-bottom:1rem}.col-md-3 strong[data-v-ffd54526],.col-md-10 strong[data-v-ffd54526]{color:#495057}.policy-evidence-list[data-v-ffd54526]{padding-left:1rem;color:#495057;font-size:.8125rem}.policy-period-muted[data-v-ffd54526]{color:#6c757d;opacity:.62}.policy-period-muted .badge[data-v-ffd54526]{opacity:.82} diff --git a/src/main/resources/static/assets/applicationInstallationForm-COPNLilm.css b/src/main/resources/static/assets/applicationInstallationForm-COPNLilm.css new file mode 100644 index 0000000..f7892ff --- /dev/null +++ b/src/main/resources/static/assets/applicationInstallationForm-COPNLilm.css @@ -0,0 +1 @@ +.install-embedded[data-v-e11fd169]{width:100%}.install-embedded-dialog[data-v-e11fd169]{width:100%;max-width:960px;margin:0 auto}.install-embedded-body[data-v-e11fd169]{overflow-y:visible}.w-80-per[data-v-e11fd169]{width:80%!important}.w-90-per[data-v-e11fd169]{width:90%!important} diff --git a/src/main/resources/static/assets/applicationInstallationForm-CmPX1mlj.js b/src/main/resources/static/assets/applicationInstallationForm-CmPX1mlj.js new file mode 100644 index 0000000..c119002 --- /dev/null +++ b/src/main/resources/static/assets/applicationInstallationForm-CmPX1mlj.js @@ -0,0 +1 @@ +import{d as el,f as tl,q as al,I as ll,g as k,r as m,x as sl,h as ve,i as nl,c as s,a,n as we,t as f,m as b,C as ol,e as ge,j as y,y as rl,F as x,k as L,v as J,z as Ct,l as U,A as ye,b as ul,o as n,u as ma}from"./index-B9L3o1bN.js";import{M as Yt}from"./bootstrap.esm-Ceob_0pG.js";import{_ as Te}from"./lodash-PecLoxXt.js";import{s as St}from"./request-BQy8ZIMN.js";import{n as il,y as dl,z as cl,B as vl,A as pl,C as ml,D as fl,E as bl,F as gl,G as yl,H as hl,r as fa,J as Il,K as kl,L as Cl,M as Sl,N as wl,O as El,P as Nl,Q as Vl}from"./applicationDetailModal-DlYeJQEs.js";import{_ as Al}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ba=["targetType","requestId","mciId","infraId","vmId","nodeId","nodeGroupId","clusterId"],Tl=["namespace","namespaceId"],ga=200,Rl=/[/?#]/,Pl=d=>Rl.test(d)||Array.from(d).some(h=>{const i=h.charCodeAt(0);return i<=31||i===127}),Ml=(d,h)=>{const i=d.getAll(h);return i.length>1?{ok:!1,error:`Query parameter "${h}" must be provided only once.`}:{ok:!0,value:String(i[0]||"").trim()}},ya=(d,h,i,g)=>d.has(i)&&d.has(g)&&h[i]!==h[g]?{ok:!1,error:`${i} and ${g} must have the same value when both are supplied.`}:{ok:!0,value:h[i]||h[g]},Ke=(d,h,i=!1)=>h?h.length>ga?`${d} must be ${ga} characters or fewer.`:Pl(h)?`${d} contains unsupported path characters.`:"":i?`${d} is required.`:"",wr=(d,h=()=>`am-install-${Date.now()}`)=>{const i=typeof d=="string"?new URLSearchParams(d.startsWith("?")?d.slice(1):d):d;for(const $ of Tl)if(i.has($))return{ok:!1,error:`${$} must not be supplied in the URL. Namespace comes from the selected Project context.`};for(const $ of i.keys())if(!ba.includes($))return{ok:!1,error:`Unsupported query parameter "${$}".`};const g={};for(const $ of ba){const Ze=Ml(i,$);if(!Ze.ok)return Ze;g[$]=Ze.value}const C=ya(i,g,"mciId","infraId");if(!C.ok)return C;const p=ya(i,g,"vmId","nodeId");if(!p.ok)return p;const A=g.targetType.toUpperCase(),r=A==="NODE"?"VM":A;if(r!=="VM"&&r!=="K8S")return{ok:!1,error:"targetType must be VM, NODE or K8S."};const P=g.requestId||h(),E=[Ke("requestId",P,!0),Ke("mciId",C.value),Ke("vmId",p.value),Ke("nodeGroupId",g.nodeGroupId),Ke("clusterId",g.clusterId)].filter(Boolean);if(E.length>0)return{ok:!1,error:E[0]};if(r==="VM"){const $=[Ke("mciId or infraId",C.value,!0)].filter(Boolean);if($.length>0)return{ok:!1,error:$[0]};if(!p.value&&!g.nodeGroupId)return{ok:!1,error:"vmId, nodeId or nodeGroupId is required."};if(g.clusterId)return{ok:!1,error:"clusterId cannot be used with a VM target."}}if(r==="K8S"){const $=Ke("clusterId",g.clusterId,!0);if($)return{ok:!1,error:$};if(C.value||p.value)return{ok:!1,error:"mciId/infraId and vmId/nodeId cannot be used with a K8S target."};if(g.nodeGroupId)return{ok:!1,error:"nodeGroupId cannot be used with a K8S target."}}return{ok:!0,target:{requestId:P,targetType:r,mciId:C.value,vmId:p.value,nodeGroupId:g.nodeGroupId,clusterId:g.clusterId}}},ha=d=>String((d==null?void 0:d.id)||(d==null?void 0:d.name)||"").trim(),xl=(d,h)=>{const i=String(h||"").trim().toLowerCase();return[d==null?void 0:d.id,d==null?void 0:d.name].map(g=>String(g||"").trim().toLowerCase()).filter(Boolean).includes(i)},Ul=(d,h)=>{const i=Array.isArray(d)?d:[],g=String((h==null?void 0:h.vmId)||"").trim(),C=String((h==null?void 0:h.nodeGroupId)||"").trim();if(g){const r=i.find(P=>xl(P,g));return r?C&&String(r.subGroupId||"").trim()!==C?{ok:!1,error:`VM "${g}" does not belong to NodeGroup "${C}".`}:{ok:!0,mode:"VM",vm:r,vmId:ha(r),nodeGroupId:C}:{ok:!1,error:`VM "${g}" was not found.`}}const p=i.filter(r=>String((r==null?void 0:r.subGroupId)||"").trim()===C);if(p.length===0)return{ok:!1,error:`NodeGroup "${C}" was not found.`};const A=Array.from(new Set(p.filter(r=>String((r==null?void 0:r.status)||"").trim().toUpperCase()==="RUNNING").map(ha).filter(Boolean)));return A.length===0?{ok:!1,error:`NodeGroup "${C}" has no running VMs.`}:{ok:!0,mode:"NODE_GROUP",members:p,runningVmIds:A,nodeGroupId:C}};function ka(d){const h=d.filter(g=>{var C;return g.name==="Nginx"&&((C=g.packageInfo)==null?void 0:C.packageName)==="nginx"&&!g.helmChart}),i=d.filter(g=>{var C,p,A;return g.name==="Nginx for Kubernetes"&&!g.packageInfo&&((C=g.helmChart)==null?void 0:C.chartName)==="nginx"&&((A=(p=g.helmChart)==null?void 0:p.chartRepositoryUrl)==null?void 0:A.replace(/\/$/,""))==="https://cloudpirates-io.github.io/helm-charts"});return h.length===1&&i.length===1?{vm:h[0],k8s:i[0]}:null}function Ia(d,h){const i=ka(h);return i&&d.id===i.k8s.id?i.vm.name:d.name}function Er(d){const h=ka(d);return d.filter(i=>!h||i.id!==h.k8s.id).map(i=>{const g=h&&i.id===h.vm.id?[h.vm,h.k8s]:[i],C=g.reduce((p,A)=>p+Number(A.ratingCount||0),0);return{...i,catalogMembers:g,deploymentCatalogIds:g.map(p=>p.id),downloadCount:g.reduce((p,A)=>p+Number(A.downloadCount||0),0),ratingCount:C,averageRating:C?g.reduce((p,A)=>p+Number(A.averageRating||0)*Number(A.ratingCount||0),0)/C:0}})}async function Nr(d,h){const i=await Promise.all([...new Set(d)].map(h));return{deploymentHistories:i.flatMap(g=>{var C;return((C=g.data)==null?void 0:C.deploymentHistories)||[]}),applicationStatuses:i.flatMap(g=>{var C;return((C=g.data)==null?void 0:C.applicationStatuses)||[]})}}const _l=()=>St.get("/cbtumblebug/ns"),jl=d=>St.get(`/cbtumblebug/ns/${d}/infra`),Ol=d=>St.get(`/cbtumblebug/ns/${d.nsId}/infra/${d.mciId}`),Dl=d=>St.get(`/cbtumblebug/ns/${d}/k8scluster`);async function Ll(d,h,i,g,C,p=()=>new Promise(r=>setTimeout(r,3e3)),A=1200){let r=d;const P=d==null?void 0:d.id;for(let E=0;E<=A;E++){if(!C())throw new Error("The form or Project changed. Refresh Cinder status on the selected cluster.");if(!P||(r==null?void 0:r.id)!==P||r.namespace!==h.namespace||r.clusterName!==h.clusterName)throw new Error("Cinder preparation returned a different target. Refresh the selected cluster.");if(g(r.message||"Preparing Cinder CSI…"),r.state==="READY")return;if(r.state==="FAILED")throw new Error(r.message||"Cinder preparation failed.");if(!["QUEUED","RUNNING"].includes(r.state))throw new Error("Unknown Cinder preparation state.");if(E===A)break;if(await p(),!C())throw new Error("The form or Project changed. Refresh Cinder status on the selected cluster.");r=await i(P)}throw new Error("Cinder verification is taking longer than expected. Refresh status before retrying.")}function Gl(d){var C,p;const i=(p=String(((C=d==null?void 0:d.packageInfo)==null?void 0:C.packageName)||"").trim().toLowerCase().split("/").pop())==null?void 0:p.split(/[:@]/)[0];if(i!=="redis"&&i!=="elasticsearch")return!1;const g=String((d==null?void 0:d.name)||"").trim().toLowerCase();return new RegExp(`(^|[^a-z0-9])${i}([^a-z0-9]|$)`).test(g)&&!(i==="redis"&&g.includes("elasticsearch"))}async function Kl(d,h,i,g,C,p=()=>new Promise(r=>setTimeout(r,3e3)),A=3e3){let r=d;const P=d==null?void 0:d.id;for(let E=0;E<=A;E++){if(!C())throw new Error("The form or Project changed. Preparation may continue, but no application will be deployed from this request.");if(!P||(r==null?void 0:r.id)!==P||r.namespace!==h.namespace||r.clusterName!==h.clusterName)throw new Error("Ingress preparation returned a different target. Deployment stopped.");if(g(r.message||"Preparing IBM Ingress and HTTPS…"),r.state==="READY")return;if(r.state==="FAILED")throw new Error(r.message||"Ingress preparation failed.");if(!["QUEUED","RUNNING"].includes(r.state))throw new Error("Unknown Ingress preparation state.");if(E===A)break;if(await p(),!C())throw new Error("The form or Project changed. Check the existing preparation before retrying Deploy.");r=await i(P)}throw new Error("Ingress preparation is taking longer than expected. Check cluster status before retrying; no application was deployed.")}const Bl=["id","tabindex"],$l={class:"modal-content"},Fl={class:"modal-header"},Hl={class:"modal-title"},ql={key:0,class:"alert alert-success mb-0",role:"status"},zl={key:1,class:"alert alert-warning",role:"status"},Yl=["disabled"],Jl={class:"mb-2 text-break"},Wl=["disabled"],Ql={key:0,class:"alert alert-info py-2",role:"status"},Xl={key:1,class:"alert alert-warning py-2",role:"alert"},Zl={key:2,class:"alert alert-secondary py-2",role:"status"},es={class:"mb-3"},ts={key:0,class:"text-muted"},as={key:1,class:"text-muted"},ls=["disabled"],ss=["value"],ns={class:"mb-3"},os={key:0,class:"text-muted"},rs={key:1,class:"text-muted"},us=["disabled"],is=["value"],ds={key:3,class:"form-select",id:"vm-namespace-empty",disabled:""},cs={class:"mb-3"},vs={key:0,class:"text-muted"},ps={key:1,class:"text-muted"},ms=["disabled"],fs={key:0,value:""},bs=["value","title"],gs={key:0,class:"mb-3"},ys={class:"d-flex gap-3"},hs={class:"form-check"},Is={class:"form-check"},ks={key:1,class:"mb-3"},Cs=["disabled"],Ss=["value"],ws={key:0,class:"mt-2",style:{display:"flex",gap:"10px","flex-wrap":"wrap"}},Es=["onClick"],Ns={key:2,class:"mb-3"},Vs=["disabled"],As=["value","disabled"],Ts={key:0,class:"mt-2"},Rs={class:"d-flex gap-2 flex-wrap"},Ps={key:1,class:"text-warning mt-2"},Ms={key:3,class:"mb-3"},xs={style:{display:"flex",gap:"10px"}},Us={class:"form-check"},_s=["disabled"],js={key:0,class:"form-check"},Os=["disabled"],Ds={key:0,class:"form-text"},Ls={key:4,class:"mb-3"},Gs={class:"mb-3"},Ks=["value"],Bs={class:"mb-3"},$s={key:5,class:"mb-3"},Fs={key:0,class:"mt-2"},Hs={key:6,class:"mb-3"},qs={key:7,class:"mb-3"},zs={class:"form-check mb-2"},Ys=["disabled"],Js={key:0},Ws={class:"d-flex align-items-center justify-content-between mb-2"},Qs=["disabled"],Xs={key:0,class:"text-muted"},Zs={key:1,class:"alert alert-danger py-2"},en={key:2,class:"alert alert-warning py-2"},tn={key:3,class:"border rounded p-2"},an=["id","value","disabled"],ln=["for"],sn={class:"text-muted"},nn={class:"d-flex justify-content-between mt-2"},on={class:"w-50 me-2"},rn={class:"w-50 ms-2"},un={class:"mt-2"},dn={class:"text-muted mt-1 mb-0"},cn={class:"mb-0 ps-3"},vn={class:"mb-3"},pn={key:0,class:"text-muted"},mn={key:1,class:"text-muted"},fn=["disabled"],bn=["value"],gn={key:3,class:"form-select",id:"k8s-namespace-empty",disabled:""},yn={class:"mb-3"},hn={key:0,class:"text-muted"},In={key:1,class:"text-muted"},kn=["disabled"],Cn={key:0,value:""},Sn=["value"],wn={class:"mb-3"},En=["value"],Nn={key:0,class:"mb-3"},Vn=["disabled"],An={key:1,class:"mb-3"},Tn={key:2,class:"mb-3"},Rn=["disabled"],Pn={value:"",disabled:""},Mn=["value"],xn={key:0,class:"text-danger mt-1 mb-0"},Un=["disabled"],_n={key:1,class:"text-danger mt-2",role:"alert"},jn={key:2,class:"border rounded p-2 mt-2"},On={role:"status",class:"mb-2"},Dn={class:"mb-2"},Ln={key:1,class:"mt-2"},Gn={class:"text-muted mb-2",role:"status"},Kn=["disabled"],Bn={key:1,class:"text-muted mt-1 mb-0"},$n={key:0},Fn=["disabled"],Hn=["disabled"],qn=["disabled"],zn={key:3,class:"mt-2"},Yn={class:"form-label"},Jn=["min"],Wn={class:"text-muted"},Qn={key:0,class:"text-muted"},Xn={key:3,class:"mb-3"},Zn={key:0,class:"form-check mt-2"},eo={key:1,class:"text-muted mt-1"},to={key:2,class:"text-muted mt-1"},ao={key:4,class:"mb-3"},lo={class:"mb-2"},so={class:"form-check"},no=["disabled"],oo={key:0,class:"d-flex justify-content-between"},ro={key:5,class:"mb-3"},uo={class:"mb-2"},io={class:"form-check"},co=["disabled"],vo={key:6,class:"mb-3"},po={class:"mb-2"},mo={class:"form-check"},fo=["disabled"],bo={key:0,class:"text-muted"},go={key:0},yo={class:"mb-2"},ho={key:0,class:"text-muted mb-1"},Io={class:"mb-2"},ko={class:"mb-2"},Co=["value"],So={key:7,class:"mb-3"},wo={class:"form-check mb-2"},Eo=["disabled"],No={key:0},Vo={class:"d-flex align-items-center justify-content-between mb-2"},Ao=["disabled"],To={key:0,class:"text-muted"},Ro={key:1,class:"alert alert-danger py-2"},Po={key:2,class:"alert alert-warning py-2"},Mo={key:3,class:"border rounded p-2"},xo=["id","value","disabled"],Uo=["for"],_o={class:"text-muted"},jo={class:"d-flex justify-content-between mt-2"},Oo={class:"w-50 me-2"},Do={class:"w-50 ms-2"},Lo={class:"mt-2"},Go={class:"mb-0 ps-3"},Ko={key:8,class:"mb-3"},Bo={class:"mb-2"},$o={class:"form-check"},Fo=["disabled"],Ho={key:0},qo={class:"d-flex justify-content-between"},zo={class:"w-50 me-2"},Yo=["value"],Jo={class:"mt-2 mb-2"},Wo=["placeholder"],Qo={class:"d-flex justify-content-between"},Xo={class:"w-50 me-2"},Zo=["placeholder"],er={class:"w-50 ms-2"},tr={class:"d-flex justify-content-between mt-2"},ar={class:"w-50 me-2"},lr={class:"w-50 ms-2"},sr={class:"d-flex gap-4 mt-3"},nr={class:"form-check"},or={class:"mb-0 ps-3"},rr={key:0,class:"px-3",role:"status"},ur={key:1,class:"px-3","aria-live":"polite"},ir={class:"modal-footer d-flex justify-content-between"},dr=["data-bs-dismiss"],cr={key:1},vr=["disabled"],pr=["disabled"],mr=["disabled"],fr="object-storage",br="storage-class",gr=el({__name:"applicationInstallationForm",props:{nsId:{default:""},title:{default:"Application Installation"},embedded:{type:Boolean,default:!1},formId:{default:"install-form"},targetType:{default:""},targetMciId:{default:""},targetVmId:{default:""},targetNodeGroupId:{default:""},targetClusterId:{default:""}},emits:["ready","deployment-event","cancel"],setup(d,{emit:h}){const i=tl(),g=al(),C=ll(),p=d,A=h,r=k(()=>p.title),P=k(()=>String(p.targetType||"").toUpperCase()),E=k(()=>p.embedded&&["VM","K8S"].includes(P.value)),$=k(()=>E.value&&P.value==="VM"&&!!String(p.targetNodeGroupId||"").trim()&&!String(p.targetVmId||"").trim()),Ze=k(()=>{if(P.value!=="VM")return`Kubernetes cluster ${p.targetClusterId}`;if($.value)return`NodeGroup ${p.targetNodeGroupId} in ${p.targetMciId}`;const t=String(p.targetNodeGroupId||"").trim();return t?`VM ${p.targetVmId} in NodeGroup ${t} / ${p.targetMciId}`:`VM ${p.targetVmId} in ${p.targetMciId}`}),wt=t=>(Array.isArray(t)?t:[t]).flatMap(o=>typeof o=="string"?o.split(","):[o]).map(o=>String((o==null?void 0:o.id)||(o==null?void 0:o.name)||o||"").trim()).filter(Boolean),Re=(...t)=>{for(const e of t){const o=wt(e);if(o.length>0)return o[0]}return""},H=k(()=>g.projectInfo||{}),nt=k(()=>g.workspaceInfo||{}),Be=k(()=>Re(H.value.ns_id,H.value.nsId)),ot=k(()=>wt(H.value.mci_ids??H.value.mciIds??H.value.mci_id??H.value.mciId)),rt=k(()=>wt(H.value.cluster_ids??H.value.clusterIds??H.value.cluster_id??H.value.clusterId)),Et=k(()=>!!Re(H.value.id,H.value.name,Be.value)),Jt=k(()=>Et.value&&!!Be.value),Wt=k(()=>{const t=Re(nt.value.name,nt.value.id),e=Re(H.value.name,H.value.id);return[t,e].filter(Boolean).join(" / ")||"the selected project"}),$e=k(()=>JSON.stringify([Re(nt.value.id,nt.value.name),Re(H.value.id,H.value.name),Be.value,ot.value,rt.value])),Nt=m([]),Pe=m([]),Ee=m([]),X=m([]),Z=m([]),Me=m([]),I=m(""),S=m(""),G=m(""),W=m(""),T=m([]),D=m("VM"),K=m(""),_=m("Standalone"),R=m({}),Fe=m(!1),N=m({}),v=m({}),j=m(null),et=m(!1),he=m([]),xe=m(!1),He=m(!1),tt=m(null),Vt=m(!1),Ca=async()=>{const t=tt.value;if(!(!t||!confirm("Check Apps Status and confirm that no installation is still running before closing this interrupted tracking record. This does not cancel or uninstall an application. Continue?"))){Vt.value=!0;try{await ml(t.id,t.namespace),tt.value=null,i.warning("Interrupted tracking closed. The application itself was not changed.")}catch{i.error("Could not close interrupted tracking. Reload its status before retrying.")}finally{Vt.value=!1}}},Ie=m(!1),le=m(!1),oe=m(null),Qt=m(0),Xt=m(null),Zt=p.formId+"-failure-detail";let At=!1;const Sa=async()=>{var u,w;const t=(u=oe.value)==null?void 0:u.deploymentId;if(!t)return;const e=document.getElementById(p.formId),o=document.getElementById(Zt);if(!o)return;const c=!p.embedded&&(e==null?void 0:e.classList.contains("show"));c&&e&&await new Promise(Y=>{e.addEventListener("hidden.bs.modal",()=>Y(),{once:!0}),Yt.getOrCreateInstance(e).hide()}),Qt.value=t,o.addEventListener("hidden.bs.modal",()=>{c&&e&&ut&&(At=!0,Yt.getOrCreateInstance(e).show())},{once:!0}),(w=Xt.value)==null||w.open(t)};let Ue=0,ut=!0;const ea=()=>{Ue++};sl(()=>{var t;ut=!1,(t=document.getElementById(p.formId))==null||t.removeEventListener("hide.bs.modal",ea)});const _e=m("GENERAL_PURPOSE"),pe=m([]),ee=m(""),ke=m(!1),Ne=m(!1),it=m(""),q=m(null),re=m(""),Ce=m(!1),Ve=m(null),je=m(!1),me=m(!1),dt=m(""),ct=m("mcmp-nhn-notebooks"),Tt=m("General HDD"),te=m(10);let z=0;const vt=t=>{var e,o;return String(((o=(e=t==null?void 0:t.response)==null?void 0:e.data)==null?void 0:o.detail)||(t==null?void 0:t.message)||"Storage API request failed. Check cluster connectivity and permissions.")},Oe=k(()=>{var t;return Number(((t=pe.value.find(e=>e.name===ee.value))==null?void 0:t.minimumSizeGi)||1)});ve(ee,()=>{te.value=Math.max(te.value,Oe.value)}),ve(te,()=>{de()});const Se=m([]),M=m(""),fe=m(""),ue=m(""),De=m("PRIVATE"),Q=m(""),Rt=m(!0),ie=m(!0),Le=m(!1),qe=m([]),at=m([]);let Ae=0;const ae=m(0),V=m("");let F=0;const ze=t=>(t==null?void 0:t.id)||(t==null?void 0:t.name)||"",ta=t=>(t==null?void 0:t.id)||(t==null?void 0:t.name)||"",lt=t=>(t==null?void 0:t.id)||(t==null?void 0:t.name)||"",pt=t=>(t==null?void 0:t.name)||(t==null?void 0:t.id)||"",wa=t=>String((t==null?void 0:t.status)||"").trim().toUpperCase()==="RUNNING",Pt=k(()=>{const t=new Map;for(const e of Z.value){const o=String((e==null?void 0:e.subGroupId)||"").trim();if(!o)continue;const c=t.get(o)||{id:o,totalVmCount:0,runningVmIds:[]};c.totalVmCount+=1;const u=lt(e);wa(e)&&u&&!c.runningVmIds.includes(u)&&c.runningVmIds.push(u),t.set(o,c)}return Array.from(t.values()).sort((e,o)=>e.id.localeCompare(o.id))}),Mt=k(()=>{var t;return((t=Pt.value.find(e=>e.id===K.value))==null?void 0:t.runningVmIds)||[]}),Ye=(t,e)=>{if(e.length===0)return!0;const o=[t==null?void 0:t.id,t==null?void 0:t.name,t==null?void 0:t.uid].map(u=>String(u||"").trim().toLowerCase()).filter(Boolean),c=e.map(u=>u.toLowerCase());return o.some(u=>c.includes(u))},aa=()=>{Pe.value=[],Ee.value=[],X.value=[],Z.value=[],Se.value=[],he.value=[],He.value=!1,S.value="",G.value="",W.value="",T.value=[],K.value="",M.value="",V.value=""};ve([I,S,M,G,T,D,K,ae,ee,N,Q,$e,r],()=>{de()},{deep:!0,flush:"sync"}),ve(I,async t=>{Te.isEmpty(S.value)||(t==="VM"?(D.value="VM",G.value="",W.value="",T.value=[],K.value="",X.value=[],Z.value=[],await xt()):t==="K8S"&&(M.value="",await _t()),fe.value="",de())}),ve(v,()=>{j.value=null},{deep:!0}),ve(ee,()=>{de()}),ve($e,async(t,e)=>{if(t===e)return;F+=1,aa(),fe.value="",ae.value=0,sa();const o=document.getElementById(p.formId);(p.embedded||o!=null&&o.classList.contains("show"))&&await mt()}),ve(_,()=>{if(D.value==="NODE_GROUP"){_.value="Standalone";return}_.value==="Standalone"?(T.value=[],X.value=[...Z.value]):_.value==="Clustering"&&(T.value=[],X.value=[...Z.value])}),ve(D,t=>{W.value="",T.value=[],K.value=t==="NODE_GROUP"&&$.value?String(p.targetNodeGroupId||"").trim():"",X.value=[...Z.value],t==="NODE_GROUP"&&(_.value="Standalone"),de()}),nl(async()=>{var e;if((e=document.getElementById(p.formId))==null||e.addEventListener("hide.bs.modal",ea),p.embedded){try{if(await mt(),V.value){A("deployment-event",{status:"FORM_ERROR",message:V.value});return}await la(),A("ready",{targetType:P.value,namespace:S.value})}catch{V.value=V.value||"The software catalog could not be loaded.",A("deployment-event",{status:"FORM_ERROR",message:"The installation form could not be initialized."})}return}const t=document.getElementById(p.formId);t&&t.addEventListener("show.bs.modal",async()=>{if(At){At=!1;return}await mt(),await la()})});const mt=async()=>{Ue++,le.value=!1,oe.value=null,tt.value=null,z++;const t=++F;aa(),I.value=E.value?P.value:"VM",D.value="VM",K.value="",_.value="Standalone",R.value={hpaEnabled:!1,hpaMinReplicas:1,hpaMaxReplicas:10,hpaCpuUtilization:60,hpaMemoryUtilization:80},Fe.value=!1,N.value={ingressEnabled:!1,ingressHost:"",ingressPath:"/",ingressClass:"nginx",ingressTlsEnabled:!1,ingressTlsSecret:""},v.value=It(),j.value=null,et.value=!1,he.value=[],xe.value=!1,He.value=!1,pe.value=[],ee.value="",ke.value=!1,Ne.value=!1,it.value="",q.value=null,Ve.value=null,dt.value="",me.value=!1,je.value=!1,re.value="",Ce.value=!1,te.value=10,_e.value="GENERAL_PURPOSE",ue.value="",De.value="PRIVATE",Q.value="",fe.value="",ae.value=0,Na(),sa(),await Va(t)},Ea=t=>{let e=(t||"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"");const o=e.lastIndexOf("@");o>=0&&(e=e.slice(o+1));const c=e.search(/[/?#]/);c>=0&&(e=e.slice(0,c));const u=e.indexOf(":");return u>=0&&e.indexOf(":",u+1)<0&&(e=e.slice(0,u)),e.trim().toLowerCase()},la=async()=>{await il("").then(({data:t})=>{Me.value=t})},Na=()=>{if(E.value){Nt.value=[{key:P.value,value:P.value}];return}Nt.value=[{key:"VM",value:"VM"},{key:"k8s",value:"K8S"}]},sa=()=>{r.value==="Application Uninstallation"?ie.value=!1:ie.value=!0},Va=async(t=F)=>{try{const{data:e}=await _l();if(t!==F)return;const o=Array.isArray(e)?e:[];if(Et.value){if(Te.isEmpty(Be.value)){V.value=`Project "${Wt.value}" has no namespace mapping.`;return}const c=o.find(u=>Ye(u,[Be.value]));if(!c){V.value=`Namespace "${Be.value}" assigned to this project was not found.`;return}Pe.value=[c],S.value=ze(c)}else{Pe.value=o;const c=Re(p.nsId),w=(c?o.find(Y=>Ye(Y,[c])):void 0)||o[0];S.value=w?ze(w):""}Te.isEmpty(S.value)||(I.value==="VM"?await xt(t):I.value==="K8S"&&await _t(t))}catch{if(t!==F)return;V.value="Namespaces could not be loaded for the selected project."}},xt=async(t=F)=>{V.value="";try{const{data:e}=await jl(S.value);if(t!==F)return;const c=(Array.isArray(e)?e:[]).filter(u=>Ye(u,ot.value));if(E.value&&P.value==="VM"){const u=c.find(w=>Ye(w,[p.targetMciId]));if(!u){Ee.value=[],G.value="",V.value=`Infra "${p.targetMciId}" was not found in the selected project namespace.`;return}Ee.value=[u],G.value=ta(u),await Ut(t);return}Ee.value=c,Ee.value.length>0?(G.value=ta(Ee.value[0]),await Ut(t)):(G.value="",V.value=ot.value.length>0?`Infra "${ot.value.join(", ")}" assigned to this project was not found.`:"No VM infrastructure is available in this project.")}catch{if(t!==F)return;V.value="VM infrastructure could not be loaded for the selected project."}},Ut=async(t=F)=>{const e={nsId:S.value,mciId:G.value};try{const{data:o}=await Ol(e);if(t!==F)return;const c=Array.isArray(o==null?void 0:o.node)?o.node:[];if(E.value&&P.value==="VM"){const u=Ul(c,{vmId:p.targetVmId,nodeGroupId:p.targetNodeGroupId});if(!u.ok){Z.value=[],X.value=[],W.value="",T.value=[],K.value="",V.value=`${u.error} Infra: "${p.targetMciId}".`;return}if(u.mode==="NODE_GROUP"){Z.value=u.members,X.value=[...u.members],D.value="NODE_GROUP",K.value=u.nodeGroupId,_.value="Standalone",W.value="",T.value=[];return}Z.value=[u.vm],X.value=[u.vm],D.value="VM",W.value=u.vmId,T.value=[u.vmId];return}Z.value=c,X.value=Z.value.filter(u=>!T.value.includes(u.id)),W.value="",Pt.value.some(u=>u.id===K.value)||(K.value=""),X.value.length===0&&(V.value="No VM is available in the infrastructure assigned to this project.")}catch{if(t!==F)return;V.value="VMs could not be loaded for the selected project."}},_t=async(t=F)=>{V.value="";try{const{data:e}=await Dl(S.value);if(t!==F)return;const c=(Array.isArray(e)?e:[]).filter(u=>Ye(u,rt.value));if(E.value&&P.value==="K8S"){const u=c.find(w=>Ye(w,[p.targetClusterId]));if(!u){Se.value=[],M.value="",V.value=`Cluster "${p.targetClusterId}" was not found in the selected project namespace.`;return}Se.value=[u],M.value=pt(u)}else Se.value=c,Se.value.length>0?M.value=pt(Se.value[0]):(M.value="",V.value=rt.value.length>0?`Cluster "${rt.value.join(", ")}" assigned to this project was not found.`:"No Kubernetes cluster is available in this project.");I.value==="K8S"&&O.value&&(N.value.ingressEnabled=!0,R.value.hpaEnabled=!1,R.value.hpaMinReplicas=1),v.value=It(),j.value=null,await Je()}catch{if(t!==F)return;V.value="Kubernetes clusters could not be loaded for the selected project."}},ft=async()=>{if(he.value=[],He.value=!1,!(!["VM","K8S"].includes(I.value)||!O.value||Te.isEmpty(S.value))){xe.value=!0;try{const{data:t}=await fl(S.value);he.value=Array.isArray(t)?t:[];const e=he.value.filter(o=>String(o.status||"").toLowerCase()==="available").map(o=>o.id);v.value.selectedStorageIds=(v.value.selectedStorageIds||[]).filter(o=>e.includes(o)),v.value.selectedStorageIds.length===0&&e.length===1&&(v.value.selectedStorageIds=[e[0]])}catch{He.value=!0}finally{xe.value=!1}}},Je=async(t="")=>{const e=++z;if(Ve.value=null,dt.value="",me.value=!1,je.value=!1,pe.value=[],ee.value="",Ne.value=!1,it.value="",q.value=null,re.value="",ke.value=!1,I.value!=="K8S"||!Kt.value||!S.value||!M.value)return;const o={namespace:S.value,clusterName:M.value};ke.value=!0;try{const{data:c}=await dl(o);if(e!==z)return;if(!Array.isArray(c))throw new Error("Invalid StorageClass API response. Retry the lookup.");pe.value=[...c].sort((u,w)=>Number(bt(w))-Number(bt(u))),ee.value=c.some(u=>u.name===t)?t:Ra(c),!t&&We.value==="alibaba"&&(te.value=Math.max(te.value,20))}catch(c){if(e!==z)return;Ne.value=!0,it.value=vt(c)}finally{e===z&&(ke.value=!1)}if(!(e!==z||Ne.value||!gt.value)){je.value=!0;try{const{data:c}=await cl(o);if(e!==z)return;if(q.value=c,!c.driverReady){const u=await vl(o);e===z&&(Ve.value=u.data)}}catch(c){e===z&&(re.value=vt(c))}finally{e===z&&(je.value=!1)}}},Aa=async()=>{var Y;if(!gt.value||me.value||!((Y=Ve.value)!=null&&Y.canInstall))return;const t=z,e=$e.value,o=Ue,c={namespace:S.value,clusterName:M.value},u=ee.value,w=()=>ut&&t===z&&e===$e.value&&o===Ue&&c.namespace===S.value&&c.clusterName===M.value;me.value=!0,re.value="";try{const{data:B}=await bl(c);await Ll(B,c,async l=>(await gl(c,l)).data,l=>{w()&&(dt.value=l)},w),w()&&await Je(u)}catch(B){w()&&(re.value=vt(B))}finally{t===z&&(me.value=!1)}},Ta=async()=>{var o;if(Ce.value||!((o=q.value)!=null&&o.canCreate))return;const t=z,e={namespace:S.value,clusterName:M.value};Ce.value=!0,re.value="";try{const{data:c}=await yl(e,{name:ct.value,diskType:Tt.value});t===z&&await Je(c.name)}catch(c){t===z&&(re.value=vt(c))}finally{Ce.value=!1}},bt=t=>We.value==="alibaba"&&t.name==="alicloud-disk-topology-alltype"&&t.provisioner==="diskplugin.csi.alibabacloud.com",Ra=t=>{var c;const e=t.find(bt),o=t.find(u=>u.defaultClass);return(e==null?void 0:e.name)||(o==null?void 0:o.name)||((c=t[0])==null?void 0:c.name)||""},Pa=async()=>{T.value=[],await xt(F),await ft(),de()},Ma=async()=>{T.value=[],K.value="",V.value="",await Ut(F),de()},xa=async()=>{await _t(F),de()},de=()=>{Ae+=1,qe.value=[],at.value=[],r.value==="Application Installation"?ie.value=!0:r.value==="Application Uninstallation"&&(ie.value=!1)},Ua=()=>{if(W.value!==""){if(_.value==="Standalone")T.value=[W.value];else if(_.value==="Clustering"&&!T.value.includes(W.value)){T.value.push(W.value);const t=X.value.findIndex(e=>e.id===W.value);t!==-1&&X.value.splice(t,1)}W.value="",de()}},_a=()=>{T.value=[],_.value="Standalone",de()},ja=t=>{if(E.value)return;const e=T.value[t];if(T.value.splice(t,1),_.value==="Clustering"){const o=Z.value.find(c=>c.id===e);o&&X.value.push(o)}de()},na=async()=>{Ue++,A("cancel"),!Ie.value&&(le.value||await mt())},oa=async()=>{const t=document.getElementById(p.formId),e=t&&!p.embedded?Yt.getInstance(t):null;e&&(t!=null&&t.classList.contains("show"))&&await new Promise(o=>{t.addEventListener("hidden.bs.modal",()=>o(),{once:!0}),e.hide()}),await C.push({name:"applicationStatus"})},Oa=()=>I.value==="VM"?D.value==="NODE_GROUP"?{targetType:"VM",namespace:S.value,mciId:G.value,nodeGroupId:K.value}:{targetType:"VM",namespace:S.value,mciId:G.value,vmId:T.value[0]||"",...E.value&&p.targetNodeGroupId?{nodeGroupId:p.targetNodeGroupId}:{}}:{targetType:"K8S",namespace:S.value,clusterId:M.value},st=(t,e={})=>{A("deployment-event",{status:t,target:Oa(),...e})},ra=t=>{if(!(!t||typeof t!="object"))return t.deploymentId||t.applicationId||t.id||void 0},Da=async()=>{if(Ie.value||le.value)return;if(Gt.value){i.error("Jupyter installation is unavailable for KT because AM does not support KT Object Storage integration.");return}if(r.value==="Application Installation"&&I.value==="VM"&&_.value==="Clustering"&&!Ot.value){i.error("Clustering is available only for Redis and Elasticsearch on individually selected VMs");return}if(r.value==="Application Installation"&&(ie.value||Le.value)){i.error("Please complete Spec Check for the current settings before deploying");return}if(V.value){i.error(V.value);return}if(I.value!=="VM"&&I.value!=="K8S"){i.error("Please Select Infra");return}if(I.value==="VM"&&r.value==="Application Installation"&&De.value==="RESTRICTED"&&(!Q.value||Q.value==="0.0.0.0/0")){i.error("Enter a restricted IPv4 CIDR such as 203.0.113.10/32");return}if(I.value==="K8S"&&r.value==="Application Installation"&&N.value.ingressEnabled&&(!Q.value||Q.value==="0.0.0.0/0")){i.error("Enter a restricted IPv4 CIDR for external access");return}if(I.value==="K8S"&&O.value){if(!N.value.ingressEnabled||!N.value.ingressHost||!Q.value||Q.value==="0.0.0.0/0"){i.error("Enter an Ingress hostname and a restricted IPv4 CIDR for Jupyter");return}if(N.value.ingressPath!=="/"||!be.value&&N.value.ingressTlsEnabled||R.value.hpaEnabled||Fe.value){i.error(be.value?"Jupyter uses one replica and path / without HPA or rebalancing":"Jupyter uses one replica, path / and HTTP NodePort 30880 without HPA or rebalancing");return}}if(O.value){if((v.value.selectedStorageIds||[]).length===0){i.error("Select at least one registered Object Storage resource");return}if(String(v.value.jupyterToken||"").length<12){i.error("Enter a Jupyter access token with at least 12 characters");return}if(!$t.value){i.error("Run the Object Storage check before deployment");return}}if(I.value==="K8S"&&!ca())return;Ie.value=!0,oe.value=null;const t=$e.value,e=Ae,o=Ue,c=()=>ut&&Ue===o&&$e.value===t&&Ae===e;st("DEPLOY_STARTED");try{let u={};if(I.value==="VM"){let w={};if(r.value=="Application Installation"){const Y=D.value==="NODE_GROUP",B=!Y&&_.value==="Clustering"?`${fe.value}-cluster`:`${fe.value}-standalone`,l=ue.value===""?void 0:Number(ue.value);w={namespace:S.value,mciId:G.value,vmIds:Y?[]:T.value,vmNodeGroupId:Y?K.value:E.value&&p.targetNodeGroupId?p.targetNodeGroupId:void 0,clusterName:B,catalogId:ae.value,servicePort:l,openServicePort:De.value==="RESTRICTED",servicePortCidr:De.value==="RESTRICTED"?Q.value:void 0,username:"admin",deploymentType:I.value,vmDeploymentMode:Y?"STANDALONE":_.value.toUpperCase(),resourceType:_e.value,additionalConfig:Ja()},u=await hl(w,c)}else u=await fa(w)}else{const w=ue.value===""?void 0:Number(ue.value),Y=Wa(),B={namespace:S.value,clusterName:M.value,openServicePort:N.value.ingressEnabled&&!be.value&&Rt.value,servicePortCidr:N.value.ingressEnabled?Q.value:void 0,catalogId:ae.value,servicePort:w,username:"",deploymentType:I.value,hpaEnabled:R.value.hpaEnabled,minReplicas:R.value.hpaMinReplicas,maxReplicas:R.value.hpaMaxReplicas,cpuThreshold:R.value.hpaCpuUtilization,memoryThreshold:R.value.hpaMemoryUtilization,workloadRebalancingEnabled:Fe.value,resourceType:_e.value,...jt(),additionalConfig:Y};if(r.value==="Application Installation"&&be.value&&B.ingressEnabled){const{data:l}=await Il({namespace:B.namespace,clusterName:B.clusterName,catalogId:B.catalogId,servicePortCidr:B.servicePortCidr,...jt()});await Kl(l,B,async ne=>(await kl(B.namespace,ne)).data,()=>{},c)}u=r.value=="Application Installation"?await Cl(B,c):await fa(B)}if(!c())return;if(u.data&&["FAILED","PARTIAL_SUCCESS"].includes(u.data.status))throw new Sl("Installation did not complete successfully. Open deployment logs for details.",ra(u.data),u.data.status);u.data?(le.value=!0,i.success("SUCCESS"),st("DEPLOY_SUCCEEDED",{deploymentId:ra(u.data)})):(oe.value={message:"The deployment API did not return a success result.",unknown:!1},i.error("FAIL"),st("DEPLOY_FAILED",{message:"The deployment API did not return a success result."}))}catch(u){if(!c())return;const w=u instanceof Error?u.message:"The deployment request failed.";oe.value={message:w,deploymentId:u==null?void 0:u.deploymentId,unknown:!!(u!=null&&u.deploymentStatusUnknown)},u!=null&&u.deploymentStatusUnknown?(u.interruptedOperation&&(tt.value=u.interruptedOperation),i.warning(w),st("DEPLOY_STATUS_UNKNOWN",{message:w})):(i.error(w),st("DEPLOY_FAILED",{message:w,deploymentId:oe.value.deploymentId}))}finally{Ie.value=!1}},jt=()=>({ingressEnabled:N.value.ingressEnabled,ingressHost:Ea(N.value.ingressHost),ingressPath:N.value.ingressPath,ingressClass:ua.value,ingressTlsEnabled:be.value?!1:N.value.ingressTlsEnabled,ingressTlsSecret:be.value||N.value.ingressTlsSecret===""?null:N.value.ingressTlsSecret}),La=async()=>{if(Le.value)return;if(V.value){i.error(V.value);return}if(I.value!=="VM"&&I.value!=="K8S"){i.error("Please Select Infra");return}if(!ca())return;const t=Ae;ie.value=!0,qe.value=[],at.value=[],Le.value=!0;try{if(I.value==="K8S"){if(!S.value||!M.value||!ae.value){i.error("Please select all items");return}const{data:o}=await wl({namespace:S.value,clusterName:M.value,catalogId:ae.value,servicePortCidr:Q.value,...jt()});if(t!==Ae)return;if(at.value=Array.isArray(o==null?void 0:o.warnings)?o.warnings:[],(o==null?void 0:o.valid)!==!0){qe.value=Array.isArray(o==null?void 0:o.errors)&&o.errors.length?o.errors:["Ingress check failed. Resolve the issue and retry Spec Check."];return}}const e=await Ga();if(t!==Ae)return;if(e==null){i.error("Please select all items");return}if(e===!1){const o=I.value==="VM"?"VM":"CLUSTER";if(!confirm("Your selected "+o+" has lower specifications than recommended. Would you like to continue with the installation?"))return}if(t!==Ae)return;i.success("Please click Deploy"),ie.value=!1}catch{t===Ae&&(qe.value=["Spec Check could not be completed. Check connectivity and permissions, then retry."])}finally{Le.value=!1}},Ga=async()=>{let t=!1;if(I.value==="VM"){const e=D.value==="NODE_GROUP"?Mt.value:T.value;if(S.value===""||G.value===""||D.value==="NODE_GROUP"&&K.value===""||e.length===0||ae.value===0)return null;{const o=D.value==="NODE_GROUP"?e:[e[0]];t=!0;for(const c of o){const u={namespace:S.value,mciName:G.value,vmName:c,catalogId:ae.value},{data:w}=await El(u);if(!w){t=!1;break}}}}else if(I.value==="K8S"){if(S.value===""||M.value===""||ae.value===0)return null;const e={namespace:S.value,clusterName:M.value,catalogId:ae.value};await Nl(e).then(({data:o})=>{t=o})}return t},ce=k(()=>Me.value.find(t=>t.id===ae.value)),Ot=k(()=>I.value==="VM"&&D.value==="VM"&&!E.value&&Gl(ce.value));ve(Ot,t=>{!t&&_.value==="Clustering"&&(_.value="Standalone")},{flush:"sync"});const We=k(()=>{var e;const t=Se.value.find(o=>o.id===M.value||o.name===M.value);return String(((e=t==null?void 0:t.connectionConfig)==null?void 0:e.providerName)||"").trim().toLowerCase()}),be=k(()=>/^(ibm|ibmcloud|ibm-cloud|ibm-vpc|ibmvpc)(-|$)/i.test(We.value)),gt=k(()=>We.value==="nhn"),ua=k(()=>"nginx"),Ka=k(()=>{var o;const t=T.value[0],e=Z.value.find(c=>lt(c)===t);return((o=e==null?void 0:e.connectionConfig)==null?void 0:o.providerName)||(e==null?void 0:e.connectionName)||""}),yt=k(()=>I.value==="VM"?Ka.value:We.value),Dt=k(()=>{var t,e;return String(((e=(t=ce.value)==null?void 0:t.helmChart)==null?void 0:e.chartName)||"").toLowerCase()}),Ba=["CAPABILITY","TAG"],Lt=k(()=>Dt.value==="loki"),se=k(()=>{var e;const t=(e=ce.value)==null?void 0:e.helmChart;return I.value==="K8S"&&(t==null?void 0:t.repositoryName)==="mcmp-builtin"&&(t==null?void 0:t.chartRepositoryUrl)==="classpath:helm"&&["0.1.0","0.1.1"].includes(t==null?void 0:t.chartVersion)&&(t==null?void 0:t.packageId)==="mcmp-builtin-"+Dt.value&&["redis","mariadb","postgresql"].includes(Dt.value)});function ia(){se.value&&(N.value.ingressEnabled=!1,R.value.hpaEnabled=!1,R.value.hpaMinReplicas=1,R.value.hpaMaxReplicas=1,Fe.value=!1)}ve(se,ia);const O=k(()=>{var e,o;return String(((o=(e=ce.value)==null?void 0:e.packageInfo)==null?void 0:o.packageName)||"").toLowerCase().includes("jupyter")&&Ht(ce.value)}),Gt=k(()=>{if(r.value!=="Application Installation"||!O.value)return!1;const t=e=>/^kt(?:classic|cloud|-cloud)?(?:[-_]|$)/i.test(String(e||"").trim());return I.value==="K8S"?t(We.value):Z.value.some(e=>{var o;return T.value.includes(lt(e))&&t(((o=e==null?void 0:e.connectionConfig)==null?void 0:o.providerName)||(e==null?void 0:e.connectionName))})}),Kt=k(()=>{var t;return I.value!=="K8S"?!1:O.value||se.value?!0:!((t=ce.value)!=null&&t.helmChart)||!Lt.value?!1:da(ce.value,br)}),Ge=k(()=>Kt.value&&(Lt.value||O.value||se.value)),$a=k(()=>Kt.value&&r.value==="Application Installation"&&(Ge.value||pe.value.length>0||Ne.value)),Fa=k(()=>ke.value||me.value||pe.value.length<=1),Ha=k(()=>ke.value?"Loading StorageClasses...":Ne.value?"Failed to load StorageClasses":pe.value.length===0?"No StorageClass found":"Select StorageClass"),ht=k(()=>{var t;return Ge.value?ke.value?"StorageClass list is loading.":Ne.value?it.value||"StorageClass list could not be loaded.":gt.value&&(me.value||je.value||!((t=q.value)!=null&&t.driverReady))?re.value||"Prepare Cinder CSI on the selected NHN cluster before deploying this application.":pe.value.length===0?"This application requires a StorageClass, but none was found.":Te.isEmpty(ee.value)?"This application requires a StorageClass.":O.value&&(!Number.isInteger(te.value)||te.value9999)?"Enter a whole-number volume capacity between "+Oe.value+" and 9999 GiB.":"":""}),qa=k(()=>Ft(yt.value)?"Optional: https://s3.ap-northeast-2.amazonaws.com":"https://object-storage.example.com"),za=k(()=>Ft(yt.value)?"ap-northeast-2":"region from object storage service"),Qe=k(()=>!ce.value||!Ht(ce.value)?!1:I.value==="VM"?!!ce.value.packageInfo&&O.value:I.value==="K8S"?!!ce.value.helmChart||O.value:!1),Bt=k(()=>Qe.value&&v.value.enabled),$t=k(()=>{var t;return!Bt.value||((t=j.value)==null?void 0:t.success)===!0}),Ya=k(()=>Ie.value||le.value||Gt.value||Le.value||!!V.value||ie.value||!$t.value||Ge.value&&!Te.isEmpty(ht.value));function It(t=yt.value,e=kt.value){const o=Ft(t);return{enabled:!!e,selectedStorageIds:[],accessMode:"READ_ONLY",backendType:"s3",endpoint:"",region:"",bucket:"",prefix:"",accessKey:"",secretKey:"",sessionToken:"",jupyterToken:"",forcePathStyle:!o}}function Ft(t){return String(t||"").toLowerCase().includes("aws")}const kt=k(()=>I.value==="K8S"&&Lt.value||O.value);function Ht(t){return da(t,fr)}function da(t,e){return(t.catalogRefs||[]).some(c=>{const u=String(c.refType||"").toUpperCase();return String(c.refValue||"").toLowerCase()===e&&Ba.includes(u)})}function qt(){if(I.value==="VM"||O.value){const t=v.value.selectedStorageIds||[];return{enabled:v.value.enabled,jupyterToken:v.value.jupyterToken,storages:t.map(e=>({objectStorageId:e,alias:e,prefix:v.value.prefix,accessMode:v.value.accessMode}))}}return{enabled:v.value.enabled,backendType:v.value.backendType,endpoint:v.value.endpoint,region:v.value.region,bucket:v.value.bucket,prefix:v.value.prefix,accessKey:v.value.accessKey,secretKey:v.value.secretKey,sessionToken:v.value.sessionToken,jupyterToken:v.value.jupyterToken,forcePathStyle:v.value.forcePathStyle,insecure:Qa(v.value.endpoint)}}function Ja(){if(!(!Qe.value||!v.value.enabled))return{objectStorage:qt()}}function Wa(){const t={};return Ge.value&&!Te.isEmpty(ee.value)&&(t.storageClass=ee.value,(O.value||se.value)&&(t.storageSize=te.value+"Gi",t.storageAccessMode="ReadWriteOnce")),Qe.value&&v.value.enabled&&(t.objectStorage=qt()),Object.keys(t).length>0?t:void 0}function ca(){if(!Ge.value)return!0;const t=ht.value;return Te.isEmpty(t)?!0:(i.error(t),!1)}function Qa(t){return String(t||"").trim().toLowerCase().startsWith("http://")}const Xa=async(t=!0)=>{if(!Bt.value)return!0;et.value=!0,j.value=null;const e={targetType:I.value,namespace:S.value,clusterName:I.value==="K8S"?M.value:void 0,mciId:I.value==="VM"?G.value:void 0,vmId:I.value==="VM"?T.value[0]:void 0,catalogId:ae.value,objectStorage:qt()};try{const{data:o}=await Vl(e);return j.value=o,o!=null&&o.success?(t&&i.success("Object Storage check succeeded"),!0):(t&&i.error("Object Storage check failed"),!1)}catch{return t&&i.error("Object Storage check failed"),!1}finally{et.value=!1}},zt=k(()=>I.value==="VM"?Me.value.filter(t=>t.packageInfo):I.value==="K8S"?Me.value.filter(t=>{var e;return t.helmChart||String(((e=t.packageInfo)==null?void 0:e.packageName)||"").toLowerCase().includes("jupyter")&&Ht(t)}):Me.value),va=async()=>{r.value==="Application Installation"&&(ie.value=!0);const t=zt.value.find(e=>fe.value===e.name);t&&(ae.value=t.id,ue.value=I.value==="K8S"&&O.value?"8888":t.defaultPort?String(t.defaultPort):"",R.value={hpaEnabled:!!t.hpaEnabled,hpaMinReplicas:t.minReplicas||1,hpaMaxReplicas:t.maxReplicas||10,hpaCpuUtilization:t.cpuThreshold||60,hpaMemoryUtilization:t.memoryThreshold||80},N.value={ingressEnabled:!!t.ingressEnabled,ingressHost:t.ingressHost||"",ingressPath:t.ingressPath||"/",ingressClass:t.ingressClass||"nginx",ingressTlsEnabled:!!t.ingressTlsEnabled,ingressTlsSecret:t.ingressTlsSecret||""},ia(),I.value==="K8S"&&O.value&&(N.value.ingressEnabled=!0,R.value.hpaEnabled=!1,R.value.hpaMinReplicas=1),v.value=It(),j.value=null),await ft(),await Je()},Za=async()=>{r.value==="Application Installation"&&(ie.value=!0),v.value=It(),j.value=null,await Je()};return(t,e)=>{var o,c,u,w,Y,B;return n(),s(x,null,[a("div",{class:we(t.embedded?"install-embedded":"modal fade"),id:t.formId,tabindex:t.embedded?void 0:-1},[a("div",{class:we(["modal-dialog modal-lg",{"install-embedded-dialog":t.embedded}]),role:"document"},[a("div",$l,[a("div",Fl,[a("h5",Hl,f(r.value),1),t.embedded?b("",!0):(n(),s("button",{key:0,type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:na}))]),a("div",{class:we(["modal-body",{"install-embedded-body":t.embedded}]),style:ol(t.embedded?void 0:"max-height: calc(100vh - 200px);overflow-y: auto;")},[le.value?(n(),s("div",ql,e[53]||(e[53]=[a("strong",null,"Deployment completed.",-1),a("p",{class:"mb-0"},"Check the application's running status in Apps Status.",-1)]))):b("",!0),tt.value?(n(),s("div",zl,[e[54]||(e[54]=ge(" AM restarted while tracking this installation. Check Apps Status before starting another installation. ")),a("button",{type:"button",class:"btn btn-sm btn-outline-warning ms-2",disabled:Vt.value,onClick:Ca},"Close interrupted tracking",8,Yl)])):b("",!0),oe.value?(n(),s("div",{key:2,class:we(["alert py-2",oe.value.unknown?"alert-warning":"alert-danger"]),role:"alert"},[a("strong",null,f(oe.value.unknown?"Deployment status unknown.":"Deployment failed."),1),a("p",Jl,f(oe.value.message),1),oe.value.deploymentId?(n(),s("button",{key:0,type:"button",class:"btn btn-sm btn-outline-danger",onClick:Sa},"View deployment logs")):(n(),s("button",{key:1,type:"button",class:"btn btn-sm btn-outline-secondary",onClick:oa},"View Apps Status"))],2)):b("",!0),y(a("fieldset",{disabled:Ie.value||le.value,class:"border-0 p-0 m-0"},[Et.value?(n(),s("div",Ql,[e[55]||(e[55]=ge(" Deployment targets are scoped to ")),a("strong",null,f(Wt.value),1),e[56]||(e[56]=ge(". "))])):b("",!0),V.value?(n(),s("div",Xl,f(V.value),1)):b("",!0),E.value?(n(),s("div",Zl,[e[57]||(e[57]=ge(" The deployment target was fixed by the Workload screen: ")),a("strong",null,f(Ze.value),1),e[58]||(e[58]=ge(". "))])):b("",!0),a("div",es,[e[59]||(e[59]=a("label",{class:"form-label"},"Target Infra",-1)),r.value=="Application Installation"?(n(),s("p",ts," Select the Infra what is the Infra will be installed ")):r.value=="Application Uninstallation"?(n(),s("p",as," Select the Infra what is the Infra will be uninstalled ")):b("",!0),y(a("select",{class:"form-select",id:"infra","onUpdate:modelValue":e[0]||(e[0]=l=>I.value=l),disabled:E.value},[(n(!0),s(x,null,L(Nt.value,l=>(n(),s("option",{value:l.value,key:l.value},f(l.value),9,ss))),128))],8,ls),[[J,I.value]])]),I.value=="VM"?(n(),s(x,{key:3},[a("div",ns,[e[61]||(e[61]=a("label",{class:"form-label"},"Namespace",-1)),r.value=="Application Installation"?(n(),s("p",os," Select the namespace where the application will be installed")):r.value=="Application Uninstallation"?(n(),s("p",rs," Select the namespace where the application will be uninstalled")):b("",!0),Pe.value.length>0?y((n(),s("select",{key:2,class:"form-select",id:"vm-namespace","onUpdate:modelValue":e[1]||(e[1]=l=>S.value=l),disabled:Jt.value,onChange:Pa},[(n(!0),s(x,null,L(Pe.value,l=>(n(),s("option",{value:ze(l),key:ze(l)},f(l.name||l.id),9,is))),128))],40,us)),[[J,S.value]]):(n(),s("select",ds,e[60]||(e[60]=[a("option",{value:""}," No namespace available ",-1)])))]),a("div",cs,[e[62]||(e[62]=a("label",{class:"form-label"},"Infra ID",-1)),r.value=="Application Installation"?(n(),s("p",vs," Select the infra ID where the application will be deployed")):r.value=="Application Uninstallation"?(n(),s("p",ps," Remove the application and associated resources from the infra")):b("",!0),y(a("select",{class:"form-select",id:"vm-mci",disabled:S.value==""||E.value,"onUpdate:modelValue":e[2]||(e[2]=l=>G.value=l),onChange:Ma},[Ee.value.length===0?(n(),s("option",fs,"No infra available")):b("",!0),(n(!0),s(x,null,L(Ee.value,l=>(n(),s("option",{value:l.id||l.name,key:l.id||l.name,title:l.id||l.name},f(l.id||l.name),9,bs))),128))],40,ms),[[J,G.value]])]),r.value=="Application Installation"&&!E.value?(n(),s("div",gs,[e[65]||(e[65]=a("label",{class:"form-label"},"Deployment Target",-1)),e[66]||(e[66]=a("p",{class:"text-muted"},"Choose one VM or one CB-Tumblebug NodeGroup.",-1)),a("div",ys,[a("div",hs,[y(a("input",{class:"form-check-input",type:"radio",id:"vm-target-single","onUpdate:modelValue":e[3]||(e[3]=l=>D.value=l),value:"VM"},null,512),[[Ct,D.value]]),e[63]||(e[63]=a("label",{class:"form-check-label",for:"vm-target-single"},"VM",-1))]),a("div",Is,[y(a("input",{class:"form-check-input",type:"radio",id:"vm-target-node-group","onUpdate:modelValue":e[4]||(e[4]=l=>D.value=l),value:"NODE_GROUP"},null,512),[[Ct,D.value]]),e[64]||(e[64]=a("label",{class:"form-check-label",for:"vm-target-node-group"},"NodeGroup (Standalone)",-1))])])])):b("",!0),D.value==="VM"?(n(),s("div",ks,[e[68]||(e[68]=a("label",{class:"form-label"},"VM Name",-1)),e[69]||(e[69]=a("p",{class:"text-muted"}," Select the virtual machine (VM) within the chosen multi-cloud infrastructure where the application will be deployed",-1)),y(a("select",{class:"form-select",id:"vm-name",disabled:G.value==""||E.value,"onUpdate:modelValue":e[5]||(e[5]=l=>W.value=l),onChange:Ua},[e[67]||(e[67]=a("option",{value:""},"Select VM",-1)),(n(!0),s(x,null,L(X.value,l=>(n(),s("option",{value:lt(l),key:lt(l)},f(l.name||l.id),9,Ss))),128))],40,Cs),[[J,W.value]]),T.value.length>0?(n(),s("div",ws,[(n(!0),s(x,null,L(T.value,(l,ne)=>(n(),s("label",{key:ne,class:"form-check-label",style:{border:"1px solid #000",padding:"5px","border-radius":"5px",cursor:"pointer"}},[ge(f(l)+" ",1),E.value?b("",!0):(n(),s("span",{key:0,onClick:Xe=>ja(ne),style:{"margin-left":"5px","font-weight":"bold"}},"X",8,Es))]))),128))])):b("",!0)])):(n(),s("div",Ns,[e[72]||(e[72]=a("label",{class:"form-label"},"NodeGroup",-1)),e[73]||(e[73]=a("p",{class:"text-muted"}," Deploy one independent application instance to every currently running VM in the selected NodeGroup. ",-1)),y(a("select",{class:"form-select",id:"vm-node-group",disabled:G.value==""||E.value,"onUpdate:modelValue":e[6]||(e[6]=l=>K.value=l),onChange:_a},[e[70]||(e[70]=a("option",{value:""},"Select NodeGroup",-1)),(n(!0),s(x,null,L(Pt.value,l=>(n(),s("option",{key:l.id,value:l.id,disabled:l.runningVmIds.length===0},f(l.id)+" ("+f(l.runningVmIds.length)+"/"+f(l.totalVmCount)+" running) ",9,As))),128))],40,Vs),[[J,K.value]]),K.value&&Mt.value.length>0?(n(),s("div",Ts,[e[71]||(e[71]=a("div",{class:"text-muted small mb-1"},"Deployment targets",-1)),a("div",Rs,[(n(!0),s(x,null,L(Mt.value,l=>(n(),s("span",{key:l,class:"badge bg-light text-dark"},f(l),1))),128))])])):K.value?(n(),s("div",Ps," The selected NodeGroup has no running VMs. ")):b("",!0)])),D.value==="VM"?(n(),s("div",Ms,[e[76]||(e[76]=a("label",{class:"form-label"},"Deployment Type",-1)),e[77]||(e[77]=a("p",{class:"text-muted"},"Select the deployment type",-1)),a("div",xs,[a("div",Us,[y(a("input",{class:"form-check-input",type:"radio",id:"Standalone","onUpdate:modelValue":e[7]||(e[7]=l=>_.value=l),value:"Standalone",disabled:E.value},null,8,_s),[[Ct,_.value]]),e[74]||(e[74]=a("label",{class:"form-check-label",for:"Standalone"},"Standalone",-1))]),Ot.value?(n(),s("div",js,[y(a("input",{class:"form-check-input",type:"radio",id:"Clustering","onUpdate:modelValue":e[8]||(e[8]=l=>_.value=l),value:"Clustering",disabled:E.value},null,8,Os),[[Ct,_.value]]),e[75]||(e[75]=a("label",{class:"form-check-label",for:"Clustering"},"Clustering",-1))])):b("",!0)]),E.value?b("",!0):(n(),s("div",Ds,"Clustering is available only for Redis and Elasticsearch server catalogs."))])):(n(),s("div",Ls,e[78]||(e[78]=[a("label",{class:"form-label"},"Deployment Type",-1),a("input",{type:"text",class:"form-control",value:"Standalone",disabled:""},null,-1),a("div",{class:"form-text"},"NodeGroup deployment does not use application clustering.",-1)]))),a("div",Gs,[e[79]||(e[79]=a("label",{class:"form-label"},"Application",-1)),e[80]||(e[80]=a("p",{class:"text-muted"},"Select the application",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[9]||(e[9]=l=>fe.value=l),onChange:va},[(n(!0),s(x,null,L(zt.value,(l,ne)=>{var Xe;return n(),s("option",{key:ne,value:l.name}," ["+f(ma(Ia)(l,Me.value))+"] "+f(((Xe=l.packageInfo)==null?void 0:Xe.packageVersion)||"latest"),9,Ks)}),128))],544),[[J,fe.value]])]),a("div",Bs,[e[81]||(e[81]=a("label",{class:"form-label"},"Port",-1)),e[82]||(e[82]=a("p",{class:"text-muted"},"Docker host port. Security Group access is configured separately below.",-1)),y(a("input",{type:"number",class:"form-control",placeholder:"8080","onUpdate:modelValue":e[10]||(e[10]=l=>ue.value=l)},null,512),[[U,ue.value]])]),r.value=="Application Installation"?(n(),s("div",$s,[e[86]||(e[86]=a("label",{class:"form-label"},"Network Exposure",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[11]||(e[11]=l=>De.value=l)},e[83]||(e[83]=[a("option",{value:"PRIVATE"},"Do not change Security Group (recommended)",-1),a("option",{value:"RESTRICTED"},"Add restricted direct access",-1)]),512),[[J,De.value]]),e[87]||(e[87]=a("p",{class:"text-muted mt-1 mb-0"}," Direct access appends one inbound TCP rule through Tumblebug. It never resaves existing rules. ",-1)),De.value==="RESTRICTED"?(n(),s("div",Fs,[e[84]||(e[84]=a("label",{class:"form-label required"},"Allowed IPv4 CIDR",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"203.0.113.10/32","onUpdate:modelValue":e[12]||(e[12]=l=>Q.value=l)},null,512),[[U,Q.value,void 0,{trim:!0}]]),e[85]||(e[85]=a("p",{class:"text-warning mt-1 mb-0"}," Public any (0.0.0.0/0) is rejected. Broader rules already present in the Security Group are not removed. ",-1))])):b("",!0)])):b("",!0),r.value=="Application Installation"?(n(),s("div",Hs,[e[89]||(e[89]=a("label",{class:"form-label"},"Resource Type",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[13]||(e[13]=l=>_e.value=l)},e[88]||(e[88]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[J,_e.value]])])):b("",!0),r.value=="Application Installation"&&Qe.value?(n(),s("div",qs,[e[97]||(e[97]=a("label",{class:"form-label"},"Object Storage Configuration",-1)),e[98]||(e[98]=a("p",{class:"text-muted"}," Select Object Storage resources already registered in Tumblebug. CSP access keys are not sent to JupyterLab. ",-1)),a("div",zs,[y(a("input",{class:"form-check-input",type:"checkbox",id:"vmObjectStorageEnabled","onUpdate:modelValue":e[14]||(e[14]=l=>v.value.enabled=l),disabled:kt.value},null,8,Ys),[[ye,v.value.enabled]]),e[90]||(e[90]=a("label",{class:"form-check-label",for:"vmObjectStorageEnabled"},"Enable Object Storage",-1))]),v.value.enabled?(n(),s("div",Js,[a("div",Ws,[e[91]||(e[91]=a("label",{class:"form-label mb-0 required"},"Registered Object Storage",-1)),a("button",{type:"button",class:"btn btn-sm btn-outline-secondary",disabled:xe.value,onClick:ft}," Refresh ",8,Qs)]),xe.value?(n(),s("div",Xs,"Loading Object Storage resources...")):He.value?(n(),s("div",Zs," Object Storage resources could not be loaded from Tumblebug. ")):he.value.length===0?(n(),s("div",en," No Object Storage resource is registered in this namespace. ")):(n(),s("div",tn,[(n(!0),s(x,null,L(he.value,l=>(n(),s("div",{class:"form-check",key:l.id},[y(a("input",{class:"form-check-input",type:"checkbox",id:`vm-object-storage-${l.id}`,value:l.id,disabled:String(l.status||"").toLowerCase()!=="available","onUpdate:modelValue":e[15]||(e[15]=ne=>v.value.selectedStorageIds=ne)},null,8,an),[[ye,v.value.selectedStorageIds]]),a("label",{class:"form-check-label",for:`vm-object-storage-${l.id}`},[ge(f(l.name||l.id)+" ",1),a("span",sn," ("+f(l.provider||"unknown CSP")+f(l.region?` / ${l.region}`:"")+" / "+f(l.status||"unknown")+") ",1)],8,ln)]))),128))])),a("div",nn,[a("div",on,[e[92]||(e[92]=a("label",{class:"form-label"},"Allowed Object Prefix",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"Optional: data/project-a/","onUpdate:modelValue":e[16]||(e[16]=l=>v.value.prefix=l)},null,512),[[U,v.value.prefix,void 0,{trim:!0}]])]),a("div",rn,[e[94]||(e[94]=a("label",{class:"form-label"},"Access Mode",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[17]||(e[17]=l=>v.value.accessMode=l)},e[93]||(e[93]=[a("option",{value:"READ_ONLY"},"Read only",-1),a("option",{value:"READ_WRITE"},"Read and write",-1)]),512),[[J,v.value.accessMode]])])]),a("div",un,[e[95]||(e[95]=a("label",{class:"form-label required"},"Jupyter Access Token",-1)),y(a("input",{type:"password",class:"form-control",placeholder:"At least 12 characters","onUpdate:modelValue":e[18]||(e[18]=l=>v.value.jupyterToken=l),autocomplete:"new-password"},null,512),[[U,v.value.jupyterToken]]),a("p",dn," This is the Jupyter login token, not a CSP secret key. Use it at http://:"+f(ue.value)+". ",1)]),e[96]||(e[96]=a("p",{class:"text-muted mt-2 mb-0"}," Jupyter requests short-lived presigned URLs through Application Manager. Multiple CSPs can be selected. ",-1)),j.value?(n(),s("div",{key:4,class:we(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[a("div",null,f(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),a("ul",cn,[(n(!0),s(x,null,L(j.value.checks,l=>(n(),s("li",{key:l.name},f(l.name)+" - "+f(l.success?"OK":"FAIL"),1))),128))])],2)):b("",!0)])):b("",!0)])):b("",!0)],64)):I.value=="K8S"?(n(),s(x,{key:4},[a("div",vn,[e[100]||(e[100]=a("label",{class:"form-label"},"Namespace",-1)),r.value=="Application Installation"?(n(),s("p",pn,"Select the namespace where the application will be installed")):r.value=="Application Uninstallation"?(n(),s("p",mn,"Select the namespace where the application will be uninstalled")):b("",!0),Pe.value.length>0?y((n(),s("select",{key:2,class:"form-select",id:"k8s-namespace","onUpdate:modelValue":e[19]||(e[19]=l=>S.value=l),disabled:Jt.value,onChange:xa},[(n(!0),s(x,null,L(Pe.value,l=>(n(),s("option",{value:ze(l),key:ze(l)},f(l.name||l.id),9,bn))),128))],40,fn)),[[J,S.value]]):(n(),s("select",gn,e[99]||(e[99]=[a("option",{value:""}," No namespace available ",-1)])))]),a("div",yn,[e[101]||(e[101]=a("label",{class:"form-label"},"ClusterName",-1)),r.value=="Application Installation"?(n(),s("p",hn,"Select the name of the cluster where the application will be deployed")):r.value=="Application Uninstallation"?(n(),s("p",In,"Remove the application and associated resources from the multi-cloud infrastructure")):b("",!0),y(a("select",{class:"form-select",id:"k8s-cluster",disabled:S.value==""||E.value,"onUpdate:modelValue":e[20]||(e[20]=l=>M.value=l),onChange:Za},[Se.value.length===0?(n(),s("option",Cn,"No cluster available")):b("",!0),(n(!0),s(x,null,L(Se.value,l=>(n(),s("option",{value:pt(l),key:pt(l)},f(l.name||l.id),9,Sn))),128))],40,kn),[[J,M.value]])]),a("div",wn,[e[102]||(e[102]=a("label",{class:"form-label"},"Helm chart",-1)),e[103]||(e[103]=a("p",{class:"text-muted"},"Select the application",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[21]||(e[21]=l=>fe.value=l),onChange:va},[(n(!0),s(x,null,L(zt.value,(l,ne)=>{var Xe,pa;return n(),s("option",{key:ne,value:l.name}," ["+f(ma(Ia)(l,Me.value))+"] "+f(((Xe=l.helmChart)==null?void 0:Xe.chartVersion)||((pa=l.packageInfo)==null?void 0:pa.packageVersion)||"latest"),9,En)}),128))],544),[[J,fe.value]])]),r.value=="Application Installation"?(n(),s("div",Nn,[e[104]||(e[104]=a("label",{class:"form-label"},"Port",-1)),e[105]||(e[105]=a("p",{class:"text-muted"},"Please enter a service port for the Kubernetes service",-1)),y(a("input",{type:"number",class:"form-control",placeholder:"80","onUpdate:modelValue":e[22]||(e[22]=l=>ue.value=l),disabled:O.value},null,8,Vn),[[U,ue.value]])])):b("",!0),r.value=="Application Installation"?(n(),s("div",An,[e[107]||(e[107]=a("label",{class:"form-label"},"Resource Type",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[23]||(e[23]=l=>_e.value=l)},e[106]||(e[106]=[a("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),a("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),a("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[J,_e.value]])])):b("",!0),r.value=="Application Installation"&&$a.value?(n(),s("div",Tn,[a("label",{class:we(["form-label",{required:Ge.value}])},"Storage Class",2),y(a("select",{class:"form-select","onUpdate:modelValue":e[24]||(e[24]=l=>ee.value=l),disabled:Fa.value},[a("option",Pn,f(Ha.value),1),(n(!0),s(x,null,L(pe.value,l=>(n(),s("option",{key:l.name,value:l.name},f(l.name)+f(bt(l)?" (recommended)":"")+f(l.defaultClass?" (default)":""),9,Mn))),128))],8,Rn),[[J,ee.value]]),Ge.value&&ht.value?(n(),s("p",xn,f(ht.value),1)):b("",!0),a("button",{type:"button",class:"btn btn-outline-secondary btn-sm mt-2",disabled:ke.value||Ce.value,onClick:e[25]||(e[25]=l=>Je(ee.value))},"Refresh StorageClasses",8,Un),re.value?(n(),s("p",_n,f(re.value),1)):b("",!0),gt.value&&!Ne.value&&(!pe.value.length||!((o=q.value)!=null&&o.driverReady))?(n(),s("div",jn,[e[114]||(e[114]=a("div",{class:"fw-bold mb-2"},"NHN block storage setup",-1)),a("p",On,f(((c=q.value)==null?void 0:c.message)||(re.value?"NHN storage setup is unavailable.":"Checking Cinder CSI and AM permissions...")),1),a("div",Dn,[e[108]||(e[108]=a("span",{class:"fw-semibold"},"1. Cinder CSI Plugin add-on",-1)),q.value?(n(),s("span",{key:0,class:we(["badge ms-2",q.value.driverReady?"bg-success":"bg-warning text-dark"])},f(q.value.driverReady?"Ready":"Required"),3)):b("",!0),q.value&&!q.value.driverReady?(n(),s("div",Ln,[a("p",Gn,f(dt.value||((u=Ve.value)==null?void 0:u.message)||"Checking Cinder add-on availability..."),1),(w=Ve.value)!=null&&w.canInstall?(n(),s("button",{key:0,type:"button",class:"btn btn-outline-primary",disabled:me.value||je.value||ke.value,onClick:Aa},f(me.value?"Preparing Cinder CSI...":Ve.value.state==="REGISTERING"?"Check Cinder readiness":"Install Cinder CSI add-on"),9,Kn)):b("",!0),!je.value&&!((Y=Ve.value)!=null&&Y.canInstall)&&!me.value?(n(),s("p",Bn," You can also install cinder-csi-plugin on the selected cluster's NHN NKS Add-ons page, then refresh StorageClasses here. ")):b("",!0)])):b("",!0)]),(B=q.value)!=null&&B.driverReady?(n(),s("div",$n,[e[110]||(e[110]=a("div",{class:"fw-semibold mb-2"},"2. Create StorageClass",-1)),e[111]||(e[111]=a("label",{class:"form-label"},"StorageClass name",-1)),y(a("input",{class:"form-control","onUpdate:modelValue":e[26]||(e[26]=l=>ct.value=l),disabled:Ce.value||!q.value.canCreate,maxlength:"63"},null,8,Fn),[[U,ct.value]]),e[112]||(e[112]=a("label",{class:"form-label mt-2"},"Disk type",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[27]||(e[27]=l=>Tt.value=l),disabled:Ce.value||!q.value.canCreate},e[109]||(e[109]=[a("option",null,"General HDD",-1),a("option",null,"General SSD",-1)]),8,Hn),[[J,Tt.value]]),e[113]||(e[113]=a("p",{class:"text-muted mt-2"},"Volumes are created when a Pod uses the claim. Retain policy keeps disks after claim deletion; remove unused disks separately.",-1)),a("button",{type:"button",class:"btn btn-outline-primary",disabled:Ce.value||!q.value.canCreate||!ct.value,onClick:Ta},f(Ce.value?"Creating...":"Create NHN StorageClass"),9,qn)])):b("",!0)])):b("",!0),O.value||se.value?(n(),s("div",zn,[a("label",Yn,f(O.value?"Notebook":"Data")+" volume capacity (GiB)",1),y(a("input",{type:"number",class:"form-control","onUpdate:modelValue":e[28]||(e[28]=l=>te.value=l),min:Oe.value,step:"1"},null,8,Jn),[[U,te.value,void 0,{number:!0}]]),a("p",Wn,"Minimum "+f(Oe.value)+" GiB for the known disk limits. Access mode: ReadWriteOnce. Provider quotas and disk availability are checked during provisioning.",1),se.value?(n(),s("p",Qn,"Single instance with generated credentials in Secret -auth (key: password). Data PVC and credentials are retained after uninstall; remove them separately when no longer needed.")):b("",!0)])):b("",!0)])):b("",!0),r.value=="Application Installation"&&N.value.ingressEnabled?(n(),s("div",Xn,[e[116]||(e[116]=a("label",{class:"form-label required"},"Allowed IPv4 CIDR",-1)),y(a("input",{class:"form-control",placeholder:"203.0.113.10/32","onUpdate:modelValue":e[29]||(e[29]=l=>Q.value=l)},null,512),[[U,Q.value,void 0,{trim:!0}]]),be.value?b("",!0):(n(),s("div",Zn,[y(a("input",{class:"form-check-input",type:"checkbox",id:"k8sOpenIngress","onUpdate:modelValue":e[30]||(e[30]=l=>Rt.value=l)},null,512),[[ye,Rt.value]]),e[115]||(e[115]=a("label",{class:"form-check-label",for:"k8sOpenIngress"},"Allow this CIDR on the worker Security Group (TCP 30880)",-1))])),be.value?(n(),s("p",eo,"HTTP via the IBM-managed load balancer. Only the allowed client IP range can access this application.")):(n(),s("p",to,"Access: http://"+f(N.value.ingressHost||"your-ingress-host")+":30880. For testing, map this hostname to an accessible Kubernetes node public IP in your PC hosts file. With source-IP preservation, use a node running the Ingress Controller.",1))])):b("",!0),r.value=="Application Installation"?(n(),s("div",ao,[e[124]||(e[124]=a("label",{class:"form-label"},"HPA Configuration",-1)),a("div",lo,[a("div",so,[y(a("input",{class:"form-check-input",type:"checkbox",id:"hpaEnabled",disabled:se.value,"onUpdate:modelValue":e[31]||(e[31]=l=>R.value.hpaEnabled=l)},null,8,no),[[ye,R.value.hpaEnabled]]),e[117]||(e[117]=a("label",{class:"form-check-label",for:"hpaEnabled"}," Enable HPA (Horizontal Pod Autoscaler) ",-1))])]),R.value.hpaEnabled?(n(),s("div",oo,[a("div",null,[e[118]||(e[118]=a("label",{class:"form-label required"}," minReplicas ",-1)),y(a("input",{type:"number",class:"form-control w-90-per",placeholder:"1","onUpdate:modelValue":e[32]||(e[32]=l=>R.value.hpaMinReplicas=l)},null,512),[[U,R.value.hpaMinReplicas]])]),a("div",null,[e[119]||(e[119]=a("label",{class:"form-label required"}," maxReplicas ",-1)),y(a("input",{type:"number",class:"form-control w-90-per",placeholder:"10","onUpdate:modelValue":e[33]||(e[33]=l=>R.value.hpaMaxReplicas=l)},null,512),[[U,R.value.hpaMaxReplicas]])]),a("div",null,[e[120]||(e[120]=a("label",{class:"form-check-label mb-2"}," CPU (%) ",-1)),y(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"60","onUpdate:modelValue":e[34]||(e[34]=l=>R.value.hpaCpuUtilization=l)},null,512),[[U,R.value.hpaCpuUtilization]]),e[121]||(e[121]=ge(" % "))]),a("div",null,[e[122]||(e[122]=a("label",{class:"form-check-label mb-2"}," MEMORY (%) ",-1)),y(a("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"80","onUpdate:modelValue":e[35]||(e[35]=l=>R.value.hpaMemoryUtilization=l)},null,512),[[U,R.value.hpaMemoryUtilization]]),e[123]||(e[123]=ge(" % "))])])):b("",!0)])):b("",!0),r.value=="Application Installation"?(n(),s("div",ro,[e[126]||(e[126]=a("label",{class:"form-label"},"Workload Rebalancing",-1)),a("div",uo,[a("div",io,[y(a("input",{class:"form-check-input",type:"checkbox",id:"workloadRebalancingEnabled",disabled:se.value,"onUpdate:modelValue":e[36]||(e[36]=l=>Fe.value=l)},null,8,co),[[ye,Fe.value]]),e[125]||(e[125]=a("label",{class:"form-check-label",for:"workloadRebalancingEnabled"}," Enable Workload Rebalancing ",-1))])])])):b("",!0),r.value=="Application Installation"?(n(),s("div",vo,[e[131]||(e[131]=a("label",{class:"form-label"},"Ingress Configuration",-1)),a("div",po,[a("div",mo,[y(a("input",{class:"form-check-input",type:"checkbox",id:"ingressEnabled",disabled:se.value,"onUpdate:modelValue":e[37]||(e[37]=l=>N.value.ingressEnabled=l)},null,8,fo),[[ye,N.value.ingressEnabled]]),e[127]||(e[127]=a("label",{class:"form-check-label",for:"ingressEnabled"}," Enable Ingress ",-1)),se.value?(n(),s("p",bo,"This TCP application uses an internal ClusterIP Service, not HTTP Ingress. Use an authenticated port-forward for access from your PC.")):b("",!0)])]),N.value.ingressEnabled?(n(),s("div",go,[a("div",yo,[e[128]||(e[128]=a("label",{class:"form-label"},"Host",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"example.com","onUpdate:modelValue":e[38]||(e[38]=l=>N.value.ingressHost=l)},null,512),[[U,N.value.ingressHost]]),be.value?(n(),s("p",ho,"For local testing, map this hostname to the IBM load balancer IP in your hosts file. HTTP does not require a certificate and is not encrypted.")):b("",!0)]),a("div",Io,[e[129]||(e[129]=a("label",{class:"form-label"},"Path",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"/","onUpdate:modelValue":e[39]||(e[39]=l=>N.value.ingressPath=l)},null,512),[[U,N.value.ingressPath]])]),a("div",ko,[e[130]||(e[130]=a("label",{class:"form-label"},"Ingress Class",-1)),a("input",{type:"text",class:"form-control",placeholder:"nginx",value:be.value?"IBM managed (auto: NGINX / Traefik)":ua.value,disabled:""},null,8,Co)])])):b("",!0)])):b("",!0),r.value=="Application Installation"&&Qe.value&&O.value?(n(),s("div",So,[e[140]||(e[140]=a("label",{class:"form-label"},"Object Storage Configuration",-1)),e[141]||(e[141]=a("p",{class:"text-muted"}," Select Object Storage resources already registered in Tumblebug. CSP access keys are not sent to JupyterLab. ",-1)),a("div",wo,[y(a("input",{class:"form-check-input",type:"checkbox",id:"k8sJupyterObjectStorageEnabled","onUpdate:modelValue":e[40]||(e[40]=l=>v.value.enabled=l),disabled:kt.value},null,8,Eo),[[ye,v.value.enabled]]),e[132]||(e[132]=a("label",{class:"form-check-label",for:"k8sJupyterObjectStorageEnabled"},"Enable Object Storage",-1))]),v.value.enabled?(n(),s("div",No,[a("div",Vo,[e[133]||(e[133]=a("label",{class:"form-label mb-0 required"},"Registered Object Storage",-1)),a("button",{type:"button",class:"btn btn-sm btn-outline-secondary",disabled:xe.value,onClick:ft}," Refresh ",8,Ao)]),xe.value?(n(),s("div",To,"Loading Object Storage resources...")):He.value?(n(),s("div",Ro," Object Storage resources could not be loaded from Tumblebug. ")):he.value.length===0?(n(),s("div",Po," No Object Storage resource is registered in this namespace. ")):(n(),s("div",Mo,[(n(!0),s(x,null,L(he.value,l=>(n(),s("div",{class:"form-check",key:l.id},[y(a("input",{class:"form-check-input",type:"checkbox",id:`vm-object-storage-${l.id}`,value:l.id,disabled:String(l.status||"").toLowerCase()!=="available","onUpdate:modelValue":e[41]||(e[41]=ne=>v.value.selectedStorageIds=ne)},null,8,xo),[[ye,v.value.selectedStorageIds]]),a("label",{class:"form-check-label",for:`vm-object-storage-${l.id}`},[ge(f(l.name||l.id)+" ",1),a("span",_o," ("+f(l.provider||"unknown CSP")+f(l.region?` / ${l.region}`:"")+" / "+f(l.status||"unknown")+") ",1)],8,Uo)]))),128))])),a("div",jo,[a("div",Oo,[e[134]||(e[134]=a("label",{class:"form-label"},"Allowed Object Prefix",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"Optional: data/project-a/","onUpdate:modelValue":e[42]||(e[42]=l=>v.value.prefix=l)},null,512),[[U,v.value.prefix,void 0,{trim:!0}]])]),a("div",Do,[e[136]||(e[136]=a("label",{class:"form-label"},"Access Mode",-1)),y(a("select",{class:"form-select","onUpdate:modelValue":e[43]||(e[43]=l=>v.value.accessMode=l)},e[135]||(e[135]=[a("option",{value:"READ_ONLY"},"Read only",-1),a("option",{value:"READ_WRITE"},"Read and write",-1)]),512),[[J,v.value.accessMode]])])]),a("div",Lo,[e[137]||(e[137]=a("label",{class:"form-label required"},"Jupyter Access Token",-1)),y(a("input",{type:"password",class:"form-control",placeholder:"At least 12 characters","onUpdate:modelValue":e[44]||(e[44]=l=>v.value.jupyterToken=l),autocomplete:"new-password"},null,512),[[U,v.value.jupyterToken]]),e[138]||(e[138]=a("p",{class:"text-muted mt-1 mb-0"}," This is the Jupyter login token, not a CSP secret key. Use it at the Ingress URL shown below. ",-1))]),e[139]||(e[139]=a("p",{class:"text-muted mt-2 mb-0"}," Jupyter requests short-lived presigned URLs through Application Manager. Multiple CSPs can be selected. ",-1)),j.value?(n(),s("div",{key:4,class:we(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[a("div",null,f(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),a("ul",Go,[(n(!0),s(x,null,L(j.value.checks,l=>(n(),s("li",{key:l.name},f(l.name)+" - "+f(l.success?"OK":"FAIL"),1))),128))])],2)):b("",!0)])):b("",!0)])):b("",!0),r.value=="Application Installation"&&Qe.value&&!O.value?(n(),s("div",Ko,[e[151]||(e[151]=a("label",{class:"form-label"},"Object Storage Configuration",-1)),a("div",Bo,[a("div",$o,[y(a("input",{class:"form-check-input",type:"checkbox",id:"objectStorageEnabled","onUpdate:modelValue":e[45]||(e[45]=l=>v.value.enabled=l),disabled:kt.value},null,8,Fo),[[ye,v.value.enabled]]),e[142]||(e[142]=a("label",{class:"form-check-label",for:"objectStorageEnabled"}," Enable Object Storage ",-1))])]),v.value.enabled?(n(),s("div",Ho,[a("div",qo,[a("div",zo,[e[143]||(e[143]=a("label",{class:"form-label"},"Target CSP",-1)),a("input",{type:"text",class:"form-control",value:yt.value||"-",disabled:""},null,8,Yo)]),e[144]||(e[144]=a("div",{class:"w-50 ms-2"},[a("label",{class:"form-label"},"Storage API"),a("input",{type:"text",class:"form-control",value:"S3-compatible",disabled:""})],-1))]),a("div",Jo,[e[145]||(e[145]=a("label",{class:"form-label"},"S3-compatible Endpoint",-1)),y(a("input",{type:"text",class:"form-control",placeholder:qa.value,"onUpdate:modelValue":e[46]||(e[46]=l=>v.value.endpoint=l)},null,8,Wo),[[U,v.value.endpoint]])]),a("div",Qo,[a("div",Xo,[e[146]||(e[146]=a("label",{class:"form-label"},"Region",-1)),y(a("input",{type:"text",class:"form-control",placeholder:za.value,"onUpdate:modelValue":e[47]||(e[47]=l=>v.value.region=l)},null,8,Zo),[[U,v.value.region]])]),a("div",er,[e[147]||(e[147]=a("label",{class:"form-label"},"Bucket Name",-1)),y(a("input",{type:"text",class:"form-control",placeholder:"object-storage-bucket","onUpdate:modelValue":e[48]||(e[48]=l=>v.value.bucket=l)},null,512),[[U,v.value.bucket]])])]),a("div",tr,[a("div",ar,[e[148]||(e[148]=a("label",{class:"form-label"},"Access Key ID",-1)),y(a("input",{type:"password",class:"form-control",placeholder:"access key id","onUpdate:modelValue":e[49]||(e[49]=l=>v.value.accessKey=l),autocomplete:"off"},null,512),[[U,v.value.accessKey]])]),a("div",lr,[e[149]||(e[149]=a("label",{class:"form-label"},"Secret Access Key",-1)),y(a("input",{type:"password",class:"form-control",placeholder:"secret access key","onUpdate:modelValue":e[50]||(e[50]=l=>v.value.secretKey=l),autocomplete:"off"},null,512),[[U,v.value.secretKey]])])]),a("div",sr,[a("div",nr,[y(a("input",{class:"form-check-input",type:"checkbox",id:"forcePathStyle","onUpdate:modelValue":e[51]||(e[51]=l=>v.value.forcePathStyle=l)},null,512),[[ye,v.value.forcePathStyle]]),e[150]||(e[150]=a("label",{class:"form-check-label",for:"forcePathStyle",title:"On: endpoint/bucket/object. Off: bucket.endpoint/object."},"Use path-style URL",-1))])]),j.value?(n(),s("div",{key:0,class:we(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[a("div",null,f(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),a("ul",or,[(n(!0),s(x,null,L(j.value.checks,l=>(n(),s("li",{key:l.name},f(l.name)+" - "+f(l.success?"OK":"FAIL"),1))),128))])],2)):b("",!0)])):b("",!0)])):b("",!0)],64)):b("",!0)],8,Wl),[[rl,!le.value]])],6),Gt.value&&!le.value?(n(),s("div",rr,e[152]||(e[152]=[a("p",{class:"alert alert-warning"},"Jupyter installation is unavailable for KT because AM does not support KT Object Storage integration.",-1)]))):b("",!0),!le.value&&(qe.value.length||at.value.length)?(n(),s("div",ur,[(n(!0),s(x,null,L(qe.value,l=>(n(),s("div",{key:l,class:"alert alert-danger",role:"alert"},f(l),1))),128)),(n(!0),s(x,null,L(at.value,l=>(n(),s("div",{key:l,class:"alert alert-warning"},f(l),1))),128))])):b("",!0),a("div",ir,[a("a",{class:"btn btn-link link-secondary","data-bs-dismiss":t.embedded?void 0:"modal",onClick:na},f(le.value?"Close":"Cancel"),9,dr),le.value?(n(),s("button",{key:0,type:"button",class:"btn btn-primary",onClick:oa}," View Apps Status ")):(n(),s("div",cr,[r.value=="Application Installation"&&Bt.value?(n(),s("button",{key:0,class:"btn btn-outline-danger ms-auto me-1",onClick:e[52]||(e[52]=l=>Xa()),disabled:Ie.value||et.value||$t.value,title:"Writes, reads, and deletes a temporary object in the selected bucket."},f(et.value?"Checking...":"Storage Check"),9,vr)):b("",!0),r.value=="Application Installation"?(n(),s("button",{key:1,class:"btn btn-danger ms-auto me-1",onClick:La,disabled:Ie.value||Le.value||!ie.value||!!V.value},f(Le.value?"Checking...":"Spec Check"),9,pr)):b("",!0),a("button",{class:"btn btn-primary ms-auto",onClick:Da,disabled:Ya.value},f(Ie.value?"Deploying…":"Deploy"),9,mr)]))])])],2)],10,Bl),ul(pl,{"deployment-id":Qt.value,"modal-id":Zt,ref_key:"failureDetailRef",ref:Xt},null,8,["deployment-id"])],64)}}}),Vr=Al(gr,[["__scopeId","data-v-e11fd169"]]);export{Vr as A,Er as g,Nr as l,wr as p}; diff --git a/src/main/resources/static/assets/createVueComponent-DGcjOmEh.js b/src/main/resources/static/assets/createVueComponent-DGcjOmEh.js new file mode 100644 index 0000000..0ae7ec8 --- /dev/null +++ b/src/main/resources/static/assets/createVueComponent-DGcjOmEh.js @@ -0,0 +1,11 @@ +import{M as r}from"./index-B9L3o1bN.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var s={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const m=(t,a,f,h)=>({color:o="currentColor",size:l=24,stroke:w=2,title:i,class:g,...c},{attrs:d,slots:n})=>{let e=[...h.map(u=>r(...u)),...n.default?[n.default()]:[]];return i&&(e=[r("title",i),...e]),r("svg",{...s[t],width:l,height:l,...d,class:["tabler-icon",`tabler-icon-${a}`],...t==="filled"?{fill:o}:{"stroke-width":w??s[t]["stroke-width"],stroke:o},...c},e)};export{m as c}; diff --git a/src/main/resources/static/assets/index-B9L3o1bN.js b/src/main/resources/static/assets/index-B9L3o1bN.js new file mode 100644 index 0000000..5064d50 --- /dev/null +++ b/src/main/resources/static/assets/index-B9L3o1bN.js @@ -0,0 +1,42 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-CKt67AF3.js","assets/IconPlus-CfVojf7j.js","assets/createVueComponent-DGcjOmEh.js","assets/Tabulator.vue_vue_type_style_index_0_lang-BgLdySTX.js","assets/Tabulator-C0-hRjAn.css","assets/request-BQy8ZIMN.js","assets/bootstrap.esm-Ceob_0pG.js","assets/YamlGenerate-CouOuHXH.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/YamlGenerate-B5_cwrRZ.css","assets/InstallSoftwareIframe-56DCha6l.js","assets/applicationInstallationForm-CmPX1mlj.js","assets/lodash-PecLoxXt.js","assets/applicationDetailModal-DlYeJQEs.js","assets/applicationDetailModal-pbHnfNb7.css","assets/applicationInstallationForm-COPNLilm.css","assets/InstallSoftwareIframe-DWV8wQFf.css","assets/SoftwareCatalog-C_LrmSvx.js","assets/IconRefresh-vvjw0GrU.js","assets/SoftwareCatalog-KiPa5CHK.css","assets/ApplicationStatus-DR0-O9-6.js","assets/ApplicationStatus-DB1vt_4c.css","assets/ApplicationRepository-DIXbaB2_.js","assets/RepositoryList-j_fxhQrY.js","assets/repository-CExw8hce.js","assets/RepositoryDetail-Bjm5j-jk.js","assets/SoftwareCatalogListTest-Bv1oxm_T.js","assets/SoftwareCatalogListTest-C5HTJg28.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();/** +* @vue/shared v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Ca(e,t){const n=new Set(e.split(","));return s=>n.has(s)}const Me={},$s=[],cn=()=>{},Lm=()=>!1,Ii=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Sa=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Ta=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Dm=Object.prototype.hasOwnProperty,Ie=(e,t)=>Dm.call(e,t),ee=Array.isArray,Fs=e=>Ar(e)==="[object Map]",Ws=e=>Ar(e)==="[object Set]",Rc=e=>Ar(e)==="[object Date]",fe=e=>typeof e=="function",qe=e=>typeof e=="string",fn=e=>typeof e=="symbol",$e=e=>e!==null&&typeof e=="object",nf=e=>($e(e)||fe(e))&&fe(e.then)&&fe(e.catch),sf=Object.prototype.toString,Ar=e=>sf.call(e),Nm=e=>Ar(e).slice(8,-1),rf=e=>Ar(e)==="[object Object]",Aa=e=>qe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ar=Ca(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Li=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},km=/-(\w)/g,Gt=Li(e=>e.replace(km,(t,n)=>n?n.toUpperCase():"")),Mm=/\B([A-Z])/g,gs=Li(e=>e.replace(Mm,"-$1").toLowerCase()),Di=Li(e=>e.charAt(0).toUpperCase()+e.slice(1)),ui=Li(e=>e?`on${Di(e)}`:""),Bn=(e,t)=>!Object.is(e,t),fi=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},yi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$m=e=>{const t=qe(e)?Number(e):NaN;return isNaN(t)?e:t};let Pc;const af=()=>Pc||(Pc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Or(e){if(ee(e)){const t={};for(let n=0;n{if(n){const s=n.split(jm);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Hn(e){let t="";if(qe(e))t=e;else if(ee(e))for(let n=0;nds(n,t))}const cf=e=>!!(e&&e.__v_isRef===!0),xa=e=>qe(e)?e:e==null?"":ee(e)||$e(e)&&(e.toString===sf||!fe(e.toString))?cf(e)?xa(e.value):JSON.stringify(e,uf,2):String(e),uf=(e,t)=>cf(t)?uf(e,t.value):Fs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,i],o)=>(n[Do(s,o)+" =>"]=i,n),{})}:Ws(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Do(n))}:fn(t)?Do(t):$e(t)&&!ee(t)&&!rf(t)?String(t):t,Do=(e,t="")=>{var n;return fn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let mt;class ff{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=mt,!t&&mt&&(this.index=(mt.scopes||(mt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0)return;let e;for(;lr;){let t=lr;for(lr=void 0;t;){const n=t.nextEffect;if(t.nextEffect=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function gf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _f(e){let t,n=e.depsTail;for(let s=n;s;s=s.prevDep)s.version===-1?(s===n&&(n=s.prevDep),Ia(s),zm(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0;e.deps=t,e.depsTail=n}function Zo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&bf(t.dep.computed)===!1||t.dep.version!==t.version)return!0;return!!e._dirty}function bf(e){if(e.flags&2)return!1;if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===gr))return;e.globalVersion=gr;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&!Zo(e)){e.flags&=-3;return}const n=ke,s=zt;ke=e,zt=!0;try{gf(e);const i=e.fn(e._value);(t.version===0||Bn(i,e._value))&&(e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ke=n,zt=s,_f(e),e.flags&=-3}}function Ia(e){const{dep:t,prevSub:n,nextSub:s}=e;if(n&&(n.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=n,e.nextSub=void 0),t.subs===e&&(t.subs=n),!t.subs&&t.computed){t.computed.flags&=-5;for(let i=t.computed.deps;i;i=i.nextDep)Ia(i)}}function zm(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let zt=!0;const yf=[];function Un(){yf.push(zt),zt=!1}function qn(){const e=yf.pop();zt=e===void 0?!0:e}function Ic(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ke;ke=void 0;try{t()}finally{ke=n}}}let gr=0;class La{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!ke||!zt||ke===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ke)n=this.activeLink={dep:this,sub:ke,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},ke.deps?(n.prevDep=ke.depsTail,ke.depsTail.nextDep=n,ke.depsTail=n):ke.deps=ke.depsTail=n,ke.flags&4&&vf(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ke.depsTail,n.nextDep=void 0,ke.depsTail.nextDep=n,ke.depsTail=n,ke.deps===n&&(ke.deps=s)}return n}trigger(t){this.version++,gr++,this.notify(t)}notify(t){Ra();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()}finally{Pa()}}}function vf(e){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)vf(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}const vi=new WeakMap,cs=Symbol(""),ea=Symbol(""),_r=Symbol("");function ot(e,t,n){if(zt&&ke){let s=vi.get(e);s||vi.set(e,s=new Map);let i=s.get(n);i||s.set(n,i=new La),i.track()}}function En(e,t,n,s,i,o){const a=vi.get(e);if(!a){gr++;return}let c=[];if(t==="clear")c=[...a.values()];else{const f=ee(e),p=f&&Aa(n);if(f&&n==="length"){const d=Number(s);a.forEach((m,b)=>{(b==="length"||b===_r||!fn(b)&&b>=d)&&c.push(m)})}else{const d=m=>m&&c.push(m);switch(n!==void 0&&d(a.get(n)),p&&d(a.get(_r)),t){case"add":f?p&&d(a.get("length")):(d(a.get(cs)),Fs(e)&&d(a.get(ea)));break;case"delete":f||(d(a.get(cs)),Fs(e)&&d(a.get(ea)));break;case"set":Fs(e)&&d(a.get(cs));break}}}Ra();for(const f of c)f.trigger();Pa()}function Km(e,t){var n;return(n=vi.get(e))==null?void 0:n.get(t)}function Is(e){const t=Ee(e);return t===e?t:(ot(t,"iterate",_r),Kt(e)?t:t.map(it))}function Ni(e){return ot(e=Ee(e),"iterate",_r),e}const Gm={__proto__:null,[Symbol.iterator](){return ko(this,Symbol.iterator,it)},concat(...e){return Is(this).concat(...e.map(t=>ee(t)?Is(t):t))},entries(){return ko(this,"entries",e=>(e[1]=it(e[1]),e))},every(e,t){return gn(this,"every",e,t,void 0,arguments)},filter(e,t){return gn(this,"filter",e,t,n=>n.map(it),arguments)},find(e,t){return gn(this,"find",e,t,it,arguments)},findIndex(e,t){return gn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gn(this,"findLast",e,t,it,arguments)},findLastIndex(e,t){return gn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Mo(this,"includes",e)},indexOf(...e){return Mo(this,"indexOf",e)},join(e){return Is(this).join(e)},lastIndexOf(...e){return Mo(this,"lastIndexOf",e)},map(e,t){return gn(this,"map",e,t,void 0,arguments)},pop(){return tr(this,"pop")},push(...e){return tr(this,"push",e)},reduce(e,...t){return Lc(this,"reduce",e,t)},reduceRight(e,...t){return Lc(this,"reduceRight",e,t)},shift(){return tr(this,"shift")},some(e,t){return gn(this,"some",e,t,void 0,arguments)},splice(...e){return tr(this,"splice",e)},toReversed(){return Is(this).toReversed()},toSorted(e){return Is(this).toSorted(e)},toSpliced(...e){return Is(this).toSpliced(...e)},unshift(...e){return tr(this,"unshift",e)},values(){return ko(this,"values",it)}};function ko(e,t,n){const s=Ni(e),i=s[t]();return s!==e&&!Kt(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=n(o.value)),o}),i}const Jm=Array.prototype;function gn(e,t,n,s,i,o){const a=Ni(e),c=a!==e&&!Kt(e),f=a[t];if(f!==Jm[t]){const m=f.apply(e,o);return c?it(m):m}let p=n;a!==e&&(c?p=function(m,b){return n.call(this,it(m),b,e)}:n.length>2&&(p=function(m,b){return n.call(this,m,b,e)}));const d=f.call(a,p,s);return c&&i?i(d):d}function Lc(e,t,n,s){const i=Ni(e);let o=n;return i!==e&&(Kt(e)?n.length>3&&(o=function(a,c,f){return n.call(this,a,c,f,e)}):o=function(a,c,f){return n.call(this,a,it(c),f,e)}),i[t](o,...s)}function Mo(e,t,n){const s=Ee(e);ot(s,"iterate",_r);const i=s[t](...n);return(i===-1||i===!1)&&Ma(n[0])?(n[0]=Ee(n[0]),s[t](...n)):i}function tr(e,t,n=[]){Un(),Ra();const s=Ee(e)[t].apply(e,n);return Pa(),qn(),s}const Xm=Ca("__proto__,__v_isRef,__isVue"),wf=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fn));function Qm(e){fn(e)||(e=String(e));const t=Ee(this);return ot(t,"has",e),t.hasOwnProperty(e)}class Ef{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(i?o?ug:Af:o?Tf:Sf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=ee(t);if(!i){let f;if(a&&(f=Gm[n]))return f;if(n==="hasOwnProperty")return Qm}const c=Reflect.get(t,n,ze(t)?t:s);return(fn(n)?wf.has(n):Xm(n))||(i||ot(t,"get",n),o)?c:ze(c)?a&&Aa(n)?c:c.value:$e(c)?i?xf(c):xr(c):c}}class Cf extends Ef{constructor(t=!1){super(!1,t)}set(t,n,s,i){let o=t[n];if(!this._isShallow){const f=hs(o);if(!Kt(s)&&!hs(s)&&(o=Ee(o),s=Ee(s)),!ee(t)&&ze(o)&&!ze(s))return f?!1:(o.value=s,!0)}const a=ee(t)&&Aa(n)?Number(n)e,ki=e=>Reflect.getPrototypeOf(e);function si(e,t,n=!1,s=!1){e=e.__v_raw;const i=Ee(e),o=Ee(t);n||(Bn(t,o)&&ot(i,"get",t),ot(i,"get",o));const{has:a}=ki(i),c=s?Da:n?Fa:it;if(a.call(i,t))return c(e.get(t));if(a.call(i,o))return c(e.get(o));e!==i&&e.get(t)}function ri(e,t=!1){const n=this.__v_raw,s=Ee(n),i=Ee(e);return t||(Bn(e,i)&&ot(s,"has",e),ot(s,"has",i)),e===i?n.has(e):n.has(e)||n.has(i)}function ii(e,t=!1){return e=e.__v_raw,!t&&ot(Ee(e),"iterate",cs),Reflect.get(e,"size",e)}function Dc(e,t=!1){!t&&!Kt(e)&&!hs(e)&&(e=Ee(e));const n=Ee(this);return ki(n).has.call(n,e)||(n.add(e),En(n,"add",e,e)),this}function Nc(e,t,n=!1){!n&&!Kt(t)&&!hs(t)&&(t=Ee(t));const s=Ee(this),{has:i,get:o}=ki(s);let a=i.call(s,e);a||(e=Ee(e),a=i.call(s,e));const c=o.call(s,e);return s.set(e,t),a?Bn(t,c)&&En(s,"set",e,t):En(s,"add",e,t),this}function kc(e){const t=Ee(this),{has:n,get:s}=ki(t);let i=n.call(t,e);i||(e=Ee(e),i=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return i&&En(t,"delete",e,void 0),o}function Mc(){const e=Ee(this),t=e.size!==0,n=e.clear();return t&&En(e,"clear",void 0,void 0),n}function oi(e,t){return function(s,i){const o=this,a=o.__v_raw,c=Ee(a),f=t?Da:e?Fa:it;return!e&&ot(c,"iterate",cs),a.forEach((p,d)=>s.call(i,f(p),f(d),o))}}function ai(e,t,n){return function(...s){const i=this.__v_raw,o=Ee(i),a=Fs(o),c=e==="entries"||e===Symbol.iterator&&a,f=e==="keys"&&a,p=i[e](...s),d=n?Da:t?Fa:it;return!t&&ot(o,"iterate",f?ea:cs),{next(){const{value:m,done:b}=p.next();return b?{value:m,done:b}:{value:c?[d(m[0]),d(m[1])]:d(m),done:b}},[Symbol.iterator](){return this}}}}function Rn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ng(){const e={get(o){return si(this,o)},get size(){return ii(this)},has:ri,add:Dc,set:Nc,delete:kc,clear:Mc,forEach:oi(!1,!1)},t={get(o){return si(this,o,!1,!0)},get size(){return ii(this)},has:ri,add(o){return Dc.call(this,o,!0)},set(o,a){return Nc.call(this,o,a,!0)},delete:kc,clear:Mc,forEach:oi(!1,!0)},n={get(o){return si(this,o,!0)},get size(){return ii(this,!0)},has(o){return ri.call(this,o,!0)},add:Rn("add"),set:Rn("set"),delete:Rn("delete"),clear:Rn("clear"),forEach:oi(!0,!1)},s={get(o){return si(this,o,!0,!0)},get size(){return ii(this,!0)},has(o){return ri.call(this,o,!0)},add:Rn("add"),set:Rn("set"),delete:Rn("delete"),clear:Rn("clear"),forEach:oi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=ai(o,!1,!1),n[o]=ai(o,!0,!1),t[o]=ai(o,!1,!0),s[o]=ai(o,!0,!0)}),[e,n,t,s]}const[sg,rg,ig,og]=ng();function Na(e,t){const n=t?e?og:ig:e?rg:sg;return(s,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(Ie(n,i)&&i in s?n:s,i,o)}const ag={get:Na(!1,!1)},lg={get:Na(!1,!0)},cg={get:Na(!0,!1)};const Sf=new WeakMap,Tf=new WeakMap,Af=new WeakMap,ug=new WeakMap;function fg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dg(e){return e.__v_skip||!Object.isExtensible(e)?0:fg(Nm(e))}function xr(e){return hs(e)?e:ka(e,!1,Zm,ag,Sf)}function Of(e){return ka(e,!1,tg,lg,Tf)}function xf(e){return ka(e,!0,eg,cg,Af)}function ka(e,t,n,s,i){if(!$e(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const a=dg(e);if(a===0)return e;const c=new Proxy(e,a===2?s:n);return i.set(e,c),c}function Fn(e){return hs(e)?Fn(e.__v_raw):!!(e&&e.__v_isReactive)}function hs(e){return!!(e&&e.__v_isReadonly)}function Kt(e){return!!(e&&e.__v_isShallow)}function Ma(e){return e?!!e.__v_raw:!1}function Ee(e){const t=e&&e.__v_raw;return t?Ee(t):e}function $a(e){return Object.isExtensible(e)&&of(e,"__v_skip",!0),e}const it=e=>$e(e)?xr(e):e,Fa=e=>$e(e)?xf(e):e;function ze(e){return e?e.__v_isRef===!0:!1}function ja(e){return Rf(e,!1)}function hg(e){return Rf(e,!0)}function Rf(e,t){return ze(e)?e:new pg(e,t)}class pg{constructor(t,n){this.dep=new La,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ee(t),this._value=n?t:it(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Kt(t)||hs(t);t=s?t:Ee(t),Bn(t,n)&&(this._rawValue=t,this._value=s?t:it(t),this.dep.trigger())}}function jn(e){return ze(e)?e.value:e}const mg={get:(e,t,n)=>t==="__v_raw"?e:jn(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return ze(i)&&!ze(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};function Pf(e){return Fn(e)?e:new Proxy(e,mg)}function gg(e){const t=ee(e)?new Array(e.length):{};for(const n in e)t[n]=bg(e,n);return t}class _g{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Km(Ee(this._object),this._key)}}function bg(e,t,n){const s=e[t];return ze(s)?s:new _g(e,t,n)}class yg{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new La(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gr-1,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){ke!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return bf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function vg(e,t,n=!1){let s,i;return fe(e)?s=e:(s=e.get,i=e.set),new yg(s,i,n)}const li={},wi=new WeakMap;let os;function wg(e,t=!1,n=os){if(n){let s=wi.get(n);s||wi.set(n,s=[]),s.push(e)}}function Eg(e,t,n=Me){const{immediate:s,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=n,p=H=>i?H:Kt(H)||i===!1||i===0?vn(H,1):vn(H);let d,m,b,w,C=!1,P=!1;if(ze(e)?(m=()=>e.value,C=Kt(e)):Fn(e)?(m=()=>p(e),C=!0):ee(e)?(P=!0,C=e.some(H=>Fn(H)||Kt(H)),m=()=>e.map(H=>{if(ze(H))return H.value;if(Fn(H))return p(H);if(fe(H))return f?f(H,2):H()})):fe(e)?t?m=f?()=>f(e,2):e:m=()=>{if(b){Un();try{b()}finally{qn()}}const H=os;os=d;try{return f?f(e,3,[w]):e(w)}finally{os=H}}:m=cn,t&&i){const H=m,Y=i===!0?1/0:i;m=()=>vn(H(),Y)}const R=hf(),$=()=>{d.stop(),R&&Ta(R.effects,d)};if(o)if(t){const H=t;t=(...Y)=>{H(...Y),$()}}else{const H=m;m=()=>{H(),$()}}let N=P?new Array(e.length).fill(li):li;const B=H=>{if(!(!(d.flags&1)||!d.dirty&&!H))if(t){const Y=d.run();if(i||C||(P?Y.some((ge,le)=>Bn(ge,N[le])):Bn(Y,N))){b&&b();const ge=os;os=d;try{const le=[Y,N===li?void 0:P&&N[0]===li?[]:N,w];f?f(t,3,le):t(...le),N=Y}finally{os=ge}}}else d.run()};return c&&c(B),d=new pf(m),d.scheduler=a?()=>a(B,!1):B,w=H=>wg(H,!1,d),b=d.onStop=()=>{const H=wi.get(d);if(H){if(f)f(H,4);else for(const Y of H)Y();wi.delete(d)}},t?s?B(!0):N=d.run():a?a(B.bind(null,!0),!0):d.run(),$.pause=d.pause.bind(d),$.resume=d.resume.bind(d),$.stop=$,$}function vn(e,t=1/0,n){if(t<=0||!$e(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,ze(e))vn(e.value,t,n);else if(ee(e))for(let s=0;s{vn(s,t,n)});else if(rf(e)){for(const s in e)vn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&vn(e[s],t,n)}return e}/** +* @vue/runtime-core v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Rr(e,t,n,s){try{return s?e(...s):e()}catch(i){Mi(i,t,n)}}function Jt(e,t,n,s){if(fe(e)){const i=Rr(e,t,n,s);return i&&nf(i)&&i.catch(o=>{Mi(o,t,n)}),i}if(ee(e)){const i=[];for(let o=0;o>>1,i=gt[s],o=yr(i);o=yr(n)?gt.push(e):gt.splice(Sg(t),0,e),e.flags|=1,Lf()}}function Lf(){!br&&!ta&&(ta=!0,Ba=If.then(Nf))}function Tg(e){ee(e)?js.push(...e):kn&&e.id===-1?kn.splice(Ns+1,0,e):e.flags&1||(js.push(e),e.flags|=1),Lf()}function $c(e,t,n=br?an+1:0){for(;nyr(n)-yr(s));if(js.length=0,kn){kn.push(...t);return}for(kn=t,Ns=0;Nse.id==null?e.flags&2?-1:1/0:e.id;function Nf(e){ta=!1,br=!0;try{for(an=0;an{s._d&&Kc(-1);const o=Ei(t);let a;try{a=e(...i)}finally{Ei(o),s._d&&Kc(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function n0(e,t){if(Je===null)return e;const n=Ui(Je),s=e.dirs||(e.dirs=[]);for(let i=0;ie.__isTeleport,Ls=Symbol("_leaveCb"),ci=Symbol("_enterCb");function xg(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Bf(()=>{e.isMounted=!0}),Vf(()=>{e.isUnmounting=!0}),e}const $t=[Function,Array],Rg={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$t,onEnter:$t,onAfterEnter:$t,onEnterCancelled:$t,onBeforeLeave:$t,onLeave:$t,onAfterLeave:$t,onLeaveCancelled:$t,onBeforeAppear:$t,onAppear:$t,onAfterAppear:$t,onAppearCancelled:$t};function Pg(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function na(e,t,n,s,i){const{appear:o,mode:a,persisted:c=!1,onBeforeEnter:f,onEnter:p,onAfterEnter:d,onEnterCancelled:m,onBeforeLeave:b,onLeave:w,onAfterLeave:C,onLeaveCancelled:P,onBeforeAppear:R,onAppear:$,onAfterAppear:N,onAppearCancelled:B}=t,H=String(e.key),Y=Pg(n,e),ge=(q,oe)=>{q&&Jt(q,s,9,oe)},le=(q,oe)=>{const ve=oe[1];ge(q,oe),ee(q)?q.every(G=>G.length<=1)&&ve():q.length<=1&&ve()},te={mode:a,persisted:c,beforeEnter(q){let oe=f;if(!n.isMounted)if(o)oe=R||f;else return;q[Ls]&&q[Ls](!0);const ve=Y[H];ve&&ks(e,ve)&&ve.el[Ls]&&ve.el[Ls](),ge(oe,[q])},enter(q){let oe=p,ve=d,G=m;if(!n.isMounted)if(o)oe=$||p,ve=N||d,G=B||m;else return;let be=!1;const He=q[ci]=st=>{be||(be=!0,st?ge(G,[q]):ge(ve,[q]),te.delayedLeave&&te.delayedLeave(),q[ci]=void 0)};oe?le(oe,[q,He]):He()},leave(q,oe){const ve=String(e.key);if(q[ci]&&q[ci](!0),n.isUnmounting)return oe();ge(b,[q]);let G=!1;const be=q[Ls]=He=>{G||(G=!0,oe(),He?ge(P,[q]):ge(C,[q]),q[Ls]=void 0,Y[ve]===e&&delete Y[ve])};Y[ve]=e,w?le(w,[q,be]):be()},clone(q){return na(q,t,n,s)}};return te}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Mf(e,t=!1,n){let s=[],i=0;for(let o=0;o1)for(let o=0;osa(C,t&&(ee(t)?t[P]:t),n,s,i));return}if(Bs(s)&&!i)return;const o=s.shapeFlag&4?Ui(s.component):s.el,a=i?null:o,{i:c,r:f}=e,p=t&&t.r,d=c.refs===Me?c.refs={}:c.refs,m=c.setupState,b=Ee(m),w=m===Me?()=>!1:C=>Ie(b,C);if(p!=null&&p!==f&&(qe(p)?(d[p]=null,w(p)&&(m[p]=null)):ze(p)&&(p.value=null)),fe(f))Rr(f,c,12,[a,d]);else{const C=qe(f),P=ze(f);if(C||P){const R=()=>{if(e.f){const $=C?w(f)?m[f]:d[f]:f.value;i?ee($)&&Ta($,o):ee($)?$.includes(o)||$.push(o):C?(d[f]=[o],w(f)&&(m[f]=d[f])):(f.value=[o],e.k&&(d[e.k]=f.value))}else C?(d[f]=a,w(f)&&(m[f]=a)):P&&(f.value=a,e.k&&(d[e.k]=a))};a?(R.id=-1,St(R,n)):R()}}}const Bs=e=>!!e.type.__asyncLoader,Ff=e=>e.type.__isKeepAlive;function Ig(e,t){jf(e,"a",t)}function Lg(e,t){jf(e,"da",t)}function jf(e,t,n=Ze){const s=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if($i(t,s,n),n){let i=n.parent;for(;i&&i.parent;)Ff(i.parent.vnode)&&Dg(s,t,n,i),i=i.parent}}function Dg(e,t,n,s){const i=$i(t,e,s,!0);Uf(()=>{Ta(s[t],i)},n)}function $i(e,t,n=Ze,s=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...a)=>{Un();const c=Lr(n),f=Jt(t,n,e,a);return c(),qn(),f});return s?i.unshift(o):i.push(o),o}}const Tn=e=>(t,n=Ze)=>{(!Vi||e==="sp")&&$i(e,(...s)=>t(...s),n)},Ng=Tn("bm"),Bf=Tn("m"),kg=Tn("bu"),Hf=Tn("u"),Vf=Tn("bum"),Uf=Tn("um"),Mg=Tn("sp"),$g=Tn("rtg"),Fg=Tn("rtc");function jg(e,t=Ze){$i("ec",e,t)}const qf="components";function cr(e,t){return zf(qf,e,!0,t)||e}const Wf=Symbol.for("v-ndc");function Va(e){return qe(e)?zf(qf,e,!1)||e:e||Wf}function zf(e,t,n=!0,s=!1){const i=Je||Ze;if(i){const o=i.type;{const c=O_(o,!1);if(c&&(c===t||c===Gt(t)||c===Di(Gt(t))))return o}const a=Fc(i[e]||o[e],t)||Fc(i.appContext[e],t);return!a&&s?o:a}}function Fc(e,t){return e&&(e[t]||e[Gt(t)]||e[Di(Gt(t))])}function jc(e,t,n,s){let i;const o=n,a=ee(e);if(a||qe(e)){const c=a&&Fn(e);c&&(e=Ni(e)),i=new Array(e.length);for(let f=0,p=e.length;ft(c,f,void 0,o));else{const c=Object.keys(e);i=new Array(c.length);for(let f=0,p=c.length;fSi(t)?!(t.type===Sn||t.type===tt&&!Kf(t.children)):!0)?e:null}function Hg(e,t){const n={};for(const s in e)n[ui(s)]=e[s];return n}const ra=e=>e?pd(e)?Ui(e):ra(e.parent):null,ur=Ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ra(e.parent),$root:e=>ra(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ua(e),$forceUpdate:e=>e.f||(e.f=()=>{Ha(e.update)}),$nextTick:e=>e.n||(e.n=Pr.bind(e.proxy)),$watch:e=>c_.bind(e)}),$o=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ie(e,t),Vg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:o,accessCache:a,type:c,appContext:f}=e;let p;if(t[0]!=="$"){const w=a[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if($o(s,t))return a[t]=1,s[t];if(i!==Me&&Ie(i,t))return a[t]=2,i[t];if((p=e.propsOptions[0])&&Ie(p,t))return a[t]=3,o[t];if(n!==Me&&Ie(n,t))return a[t]=4,n[t];ia&&(a[t]=0)}}const d=ur[t];let m,b;if(d)return t==="$attrs"&&ot(e.attrs,"get",""),d(e);if((m=c.__cssModules)&&(m=m[t]))return m;if(n!==Me&&Ie(n,t))return a[t]=4,n[t];if(b=f.config.globalProperties,Ie(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:i,ctx:o}=e;return $o(i,t)?(i[t]=n,!0):s!==Me&&Ie(s,t)?(s[t]=n,!0):Ie(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:i,propsOptions:o}},a){let c;return!!n[a]||e!==Me&&Ie(e,a)||$o(t,a)||(c=o[0])&&Ie(c,a)||Ie(s,a)||Ie(ur,a)||Ie(i.config.globalProperties,a)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ie(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Bc(e){return ee(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ia=!0;function Ug(e){const t=Ua(e),n=e.proxy,s=e.ctx;ia=!1,t.beforeCreate&&Hc(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:c,provide:f,inject:p,created:d,beforeMount:m,mounted:b,beforeUpdate:w,updated:C,activated:P,deactivated:R,beforeDestroy:$,beforeUnmount:N,destroyed:B,unmounted:H,render:Y,renderTracked:ge,renderTriggered:le,errorCaptured:te,serverPrefetch:q,expose:oe,inheritAttrs:ve,components:G,directives:be,filters:He}=t;if(p&&qg(p,s,null),a)for(const ae in a){const Se=a[ae];fe(Se)&&(s[ae]=Se.bind(n))}if(i){const ae=i.call(n,n);$e(ae)&&(e.data=xr(ae))}if(ia=!0,o)for(const ae in o){const Se=o[ae],Pt=fe(Se)?Se.bind(n,n):fe(Se.get)?Se.get.bind(n,n):cn,I=!fe(Se)&&fe(Se.set)?Se.set.bind(n):cn,_t=Ft({get:Pt,set:I});Object.defineProperty(s,ae,{enumerable:!0,configurable:!0,get:()=>_t.value,set:et=>_t.value=et})}if(c)for(const ae in c)Gf(c[ae],s,n,ae);if(f){const ae=fe(f)?f.call(n):f;Reflect.ownKeys(ae).forEach(Se=>{di(Se,ae[Se])})}d&&Hc(d,e,"c");function Oe(ae,Se){ee(Se)?Se.forEach(Pt=>ae(Pt.bind(n))):Se&&ae(Se.bind(n))}if(Oe(Ng,m),Oe(Bf,b),Oe(kg,w),Oe(Hf,C),Oe(Ig,P),Oe(Lg,R),Oe(jg,te),Oe(Fg,ge),Oe($g,le),Oe(Vf,N),Oe(Uf,H),Oe(Mg,q),ee(oe))if(oe.length){const ae=e.exposed||(e.exposed={});oe.forEach(Se=>{Object.defineProperty(ae,Se,{get:()=>n[Se],set:Pt=>n[Se]=Pt})})}else e.exposed||(e.exposed={});Y&&e.render===cn&&(e.render=Y),ve!=null&&(e.inheritAttrs=ve),G&&(e.components=G),be&&(e.directives=be),q&&$f(e)}function qg(e,t,n=cn){ee(e)&&(e=oa(e));for(const s in e){const i=e[s];let o;$e(i)?"default"in i?o=xt(i.from||s,i.default,!0):o=xt(i.from||s):o=xt(i),ze(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[s]=o}}function Hc(e,t,n){Jt(ee(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gf(e,t,n,s){let i=s.includes(".")?ld(n,s):()=>n[s];if(qe(e)){const o=t[e];fe(o)&&fr(i,o)}else if(fe(e))fr(i,e.bind(n));else if($e(e))if(ee(e))e.forEach(o=>Gf(o,t,n,s));else{const o=fe(e.handler)?e.handler.bind(n):t[e.handler];fe(o)&&fr(i,o,e)}}function Ua(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,c=o.get(t);let f;return c?f=c:!i.length&&!n&&!s?f=t:(f={},i.length&&i.forEach(p=>Ci(f,p,a,!0)),Ci(f,t,a)),$e(t)&&o.set(t,f),f}function Ci(e,t,n,s=!1){const{mixins:i,extends:o}=t;o&&Ci(e,o,n,!0),i&&i.forEach(a=>Ci(e,a,n,!0));for(const a in t)if(!(s&&a==="expose")){const c=Wg[a]||n&&n[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Wg={data:Vc,props:Uc,emits:Uc,methods:or,computed:or,beforeCreate:pt,created:pt,beforeMount:pt,mounted:pt,beforeUpdate:pt,updated:pt,beforeDestroy:pt,beforeUnmount:pt,destroyed:pt,unmounted:pt,activated:pt,deactivated:pt,errorCaptured:pt,serverPrefetch:pt,components:or,directives:or,watch:Kg,provide:Vc,inject:zg};function Vc(e,t){return t?e?function(){return Ge(fe(e)?e.call(this,this):e,fe(t)?t.call(this,this):t)}:t:e}function zg(e,t){return or(oa(e),oa(t))}function oa(e){if(ee(e)){const t={};for(let n=0;n1)return n&&fe(t)?t.call(s&&s.proxy):t}}function Xg(){return!!(Ze||Je||us)}const Xf={},Qf=()=>Object.create(Xf),Yf=e=>Object.getPrototypeOf(e)===Xf;function Qg(e,t,n,s=!1){const i={},o=Qf();e.propsDefaults=Object.create(null),Zf(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);n?e.props=s?i:Of(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function Yg(e,t,n,s){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,c=Ee(i),[f]=e.propsOptions;let p=!1;if((s||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m{f=!0;const[b,w]=ed(m,t,!0);Ge(a,b),w&&c.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!f)return $e(e)&&s.set(e,$s),$s;if(ee(o))for(let d=0;de[0]==="_"||e==="$stable",qa=e=>ee(e)?e.map(ln):[ln(e)],e_=(e,t,n)=>{if(t._n)return t;const s=Ir((...i)=>qa(t(...i)),n);return s._c=!1,s},nd=(e,t,n)=>{const s=e._ctx;for(const i in e){if(td(i))continue;const o=e[i];if(fe(o))t[i]=e_(i,o,s);else if(o!=null){const a=qa(o);t[i]=()=>a}}},sd=(e,t)=>{const n=qa(t);e.slots.default=()=>n},rd=(e,t,n)=>{for(const s in t)(n||s!=="_")&&(e[s]=t[s])},t_=(e,t,n)=>{const s=e.slots=Qf();if(e.vnode.shapeFlag&32){const i=t._;i?(rd(s,t,n),n&&of(s,"_",i,!0)):nd(t,s)}else t&&sd(e,t)},n_=(e,t,n)=>{const{vnode:s,slots:i}=e;let o=!0,a=Me;if(s.shapeFlag&32){const c=t._;c?n&&c===1?o=!1:rd(i,t,n):(o=!t.$stable,nd(t,i)),a=t}else t&&(sd(e,t),a={default:1});if(o)for(const c in i)!td(c)&&a[c]==null&&delete i[c]},St=g_;function s_(e){return r_(e)}function r_(e,t){const n=af();n.__VUE__=!0;const{insert:s,remove:i,patchProp:o,createElement:a,createText:c,createComment:f,setText:p,setElementText:d,parentNode:m,nextSibling:b,setScopeId:w=cn,insertStaticContent:C}=e,P=(g,_,E,D=null,O=null,k=null,W=void 0,V=null,F=!!_.dynamicChildren)=>{if(g===_)return;g&&!ks(g,_)&&(D=x(g),et(g,O,k,!0),g=null),_.patchFlag===-2&&(F=!1,_.dynamicChildren=null);const{type:M,ref:ne,shapeFlag:z}=_;switch(M){case ji:R(g,_,E,D);break;case Sn:$(g,_,E,D);break;case hi:g==null&&N(_,E,D,W);break;case tt:G(g,_,E,D,O,k,W,V,F);break;default:z&1?Y(g,_,E,D,O,k,W,V,F):z&6?be(g,_,E,D,O,k,W,V,F):(z&64||z&128)&&M.process(g,_,E,D,O,k,W,V,F,Z)}ne!=null&&O&&sa(ne,g&&g.ref,k,_||g,!_)},R=(g,_,E,D)=>{if(g==null)s(_.el=c(_.children),E,D);else{const O=_.el=g.el;_.children!==g.children&&p(O,_.children)}},$=(g,_,E,D)=>{g==null?s(_.el=f(_.children||""),E,D):_.el=g.el},N=(g,_,E,D)=>{[g.el,g.anchor]=C(g.children,_,E,D,g.el,g.anchor)},B=({el:g,anchor:_},E,D)=>{let O;for(;g&&g!==_;)O=b(g),s(g,E,D),g=O;s(_,E,D)},H=({el:g,anchor:_})=>{let E;for(;g&&g!==_;)E=b(g),i(g),g=E;i(_)},Y=(g,_,E,D,O,k,W,V,F)=>{_.type==="svg"?W="svg":_.type==="math"&&(W="mathml"),g==null?ge(_,E,D,O,k,W,V,F):q(g,_,O,k,W,V,F)},ge=(g,_,E,D,O,k,W,V)=>{let F,M;const{props:ne,shapeFlag:z,transition:Q,dirs:re}=g;if(F=g.el=a(g.type,k,ne&&ne.is,ne),z&8?d(F,g.children):z&16&&te(g.children,F,null,D,O,Fo(g,k),W,V),re&&ss(g,null,D,"created"),le(F,g,g.scopeId,W,D),ne){for(const Ce in ne)Ce!=="value"&&!ar(Ce)&&o(F,Ce,null,ne[Ce],k,D);"value"in ne&&o(F,"value",null,ne.value,k),(M=ne.onVnodeBeforeMount)&&rn(M,D,g)}re&&ss(g,null,D,"beforeMount");const pe=i_(O,Q);pe&&Q.beforeEnter(F),s(F,_,E),((M=ne&&ne.onVnodeMounted)||pe||re)&&St(()=>{M&&rn(M,D,g),pe&&Q.enter(F),re&&ss(g,null,D,"mounted")},O)},le=(g,_,E,D,O)=>{if(E&&w(g,E),D)for(let k=0;k{for(let M=F;M{const V=_.el=g.el;let{patchFlag:F,dynamicChildren:M,dirs:ne}=_;F|=g.patchFlag&16;const z=g.props||Me,Q=_.props||Me;let re;if(E&&rs(E,!1),(re=Q.onVnodeBeforeUpdate)&&rn(re,E,_,g),ne&&ss(_,g,E,"beforeUpdate"),E&&rs(E,!0),(z.innerHTML&&Q.innerHTML==null||z.textContent&&Q.textContent==null)&&d(V,""),M?oe(g.dynamicChildren,M,V,E,D,Fo(_,O),k):W||Se(g,_,V,null,E,D,Fo(_,O),k,!1),F>0){if(F&16)ve(V,z,Q,E,O);else if(F&2&&z.class!==Q.class&&o(V,"class",null,Q.class,O),F&4&&o(V,"style",z.style,Q.style,O),F&8){const pe=_.dynamicProps;for(let Ce=0;Ce{re&&rn(re,E,_,g),ne&&ss(_,g,E,"updated")},D)},oe=(g,_,E,D,O,k,W)=>{for(let V=0;V<_.length;V++){const F=g[V],M=_[V],ne=F.el&&(F.type===tt||!ks(F,M)||F.shapeFlag&70)?m(F.el):E;P(F,M,ne,null,D,O,k,W,!0)}},ve=(g,_,E,D,O)=>{if(_!==E){if(_!==Me)for(const k in _)!ar(k)&&!(k in E)&&o(g,k,_[k],null,O,D);for(const k in E){if(ar(k))continue;const W=E[k],V=_[k];W!==V&&k!=="value"&&o(g,k,V,W,O,D)}"value"in E&&o(g,"value",_.value,E.value,O)}},G=(g,_,E,D,O,k,W,V,F)=>{const M=_.el=g?g.el:c(""),ne=_.anchor=g?g.anchor:c("");let{patchFlag:z,dynamicChildren:Q,slotScopeIds:re}=_;re&&(V=V?V.concat(re):re),g==null?(s(M,E,D),s(ne,E,D),te(_.children||[],E,ne,O,k,W,V,F)):z>0&&z&64&&Q&&g.dynamicChildren?(oe(g.dynamicChildren,Q,E,O,k,W,V),(_.key!=null||O&&_===O.subTree)&&id(g,_,!0)):Se(g,_,E,ne,O,k,W,V,F)},be=(g,_,E,D,O,k,W,V,F)=>{_.slotScopeIds=V,g==null?_.shapeFlag&512?O.ctx.activate(_,E,D,W,F):He(_,E,D,O,k,W,F):st(g,_,F)},He=(g,_,E,D,O,k,W)=>{const V=g.component=E_(g,D,O);if(Ff(g)&&(V.ctx.renderer=Z),C_(V,!1,W),V.asyncDep){if(O&&O.registerDep(V,Oe,W),!g.el){const F=V.subTree=nt(Sn);$(null,F,_,E)}}else Oe(V,g,_,E,O,k,W)},st=(g,_,E)=>{const D=_.component=g.component;if(p_(g,_,E))if(D.asyncDep&&!D.asyncResolved){ae(D,_,E);return}else D.next=_,D.update();else _.el=g.el,D.vnode=_},Oe=(g,_,E,D,O,k,W)=>{const V=()=>{if(g.isMounted){let{next:z,bu:Q,u:re,parent:pe,vnode:Ce}=g;{const lt=od(g);if(lt){z&&(z.el=Ce.el,ae(g,z,W)),lt.asyncDep.then(()=>{g.isUnmounted||V()});return}}let ye=z,Xe;rs(g,!1),z?(z.el=Ce.el,ae(g,z,W)):z=Ce,Q&&fi(Q),(Xe=z.props&&z.props.onVnodeBeforeUpdate)&&rn(Xe,pe,z,Ce),rs(g,!0);const Qe=jo(g),at=g.subTree;g.subTree=Qe,P(at,Qe,m(at.el),x(at),g,O,k),z.el=Qe.el,ye===null&&m_(g,Qe.el),re&&St(re,O),(Xe=z.props&&z.props.onVnodeUpdated)&&St(()=>rn(Xe,pe,z,Ce),O)}else{let z;const{el:Q,props:re}=_,{bm:pe,m:Ce,parent:ye,root:Xe,type:Qe}=g,at=Bs(_);if(rs(g,!1),pe&&fi(pe),!at&&(z=re&&re.onVnodeBeforeMount)&&rn(z,ye,_),rs(g,!0),Q&&je){const lt=()=>{g.subTree=jo(g),je(Q,g.subTree,g,O,null)};at&&Qe.__asyncHydrate?Qe.__asyncHydrate(Q,g,lt):lt()}else{Xe.ce&&Xe.ce._injectChildStyle(Qe);const lt=g.subTree=jo(g);P(null,lt,E,D,g,O,k),_.el=lt.el}if(Ce&&St(Ce,O),!at&&(z=re&&re.onVnodeMounted)){const lt=_;St(()=>rn(z,ye,lt),O)}(_.shapeFlag&256||ye&&Bs(ye.vnode)&&ye.vnode.shapeFlag&256)&&g.a&&St(g.a,O),g.isMounted=!0,_=E=D=null}};g.scope.on();const F=g.effect=new pf(V);g.scope.off();const M=g.update=F.run.bind(F),ne=g.job=F.runIfDirty.bind(F);ne.i=g,ne.id=g.uid,F.scheduler=()=>Ha(ne),rs(g,!0),M()},ae=(g,_,E)=>{_.component=g;const D=g.vnode.props;g.vnode=_,g.next=null,Yg(g,_.props,D,E),n_(g,_.children,E),Un(),$c(g),qn()},Se=(g,_,E,D,O,k,W,V,F=!1)=>{const M=g&&g.children,ne=g?g.shapeFlag:0,z=_.children,{patchFlag:Q,shapeFlag:re}=_;if(Q>0){if(Q&128){I(M,z,E,D,O,k,W,V,F);return}else if(Q&256){Pt(M,z,E,D,O,k,W,V,F);return}}re&8?(ne&16&&Be(M,O,k),z!==M&&d(E,z)):ne&16?re&16?I(M,z,E,D,O,k,W,V,F):Be(M,O,k,!0):(ne&8&&d(E,""),re&16&&te(z,E,D,O,k,W,V,F))},Pt=(g,_,E,D,O,k,W,V,F)=>{g=g||$s,_=_||$s;const M=g.length,ne=_.length,z=Math.min(M,ne);let Q;for(Q=0;Qne?Be(g,O,k,!0,!1,z):te(_,E,D,O,k,W,V,F,z)},I=(g,_,E,D,O,k,W,V,F)=>{let M=0;const ne=_.length;let z=g.length-1,Q=ne-1;for(;M<=z&&M<=Q;){const re=g[M],pe=_[M]=F?Mn(_[M]):ln(_[M]);if(ks(re,pe))P(re,pe,E,null,O,k,W,V,F);else break;M++}for(;M<=z&&M<=Q;){const re=g[z],pe=_[Q]=F?Mn(_[Q]):ln(_[Q]);if(ks(re,pe))P(re,pe,E,null,O,k,W,V,F);else break;z--,Q--}if(M>z){if(M<=Q){const re=Q+1,pe=reQ)for(;M<=z;)et(g[M],O,k,!0),M++;else{const re=M,pe=M,Ce=new Map;for(M=pe;M<=Q;M++){const ct=_[M]=F?Mn(_[M]):ln(_[M]);ct.key!=null&&Ce.set(ct.key,M)}let ye,Xe=0;const Qe=Q-pe+1;let at=!1,lt=0;const Wn=new Array(Qe);for(M=0;M=Qe){et(ct,O,k,!0);continue}let It;if(ct.key!=null)It=Ce.get(ct.key);else for(ye=pe;ye<=Q;ye++)if(Wn[ye-pe]===0&&ks(ct,_[ye])){It=ye;break}It===void 0?et(ct,O,k,!0):(Wn[It-pe]=M+1,It>=lt?lt=It:at=!0,P(ct,_[It],E,null,O,k,W,V,F),Xe++)}const $r=at?o_(Wn):$s;for(ye=$r.length-1,M=Qe-1;M>=0;M--){const ct=pe+M,It=_[ct],Fr=ct+1{const{el:k,type:W,transition:V,children:F,shapeFlag:M}=g;if(M&6){_t(g.component.subTree,_,E,D);return}if(M&128){g.suspense.move(_,E,D);return}if(M&64){W.move(g,_,E,Z);return}if(W===tt){s(k,_,E);for(let z=0;zV.enter(k),O);else{const{leave:z,delayLeave:Q,afterLeave:re}=V,pe=()=>s(k,_,E),Ce=()=>{z(k,()=>{pe(),re&&re()})};Q?Q(k,pe,Ce):Ce()}else s(k,_,E)},et=(g,_,E,D=!1,O=!1)=>{const{type:k,props:W,ref:V,children:F,dynamicChildren:M,shapeFlag:ne,patchFlag:z,dirs:Q,cacheIndex:re}=g;if(z===-2&&(O=!1),V!=null&&sa(V,null,E,g,!0),re!=null&&(_.renderCache[re]=void 0),ne&256){_.ctx.deactivate(g);return}const pe=ne&1&&Q,Ce=!Bs(g);let ye;if(Ce&&(ye=W&&W.onVnodeBeforeUnmount)&&rn(ye,_,g),ne&6)Zt(g.component,E,D);else{if(ne&128){g.suspense.unmount(E,D);return}pe&&ss(g,null,_,"beforeUnmount"),ne&64?g.type.remove(g,_,E,Z,D):M&&!M.hasOnce&&(k!==tt||z>0&&z&64)?Be(M,_,E,!1,!0):(k===tt&&z&384||!O&&ne&16)&&Be(F,_,E),D&&Yt(g)}(Ce&&(ye=W&&W.onVnodeUnmounted)||pe)&&St(()=>{ye&&rn(ye,_,g),pe&&ss(g,null,_,"unmounted")},E)},Yt=g=>{const{type:_,el:E,anchor:D,transition:O}=g;if(_===tt){rt(E,D);return}if(_===hi){H(g);return}const k=()=>{i(E),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(g.shapeFlag&1&&O&&!O.persisted){const{leave:W,delayLeave:V}=O,F=()=>W(E,k);V?V(g.el,k,F):F()}else k()},rt=(g,_)=>{let E;for(;g!==_;)E=b(g),i(g),g=E;i(_)},Zt=(g,_,E)=>{const{bum:D,scope:O,job:k,subTree:W,um:V,m:F,a:M}=g;Wc(F),Wc(M),D&&fi(D),O.stop(),k&&(k.flags|=8,et(W,g,_,E)),V&&St(V,_),St(()=>{g.isUnmounted=!0},_),_&&_.pendingBranch&&!_.isUnmounted&&g.asyncDep&&!g.asyncResolved&&g.suspenseId===_.pendingId&&(_.deps--,_.deps===0&&_.resolve())},Be=(g,_,E,D=!1,O=!1,k=0)=>{for(let W=k;W{if(g.shapeFlag&6)return x(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const _=b(g.anchor||g.el),E=_&&_[Ag];return E?b(E):_};let A=!1;const U=(g,_,E)=>{g==null?_._vnode&&et(_._vnode,null,null,!0):P(_._vnode||null,g,_,null,null,null,E),_._vnode=g,A||(A=!0,$c(),Df(),A=!1)},Z={p:P,um:et,m:_t,r:Yt,mt:He,mc:te,pc:Se,pbc:oe,n:x,o:e};let Te,je;return{render:U,hydrate:Te,createApp:Jg(U,Te)}}function Fo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function i_(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function id(e,t,n=!1){const s=e.children,i=t.children;if(ee(s)&&ee(i))for(let o=0;o>1,e[n[c]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,a=n[o-1];o-- >0;)n[o]=a,a=t[a];return n}function od(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:od(t)}function Wc(e){if(e)for(let t=0;txt(a_);function fr(e,t,n){return ad(e,t,n)}function ad(e,t,n=Me){const{immediate:s,deep:i,flush:o,once:a}=n,c=Ge({},n);let f;if(Vi)if(o==="sync"){const b=l_();f=b.__watcherHandles||(b.__watcherHandles=[])}else if(!t||s)c.once=!0;else return{stop:cn,resume:cn,pause:cn};const p=Ze;c.call=(b,w,C)=>Jt(b,p,w,C);let d=!1;o==="post"?c.scheduler=b=>{St(b,p&&p.suspense)}:o!=="sync"&&(d=!0,c.scheduler=(b,w)=>{w?b():Ha(b)}),c.augmentJob=b=>{t&&(b.flags|=4),d&&(b.flags|=2,p&&(b.id=p.uid,b.i=p))};const m=Eg(e,t,c);return f&&f.push(m),m}function c_(e,t,n){const s=this.proxy,i=qe(e)?e.includes(".")?ld(s,e):()=>s[e]:e.bind(s,s);let o;fe(t)?o=t:(o=t.handler,n=t);const a=Lr(this),c=ad(i,o.bind(s),n);return a(),c}function ld(e,t){const n=t.split(".");return()=>{let s=e;for(let i=0;it==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Gt(t)}Modifiers`]||e[`${gs(t)}Modifiers`];function f_(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Me;let i=n;const o=t.startsWith("update:"),a=o&&u_(s,t.slice(7));a&&(a.trim&&(i=n.map(d=>qe(d)?d.trim():d)),a.number&&(i=n.map(yi)));let c,f=s[c=ui(t)]||s[c=ui(Gt(t))];!f&&o&&(f=s[c=ui(gs(t))]),f&&Jt(f,e,6,i);const p=s[c+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Jt(p,e,6,i)}}function cd(e,t,n=!1){const s=t.emitsCache,i=s.get(e);if(i!==void 0)return i;const o=e.emits;let a={},c=!1;if(!fe(e)){const f=p=>{const d=cd(p,t,!0);d&&(c=!0,Ge(a,d))};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!o&&!c?($e(e)&&s.set(e,null),null):(ee(o)?o.forEach(f=>a[f]=null):Ge(a,o),$e(e)&&s.set(e,a),a)}function Fi(e,t){return!e||!Ii(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ie(e,t[0].toLowerCase()+t.slice(1))||Ie(e,gs(t))||Ie(e,t))}function jo(e){const{type:t,vnode:n,proxy:s,withProxy:i,propsOptions:[o],slots:a,attrs:c,emit:f,render:p,renderCache:d,props:m,data:b,setupState:w,ctx:C,inheritAttrs:P}=e,R=Ei(e);let $,N;try{if(n.shapeFlag&4){const H=i||s,Y=H;$=ln(p.call(Y,H,d,m,w,b,C)),N=c}else{const H=t;$=ln(H.length>1?H(m,{attrs:c,slots:a,emit:f}):H(m,null)),N=t.props?c:d_(c)}}catch(H){dr.length=0,Mi(H,e,1),$=nt(Sn)}let B=$;if(N&&P!==!1){const H=Object.keys(N),{shapeFlag:Y}=B;H.length&&Y&7&&(o&&H.some(Sa)&&(N=h_(N,o)),B=ps(B,N,!1,!0))}return n.dirs&&(B=ps(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&vr(B,n.transition),$=B,Ei(R),$}const d_=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ii(n))&&((t||(t={}))[n]=e[n]);return t},h_=(e,t)=>{const n={};for(const s in e)(!Sa(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function p_(e,t,n){const{props:s,children:i,component:o}=e,{props:a,children:c,patchFlag:f}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&f>=0){if(f&1024)return!0;if(f&16)return s?zc(s,a,p):!!a;if(f&8){const d=t.dynamicProps;for(let m=0;me.__isSuspense;function g_(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):Tg(e)}const tt=Symbol.for("v-fgt"),ji=Symbol.for("v-txt"),Sn=Symbol.for("v-cmt"),hi=Symbol.for("v-stc"),dr=[];let Ot=null;function Ve(e=!1){dr.push(Ot=e?null:[])}function __(){dr.pop(),Ot=dr[dr.length-1]||null}let wr=1;function Kc(e){wr+=e,e<0&&Ot&&(Ot.hasOnce=!0)}function fd(e){return e.dynamicChildren=wr>0?Ot||$s:null,__(),wr>0&&Ot&&Ot.push(e),e}function qt(e,t,n,s,i,o){return fd(_s(e,t,n,s,i,o,!0))}function jt(e,t,n,s,i){return fd(nt(e,t,n,s,i,!0))}function Si(e){return e?e.__v_isVNode===!0:!1}function ks(e,t){return e.type===t.type&&e.key===t.key}const dd=({key:e})=>e??null,pi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?qe(e)||ze(e)||fe(e)?{i:Je,r:e,k:t,f:!!n}:e:null);function _s(e,t=null,n=null,s=0,i=null,o=e===tt?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&dd(t),ref:t&&pi(t),scopeId:kf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Je};return c?(Wa(f,n),o&128&&e.normalize(f)):n&&(f.shapeFlag|=qe(n)?8:16),wr>0&&!a&&Ot&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Ot.push(f),f}const nt=b_;function b_(e,t=null,n=null,s=0,i=null,o=!1){if((!e||e===Wf)&&(e=Sn),Si(e)){const c=ps(e,t,!0);return n&&Wa(c,n),wr>0&&!o&&Ot&&(c.shapeFlag&6?Ot[Ot.indexOf(e)]=c:Ot.push(c)),c.patchFlag=-2,c}if(x_(e)&&(e=e.__vccOpts),t){t=y_(t);let{class:c,style:f}=t;c&&!qe(c)&&(t.class=Hn(c)),$e(f)&&(Ma(f)&&!ee(f)&&(f=Ge({},f)),t.style=Or(f))}const a=qe(e)?1:ud(e)?128:Og(e)?64:$e(e)?4:fe(e)?2:0;return _s(e,t,n,s,i,a,o,!0)}function y_(e){return e?Ma(e)||Yf(e)?Ge({},e):e:null}function ps(e,t,n=!1,s=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=e,p=t?Hi(i||{},t):i,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&dd(p),ref:t&&t.ref?n&&o?ee(o)?o.concat(pi(t)):[o,pi(t)]:pi(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==tt?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ps(e.ssContent),ssFallback:e.ssFallback&&ps(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return f&&s&&vr(d,f.clone(d)),d}function Bi(e=" ",t=0){return nt(ji,null,e,t)}function s0(e,t){const n=nt(hi,null,e);return n.staticCount=t,n}function Bo(e="",t=!1){return t?(Ve(),jt(Sn,null,e)):nt(Sn,null,e)}function ln(e){return e==null||typeof e=="boolean"?nt(Sn):ee(e)?nt(tt,null,e.slice()):typeof e=="object"?Mn(e):nt(ji,null,String(e))}function Mn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ps(e)}function Wa(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ee(t))n=16;else if(typeof t=="object")if(s&65){const i=t.default;i&&(i._c&&(i._d=!1),Wa(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Yf(t)?t._ctx=Je:i===3&&Je&&(Je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else fe(t)?(t={default:t,_ctx:Je},n=32):(t=String(t),s&64?(n=16,t=[Bi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Hi(...e){const t={};for(let n=0;nZe||Je;let Ti,la;{const e=af(),t=(n,s)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(s),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Ti=t("__VUE_INSTANCE_SETTERS__",n=>Ze=n),la=t("__VUE_SSR_SETTERS__",n=>Vi=n)}const Lr=e=>{const t=Ze;return Ti(e),e.scope.on(),()=>{e.scope.off(),Ti(t)}},Gc=()=>{Ze&&Ze.scope.off(),Ti(null)};function pd(e){return e.vnode.shapeFlag&4}let Vi=!1;function C_(e,t=!1,n=!1){t&&la(t);const{props:s,children:i}=e.vnode,o=pd(e);Qg(e,s,o,t),t_(e,i,n);const a=o?S_(e,t):void 0;return t&&la(!1),a}function S_(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vg);const{setup:s}=n;if(s){const i=e.setupContext=s.length>1?A_(e):null,o=Lr(e);Un();const a=Rr(s,e,0,[e.props,i]);if(qn(),o(),nf(a)){if(Bs(e)||$f(e),a.then(Gc,Gc),t)return a.then(c=>{Jc(e,c,t)}).catch(c=>{Mi(c,e,0)});e.asyncDep=a}else Jc(e,a,t)}else md(e,t)}function Jc(e,t,n){fe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:$e(t)&&(e.setupState=Pf(t)),md(e,n)}let Xc;function md(e,t,n){const s=e.type;if(!e.render){if(!t&&Xc&&!s.render){const i=s.template||Ua(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:c,compilerOptions:f}=s,p=Ge(Ge({isCustomElement:o,delimiters:c},a),f);s.render=Xc(i,p)}}e.render=s.render||cn}{const i=Lr(e);Un();try{Ug(e)}finally{qn(),i()}}}const T_={get(e,t){return ot(e,"get",""),e[t]}};function A_(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,T_),slots:e.slots,emit:e.emit,expose:t}}function Ui(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pf($a(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ur)return ur[n](e)},has(t,n){return n in t||n in ur}})):e.proxy}function O_(e,t=!0){return fe(e)?e.displayName||e.name:e.name||t&&e.__name}function x_(e){return fe(e)&&"__vccOpts"in e}const Ft=(e,t)=>vg(e,t,Vi);function gd(e,t,n){const s=arguments.length;return s===2?$e(t)&&!ee(t)?Si(t)?nt(e,null,[t]):nt(e,t):nt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Si(n)&&(n=[n]),nt(e,t,n))}const R_="3.5.3";/** +* @vue/runtime-dom v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ca;const Qc=typeof window<"u"&&window.trustedTypes;if(Qc)try{ca=Qc.createPolicy("vue",{createHTML:e=>e})}catch{}const _d=ca?e=>ca.createHTML(e):e=>e,P_="http://www.w3.org/2000/svg",I_="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,Yc=yn&&yn.createElement("template"),L_={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const i=t==="svg"?yn.createElementNS(P_,e):t==="mathml"?yn.createElementNS(I_,e):n?yn.createElement(e,{is:n}):yn.createElement(e);return e==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:e=>yn.createTextNode(e),createComment:e=>yn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,i,o){const a=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{Yc.innerHTML=_d(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const c=Yc.content;if(s==="svg"||s==="mathml"){const f=c.firstChild;for(;f.firstChild;)c.appendChild(f.firstChild);c.removeChild(f)}t.insertBefore(c,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Pn="transition",nr="animation",Hs=Symbol("_vtc"),bd={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},D_=Ge({},Rg,bd),is=(e,t=[])=>{ee(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zc=e=>e?ee(e)?e.some(t=>t.length>1):e.length>1:!1;function N_(e){const t={};for(const G in e)G in bd||(t[G]=e[G]);if(e.css===!1)return t;const{name:n="v",type:s,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:a=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:f=o,appearActiveClass:p=a,appearToClass:d=c,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,C=k_(i),P=C&&C[0],R=C&&C[1],{onBeforeEnter:$,onEnter:N,onEnterCancelled:B,onLeave:H,onLeaveCancelled:Y,onBeforeAppear:ge=$,onAppear:le=N,onAppearCancelled:te=B}=t,q=(G,be,He)=>{Dn(G,be?d:c),Dn(G,be?p:a),He&&He()},oe=(G,be)=>{G._isLeaving=!1,Dn(G,m),Dn(G,w),Dn(G,b),be&&be()},ve=G=>(be,He)=>{const st=G?le:N,Oe=()=>q(be,G,He);is(st,[be,Oe]),eu(()=>{Dn(be,G?f:o),bn(be,G?d:c),Zc(st)||tu(be,s,P,Oe)})};return Ge(t,{onBeforeEnter(G){is($,[G]),bn(G,o),bn(G,a)},onBeforeAppear(G){is(ge,[G]),bn(G,f),bn(G,p)},onEnter:ve(!1),onAppear:ve(!0),onLeave(G,be){G._isLeaving=!0;const He=()=>oe(G,be);bn(G,m),bn(G,b),vd(),eu(()=>{G._isLeaving&&(Dn(G,m),bn(G,w),Zc(H)||tu(G,s,R,He))}),is(H,[G,He])},onEnterCancelled(G){q(G,!1),is(B,[G])},onAppearCancelled(G){q(G,!0),is(te,[G])},onLeaveCancelled(G){oe(G),is(Y,[G])}})}function k_(e){if(e==null)return null;if($e(e))return[Ho(e.enter),Ho(e.leave)];{const t=Ho(e);return[t,t]}}function Ho(e){return $m(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Hs]||(e[Hs]=new Set)).add(t)}function Dn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Hs];n&&(n.delete(t),n.size||(e[Hs]=void 0))}function eu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let M_=0;function tu(e,t,n,s){const i=e._endId=++M_,o=()=>{i===e._endId&&s()};if(n)return setTimeout(o,n);const{type:a,timeout:c,propCount:f}=yd(e,t);if(!a)return s();const p=a+"end";let d=0;const m=()=>{e.removeEventListener(p,b),o()},b=w=>{w.target===e&&++d>=f&&m()};setTimeout(()=>{d(n[C]||"").split(", "),i=s(`${Pn}Delay`),o=s(`${Pn}Duration`),a=nu(i,o),c=s(`${nr}Delay`),f=s(`${nr}Duration`),p=nu(c,f);let d=null,m=0,b=0;t===Pn?a>0&&(d=Pn,m=a,b=o.length):t===nr?p>0&&(d=nr,m=p,b=f.length):(m=Math.max(a,p),d=m>0?a>p?Pn:nr:null,b=d?d===Pn?o.length:f.length:0);const w=d===Pn&&/\b(transform|all)(,|$)/.test(s(`${Pn}Property`).toString());return{type:d,timeout:m,propCount:b,hasTransform:w}}function nu(e,t){for(;e.lengthsu(n)+su(e[s])))}function su(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function vd(){return document.body.offsetHeight}function $_(e,t,n){const s=e[Hs];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ai=Symbol("_vod"),wd=Symbol("_vsh"),r0={beforeMount(e,{value:t},{transition:n}){e[Ai]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):sr(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),sr(e,!0),s.enter(e)):s.leave(e,()=>{sr(e,!1)}):sr(e,t))},beforeUnmount(e,{value:t}){sr(e,t)}};function sr(e,t){e.style.display=t?e[Ai]:"none",e[wd]=!t}const F_=Symbol(""),j_=/(^|;)\s*display\s*:/;function B_(e,t,n){const s=e.style,i=qe(n);let o=!1;if(n&&!i){if(t)if(qe(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();n[c]==null&&mi(s,c,"")}else for(const a in t)n[a]==null&&mi(s,a,"");for(const a in n)a==="display"&&(o=!0),mi(s,a,n[a])}else if(i){if(t!==n){const a=s[F_];a&&(n+=";"+a),s.cssText=n,o=j_.test(n)}}else t&&e.removeAttribute("style");Ai in e&&(e[Ai]=o?s.display:"",e[wd]&&(s.display="none"))}const ru=/\s*!important$/;function mi(e,t,n){if(ee(n))n.forEach(s=>mi(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=H_(e,t);ru.test(n)?e.setProperty(gs(s),n.replace(ru,""),"important"):e[s]=n}}const iu=["Webkit","Moz","ms"],Vo={};function H_(e,t){const n=Vo[t];if(n)return n;let s=Gt(t);if(s!=="filter"&&s in e)return Vo[t]=s;s=Di(s);for(let i=0;iUo||(z_.then(()=>Uo=0),Uo=Date.now());function G_(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Jt(J_(s,n.value),t,5,[s])};return n.value=e,n.attached=K_(),n}function J_(e,t){if(ee(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>i=>!i._stopped&&s&&s(i))}else return t}const uu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,X_=(e,t,n,s,i,o)=>{const a=i==="svg";t==="class"?$_(e,s,a):t==="style"?B_(e,n,s):Ii(t)?Sa(t)||q_(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Q_(e,t,s,a))?(V_(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&au(e,t,s,a,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),au(e,t,s,a))};function Q_(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&uu(t)&&fe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return uu(t)&&qe(n)?!1:!!(t in e||e._isVueCE&&(/[A-Z]/.test(t)||!qe(n)))}const Ed=new WeakMap,Cd=new WeakMap,Oi=Symbol("_moveCb"),fu=Symbol("_enterCb"),Y_=e=>(delete e.props.mode,e),Z_=Y_({name:"TransitionGroup",props:Ge({},D_,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=hd(),s=xg();let i,o;return Hf(()=>{if(!i.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!rb(i[0].el,n.vnode.el,a))return;i.forEach(tb),i.forEach(nb);const c=i.filter(sb);vd(),c.forEach(f=>{const p=f.el,d=p.style;bn(p,a),d.transform=d.webkitTransform=d.transitionDuration="";const m=p[Oi]=b=>{b&&b.target!==p||(!b||/transform$/.test(b.propertyName))&&(p.removeEventListener("transitionend",m),p[Oi]=null,Dn(p,a))};p.addEventListener("transitionend",m)})}),()=>{const a=Ee(e),c=N_(a);let f=a.tag||tt;if(i=[],o)for(let p=0;p{c.split(/\s+/).forEach(f=>f&&s.classList.remove(f))}),n.split(/\s+/).forEach(c=>c&&s.classList.add(c)),s.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(s);const{hasTransform:a}=yd(s);return o.removeChild(s),a}const Vn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?n=>fi(t,n):t};function ib(e){e.target.composing=!0}function du(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Bt=Symbol("_assign"),i0={created(e,{modifiers:{lazy:t,trim:n,number:s}},i){e[Bt]=Vn(i);const o=s||i.props&&i.props.type==="number";wn(e,t?"change":"input",a=>{if(a.target.composing)return;let c=e.value;n&&(c=c.trim()),o&&(c=yi(c)),e[Bt](c)}),n&&wn(e,"change",()=>{e.value=e.value.trim()}),t||(wn(e,"compositionstart",ib),wn(e,"compositionend",du),wn(e,"change",du))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:i,number:o}},a){if(e[Bt]=Vn(a),e.composing)return;const c=(o||e.type==="number")&&!/^0\d/.test(e.value)?yi(e.value):e.value,f=t??"";c!==f&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||i&&e.value.trim()===f)||(e.value=f))}},o0={deep:!0,created(e,t,n){e[Bt]=Vn(n),wn(e,"change",()=>{const s=e._modelValue,i=Vs(e),o=e.checked,a=e[Bt];if(ee(s)){const c=Oa(s,i),f=c!==-1;if(o&&!f)a(s.concat(i));else if(!o&&f){const p=[...s];p.splice(c,1),a(p)}}else if(Ws(s)){const c=new Set(s);o?c.add(i):c.delete(i),a(c)}else a(Sd(e,o))})},mounted:hu,beforeUpdate(e,t,n){e[Bt]=Vn(n),hu(e,t,n)}};function hu(e,{value:t,oldValue:n},s){e._modelValue=t;let i;ee(t)?i=Oa(t,s.props.value)>-1:Ws(t)?i=t.has(s.props.value):i=ds(t,Sd(e,!0)),e.checked!==i&&(e.checked=i)}const a0={created(e,{value:t},n){e.checked=ds(t,n.props.value),e[Bt]=Vn(n),wn(e,"change",()=>{e[Bt](Vs(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Bt]=Vn(s),t!==n&&(e.checked=ds(t,s.props.value))}},l0={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const i=Ws(t);wn(e,"change",()=>{const o=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?yi(Vs(a)):Vs(a));e[Bt](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,Pr(()=>{e._assigning=!1})}),e[Bt]=Vn(s)},mounted(e,{value:t,modifiers:{number:n}}){pu(e,t)},beforeUpdate(e,t,n){e[Bt]=Vn(n)},updated(e,{value:t,modifiers:{number:n}}){e._assigning||pu(e,t)}};function pu(e,t,n){const s=e.multiple,i=ee(t);if(!(s&&!i&&!Ws(t))){for(let o=0,a=e.options.length;oString(d)===String(f)):c.selected=Oa(t,f)>-1}else c.selected=t.has(f);else if(ds(Vs(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Vs(e){return"_value"in e?e._value:e.value}function Sd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ob=["ctrl","shift","alt","meta"],ab={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ob.some(n=>e[`${n}Key`]&&!t.includes(n))},lb=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(i,...o)=>{for(let a=0;a{const t=ub().createApp(...e),{mount:n}=t;return t.mount=s=>{const i=db(s);if(!i)return;const o=t._component;!fe(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const a=n(i,!1,fb(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),a},t};function fb(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function db(e){return qe(e)?document.querySelector(e):e}var hb=!1;/*! + * pinia v2.2.2 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */let Ad;const qi=e=>Ad=e,Od=Symbol();function ua(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var hr;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(hr||(hr={}));function pb(){const e=df(!0),t=e.run(()=>ja({}));let n=[],s=[];const i=$a({install(o){qi(i),i._a=o,o.provide(Od,i),o.config.globalProperties.$pinia=i,s.forEach(a=>n.push(a)),s=[]},use(o){return!this._a&&!hb?s.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const xd=()=>{};function gu(e,t,n,s=xd){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),s())};return!n&&hf()&&Wm(i),i}function Ds(e,...t){e.slice().forEach(n=>{n(...t)})}const mb=e=>e(),_u=Symbol(),qo=Symbol();function fa(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];ua(i)&&ua(s)&&e.hasOwnProperty(n)&&!ze(s)&&!Fn(s)?e[n]=fa(i,s):e[n]=s}return e}const gb=Symbol();function _b(e){return!ua(e)||!e.hasOwnProperty(gb)}const{assign:Nn}=Object;function bb(e){return!!(ze(e)&&e.effect)}function yb(e,t,n,s){const{state:i,actions:o,getters:a}=t,c=n.state.value[e];let f;function p(){c||(n.state.value[e]=i?i():{});const d=gg(n.state.value[e]);return Nn(d,o,Object.keys(a||{}).reduce((m,b)=>(m[b]=$a(Ft(()=>{qi(n);const w=n._s.get(e);return a[b].call(w,w)})),m),{}))}return f=Rd(e,p,t,n,s,!0),f}function Rd(e,t,n={},s,i,o){let a;const c=Nn({actions:{}},n),f={deep:!0};let p,d,m=[],b=[],w;const C=s.state.value[e];!o&&!C&&(s.state.value[e]={}),ja({});let P;function R(te){let q;p=d=!1,typeof te=="function"?(te(s.state.value[e]),q={type:hr.patchFunction,storeId:e,events:w}):(fa(s.state.value[e],te),q={type:hr.patchObject,payload:te,storeId:e,events:w});const oe=P=Symbol();Pr().then(()=>{P===oe&&(p=!0)}),d=!0,Ds(m,q,s.state.value[e])}const $=o?function(){const{state:q}=n,oe=q?q():{};this.$patch(ve=>{Nn(ve,oe)})}:xd;function N(){a.stop(),m=[],b=[],s._s.delete(e)}const B=(te,q="")=>{if(_u in te)return te[qo]=q,te;const oe=function(){qi(s);const ve=Array.from(arguments),G=[],be=[];function He(ae){G.push(ae)}function st(ae){be.push(ae)}Ds(b,{args:ve,name:oe[qo],store:Y,after:He,onError:st});let Oe;try{Oe=te.apply(this&&this.$id===e?this:Y,ve)}catch(ae){throw Ds(be,ae),ae}return Oe instanceof Promise?Oe.then(ae=>(Ds(G,ae),ae)).catch(ae=>(Ds(be,ae),Promise.reject(ae))):(Ds(G,Oe),Oe)};return oe[_u]=!0,oe[qo]=q,oe},H={_p:s,$id:e,$onAction:gu.bind(null,b),$patch:R,$reset:$,$subscribe(te,q={}){const oe=gu(m,te,q.detached,()=>ve()),ve=a.run(()=>fr(()=>s.state.value[e],G=>{(q.flush==="sync"?d:p)&&te({storeId:e,type:hr.direct,events:w},G)},Nn({},f,q)));return oe},$dispose:N},Y=xr(H);s._s.set(e,Y);const le=(s._a&&s._a.runWithContext||mb)(()=>s._e.run(()=>(a=df()).run(()=>t({action:B}))));for(const te in le){const q=le[te];if(ze(q)&&!bb(q)||Fn(q))o||(C&&_b(q)&&(ze(q)?q.value=C[te]:fa(q,C[te])),s.state.value[e][te]=q);else if(typeof q=="function"){const oe=B(q,te);le[te]=oe,c.actions[te]=q}}return Nn(Y,le),Nn(Ee(Y),le),Object.defineProperty(Y,"$state",{get:()=>s.state.value[e],set:te=>{R(q=>{Nn(q,te)})}}),s._p.forEach(te=>{Nn(Y,a.run(()=>te({store:Y,app:s._a,pinia:s,options:c})))}),C&&o&&n.hydrate&&n.hydrate(Y.$state,C),p=!0,d=!0,Y}function vb(e,t,n){let s,i;const o=typeof t=="function";s=e,i=o?n:t;function a(c,f){const p=Xg();return c=c||(p?xt(Od,null):null),c&&qi(c),c=Ad,c._s.has(s)||(o?Rd(s,t,i,c):yb(s,i,c)),c._s.get(s)}return a.$id=s,a}/*! + * vue-router v4.4.3 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const Ms=typeof document<"u";function wb(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pe=Object.assign;function Wo(e,t){const n={};for(const s in t){const i=t[s];n[s]=Xt(i)?i.map(e):e(i)}return n}const pr=()=>{},Xt=Array.isArray,Pd=/#/g,Eb=/&/g,Cb=/\//g,Sb=/=/g,Tb=/\?/g,Id=/\+/g,Ab=/%5B/g,Ob=/%5D/g,Ld=/%5E/g,xb=/%60/g,Dd=/%7B/g,Rb=/%7C/g,Nd=/%7D/g,Pb=/%20/g;function za(e){return encodeURI(""+e).replace(Rb,"|").replace(Ab,"[").replace(Ob,"]")}function Ib(e){return za(e).replace(Dd,"{").replace(Nd,"}").replace(Ld,"^")}function da(e){return za(e).replace(Id,"%2B").replace(Pb,"+").replace(Pd,"%23").replace(Eb,"%26").replace(xb,"`").replace(Dd,"{").replace(Nd,"}").replace(Ld,"^")}function Lb(e){return da(e).replace(Sb,"%3D")}function Db(e){return za(e).replace(Pd,"%23").replace(Tb,"%3F")}function Nb(e){return e==null?"":Db(e).replace(Cb,"%2F")}function Er(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const kb=/\/$/,Mb=e=>e.replace(kb,"");function zo(e,t,n="/"){let s,i={},o="",a="";const c=t.indexOf("#");let f=t.indexOf("?");return c=0&&(f=-1),f>-1&&(s=t.slice(0,f),o=t.slice(f+1,c>-1?c:t.length),i=e(o)),c>-1&&(s=s||t.slice(0,c),a=t.slice(c,t.length)),s=Bb(s??t,n),{fullPath:s+(o&&"?")+o+a,path:s,query:i,hash:Er(a)}}function $b(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function bu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Fb(e,t,n){const s=t.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&Us(t.matched[s],n.matched[i])&&kd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Us(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function kd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!jb(e[n],t[n]))return!1;return!0}function jb(e,t){return Xt(e)?yu(e,t):Xt(t)?yu(t,e):e===t}function yu(e,t){return Xt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Bb(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let o=n.length-1,a,c;for(a=0;a1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(a).join("/")}const In={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Cr;(function(e){e.pop="pop",e.push="push"})(Cr||(Cr={}));var mr;(function(e){e.back="back",e.forward="forward",e.unknown=""})(mr||(mr={}));function Hb(e){if(!e)if(Ms){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Mb(e)}const Vb=/^[^#]+#/;function Ub(e,t){return e.replace(Vb,"#")+t}function qb(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Wi=()=>({left:window.scrollX,top:window.scrollY});function Wb(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=qb(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function vu(e,t){return(history.state?history.state.position-t:-1)+e}const ha=new Map;function zb(e,t){ha.set(e,t)}function Kb(e){const t=ha.get(e);return ha.delete(e),t}let Gb=()=>location.protocol+"//"+location.host;function Md(e,t){const{pathname:n,search:s,hash:i}=t,o=e.indexOf("#");if(o>-1){let c=i.includes(e.slice(o))?e.slice(o).length:1,f=i.slice(c);return f[0]!=="/"&&(f="/"+f),bu(f,"")}return bu(n,e)+s+i}function Jb(e,t,n,s){let i=[],o=[],a=null;const c=({state:b})=>{const w=Md(e,location),C=n.value,P=t.value;let R=0;if(b){if(n.value=w,t.value=b,a&&a===C){a=null;return}R=P?b.position-P.position:0}else s(w);i.forEach($=>{$(n.value,C,{delta:R,type:Cr.pop,direction:R?R>0?mr.forward:mr.back:mr.unknown})})};function f(){a=n.value}function p(b){i.push(b);const w=()=>{const C=i.indexOf(b);C>-1&&i.splice(C,1)};return o.push(w),w}function d(){const{history:b}=window;b.state&&b.replaceState(Pe({},b.state,{scroll:Wi()}),"")}function m(){for(const b of o)b();o=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:f,listen:p,destroy:m}}function wu(e,t,n,s=!1,i=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:i?Wi():null}}function Xb(e){const{history:t,location:n}=window,s={value:Md(e,n)},i={value:t.state};i.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(f,p,d){const m=e.indexOf("#"),b=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+f:Gb()+e+f;try{t[d?"replaceState":"pushState"](p,"",b),i.value=p}catch(w){console.error(w),n[d?"replace":"assign"](b)}}function a(f,p){const d=Pe({},t.state,wu(i.value.back,f,i.value.forward,!0),p,{position:i.value.position});o(f,d,!0),s.value=f}function c(f,p){const d=Pe({},i.value,t.state,{forward:f,scroll:Wi()});o(d.current,d,!0);const m=Pe({},wu(s.value,f,null),{position:d.position+1},p);o(f,m,!1),s.value=f}return{location:s,state:i,push:c,replace:a}}function Qb(e){e=Hb(e);const t=Xb(e),n=Jb(e,t.state,t.location,t.replace);function s(o,a=!0){a||n.pauseListeners(),history.go(o)}const i=Pe({location:"",base:e,go:s,createHref:Ub.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function Yb(e){return typeof e=="string"||e&&typeof e=="object"}function $d(e){return typeof e=="string"||typeof e=="symbol"}const Fd=Symbol("");var Eu;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Eu||(Eu={}));function qs(e,t){return Pe(new Error,{type:e,[Fd]:!0},t)}function _n(e,t){return e instanceof Error&&Fd in e&&(t==null||!!(e.type&t))}const Cu="[^/]+?",Zb={sensitive:!1,strict:!1,start:!0,end:!0},ey=/[.+*?^${}()[\]/\\]/g;function ty(e,t){const n=Pe({},Zb,t),s=[];let i=n.start?"^":"";const o=[];for(const p of e){const d=p.length?[]:[90];n.strict&&!p.length&&(i+="/");for(let m=0;mt.length?t.length===1&&t[0]===80?1:-1:0}function jd(e,t){let n=0;const s=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const sy={type:0,value:""},ry=/[a-zA-Z0-9_]/;function iy(e){if(!e)return[[]];if(e==="/")return[[sy]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(w){throw new Error(`ERR (${n})/"${p}": ${w}`)}let n=0,s=n;const i=[];let o;function a(){o&&i.push(o),o=[]}let c=0,f,p="",d="";function m(){p&&(n===0?o.push({type:0,value:p}):n===1||n===2||n===3?(o.length>1&&(f==="*"||f==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:p,regexp:d,repeatable:f==="*"||f==="+",optional:f==="*"||f==="?"})):t("Invalid state to consume buffer"),p="")}function b(){p+=f}for(;c{a(B)}:pr}function a(m){if($d(m)){const b=s.get(m);b&&(s.delete(m),n.splice(n.indexOf(b),1),b.children.forEach(a),b.alias.forEach(a))}else{const b=n.indexOf(m);b>-1&&(n.splice(b,1),m.record.name&&s.delete(m.record.name),m.children.forEach(a),m.alias.forEach(a))}}function c(){return n}function f(m){const b=fy(m,n);n.splice(b,0,m),m.record.name&&!Au(m)&&s.set(m.record.name,m)}function p(m,b){let w,C={},P,R;if("name"in m&&m.name){if(w=s.get(m.name),!w)throw qs(1,{location:m});R=w.record.name,C=Pe(Tu(b.params,w.keys.filter(B=>!B.optional).concat(w.parent?w.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),m.params&&Tu(m.params,w.keys.map(B=>B.name))),P=w.stringify(C)}else if(m.path!=null)P=m.path,w=n.find(B=>B.re.test(P)),w&&(C=w.parse(P),R=w.record.name);else{if(w=b.name?s.get(b.name):n.find(B=>B.re.test(b.path)),!w)throw qs(1,{location:m,currentLocation:b});R=w.record.name,C=Pe({},b.params,m.params),P=w.stringify(C)}const $=[];let N=w;for(;N;)$.unshift(N.record),N=N.parent;return{name:R,path:P,params:C,matched:$,meta:uy($)}}e.forEach(m=>o(m));function d(){n.length=0,s.clear()}return{addRoute:o,resolve:p,removeRoute:a,clearRoutes:d,getRoutes:c,getRecordMatcher:i}}function Tu(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function ly(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:cy(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function cy(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Au(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function uy(e){return e.reduce((t,n)=>Pe(t,n.meta),{})}function Ou(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function fy(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;jd(e,t[o])<0?s=o:n=o+1}const i=dy(e);return i&&(s=t.lastIndexOf(i,s-1)),s}function dy(e){let t=e;for(;t=t.parent;)if(Bd(t)&&jd(e,t)===0)return t}function Bd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function hy(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;io&&da(o)):[s&&da(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function py(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Xt(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return t}const my=Symbol(""),Ru=Symbol(""),zi=Symbol(""),Ka=Symbol(""),pa=Symbol("");function rr(){let e=[];function t(s){return e.push(s),()=>{const i=e.indexOf(s);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $n(e,t,n,s,i,o=a=>a()){const a=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((c,f)=>{const p=b=>{b===!1?f(qs(4,{from:n,to:t})):b instanceof Error?f(b):Yb(b)?f(qs(2,{from:t,to:b})):(a&&s.enterCallbacks[i]===a&&typeof b=="function"&&a.push(b),c())},d=o(()=>e.call(s&&s.instances[i],t,n,p));let m=Promise.resolve(d);e.length<3&&(m=m.then(p)),m.catch(b=>f(b))})}function Ko(e,t,n,s,i=o=>o()){const o=[];for(const a of e)for(const c in a.components){let f=a.components[c];if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(gy(f)){const d=(f.__vccOpts||f)[t];d&&o.push($n(d,n,s,a,c,i))}else{let p=f();o.push(()=>p.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${a.path}"`));const m=wb(d)?d.default:d;a.components[c]=m;const w=(m.__vccOpts||m)[t];return w&&$n(w,n,s,a,c,i)()}))}}return o}function gy(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Pu(e){const t=xt(zi),n=xt(Ka),s=Ft(()=>{const f=jn(e.to);return t.resolve(f)}),i=Ft(()=>{const{matched:f}=s.value,{length:p}=f,d=f[p-1],m=n.matched;if(!d||!m.length)return-1;const b=m.findIndex(Us.bind(null,d));if(b>-1)return b;const w=Iu(f[p-2]);return p>1&&Iu(d)===w&&m[m.length-1].path!==w?m.findIndex(Us.bind(null,f[p-2])):b}),o=Ft(()=>i.value>-1&&vy(n.params,s.value.params)),a=Ft(()=>i.value>-1&&i.value===n.matched.length-1&&kd(n.params,s.value.params));function c(f={}){return yy(f)?t[jn(e.replace)?"replace":"push"](jn(e.to)).catch(pr):Promise.resolve()}return{route:s,href:Ft(()=>s.value.href),isActive:o,isExactActive:a,navigate:c}}const _y=dn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Pu,setup(e,{slots:t}){const n=xr(Pu(e)),{options:s}=xt(zi),i=Ft(()=>({[Lu(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Lu(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&t.default(n);return e.custom?o:gd("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},o)}}}),by=_y;function yy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function vy(e,t){for(const n in t){const s=t[n],i=e[n];if(typeof s=="string"){if(s!==i)return!1}else if(!Xt(i)||i.length!==s.length||s.some((o,a)=>o!==i[a]))return!1}return!0}function Iu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Lu=(e,t,n)=>e??t??n,wy=dn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=xt(pa),i=Ft(()=>e.route||s.value),o=xt(Ru,0),a=Ft(()=>{let p=jn(o);const{matched:d}=i.value;let m;for(;(m=d[p])&&!m.components;)p++;return p}),c=Ft(()=>i.value.matched[a.value]);di(Ru,Ft(()=>a.value+1)),di(my,c),di(pa,i);const f=ja();return fr(()=>[f.value,c.value,e.name],([p,d,m],[b,w,C])=>{d&&(d.instances[m]=p,w&&w!==d&&p&&p===b&&(d.leaveGuards.size||(d.leaveGuards=w.leaveGuards),d.updateGuards.size||(d.updateGuards=w.updateGuards))),p&&d&&(!w||!Us(d,w)||!b)&&(d.enterCallbacks[m]||[]).forEach(P=>P(p))},{flush:"post"}),()=>{const p=i.value,d=e.name,m=c.value,b=m&&m.components[d];if(!b)return Du(n.default,{Component:b,route:p});const w=m.props[d],C=w?w===!0?p.params:typeof w=="function"?w(p):w:null,R=gd(b,Pe({},C,t,{onVnodeUnmounted:$=>{$.component.isUnmounted&&(m.instances[d]=null)},ref:f}));return Du(n.default,{Component:R,route:p})||R}}});function Du(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Hd=wy;function Ey(e){const t=ay(e.routes,e),n=e.parseQuery||hy,s=e.stringifyQuery||xu,i=e.history,o=rr(),a=rr(),c=rr(),f=hg(In);let p=In;Ms&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Wo.bind(null,x=>""+x),m=Wo.bind(null,Nb),b=Wo.bind(null,Er);function w(x,A){let U,Z;return $d(x)?(U=t.getRecordMatcher(x),Z=A):Z=x,t.addRoute(Z,U)}function C(x){const A=t.getRecordMatcher(x);A&&t.removeRoute(A)}function P(){return t.getRoutes().map(x=>x.record)}function R(x){return!!t.getRecordMatcher(x)}function $(x,A){if(A=Pe({},A||f.value),typeof x=="string"){const _=zo(n,x,A.path),E=t.resolve({path:_.path},A),D=i.createHref(_.fullPath);return Pe(_,E,{params:b(E.params),hash:Er(_.hash),redirectedFrom:void 0,href:D})}let U;if(x.path!=null)U=Pe({},x,{path:zo(n,x.path,A.path).path});else{const _=Pe({},x.params);for(const E in _)_[E]==null&&delete _[E];U=Pe({},x,{params:m(_)}),A.params=m(A.params)}const Z=t.resolve(U,A),Te=x.hash||"";Z.params=d(b(Z.params));const je=$b(s,Pe({},x,{hash:Ib(Te),path:Z.path})),g=i.createHref(je);return Pe({fullPath:je,hash:Te,query:s===xu?py(x.query):x.query||{}},Z,{redirectedFrom:void 0,href:g})}function N(x){return typeof x=="string"?zo(n,x,f.value.path):Pe({},x)}function B(x,A){if(p!==x)return qs(8,{from:A,to:x})}function H(x){return le(x)}function Y(x){return H(Pe(N(x),{replace:!0}))}function ge(x){const A=x.matched[x.matched.length-1];if(A&&A.redirect){const{redirect:U}=A;let Z=typeof U=="function"?U(x):U;return typeof Z=="string"&&(Z=Z.includes("?")||Z.includes("#")?Z=N(Z):{path:Z},Z.params={}),Pe({query:x.query,hash:x.hash,params:Z.path!=null?{}:x.params},Z)}}function le(x,A){const U=p=$(x),Z=f.value,Te=x.state,je=x.force,g=x.replace===!0,_=ge(U);if(_)return le(Pe(N(_),{state:typeof _=="object"?Pe({},Te,_.state):Te,force:je,replace:g}),A||U);const E=U;E.redirectedFrom=A;let D;return!je&&Fb(s,Z,U)&&(D=qs(16,{to:E,from:Z}),_t(Z,Z,!0,!1)),(D?Promise.resolve(D):oe(E,Z)).catch(O=>_n(O)?_n(O,2)?O:I(O):Se(O,E,Z)).then(O=>{if(O){if(_n(O,2))return le(Pe({replace:g},N(O.to),{state:typeof O.to=="object"?Pe({},Te,O.to.state):Te,force:je}),A||E)}else O=G(E,Z,!0,g,Te);return ve(E,Z,O),O})}function te(x,A){const U=B(x,A);return U?Promise.reject(U):Promise.resolve()}function q(x){const A=rt.values().next().value;return A&&typeof A.runWithContext=="function"?A.runWithContext(x):x()}function oe(x,A){let U;const[Z,Te,je]=Cy(x,A);U=Ko(Z.reverse(),"beforeRouteLeave",x,A);for(const _ of Z)_.leaveGuards.forEach(E=>{U.push($n(E,x,A))});const g=te.bind(null,x,A);return U.push(g),Be(U).then(()=>{U=[];for(const _ of o.list())U.push($n(_,x,A));return U.push(g),Be(U)}).then(()=>{U=Ko(Te,"beforeRouteUpdate",x,A);for(const _ of Te)_.updateGuards.forEach(E=>{U.push($n(E,x,A))});return U.push(g),Be(U)}).then(()=>{U=[];for(const _ of je)if(_.beforeEnter)if(Xt(_.beforeEnter))for(const E of _.beforeEnter)U.push($n(E,x,A));else U.push($n(_.beforeEnter,x,A));return U.push(g),Be(U)}).then(()=>(x.matched.forEach(_=>_.enterCallbacks={}),U=Ko(je,"beforeRouteEnter",x,A,q),U.push(g),Be(U))).then(()=>{U=[];for(const _ of a.list())U.push($n(_,x,A));return U.push(g),Be(U)}).catch(_=>_n(_,8)?_:Promise.reject(_))}function ve(x,A,U){c.list().forEach(Z=>q(()=>Z(x,A,U)))}function G(x,A,U,Z,Te){const je=B(x,A);if(je)return je;const g=A===In,_=Ms?history.state:{};U&&(Z||g?i.replace(x.fullPath,Pe({scroll:g&&_&&_.scroll},Te)):i.push(x.fullPath,Te)),f.value=x,_t(x,A,U,g),I()}let be;function He(){be||(be=i.listen((x,A,U)=>{if(!Zt.listening)return;const Z=$(x),Te=ge(Z);if(Te){le(Pe(Te,{replace:!0}),Z).catch(pr);return}p=Z;const je=f.value;Ms&&zb(vu(je.fullPath,U.delta),Wi()),oe(Z,je).catch(g=>_n(g,12)?g:_n(g,2)?(le(g.to,Z).then(_=>{_n(_,20)&&!U.delta&&U.type===Cr.pop&&i.go(-1,!1)}).catch(pr),Promise.reject()):(U.delta&&i.go(-U.delta,!1),Se(g,Z,je))).then(g=>{g=g||G(Z,je,!1),g&&(U.delta&&!_n(g,8)?i.go(-U.delta,!1):U.type===Cr.pop&&_n(g,20)&&i.go(-1,!1)),ve(Z,je,g)}).catch(pr)}))}let st=rr(),Oe=rr(),ae;function Se(x,A,U){I(x);const Z=Oe.list();return Z.length?Z.forEach(Te=>Te(x,A,U)):console.error(x),Promise.reject(x)}function Pt(){return ae&&f.value!==In?Promise.resolve():new Promise((x,A)=>{st.add([x,A])})}function I(x){return ae||(ae=!x,He(),st.list().forEach(([A,U])=>x?U(x):A()),st.reset()),x}function _t(x,A,U,Z){const{scrollBehavior:Te}=e;if(!Ms||!Te)return Promise.resolve();const je=!U&&Kb(vu(x.fullPath,0))||(Z||!U)&&history.state&&history.state.scroll||null;return Pr().then(()=>Te(x,A,je)).then(g=>g&&Wb(g)).catch(g=>Se(g,x,A))}const et=x=>i.go(x);let Yt;const rt=new Set,Zt={currentRoute:f,listening:!0,addRoute:w,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:R,getRoutes:P,resolve:$,options:e,push:H,replace:Y,go:et,back:()=>et(-1),forward:()=>et(1),beforeEach:o.add,beforeResolve:a.add,afterEach:c.add,onError:Oe.add,isReady:Pt,install(x){const A=this;x.component("RouterLink",by),x.component("RouterView",Hd),x.config.globalProperties.$router=A,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>jn(f)}),Ms&&!Yt&&f.value===In&&(Yt=!0,H(i.location).catch(Te=>{}));const U={};for(const Te in In)Object.defineProperty(U,Te,{get:()=>f.value[Te],enumerable:!0});x.provide(zi,A),x.provide(Ka,Of(U)),x.provide(pa,f);const Z=x.unmount;rt.add(x),x.unmount=function(){rt.delete(x),rt.size<1&&(p=In,be&&be(),be=null,f.value=In,Yt=!1,ae=!1),Z()}}};function Be(x){return x.reduce((A,U)=>A.then(()=>q(U)),Promise.resolve())}return Zt}function Cy(e,t){const n=[],s=[],i=[],o=Math.max(t.matched.length,e.matched.length);for(let a=0;aUs(p,c))?s.push(c):n.push(c));const f=e.matched[a];f&&(t.matched.find(p=>Us(p,f))||i.push(f))}return[n,s,i]}function c0(){return xt(zi)}function u0(e){return xt(Ka)}const Sy=dn({__name:"App",setup(e){return(t,n)=>(Ve(),jt(jn(Hd)))}});function Vd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ty}=Object.prototype,{getPrototypeOf:Ga}=Object,Ki=(e=>t=>{const n=Ty.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=e=>(e=e.toLowerCase(),t=>Ki(t)===e),Gi=e=>t=>typeof t===e,{isArray:zs}=Array,Sr=Gi("undefined");function Ay(e){return e!==null&&!Sr(e)&&e.constructor!==null&&!Sr(e.constructor)&&Rt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ud=Qt("ArrayBuffer");function Oy(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ud(e.buffer),t}const xy=Gi("string"),Rt=Gi("function"),qd=Gi("number"),Ji=e=>e!==null&&typeof e=="object",Ry=e=>e===!0||e===!1,gi=e=>{if(Ki(e)!=="object")return!1;const t=Ga(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Py=Qt("Date"),Iy=Qt("File"),Ly=Qt("Blob"),Dy=Qt("FileList"),Ny=e=>Ji(e)&&Rt(e.pipe),ky=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Rt(e.append)&&((t=Ki(e))==="formdata"||t==="object"&&Rt(e.toString)&&e.toString()==="[object FormData]"))},My=Qt("URLSearchParams"),[$y,Fy,jy,By]=["ReadableStream","Request","Response","Headers"].map(Qt),Hy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,i;if(typeof e!="object"&&(e=[e]),zs(e))for(s=0,i=e.length;s0;)if(i=n[s],t===i.toLowerCase())return i;return null}const as=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zd=e=>!Sr(e)&&e!==as;function ma(){const{caseless:e}=zd(this)&&this||{},t={},n=(s,i)=>{const o=e&&Wd(t,i)||i;gi(t[o])&&gi(s)?t[o]=ma(t[o],s):gi(s)?t[o]=ma({},s):zs(s)?t[o]=s.slice():t[o]=s};for(let s=0,i=arguments.length;s(Dr(t,(i,o)=>{n&&Rt(i)?e[o]=Vd(i,n):e[o]=i},{allOwnKeys:s}),e),Uy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qy=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Wy=(e,t,n,s)=>{let i,o,a;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!s||s(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Ga(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Ky=e=>{if(!e)return null;if(zs(e))return e;let t=e.length;if(!qd(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Gy=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ga(Uint8Array)),Jy=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=s.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Xy=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Qy=Qt("HTMLFormElement"),Yy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,i){return s.toUpperCase()+i}),Nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Zy=Qt("RegExp"),Kd=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Dr(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(s[o]=a||i)}),Object.defineProperties(e,s)},ev=e=>{Kd(e,(t,n)=>{if(Rt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(Rt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tv=(e,t)=>{const n={},s=i=>{i.forEach(o=>{n[o]=!0})};return zs(e)?s(e):s(String(e).split(t)),n},nv=()=>{},sv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Go="abcdefghijklmnopqrstuvwxyz",ku="0123456789",Gd={DIGIT:ku,ALPHA:Go,ALPHA_DIGIT:Go+Go.toUpperCase()+ku},rv=(e=16,t=Gd.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function iv(e){return!!(e&&Rt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ov=e=>{const t=new Array(10),n=(s,i)=>{if(Ji(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const o=zs(s)?[]:{};return Dr(s,(a,c)=>{const f=n(a,i+1);!Sr(f)&&(o[c]=f)}),t[i]=void 0,o}}return s};return n(e,0)},av=Qt("AsyncFunction"),lv=e=>e&&(Ji(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),Jd=((e,t)=>e?setImmediate:t?((n,s)=>(as.addEventListener("message",({source:i,data:o})=>{i===as&&o===n&&s.length&&s.shift()()},!1),i=>{s.push(i),as.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Rt(as.postMessage)),cv=typeof queueMicrotask<"u"?queueMicrotask.bind(as):typeof process<"u"&&process.nextTick||Jd,T={isArray:zs,isArrayBuffer:Ud,isBuffer:Ay,isFormData:ky,isArrayBufferView:Oy,isString:xy,isNumber:qd,isBoolean:Ry,isObject:Ji,isPlainObject:gi,isReadableStream:$y,isRequest:Fy,isResponse:jy,isHeaders:By,isUndefined:Sr,isDate:Py,isFile:Iy,isBlob:Ly,isRegExp:Zy,isFunction:Rt,isStream:Ny,isURLSearchParams:My,isTypedArray:Gy,isFileList:Dy,forEach:Dr,merge:ma,extend:Vy,trim:Hy,stripBOM:Uy,inherits:qy,toFlatObject:Wy,kindOf:Ki,kindOfTest:Qt,endsWith:zy,toArray:Ky,forEachEntry:Jy,matchAll:Xy,isHTMLForm:Qy,hasOwnProperty:Nu,hasOwnProp:Nu,reduceDescriptors:Kd,freezeMethods:ev,toObjectSet:tv,toCamelCase:Yy,noop:nv,toFiniteNumber:sv,findKey:Wd,global:as,isContextDefined:zd,ALPHABET:Gd,generateString:rv,isSpecCompliantForm:iv,toJSONObject:ov,isAsyncFn:av,isThenable:lv,setImmediate:Jd,asap:cv};function de(e,t,n,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}T.inherits(de,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Xd=de.prototype,Qd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Qd[e]={value:e}});Object.defineProperties(de,Qd);Object.defineProperty(Xd,"isAxiosError",{value:!0});de.from=(e,t,n,s,i,o)=>{const a=Object.create(Xd);return T.toFlatObject(e,a,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),de.call(a,e.message,t,n,s,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const uv=null;function ga(e){return T.isPlainObject(e)||T.isArray(e)}function Yd(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Mu(e,t,n){return e?e.concat(t).map(function(i,o){return i=Yd(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function fv(e){return T.isArray(e)&&!e.some(ga)}const dv=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Xi(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(P,R){return!T.isUndefined(R[P])});const s=n.metaTokens,i=n.visitor||d,o=n.dots,a=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function p(C){if(C===null)return"";if(T.isDate(C))return C.toISOString();if(!f&&T.isBlob(C))throw new de("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(C)||T.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function d(C,P,R){let $=C;if(C&&!R&&typeof C=="object"){if(T.endsWith(P,"{}"))P=s?P:P.slice(0,-2),C=JSON.stringify(C);else if(T.isArray(C)&&fv(C)||(T.isFileList(C)||T.endsWith(P,"[]"))&&($=T.toArray(C)))return P=Yd(P),$.forEach(function(B,H){!(T.isUndefined(B)||B===null)&&t.append(a===!0?Mu([P],H,o):a===null?P:P+"[]",p(B))}),!1}return ga(C)?!0:(t.append(Mu(R,P,o),p(C)),!1)}const m=[],b=Object.assign(dv,{defaultVisitor:d,convertValue:p,isVisitable:ga});function w(C,P){if(!T.isUndefined(C)){if(m.indexOf(C)!==-1)throw Error("Circular reference detected in "+P.join("."));m.push(C),T.forEach(C,function($,N){(!(T.isUndefined($)||$===null)&&i.call(t,$,T.isString(N)?N.trim():N,P,b))===!0&&w($,P?P.concat(N):[N])}),m.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return w(e),t}function $u(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ja(e,t){this._pairs=[],e&&Xi(e,this,t)}const Zd=Ja.prototype;Zd.append=function(t,n){this._pairs.push([t,n])};Zd.toString=function(t){const n=t?function(s){return t.call(this,s,$u)}:$u;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function hv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function eh(e,t,n){if(!t)return e;const s=n&&n.encode||hv,i=n&&n.serialize;let o;if(i?o=i(t,n):o=T.isURLSearchParams(t)?t.toString():new Ja(t,n).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Fu{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(s){s!==null&&t(s)})}}const th={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pv=typeof URLSearchParams<"u"?URLSearchParams:Ja,mv=typeof FormData<"u"?FormData:null,gv=typeof Blob<"u"?Blob:null,_v={isBrowser:!0,classes:{URLSearchParams:pv,FormData:mv,Blob:gv},protocols:["http","https","file","blob","url","data"]},Xa=typeof window<"u"&&typeof document<"u",_a=typeof navigator=="object"&&navigator||void 0,bv=Xa&&(!_a||["ReactNative","NativeScript","NS"].indexOf(_a.product)<0),yv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vv=Xa&&window.location.href||"http://localhost",wv=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xa,hasStandardBrowserEnv:bv,hasStandardBrowserWebWorkerEnv:yv,navigator:_a,origin:vv},Symbol.toStringTag,{value:"Module"})),bt={...wv,..._v};function Ev(e,t){return Xi(e,new bt.classes.URLSearchParams,Object.assign({visitor:function(n,s,i,o){return bt.isNode&&T.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Cv(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sv(e){const t={},n=Object.keys(e);let s;const i=n.length;let o;for(s=0;s=n.length;return a=!a&&T.isArray(i)?i.length:a,f?(T.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!c):((!i[a]||!T.isObject(i[a]))&&(i[a]=[]),t(n,s,i[a],o)&&T.isArray(i[a])&&(i[a]=Sv(i[a])),!c)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(s,i)=>{t(Cv(s),i,n,0)}),n}return null}function Tv(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Nr={transitional:th,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",i=s.indexOf("application/json")>-1,o=T.isObject(t);if(o&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return i?JSON.stringify(nh(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ev(t,this.formSerializer).toString();if((c=T.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Xi(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Tv(t)):t}],transformResponse:[function(t){const n=this.transitional||Nr.transitional,s=n&&n.forcedJSONParsing,i=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(s&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?de.from(c,de.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Nr.headers[e]={}});const Av=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ov=e=>{const t={};let n,s,i;return e&&e.split(` +`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!n||t[n]&&Av[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},ju=Symbol("internals");function ir(e){return e&&String(e).trim().toLowerCase()}function _i(e){return e===!1||e==null?e:T.isArray(e)?e.map(_i):String(e)}function xv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Rv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jo(e,t,n,s,i){if(T.isFunction(s))return s.call(this,t,n);if(i&&(t=n),!!T.isString(t)){if(T.isString(s))return t.indexOf(s)!==-1;if(T.isRegExp(s))return s.test(t)}}function Pv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Iv(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(i,o,a){return this[s].call(this,t,i,o,a)},configurable:!0})})}class yt{constructor(t){t&&this.set(t)}set(t,n,s){const i=this;function o(c,f,p){const d=ir(f);if(!d)throw new Error("header name must be a non-empty string");const m=T.findKey(i,d);(!m||i[m]===void 0||p===!0||p===void 0&&i[m]!==!1)&&(i[m||f]=_i(c))}const a=(c,f)=>T.forEach(c,(p,d)=>o(p,d,f));if(T.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(T.isString(t)&&(t=t.trim())&&!Rv(t))a(Ov(t),n);else if(T.isHeaders(t))for(const[c,f]of t.entries())o(f,c,s);else t!=null&&o(n,t,s);return this}get(t,n){if(t=ir(t),t){const s=T.findKey(this,t);if(s){const i=this[s];if(!n)return i;if(n===!0)return xv(i);if(T.isFunction(n))return n.call(this,i,s);if(T.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ir(t),t){const s=T.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Jo(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let i=!1;function o(a){if(a=ir(a),a){const c=T.findKey(s,a);c&&(!n||Jo(s,s[c],c,n))&&(delete s[c],i=!0)}}return T.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let s=n.length,i=!1;for(;s--;){const o=n[s];(!t||Jo(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,s={};return T.forEach(this,(i,o)=>{const a=T.findKey(s,o);if(a){n[a]=_i(i),delete n[o];return}const c=t?Pv(o):String(o).trim();c!==o&&delete n[o],n[c]=_i(i),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(s,i)=>{s!=null&&s!==!1&&(n[i]=t&&T.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ju]=this[ju]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=ir(a);s[c]||(Iv(i,a),s[c]=!0)}return T.isArray(t)?t.forEach(o):o(t),this}}yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(yt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});T.freezeMethods(yt);function Xo(e,t){const n=this||Nr,s=t||n,i=yt.from(s.headers);let o=s.data;return T.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function sh(e){return!!(e&&e.__CANCEL__)}function Ks(e,t,n){de.call(this,e??"canceled",de.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Ks,de,{__CANCEL__:!0});function rh(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new de("Request failed with status code "+n.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dv(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),d=s[o];a||(a=p),n[i]=f,s[i]=p;let m=o,b=0;for(;m!==i;)b+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a{n=d,i=null,o&&(clearTimeout(o),o=null),e.apply(null,p)};return[(...p)=>{const d=Date.now(),m=d-n;m>=s?a(p,d):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},s-m)))},()=>i&&a(i)]}const xi=(e,t,n=3)=>{let s=0;const i=Dv(50,250);return Nv(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,f=a-s,p=i(f),d=a<=c;s=a;const m={loaded:a,total:c,progress:c?a/c:void 0,bytes:f,rate:p||void 0,estimated:p&&c&&d?(c-a)/p:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},Bu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Hu=e=>(...t)=>T.asap(()=>e(...t)),kv=bt.hasStandardBrowserEnv?function(){const t=bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent),n=document.createElement("a");let s;function i(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=i(window.location.href),function(a){const c=T.isString(a)?i(a):a;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}(),Mv=bt.hasStandardBrowserEnv?{write(e,t,n,s,i,o){const a=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),T.isString(s)&&a.push("path="+s),T.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $v(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fv(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ih(e,t){return e&&!$v(t)?Fv(e,t):t}const Vu=e=>e instanceof yt?{...e}:e;function ms(e,t){t=t||{};const n={};function s(p,d,m){return T.isPlainObject(p)&&T.isPlainObject(d)?T.merge.call({caseless:m},p,d):T.isPlainObject(d)?T.merge({},d):T.isArray(d)?d.slice():d}function i(p,d,m){if(T.isUndefined(d)){if(!T.isUndefined(p))return s(void 0,p,m)}else return s(p,d,m)}function o(p,d){if(!T.isUndefined(d))return s(void 0,d)}function a(p,d){if(T.isUndefined(d)){if(!T.isUndefined(p))return s(void 0,p)}else return s(void 0,d)}function c(p,d,m){if(m in t)return s(p,d);if(m in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,d)=>i(Vu(p),Vu(d),!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=f[d]||i,b=m(e[d],t[d],d);T.isUndefined(b)&&m!==c||(n[d]=b)}),n}const oh=e=>{const t=ms({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=yt.from(a),t.url=eh(ih(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(T.isFormData(n)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[p,...d]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...d].join("; "))}}if(bt.hasStandardBrowserEnv&&(s&&T.isFunction(s)&&(s=s(t)),s||s!==!1&&kv(t.url))){const p=i&&o&&Mv.read(o);p&&a.set(i,p)}return t},jv=typeof XMLHttpRequest<"u",Bv=jv&&function(e){return new Promise(function(n,s){const i=oh(e);let o=i.data;const a=yt.from(i.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:p}=i,d,m,b,w,C;function P(){w&&w(),C&&C(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let R=new XMLHttpRequest;R.open(i.method.toUpperCase(),i.url,!0),R.timeout=i.timeout;function $(){if(!R)return;const B=yt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),Y={data:!c||c==="text"||c==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:B,config:e,request:R};rh(function(le){n(le),P()},function(le){s(le),P()},Y),R=null}"onloadend"in R?R.onloadend=$:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout($)},R.onabort=function(){R&&(s(new de("Request aborted",de.ECONNABORTED,e,R)),R=null)},R.onerror=function(){s(new de("Network Error",de.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const Y=i.transitional||th;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),s(new de(H,Y.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,R)),R=null},o===void 0&&a.setContentType(null),"setRequestHeader"in R&&T.forEach(a.toJSON(),function(H,Y){R.setRequestHeader(Y,H)}),T.isUndefined(i.withCredentials)||(R.withCredentials=!!i.withCredentials),c&&c!=="json"&&(R.responseType=i.responseType),p&&([b,C]=xi(p,!0),R.addEventListener("progress",b)),f&&R.upload&&([m,w]=xi(f),R.upload.addEventListener("progress",m),R.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(d=B=>{R&&(s(!B||B.type?new Ks(null,e,R):B),R.abort(),R=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const N=Lv(i.url);if(N&&bt.protocols.indexOf(N)===-1){s(new de("Unsupported protocol "+N+":",de.ERR_BAD_REQUEST,e));return}R.send(o||null)})},Hv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,i;const o=function(p){if(!i){i=!0,c();const d=p instanceof Error?p:this.reason;s.abort(d instanceof de?d:new Ks(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:f}=s;return f.unsubscribe=()=>T.asap(c),f}},Vv=function*(e,t){let n=e.byteLength;if(!t||n{const i=Uv(e,t);let o=0,a,c=f=>{a||(a=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:p,value:d}=await i.next();if(p){c(),f.close();return}let m=d.byteLength;if(n){let b=o+=m;n(b)}f.enqueue(new Uint8Array(d))}catch(p){throw c(p),p}},cancel(f){return c(f),i.return()}},{highWaterMark:2})},Qi=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ah=Qi&&typeof ReadableStream=="function",Wv=Qi&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),lh=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zv=ah&&lh(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),qu=64*1024,ba=ah&&lh(()=>T.isReadableStream(new Response("").body)),Ri={stream:ba&&(e=>e.body)};Qi&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ri[t]&&(Ri[t]=T.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new de(`Response type '${t}' is not supported`,de.ERR_NOT_SUPPORT,s)})})})(new Response);const Kv=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Wv(e)).byteLength},Gv=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Kv(t)},Jv=Qi&&(async e=>{let{url:t,method:n,data:s,signal:i,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:f,responseType:p,headers:d,withCredentials:m="same-origin",fetchOptions:b}=oh(e);p=p?(p+"").toLowerCase():"text";let w=Hv([i,o&&o.toAbortSignal()],a),C;const P=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let R;try{if(f&&zv&&n!=="get"&&n!=="head"&&(R=await Gv(d,s))!==0){let Y=new Request(t,{method:"POST",body:s,duplex:"half"}),ge;if(T.isFormData(s)&&(ge=Y.headers.get("content-type"))&&d.setContentType(ge),Y.body){const[le,te]=Bu(R,xi(Hu(f)));s=Uu(Y.body,qu,le,te)}}T.isString(m)||(m=m?"include":"omit");const $="credentials"in Request.prototype;C=new Request(t,{...b,signal:w,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:$?m:void 0});let N=await fetch(C);const B=ba&&(p==="stream"||p==="response");if(ba&&(c||B&&P)){const Y={};["status","statusText","headers"].forEach(q=>{Y[q]=N[q]});const ge=T.toFiniteNumber(N.headers.get("content-length")),[le,te]=c&&Bu(ge,xi(Hu(c),!0))||[];N=new Response(Uu(N.body,qu,le,()=>{te&&te(),P&&P()}),Y)}p=p||"text";let H=await Ri[T.findKey(Ri,p)||"text"](N,e);return!B&&P&&P(),await new Promise((Y,ge)=>{rh(Y,ge,{data:H,headers:yt.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:C})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/fetch/i.test($.message)?Object.assign(new de("Network Error",de.ERR_NETWORK,e,C),{cause:$.cause||$}):de.from($,$&&$.code,e,C)}}),ya={http:uv,xhr:Bv,fetch:Jv};T.forEach(ya,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wu=e=>`- ${e}`,Xv=e=>T.isFunction(e)||e===null||e===!1,ch={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,s;const i={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : +`+o.map(Wu).join(` +`):" "+Wu(o[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:ya};function Qo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function zu(e){return Qo(e),e.headers=yt.from(e.headers),e.data=Xo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ch.getAdapter(e.adapter||Nr.adapter)(e).then(function(s){return Qo(e),s.data=Xo.call(e,e.transformResponse,s),s.headers=yt.from(s.headers),s},function(s){return sh(s)||(Qo(e),s&&s.response&&(s.response.data=Xo.call(e,e.transformResponse,s.response),s.response.headers=yt.from(s.response.headers))),Promise.reject(s)})}const uh="1.7.7",Qa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qa[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ku={};Qa.transitional=function(t,n,s){function i(o,a){return"[Axios v"+uh+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(t===!1)throw new de(i(a," has been removed"+(n?" in "+n:"")),de.ERR_DEPRECATED);return n&&!Ku[a]&&(Ku[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Qv(e,t,n){if(typeof e!="object")throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],a=t[o];if(a){const c=e[o],f=c===void 0||a(c,o,e);if(f!==!0)throw new de("option "+o+" must be "+f,de.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}}const va={assertOptions:Qv,validators:Qa},Ln=va.validators;class fs{constructor(t){this.defaults=t,this.interceptors={request:new Fu,response:new Fu}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(T.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&T.merge(o.common,o[n.method]);o&&T.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Yv(e){return function(n){return e.apply(null,n)}}function Zv(e){return T.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function fh(e){const t=new fs(e),n=Vd(fs.prototype.request,t);return T.extend(n,fs.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return fh(ms(e,i))},n}const Ke=fh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=sh;Ke.VERSION=uh;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Yv;Ke.isAxiosError=Zv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>nh(T.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=ch.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const ew="modulepreload",tw=function(e){return"/"+e},Gu={},on=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=tw(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":ew,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},dh=Ey({history:Qb(),routes:[{path:"/",name:"home",redirect:"/web/applications/swcatalog"},{path:"/web",name:"rootOssList",component:()=>on(()=>import("./OssList-CKt67AF3.js"),__vite__mapDeps([0,1,2,3,4,5,6]))},{path:"/web/oss/list",name:"ossList",component:()=>on(()=>import("./OssList-CKt67AF3.js"),__vite__mapDeps([0,1,2,3,4,5,6]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>on(()=>import("./YamlGenerate-CouOuHXH.js"),__vite__mapDeps([7,5,8,9]))},{path:"/web/repository/list",redirect:e=>({name:"repositoryList",query:e.query,hash:e.hash})},{path:"/web/repository/detail/:repositoryName",redirect:e=>({name:"repositoryDetail",params:{repositoryName:e.params.repositoryName},query:e.query,hash:e.hash})},{path:"/web/softwareCatalog/install",name:"softwareCatalogInstall",component:()=>on(()=>import("./InstallSoftwareIframe-56DCha6l.js"),__vite__mapDeps([10,11,6,12,5,13,2,8,14,15,16]))},{path:"/web/softwareCatalog",redirect:e=>({name:"softwareCatalog",query:e.query,hash:e.hash})},{path:"/web/applications/swcatalog",name:"softwareCatalog",component:()=>on(()=>import("./SoftwareCatalog-C_LrmSvx.js"),__vite__mapDeps([17,11,6,12,5,13,2,8,14,15,18,19]))},{path:"/web/applications/status",name:"applicationStatus",component:()=>on(()=>import("./ApplicationStatus-DR0-O9-6.js"),__vite__mapDeps([20,18,2,3,4,13,6,5,8,14,21]))},{path:"/web/applications/repository",component:()=>on(()=>import("./ApplicationRepository-DIXbaB2_.js"),__vite__mapDeps([22,1,2])),children:[{path:"",name:"repositoryList",component:()=>on(()=>import("./RepositoryList-j_fxhQrY.js"),__vite__mapDeps([23,3,4,24,5,6]))},{path:":repositoryName",name:"repositoryDetail",component:()=>on(()=>import("./RepositoryDetail-Bjm5j-jk.js"),__vite__mapDeps([25,24,5,12,3,4]))}]},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>on(()=>import("./SoftwareCatalogListTest-Bv1oxm_T.js"),__vite__mapDeps([26,1,2,13,6,5,8,14,12,11,15,27]))}]}),nw=vb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){var e,t,n,s;return((e=this.projectInfo)==null?void 0:e.ns_id)||((t=this.projectInfo)==null?void 0:t.nsid)||((n=this.projectInfo)==null?void 0:n.nsId)||((s=this.projectInfo)==null?void 0:s.NsId)||null},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});let Ju=!1;dh.beforeEach(async(e,t,n)=>{Ju||(window.addEventListener("message",function(s){var f,p,d,m;const i=s.data;if(!i||typeof i!="object")return;const o=String(i.accessToken??"").trim(),a=((f=i.workspaceInfo)==null?void 0:f.id)??((p=i.workspaceInfo)==null?void 0:p.Id),c=((d=i.projectInfo)==null?void 0:d.id)??((m=i.projectInfo)==null?void 0:m.Id);if(!(!o||["undefined","null"].includes(o.toLowerCase())||!a||!c))try{nw().setUser(i)}catch{console.error("Unable to apply Web Console project context.")}}),Ju=!0),n()});const sw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},f0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var rw=Object.defineProperty,Xu=Object.getOwnPropertySymbols,iw=Object.prototype.hasOwnProperty,ow=Object.prototype.propertyIsEnumerable,Qu=(e,t,n)=>t in e?rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hh=(e,t)=>{for(var n in t||(t={}))iw.call(t,n)&&Qu(e,n,t[n]);if(Xu)for(var n of Xu(t))ow.call(t,n)&&Qu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",ph=e=>Zi(e)&&e.trim().length>0,aw=e=>typeof e=="number",ls=e=>typeof e>"u",Tr=e=>typeof e=="object"&&e!==null,lw=e=>un(e,"tag")&&ph(e.tag),mh=e=>window.TouchEvent&&e instanceof TouchEvent,gh=e=>un(e,"component")&&_h(e.component),cw=e=>Yi(e)||Tr(e),_h=e=>!ls(e)&&(Zi(e)||cw(e)||gh(e)),Yu=e=>Tr(e)&&["height","width","right","left","top","bottom"].every(t=>aw(e[t])),un=(e,t)=>(Tr(e)||Yi(e))&&t in e,uw=(e=>()=>e++)(0);function Yo(e){return mh(e)?e.targetTouches[0].clientX:e.clientX}function Zu(e){return mh(e)?e.targetTouches[0].clientY:e.clientY}var fw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>gh(e)?kr(e.component):lw(e)?dn({render(){return e}}):typeof e=="string"?e:Ee(jn(e)),dw=e=>{if(typeof e=="string")return e;const t=un(e,"props")&&Tr(e.props)?e.props:{},n=un(e,"listeners")&&Tr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},hw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},pw=e=>["on","off","emit"].every(t=>un(e,t)&&Yi(e[t])),Tt;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(Tt||(Tt={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var Wt="Vue-Toastification",Ut={type:{type:String,default:Tt.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},bh={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},yh={transition:{type:[Object,String],default:`${Wt}__bounce`}},mw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:bh.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},gw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},_w={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:yh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},Cn={CORE_TOAST:mw,TOAST:gw,CONTAINER:_w,PROGRESS_BAR:Ea,ICON:bh,TRANSITION:yh,CLOSE_BUTTON:bi},vh=dn({name:"VtProgressBar",props:Cn.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${Wt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function bw(e,t){return Ve(),qt("div",{style:Or(e.style),class:Hn(e.cpClass)},null,6)}vh.render=bw;var yw=vh,wh=dn({name:"VtCloseButton",props:Cn.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${Wt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),vw=Bi(" × ");function ww(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Ir(()=>[vw]),_:1},16,["aria-label","class"])}wh.render=ww;var Ew=wh,Eh={},Cw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Sw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Sw];function Aw(e,t){return Ve(),qt("svg",Cw,Tw)}Eh.render=Aw;var Ow=Eh,Ch={},xw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Rw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Pw=[Rw];function Iw(e,t){return Ve(),qt("svg",xw,Pw)}Ch.render=Iw;var ef=Ch,Sh={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Dw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Nw=[Dw];function kw(e,t){return Ve(),qt("svg",Lw,Nw)}Sh.render=kw;var Mw=Sh,Th={},$w={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},Fw=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),jw=[Fw];function Bw(e,t){return Ve(),qt("svg",$w,jw)}Th.render=Bw;var Hw=Th,Ah=dn({name:"VtIcon",props:Cn.ICON,computed:{customIconChildren(){return un(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):un(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return un(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:_h(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[Tt.DEFAULT]:ef,[Tt.INFO]:ef,[Tt.SUCCESS]:Ow,[Tt.ERROR]:Hw,[Tt.WARNING]:Mw}[this.type]},iconClasses(){const e=[`${Wt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return ph(e)?e.trim():t}}});function Vw(e,t){return Ve(),jt(Va(e.component),{class:Hn(e.iconClasses)},{default:Ir(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Ah.render=Vw;var Uw=Ah,Oh=dn({name:"VtToast",components:{ProgressBar:yw,CloseButton:Ew,Icon:Uw},inheritAttrs:!1,props:Object.assign({},Cn.CORE_TOAST,Cn.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${Wt}__toast`,`${Wt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${Wt}__toast--rtl`),e},bodyClasses(){return[`${Wt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Yu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:un,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Zu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Zu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Yu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),qw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),qt("div",{class:Hn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Hn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),qt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Hg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,qw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:lb(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Oh.render=Ww;var zw=Oh,xh=dn({name:"VtTransition",props:Cn.TRANSITION,emits:["leave"],methods:{hasProp:un,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function Kw(e,t){return Ve(),jt(eb,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Ir(()=>[Bg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}xh.render=Kw;var Gw=xh,Rh=dn({name:"VueToastification",devtools:{hide:!0},components:{Toast:zw,VtTransition:Gw},props:Object.assign({},Cn.CORE_TOAST,Cn.CONTAINER,Cn.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),fw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=dw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${Wt}__container`,e].concat(this.defaults.containerClassName)}}});function Jw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),qt("div",null,[(Ve(!0),qt(tt,null,jc(e.positions,i=>(Ve(),qt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Hn(e.getClasses(i))},{default:Ir(()=>[(Ve(!0),qt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}Rh.render=Jw;var Xw=Rh,tf=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Xw,hh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${Wt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:uw(),type:Tt.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:Tt.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:Tt.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:Tt.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:Tt.WARNING})),s},Qw=()=>{const e=()=>console.warn(`[${Wt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Ph(e){return hw()?pw(e)?tf({eventBus:e},!1):tf(e,!0):Qw()}var Ih=Symbol("VueToastification"),Lh=new Za,Yw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Ph(hh({eventBus:Lh},t));e.provide(Ih,n)},d0=e=>{const t=hd()?xt(Ih,void 0):void 0;return t||Ph(Lh)},Zw=Yw,e0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function h0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t0={exports:{}};/*! + * Bootstrap v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */(function(e,t){(function(n,s){e.exports=s()})(e0,function(){const n=new Map,s={set(u,r,l){n.has(u)||n.set(u,new Map);const h=n.get(u);h.has(r)||h.size===0?h.set(r,l):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(h.keys())[0]}.`)},get:(u,r)=>n.has(u)&&n.get(u).get(r)||null,remove(u,r){if(!n.has(u))return;const l=n.get(u);l.delete(r),l.size===0&&n.delete(u)}},i="transitionend",o=u=>(u&&window.CSS&&window.CSS.escape&&(u=u.replace(/#([^\s"#']+)/g,(r,l)=>`#${CSS.escape(l)}`)),u),a=u=>{u.dispatchEvent(new Event(i))},c=u=>!(!u||typeof u!="object")&&(u.jquery!==void 0&&(u=u[0]),u.nodeType!==void 0),f=u=>c(u)?u.jquery?u[0]:u:typeof u=="string"&&u.length>0?document.querySelector(o(u)):null,p=u=>{if(!c(u)||u.getClientRects().length===0)return!1;const r=getComputedStyle(u).getPropertyValue("visibility")==="visible",l=u.closest("details:not([open])");if(!l)return r;if(l!==u){const h=u.closest("summary");if(h&&h.parentNode!==l||h===null)return!1}return r},d=u=>!u||u.nodeType!==Node.ELEMENT_NODE||!!u.classList.contains("disabled")||(u.disabled!==void 0?u.disabled:u.hasAttribute("disabled")&&u.getAttribute("disabled")!=="false"),m=u=>{if(!document.documentElement.attachShadow)return null;if(typeof u.getRootNode=="function"){const r=u.getRootNode();return r instanceof ShadowRoot?r:null}return u instanceof ShadowRoot?u:u.parentNode?m(u.parentNode):null},b=()=>{},w=u=>{u.offsetHeight},C=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,P=[],R=()=>document.documentElement.dir==="rtl",$=u=>{var r;r=()=>{const l=C();if(l){const h=u.NAME,y=l.fn[h];l.fn[h]=u.jQueryInterface,l.fn[h].Constructor=u,l.fn[h].noConflict=()=>(l.fn[h]=y,u.jQueryInterface)}},document.readyState==="loading"?(P.length||document.addEventListener("DOMContentLoaded",()=>{for(const l of P)l()}),P.push(r)):r()},N=(u,r=[],l=u)=>typeof u=="function"?u(...r):l,B=(u,r,l=!0)=>{if(!l)return void N(u);const h=(S=>{if(!S)return 0;let{transitionDuration:L,transitionDelay:j}=window.getComputedStyle(S);const J=Number.parseFloat(L),X=Number.parseFloat(j);return J||X?(L=L.split(",")[0],j=j.split(",")[0],1e3*(Number.parseFloat(L)+Number.parseFloat(j))):0})(r)+5;let y=!1;const v=({target:S})=>{S===r&&(y=!0,r.removeEventListener(i,v),N(u))};r.addEventListener(i,v),setTimeout(()=>{y||a(r)},h)},H=(u,r,l,h)=>{const y=u.length;let v=u.indexOf(r);return v===-1?!l&&h?u[y-1]:u[0]:(v+=l?1:-1,h&&(v=(v+y)%y),u[Math.max(0,Math.min(v,y-1))])},Y=/[^.]*(?=\..*)\.|.*/,ge=/\..*/,le=/::\d+$/,te={};let q=1;const oe={mouseenter:"mouseover",mouseleave:"mouseout"},ve=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function G(u,r){return r&&`${r}::${q++}`||u.uidEvent||q++}function be(u){const r=G(u);return u.uidEvent=r,te[r]=te[r]||{},te[r]}function He(u,r,l=null){return Object.values(u).find(h=>h.callable===r&&h.delegationSelector===l)}function st(u,r,l){const h=typeof r=="string",y=h?l:r||l;let v=Pt(u);return ve.has(v)||(v=u),[h,y,v]}function Oe(u,r,l,h,y){if(typeof r!="string"||!u)return;let[v,S,L]=st(r,l,h);r in oe&&(S=(ce=>function(ie){if(!ie.relatedTarget||ie.relatedTarget!==ie.delegateTarget&&!ie.delegateTarget.contains(ie.relatedTarget))return ce.call(this,ie)})(S));const j=be(u),J=j[L]||(j[L]={}),X=He(J,S,v?l:null);if(X)return void(X.oneOff=X.oneOff&&y);const K=G(S,r.replace(Y,"")),he=v?function(se,ce,ie){return function ue(Le){const Fe=se.querySelectorAll(ce);for(let{target:_e}=Le;_e&&_e!==this;_e=_e.parentNode)for(const Ae of Fe)if(Ae===_e)return _t(Le,{delegateTarget:_e}),ue.oneOff&&I.off(se,Le.type,ce,ie),ie.apply(_e,[Le])}}(u,l,S):function(se,ce){return function ie(ue){return _t(ue,{delegateTarget:se}),ie.oneOff&&I.off(se,ue.type,ce),ce.apply(se,[ue])}}(u,S);he.delegationSelector=v?l:null,he.callable=S,he.oneOff=y,he.uidEvent=K,J[K]=he,u.addEventListener(L,he,v)}function ae(u,r,l,h,y){const v=He(r[l],h,y);v&&(u.removeEventListener(l,v,!!y),delete r[l][v.uidEvent])}function Se(u,r,l,h){const y=r[l]||{};for(const[v,S]of Object.entries(y))v.includes(h)&&ae(u,r,l,S.callable,S.delegationSelector)}function Pt(u){return u=u.replace(ge,""),oe[u]||u}const I={on(u,r,l,h){Oe(u,r,l,h,!1)},one(u,r,l,h){Oe(u,r,l,h,!0)},off(u,r,l,h){if(typeof r!="string"||!u)return;const[y,v,S]=st(r,l,h),L=S!==r,j=be(u),J=j[S]||{},X=r.startsWith(".");if(v===void 0){if(X)for(const K of Object.keys(j))Se(u,j,K,r.slice(1));for(const[K,he]of Object.entries(J)){const se=K.replace(le,"");L&&!r.includes(se)||ae(u,j,S,he.callable,he.delegationSelector)}}else{if(!Object.keys(J).length)return;ae(u,j,S,v,y?l:null)}},trigger(u,r,l){if(typeof r!="string"||!u)return null;const h=C();let y=null,v=!0,S=!0,L=!1;r!==Pt(r)&&h&&(y=h.Event(r,l),h(u).trigger(y),v=!y.isPropagationStopped(),S=!y.isImmediatePropagationStopped(),L=y.isDefaultPrevented());const j=_t(new Event(r,{bubbles:v,cancelable:!0}),l);return L&&j.preventDefault(),S&&u.dispatchEvent(j),j.defaultPrevented&&y&&y.preventDefault(),j}};function _t(u,r={}){for(const[l,h]of Object.entries(r))try{u[l]=h}catch{Object.defineProperty(u,l,{configurable:!0,get:()=>h})}return u}function et(u){if(u==="true")return!0;if(u==="false")return!1;if(u===Number(u).toString())return Number(u);if(u===""||u==="null")return null;if(typeof u!="string")return u;try{return JSON.parse(decodeURIComponent(u))}catch{return u}}function Yt(u){return u.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}const rt={setDataAttribute(u,r,l){u.setAttribute(`data-bs-${Yt(r)}`,l)},removeDataAttribute(u,r){u.removeAttribute(`data-bs-${Yt(r)}`)},getDataAttributes(u){if(!u)return{};const r={},l=Object.keys(u.dataset).filter(h=>h.startsWith("bs")&&!h.startsWith("bsConfig"));for(const h of l){let y=h.replace(/^bs/,"");y=y.charAt(0).toLowerCase()+y.slice(1,y.length),r[y]=et(u.dataset[h])}return r},getDataAttribute:(u,r)=>et(u.getAttribute(`data-bs-${Yt(r)}`))};class Zt{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(r){return r=this._mergeConfigObj(r),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}_configAfterMerge(r){return r}_mergeConfigObj(r,l){const h=c(l)?rt.getDataAttribute(l,"config"):{};return{...this.constructor.Default,...typeof h=="object"?h:{},...c(l)?rt.getDataAttributes(l):{},...typeof r=="object"?r:{}}}_typeCheckConfig(r,l=this.constructor.DefaultType){for(const[y,v]of Object.entries(l)){const S=r[y],L=c(S)?"element":(h=S)==null?`${h}`:Object.prototype.toString.call(h).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(v).test(L))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${y}" provided type "${L}" but expected type "${v}".`)}var h}}class Be extends Zt{constructor(r,l){super(),(r=f(r))&&(this._element=r,this._config=this._getConfig(l),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),I.off(this._element,this.constructor.EVENT_KEY);for(const r of Object.getOwnPropertyNames(this))this[r]=null}_queueCallback(r,l,h=!0){B(r,l,h)}_getConfig(r){return r=this._mergeConfigObj(r,this._element),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}static getInstance(r){return s.get(f(r),this.DATA_KEY)}static getOrCreateInstance(r,l={}){return this.getInstance(r)||new this(r,typeof l=="object"?l:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(r){return`${r}${this.EVENT_KEY}`}}const x=u=>{let r=u.getAttribute("data-bs-target");if(!r||r==="#"){let l=u.getAttribute("href");if(!l||!l.includes("#")&&!l.startsWith("."))return null;l.includes("#")&&!l.startsWith("#")&&(l=`#${l.split("#")[1]}`),r=l&&l!=="#"?l.trim():null}return r?r.split(",").map(l=>o(l)).join(","):null},A={find:(u,r=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(r,u)),findOne:(u,r=document.documentElement)=>Element.prototype.querySelector.call(r,u),children:(u,r)=>[].concat(...u.children).filter(l=>l.matches(r)),parents(u,r){const l=[];let h=u.parentNode.closest(r);for(;h;)l.push(h),h=h.parentNode.closest(r);return l},prev(u,r){let l=u.previousElementSibling;for(;l;){if(l.matches(r))return[l];l=l.previousElementSibling}return[]},next(u,r){let l=u.nextElementSibling;for(;l;){if(l.matches(r))return[l];l=l.nextElementSibling}return[]},focusableChildren(u){const r=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(l=>`${l}:not([tabindex^="-"])`).join(",");return this.find(r,u).filter(l=>!d(l)&&p(l))},getSelectorFromElement(u){const r=x(u);return r&&A.findOne(r)?r:null},getElementFromSelector(u){const r=x(u);return r?A.findOne(r):null},getMultipleElementsFromSelector(u){const r=x(u);return r?A.find(r):[]}},U=(u,r="hide")=>{const l=`click.dismiss${u.EVENT_KEY}`,h=u.NAME;I.on(document,l,`[data-bs-dismiss="${h}"]`,function(y){if(["A","AREA"].includes(this.tagName)&&y.preventDefault(),d(this))return;const v=A.getElementFromSelector(this)||this.closest(`.${h}`);u.getOrCreateInstance(v)[r]()})},Z=".bs.alert",Te=`close${Z}`,je=`closed${Z}`;class g extends Be{static get NAME(){return"alert"}close(){if(I.trigger(this._element,Te).defaultPrevented)return;this._element.classList.remove("show");const r=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,r)}_destroyElement(){this._element.remove(),I.trigger(this._element,je),this.dispose()}static jQueryInterface(r){return this.each(function(){const l=g.getOrCreateInstance(this);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r](this)}})}}U(g,"close"),$(g);const _='[data-bs-toggle="button"]';class E extends Be{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(r){return this.each(function(){const l=E.getOrCreateInstance(this);r==="toggle"&&l[r]()})}}I.on(document,"click.bs.button.data-api",_,u=>{u.preventDefault();const r=u.target.closest(_);E.getOrCreateInstance(r).toggle()}),$(E);const D=".bs.swipe",O=`touchstart${D}`,k=`touchmove${D}`,W=`touchend${D}`,V=`pointerdown${D}`,F=`pointerup${D}`,M={endCallback:null,leftCallback:null,rightCallback:null},ne={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class z extends Zt{constructor(r,l){super(),this._element=r,r&&z.isSupported()&&(this._config=this._getConfig(l),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return M}static get DefaultType(){return ne}static get NAME(){return"swipe"}dispose(){I.off(this._element,D)}_start(r){this._supportPointerEvents?this._eventIsPointerPenTouch(r)&&(this._deltaX=r.clientX):this._deltaX=r.touches[0].clientX}_end(r){this._eventIsPointerPenTouch(r)&&(this._deltaX=r.clientX-this._deltaX),this._handleSwipe(),N(this._config.endCallback)}_move(r){this._deltaX=r.touches&&r.touches.length>1?0:r.touches[0].clientX-this._deltaX}_handleSwipe(){const r=Math.abs(this._deltaX);if(r<=40)return;const l=r/this._deltaX;this._deltaX=0,l&&N(l>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(I.on(this._element,V,r=>this._start(r)),I.on(this._element,F,r=>this._end(r)),this._element.classList.add("pointer-event")):(I.on(this._element,O,r=>this._start(r)),I.on(this._element,k,r=>this._move(r)),I.on(this._element,W,r=>this._end(r)))}_eventIsPointerPenTouch(r){return this._supportPointerEvents&&(r.pointerType==="pen"||r.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Q=".bs.carousel",re=".data-api",pe="next",Ce="prev",ye="left",Xe="right",Qe=`slide${Q}`,at=`slid${Q}`,lt=`keydown${Q}`,Wn=`mouseenter${Q}`,$r=`mouseleave${Q}`,ct=`dragstart${Q}`,It=`load${Q}${re}`,Fr=`click${Q}${re}`,el="carousel",jr="active",tl=".active",nl=".carousel-item",Dh=tl+nl,Nh={ArrowLeft:Xe,ArrowRight:ye},kh={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Mh={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class bs extends Be{constructor(r,l){super(r,l),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=A.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===el&&this.cycle()}static get Default(){return kh}static get DefaultType(){return Mh}static get NAME(){return"carousel"}next(){this._slide(pe)}nextWhenVisible(){!document.hidden&&p(this._element)&&this.next()}prev(){this._slide(Ce)}pause(){this._isSliding&&a(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?I.one(this._element,at,()=>this.cycle()):this.cycle())}to(r){const l=this._getItems();if(r>l.length-1||r<0)return;if(this._isSliding)return void I.one(this._element,at,()=>this.to(r));const h=this._getItemIndex(this._getActive());if(h===r)return;const y=r>h?pe:Ce;this._slide(y,l[r])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(r){return r.defaultInterval=r.interval,r}_addEventListeners(){this._config.keyboard&&I.on(this._element,lt,r=>this._keydown(r)),this._config.pause==="hover"&&(I.on(this._element,Wn,()=>this.pause()),I.on(this._element,$r,()=>this._maybeEnableCycle())),this._config.touch&&z.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const l of A.find(".carousel-item img",this._element))I.on(l,ct,h=>h.preventDefault());const r={leftCallback:()=>this._slide(this._directionToOrder(ye)),rightCallback:()=>this._slide(this._directionToOrder(Xe)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new z(this._element,r)}_keydown(r){if(/input|textarea/i.test(r.target.tagName))return;const l=Nh[r.key];l&&(r.preventDefault(),this._slide(this._directionToOrder(l)))}_getItemIndex(r){return this._getItems().indexOf(r)}_setActiveIndicatorElement(r){if(!this._indicatorsElement)return;const l=A.findOne(tl,this._indicatorsElement);l.classList.remove(jr),l.removeAttribute("aria-current");const h=A.findOne(`[data-bs-slide-to="${r}"]`,this._indicatorsElement);h&&(h.classList.add(jr),h.setAttribute("aria-current","true"))}_updateInterval(){const r=this._activeElement||this._getActive();if(!r)return;const l=Number.parseInt(r.getAttribute("data-bs-interval"),10);this._config.interval=l||this._config.defaultInterval}_slide(r,l=null){if(this._isSliding)return;const h=this._getActive(),y=r===pe,v=l||H(this._getItems(),h,y,this._config.wrap);if(v===h)return;const S=this._getItemIndex(v),L=K=>I.trigger(this._element,K,{relatedTarget:v,direction:this._orderToDirection(r),from:this._getItemIndex(h),to:S});if(L(Qe).defaultPrevented||!h||!v)return;const j=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(S),this._activeElement=v;const J=y?"carousel-item-start":"carousel-item-end",X=y?"carousel-item-next":"carousel-item-prev";v.classList.add(X),w(v),h.classList.add(J),v.classList.add(J),this._queueCallback(()=>{v.classList.remove(J,X),v.classList.add(jr),h.classList.remove(jr,X,J),this._isSliding=!1,L(at)},h,this._isAnimated()),j&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return A.findOne(Dh,this._element)}_getItems(){return A.find(nl,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(r){return R()?r===ye?Ce:pe:r===ye?pe:Ce}_orderToDirection(r){return R()?r===Ce?ye:Xe:r===Ce?Xe:ye}static jQueryInterface(r){return this.each(function(){const l=bs.getOrCreateInstance(this,r);if(typeof r!="number"){if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}}else l.to(r)})}}I.on(document,Fr,"[data-bs-slide], [data-bs-slide-to]",function(u){const r=A.getElementFromSelector(this);if(!r||!r.classList.contains(el))return;u.preventDefault();const l=bs.getOrCreateInstance(r),h=this.getAttribute("data-bs-slide-to");return h?(l.to(h),void l._maybeEnableCycle()):rt.getDataAttribute(this,"slide")==="next"?(l.next(),void l._maybeEnableCycle()):(l.prev(),void l._maybeEnableCycle())}),I.on(window,It,()=>{const u=A.find('[data-bs-ride="carousel"]');for(const r of u)bs.getOrCreateInstance(r)}),$(bs);const Gs=".bs.collapse",$h=`show${Gs}`,Fh=`shown${Gs}`,jh=`hide${Gs}`,Bh=`hidden${Gs}`,Hh=`click${Gs}.data-api`,eo="show",ys="collapse",Br="collapsing",Vh=`:scope .${ys} .${ys}`,to='[data-bs-toggle="collapse"]',Uh={parent:null,toggle:!0},qh={parent:"(null|element)",toggle:"boolean"};class vs extends Be{constructor(r,l){super(r,l),this._isTransitioning=!1,this._triggerArray=[];const h=A.find(to);for(const y of h){const v=A.getSelectorFromElement(y),S=A.find(v).filter(L=>L===this._element);v!==null&&S.length&&this._triggerArray.push(y)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Uh}static get DefaultType(){return qh}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let r=[];if(this._config.parent&&(r=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(y=>y!==this._element).map(y=>vs.getOrCreateInstance(y,{toggle:!1}))),r.length&&r[0]._isTransitioning||I.trigger(this._element,$h).defaultPrevented)return;for(const y of r)y.hide();const l=this._getDimension();this._element.classList.remove(ys),this._element.classList.add(Br),this._element.style[l]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const h=`scroll${l[0].toUpperCase()+l.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Br),this._element.classList.add(ys,eo),this._element.style[l]="",I.trigger(this._element,Fh)},this._element,!0),this._element.style[l]=`${this._element[h]}px`}hide(){if(this._isTransitioning||!this._isShown()||I.trigger(this._element,jh).defaultPrevented)return;const r=this._getDimension();this._element.style[r]=`${this._element.getBoundingClientRect()[r]}px`,w(this._element),this._element.classList.add(Br),this._element.classList.remove(ys,eo);for(const l of this._triggerArray){const h=A.getElementFromSelector(l);h&&!this._isShown(h)&&this._addAriaAndCollapsedClass([l],!1)}this._isTransitioning=!0,this._element.style[r]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Br),this._element.classList.add(ys),I.trigger(this._element,Bh)},this._element,!0)}_isShown(r=this._element){return r.classList.contains(eo)}_configAfterMerge(r){return r.toggle=!!r.toggle,r.parent=f(r.parent),r}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const r=this._getFirstLevelChildren(to);for(const l of r){const h=A.getElementFromSelector(l);h&&this._addAriaAndCollapsedClass([l],this._isShown(h))}}_getFirstLevelChildren(r){const l=A.find(Vh,this._config.parent);return A.find(r,this._config.parent).filter(h=>!l.includes(h))}_addAriaAndCollapsedClass(r,l){if(r.length)for(const h of r)h.classList.toggle("collapsed",!l),h.setAttribute("aria-expanded",l)}static jQueryInterface(r){const l={};return typeof r=="string"&&/show|hide/.test(r)&&(l.toggle=!1),this.each(function(){const h=vs.getOrCreateInstance(this,l);if(typeof r=="string"){if(h[r]===void 0)throw new TypeError(`No method named "${r}"`);h[r]()}})}}I.on(document,Hh,to,function(u){(u.target.tagName==="A"||u.delegateTarget&&u.delegateTarget.tagName==="A")&&u.preventDefault();for(const r of A.getMultipleElementsFromSelector(this))vs.getOrCreateInstance(r,{toggle:!1}).toggle()}),$(vs);var ut="top",vt="bottom",wt="right",ft="left",Hr="auto",ws=[ut,vt,wt,ft],zn="start",Es="end",sl="clippingParents",no="viewport",Cs="popper",rl="reference",so=ws.reduce(function(u,r){return u.concat([r+"-"+zn,r+"-"+Es])},[]),ro=[].concat(ws,[Hr]).reduce(function(u,r){return u.concat([r,r+"-"+zn,r+"-"+Es])},[]),il="beforeRead",ol="read",al="afterRead",ll="beforeMain",cl="main",ul="afterMain",fl="beforeWrite",dl="write",hl="afterWrite",pl=[il,ol,al,ll,cl,ul,fl,dl,hl];function en(u){return u?(u.nodeName||"").toLowerCase():null}function Et(u){if(u==null)return window;if(u.toString()!=="[object Window]"){var r=u.ownerDocument;return r&&r.defaultView||window}return u}function Kn(u){return u instanceof Et(u).Element||u instanceof Element}function Lt(u){return u instanceof Et(u).HTMLElement||u instanceof HTMLElement}function io(u){return typeof ShadowRoot<"u"&&(u instanceof Et(u).ShadowRoot||u instanceof ShadowRoot)}const oo={name:"applyStyles",enabled:!0,phase:"write",fn:function(u){var r=u.state;Object.keys(r.elements).forEach(function(l){var h=r.styles[l]||{},y=r.attributes[l]||{},v=r.elements[l];Lt(v)&&en(v)&&(Object.assign(v.style,h),Object.keys(y).forEach(function(S){var L=y[S];L===!1?v.removeAttribute(S):v.setAttribute(S,L===!0?"":L)}))})},effect:function(u){var r=u.state,l={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,l.popper),r.styles=l,r.elements.arrow&&Object.assign(r.elements.arrow.style,l.arrow),function(){Object.keys(r.elements).forEach(function(h){var y=r.elements[h],v=r.attributes[h]||{},S=Object.keys(r.styles.hasOwnProperty(h)?r.styles[h]:l[h]).reduce(function(L,j){return L[j]="",L},{});Lt(y)&&en(y)&&(Object.assign(y.style,S),Object.keys(v).forEach(function(L){y.removeAttribute(L)}))})}},requires:["computeStyles"]};function tn(u){return u.split("-")[0]}var Gn=Math.max,Vr=Math.min,Ss=Math.round;function ao(){var u=navigator.userAgentData;return u!=null&&u.brands&&Array.isArray(u.brands)?u.brands.map(function(r){return r.brand+"/"+r.version}).join(" "):navigator.userAgent}function ml(){return!/^((?!chrome|android).)*safari/i.test(ao())}function Ts(u,r,l){r===void 0&&(r=!1),l===void 0&&(l=!1);var h=u.getBoundingClientRect(),y=1,v=1;r&&Lt(u)&&(y=u.offsetWidth>0&&Ss(h.width)/u.offsetWidth||1,v=u.offsetHeight>0&&Ss(h.height)/u.offsetHeight||1);var S=(Kn(u)?Et(u):window).visualViewport,L=!ml()&&l,j=(h.left+(L&&S?S.offsetLeft:0))/y,J=(h.top+(L&&S?S.offsetTop:0))/v,X=h.width/y,K=h.height/v;return{width:X,height:K,top:J,right:j+X,bottom:J+K,left:j,x:j,y:J}}function lo(u){var r=Ts(u),l=u.offsetWidth,h=u.offsetHeight;return Math.abs(r.width-l)<=1&&(l=r.width),Math.abs(r.height-h)<=1&&(h=r.height),{x:u.offsetLeft,y:u.offsetTop,width:l,height:h}}function gl(u,r){var l=r.getRootNode&&r.getRootNode();if(u.contains(r))return!0;if(l&&io(l)){var h=r;do{if(h&&u.isSameNode(h))return!0;h=h.parentNode||h.host}while(h)}return!1}function hn(u){return Et(u).getComputedStyle(u)}function Wh(u){return["table","td","th"].indexOf(en(u))>=0}function An(u){return((Kn(u)?u.ownerDocument:u.document)||window.document).documentElement}function Ur(u){return en(u)==="html"?u:u.assignedSlot||u.parentNode||(io(u)?u.host:null)||An(u)}function _l(u){return Lt(u)&&hn(u).position!=="fixed"?u.offsetParent:null}function Js(u){for(var r=Et(u),l=_l(u);l&&Wh(l)&&hn(l).position==="static";)l=_l(l);return l&&(en(l)==="html"||en(l)==="body"&&hn(l).position==="static")?r:l||function(h){var y=/firefox/i.test(ao());if(/Trident/i.test(ao())&&Lt(h)&&hn(h).position==="fixed")return null;var v=Ur(h);for(io(v)&&(v=v.host);Lt(v)&&["html","body"].indexOf(en(v))<0;){var S=hn(v);if(S.transform!=="none"||S.perspective!=="none"||S.contain==="paint"||["transform","perspective"].indexOf(S.willChange)!==-1||y&&S.willChange==="filter"||y&&S.filter&&S.filter!=="none")return v;v=v.parentNode}return null}(u)||r}function co(u){return["top","bottom"].indexOf(u)>=0?"x":"y"}function Xs(u,r,l){return Gn(u,Vr(r,l))}function bl(u){return Object.assign({},{top:0,right:0,bottom:0,left:0},u)}function yl(u,r){return r.reduce(function(l,h){return l[h]=u,l},{})}const vl={name:"arrow",enabled:!0,phase:"main",fn:function(u){var r,l=u.state,h=u.name,y=u.options,v=l.elements.arrow,S=l.modifiersData.popperOffsets,L=tn(l.placement),j=co(L),J=[ft,wt].indexOf(L)>=0?"height":"width";if(v&&S){var X=function(De,Re){return bl(typeof(De=typeof De=="function"?De(Object.assign({},Re.rects,{placement:Re.placement})):De)!="number"?De:yl(De,ws))}(y.padding,l),K=lo(v),he=j==="y"?ut:ft,se=j==="y"?vt:wt,ce=l.rects.reference[J]+l.rects.reference[j]-S[j]-l.rects.popper[J],ie=S[j]-l.rects.reference[j],ue=Js(v),Le=ue?j==="y"?ue.clientHeight||0:ue.clientWidth||0:0,Fe=ce/2-ie/2,_e=X[he],Ae=Le-K[J]-X[se],me=Le/2-K[J]/2+Fe,we=Xs(_e,me,Ae),xe=j;l.modifiersData[h]=((r={})[xe]=we,r.centerOffset=we-me,r)}},effect:function(u){var r=u.state,l=u.options.element,h=l===void 0?"[data-popper-arrow]":l;h!=null&&(typeof h!="string"||(h=r.elements.popper.querySelector(h)))&&gl(r.elements.popper,h)&&(r.elements.arrow=h)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function As(u){return u.split("-")[1]}var zh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wl(u){var r,l=u.popper,h=u.popperRect,y=u.placement,v=u.variation,S=u.offsets,L=u.position,j=u.gpuAcceleration,J=u.adaptive,X=u.roundOffsets,K=u.isFixed,he=S.x,se=he===void 0?0:he,ce=S.y,ie=ce===void 0?0:ce,ue=typeof X=="function"?X({x:se,y:ie}):{x:se,y:ie};se=ue.x,ie=ue.y;var Le=S.hasOwnProperty("x"),Fe=S.hasOwnProperty("y"),_e=ft,Ae=ut,me=window;if(J){var we=Js(l),xe="clientHeight",De="clientWidth";we===Et(l)&&hn(we=An(l)).position!=="static"&&L==="absolute"&&(xe="scrollHeight",De="scrollWidth"),(y===ut||(y===ft||y===wt)&&v===Es)&&(Ae=vt,ie-=(K&&we===me&&me.visualViewport?me.visualViewport.height:we[xe])-h.height,ie*=j?1:-1),y!==ft&&(y!==ut&&y!==vt||v!==Es)||(_e=wt,se-=(K&&we===me&&me.visualViewport?me.visualViewport.width:we[De])-h.width,se*=j?1:-1)}var Re,We=Object.assign({position:L},J&&zh),Ct=X===!0?function(Vt,dt){var Nt=Vt.x,kt=Vt.y,Ue=dt.devicePixelRatio||1;return{x:Ss(Nt*Ue)/Ue||0,y:Ss(kt*Ue)/Ue||0}}({x:se,y:ie},Et(l)):{x:se,y:ie};return se=Ct.x,ie=Ct.y,j?Object.assign({},We,((Re={})[Ae]=Fe?"0":"",Re[_e]=Le?"0":"",Re.transform=(me.devicePixelRatio||1)<=1?"translate("+se+"px, "+ie+"px)":"translate3d("+se+"px, "+ie+"px, 0)",Re)):Object.assign({},We,((r={})[Ae]=Fe?ie+"px":"",r[_e]=Le?se+"px":"",r.transform="",r))}const uo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(u){var r=u.state,l=u.options,h=l.gpuAcceleration,y=h===void 0||h,v=l.adaptive,S=v===void 0||v,L=l.roundOffsets,j=L===void 0||L,J={placement:tn(r.placement),variation:As(r.placement),popper:r.elements.popper,popperRect:r.rects.popper,gpuAcceleration:y,isFixed:r.options.strategy==="fixed"};r.modifiersData.popperOffsets!=null&&(r.styles.popper=Object.assign({},r.styles.popper,wl(Object.assign({},J,{offsets:r.modifiersData.popperOffsets,position:r.options.strategy,adaptive:S,roundOffsets:j})))),r.modifiersData.arrow!=null&&(r.styles.arrow=Object.assign({},r.styles.arrow,wl(Object.assign({},J,{offsets:r.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:j})))),r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-placement":r.placement})},data:{}};var qr={passive:!0};const fo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(u){var r=u.state,l=u.instance,h=u.options,y=h.scroll,v=y===void 0||y,S=h.resize,L=S===void 0||S,j=Et(r.elements.popper),J=[].concat(r.scrollParents.reference,r.scrollParents.popper);return v&&J.forEach(function(X){X.addEventListener("scroll",l.update,qr)}),L&&j.addEventListener("resize",l.update,qr),function(){v&&J.forEach(function(X){X.removeEventListener("scroll",l.update,qr)}),L&&j.removeEventListener("resize",l.update,qr)}},data:{}};var Kh={left:"right",right:"left",bottom:"top",top:"bottom"};function Wr(u){return u.replace(/left|right|bottom|top/g,function(r){return Kh[r]})}var Gh={start:"end",end:"start"};function El(u){return u.replace(/start|end/g,function(r){return Gh[r]})}function ho(u){var r=Et(u);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function po(u){return Ts(An(u)).left+ho(u).scrollLeft}function mo(u){var r=hn(u),l=r.overflow,h=r.overflowX,y=r.overflowY;return/auto|scroll|overlay|hidden/.test(l+y+h)}function Cl(u){return["html","body","#document"].indexOf(en(u))>=0?u.ownerDocument.body:Lt(u)&&mo(u)?u:Cl(Ur(u))}function Qs(u,r){var l;r===void 0&&(r=[]);var h=Cl(u),y=h===((l=u.ownerDocument)==null?void 0:l.body),v=Et(h),S=y?[v].concat(v.visualViewport||[],mo(h)?h:[]):h,L=r.concat(S);return y?L:L.concat(Qs(Ur(S)))}function go(u){return Object.assign({},u,{left:u.x,top:u.y,right:u.x+u.width,bottom:u.y+u.height})}function Sl(u,r,l){return r===no?go(function(h,y){var v=Et(h),S=An(h),L=v.visualViewport,j=S.clientWidth,J=S.clientHeight,X=0,K=0;if(L){j=L.width,J=L.height;var he=ml();(he||!he&&y==="fixed")&&(X=L.offsetLeft,K=L.offsetTop)}return{width:j,height:J,x:X+po(h),y:K}}(u,l)):Kn(r)?function(h,y){var v=Ts(h,!1,y==="fixed");return v.top=v.top+h.clientTop,v.left=v.left+h.clientLeft,v.bottom=v.top+h.clientHeight,v.right=v.left+h.clientWidth,v.width=h.clientWidth,v.height=h.clientHeight,v.x=v.left,v.y=v.top,v}(r,l):go(function(h){var y,v=An(h),S=ho(h),L=(y=h.ownerDocument)==null?void 0:y.body,j=Gn(v.scrollWidth,v.clientWidth,L?L.scrollWidth:0,L?L.clientWidth:0),J=Gn(v.scrollHeight,v.clientHeight,L?L.scrollHeight:0,L?L.clientHeight:0),X=-S.scrollLeft+po(h),K=-S.scrollTop;return hn(L||v).direction==="rtl"&&(X+=Gn(v.clientWidth,L?L.clientWidth:0)-j),{width:j,height:J,x:X,y:K}}(An(u)))}function Tl(u){var r,l=u.reference,h=u.element,y=u.placement,v=y?tn(y):null,S=y?As(y):null,L=l.x+l.width/2-h.width/2,j=l.y+l.height/2-h.height/2;switch(v){case ut:r={x:L,y:l.y-h.height};break;case vt:r={x:L,y:l.y+l.height};break;case wt:r={x:l.x+l.width,y:j};break;case ft:r={x:l.x-h.width,y:j};break;default:r={x:l.x,y:l.y}}var J=v?co(v):null;if(J!=null){var X=J==="y"?"height":"width";switch(S){case zn:r[J]=r[J]-(l[X]/2-h[X]/2);break;case Es:r[J]=r[J]+(l[X]/2-h[X]/2)}}return r}function Os(u,r){r===void 0&&(r={});var l=r,h=l.placement,y=h===void 0?u.placement:h,v=l.strategy,S=v===void 0?u.strategy:v,L=l.boundary,j=L===void 0?sl:L,J=l.rootBoundary,X=J===void 0?no:J,K=l.elementContext,he=K===void 0?Cs:K,se=l.altBoundary,ce=se!==void 0&&se,ie=l.padding,ue=ie===void 0?0:ie,Le=bl(typeof ue!="number"?ue:yl(ue,ws)),Fe=he===Cs?rl:Cs,_e=u.rects.popper,Ae=u.elements[ce?Fe:he],me=function(dt,Nt,kt,Ue){var nn=Nt==="clippingParents"?function(Ne){var ht=Qs(Ur(Ne)),Mt=["absolute","fixed"].indexOf(hn(Ne).position)>=0&&Lt(Ne)?Js(Ne):Ne;return Kn(Mt)?ht.filter(function(xn){return Kn(xn)&&gl(xn,Mt)&&en(xn)!=="body"}):[]}(dt):[].concat(Nt),sn=[].concat(nn,[kt]),Ps=sn[0],Ye=sn.reduce(function(Ne,ht){var Mt=Sl(dt,ht,Ue);return Ne.top=Gn(Mt.top,Ne.top),Ne.right=Vr(Mt.right,Ne.right),Ne.bottom=Vr(Mt.bottom,Ne.bottom),Ne.left=Gn(Mt.left,Ne.left),Ne},Sl(dt,Ps,Ue));return Ye.width=Ye.right-Ye.left,Ye.height=Ye.bottom-Ye.top,Ye.x=Ye.left,Ye.y=Ye.top,Ye}(Kn(Ae)?Ae:Ae.contextElement||An(u.elements.popper),j,X,S),we=Ts(u.elements.reference),xe=Tl({reference:we,element:_e,strategy:"absolute",placement:y}),De=go(Object.assign({},_e,xe)),Re=he===Cs?De:we,We={top:me.top-Re.top+Le.top,bottom:Re.bottom-me.bottom+Le.bottom,left:me.left-Re.left+Le.left,right:Re.right-me.right+Le.right},Ct=u.modifiersData.offset;if(he===Cs&&Ct){var Vt=Ct[y];Object.keys(We).forEach(function(dt){var Nt=[wt,vt].indexOf(dt)>=0?1:-1,kt=[ut,vt].indexOf(dt)>=0?"y":"x";We[dt]+=Vt[kt]*Nt})}return We}function Jh(u,r){r===void 0&&(r={});var l=r,h=l.placement,y=l.boundary,v=l.rootBoundary,S=l.padding,L=l.flipVariations,j=l.allowedAutoPlacements,J=j===void 0?ro:j,X=As(h),K=X?L?so:so.filter(function(ce){return As(ce)===X}):ws,he=K.filter(function(ce){return J.indexOf(ce)>=0});he.length===0&&(he=K);var se=he.reduce(function(ce,ie){return ce[ie]=Os(u,{placement:ie,boundary:y,rootBoundary:v,padding:S})[tn(ie)],ce},{});return Object.keys(se).sort(function(ce,ie){return se[ce]-se[ie]})}const Al={name:"flip",enabled:!0,phase:"main",fn:function(u){var r=u.state,l=u.options,h=u.name;if(!r.modifiersData[h]._skip){for(var y=l.mainAxis,v=y===void 0||y,S=l.altAxis,L=S===void 0||S,j=l.fallbackPlacements,J=l.padding,X=l.boundary,K=l.rootBoundary,he=l.altBoundary,se=l.flipVariations,ce=se===void 0||se,ie=l.allowedAutoPlacements,ue=r.options.placement,Le=tn(ue),Fe=j||(Le!==ue&&ce?function(Ne){if(tn(Ne)===Hr)return[];var ht=Wr(Ne);return[El(Ne),ht,El(ht)]}(ue):[Wr(ue)]),_e=[ue].concat(Fe).reduce(function(Ne,ht){return Ne.concat(tn(ht)===Hr?Jh(r,{placement:ht,boundary:X,rootBoundary:K,padding:J,flipVariations:ce,allowedAutoPlacements:ie}):ht)},[]),Ae=r.rects.reference,me=r.rects.popper,we=new Map,xe=!0,De=_e[0],Re=0;Re<_e.length;Re++){var We=_e[Re],Ct=tn(We),Vt=As(We)===zn,dt=[ut,vt].indexOf(Ct)>=0,Nt=dt?"width":"height",kt=Os(r,{placement:We,boundary:X,rootBoundary:K,altBoundary:he,padding:J}),Ue=dt?Vt?wt:ft:Vt?vt:ut;Ae[Nt]>me[Nt]&&(Ue=Wr(Ue));var nn=Wr(Ue),sn=[];if(v&&sn.push(kt[Ct]<=0),L&&sn.push(kt[Ue]<=0,kt[nn]<=0),sn.every(function(Ne){return Ne})){De=We,xe=!1;break}we.set(We,sn)}if(xe)for(var Ps=function(Ne){var ht=_e.find(function(Mt){var xn=we.get(Mt);if(xn)return xn.slice(0,Ne).every(function(ei){return ei})});if(ht)return De=ht,"break"},Ye=ce?3:1;Ye>0&&Ps(Ye)!=="break";Ye--);r.placement!==De&&(r.modifiersData[h]._skip=!0,r.placement=De,r.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ol(u,r,l){return l===void 0&&(l={x:0,y:0}),{top:u.top-r.height-l.y,right:u.right-r.width+l.x,bottom:u.bottom-r.height+l.y,left:u.left-r.width-l.x}}function xl(u){return[ut,wt,vt,ft].some(function(r){return u[r]>=0})}const Rl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(u){var r=u.state,l=u.name,h=r.rects.reference,y=r.rects.popper,v=r.modifiersData.preventOverflow,S=Os(r,{elementContext:"reference"}),L=Os(r,{altBoundary:!0}),j=Ol(S,h),J=Ol(L,y,v),X=xl(j),K=xl(J);r.modifiersData[l]={referenceClippingOffsets:j,popperEscapeOffsets:J,isReferenceHidden:X,hasPopperEscaped:K},r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-reference-hidden":X,"data-popper-escaped":K})}},Pl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(u){var r=u.state,l=u.options,h=u.name,y=l.offset,v=y===void 0?[0,0]:y,S=ro.reduce(function(X,K){return X[K]=function(he,se,ce){var ie=tn(he),ue=[ft,ut].indexOf(ie)>=0?-1:1,Le=typeof ce=="function"?ce(Object.assign({},se,{placement:he})):ce,Fe=Le[0],_e=Le[1];return Fe=Fe||0,_e=(_e||0)*ue,[ft,wt].indexOf(ie)>=0?{x:_e,y:Fe}:{x:Fe,y:_e}}(K,r.rects,v),X},{}),L=S[r.placement],j=L.x,J=L.y;r.modifiersData.popperOffsets!=null&&(r.modifiersData.popperOffsets.x+=j,r.modifiersData.popperOffsets.y+=J),r.modifiersData[h]=S}},_o={name:"popperOffsets",enabled:!0,phase:"read",fn:function(u){var r=u.state,l=u.name;r.modifiersData[l]=Tl({reference:r.rects.reference,element:r.rects.popper,strategy:"absolute",placement:r.placement})},data:{}},Il={name:"preventOverflow",enabled:!0,phase:"main",fn:function(u){var r=u.state,l=u.options,h=u.name,y=l.mainAxis,v=y===void 0||y,S=l.altAxis,L=S!==void 0&&S,j=l.boundary,J=l.rootBoundary,X=l.altBoundary,K=l.padding,he=l.tether,se=he===void 0||he,ce=l.tetherOffset,ie=ce===void 0?0:ce,ue=Os(r,{boundary:j,rootBoundary:J,padding:K,altBoundary:X}),Le=tn(r.placement),Fe=As(r.placement),_e=!Fe,Ae=co(Le),me=Ae==="x"?"y":"x",we=r.modifiersData.popperOffsets,xe=r.rects.reference,De=r.rects.popper,Re=typeof ie=="function"?ie(Object.assign({},r.rects,{placement:r.placement})):ie,We=typeof Re=="number"?{mainAxis:Re,altAxis:Re}:Object.assign({mainAxis:0,altAxis:0},Re),Ct=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,Vt={x:0,y:0};if(we){if(v){var dt,Nt=Ae==="y"?ut:ft,kt=Ae==="y"?vt:wt,Ue=Ae==="y"?"height":"width",nn=we[Ae],sn=nn+ue[Nt],Ps=nn-ue[kt],Ye=se?-De[Ue]/2:0,Ne=Fe===zn?xe[Ue]:De[Ue],ht=Fe===zn?-De[Ue]:-xe[Ue],Mt=r.elements.arrow,xn=se&&Mt?lo(Mt):{width:0,height:0},ei=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},_c=ei[Nt],bc=ei[kt],ti=Xs(0,xe[Ue],xn[Ue]),Sm=_e?xe[Ue]/2-Ye-ti-_c-We.mainAxis:Ne-ti-_c-We.mainAxis,Tm=_e?-xe[Ue]/2+Ye+ti+bc+We.mainAxis:ht+ti+bc+We.mainAxis,Po=r.elements.arrow&&Js(r.elements.arrow),Am=Po?Ae==="y"?Po.clientTop||0:Po.clientLeft||0:0,yc=(dt=Ct==null?void 0:Ct[Ae])!=null?dt:0,Om=nn+Tm-yc,vc=Xs(se?Vr(sn,nn+Sm-yc-Am):sn,nn,se?Gn(Ps,Om):Ps);we[Ae]=vc,Vt[Ae]=vc-nn}if(L){var wc,xm=Ae==="x"?ut:ft,Rm=Ae==="x"?vt:wt,ns=we[me],ni=me==="y"?"height":"width",Ec=ns+ue[xm],Cc=ns-ue[Rm],Io=[ut,ft].indexOf(Le)!==-1,Sc=(wc=Ct==null?void 0:Ct[me])!=null?wc:0,Tc=Io?Ec:ns-xe[ni]-De[ni]-Sc+We.altAxis,Ac=Io?ns+xe[ni]+De[ni]-Sc-We.altAxis:Cc,Oc=se&&Io?function(Pm,Im,Lo){var xc=Xs(Pm,Im,Lo);return xc>Lo?Lo:xc}(Tc,ns,Ac):Xs(se?Tc:Ec,ns,se?Ac:Cc);we[me]=Oc,Vt[me]=Oc-ns}r.modifiersData[h]=Vt}},requiresIfExists:["offset"]};function Xh(u,r,l){l===void 0&&(l=!1);var h,y,v=Lt(r),S=Lt(r)&&function(K){var he=K.getBoundingClientRect(),se=Ss(he.width)/K.offsetWidth||1,ce=Ss(he.height)/K.offsetHeight||1;return se!==1||ce!==1}(r),L=An(r),j=Ts(u,S,l),J={scrollLeft:0,scrollTop:0},X={x:0,y:0};return(v||!v&&!l)&&((en(r)!=="body"||mo(L))&&(J=(h=r)!==Et(h)&&Lt(h)?{scrollLeft:(y=h).scrollLeft,scrollTop:y.scrollTop}:ho(h)),Lt(r)?((X=Ts(r,!0)).x+=r.clientLeft,X.y+=r.clientTop):L&&(X.x=po(L))),{x:j.left+J.scrollLeft-X.x,y:j.top+J.scrollTop-X.y,width:j.width,height:j.height}}function Qh(u){var r=new Map,l=new Set,h=[];function y(v){l.add(v.name),[].concat(v.requires||[],v.requiresIfExists||[]).forEach(function(S){if(!l.has(S)){var L=r.get(S);L&&y(L)}}),h.push(v)}return u.forEach(function(v){r.set(v.name,v)}),u.forEach(function(v){l.has(v.name)||y(v)}),h}var Ll={placement:"bottom",modifiers:[],strategy:"absolute"};function Dl(){for(var u=arguments.length,r=new Array(u),l=0;lNumber.parseInt(l,10)):typeof r=="function"?l=>r(l,this._element):r}_getPopperConfig(){const r={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(rt.setDataAttribute(this._menu,"popper","static"),r.modifiers=[{name:"applyStyles",enabled:!1}]),{...r,...N(this._config.popperConfig,[r])}}_selectMenuItem({key:r,target:l}){const h=A.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(y=>p(y));h.length&&H(h,l,r===Ml,!h.includes(l)).focus()}static jQueryInterface(r){return this.each(function(){const l=Ht.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}static clearMenus(r){if(r.button===2||r.type==="keyup"&&r.key!=="Tab")return;const l=A.find(op);for(const h of l){const y=Ht.getInstance(h);if(!y||y._config.autoClose===!1)continue;const v=r.composedPath(),S=v.includes(y._menu);if(v.includes(y._element)||y._config.autoClose==="inside"&&!S||y._config.autoClose==="outside"&&S||y._menu.contains(r.target)&&(r.type==="keyup"&&r.key==="Tab"||/input|select|option|textarea|form/i.test(r.target.tagName)))continue;const L={relatedTarget:y._element};r.type==="click"&&(L.clickEvent=r),y._completeHide(L)}}static dataApiKeydownHandler(r){const l=/input|textarea/i.test(r.target.tagName),h=r.key==="Escape",y=[ep,Ml].includes(r.key);if(!y&&!h||l&&!h)return;r.preventDefault();const v=this.matches(Xn)?this:A.prev(this,Xn)[0]||A.next(this,Xn)[0]||A.findOne(Xn,r.delegateTarget.parentNode),S=Ht.getOrCreateInstance(v);if(y)return r.stopPropagation(),S.show(),void S._selectMenuItem(r);S._isShown()&&(r.stopPropagation(),S.hide(),v.focus())}}I.on(document,Fl,Xn,Ht.dataApiKeydownHandler),I.on(document,Fl,Kr,Ht.dataApiKeydownHandler),I.on(document,$l,Ht.clearMenus),I.on(document,ip,Ht.clearMenus),I.on(document,$l,Xn,function(u){u.preventDefault(),Ht.getOrCreateInstance(this).toggle()}),$(Ht);const jl="backdrop",Bl="show",Hl=`mousedown.bs.${jl}`,mp={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},gp={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Vl extends Zt{constructor(r){super(),this._config=this._getConfig(r),this._isAppended=!1,this._element=null}static get Default(){return mp}static get DefaultType(){return gp}static get NAME(){return jl}show(r){if(!this._config.isVisible)return void N(r);this._append();const l=this._getElement();this._config.isAnimated&&w(l),l.classList.add(Bl),this._emulateAnimation(()=>{N(r)})}hide(r){this._config.isVisible?(this._getElement().classList.remove(Bl),this._emulateAnimation(()=>{this.dispose(),N(r)})):N(r)}dispose(){this._isAppended&&(I.off(this._element,Hl),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const r=document.createElement("div");r.className=this._config.className,this._config.isAnimated&&r.classList.add("fade"),this._element=r}return this._element}_configAfterMerge(r){return r.rootElement=f(r.rootElement),r}_append(){if(this._isAppended)return;const r=this._getElement();this._config.rootElement.append(r),I.on(r,Hl,()=>{N(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(r){B(r,this._getElement(),this._config.isAnimated)}}const Gr=".bs.focustrap",_p=`focusin${Gr}`,bp=`keydown.tab${Gr}`,Ul="backward",yp={autofocus:!0,trapElement:null},vp={autofocus:"boolean",trapElement:"element"};class ql extends Zt{constructor(r){super(),this._config=this._getConfig(r),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return yp}static get DefaultType(){return vp}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),I.off(document,Gr),I.on(document,_p,r=>this._handleFocusin(r)),I.on(document,bp,r=>this._handleKeydown(r)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,I.off(document,Gr))}_handleFocusin(r){const{trapElement:l}=this._config;if(r.target===document||r.target===l||l.contains(r.target))return;const h=A.focusableChildren(l);h.length===0?l.focus():this._lastTabNavDirection===Ul?h[h.length-1].focus():h[0].focus()}_handleKeydown(r){r.key==="Tab"&&(this._lastTabNavDirection=r.shiftKey?Ul:"forward")}}const Wl=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",zl=".sticky-top",Jr="padding-right",Kl="margin-right";class vo{constructor(){this._element=document.body}getWidth(){const r=document.documentElement.clientWidth;return Math.abs(window.innerWidth-r)}hide(){const r=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Jr,l=>l+r),this._setElementAttributes(Wl,Jr,l=>l+r),this._setElementAttributes(zl,Kl,l=>l-r)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Jr),this._resetElementAttributes(Wl,Jr),this._resetElementAttributes(zl,Kl)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(r,l,h){const y=this.getWidth();this._applyManipulationCallback(r,v=>{if(v!==this._element&&window.innerWidth>v.clientWidth+y)return;this._saveInitialAttribute(v,l);const S=window.getComputedStyle(v).getPropertyValue(l);v.style.setProperty(l,`${h(Number.parseFloat(S))}px`)})}_saveInitialAttribute(r,l){const h=r.style.getPropertyValue(l);h&&rt.setDataAttribute(r,l,h)}_resetElementAttributes(r,l){this._applyManipulationCallback(r,h=>{const y=rt.getDataAttribute(h,l);y!==null?(rt.removeDataAttribute(h,l),h.style.setProperty(l,y)):h.style.removeProperty(l)})}_applyManipulationCallback(r,l){if(c(r))l(r);else for(const h of A.find(r,this._element))l(h)}}const Dt=".bs.modal",wp=`hide${Dt}`,Ep=`hidePrevented${Dt}`,Gl=`hidden${Dt}`,Jl=`show${Dt}`,Cp=`shown${Dt}`,Sp=`resize${Dt}`,Tp=`click.dismiss${Dt}`,Ap=`mousedown.dismiss${Dt}`,Op=`keydown.dismiss${Dt}`,xp=`click${Dt}.data-api`,Xl="modal-open",Ql="show",wo="modal-static",Rp={backdrop:!0,focus:!0,keyboard:!0},Pp={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Qn extends Be{constructor(r,l){super(r,l),this._dialog=A.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new vo,this._addEventListeners()}static get Default(){return Rp}static get DefaultType(){return Pp}static get NAME(){return"modal"}toggle(r){return this._isShown?this.hide():this.show(r)}show(r){this._isShown||this._isTransitioning||I.trigger(this._element,Jl,{relatedTarget:r}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Xl),this._adjustDialog(),this._backdrop.show(()=>this._showElement(r)))}hide(){this._isShown&&!this._isTransitioning&&(I.trigger(this._element,wp).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ql),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){I.off(window,Dt),I.off(this._dialog,Dt),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Vl({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ql({trapElement:this._element})}_showElement(r){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const l=A.findOne(".modal-body",this._dialog);l&&(l.scrollTop=0),w(this._element),this._element.classList.add(Ql),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,I.trigger(this._element,Cp,{relatedTarget:r})},this._dialog,this._isAnimated())}_addEventListeners(){I.on(this._element,Op,r=>{r.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),I.on(window,Sp,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),I.on(this._element,Ap,r=>{I.one(this._element,Tp,l=>{this._element===r.target&&this._element===l.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Xl),this._resetAdjustments(),this._scrollBar.reset(),I.trigger(this._element,Gl)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(I.trigger(this._element,Ep).defaultPrevented)return;const r=this._element.scrollHeight>document.documentElement.clientHeight,l=this._element.style.overflowY;l==="hidden"||this._element.classList.contains(wo)||(r||(this._element.style.overflowY="hidden"),this._element.classList.add(wo),this._queueCallback(()=>{this._element.classList.remove(wo),this._queueCallback(()=>{this._element.style.overflowY=l},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const r=this._element.scrollHeight>document.documentElement.clientHeight,l=this._scrollBar.getWidth(),h=l>0;if(h&&!r){const y=R()?"paddingLeft":"paddingRight";this._element.style[y]=`${l}px`}if(!h&&r){const y=R()?"paddingRight":"paddingLeft";this._element.style[y]=`${l}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(r,l){return this.each(function(){const h=Qn.getOrCreateInstance(this,r);if(typeof r=="string"){if(h[r]===void 0)throw new TypeError(`No method named "${r}"`);h[r](l)}})}}I.on(document,xp,'[data-bs-toggle="modal"]',function(u){const r=A.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&u.preventDefault(),I.one(r,Jl,h=>{h.defaultPrevented||I.one(r,Gl,()=>{p(this)&&this.focus()})});const l=A.findOne(".modal.show");l&&Qn.getInstance(l).hide(),Qn.getOrCreateInstance(r).toggle(this)}),U(Qn),$(Qn);const pn=".bs.offcanvas",Yl=".data-api",Ip=`load${pn}${Yl}`,Zl="show",ec="showing",tc="hiding",nc=".offcanvas.show",Lp=`show${pn}`,Dp=`shown${pn}`,Np=`hide${pn}`,sc=`hidePrevented${pn}`,rc=`hidden${pn}`,kp=`resize${pn}`,Mp=`click${pn}${Yl}`,$p=`keydown.dismiss${pn}`,Fp={backdrop:!0,keyboard:!0,scroll:!1},jp={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class mn extends Be{constructor(r,l){super(r,l),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Fp}static get DefaultType(){return jp}static get NAME(){return"offcanvas"}toggle(r){return this._isShown?this.hide():this.show(r)}show(r){this._isShown||I.trigger(this._element,Lp,{relatedTarget:r}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new vo().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ec),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Zl),this._element.classList.remove(ec),I.trigger(this._element,Dp,{relatedTarget:r})},this._element,!0))}hide(){this._isShown&&(I.trigger(this._element,Np).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(tc),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Zl,tc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new vo().reset(),I.trigger(this._element,rc)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const r=!!this._config.backdrop;return new Vl({className:"offcanvas-backdrop",isVisible:r,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:r?()=>{this._config.backdrop!=="static"?this.hide():I.trigger(this._element,sc)}:null})}_initializeFocusTrap(){return new ql({trapElement:this._element})}_addEventListeners(){I.on(this._element,$p,r=>{r.key==="Escape"&&(this._config.keyboard?this.hide():I.trigger(this._element,sc))})}static jQueryInterface(r){return this.each(function(){const l=mn.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r](this)}})}}I.on(document,Mp,'[data-bs-toggle="offcanvas"]',function(u){const r=A.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&u.preventDefault(),d(this))return;I.one(r,rc,()=>{p(this)&&this.focus()});const l=A.findOne(nc);l&&l!==r&&mn.getInstance(l).hide(),mn.getOrCreateInstance(r).toggle(this)}),I.on(window,Ip,()=>{for(const u of A.find(nc))mn.getOrCreateInstance(u).show()}),I.on(window,kp,()=>{for(const u of A.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(u).position!=="fixed"&&mn.getOrCreateInstance(u).hide()}),U(mn),$(mn);const ic={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Bp=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Hp=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Vp=(u,r)=>{const l=u.nodeName.toLowerCase();return r.includes(l)?!Bp.has(l)||!!Hp.test(u.nodeValue):r.filter(h=>h instanceof RegExp).some(h=>h.test(l))},Up={allowList:ic,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},qp={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Wp={entry:"(string|element|function|null)",selector:"(string|element)"};class zp extends Zt{constructor(r){super(),this._config=this._getConfig(r)}static get Default(){return Up}static get DefaultType(){return qp}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(r=>this._resolvePossibleFunction(r)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(r){return this._checkContent(r),this._config.content={...this._config.content,...r},this}toHtml(){const r=document.createElement("div");r.innerHTML=this._maybeSanitize(this._config.template);for(const[y,v]of Object.entries(this._config.content))this._setContent(r,v,y);const l=r.children[0],h=this._resolvePossibleFunction(this._config.extraClass);return h&&l.classList.add(...h.split(" ")),l}_typeCheckConfig(r){super._typeCheckConfig(r),this._checkContent(r.content)}_checkContent(r){for(const[l,h]of Object.entries(r))super._typeCheckConfig({selector:l,entry:h},Wp)}_setContent(r,l,h){const y=A.findOne(h,r);y&&((l=this._resolvePossibleFunction(l))?c(l)?this._putElementInTemplate(f(l),y):this._config.html?y.innerHTML=this._maybeSanitize(l):y.textContent=l:y.remove())}_maybeSanitize(r){return this._config.sanitize?function(l,h,y){if(!l.length)return l;if(y&&typeof y=="function")return y(l);const v=new window.DOMParser().parseFromString(l,"text/html"),S=[].concat(...v.body.querySelectorAll("*"));for(const L of S){const j=L.nodeName.toLowerCase();if(!Object.keys(h).includes(j)){L.remove();continue}const J=[].concat(...L.attributes),X=[].concat(h["*"]||[],h[j]||[]);for(const K of J)Vp(K,X)||L.removeAttribute(K.nodeName)}return v.body.innerHTML}(r,this._config.allowList,this._config.sanitizeFn):r}_resolvePossibleFunction(r){return N(r,[this])}_putElementInTemplate(r,l){if(this._config.html)return l.innerHTML="",void l.append(r);l.textContent=r.textContent}}const Kp=new Set(["sanitize","allowList","sanitizeFn"]),Eo="fade",Xr="show",oc=".modal",ac="hide.bs.modal",Ys="hover",Co="focus",Gp={AUTO:"auto",TOP:"top",RIGHT:R()?"left":"right",BOTTOM:"bottom",LEFT:R()?"right":"left"},Jp={allowList:ic,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Xp={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Yn extends Be{constructor(r,l){if(Nl===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(r,l),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Jp}static get DefaultType(){return Xp}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),I.off(this._element.closest(oc),ac,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const r=I.trigger(this._element,this.constructor.eventName("show")),l=(m(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(r.defaultPrevented||!l)return;this._disposePopper();const h=this._getTipElement();this._element.setAttribute("aria-describedby",h.getAttribute("id"));const{container:y}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(y.append(h),I.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(h),h.classList.add(Xr),"ontouchstart"in document.documentElement)for(const v of[].concat(...document.body.children))I.on(v,"mouseover",b);this._queueCallback(()=>{I.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!I.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Xr),"ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))I.off(r,"mouseover",b);this._activeTrigger.click=!1,this._activeTrigger[Co]=!1,this._activeTrigger[Ys]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),I.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(r){const l=this._getTemplateFactory(r).toHtml();if(!l)return null;l.classList.remove(Eo,Xr),l.classList.add(`bs-${this.constructor.NAME}-auto`);const h=(y=>{do y+=Math.floor(1e6*Math.random());while(document.getElementById(y));return y})(this.constructor.NAME).toString();return l.setAttribute("id",h),this._isAnimated()&&l.classList.add(Eo),l}setContent(r){this._newContent=r,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(r){return this._templateFactory?this._templateFactory.changeContent(r):this._templateFactory=new zp({...this._config,content:r,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(r){return this.constructor.getOrCreateInstance(r.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Eo)}_isShown(){return this.tip&&this.tip.classList.contains(Xr)}_createPopper(r){const l=N(this._config.placement,[this,r,this._element]),h=Gp[l.toUpperCase()];return bo(this._element,r,this._getPopperConfig(h))}_getOffset(){const{offset:r}=this._config;return typeof r=="string"?r.split(",").map(l=>Number.parseInt(l,10)):typeof r=="function"?l=>r(l,this._element):r}_resolvePossibleFunction(r){return N(r,[this._element])}_getPopperConfig(r){const l={placement:r,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:h=>{this._getTipElement().setAttribute("data-popper-placement",h.state.placement)}}]};return{...l,...N(this._config.popperConfig,[l])}}_setListeners(){const r=this._config.trigger.split(" ");for(const l of r)if(l==="click")I.on(this._element,this.constructor.eventName("click"),this._config.selector,h=>{this._initializeOnDelegatedTarget(h).toggle()});else if(l!=="manual"){const h=l===Ys?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),y=l===Ys?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");I.on(this._element,h,this._config.selector,v=>{const S=this._initializeOnDelegatedTarget(v);S._activeTrigger[v.type==="focusin"?Co:Ys]=!0,S._enter()}),I.on(this._element,y,this._config.selector,v=>{const S=this._initializeOnDelegatedTarget(v);S._activeTrigger[v.type==="focusout"?Co:Ys]=S._element.contains(v.relatedTarget),S._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},I.on(this._element.closest(oc),ac,this._hideModalHandler)}_fixTitle(){const r=this._element.getAttribute("title");r&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",r),this._element.setAttribute("data-bs-original-title",r),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(r,l){clearTimeout(this._timeout),this._timeout=setTimeout(r,l)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(r){const l=rt.getDataAttributes(this._element);for(const h of Object.keys(l))Kp.has(h)&&delete l[h];return r={...l,...typeof r=="object"&&r?r:{}},r=this._mergeConfigObj(r),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}_configAfterMerge(r){return r.container=r.container===!1?document.body:f(r.container),typeof r.delay=="number"&&(r.delay={show:r.delay,hide:r.delay}),typeof r.title=="number"&&(r.title=r.title.toString()),typeof r.content=="number"&&(r.content=r.content.toString()),r}_getDelegateConfig(){const r={};for(const[l,h]of Object.entries(this._config))this.constructor.Default[l]!==h&&(r[l]=h);return r.selector=!1,r.trigger="manual",r}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(r){return this.each(function(){const l=Yn.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}}$(Yn);const Qp={...Yn.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Yp={...Yn.DefaultType,content:"(null|string|element|function)"};class Qr extends Yn{static get Default(){return Qp}static get DefaultType(){return Yp}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(r){return this.each(function(){const l=Qr.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}}$(Qr);const So=".bs.scrollspy",Zp=`activate${So}`,lc=`click${So}`,em=`load${So}.data-api`,Rs="active",To="[href]",cc=".nav-link",tm=`${cc}, .nav-item > ${cc}, .list-group-item`,nm={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},sm={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zs extends Be{constructor(r,l){super(r,l),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return nm}static get DefaultType(){return sm}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const r of this._observableSections.values())this._observer.observe(r)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(r){return r.target=f(r.target)||document.body,r.rootMargin=r.offset?`${r.offset}px 0px -30%`:r.rootMargin,typeof r.threshold=="string"&&(r.threshold=r.threshold.split(",").map(l=>Number.parseFloat(l))),r}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(I.off(this._config.target,lc),I.on(this._config.target,lc,To,r=>{const l=this._observableSections.get(r.target.hash);if(l){r.preventDefault();const h=this._rootElement||window,y=l.offsetTop-this._element.offsetTop;if(h.scrollTo)return void h.scrollTo({top:y,behavior:"smooth"});h.scrollTop=y}}))}_getNewObserver(){const r={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(l=>this._observerCallback(l),r)}_observerCallback(r){const l=S=>this._targetLinks.get(`#${S.target.id}`),h=S=>{this._previousScrollData.visibleEntryTop=S.target.offsetTop,this._process(l(S))},y=(this._rootElement||document.documentElement).scrollTop,v=y>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=y;for(const S of r){if(!S.isIntersecting){this._activeTarget=null,this._clearActiveClass(l(S));continue}const L=S.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(v&&L){if(h(S),!y)return}else v||L||h(S)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const r=A.find(To,this._config.target);for(const l of r){if(!l.hash||d(l))continue;const h=A.findOne(decodeURI(l.hash),this._element);p(h)&&(this._targetLinks.set(decodeURI(l.hash),l),this._observableSections.set(l.hash,h))}}_process(r){this._activeTarget!==r&&(this._clearActiveClass(this._config.target),this._activeTarget=r,r.classList.add(Rs),this._activateParents(r),I.trigger(this._element,Zp,{relatedTarget:r}))}_activateParents(r){if(r.classList.contains("dropdown-item"))A.findOne(".dropdown-toggle",r.closest(".dropdown")).classList.add(Rs);else for(const l of A.parents(r,".nav, .list-group"))for(const h of A.prev(l,tm))h.classList.add(Rs)}_clearActiveClass(r){r.classList.remove(Rs);const l=A.find(`${To}.${Rs}`,r);for(const h of l)h.classList.remove(Rs)}static jQueryInterface(r){return this.each(function(){const l=Zs.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}})}}I.on(window,em,()=>{for(const u of A.find('[data-bs-spy="scroll"]'))Zs.getOrCreateInstance(u)}),$(Zs);const Zn=".bs.tab",rm=`hide${Zn}`,im=`hidden${Zn}`,om=`show${Zn}`,am=`shown${Zn}`,lm=`click${Zn}`,cm=`keydown${Zn}`,um=`load${Zn}`,fm="ArrowLeft",uc="ArrowRight",dm="ArrowUp",fc="ArrowDown",Ao="Home",dc="End",es="active",hc="fade",Oo="show",pc=".dropdown-toggle",xo=`:not(${pc})`,mc='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ro=`.nav-link${xo}, .list-group-item${xo}, [role="tab"]${xo}, ${mc}`,hm=`.${es}[data-bs-toggle="tab"], .${es}[data-bs-toggle="pill"], .${es}[data-bs-toggle="list"]`;class ts extends Be{constructor(r){super(r),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),I.on(this._element,cm,l=>this._keydown(l)))}static get NAME(){return"tab"}show(){const r=this._element;if(this._elemIsActive(r))return;const l=this._getActiveElem(),h=l?I.trigger(l,rm,{relatedTarget:r}):null;I.trigger(r,om,{relatedTarget:l}).defaultPrevented||h&&h.defaultPrevented||(this._deactivate(l,r),this._activate(r,l))}_activate(r,l){r&&(r.classList.add(es),this._activate(A.getElementFromSelector(r)),this._queueCallback(()=>{r.getAttribute("role")==="tab"?(r.removeAttribute("tabindex"),r.setAttribute("aria-selected",!0),this._toggleDropDown(r,!0),I.trigger(r,am,{relatedTarget:l})):r.classList.add(Oo)},r,r.classList.contains(hc)))}_deactivate(r,l){r&&(r.classList.remove(es),r.blur(),this._deactivate(A.getElementFromSelector(r)),this._queueCallback(()=>{r.getAttribute("role")==="tab"?(r.setAttribute("aria-selected",!1),r.setAttribute("tabindex","-1"),this._toggleDropDown(r,!1),I.trigger(r,im,{relatedTarget:l})):r.classList.remove(Oo)},r,r.classList.contains(hc)))}_keydown(r){if(![fm,uc,dm,fc,Ao,dc].includes(r.key))return;r.stopPropagation(),r.preventDefault();const l=this._getChildren().filter(y=>!d(y));let h;if([Ao,dc].includes(r.key))h=l[r.key===Ao?0:l.length-1];else{const y=[uc,fc].includes(r.key);h=H(l,r.target,y,!0)}h&&(h.focus({preventScroll:!0}),ts.getOrCreateInstance(h).show())}_getChildren(){return A.find(Ro,this._parent)}_getActiveElem(){return this._getChildren().find(r=>this._elemIsActive(r))||null}_setInitialAttributes(r,l){this._setAttributeIfNotExists(r,"role","tablist");for(const h of l)this._setInitialAttributesOnChild(h)}_setInitialAttributesOnChild(r){r=this._getInnerElement(r);const l=this._elemIsActive(r),h=this._getOuterElement(r);r.setAttribute("aria-selected",l),h!==r&&this._setAttributeIfNotExists(h,"role","presentation"),l||r.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(r,"role","tab"),this._setInitialAttributesOnTargetPanel(r)}_setInitialAttributesOnTargetPanel(r){const l=A.getElementFromSelector(r);l&&(this._setAttributeIfNotExists(l,"role","tabpanel"),r.id&&this._setAttributeIfNotExists(l,"aria-labelledby",`${r.id}`))}_toggleDropDown(r,l){const h=this._getOuterElement(r);if(!h.classList.contains("dropdown"))return;const y=(v,S)=>{const L=A.findOne(v,h);L&&L.classList.toggle(S,l)};y(pc,es),y(".dropdown-menu",Oo),h.setAttribute("aria-expanded",l)}_setAttributeIfNotExists(r,l,h){r.hasAttribute(l)||r.setAttribute(l,h)}_elemIsActive(r){return r.classList.contains(es)}_getInnerElement(r){return r.matches(Ro)?r:A.findOne(Ro,r)}_getOuterElement(r){return r.closest(".nav-item, .list-group-item")||r}static jQueryInterface(r){return this.each(function(){const l=ts.getOrCreateInstance(this);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}})}}I.on(document,lm,mc,function(u){["A","AREA"].includes(this.tagName)&&u.preventDefault(),d(this)||ts.getOrCreateInstance(this).show()}),I.on(window,um,()=>{for(const u of A.find(hm))ts.getOrCreateInstance(u)}),$(ts);const On=".bs.toast",pm=`mouseover${On}`,mm=`mouseout${On}`,gm=`focusin${On}`,_m=`focusout${On}`,bm=`hide${On}`,ym=`hidden${On}`,vm=`show${On}`,wm=`shown${On}`,gc="hide",Yr="show",Zr="showing",Em={animation:"boolean",autohide:"boolean",delay:"number"},Cm={animation:!0,autohide:!0,delay:5e3};class er extends Be{constructor(r,l){super(r,l),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Cm}static get DefaultType(){return Em}static get NAME(){return"toast"}show(){I.trigger(this._element,vm).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(gc),w(this._element),this._element.classList.add(Yr,Zr),this._queueCallback(()=>{this._element.classList.remove(Zr),I.trigger(this._element,wm),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(I.trigger(this._element,bm).defaultPrevented||(this._element.classList.add(Zr),this._queueCallback(()=>{this._element.classList.add(gc),this._element.classList.remove(Zr,Yr),I.trigger(this._element,ym)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Yr),super.dispose()}isShown(){return this._element.classList.contains(Yr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(r,l){switch(r.type){case"mouseover":case"mouseout":this._hasMouseInteraction=l;break;case"focusin":case"focusout":this._hasKeyboardInteraction=l}if(l)return void this._clearTimeout();const h=r.relatedTarget;this._element===h||this._element.contains(h)||this._maybeScheduleHide()}_setListeners(){I.on(this._element,pm,r=>this._onInteraction(r,!0)),I.on(this._element,mm,r=>this._onInteraction(r,!1)),I.on(this._element,gm,r=>this._onInteraction(r,!0)),I.on(this._element,_m,r=>this._onInteraction(r,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(r){return this.each(function(){const l=er.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r](this)}})}}return U(er),$(er),{Alert:g,Button:E,Carousel:bs,Collapse:vs,Dropdown:Ht,Modal:Qn,Offcanvas:mn,Popover:Qr,ScrollSpy:Zs,Tab:ts,Toast:er,Tooltip:Yn}})})(t0);/*! +* Tabler v1.0.0-beta19 (https://tabler.io) +* @version 1.0.0-beta19 +* @link https://tabler.io +* Copyright 2018-2023 The Tabler Authors +* Copyright 2018-2023 codecalm.net Paweł Kuna +* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) +*/(function(e){typeof define=="function"&&define.amd?define(e):e()})(function(){var e,t="tablerTheme",n=new Proxy(new URLSearchParams(window.location.search),{get:function(i,o){return i.get(o)}});if(n.theme)localStorage.setItem(t,n.theme),e=n.theme;else{var s=localStorage.getItem(t);e=s||"light"}e==="dark"?document.body.setAttribute("data-bs-theme",e):document.body.removeAttribute("data-bs-theme")});const Mr=Td(Sy);Ke.defaults.baseURL=sw("http://localhost:18084");Mr.config.globalProperties.axios=Ke;Mr.use(pb());Mr.use(dh);Mr.use(Zw,{});Mr.mount("#app");export{o0 as A,Pr as B,Or as C,u0 as D,Ir as E,tt as F,Va as G,dh as H,c0 as I,f0 as J,sw as K,Ke as L,gd as M,e0 as N,h0 as O,Hd as R,_s as a,nt as b,qt as c,dn as d,Bi as e,d0 as f,Ft as g,fr as h,Bf as i,n0 as j,jc as k,i0 as l,Bo as m,Hn as n,Ve as o,s0 as p,nw as q,ja as r,jt as s,xa as t,jn as u,l0 as v,lb as w,Vf as x,r0 as y,a0 as z}; diff --git a/src/main/resources/static/assets/lodash-PecLoxXt.js b/src/main/resources/static/assets/lodash-PecLoxXt.js new file mode 100644 index 0000000..85174a2 --- /dev/null +++ b/src/main/resources/static/assets/lodash-PecLoxXt.js @@ -0,0 +1,27 @@ +import{N as jt,O as rp}from"./index-B9L3o1bN.js";var Je={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Je.exports;(function(Qe,Ve){(function(){var o,rl="4.17.21",ke=200,il="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",sn="Expected a function",ul="Invalid `variable` option passed into `_.template`",je="__lodash_hash_undefined__",fl=500,ne="__lodash_placeholder__",qn=1,Ii=2,at=4,ct=1,te=2,an=1,jn=2,Si=4,Tn=8,ht=16,Ln=32,gt=64,Wn=128,Ot=256,nr=512,ll=30,ol="...",sl=800,al=16,Ei=1,cl=2,hl=3,nt=1/0,Kn=9007199254740991,gl=17976931348623157e292,ee=NaN,yn=4294967295,_l=yn-1,pl=yn>>>1,vl=[["ary",Wn],["bind",an],["bindKey",jn],["curry",Tn],["curryRight",ht],["flip",nr],["partial",Ln],["partialRight",gt],["rearg",Ot]],_t="[object Arguments]",re="[object Array]",dl="[object AsyncFunction]",Wt="[object Boolean]",Pt="[object Date]",wl="[object DOMException]",ie="[object Error]",ue="[object Function]",Ti="[object GeneratorFunction]",xn="[object Map]",Bt="[object Number]",xl="[object Null]",Pn="[object Object]",Li="[object Promise]",Al="[object Proxy]",bt="[object RegExp]",An="[object Set]",Ft="[object String]",fe="[object Symbol]",Rl="[object Undefined]",Mt="[object WeakMap]",Il="[object WeakSet]",Ut="[object ArrayBuffer]",pt="[object DataView]",tr="[object Float32Array]",er="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",ur="[object Int32Array]",fr="[object Uint8Array]",lr="[object Uint8ClampedArray]",or="[object Uint16Array]",sr="[object Uint32Array]",Sl=/\b__p \+= '';/g,El=/\b(__p \+=) '' \+/g,Tl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yi=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,Ll=RegExp(yi.source),yl=RegExp(Ci.source),Cl=/<%-([\s\S]+?)%>/g,ml=/<%([\s\S]+?)%>/g,mi=/<%=([\s\S]+?)%>/g,Ol=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wl=/^\w*$/,Pl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(ar.source),cr=/^\s+/,bl=/\s/,Fl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ml=/\{\n\/\* \[wrapped with (.+)\] \*/,Ul=/,? & /,Dl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nl=/[()=,{}\[\]\/\s]/,Gl=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,ql=/^[-+]0x[0-9a-f]+$/i,Kl=/^0b[01]+$/i,$l=/^\[object .+?Constructor\]$/,zl=/^0o[0-7]+$/i,Zl=/^(?:0|[1-9]\d*)$/,Yl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,Xl=/['\n\r\u2028\u2029\\]/g,oe="\\ud800-\\udfff",Jl="\\u0300-\\u036f",Ql="\\ufe20-\\ufe2f",Vl="\\u20d0-\\u20ff",Wi=Jl+Ql+Vl,Pi="\\u2700-\\u27bf",Bi="a-z\\xdf-\\xf6\\xf8-\\xff",kl="\\xac\\xb1\\xd7\\xf7",jl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",no="\\u2000-\\u206f",to=" \\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",bi="A-Z\\xc0-\\xd6\\xd8-\\xde",Fi="\\ufe0e\\ufe0f",Mi=kl+jl+no+to,hr="['’]",eo="["+oe+"]",Ui="["+Mi+"]",se="["+Wi+"]",Di="\\d+",ro="["+Pi+"]",Ni="["+Bi+"]",Gi="[^"+oe+Mi+Di+Pi+Bi+bi+"]",gr="\\ud83c[\\udffb-\\udfff]",io="(?:"+se+"|"+gr+")",Hi="[^"+oe+"]",_r="(?:\\ud83c[\\udde6-\\uddff]){2}",pr="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="["+bi+"]",qi="\\u200d",Ki="(?:"+Ni+"|"+Gi+")",uo="(?:"+vt+"|"+Gi+")",$i="(?:"+hr+"(?:d|ll|m|re|s|t|ve))?",zi="(?:"+hr+"(?:D|LL|M|RE|S|T|VE))?",Zi=io+"?",Yi="["+Fi+"]?",fo="(?:"+qi+"(?:"+[Hi,_r,pr].join("|")+")"+Yi+Zi+")*",lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xi=Yi+Zi+fo,so="(?:"+[ro,_r,pr].join("|")+")"+Xi,ao="(?:"+[Hi+se+"?",se,_r,pr,eo].join("|")+")",co=RegExp(hr,"g"),ho=RegExp(se,"g"),vr=RegExp(gr+"(?="+gr+")|"+ao+Xi,"g"),go=RegExp([vt+"?"+Ni+"+"+$i+"(?="+[Ui,vt,"$"].join("|")+")",uo+"+"+zi+"(?="+[Ui,vt+Ki,"$"].join("|")+")",vt+"?"+Ki+"+"+$i,vt+"+"+zi,oo,lo,Di,so].join("|"),"g"),_o=RegExp("["+qi+oe+Wi+Fi+"]"),po=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vo=["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"],wo=-1,M={};M[tr]=M[er]=M[rr]=M[ir]=M[ur]=M[fr]=M[lr]=M[or]=M[sr]=!0,M[_t]=M[re]=M[Ut]=M[Wt]=M[pt]=M[Pt]=M[ie]=M[ue]=M[xn]=M[Bt]=M[Pn]=M[bt]=M[An]=M[Ft]=M[Mt]=!1;var F={};F[_t]=F[re]=F[Ut]=F[pt]=F[Wt]=F[Pt]=F[tr]=F[er]=F[rr]=F[ir]=F[ur]=F[xn]=F[Bt]=F[Pn]=F[bt]=F[An]=F[Ft]=F[fe]=F[fr]=F[lr]=F[or]=F[sr]=!0,F[ie]=F[ue]=F[Mt]=!1;var xo={À:"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"},Ao={"&":"&","<":"<",">":">",'"':""","'":"'"},Ro={"&":"&","<":"<",">":">",""":'"',"'":"'"},Io={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},So=parseFloat,Eo=parseInt,Ji=typeof jt=="object"&&jt&&jt.Object===Object&&jt,To=typeof self=="object"&&self&&self.Object===Object&&self,z=Ji||To||Function("return this")(),dr=Ve&&!Ve.nodeType&&Ve,tt=dr&&!0&&Qe&&!Qe.nodeType&&Qe,Qi=tt&&tt.exports===dr,wr=Qi&&Ji.process,cn=function(){try{var a=tt&&tt.require&&tt.require("util").types;return a||wr&&wr.binding&&wr.binding("util")}catch{}}(),Vi=cn&&cn.isArrayBuffer,ki=cn&&cn.isDate,ji=cn&&cn.isMap,nu=cn&&cn.isRegExp,tu=cn&&cn.isSet,eu=cn&&cn.isTypedArray;function en(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Lo(a,g,h,w){for(var S=-1,W=a==null?0:a.length;++S-1}function xr(a,g,h){for(var w=-1,S=a==null?0:a.length;++w-1;);return h}function au(a,g){for(var h=a.length;h--&&dt(g,a[h],0)>-1;);return h}function Fo(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Mo=Sr(xo),Uo=Sr(Ao);function Do(a){return"\\"+Io[a]}function No(a,g){return a==null?o:a[g]}function wt(a){return _o.test(a)}function Go(a){return po.test(a)}function Ho(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function yr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,S){h[++g]=[S,w]}),h}function cu(a,g){return function(h){return a(g(h))}}function Zn(a,g){for(var h=-1,w=a.length,S=0,W=[];++h-1}function Cs(n,t){var e=this.__data__,r=ye(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}Bn.prototype.clear=Es,Bn.prototype.delete=Ts,Bn.prototype.get=Ls,Bn.prototype.has=ys,Bn.prototype.set=Cs;function bn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function pn(n,t,e,r,i,f){var l,s=t&qn,c=t&Ii,_=t&at;if(e&&(l=i?e(n,r,i,f):e(n)),l!==o)return l;if(!D(n))return n;var p=E(n);if(p){if(l=Pa(n),!s)return k(n,l)}else{var v=X(n),d=v==ue||v==Ti;if(kn(n))return Yu(n,s);if(v==Pn||v==_t||d&&!i){if(l=c||d?{}:gf(n),!s)return c?Ra(n,$s(l,n)):Aa(n,Su(l,n))}else{if(!F[v])return i?n:{};l=Ba(n,v,s)}}f||(f=new In);var x=f.get(n);if(x)return x;f.set(n,l),qf(n)?n.forEach(function(I){l.add(pn(I,t,e,I,n,f))}):Gf(n)&&n.forEach(function(I,C){l.set(C,pn(I,t,e,C,n,f))});var R=_?c?jr:kr:c?nn:$,L=p?o:R(n);return hn(L||n,function(I,C){L&&(C=I,I=n[C]),$t(l,C,pn(I,t,e,C,n,f))}),l}function zs(n){var t=$(n);return function(e){return Eu(e,n,t)}}function Eu(n,t,e){var r=e.length;if(n==null)return!r;for(n=b(n);r--;){var i=e[r],f=t[i],l=n[i];if(l===o&&!(i in n)||!f(l))return!1}return!0}function Tu(n,t,e){if(typeof n!="function")throw new gn(sn);return Vt(function(){n.apply(o,e)},t)}function zt(n,t,e,r){var i=-1,f=ae,l=!0,s=n.length,c=[],_=t.length;if(!s)return c;e&&(t=U(t,rn(e))),r?(f=xr,l=!1):t.length>=ke&&(f=Dt,l=!1,t=new it(t));n:for(;++ii?0:i+e),r=r===o||r>i?i:T(r),r<0&&(r+=i),r=e>r?0:$f(r);e0&&e(s)?t>1?Z(s,t-1,e,r,i):zn(i,s):r||(i[i.length]=s)}return i}var br=ju(),Cu=ju(!0);function Cn(n,t){return n&&br(n,t,$)}function Fr(n,t){return n&&Cu(n,t,$)}function me(n,t){return $n(t,function(e){return Nn(n[e])})}function ft(n,t){t=Qn(t,n);for(var e=0,r=t.length;n!=null&&et}function Xs(n,t){return n!=null&&B.call(n,t)}function Js(n,t){return n!=null&&t in b(n)}function Qs(n,t,e){return n>=Y(t,e)&&n=120&&p.length>=120)?new it(l&&p):o}p=n[0];var v=-1,d=s[0];n:for(;++v-1;)s!==n&&Ae.call(s,c,1),Ae.call(n,c,1);return n}function Nu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;Dn(i)?Ae.call(n,i,1):zr(n,i)}}return n}function qr(n,t){return n+Se(xu()*(t-n+1))}function sa(n,t,e,r){for(var i=-1,f=K(Ie((t-n)/(e||1)),0),l=h(f);f--;)l[r?f:++i]=n,n+=e;return l}function Kr(n,t){var e="";if(!n||t<1||t>Kn)return e;do t%2&&(e+=n),t=Se(t/2),t&&(n+=n);while(t);return e}function y(n,t){return fi(vf(n,t,tn),n+"")}function aa(n){return Iu(mt(n))}function ca(n,t){var e=mt(n);return Ge(e,ut(t,0,e.length))}function Xt(n,t,e,r){if(!D(n))return n;t=Qn(t,n);for(var i=-1,f=t.length,l=f-1,s=n;s!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r>>1,l=n[f];l!==null&&!fn(l)&&(e?l<=t:l=ke){var _=t?null:Ta(n);if(_)return he(_);l=!1,i=Dt,c=new it}else c=t?[]:s;n:for(;++r=r?n:vn(n,t,e)}var Zu=es||function(n){return z.clearTimeout(n)};function Yu(n,t){if(t)return n.slice();var e=n.length,r=_u?_u(e):new n.constructor(e);return n.copy(r),r}function Jr(n){var t=new n.constructor(n.byteLength);return new we(t).set(new we(n)),t}function va(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function da(n){var t=new n.constructor(n.source,Oi.exec(n));return t.lastIndex=n.lastIndex,t}function wa(n){return Kt?b(Kt.call(n)):{}}function Xu(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Ju(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=fn(n),l=t!==o,s=t===null,c=t===t,_=fn(t);if(!s&&!_&&!f&&n>t||f&&l&&c&&!s&&!_||r&&l&&c||!e&&c||!i)return 1;if(!r&&!f&&!_&&n=s)return c;var _=e[r];return c*(_=="desc"?-1:1)}}return n.index-t.index}function Qu(n,t,e,r){for(var i=-1,f=n.length,l=e.length,s=-1,c=t.length,_=K(f-l,0),p=h(c+_),v=!r;++s1?e[i-1]:o,l=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,l&&Q(e[0],e[1],l)&&(f=i<3?o:f,i=1),t=b(t);++r-1?i[f?t[l]:l]:o}}function ef(n){return Un(function(t){var e=t.length,r=e,i=_n.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new gn(sn);if(i&&!l&&De(f)=="wrapper")var l=new _n([],!0)}for(r=l?r:e;++r1&&O.reverse(),p&&cs))return!1;var _=f.get(n),p=f.get(t);if(_&&p)return _==t&&p==n;var v=-1,d=!0,x=e&te?new it:o;for(f.set(n,t),f.set(t,n);++v1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Fl,`{ +/* [wrapped with `+t+`] */ +`)}function Fa(n){return E(n)||st(n)||!!(du&&n&&n[du])}function Dn(n,t){var e=typeof n;return t=t??Kn,!!t&&(e=="number"||e!="symbol"&&Zl.test(n))&&n>-1&&n%1==0&&n0){if(++t>=sl)return arguments[0]}else t=0;return n.apply(o,arguments)}}function Ge(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,Cf(n,e)});function mf(n){var t=u(n);return t.__chain__=!0,t}function Zc(n,t){return t(n),n}function He(n,t){return t(n)}var Yc=Un(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return Br(f,n)};return t>1||this.__actions__.length||!(r instanceof m)||!Dn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:He,args:[i],thisArg:o}),new _n(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function Xc(){return mf(this)}function Jc(){return new _n(this.value(),this.__chain__)}function Qc(){this.__values__===o&&(this.__values__=Kf(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function Vc(){return this}function kc(n){for(var t,e=this;e instanceof Le;){var r=If(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function jc(){var n=this.__wrapped__;if(n instanceof m){var t=n;return this.__actions__.length&&(t=new m(this)),t=t.reverse(),t.__actions__.push({func:He,args:[li],thisArg:o}),new _n(t,this.__chain__)}return this.thru(li)}function nh(){return $u(this.__wrapped__,this.__actions__)}var th=Be(function(n,t,e){B.call(n,e)?++n[e]:Fn(n,e,1)});function eh(n,t,e){var r=E(n)?ru:Zs;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}function rh(n,t){var e=E(n)?$n:yu;return e(n,A(t,3))}var ih=tf(Sf),uh=tf(Ef);function fh(n,t){return Z(qe(n,t),1)}function lh(n,t){return Z(qe(n,t),nt)}function oh(n,t,e){return e=e===o?1:T(e),Z(qe(n,t),e)}function Of(n,t){var e=E(n)?hn:Xn;return e(n,A(t,3))}function Wf(n,t){var e=E(n)?yo:Lu;return e(n,A(t,3))}var sh=Be(function(n,t,e){B.call(n,e)?n[e].push(t):Fn(n,e,[t])});function ah(n,t,e,r){n=j(n)?n:mt(n),e=e&&!r?T(e):0;var i=n.length;return e<0&&(e=K(i+e,0)),Ye(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&dt(n,t,e)>-1}var ch=y(function(n,t,e){var r=-1,i=typeof t=="function",f=j(n)?h(n.length):[];return Xn(n,function(l){f[++r]=i?en(t,l,e):Zt(l,t,e)}),f}),hh=Be(function(n,t,e){Fn(n,e,t)});function qe(n,t){var e=E(n)?U:Bu;return e(n,A(t,3))}function gh(n,t,e,r){return n==null?[]:(E(t)||(t=t==null?[]:[t]),e=r?o:e,E(e)||(e=e==null?[]:[e]),Uu(n,t,e))}var _h=Be(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function ph(n,t,e){var r=E(n)?Ar:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Xn)}function vh(n,t,e){var r=E(n)?Co:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Lu)}function dh(n,t){var e=E(n)?$n:yu;return e(n,ze(A(t,3)))}function wh(n){var t=E(n)?Iu:aa;return t(n)}function xh(n,t,e){(e?Q(n,t,e):t===o)?t=1:t=T(t);var r=E(n)?Hs:ca;return r(n,t)}function Ah(n){var t=E(n)?qs:ga;return t(n)}function Rh(n){if(n==null)return 0;if(j(n))return Ye(n)?xt(n):n.length;var t=X(n);return t==xn||t==An?n.size:Nr(n).length}function Ih(n,t,e){var r=E(n)?Rr:_a;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}var Sh=y(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Q(n,t[0],t[1])?t=[]:e>2&&Q(t[0],t[1],t[2])&&(t=[t[0]]),Uu(n,Z(t,1),[])}),Ke=rs||function(){return z.Date.now()};function Eh(n,t){if(typeof t!="function")throw new gn(sn);return n=T(n),function(){if(--n<1)return t.apply(this,arguments)}}function Pf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,Mn(n,Wn,o,o,o,o,t)}function Bf(n,t){var e;if(typeof t!="function")throw new gn(sn);return n=T(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var si=y(function(n,t,e){var r=an;if(e.length){var i=Zn(e,yt(si));r|=Ln}return Mn(n,r,t,e,i)}),bf=y(function(n,t,e){var r=an|jn;if(e.length){var i=Zn(e,yt(bf));r|=Ln}return Mn(t,r,n,e,i)});function Ff(n,t,e){t=e?o:t;var r=Mn(n,Tn,o,o,o,o,o,t);return r.placeholder=Ff.placeholder,r}function Mf(n,t,e){t=e?o:t;var r=Mn(n,ht,o,o,o,o,o,t);return r.placeholder=Mf.placeholder,r}function Uf(n,t,e){var r,i,f,l,s,c,_=0,p=!1,v=!1,d=!0;if(typeof n!="function")throw new gn(sn);t=wn(t)||0,D(e)&&(p=!!e.leading,v="maxWait"in e,f=v?K(wn(e.maxWait)||0,t):f,d="trailing"in e?!!e.trailing:d);function x(H){var En=r,Hn=i;return r=i=o,_=H,l=n.apply(Hn,En),l}function R(H){return _=H,s=Vt(C,t),p?x(H):l}function L(H){var En=H-c,Hn=H-_,el=t-En;return v?Y(el,f-Hn):el}function I(H){var En=H-c,Hn=H-_;return c===o||En>=t||En<0||v&&Hn>=f}function C(){var H=Ke();if(I(H))return O(H);s=Vt(C,L(H))}function O(H){return s=o,d&&r?x(H):(r=i=o,l)}function ln(){s!==o&&Zu(s),_=0,r=c=i=s=o}function V(){return s===o?l:O(Ke())}function on(){var H=Ke(),En=I(H);if(r=arguments,i=this,c=H,En){if(s===o)return R(c);if(v)return Zu(s),s=Vt(C,t),x(c)}return s===o&&(s=Vt(C,t)),l}return on.cancel=ln,on.flush=V,on}var Th=y(function(n,t){return Tu(n,1,t)}),Lh=y(function(n,t,e){return Tu(n,wn(t)||0,e)});function yh(n){return Mn(n,nr)}function $e(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new gn(sn);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var l=n.apply(this,r);return e.cache=f.set(i,l)||f,l};return e.cache=new($e.Cache||bn),e}$e.Cache=bn;function ze(n){if(typeof n!="function")throw new gn(sn);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)}}function Ch(n){return Bf(2,n)}var mh=pa(function(n,t){t=t.length==1&&E(t[0])?U(t[0],rn(A())):U(Z(t,1),rn(A()));var e=t.length;return y(function(r){for(var i=-1,f=Y(r.length,e);++i=t}),st=Ou(function(){return arguments}())?Ou:function(n){return N(n)&&B.call(n,"callee")&&!vu.call(n,"callee")},E=h.isArray,$h=Vi?rn(Vi):ks;function j(n){return n!=null&&Ze(n.length)&&!Nn(n)}function G(n){return N(n)&&j(n)}function zh(n){return n===!0||n===!1||N(n)&&J(n)==Wt}var kn=us||Ri,Zh=ki?rn(ki):js;function Yh(n){return N(n)&&n.nodeType===1&&!kt(n)}function Xh(n){if(n==null)return!0;if(j(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||kn(n)||Ct(n)||st(n)))return!n.length;var t=X(n);if(t==xn||t==An)return!n.size;if(Qt(n))return!Nr(n).length;for(var e in n)if(B.call(n,e))return!1;return!0}function Jh(n,t){return Yt(n,t)}function Qh(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?Yt(n,t,o,e):!!r}function ci(n){if(!N(n))return!1;var t=J(n);return t==ie||t==wl||typeof n.message=="string"&&typeof n.name=="string"&&!kt(n)}function Vh(n){return typeof n=="number"&&wu(n)}function Nn(n){if(!D(n))return!1;var t=J(n);return t==ue||t==Ti||t==dl||t==Al}function Nf(n){return typeof n=="number"&&n==T(n)}function Ze(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kn}function D(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function N(n){return n!=null&&typeof n=="object"}var Gf=ji?rn(ji):ta;function kh(n,t){return n===t||Dr(n,t,ti(t))}function jh(n,t,e){return e=typeof e=="function"?e:o,Dr(n,t,ti(t),e)}function ng(n){return Hf(n)&&n!=+n}function tg(n){if(Da(n))throw new S(il);return Wu(n)}function eg(n){return n===null}function rg(n){return n==null}function Hf(n){return typeof n=="number"||N(n)&&J(n)==Bt}function kt(n){if(!N(n)||J(n)!=Pn)return!1;var t=xe(n);if(t===null)return!0;var e=B.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&pe.call(e)==jo}var hi=nu?rn(nu):ea;function ig(n){return Nf(n)&&n>=-Kn&&n<=Kn}var qf=tu?rn(tu):ra;function Ye(n){return typeof n=="string"||!E(n)&&N(n)&&J(n)==Ft}function fn(n){return typeof n=="symbol"||N(n)&&J(n)==fe}var Ct=eu?rn(eu):ia;function ug(n){return n===o}function fg(n){return N(n)&&X(n)==Mt}function lg(n){return N(n)&&J(n)==Il}var og=Ue(Gr),sg=Ue(function(n,t){return n<=t});function Kf(n){if(!n)return[];if(j(n))return Ye(n)?Rn(n):k(n);if(Nt&&n[Nt])return Ho(n[Nt]());var t=X(n),e=t==xn?yr:t==An?he:mt;return e(n)}function Gn(n){if(!n)return n===0?n:0;if(n=wn(n),n===nt||n===-nt){var t=n<0?-1:1;return t*gl}return n===n?n:0}function T(n){var t=Gn(n),e=t%1;return t===t?e?t-e:t:0}function $f(n){return n?ut(T(n),0,yn):0}function wn(n){if(typeof n=="number")return n;if(fn(n))return ee;if(D(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=D(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=ou(n);var e=Kl.test(n);return e||zl.test(n)?Eo(n.slice(2),e?2:8):ql.test(n)?ee:+n}function zf(n){return mn(n,nn(n))}function ag(n){return n?ut(T(n),-Kn,Kn):n===0?n:0}function P(n){return n==null?"":un(n)}var cg=Tt(function(n,t){if(Qt(t)||j(t)){mn(t,$(t),n);return}for(var e in t)B.call(t,e)&&$t(n,e,t[e])}),Zf=Tt(function(n,t){mn(t,nn(t),n)}),Xe=Tt(function(n,t,e,r){mn(t,nn(t),n,r)}),hg=Tt(function(n,t,e,r){mn(t,$(t),n,r)}),gg=Un(Br);function _g(n,t){var e=Et(n);return t==null?e:Su(e,t)}var pg=y(function(n,t){n=b(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&Q(t[0],t[1],i)&&(r=1);++e1),f}),mn(n,jr(n),e),r&&(e=pn(e,qn|Ii|at,La));for(var i=t.length;i--;)zr(e,t[i]);return e});function Bg(n,t){return Xf(n,ze(A(t)))}var bg=Un(function(n,t){return n==null?{}:la(n,t)});function Xf(n,t){if(n==null)return{};var e=U(jr(n),function(r){return[r]});return t=A(t),Du(n,e,function(r,i){return t(r,i[0])})}function Fg(n,t,e){t=Qn(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=xu();return Y(n+i*(t-n+So("1e-"+((i+"").length-1))),t)}return qr(n,t)}var Zg=Lt(function(n,t,e){return t=t.toLowerCase(),n+(e?Vf(t):t)});function Vf(n){return pi(P(n).toLowerCase())}function kf(n){return n=P(n),n&&n.replace(Yl,Mo).replace(ho,"")}function Yg(n,t,e){n=P(n),t=un(t);var r=n.length;e=e===o?r:ut(T(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function Xg(n){return n=P(n),n&&yl.test(n)?n.replace(Ci,Uo):n}function Jg(n){return n=P(n),n&&Bl.test(n)?n.replace(ar,"\\$&"):n}var Qg=Lt(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),Vg=Lt(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),kg=nf("toLowerCase");function jg(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Me(Se(i),e)+n+Me(Ie(i),e)}function n_(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;return t&&r>>0,e?(n=P(n),n&&(typeof t=="string"||t!=null&&!hi(t))&&(t=un(t),!t&&wt(n))?Vn(Rn(n),0,e):n.split(t,e)):[]}var l_=Lt(function(n,t,e){return n+(e?" ":"")+pi(t)});function o_(n,t,e){return n=P(n),e=e==null?0:ut(T(e),0,n.length),t=un(t),n.slice(e,e+t.length)==t}function s_(n,t,e){var r=u.templateSettings;e&&Q(n,t,e)&&(t=o),n=P(n),t=Xe({},t,r,of);var i=Xe({},t.imports,r.imports,of),f=$(i),l=Lr(i,f),s,c,_=0,p=t.interpolate||le,v="__p += '",d=Cr((t.escape||le).source+"|"+p.source+"|"+(p===mi?Hl:le).source+"|"+(t.evaluate||le).source+"|$","g"),x="//# sourceURL="+(B.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wo+"]")+` +`;n.replace(d,function(I,C,O,ln,V,on){return O||(O=ln),v+=n.slice(_,on).replace(Xl,Do),C&&(s=!0,v+=`' + +__e(`+C+`) + +'`),V&&(c=!0,v+=`'; +`+V+`; +__p += '`),O&&(v+=`' + +((__t = (`+O+`)) == null ? '' : __t) + +'`),_=on+I.length,I}),v+=`'; +`;var R=B.call(t,"variable")&&t.variable;if(!R)v=`with (obj) { +`+v+` +} +`;else if(Nl.test(R))throw new S(ul);v=(c?v.replace(Sl,""):v).replace(El,"$1").replace(Tl,"$1;"),v="function("+(R||"obj")+`) { +`+(R?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+v+`return __p +}`;var L=nl(function(){return W(f,x+"return "+v).apply(o,l)});if(L.source=v,ci(L))throw L;return L}function a_(n){return P(n).toLowerCase()}function c_(n){return P(n).toUpperCase()}function h_(n,t,e){if(n=P(n),n&&(e||t===o))return ou(n);if(!n||!(t=un(t)))return n;var r=Rn(n),i=Rn(t),f=su(r,i),l=au(r,i)+1;return Vn(r,f,l).join("")}function g_(n,t,e){if(n=P(n),n&&(e||t===o))return n.slice(0,hu(n)+1);if(!n||!(t=un(t)))return n;var r=Rn(n),i=au(r,Rn(t))+1;return Vn(r,0,i).join("")}function __(n,t,e){if(n=P(n),n&&(e||t===o))return n.replace(cr,"");if(!n||!(t=un(t)))return n;var r=Rn(n),i=su(r,Rn(t));return Vn(r,i).join("")}function p_(n,t){var e=ll,r=ol;if(D(t)){var i="separator"in t?t.separator:i;e="length"in t?T(t.length):e,r="omission"in t?un(t.omission):r}n=P(n);var f=n.length;if(wt(n)){var l=Rn(n);f=l.length}if(e>=f)return n;var s=e-xt(r);if(s<1)return r;var c=l?Vn(l,0,s).join(""):n.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),hi(i)){if(n.slice(s).search(i)){var _,p=c;for(i.global||(i=Cr(i.source,P(Oi.exec(i))+"g")),i.lastIndex=0;_=i.exec(p);)var v=_.index;c=c.slice(0,v===o?s:v)}}else if(n.indexOf(un(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r}function v_(n){return n=P(n),n&&Ll.test(n)?n.replace(yi,zo):n}var d_=Lt(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),pi=nf("toUpperCase");function jf(n,t,e){return n=P(n),t=e?o:t,t===o?Go(n)?Xo(n):Wo(n):n.match(t)||[]}var nl=y(function(n,t){try{return en(n,o,t)}catch(e){return ci(e)?e:new S(e)}}),w_=Un(function(n,t){return hn(t,function(e){e=On(e),Fn(n,e,si(n[e],n))}),n});function x_(n){var t=n==null?0:n.length,e=A();return n=t?U(n,function(r){if(typeof r[1]!="function")throw new gn(sn);return[e(r[0]),r[1]]}):[],y(function(r){for(var i=-1;++iKn)return[];var e=yn,r=Y(n,yn);t=A(t),n-=yn;for(var i=Tr(r,t);++e0||t<0)?new m(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=T(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(yn)},Cn(m.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var l=this.__wrapped__,s=r?[1]:arguments,c=l instanceof m,_=s[0],p=c||E(l),v=function(C){var O=i.apply(u,zn([C],s));return r&&d?O[0]:O};p&&e&&typeof _=="function"&&_.length!=1&&(c=p=!1);var d=this.__chain__,x=!!this.__actions__.length,R=f&&!d,L=c&&!x;if(!f&&p){l=L?l:new m(this);var I=n.apply(l,s);return I.__actions__.push({func:He,args:[v],thisArg:o}),new _n(I,d)}return R&&L?n.apply(this,s):(I=this.thru(v),R?r?I.value()[0]:I.value():I)})}),hn(["pop","push","shift","sort","splice","unshift"],function(n){var t=ge[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(E(f)?f:[],i)}return this[e](function(l){return t.apply(E(l)?l:[],i)})}}),Cn(m.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";B.call(St,r)||(St[r]=[]),St[r].push({name:t,func:e})}}),St[be(o,jn).name]=[{name:"wrapper",func:o}],m.prototype.clone=vs,m.prototype.reverse=ds,m.prototype.value=ws,u.prototype.at=Yc,u.prototype.chain=Xc,u.prototype.commit=Jc,u.prototype.next=Qc,u.prototype.plant=kc,u.prototype.reverse=jc,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=nh,u.prototype.first=u.prototype.head,Nt&&(u.prototype[Nt]=Vc),u},At=Jo();tt?((tt.exports=At)._=At,dr._=At):z._=At}).call(jt)})(Je,Je.exports);var ip=Je.exports;const fp=rp(ip);export{fp as _}; diff --git a/src/main/resources/static/assets/repository-CExw8hce.js b/src/main/resources/static/assets/repository-CExw8hce.js new file mode 100644 index 0000000..bf391e4 --- /dev/null +++ b/src/main/resources/static/assets/repository-CExw8hce.js @@ -0,0 +1 @@ +import{s}from"./request-BQy8ZIMN.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; diff --git a/src/main/resources/static/assets/request-BQy8ZIMN.js b/src/main/resources/static/assets/request-BQy8ZIMN.js new file mode 100644 index 0000000..e718a21 --- /dev/null +++ b/src/main/resources/static/assets/request-BQy8ZIMN.js @@ -0,0 +1 @@ +import{K as f,f as I,L as m,q as g}from"./index-B9L3o1bN.js";const h=f("http://localhost:18084"),p=I(),r=m.create({baseURL:h,timeout:3e5}),c=e=>{const t=String(e??"").trim();return["undefined","null"].includes(t.toLowerCase())?"":t},P=e=>{if(typeof document>"u")return"";const t=`${e}=`,a=document.cookie.split(";").map(s=>s.trim()).find(s=>s.startsWith(t));return a?a.slice(t.length):""},j=()=>{var i,d,l,u;let e;try{e=g()}catch{return{}}const t=c(P("Authorization")||e.accessToken),a=c(((i=e.workspaceInfo)==null?void 0:i.id)??((d=e.workspaceInfo)==null?void 0:d.Id)),s=c(((l=e.projectInfo)==null?void 0:l.id)??((u=e.projectInfo)==null?void 0:u.Id)),n=c(e.getNsId()),o={};return t&&(o.Authorization=t.toLowerCase().startsWith("bearer ")?`Bearer ${t.slice(7).trim()}`:`Bearer ${t}`),a&&(o["X-MCMP-Workspace-ID"]=a),s&&(o["X-MCMP-Project-ID"]=s),n&&(o["X-MCMP-Namespace-ID"]=n),o};r.interceptors.request.use(e=>{const t=j();return Object.entries(t).forEach(([a,s])=>{var n;typeof((n=e.headers)==null?void 0:n.set)=="function"?e.headers.set(a,s):e.headers[a]=s}),e},e=>(console.warn("API request setup failed",(e==null?void 0:e.message)||"Unknown error"),Promise.reject(e)));r.interceptors.response.use(e=>{var a,s,n;const t=e.data;if(t.code===200)return t;{(s=(a=e.config)==null?void 0:a.url)!=null&&s.startsWith("/applications/deployment-submissions/")||p.error(t.detail);const o=Object.assign(new Error(t.detail||t.message||"Error"),{deploymentId:(n=t.data)==null?void 0:n.deploymentId});return Promise.reject(o)}},e=>{var a,s,n,o,i;const t=e.response;return console.warn("API request failed",{url:(a=e==null?void 0:e.config)==null?void 0:a.url,status:t==null?void 0:t.status,message:e==null?void 0:e.message}),(t==null?void 0:t.status)===404&&!((n=(s=e==null?void 0:e.config)==null?void 0:s.url)!=null&&n.startsWith("/applications/deployment-submissions/"))&&p.error("API Call Fail :: Code 404"),m.isCancel(e)||(i=(o=t==null?void 0:t.data)==null?void 0:o.data)!=null&&i.deploymentId&&(e.deploymentId=t.data.data.deploymentId,e.message=t.data.detail||t.data.message||e.message),Promise.reject(e)});export{j as g,r as s}; diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 60106ca..ba40622 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -5,7 +5,7 @@ App - + diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApiTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApiTest.java index 4ba848c..87d748e 100644 --- a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApiTest.java +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmCloudIngressApiTest.java @@ -13,6 +13,13 @@ import org.junit.jupiter.params.provider.ValueSource; class IbmCloudIngressApiTest { + @Test void newTraefikBackendMayOmitTheOptionalProxyConfiguration() throws Exception { + doReturn(json.readTree("{\"cluster\":\"cluster-id\",\"backend\":{\"public\":\"traefik\"}}")) + .when(api).request(eq("GET"),any(),any(),isNull(),any()); + assertThat(api.proxyConfig(session,"cluster-id","public").path("proxyProtocol").path("enable").asBoolean()).isFalse(); + assertThatThrownBy(()->api.proxyConfig(session,"different-cluster","public")).hasMessageContaining("unknown PROXY"); + verify(api,never()).request(eq("PATCH"),any(),any(),any(),any()); + } final ObjectMapper json = new ObjectMapper(); final IbmCloudIngressApi api = spy(new IbmCloudIngressApi()); final IbmCloudIngressApi.Session session = new IbmCloudIngressApi.Session("test-token",URI.create("https://containers.cloud.ibm.com/global/"),URI.create("https://jp-osa.iaas.cloud.ibm.com")); @@ -34,6 +41,7 @@ class IbmCloudIngressApiTest { verify(api).request(eq("PATCH"),eq(URI.create("https://containers.cloud.ibm.com/global/ingress/v2/load-balancer/configuration")),eq("test-token"),body.capture(),eq("application/json")); assertThat(json.readTree(body.getValue()).path("proxyProtocol").path("cidr").get(0).asText()).isEqualTo("10.2.0.0/24"); assertThat(json.readTree(body.getValue()).path("proxyProtocol").path("enable").asBoolean()).isTrue(); + assertThat(json.readTree(body.getValue()).path("proxyProtocol").has("headerTimeout")).isFalse(); } void lbResponses(String vpc, int capacity, String cidr, String next) throws Exception { @@ -67,7 +75,7 @@ void neverSendsBearerTokenToUntrustedPagination(String next) throws Exception { assertThatThrownBy(() -> api.trustedSubnets(session,json.readTree("{\"vpcs\":[\"vpc-1\"]}"),Set.of("a.lb.appdomain.cloud"),true)).hasMessageContaining("pagination"); verify(api,never()).request(eq("GET"),eq(URI.create(next)),any(),any(),any()); } - @ParameterizedTest @ValueSource(ints={301,401,403,429,500}) void httpFailuresDoNotExposeCredentialsOrUpstreamBody(int status) throws Exception { + @ParameterizedTest @ValueSource(ints={301,400,401,403,408,429,500}) void httpFailuresDoNotExposeCredentialsOrUpstreamBody(int status) throws Exception { HttpClient http=mock(HttpClient.class); HttpResponse response=mock(HttpResponse.class); when(http.send(any(),any(HttpResponse.BodyHandler.class))).thenReturn(response); when(response.statusCode()).thenReturn(status); when(response.body()).thenReturn("private upstream key data"); @@ -76,6 +84,18 @@ void neverSendsBearerTokenToUntrustedPagination(String next) throws Exception { .hasMessageContaining("HTTP "+status).hasMessageNotContaining("private upstream") .hasMessageNotContaining("secret-token").hasMessageNotContaining("secret-body"); } + @Test void structuredIbmRejectionRetainsSafeCodeAndStatusWithoutResponseDetails() throws Exception { + HttpClient http=mock(HttpClient.class);HttpResponse response=mock(HttpResponse.class); + when(http.send(any(),any(HttpResponse.BodyHandler.class))).thenReturn(response); + when(response.statusCode()).thenReturn(400); + when(response.body()).thenReturn("{\"code\":\"EInvalidParameter\",\"description\":\"sensitive upstream detail\"}"); + var real=new IbmCloudIngressApi(http); + assertThatThrownBy(()->real.request("PATCH",URI.create("https://containers.cloud.ibm.com/global/test"),"secret-token","secret-body","application/json")) + .isInstanceOfSatisfying(IbmCloudIngressApi.RequestFailure.class,error->{ + assertThat(error.status).isEqualTo(400);assertThat(error.definitelyRejected()).isTrue(); + assertThat(error.getMessage()).contains("EInvalidParameter").doesNotContain("sensitive upstream detail"); + }); + } @ParameterizedTest @ValueSource(strings={"", "../another-cluster", "https://bad", "cluster?x=y", "cluster\nheader"}) void invalidIdsNeverReachNetwork(String id) { assertThatThrownBy(() -> api.cluster(session,id)).isInstanceOf(IllegalArgumentException.class); diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationServiceTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationServiceTest.java index c25bb58..ea575bc 100644 --- a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationServiceTest.java +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmIngressAutomationServiceTest.java @@ -13,6 +13,49 @@ import org.junit.jupiter.params.provider.ValueSource; class IbmIngressAutomationServiceTest { + @Test void traefikHttpDeployEnablesProxyOnceAndWaitsForNativeControllerConfiguration() throws Exception { + authorize(); + var setup=mock(IbmKubernetesIngressSetup.class); + var nativeService=new IbmIngressAutomationService(tb,properties,cloud,certificates,setup); + try(var fixture=new IbmAutomationClusterFixture(false)) { + new IbmTraefikIngressTest().cluster(fixture.client,false); + var config=new IbmTraefikIngressTest().config(); + var lb=fixture.client.services().inNamespace("kube-system").withName("public-traefik").get(); + lb.getSpec().getPorts().add(new io.fabric8.kubernetes.api.model.ServicePortBuilder().withPort(443).build()); + fixture.client.services().inNamespace("kube-system").resource(lb).update(); + when(setup.check(any(),any(),any(),any())).thenReturn(List.of()); + when(setup.plan(any(),any(),any(),any())).thenReturn(new IbmKubernetesIngressSetup.Plan(List.of(),null,List.of(),true)); + when(cloud.trustedSubnets(eq(session),any(),eq(Set.of("a.lb.appdomain.cloud","test.lb.appdomain.cloud")),eq(true))) + .thenReturn(List.of("10.2.0.0/24")); + assertThat(nativeService.check(fixture.client,"project-a","chosen-cluster","default",config)) + .anyMatch(message->message.contains("Deploy will enable PROXY")); + verify(cloud,never()).enableProxy(any(),any(),any()); + doAnswer(call -> { + var deployment=fixture.client.apps().deployments().inNamespace("kube-system").withName("traefik").get(); + deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getArgs().addAll(List.of( + "--entryPoints.web.proxyProtocol.trustedIPs=10.2.0.0/24", + "--entryPoints.websecure.proxyProtocol.trustedIPs=10.2.0.0/24")); + fixture.client.apps().deployments().inNamespace("kube-system").resource(deployment).update(); + return null; + }).when(cloud).enableProxy(session,"ibm-cluster-selected",List.of("10.2.0.0/24")); + nativeService.prepare(fixture.client,"project-a","chosen-cluster","default",config,m->{}); + nativeService.prepare(fixture.client,"project-a","chosen-cluster","default",config,m->{}); + verify(cloud,times(1)).enableProxy(session,"ibm-cluster-selected",List.of("10.2.0.0/24")); + assertThat(IbmIngressSupport.verify(fixture.client,config)).anyMatch(message->message.contains("Traefik")); + assertThat(fixture.client.configMaps().inNamespace("kube-system").withName(IbmIngressAutomationService.LOCK).get()).isNull(); + } + } + @Test void unpreparedTraefikRequiresAnAuthorizedOfficialApiProfileBeforeAnySharedWrites() { + try(var fixture=new IbmAutomationClusterFixture(false)) { + new IbmTraefikIngressTest().cluster(fixture.client,false); + var config=new IbmTraefikIngressTest().config(); + assertThatThrownBy(()->service.prepare(fixture.client,"project-a","chosen-cluster","default",config,m->{})) + .hasMessageContaining("authorize"); + assertThat(fixture.client.configMaps().inNamespace("kube-system").withName(IbmKubernetesIngressSetup.JOURNAL).get()).isNull(); + assertThat(fixture.client.configMaps().inNamespace("kube-system").withName(IbmIngressAutomationService.INTENT).get()).isNull(); + verifyNoInteractions(cloud); + } + } final CbtumblebugRestApi tb=mock(CbtumblebugRestApi.class); final IbmCloudIngressApi cloud=mock(IbmCloudIngressApi.class); final IbmIngressAutomationProperties properties=new IbmIngressAutomationProperties(); @@ -77,10 +120,29 @@ void unauthorizedProfilesCannotWriteSharedResources(String scenario) { try(var fixture=new IbmAutomationClusterFixture(false)) { doThrow(new IllegalArgumentException("IBM request timed out")).when(cloud).enableProxy(any(),any(),any()); assertThatThrownBy(() -> service.prepare(fixture.client,"project-a","chosen-cluster","default",IbmIngressTlsResolverTest.config(),m -> {})).hasMessageContaining("timed out"); + assertThat(fixture.client.configMaps().inNamespace("kube-system").withName(IbmIngressAutomationService.INTENT).get().getData().get("state")).isEqualTo("UNKNOWN"); assertThatThrownBy(() -> service.prepare(fixture.client,"project-a","chosen-cluster","default",IbmIngressTlsResolverTest.config(),m -> {})).hasMessageContaining("unresolved"); verify(cloud,times(1)).enableProxy(any(),any(),any()); } } + @Test void definiteRejectionIsRecordedAndCanBeRetriedAfterRecheckingLiveIbmState() { + authorize(); + try(var fixture=new IbmAutomationClusterFixture(false)) { + doThrow(new IbmCloudIngressApi.RequestFailure("PATCH",400,"EInvalidParameter")) + .when(cloud).enableProxy(any(),any(),any()); + assertThatThrownBy(()->service.prepare(fixture.client,"project-a","chosen-cluster","default",IbmIngressTlsResolverTest.config(),m->{})) + .hasMessageContaining("HTTP 400"); + var record=fixture.client.configMaps().inNamespace("kube-system").withName(IbmIngressAutomationService.INTENT).get(); + assertThat(record.getData()).containsEntry("state","REJECTED"); + assertThat(record.getData().get("error")).contains("EInvalidParameter"); + doAnswer(call->{fixture.proxyReady();return null;}).when(cloud).enableProxy(any(),any(),any()); + service.prepare(fixture.client,"project-a","chosen-cluster","default",IbmIngressTlsResolverTest.config(),m->{}); + var retried=fixture.client.configMaps().inNamespace("kube-system").withName(IbmIngressAutomationService.INTENT).get(); + assertThat(retried.getData()).containsEntry("state","ACCEPTED").containsEntry("previousState","REJECTED"); + assertThat(retried.getData().get("previousError")).contains("EInvalidParameter"); + verify(cloud,times(2)).enableProxy(any(),any(),any()); + } + } @Test void activePreparationLockCannotBeStolen() { authorize(); try(var fixture=new IbmAutomationClusterFixture(false)) { diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentialsTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentialsTest.java new file mode 100644 index 0000000..3ff02fb --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmOpenBaoCredentialsTest.java @@ -0,0 +1,65 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import static org.assertj.core.api.Assertions.*; +import static org.mockito.Mockito.*; +import java.nio.file.*; +import java.util.*; +import java.net.URI; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class IbmOpenBaoCredentialsTest { + @TempDir Path directory; + final NhnTestHttp http = new NhnTestHttp(); + final IbmIngressAutomationProperties properties = new IbmIngressAutomationProperties(); + final IbmIngressAutomationProperties.Profile profile = new IbmIngressAutomationProperties.Profile(); + + IbmOpenBaoCredentialsTest() throws Exception { } + IbmOpenBaoCredentials reader() throws Exception { + properties.setOpenBaoUrl("http://openbao:8200"); + Path token=directory.resolve("token"); Files.writeString(token,"scoped-ibm-read-token\n"); + properties.setOpenBaoTokenFile(token.toString()); + profile.setSecretPath("secret/data/csp/ibm"); profile.setRegion("jp-tok"); + return new IbmOpenBaoCredentials(properties,http.client); + } + + @Test void readsRegisteredIbmKeyAndAuthenticatesWithoutAnApiKeyFile() throws Exception { + var reader=reader(); + http.respond(200,"{\"data\":{\"data\":{\"IC_API_KEY\":\"test-ibm-api-key\"}}}"); + var api=spy(new IbmCloudIngressApi(java.net.http.HttpClient.newHttpClient(),reader)); + doReturn(new ObjectMapper().readTree("{\"access_token\":\"iam-access-token\"}")) + .when(api).request(eq("POST"),eq(URI.create("https://iam.cloud.ibm.com/identity/token")),isNull(),anyString(),anyString()); + var session=api.login(profile); + assertThat(session.toString()).doesNotContain("iam-access-token","test-ibm-api-key"); + assertThat(http.requests).singleElement().satisfies(request -> { + assertThat(request.uri().toString()).isEqualTo("http://openbao:8200/v1/secret/data/csp/ibm"); + assertThat(request.headers().firstValue("X-Vault-Token")).contains("scoped-ibm-read-token"); + assertThat(request.method()).isEqualTo("GET"); + }); + verify(api).request(eq("POST"),any(),isNull(),contains("apikey=test-ibm-api-key"),any()); + try (var files = Files.list(directory)) { + assertThat(files.map(p->p.getFileName().toString()).toList()).containsExactly("token"); + } + } + + @ParameterizedTest @ValueSource(strings={"secret/data/csp/nhn","secret/data/csp/ibm/../aws","secret/data/csp/ibm?list=true","../sys/mounts"}) + void rejectsUnrelatedOrUntrustedSecretPathsBeforeHttp(String path) throws Exception { + var reader=reader();profile.setSecretPath(path); + assertThatThrownBy(()->reader.read(profile)).hasMessageContaining("registered IBM credential").hasNoCause(); + assertThat(http.requests).isEmpty(); + } + @ParameterizedTest @ValueSource(strings={"{}","{\"data\":{\"data\":{\"IC_API_KEY\":\"Hidden for security.\"}}}","{\"data\":{\"data\":{\"IC_API_KEY\":\"*****\"}}}","private-upstream-body"}) + void missingMaskedOrMalformedCredentialsDoNotLeakResponse(String body) throws Exception { + var reader=reader();http.respond(200,body); + assertThatThrownBy(()->reader.read(profile)).hasMessageContaining("registered IBM credential") + .hasMessageNotContaining(body).hasNoCause(); + } + @Test void deniedTokenDoesNotLeakCredentialsOrUpstreamBody() throws Exception { + var reader=reader();http.respond(403,"private-upstream-body"); + assertThatThrownBy(()->reader.read(profile)).hasMessageNotContaining("private-upstream-body") + .hasMessageNotContaining("scoped-ibm-read-token").hasNoCause(); + } +} diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngressTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngressTest.java new file mode 100644 index 0000000..2d603c7 --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IbmTraefikIngressTest.java @@ -0,0 +1,89 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import static org.assertj.core.api.Assertions.*; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.fabric8.kubernetes.api.model.*; +import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder; +import io.fabric8.kubernetes.api.model.networking.v1.Ingress; +import io.fabric8.kubernetes.api.model.networking.v1.IngressClassBuilder; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import java.util.*; +import org.junit.jupiter.api.Test; +import kr.co.mcmp.softwarecatalog.SoftwareCatalog; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentConfigDTO; +import kr.co.mcmp.softwarecatalog.application.model.PackageInfo; + +class IbmTraefikIngressTest { + DeploymentConfigDTO config() { + var config = HelmIngressValuesTest.config(); config.setIngressClass(IbmIngressSupport.PUBLIC_TRAEFIK_CLASS); + config.setIngressHost("notebook.example.com"); config.setIngressTlsEnabled(false); return config; + } + void cluster(io.fabric8.kubernetes.client.KubernetesClient client, boolean proxy) { + String clazz = IbmIngressSupport.PUBLIC_TRAEFIK_CLASS; + client.network().v1().ingressClasses().resource(new IngressClassBuilder().withNewMetadata().withName(clazz).endMetadata() + .withNewSpec().withController("traefik.io/ingress-controller").endSpec().build()).create(); + var args = new ArrayList<>(List.of("--providers.kubernetesingress=true", "--providers.kubernetescrd=true", + "--providers.kubernetesingress.ingressendpoint.publishedservice=kube-system/public-traefik")); + if (proxy) args.addAll(List.of("--entryPoints.web.proxyProtocol.trustedIPs=10.2.0.0/24", "--entryPoints.websecure.proxyProtocol.trustedIPs=10.2.0.0/24")); + client.apps().deployments().inNamespace("kube-system").resource(new DeploymentBuilder().withNewMetadata().withName("traefik") + .withLabels(Map.of("ingress-class",clazz)).endMetadata().withNewSpec().withNewTemplate().withNewSpec() + .addNewContainer().withName("traefik").withImage("ibm/traefik:3.7.12").withArgs(args).endContainer() + .endSpec().endTemplate().endSpec().withNewStatus().withAvailableReplicas(1).endStatus().build()).create(); + client.services().inNamespace("kube-system").resource(new ServiceBuilder().withNewMetadata().withName("public-traefik") + .withLabels(Map.of("app.kubernetes.io/part-of","managed-ingress")) + .withAnnotations(Map.of(IbmIngressSupport.PROXY_FEATURE,"proxy-protocol")).endMetadata() + .withNewSpec().withType("LoadBalancer").addNewPort().withPort(80).endPort().endSpec() + .withNewStatus().withNewLoadBalancer().addNewIngress().withHostname("test.lb.appdomain.cloud").endIngress().endLoadBalancer().endStatus().build()).create(); + } + @Test void selectsExistingTraefikAndChecksRealSourceIpConfiguration() { + var server = new KubernetesServer(false,true); server.before(); + try (var client = server.getClient()) { + cluster(client,true); + var requested = config(); requested.setIngressClass(IbmIngressSupport.PUBLIC_CLASS); + assertThat(IbmIngressSupport.resolveAvailable(client,requested).getIngressClass()).isEqualTo(IbmIngressSupport.PUBLIC_TRAEFIK_CLASS); + assertThat(IbmIngressSupport.verify(client,config())).singleElement().asString().contains("Traefik"); + var nginx = new IngressClassBuilder().withNewMetadata().withName(IbmIngressSupport.PUBLIC_CLASS).endMetadata() + .withNewSpec().withController("cloud.ibm.com/"+IbmIngressSupport.PUBLIC_CLASS).endSpec().build(); + client.network().v1().ingressClasses().resource(nginx).create(); + assertThat(IbmIngressSupport.resolveAvailable(client,requested).getIngressClass()).isEqualTo(IbmIngressSupport.PUBLIC_CLASS); + var deployment=client.apps().deployments().inNamespace("kube-system").withName("traefik").get(); + deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getArgs().removeIf(a->a.toLowerCase().contains("proxyprotocol")); + client.apps().deployments().inNamespace("kube-system").resource(deployment).update(); + assertThatThrownBy(()->IbmIngressSupport.verify(client,config())).isInstanceOf(IbmIngressSupport.MissingProxyException.class); + } finally {server.after();} + } + @Test void jupyterRendersNativeCidrMiddlewareAndKeepsTlsOnTheSelectedEntryPoint() throws Exception { + var service=new K8sJupyterService(null,null,null,null,null,null,new ObjectMapper(),null,null); + org.springframework.test.util.ReflectionTestUtils.setField(service,"gatewayUrl","https://am.example.test/applications/object-storage-gateway"); + var catalog=new SoftwareCatalog(); catalog.setPackageInfo(PackageInfo.builder().packageName("quay.io/jupyter/scipy-notebook").packageVersion("2026-07-28").build()); + var request=new K8sJupyterServiceTest().request(); request.setIngressClass(IbmIngressSupport.PUBLIC_TRAEFIK_CLASS); request.setIngressTlsEnabled(true);request.setIngressTlsSecret("notebook-tls"); + var resources=service.resources(request,catalog,"mcmp-jupyter-91","grant","login"); + var ingress=(Ingress)resources.stream().filter(Ingress.class::isInstance).findFirst().orElseThrow(); + var middleware=(GenericKubernetesResource)resources.stream().filter(GenericKubernetesResource.class::isInstance).findFirst().orElseThrow(); + assertThat(ingress.getMetadata().getAnnotations()).containsEntry("traefik.ingress.kubernetes.io/router.entrypoints","websecure") + .containsEntry("traefik.ingress.kubernetes.io/router.tls","true").doesNotContainKey(K8sIngressAccessService.CIDR_ANNOTATION); + assertThat(ingress.getSpec().getTls()).singleElement().satisfies(tls->assertThat(tls.getSecretName()).isEqualTo("notebook-tls")); + assertThat(new ObjectMapper().writeValueAsString(middleware)).contains("ipAllowList",request.getServicePortCidr()); + assertThat(middleware.getMetadata().getLabels()).containsEntry(K8sJupyterService.OWNER,"mcmp-jupyter-91"); + K8sIngressPolicy.verifyManifest(new org.yaml.snakeyaml.Yaml().dump(new ObjectMapper().convertValue(ingress,Map.class)),request.getServicePortCidr(),request.getIngressHost(),request.getIngressClass()); + ingress.getMetadata().getAnnotations().remove(IbmTraefikIngress.MIDDLEWARES); + assertThatThrownBy(()->K8sIngressPolicy.verifyManifest(new org.yaml.snakeyaml.Yaml().dump(new ObjectMapper().convertValue(ingress,Map.class)),request.getServicePortCidr(),request.getIngressHost(),request.getIngressClass())).hasMessageContaining("CIDR restriction"); + } + @Test void helmPolicyIsBoundToItsIngressAndCannotOverwriteAnExistingPolicy() { + var server=new KubernetesServer(false,true);server.before(); + try(var client=server.getClient()) { + var cfg=config();String cidr="203.0.113.4/32"; + var policy=IbmTraefikIngress.create(client,cfg,cidr); + assertThatThrownBy(()->IbmTraefikIngress.create(client,cfg,cidr)).hasMessageContaining("already exists"); + var ingress=new io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder().withNewMetadata().withName("helm-notebook").withNamespace("default") + .withAnnotations(Map.of("meta.helm.sh/release-name","notebook",IbmTraefikIngress.MIDDLEWARES, + IbmTraefikIngress.reference("default",cfg.getIngressHost(),cfg.getIngressClass(),cidr))).endMetadata().build(); + ingress=client.network().v1().ingresses().inNamespace("default").resource(ingress).create(); + IbmTraefikIngress.bind(client,policy,"notebook"); + var stored=client.genericKubernetesResources(IbmTraefikIngress.CONTEXT).inNamespace("default").withName(policy.getMetadata().getName()).get(); + String uid=ingress.getMetadata().getUid(); + assertThat(stored.getMetadata().getOwnerReferences()).singleElement().satisfies(owner->assertThat(owner.getUid()).isEqualTo(uid)); + assertThatThrownBy(()->IbmTraefikIngress.bind(client,policy,"another-release")).hasMessageContaining("no protected"); + } finally {server.after();} + } +} diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployServiceIngressConflictTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployServiceIngressConflictTest.java index fedfc69..939420f 100644 --- a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployServiceIngressConflictTest.java +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesDeployServiceIngressConflictTest.java @@ -61,7 +61,7 @@ void duplicateCatalogRouteStopsBeforeStatusUpdatesInstallAndPortOpening(String e .hasRootCauseInstanceOf(IllegalArgumentException.class) .rootCause().hasMessageContaining("Host/Path conflict").hasMessageContaining("other-namespace/old-app"); verifyNoInteractions(helm, statuses, histories); - verify(access).resolveTarget(any(), same(catalog)); + verify(access).resolveTarget(same(client), any(), same(catalog)); verifyNoMoreInteractions(access); verify(client).close(); } @@ -83,7 +83,7 @@ void differentRequestPathOverridesCatalogAndContinuesToNormalDeployment(String r order.verify(routes).list(); order.verify(helm).ensureMetricsServer(client, "project-a", "cluster-a"); verifyNoInteractions(histories); - verify(access).resolveTarget(any(), same(catalog)); + verify(access).resolveTarget(same(client), any(), same(catalog)); verifyNoMoreInteractions(access); } @@ -107,7 +107,7 @@ void readFailureStopsBeforeAnyInstallationOrFirewallChange() { .hasMessageContaining("cluster-wide Ingress list permission") .hasRootCause(forbidden); verifyNoInteractions(helm, statuses, histories); - verify(access).resolveTarget(any(), same(catalog)); + verify(access).resolveTarget(same(client), any(), same(catalog)); verifyNoMoreInteractions(access); } @@ -126,8 +126,8 @@ void ibmDeploymentRechecksPolicyAndNeverInstallsNodePortController(boolean proxy var ibmRoutes = KubernetesIngressRouteValidatorTest.stubIngressList(ibm); when(ibmRoutes.list()).thenReturn(new IngressListBuilder().build()); when(factory.getClient("project-a","cluster-a")).thenReturn(ibm); - doAnswer(call -> { ((DeploymentRequest)call.getArgument(0)).setIngressClass(IbmIngressSupport.PUBLIC_CLASS); return null; }) - .when(access).resolveTarget(any(),same(catalog)); + doAnswer(call -> { ((DeploymentRequest)call.getArgument(1)).setIngressClass(IbmIngressSupport.PUBLIC_CLASS); return null; }) + .when(access).resolveTarget(same(ibm),any(),same(catalog)); var boundary = new IllegalStateException("test-application-helm-boundary"); doThrow(boundary).when(helm).deployHelmChart(eq(ibm),eq("project-a"),same(catalog),any(),eq("cluster-a"),any()); var request = request(); request.setIngressHost(IbmIngressTlsResolverTest.HOST); request.setIngressTlsEnabled(true); @@ -142,7 +142,7 @@ void ibmDeploymentRechecksPolicyAndNeverInstallsNodePortController(boolean proxy result.rootCause().hasMessageContaining("source IP preservation is disabled"); verifyNoInteractions(helm); } - verify(access).resolveTarget(any(),same(catalog)); + verify(access).resolveTarget(same(ibm),any(),same(catalog)); verifyNoMoreInteractions(access); verifyNoInteractions(histories); } diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightServiceTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightServiceTest.java index 71d75b5..2d9df8c 100644 --- a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightServiceTest.java +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/KubernetesIngressPreflightServiceTest.java @@ -149,8 +149,8 @@ void invalidInputBlocksBeforeClusterAccess(Consumer chan IbmIngressTlsResolverTest.configureDefault(ibm); var ibmRoutes = KubernetesIngressRouteValidatorTest.stubIngressList(ibm); when(clients.getClient("project-a","cluster-a")).thenReturn(ibm); - doAnswer(call -> { ((kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequest)call.getArgument(0)).setIngressClass(IbmIngressSupport.PUBLIC_CLASS); return null; }) - .when(ingressAccess).resolveTarget(any(),same(catalog)); + doAnswer(call -> { ((kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequest)call.getArgument(1)).setIngressClass(IbmIngressSupport.PUBLIC_CLASS); return null; }) + .when(ingressAccess).resolveTarget(same(ibm),any(),same(catalog)); when(ibmRoutes.list()).thenReturn(new IngressListBuilder().withItems(KubernetesIngressRouteValidatorTest.ingress( "default","existing",IbmIngressSupport.PUBLIC_CLASS,IbmIngressTlsResolverTest.HOST,"/app")).build()); var r = request(); r.setIngressHost(IbmIngressTlsResolverTest.HOST); r.setServicePortCidr("203.0.113.8/32");