likec4 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__app__/src/chunks/{-index-overview-B8AbCuYt.js → -index-overview-Csz814YU.js} +6 -6
- package/dist/__app__/src/chunks/{likec4-DOemzWvz.js → likec4-DlkyDuSp.js} +20 -8
- package/dist/__app__/src/chunks/{main-OEl3ruxE.js → main-Bc_PC5BH.js} +3460 -291
- package/dist/__app__/src/chunks/{mantine-BqgMLMPH.js → mantine-IOl1S4mZ.js} +149 -51
- package/dist/__app__/src/chunks/{tanstack-router-Mzh8n5Lx.js → tanstack-router-CU5V4Ll-.js} +1 -1
- package/dist/__app__/src/const.js +2 -0
- package/dist/__app__/src/main.js +1 -1
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +3829 -511
- package/dist/chunks/prompt.mjs +1 -1
- package/dist/cli/index.mjs +3 -3
- package/dist/index.d.mts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.Ceq7jJZD.mjs +1816 -0
- package/icons/all.d.ts +589 -0
- package/icons/all.js +1178 -0
- package/icons/azure/abs-member.js +21 -0
- package/icons/azure/active-directory-connect-health.js +115 -0
- package/icons/azure/activity-log.js +33 -0
- package/icons/azure/administrative-units.js +80 -0
- package/icons/azure/advisor.js +44 -0
- package/icons/azure/ai-studio.js +105 -0
- package/icons/azure/aks-automatic.js +105 -0
- package/icons/azure/aks-istio.js +63 -0
- package/icons/azure/alerts.js +29 -0
- package/icons/azure/all-resources.js +21 -0
- package/icons/azure/analysis-services.js +34 -0
- package/icons/azure/anomaly-detector.js +33 -0
- package/icons/azure/api-center.js +31 -0
- package/icons/azure/api-connections.js +44 -0
- package/icons/azure/api-management-services.js +29 -0
- package/icons/azure/api-proxy.js +32 -0
- package/icons/azure/app-compliance-automation.js +71 -0
- package/icons/azure/app-configuration.js +45 -0
- package/icons/azure/app-registrations.js +39 -0
- package/icons/azure/app-service-certificates.js +31 -0
- package/icons/azure/app-service-domains.js +23 -0
- package/icons/azure/app-service-environments.js +25 -0
- package/icons/azure/app-service-plans.js +44 -0
- package/icons/azure/app-services.js +82 -0
- package/icons/azure/app-space-component.js +39 -0
- package/icons/azure/app-space.js +37 -0
- package/icons/azure/applens.js +45 -0
- package/icons/azure/application-gateway-containers.js +113 -0
- package/icons/azure/application-gateways.js +60 -0
- package/icons/azure/application-group.js +21 -0
- package/icons/azure/application-insights.js +46 -0
- package/icons/azure/application-security-groups.js +43 -0
- package/icons/azure/aquila.js +95 -0
- package/icons/azure/arc-data-services.js +49 -0
- package/icons/azure/arc-kubernetes.js +73 -0
- package/icons/azure/arc-machines.js +40 -0
- package/icons/azure/arc-postgre-sql.js +62 -0
- package/icons/azure/arc-sql-managed-instance.js +54 -0
- package/icons/azure/arc-sql-server.js +40 -0
- package/icons/azure/atm-multistack.js +59 -0
- package/icons/azure/auto-scale.js +32 -0
- package/icons/azure/automanaged-vm.js +65 -0
- package/icons/azure/automation-accounts.js +62 -0
- package/icons/azure/availability-sets.js +48 -0
- package/icons/azure/avs-vm.js +32 -0
- package/icons/azure/azure-a.js +46 -0
- package/icons/azure/azure-ad-b2c.js +129 -0
- package/icons/azure/azure-api-for-fhir.js +22 -0
- package/icons/azure/azure-applied-ai-services.js +60 -0
- package/icons/azure/azure-arc.js +75 -0
- package/icons/azure/azure-attestation.js +35 -0
- package/icons/azure/azure-backup-center.js +63 -0
- package/icons/azure/azure-blockchain-service.js +51 -0
- package/icons/azure/azure-center-for-sap.js +37 -0
- package/icons/azure/azure-chaos-studio.js +41 -0
- package/icons/azure/azure-cloud-shell.js +28 -0
- package/icons/azure/azure-communication-services.js +41 -0
- package/icons/azure/azure-communications-gateway.js +32 -0
- package/icons/azure/azure-compute-galleries.js +24 -0
- package/icons/azure/azure-cosmos-db.js +41 -0
- package/icons/azure/azure-data-catalog.js +69 -0
- package/icons/azure/azure-data-explorer-clusters.js +82 -0
- package/icons/azure/azure-database-maria-db-server.js +45 -0
- package/icons/azure/azure-database-migration-services.js +62 -0
- package/icons/azure/azure-database-my-sql-server.js +45 -0
- package/icons/azure/azure-database-postgre-sql-server-group.js +65 -0
- package/icons/azure/azure-database-postgre-sql-server.js +57 -0
- package/icons/azure/azure-databox-gateway.js +28 -0
- package/icons/azure/azure-databricks.js +12 -0
- package/icons/azure/azure-deployment-environments.js +48 -0
- package/icons/azure/azure-dev-ops.js +21 -0
- package/icons/azure/azure-dev-tunnels.js +20 -0
- package/icons/azure/azure-edge-hardware-center.js +58 -0
- package/icons/azure/azure-experimentation-studio.js +77 -0
- package/icons/azure/azure-fileshares.js +46 -0
- package/icons/azure/azure-firewall-manager.js +49 -0
- package/icons/azure/azure-firewall-policy.js +37 -0
- package/icons/azure/azure-hcp-cache.js +23 -0
- package/icons/azure/azure-hpc-workbenches.js +68 -0
- package/icons/azure/azure-hybrid-center.js +22 -0
- package/icons/azure/azure-information-protection.js +51 -0
- package/icons/azure/azure-io-t-operations.js +46 -0
- package/icons/azure/azure-lighthouse.js +35 -0
- package/icons/azure/azure-load-testing.js +56 -0
- package/icons/azure/azure-managed-grafana.js +19 -0
- package/icons/azure/azure-maps-accounts.js +16 -0
- package/icons/azure/azure-media-service.js +90 -0
- package/icons/azure/azure-migrate.js +46 -0
- package/icons/azure/azure-monitor-dashboard.js +47 -0
- package/icons/azure/azure-monitor-pipeline.js +57 -0
- package/icons/azure/azure-monitors-for-sap-solutions.js +49 -0
- package/icons/azure/azure-net-app-files.js +36 -0
- package/icons/azure/azure-network-function-manager-functions.js +41 -0
- package/icons/azure/azure-network-function-manager.js +65 -0
- package/icons/azure/azure-object-understanding.js +39 -0
- package/icons/azure/azure-open-ai.js +29 -0
- package/icons/azure/azure-operator-5g-core.js +64 -0
- package/icons/azure/azure-operator-insights.js +31 -0
- package/icons/azure/azure-operator-nexus.js +54 -0
- package/icons/azure/azure-operator-service-manager.js +30 -0
- package/icons/azure/azure-orbital.js +115 -0
- package/icons/azure/azure-programmable-connectivity.js +145 -0
- package/icons/azure/azure-purview-accounts.js +56 -0
- package/icons/azure/azure-quotas.js +43 -0
- package/icons/azure/azure-red-hat-open-shift.js +44 -0
- package/icons/azure/azure-sentinel.js +37 -0
- package/icons/azure/azure-service-bus.js +66 -0
- package/icons/azure/azure-sphere.js +57 -0
- package/icons/azure/azure-spring-apps.js +67 -0
- package/icons/azure/azure-sql-edge.js +146 -0
- package/icons/azure/azure-sql-server-stretch-databases.js +54 -0
- package/icons/azure/azure-sql-vm.js +37 -0
- package/icons/azure/azure-sql.js +27 -0
- package/icons/azure/azure-stack-edge.js +33 -0
- package/icons/azure/azure-stack-hci-sizer.js +57 -0
- package/icons/azure/azure-stack.js +54 -0
- package/icons/azure/azure-storage-mover.js +58 -0
- package/icons/azure/azure-support-center-blue.js +31 -0
- package/icons/azure/azure-sustainability.js +42 -0
- package/icons/azure/azure-synapse-analytics.js +49 -0
- package/icons/azure/azure-token-service.js +46 -0
- package/icons/azure/azure-video-indexer.js +60 -0
- package/icons/azure/azure-virtual-desktop.js +19 -0
- package/icons/azure/azure-vmware-solution.js +35 -0
- package/icons/azure/azure-workbooks.js +72 -0
- package/icons/azure/azurite.js +34 -0
- package/icons/azure/backlog.js +48 -0
- package/icons/azure/backup-vault.js +49 -0
- package/icons/azure/bare-metal-infrastructure.js +41 -0
- package/icons/azure/bastions.js +71 -0
- package/icons/azure/batch-accounts.js +52 -0
- package/icons/azure/batch-ai.js +56 -0
- package/icons/azure/biz-talk.js +39 -0
- package/icons/azure/blob-block.js +17 -0
- package/icons/azure/blob-page.js +43 -0
- package/icons/azure/blockchain-applications.js +32 -0
- package/icons/azure/blueprints.js +56 -0
- package/icons/azure/bonsai.js +63 -0
- package/icons/azure/bot-services.js +43 -0
- package/icons/azure/branch.js +32 -0
- package/icons/azure/browser.js +16 -0
- package/icons/azure/bug.js +26 -0
- package/icons/azure/builds.js +48 -0
- package/icons/azure/business-process-tracking.js +28 -0
- package/icons/azure/cache-redis.js +72 -0
- package/icons/azure/cache.js +113 -0
- package/icons/azure/capacity-reservation-groups.js +47 -0
- package/icons/azure/capacity.js +74 -0
- package/icons/azure/cdn-profiles.js +21 -0
- package/icons/azure/central-service-instance-for-sap.js +44 -0
- package/icons/azure/ceres.js +58 -0
- package/icons/azure/change-analysis.js +93 -0
- package/icons/azure/client-apps.js +21 -0
- package/icons/azure/cloud-services-classic.js +37 -0
- package/icons/azure/cloud-services-extended-support.js +50 -0
- package/icons/azure/cloud-test.js +58 -0
- package/icons/azure/code-optimization.js +146 -0
- package/icons/azure/code.js +94 -0
- package/icons/azure/cognitive-search.js +26 -0
- package/icons/azure/cognitive-services-decisions.js +94 -0
- package/icons/azure/cognitive-services.js +42 -0
- package/icons/azure/collaborative-service.js +46 -0
- package/icons/azure/commit.js +30 -0
- package/icons/azure/community-images.js +35 -0
- package/icons/azure/compliance-center.js +48 -0
- package/icons/azure/compliance.js +35 -0
- package/icons/azure/compute-fleet.js +91 -0
- package/icons/azure/computer-vision.js +24 -0
- package/icons/azure/conditional-access.js +45 -0
- package/icons/azure/confidential-ledgers.js +63 -0
- package/icons/azure/connected-cache.js +77 -0
- package/icons/azure/connected-vehicle-platform.js +66 -0
- package/icons/azure/connections.js +54 -0
- package/icons/azure/consortium.js +63 -0
- package/icons/azure/container-apps-environments.js +44 -0
- package/icons/azure/container-instances.js +37 -0
- package/icons/azure/container-registries.js +57 -0
- package/icons/azure/container-services-deprecated.js +65 -0
- package/icons/azure/content-moderators.js +41 -0
- package/icons/azure/content-safety.js +77 -0
- package/icons/azure/controls-horizontal.js +135 -0
- package/icons/azure/controls.js +33 -0
- package/icons/azure/cost-alerts.js +28 -0
- package/icons/azure/cost-analysis.js +35 -0
- package/icons/azure/cost-budgets.js +30 -0
- package/icons/azure/cost-export.js +25 -0
- package/icons/azure/cost-management-and-billing.js +31 -0
- package/icons/azure/cost-management.js +35 -0
- package/icons/azure/counter.js +33 -0
- package/icons/azure/cubes.js +16 -0
- package/icons/azure/custom-ip-prefix.js +34 -0
- package/icons/azure/custom-vision.js +48 -0
- package/icons/azure/customer-lockbox-for-microsoft-azure.js +42 -0
- package/icons/azure/dashboard-hub.js +61 -0
- package/icons/azure/dashboard.js +42 -0
- package/icons/azure/data-box.js +33 -0
- package/icons/azure/data-collection-rules.js +42 -0
- package/icons/azure/data-factories.js +36 -0
- package/icons/azure/data-lake-analytics.js +32 -0
- package/icons/azure/data-lake-storage-gen1.js +38 -0
- package/icons/azure/data-lake-store-gen1.js +38 -0
- package/icons/azure/data-share-invitations.js +23 -0
- package/icons/azure/data-shares.js +67 -0
- package/icons/azure/database-instance-for-sap.js +69 -0
- package/icons/azure/ddo-s-protection-plans.js +36 -0
- package/icons/azure/dedicated-hsm.js +38 -0
- package/icons/azure/defender-cm-local-manager.js +131 -0
- package/icons/azure/defender-dcs-controller.js +66 -0
- package/icons/azure/defender-distributer-control-system.js +45 -0
- package/icons/azure/defender-engineering-station.js +71 -0
- package/icons/azure/defender-external-management.js +88 -0
- package/icons/azure/defender-freezer-monitor.js +151 -0
- package/icons/azure/defender-historian.js +53 -0
- package/icons/azure/defender-hmi.js +43 -0
- package/icons/azure/defender-industrial-packaging-system.js +75 -0
- package/icons/azure/defender-industrial-printer.js +34 -0
- package/icons/azure/defender-industrial-robot.js +99 -0
- package/icons/azure/defender-industrial-scale-system.js +58 -0
- package/icons/azure/defender-marquee.js +38 -0
- package/icons/azure/defender-meter.js +101 -0
- package/icons/azure/defender-plc.js +55 -0
- package/icons/azure/defender-pneumatic-device.js +50 -0
- package/icons/azure/defender-programable-board.js +82 -0
- package/icons/azure/defender-relay.js +49 -0
- package/icons/azure/defender-robot-controller.js +79 -0
- package/icons/azure/defender-rtu.js +23 -0
- package/icons/azure/defender-sensor.js +44 -0
- package/icons/azure/defender-slot.js +31 -0
- package/icons/azure/defender-web-guiding-system.js +167 -0
- package/icons/azure/detonation.js +30 -0
- package/icons/azure/dev-console.js +30 -0
- package/icons/azure/dev-ops-starter.js +102 -0
- package/icons/azure/dev-test-labs.js +46 -0
- package/icons/azure/device-compliance.js +40 -0
- package/icons/azure/device-configuration.js +33 -0
- package/icons/azure/device-enrollment.js +37 -0
- package/icons/azure/device-provisioning-services.js +43 -0
- package/icons/azure/device-security-apple.js +43 -0
- package/icons/azure/device-security-google.js +43 -0
- package/icons/azure/device-security-windows.js +43 -0
- package/icons/azure/device-update-io-t-hub.js +35 -0
- package/icons/azure/devices.js +29 -0
- package/icons/azure/diagnostics-settings.js +40 -0
- package/icons/azure/digital-twins.js +40 -0
- package/icons/azure/disk-encryption-sets.js +63 -0
- package/icons/azure/disk-pool.js +92 -0
- package/icons/azure/disks-classic.js +63 -0
- package/icons/azure/disks-snapshots.js +49 -0
- package/icons/azure/disks.js +63 -0
- package/icons/azure/dns-multistack.js +49 -0
- package/icons/azure/dns-private-resolver.js +39 -0
- package/icons/azure/dns-security-policy.js +90 -0
- package/icons/azure/dns-zones.js +37 -0
- package/icons/azure/download.js +60 -0
- package/icons/azure/e-books.js +42 -0
- package/icons/azure/edge-management.js +53 -0
- package/icons/azure/education.js +42 -0
- package/icons/azure/elastic-job-agents.js +50 -0
- package/icons/azure/elastic-san.js +65 -0
- package/icons/azure/endpoint-analytics.js +72 -0
- package/icons/azure/enterprise-applications.js +55 -0
- package/icons/azure/entra-connect-health.js +115 -0
- package/icons/azure/entra-connect-sync.js +86 -0
- package/icons/azure/entra-connect.js +123 -0
- package/icons/azure/entra-domain-services.js +99 -0
- package/icons/azure/entra-global-secure-access.js +37 -0
- package/icons/azure/entra-id-protection.js +63 -0
- package/icons/azure/entra-identity-custom-roles.js +62 -0
- package/icons/azure/entra-identity-licenses.js +52 -0
- package/icons/azure/entra-identity-risky-signins.js +28 -0
- package/icons/azure/entra-identity-risky-users.js +28 -0
- package/icons/azure/entra-identity-roles-and-administrators.js +31 -0
- package/icons/azure/entra-internet-access.js +72 -0
- package/icons/azure/entra-managed-identities.js +114 -0
- package/icons/azure/entra-private-access.js +60 -0
- package/icons/azure/entra-privleged-identity-management.js +114 -0
- package/icons/azure/entra-verified-id.js +53 -0
- package/icons/azure/error.js +30 -0
- package/icons/azure/event-grid-domains.js +65 -0
- package/icons/azure/event-grid-subscriptions.js +65 -0
- package/icons/azure/event-grid-topics.js +68 -0
- package/icons/azure/event-hub-clusters.js +77 -0
- package/icons/azure/event-hubs.js +64 -0
- package/icons/azure/exchange-access.js +45 -0
- package/icons/azure/exchange-on-premises-access.js +28 -0
- package/icons/azure/express-route-circuits.js +38 -0
- package/icons/azure/express-route-direct.js +50 -0
- package/icons/azure/express-route-traffic-collector.js +86 -0
- package/icons/azure/extended-security-updates.js +33 -0
- package/icons/azure/extensions.js +28 -0
- package/icons/azure/external-identities.js +42 -0
- package/icons/azure/face-apis.js +19 -0
- package/icons/azure/feature-previews.js +21 -0
- package/icons/azure/fhir-service.js +60 -0
- package/icons/azure/fiji.js +42 -0
- package/icons/azure/file.js +29 -0
- package/icons/azure/files.js +45 -0
- package/icons/azure/firewalls.js +32 -0
- package/icons/azure/folder-blank.js +28 -0
- package/icons/azure/folder-website.js +84 -0
- package/icons/azure/form-recognizers.js +48 -0
- package/icons/azure/free-services.js +43 -0
- package/icons/azure/front-door-and-cdn-profiles.js +26 -0
- package/icons/azure/ftp.js +17 -0
- package/icons/azure/function-apps.js +61 -0
- package/icons/azure/gear.js +37 -0
- package/icons/azure/genomics-accounts.js +57 -0
- package/icons/azure/genomics.js +57 -0
- package/icons/azure/globe-error.js +42 -0
- package/icons/azure/globe-success.js +52 -0
- package/icons/azure/globe-warning.js +53 -0
- package/icons/azure/groups.js +42 -0
- package/icons/azure/guide.js +17 -0
- package/icons/azure/hd-insight-clusters.js +38 -0
- package/icons/azure/hdi-aks-cluster.js +60 -0
- package/icons/azure/heart.js +31 -0
- package/icons/azure/help-and-support.js +33 -0
- package/icons/azure/host-groups.js +48 -0
- package/icons/azure/host-pools.js +19 -0
- package/icons/azure/hosts.js +46 -0
- package/icons/azure/ic-m-troubleshooting.js +60 -0
- package/icons/azure/identity-governance.js +41 -0
- package/icons/azure/identity-multi-factor-authentication.js +71 -0
- package/icons/azure/identity-secure-score.js +55 -0
- package/icons/azure/image-definitions.js +27 -0
- package/icons/azure/image-templates.js +32 -0
- package/icons/azure/image-versions.js +27 -0
- package/icons/azure/image.js +31 -0
- package/icons/azure/images.js +37 -0
- package/icons/azure/immersive-readers.js +60 -0
- package/icons/azure/import-export-jobs.js +25 -0
- package/icons/azure/industrial-io-t.js +53 -0
- package/icons/azure/information.js +21 -0
- package/icons/azure/infrastructure-backup.js +67 -0
- package/icons/azure/input-output.js +97 -0
- package/icons/azure/instance-pools.js +76 -0
- package/icons/azure/integration-accounts.js +30 -0
- package/icons/azure/integration-environments.js +94 -0
- package/icons/azure/integration-service-environments.js +58 -0
- package/icons/azure/internet-analyzer-profiles.js +48 -0
- package/icons/azure/intune-app-protection.js +46 -0
- package/icons/azure/intune-for-education.js +46 -0
- package/icons/azure/intune-trends.js +29 -0
- package/icons/azure/intune.js +46 -0
- package/icons/azure/io-t-central-applications.js +20 -0
- package/icons/azure/io-t-edge.js +25 -0
- package/icons/azure/io-t-hub.js +36 -0
- package/icons/azure/ip-address-manager.js +52 -0
- package/icons/azure/ip-groups.js +39 -0
- package/icons/azure/journey-hub.js +30 -0
- package/icons/azure/key-vaults.js +61 -0
- package/icons/azure/keys.js +97 -0
- package/icons/azure/kubernetes-fleet-manager.js +73 -0
- package/icons/azure/kubernetes-services.js +65 -0
- package/icons/azure/lab-accounts.js +47 -0
- package/icons/azure/lab-services.js +46 -0
- package/icons/azure/language-understanding.js +14 -0
- package/icons/azure/language.js +71 -0
- package/icons/azure/launch-portal.js +25 -0
- package/icons/azure/learn.js +61 -0
- package/icons/azure/load-balancer-hub.js +90 -0
- package/icons/azure/load-balancers.js +28 -0
- package/icons/azure/load-test.js +50 -0
- package/icons/azure/load-testing.js +71 -0
- package/icons/azure/local-network-gateways.js +33 -0
- package/icons/azure/location.js +34 -0
- package/icons/azure/log-analytics-query-pack.js +57 -0
- package/icons/azure/log-analytics-workspaces.js +36 -0
- package/icons/azure/log-streaming.js +46 -0
- package/icons/azure/logic-apps-custom-connector.js +43 -0
- package/icons/azure/logic-apps.js +54 -0
- package/icons/azure/machine-learning-studio-classic-web-services.js +38 -0
- package/icons/azure/machine-learning-studio-web-service-plans.js +62 -0
- package/icons/azure/machine-learning-studio-workspaces.js +44 -0
- package/icons/azure/machine-learning.js +29 -0
- package/icons/azure/machines-azure-arc.js +27 -0
- package/icons/azure/maintenance-configuration.js +62 -0
- package/icons/azure/managed-applications-center.js +44 -0
- package/icons/azure/managed-database.js +57 -0
- package/icons/azure/managed-desktop.js +40 -0
- package/icons/azure/managed-dev-ops-pools.js +59 -0
- package/icons/azure/managed-file-shares.js +59 -0
- package/icons/azure/managed-identities.js +44 -0
- package/icons/azure/managed-instance-apache-cassandra.js +49 -0
- package/icons/azure/managed-service-fabric.js +98 -0
- package/icons/azure/management-groups.js +66 -0
- package/icons/azure/management-portal.js +17 -0
- package/icons/azure/marketplace-management.js +36 -0
- package/icons/azure/marketplace.js +38 -0
- package/icons/azure/med-tech-service.js +65 -0
- package/icons/azure/media-file.js +36 -0
- package/icons/azure/media.js +108 -0
- package/icons/azure/mesh-applications.js +47 -0
- package/icons/azure/metrics-advisor.js +47 -0
- package/icons/azure/metrics.js +34 -0
- package/icons/azure/microsoft-defender-easm.js +69 -0
- package/icons/azure/microsoft-defender-for-cloud.js +50 -0
- package/icons/azure/microsoft-defender-for-io-t.js +43 -0
- package/icons/azure/microsoft-dev-box.js +143 -0
- package/icons/azure/mindaro.js +47 -0
- package/icons/azure/mission-landing-zone.js +48 -0
- package/icons/azure/mobile-engagement.js +35 -0
- package/icons/azure/mobile-networks.js +75 -0
- package/icons/azure/mobile.js +28 -0
- package/icons/azure/modular-data-center.js +61 -0
- package/icons/azure/module.js +25 -0
- package/icons/azure/monitor-health-models.js +77 -0
- package/icons/azure/monitor.js +61 -0
- package/icons/azure/multi-tenancy.js +47 -0
- package/icons/azure/multifactor-authentication.js +84 -0
- package/icons/azure/my-customers.js +42 -0
- package/icons/azure/nat.js +45 -0
- package/icons/azure/network-interfaces.js +41 -0
- package/icons/azure/network-managers.js +44 -0
- package/icons/azure/network-security-groups.js +42 -0
- package/icons/azure/network-security-perimeters.js +91 -0
- package/icons/azure/network-watcher.js +55 -0
- package/icons/azure/notification-hub-namespaces.js +22 -0
- package/icons/azure/notification-hubs.js +22 -0
- package/icons/azure/offers.js +35 -0
- package/icons/azure/on-premises-data-gateways.js +33 -0
- package/icons/azure/open-supply-chain-platform.js +54 -0
- package/icons/azure/operation-log-classic.js +33 -0
- package/icons/azure/oracle-database.js +33 -0
- package/icons/azure/os-images-classic.js +38 -0
- package/icons/azure/osconfig.js +71 -0
- package/icons/azure/outbound-connection.js +24 -0
- package/icons/azure/partner-namespace.js +97 -0
- package/icons/azure/partner-registration.js +95 -0
- package/icons/azure/partner-topic.js +82 -0
- package/icons/azure/peering-service.js +27 -0
- package/icons/azure/peerings.js +33 -0
- package/icons/azure/personalizers.js +55 -0
- package/icons/azure/plans.js +40 -0
- package/icons/azure/policy.js +34 -0
- package/icons/azure/power-bi-embedded.js +69 -0
- package/icons/azure/power-platform.js +163 -0
- package/icons/azure/power-up.js +42 -0
- package/icons/azure/power.js +31 -0
- package/icons/azure/powershell.js +30 -0
- package/icons/azure/preview-features.js +50 -0
- package/icons/azure/private-endpoints.js +69 -0
- package/icons/azure/private-link-service.js +83 -0
- package/icons/azure/private-link-services.js +72 -0
- package/icons/azure/private-link.js +94 -0
- package/icons/azure/process-explorer.js +23 -0
- package/icons/azure/production-ready-database.js +70 -0
- package/icons/azure/proximity-placement-groups.js +71 -0
- package/icons/azure/public-ip-addresses-classic.js +19 -0
- package/icons/azure/public-ip-addresses.js +19 -0
- package/icons/azure/public-ip-prefixes.js +53 -0
- package/icons/azure/qn-a-makers.js +50 -0
- package/icons/azure/quickstart-center.js +54 -0
- package/icons/azure/recent.js +57 -0
- package/icons/azure/recovery-services-vaults.js +45 -0
- package/icons/azure/region-management.js +42 -0
- package/icons/azure/relays.js +45 -0
- package/icons/azure/remote-rendering.js +71 -0
- package/icons/azure/reservations.js +37 -0
- package/icons/azure/reserved-capacity.js +45 -0
- package/icons/azure/reserved-ip-addresses-classic.js +21 -0
- package/icons/azure/resource-explorer.js +33 -0
- package/icons/azure/resource-graph-explorer.js +25 -0
- package/icons/azure/resource-group-list.js +48 -0
- package/icons/azure/resource-groups.js +40 -0
- package/icons/azure/resource-guard.js +46 -0
- package/icons/azure/resource-linked.js +40 -0
- package/icons/azure/resource-management-private-link.js +44 -0
- package/icons/azure/resource-mover.js +20 -0
- package/icons/azure/resources-provider.js +27 -0
- package/icons/azure/restore-points-collections.js +40 -0
- package/icons/azure/restore-points.js +39 -0
- package/icons/azure/route-filters.js +39 -0
- package/icons/azure/route-tables.js +40 -0
- package/icons/azure/rtos.js +64 -0
- package/icons/azure/savings-plans.js +53 -0
- package/icons/azure/scheduler-job-collections.js +73 -0
- package/icons/azure/scheduler.js +75 -0
- package/icons/azure/scvmm-management-servers.js +68 -0
- package/icons/azure/search-grid.js +48 -0
- package/icons/azure/search.js +28 -0
- package/icons/azure/security-baselines.js +44 -0
- package/icons/azure/security.js +22 -0
- package/icons/azure/send-grid-accounts.js +25 -0
- package/icons/azure/server-farm.js +54 -0
- package/icons/azure/serverless-search.js +54 -0
- package/icons/azure/service-catalog-mad.js +48 -0
- package/icons/azure/service-endpoint-policies.js +64 -0
- package/icons/azure/service-fabric-clusters.js +53 -0
- package/icons/azure/service-health.js +34 -0
- package/icons/azure/service-providers.js +38 -0
- package/icons/azure/shared-image-galleries.js +21 -0
- package/icons/azure/signal-r.js +22 -0
- package/icons/azure/software-as-a-service.js +43 -0
- package/icons/azure/software-updates.js +22 -0
- package/icons/azure/solutions.js +58 -0
- package/icons/azure/sonic-dash.js +73 -0
- package/icons/azure/spatial-anchor-accounts.js +44 -0
- package/icons/azure/speech-services.js +32 -0
- package/icons/azure/spot-vm.js +40 -0
- package/icons/azure/spot-vmss.js +66 -0
- package/icons/azure/sql-data-warehouses.js +54 -0
- package/icons/azure/sql-database.js +52 -0
- package/icons/azure/sql-elastic-pools.js +78 -0
- package/icons/azure/sql-managed-instance.js +51 -0
- package/icons/azure/sql-server-registries.js +64 -0
- package/icons/azure/sql-server.js +46 -0
- package/icons/azure/ssd.js +30 -0
- package/icons/azure/ssh-keys.js +42 -0
- package/icons/azure/ssis-lift-and-shift-ir.js +72 -0
- package/icons/azure/stack-hci-premium.js +78 -0
- package/icons/azure/static-apps.js +29 -0
- package/icons/azure/stor-simple-data-managers.js +57 -0
- package/icons/azure/stor-simple-device-managers.js +27 -0
- package/icons/azure/storage-accounts-classic.js +36 -0
- package/icons/azure/storage-accounts.js +35 -0
- package/icons/azure/storage-actions.js +66 -0
- package/icons/azure/storage-azure-files.js +30 -0
- package/icons/azure/storage-container.js +29 -0
- package/icons/azure/storage-explorer.js +27 -0
- package/icons/azure/storage-functions.js +40 -0
- package/icons/azure/storage-queue.js +18 -0
- package/icons/azure/storage-sync-services.js +52 -0
- package/icons/azure/stream-analytics-jobs.js +53 -0
- package/icons/azure/subnet.js +43 -0
- package/icons/azure/subscriptions.js +41 -0
- package/icons/azure/system-topic.js +103 -0
- package/icons/azure/table.js +23 -0
- package/icons/azure/tag.js +28 -0
- package/icons/azure/tags.js +46 -0
- package/icons/azure/targets-management.js +43 -0
- package/icons/azure/template-specs.js +67 -0
- package/icons/azure/templates.js +33 -0
- package/icons/azure/tenant-properties.js +51 -0
- package/icons/azure/tenant-status.js +40 -0
- package/icons/azure/test-base.js +56 -0
- package/icons/azure/tfs-vc-repository.js +42 -0
- package/icons/azure/time-series-data-sets.js +52 -0
- package/icons/azure/time-series-insights-access-policies.js +42 -0
- package/icons/azure/time-series-insights-environments.js +39 -0
- package/icons/azure/time-series-insights-event-sources.js +36 -0
- package/icons/azure/toolbox.js +26 -0
- package/icons/azure/traffic-manager-profiles.js +36 -0
- package/icons/azure/translator-text.js +75 -0
- package/icons/azure/troubleshoot.js +38 -0
- package/icons/azure/universal-print.js +35 -0
- package/icons/azure/update-management-center.js +69 -0
- package/icons/azure/updates.js +47 -0
- package/icons/azure/user-privacy.js +44 -0
- package/icons/azure/user-settings.js +46 -0
- package/icons/azure/user-subscriptions.js +82 -0
- package/icons/azure/users.js +26 -0
- package/icons/azure/verifiable-credentials.js +99 -0
- package/icons/azure/verification-as-a-service.js +84 -0
- package/icons/azure/versions.js +24 -0
- package/icons/azure/video-analyzers.js +42 -0
- package/icons/azure/virtual-clusters.js +77 -0
- package/icons/azure/virtual-enclaves.js +40 -0
- package/icons/azure/virtual-instance-for-sap.js +70 -0
- package/icons/azure/virtual-machine.js +30 -0
- package/icons/azure/virtual-machines-classic.js +31 -0
- package/icons/azure/virtual-network-gateways.js +45 -0
- package/icons/azure/virtual-networks-classic.js +64 -0
- package/icons/azure/virtual-networks.js +64 -0
- package/icons/azure/virtual-router.js +29 -0
- package/icons/azure/virtual-visits-builder.js +75 -0
- package/icons/azure/virtual-wan-hub.js +55 -0
- package/icons/azure/virtual-wans.js +60 -0
- package/icons/azure/vm-app-definitions.js +66 -0
- package/icons/azure/vm-app-versions.js +58 -0
- package/icons/azure/vm-image-version.js +59 -0
- package/icons/azure/vm-images-classic.js +38 -0
- package/icons/azure/vm-scale-sets.js +38 -0
- package/icons/azure/wac-installer.js +104 -0
- package/icons/azure/wac.js +56 -0
- package/icons/azure/web-app-database.js +160 -0
- package/icons/azure/web-application-firewall-policies-waf.js +91 -0
- package/icons/azure/web-jobs.js +119 -0
- package/icons/azure/web-slots.js +30 -0
- package/icons/azure/web-test.js +105 -0
- package/icons/azure/website-power.js +62 -0
- package/icons/azure/website-staging.js +24 -0
- package/icons/azure/windows-notification-services.js +67 -0
- package/icons/azure/windows10-core-services.js +50 -0
- package/icons/azure/workbooks.js +38 -0
- package/icons/azure/worker-container-app.js +69 -0
- package/icons/azure/workflow.js +36 -0
- package/icons/azure/workspace-gateway.js +64 -0
- package/icons/azure/workspaces.js +23 -0
- package/package.json +34 -35
- package/react/index.d.ts +11 -4
- package/react/index.mjs +4050 -746
- package/react/style.css +1 -1
- package/dist/shared/likec4.Cjx4es-x.mjs +0 -1224
|
@@ -2,11 +2,11 @@ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createContext as createContext$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$1, useContext as useContext$1, useRef as useRef$1, useInsertionEffect, useCallback as useCallback$1, useMemo as useMemo$1, forwardRef as forwardRef$1, Fragment, createElement as createElement$1, useId as useId$1, Children, isValidElement, useState as useState$1, memo as memo$1, Suspense, lazy, Component, useSyncExternalStore, StrictMode } from "react";
|
|
4
4
|
import { createRoot } from "react-dom/client";
|
|
5
|
-
import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet, a as createFileRoute, u as useRouter, b as useParams, d as useRouterState, i as isNotFound, n as notFound, R as RouterProvider, e as createRouter$1, f as createHashHistory, g as createBrowserHistory } from "./tanstack-router-
|
|
6
|
-
import { e as Container, f as Title, a as Text$1, G as Group, g as Button, M as MantineContext, h as useHotkeys, i as Tooltip$
|
|
7
|
-
import { withOverviewGraph, ComponentName, isDevelopment, basepath, useHashHistory } from "../const.js";
|
|
5
|
+
import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet, a as createFileRoute, u as useRouter, b as useParams, d as useRouterState, i as isNotFound, n as notFound, R as RouterProvider, e as createRouter$1, f as createHashHistory, g as createBrowserHistory } from "./tanstack-router-CU5V4Ll-.js";
|
|
6
|
+
import { e as Container, f as Title, a as Text$1, G as Group, g as Button, t as themeToVars, M as MantineContext, h as useHotkeys, i as Tooltip$2, j as Menu, k as MenuTarget, l as MenuDropdown, m as MenuLabel, n as MenuDivider, S as Stack$1, c as clsx, o as TooltipGroup, p as Space, A as ActionIcon$1, B as Box, q as MenuItem, r as Popover, s as PopoverTarget, v as PopoverDropdown, w as ScrollAreaAutosize, x as CloseButton, H as HoverCard, y as HoverCardTarget, U as UnstyledButton, z as HoverCardDropdown, D as Anchor, E as CopyButton$1, F as useLocalStorage, C as Card, b as CardSection, J as Spoiler, K as Badge, L as ButtonGroup, T as ThemeIcon, P as Paper, N as Tabs, O as TabsList, Q as TabsTab, R as TabsPanel, V as rem, W as Divider, X as Flex, Y as ColorSwatch, Z as CheckIcon, _ as Select, $ as Slider, a0 as SegmentedControl, a1 as FloatingIndicator, a2 as ActionIconGroup, a3 as Overlay, a4 as Notification, a5 as Code, a6 as createTheme, a7 as MantineProvider, a8 as useInViewport, a9 as SimpleGrid, u as useMantineColorScheme, aa as useTree, ab as useComputedColorScheme, ac as Tree, ad as Drawer, ae as ScrollArea, af as Alert, ag as ModalRoot, ah as ModalOverlay, ai as ModalContent, aj as ModalBody, ak as useMantineTheme, al as useMediaQuery, am as useDisclosure, an as LoadingOverlay, ao as useCallbackRef, ap as Burger, aq as Loader } from "./mantine-IOl1S4mZ.js";
|
|
7
|
+
import { withOverviewGraph, ComponentName, isDevelopment, krokiD2SvgUrl, basepath, useHashHistory } from "../const.js";
|
|
8
8
|
import { useLikeC4ModelAtom } from "virtual:likec4/model";
|
|
9
|
-
import { d as useReactFlow, e as useStoreApi, f as useNodesData, g as useStore$1, h as createWithEqualityFn, j as applyNodeChanges, k as applyEdgeChanges, l as getViewportForBounds, m as getNodeDimensions, n as getBoundsOfRects, s as shallow$1, o as boxToRect, p as useStoreWithEqualityFn, E as EdgeLabelRenderer, H as Handle, P as Position,
|
|
9
|
+
import { d as useReactFlow, e as useStoreApi, f as useNodesData, g as useStore$1, h as createWithEqualityFn, j as applyNodeChanges, k as applyEdgeChanges, l as getViewportForBounds, m as getNodeDimensions, n as getBoundsOfRects, s as shallow$1, o as boxToRect, p as useStoreWithEqualityFn, q as getDefaultExportFromCjs, E as EdgeLabelRenderer, H as Handle, P as Position, r as useOnViewportChange, i as index, t as useOnSelectionChange, b as Background, c as BackgroundVariant, C as Controls, R as ReactFlowProvider } from "./likec4-DlkyDuSp.js";
|
|
10
10
|
import { RenderIcon } from "../icons.js";
|
|
11
11
|
import { usePreviewUrl } from "virtual:likec4/previews";
|
|
12
12
|
var content = "_1u4wf800", image = "_1u4wf801", inner = "_1u4wf802", root = "_1u4wf803", description$2 = "_1u4wf804", title$4 = "_1u4wf805";
|
|
@@ -26,7 +26,7 @@ function NotFound() {
|
|
|
26
26
|
] })
|
|
27
27
|
] }) });
|
|
28
28
|
}
|
|
29
|
-
var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
29
|
+
var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
30
30
|
function combineComparators(comparatorA, comparatorB) {
|
|
31
31
|
return function(a2, b2, state) {
|
|
32
32
|
return comparatorA(a2, b2, state) && comparatorB(a2, b2, state);
|
|
@@ -44,11 +44,11 @@ function createIsCircular(areItemsEqual) {
|
|
|
44
44
|
return cache.delete(a2), cache.delete(b2), result;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function getStrictProperties(
|
|
48
|
-
return getOwnPropertyNames(
|
|
47
|
+
function getStrictProperties(object2) {
|
|
48
|
+
return getOwnPropertyNames(object2).concat(getOwnPropertySymbols(object2));
|
|
49
49
|
}
|
|
50
|
-
var hasOwn = Object.hasOwn || function(
|
|
51
|
-
return hasOwnProperty.call(
|
|
50
|
+
var hasOwn = Object.hasOwn || function(object2, property) {
|
|
51
|
+
return hasOwnProperty$1.call(object2, property);
|
|
52
52
|
};
|
|
53
53
|
function sameValueZeroEqual(a2, b2) {
|
|
54
54
|
return a2 || b2 ? a2 === b2 : a2 === b2 || a2 !== a2 && b2 !== b2;
|
|
@@ -424,10 +424,10 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
424
424
|
};
|
|
425
425
|
return { schedule: stepsOrder.reduce((acc, key) => {
|
|
426
426
|
const step = steps2[key];
|
|
427
|
-
return acc[key] = (
|
|
428
|
-
}, {}), cancel: (
|
|
427
|
+
return acc[key] = (process2, keepAlive = !1, immediate = !1) => (runNextFrame || wake(), step.schedule(process2, keepAlive, immediate)), acc;
|
|
428
|
+
}, {}), cancel: (process2) => {
|
|
429
429
|
for (let i2 = 0; i2 < stepsOrder.length; i2++)
|
|
430
|
-
steps2[stepsOrder[i2]].cancel(
|
|
430
|
+
steps2[stepsOrder[i2]].cancel(process2);
|
|
431
431
|
}, state, steps: steps2 };
|
|
432
432
|
}
|
|
433
433
|
const { schedule: frame, cancel: cancelFrame, state: frameData, steps } = createRenderBatcher(typeof requestAnimationFrame < "u" ? requestAnimationFrame : noop$1, !0), isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
|
|
@@ -3548,7 +3548,43 @@ function LazyMotion({ children, features, strict = !1 }) {
|
|
|
3548
3548
|
function isLazyBundle(features) {
|
|
3549
3549
|
return typeof features == "function";
|
|
3550
3550
|
}
|
|
3551
|
-
const
|
|
3551
|
+
const DeprecatedLayoutGroupContext = createContext$1(null);
|
|
3552
|
+
function useIsMounted() {
|
|
3553
|
+
const isMounted = useRef$1(!1);
|
|
3554
|
+
return useIsomorphicLayoutEffect$2(() => (isMounted.current = !0, () => {
|
|
3555
|
+
isMounted.current = !1;
|
|
3556
|
+
}), []), isMounted;
|
|
3557
|
+
}
|
|
3558
|
+
function useForceUpdate$1() {
|
|
3559
|
+
const isMounted = useIsMounted(), [forcedRenderCount, setForcedRenderCount] = useState$1(0), forceRender = useCallback$1(() => {
|
|
3560
|
+
isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
|
|
3561
|
+
}, [forcedRenderCount]);
|
|
3562
|
+
return [useCallback$1(() => frame.postRender(forceRender), [forceRender]), forcedRenderCount];
|
|
3563
|
+
}
|
|
3564
|
+
const notify = (node) => !node.isLayoutDirty && node.willUpdate(!1);
|
|
3565
|
+
function nodeGroup() {
|
|
3566
|
+
const nodes = /* @__PURE__ */ new Set(), subscriptions = /* @__PURE__ */ new WeakMap(), dirtyAll = () => nodes.forEach(notify);
|
|
3567
|
+
return {
|
|
3568
|
+
add: (node) => {
|
|
3569
|
+
nodes.add(node), subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll));
|
|
3570
|
+
},
|
|
3571
|
+
remove: (node) => {
|
|
3572
|
+
nodes.delete(node);
|
|
3573
|
+
const unsubscribe = subscriptions.get(node);
|
|
3574
|
+
unsubscribe && (unsubscribe(), subscriptions.delete(node)), dirtyAll();
|
|
3575
|
+
},
|
|
3576
|
+
dirty: dirtyAll
|
|
3577
|
+
};
|
|
3578
|
+
}
|
|
3579
|
+
const shouldInheritGroup = (inherit) => inherit === !0, shouldInheritId = (inherit) => shouldInheritGroup(inherit === !0) || inherit === "id", LayoutGroup = ({ children, id: id2, inherit = !0 }) => {
|
|
3580
|
+
const layoutGroupContext = useContext$1(LayoutGroupContext), deprecatedLayoutGroupContext = useContext$1(DeprecatedLayoutGroupContext), [forceRender, key] = useForceUpdate$1(), context = useRef$1(null), upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext;
|
|
3581
|
+
context.current === null && (shouldInheritId(inherit) && upstreamId && (id2 = id2 ? upstreamId + "-" + id2 : upstreamId), context.current = {
|
|
3582
|
+
id: id2,
|
|
3583
|
+
group: shouldInheritGroup(inherit) && layoutGroupContext.group || nodeGroup()
|
|
3584
|
+
});
|
|
3585
|
+
const memoizedContext = useMemo$1(() => ({ ...context.current, forceRender }), [key]);
|
|
3586
|
+
return jsx(LayoutGroupContext.Provider, { value: memoizedContext, children });
|
|
3587
|
+
}, domAnimation = {
|
|
3552
3588
|
renderer: createDomVisualElement,
|
|
3553
3589
|
...animations,
|
|
3554
3590
|
...gestureAnimations
|
|
@@ -6662,75 +6698,3205 @@ function createDiagramStore(props2) {
|
|
|
6662
6698
|
return vector(v).mul(scale2).add(nodeCenter);
|
|
6663
6699
|
}
|
|
6664
6700
|
}
|
|
6665
|
-
}),
|
|
6666
|
-
{
|
|
6667
|
-
name: `${storeDevId} - ${props2.view.id}`,
|
|
6668
|
-
enabled: DEV
|
|
6669
|
-
}
|
|
6670
|
-
)
|
|
6671
|
-
),
|
|
6672
|
-
shallow$1
|
|
6673
|
-
);
|
|
6674
|
-
}
|
|
6675
|
-
const DiagramContext = createContext$1(null);
|
|
6676
|
-
function DiagramContextProvider({
|
|
6677
|
-
children,
|
|
6678
|
-
view,
|
|
6679
|
-
className,
|
|
6680
|
-
keepAspectRatio,
|
|
6681
|
-
whereFilter,
|
|
6682
|
-
...props2
|
|
6683
|
-
}) {
|
|
6684
|
-
const containerRef = useRef$1(null), xystore = useXYStoreApi(), xyflow = useXYFlow(), store = useRef$1(), getContainer = useCallback$1(() => containerRef.current, [containerRef]);
|
|
6685
|
-
return store.current || (store.current = createDiagramStore({
|
|
6686
|
-
xystore,
|
|
6687
|
-
xyflow,
|
|
6688
|
-
view,
|
|
6689
|
-
getContainer,
|
|
6690
|
-
whereFilter: structuredClone(whereFilter),
|
|
6691
|
-
...props2
|
|
6692
|
-
})), useUpdateEffect(
|
|
6693
|
-
() => store.current?.setState({ xyflow, xystore, getContainer }, !1, "update xyflow and xystore"),
|
|
6694
|
-
[xyflow, xystore, getContainer]
|
|
6695
|
-
), useUpdateEffect(
|
|
6696
|
-
() => store.current?.setState(props2, !1, "update incoming props"),
|
|
6697
|
-
[props2]
|
|
6698
|
-
), useUpdateEffect(
|
|
6699
|
-
() => {
|
|
6700
|
-
const current = store.current;
|
|
6701
|
-
invariant(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
|
|
6702
|
-
},
|
|
6703
|
-
[view, whereFilter],
|
|
6704
|
-
(a2, b2) => shallowEqual(a2[0], b2[0]) && deepEqual(a2[1], b2[1])
|
|
6705
|
-
), /* @__PURE__ */ jsx(
|
|
6706
|
-
"div",
|
|
6707
|
-
{
|
|
6708
|
-
ref: containerRef,
|
|
6709
|
-
className,
|
|
6710
|
-
...keepAspectRatio && {
|
|
6711
|
-
style: {
|
|
6712
|
-
aspectRatio: `${Math.ceil(view.bounds.width)}/${Math.ceil(view.bounds.height)}`,
|
|
6713
|
-
maxHeight: Math.ceil(view.bounds.height)
|
|
6701
|
+
}),
|
|
6702
|
+
{
|
|
6703
|
+
name: `${storeDevId} - ${props2.view.id}`,
|
|
6704
|
+
enabled: DEV
|
|
6705
|
+
}
|
|
6706
|
+
)
|
|
6707
|
+
),
|
|
6708
|
+
shallow$1
|
|
6709
|
+
);
|
|
6710
|
+
}
|
|
6711
|
+
const DiagramContext = createContext$1(null);
|
|
6712
|
+
function DiagramContextProvider({
|
|
6713
|
+
children,
|
|
6714
|
+
view,
|
|
6715
|
+
className,
|
|
6716
|
+
keepAspectRatio,
|
|
6717
|
+
whereFilter,
|
|
6718
|
+
...props2
|
|
6719
|
+
}) {
|
|
6720
|
+
const containerRef = useRef$1(null), xystore = useXYStoreApi(), xyflow = useXYFlow(), store = useRef$1(), getContainer = useCallback$1(() => containerRef.current, [containerRef]);
|
|
6721
|
+
return store.current || (store.current = createDiagramStore({
|
|
6722
|
+
xystore,
|
|
6723
|
+
xyflow,
|
|
6724
|
+
view,
|
|
6725
|
+
getContainer,
|
|
6726
|
+
whereFilter: structuredClone(whereFilter),
|
|
6727
|
+
...props2
|
|
6728
|
+
})), useUpdateEffect(
|
|
6729
|
+
() => store.current?.setState({ xyflow, xystore, getContainer }, !1, "update xyflow and xystore"),
|
|
6730
|
+
[xyflow, xystore, getContainer]
|
|
6731
|
+
), useUpdateEffect(
|
|
6732
|
+
() => store.current?.setState(props2, !1, "update incoming props"),
|
|
6733
|
+
[props2]
|
|
6734
|
+
), useUpdateEffect(
|
|
6735
|
+
() => {
|
|
6736
|
+
const current = store.current;
|
|
6737
|
+
invariant(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
|
|
6738
|
+
},
|
|
6739
|
+
[view, whereFilter],
|
|
6740
|
+
(a2, b2) => shallowEqual(a2[0], b2[0]) && deepEqual(a2[1], b2[1])
|
|
6741
|
+
), /* @__PURE__ */ jsx(
|
|
6742
|
+
"div",
|
|
6743
|
+
{
|
|
6744
|
+
ref: containerRef,
|
|
6745
|
+
className,
|
|
6746
|
+
...keepAspectRatio && {
|
|
6747
|
+
style: {
|
|
6748
|
+
aspectRatio: `${Math.ceil(view.bounds.width)}/${Math.ceil(view.bounds.height)}`,
|
|
6749
|
+
maxHeight: Math.ceil(view.bounds.height)
|
|
6750
|
+
}
|
|
6751
|
+
},
|
|
6752
|
+
children: /* @__PURE__ */ jsx(DiagramContext.Provider, { value: store.current, children })
|
|
6753
|
+
}
|
|
6754
|
+
);
|
|
6755
|
+
}
|
|
6756
|
+
DiagramContextProvider.displayName = "DiagramContextProvider";
|
|
6757
|
+
function useDiagramState(selector2, equalityFn) {
|
|
6758
|
+
const store = useContext$1(DiagramContext);
|
|
6759
|
+
if (store === null)
|
|
6760
|
+
throw new Error("useDiagramStore could be used only inside DiagramContext");
|
|
6761
|
+
return useStoreWithEqualityFn(store, selector2, equalityFn ?? shallowEqual);
|
|
6762
|
+
}
|
|
6763
|
+
function useDiagramStoreApi() {
|
|
6764
|
+
const store = useContext$1(DiagramContext);
|
|
6765
|
+
if (store === null)
|
|
6766
|
+
throw new Error("useDiagramStoreApi could be used only inside DiagramContext");
|
|
6767
|
+
return store;
|
|
6768
|
+
}
|
|
6769
|
+
var stylesheets = {}, injectStyles = (_ref) => {
|
|
6770
|
+
var {
|
|
6771
|
+
fileScope,
|
|
6772
|
+
css
|
|
6773
|
+
} = _ref, fileScopeId = fileScope.packageName ? [fileScope.packageName, fileScope.filePath].join("/") : fileScope.filePath, stylesheet = stylesheets[fileScopeId];
|
|
6774
|
+
if (!stylesheet) {
|
|
6775
|
+
var styleEl = document.createElement("style");
|
|
6776
|
+
fileScope.packageName && styleEl.setAttribute("data-package", fileScope.packageName), styleEl.setAttribute("data-file", fileScope.filePath), styleEl.setAttribute("type", "text/css"), stylesheet = stylesheets[fileScopeId] = styleEl, document.head.appendChild(styleEl);
|
|
6777
|
+
}
|
|
6778
|
+
stylesheet.innerHTML = css;
|
|
6779
|
+
};
|
|
6780
|
+
function getVarName(variable) {
|
|
6781
|
+
var matches = variable.match(/^var\((.*)\)$/);
|
|
6782
|
+
return matches ? matches[1] : variable;
|
|
6783
|
+
}
|
|
6784
|
+
function walkObject(obj, fn) {
|
|
6785
|
+
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], clone = {};
|
|
6786
|
+
for (var key in obj) {
|
|
6787
|
+
var _value = obj[key], currentPath = [...path, key];
|
|
6788
|
+
typeof _value == "string" || typeof _value == "number" || _value == null ? clone[key] = fn(_value, currentPath) : typeof _value == "object" && !Array.isArray(_value) ? clone[key] = walkObject(_value, fn, currentPath) : console.warn('Skipping invalid key "'.concat(currentPath.join("."), '". Should be a string, number, null or object. Received: "').concat(Array.isArray(_value) ? "Array" : typeof _value, '"'));
|
|
6789
|
+
}
|
|
6790
|
+
return clone;
|
|
6791
|
+
}
|
|
6792
|
+
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
6793
|
+
var object = {}, hasOwnProperty = object.hasOwnProperty, merge = function(options, defaults) {
|
|
6794
|
+
if (!options)
|
|
6795
|
+
return defaults;
|
|
6796
|
+
var result = {};
|
|
6797
|
+
for (var key in defaults)
|
|
6798
|
+
result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
|
|
6799
|
+
return result;
|
|
6800
|
+
}, regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/, regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/, regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g, cssesc = function cssesc2(string, options) {
|
|
6801
|
+
options = merge(options, cssesc2.options), options.quotes != "single" && options.quotes != "double" && (options.quotes = "single");
|
|
6802
|
+
for (var quote = options.quotes == "double" ? '"' : "'", isIdentifier = options.isIdentifier, firstChar = string.charAt(0), output = "", counter2 = 0, length = string.length; counter2 < length; ) {
|
|
6803
|
+
var character = string.charAt(counter2++), codePoint = character.charCodeAt(), value = void 0;
|
|
6804
|
+
if (codePoint < 32 || codePoint > 126) {
|
|
6805
|
+
if (codePoint >= 55296 && codePoint <= 56319 && counter2 < length) {
|
|
6806
|
+
var extra = string.charCodeAt(counter2++);
|
|
6807
|
+
(extra & 64512) == 56320 ? codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536 : counter2--;
|
|
6808
|
+
}
|
|
6809
|
+
value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
|
6810
|
+
} else
|
|
6811
|
+
options.escapeEverything ? regexAnySingleEscape.test(character) ? value = "\\" + character : value = "\\" + codePoint.toString(16).toUpperCase() + " " : /[\t\n\f\r\x0B]/.test(character) ? value = "\\" + codePoint.toString(16).toUpperCase() + " " : character == "\\" || !isIdentifier && (character == '"' && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character) ? value = "\\" + character : value = character;
|
|
6812
|
+
output += value;
|
|
6813
|
+
}
|
|
6814
|
+
return isIdentifier && (/^-[-\d]/.test(output) ? output = "\\-" + output.slice(1) : /\d/.test(firstChar) && (output = "\\3" + firstChar + " " + output.slice(1))), output = output.replace(regexExcessiveSpaces, function($0, $1, $2) {
|
|
6815
|
+
return $1 && $1.length % 2 ? $0 : ($1 || "") + $2;
|
|
6816
|
+
}), !isIdentifier && options.wrap ? quote + output + quote : output;
|
|
6817
|
+
};
|
|
6818
|
+
cssesc.options = {
|
|
6819
|
+
escapeEverything: !1,
|
|
6820
|
+
isIdentifier: !1,
|
|
6821
|
+
quotes: "single",
|
|
6822
|
+
wrap: !1
|
|
6823
|
+
};
|
|
6824
|
+
cssesc.version = "3.0.0";
|
|
6825
|
+
var cssesc_1 = cssesc;
|
|
6826
|
+
const cssesc$1 = /* @__PURE__ */ getDefaultExportFromCjs(cssesc_1);
|
|
6827
|
+
class AhoCorasick {
|
|
6828
|
+
constructor(keywords) {
|
|
6829
|
+
const { failure, gotoFn, output } = this._buildTables(keywords);
|
|
6830
|
+
this.gotoFn = gotoFn, this.output = output, this.failure = failure;
|
|
6831
|
+
}
|
|
6832
|
+
_buildTables(keywords) {
|
|
6833
|
+
const gotoFn = {
|
|
6834
|
+
0: {}
|
|
6835
|
+
}, output = {};
|
|
6836
|
+
let state = 0;
|
|
6837
|
+
for (const word of keywords) {
|
|
6838
|
+
let curr = 0;
|
|
6839
|
+
for (const l2 of word)
|
|
6840
|
+
gotoFn[curr] && l2 in gotoFn[curr] ? curr = gotoFn[curr][l2] : (state++, gotoFn[curr][l2] = state, gotoFn[state] = {}, curr = state, output[state] = []);
|
|
6841
|
+
output[curr].push(word);
|
|
6842
|
+
}
|
|
6843
|
+
const failure = {}, xs = [];
|
|
6844
|
+
for (const l2 in gotoFn[0]) {
|
|
6845
|
+
const state2 = gotoFn[0][l2];
|
|
6846
|
+
failure[state2] = 0, xs.push(state2);
|
|
6847
|
+
}
|
|
6848
|
+
for (; xs.length > 0; ) {
|
|
6849
|
+
const r2 = xs.shift();
|
|
6850
|
+
if (r2 !== void 0)
|
|
6851
|
+
for (const l2 in gotoFn[r2]) {
|
|
6852
|
+
const s2 = gotoFn[r2][l2];
|
|
6853
|
+
xs.push(s2);
|
|
6854
|
+
let state2 = failure[r2];
|
|
6855
|
+
for (; state2 > 0 && !(l2 in gotoFn[state2]); )
|
|
6856
|
+
state2 = failure[state2];
|
|
6857
|
+
if (l2 in gotoFn[state2]) {
|
|
6858
|
+
const fs = gotoFn[state2][l2];
|
|
6859
|
+
failure[s2] = fs, output[s2] = [...output[s2], ...output[fs]];
|
|
6860
|
+
} else
|
|
6861
|
+
failure[s2] = 0;
|
|
6862
|
+
}
|
|
6863
|
+
}
|
|
6864
|
+
return {
|
|
6865
|
+
gotoFn,
|
|
6866
|
+
output,
|
|
6867
|
+
failure
|
|
6868
|
+
};
|
|
6869
|
+
}
|
|
6870
|
+
search(str) {
|
|
6871
|
+
let state = 0;
|
|
6872
|
+
const results = [];
|
|
6873
|
+
for (let i2 = 0; i2 < str.length; i2++) {
|
|
6874
|
+
const l2 = str[i2];
|
|
6875
|
+
for (; state > 0 && !(l2 in this.gotoFn[state]); )
|
|
6876
|
+
state = this.failure[state];
|
|
6877
|
+
if (l2 in this.gotoFn[state] && (state = this.gotoFn[state][l2], this.output[state].length > 0)) {
|
|
6878
|
+
const foundStrs = this.output[state];
|
|
6879
|
+
results.push([i2, foundStrs]);
|
|
6880
|
+
}
|
|
6881
|
+
}
|
|
6882
|
+
return results;
|
|
6883
|
+
}
|
|
6884
|
+
}
|
|
6885
|
+
var mockAdapter = {
|
|
6886
|
+
appendCss: () => {
|
|
6887
|
+
},
|
|
6888
|
+
registerClassName: () => {
|
|
6889
|
+
},
|
|
6890
|
+
onEndFileScope: () => {
|
|
6891
|
+
},
|
|
6892
|
+
registerComposition: () => {
|
|
6893
|
+
},
|
|
6894
|
+
markCompositionUsed: () => {
|
|
6895
|
+
},
|
|
6896
|
+
getIdentOption: () => "short"
|
|
6897
|
+
}, adapterStack = [mockAdapter], currentAdapter = () => {
|
|
6898
|
+
if (adapterStack.length < 1)
|
|
6899
|
+
throw new Error("No adapter configured");
|
|
6900
|
+
return adapterStack[adapterStack.length - 1];
|
|
6901
|
+
}, hasConfiguredAdapter = !1, setAdapterIfNotSet = (newAdapter) => {
|
|
6902
|
+
hasConfiguredAdapter || setAdapter(newAdapter);
|
|
6903
|
+
}, setAdapter = (newAdapter) => {
|
|
6904
|
+
if (!newAdapter)
|
|
6905
|
+
throw new Error('No adapter provided when calling "setAdapter"');
|
|
6906
|
+
hasConfiguredAdapter = !0, adapterStack.push(newAdapter);
|
|
6907
|
+
}, markCompositionUsed = function() {
|
|
6908
|
+
return currentAdapter().markCompositionUsed(...arguments);
|
|
6909
|
+
};
|
|
6910
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
6911
|
+
return raw || (raw = strings.slice(0)), Object.freeze(Object.defineProperties(strings, {
|
|
6912
|
+
raw: {
|
|
6913
|
+
value: Object.freeze(raw)
|
|
6914
|
+
}
|
|
6915
|
+
}));
|
|
6916
|
+
}
|
|
6917
|
+
var SelectorType;
|
|
6918
|
+
(function(SelectorType2) {
|
|
6919
|
+
SelectorType2.Attribute = "attribute", SelectorType2.Pseudo = "pseudo", SelectorType2.PseudoElement = "pseudo-element", SelectorType2.Tag = "tag", SelectorType2.Universal = "universal", SelectorType2.Adjacent = "adjacent", SelectorType2.Child = "child", SelectorType2.Descendant = "descendant", SelectorType2.Parent = "parent", SelectorType2.Sibling = "sibling", SelectorType2.ColumnCombinator = "column-combinator";
|
|
6920
|
+
})(SelectorType || (SelectorType = {}));
|
|
6921
|
+
var AttributeAction;
|
|
6922
|
+
(function(AttributeAction2) {
|
|
6923
|
+
AttributeAction2.Any = "any", AttributeAction2.Element = "element", AttributeAction2.End = "end", AttributeAction2.Equals = "equals", AttributeAction2.Exists = "exists", AttributeAction2.Hyphen = "hyphen", AttributeAction2.Not = "not", AttributeAction2.Start = "start";
|
|
6924
|
+
})(AttributeAction || (AttributeAction = {}));
|
|
6925
|
+
const reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, actionTypes = /* @__PURE__ */ new Map([
|
|
6926
|
+
[126, AttributeAction.Element],
|
|
6927
|
+
[94, AttributeAction.Start],
|
|
6928
|
+
[36, AttributeAction.End],
|
|
6929
|
+
[42, AttributeAction.Any],
|
|
6930
|
+
[33, AttributeAction.Not],
|
|
6931
|
+
[124, AttributeAction.Hyphen]
|
|
6932
|
+
]), unpackPseudos = /* @__PURE__ */ new Set([
|
|
6933
|
+
"has",
|
|
6934
|
+
"not",
|
|
6935
|
+
"matches",
|
|
6936
|
+
"is",
|
|
6937
|
+
"where",
|
|
6938
|
+
"host",
|
|
6939
|
+
"host-context"
|
|
6940
|
+
]);
|
|
6941
|
+
function isTraversal(selector2) {
|
|
6942
|
+
switch (selector2.type) {
|
|
6943
|
+
case SelectorType.Adjacent:
|
|
6944
|
+
case SelectorType.Child:
|
|
6945
|
+
case SelectorType.Descendant:
|
|
6946
|
+
case SelectorType.Parent:
|
|
6947
|
+
case SelectorType.Sibling:
|
|
6948
|
+
case SelectorType.ColumnCombinator:
|
|
6949
|
+
return !0;
|
|
6950
|
+
default:
|
|
6951
|
+
return !1;
|
|
6952
|
+
}
|
|
6953
|
+
}
|
|
6954
|
+
const stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
|
|
6955
|
+
function funescape(_, escaped, escapedWhitespace) {
|
|
6956
|
+
const high = parseInt(escaped, 16) - 65536;
|
|
6957
|
+
return high !== high || escapedWhitespace ? escaped : high < 0 ? (
|
|
6958
|
+
// BMP codepoint
|
|
6959
|
+
String.fromCharCode(high + 65536)
|
|
6960
|
+
) : (
|
|
6961
|
+
// Supplemental Plane codepoint (surrogate pair)
|
|
6962
|
+
String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
|
|
6963
|
+
);
|
|
6964
|
+
}
|
|
6965
|
+
function unescapeCSS(str) {
|
|
6966
|
+
return str.replace(reEscape, funescape);
|
|
6967
|
+
}
|
|
6968
|
+
function isQuote(c) {
|
|
6969
|
+
return c === 39 || c === 34;
|
|
6970
|
+
}
|
|
6971
|
+
function isWhitespace(c) {
|
|
6972
|
+
return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
|
|
6973
|
+
}
|
|
6974
|
+
function parse(selector2) {
|
|
6975
|
+
const subselects = [], endIndex = parseSelector(subselects, `${selector2}`, 0);
|
|
6976
|
+
if (endIndex < selector2.length)
|
|
6977
|
+
throw new Error(`Unmatched selector: ${selector2.slice(endIndex)}`);
|
|
6978
|
+
return subselects;
|
|
6979
|
+
}
|
|
6980
|
+
function parseSelector(subselects, selector2, selectorIndex) {
|
|
6981
|
+
let tokens = [];
|
|
6982
|
+
function getName(offset) {
|
|
6983
|
+
const match = selector2.slice(selectorIndex + offset).match(reName);
|
|
6984
|
+
if (!match)
|
|
6985
|
+
throw new Error(`Expected name, found ${selector2.slice(selectorIndex)}`);
|
|
6986
|
+
const [name] = match;
|
|
6987
|
+
return selectorIndex += offset + name.length, unescapeCSS(name);
|
|
6988
|
+
}
|
|
6989
|
+
function stripWhitespace(offset) {
|
|
6990
|
+
for (selectorIndex += offset; selectorIndex < selector2.length && isWhitespace(selector2.charCodeAt(selectorIndex)); )
|
|
6991
|
+
selectorIndex++;
|
|
6992
|
+
}
|
|
6993
|
+
function readValueWithParenthesis() {
|
|
6994
|
+
selectorIndex += 1;
|
|
6995
|
+
const start = selectorIndex;
|
|
6996
|
+
let counter2 = 1;
|
|
6997
|
+
for (; counter2 > 0 && selectorIndex < selector2.length; selectorIndex++)
|
|
6998
|
+
selector2.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex) ? counter2++ : selector2.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex) && counter2--;
|
|
6999
|
+
if (counter2)
|
|
7000
|
+
throw new Error("Parenthesis not matched");
|
|
7001
|
+
return unescapeCSS(selector2.slice(start, selectorIndex - 1));
|
|
7002
|
+
}
|
|
7003
|
+
function isEscaped(pos) {
|
|
7004
|
+
let slashCount = 0;
|
|
7005
|
+
for (; selector2.charCodeAt(--pos) === 92; )
|
|
7006
|
+
slashCount++;
|
|
7007
|
+
return (slashCount & 1) === 1;
|
|
7008
|
+
}
|
|
7009
|
+
function ensureNotTraversal() {
|
|
7010
|
+
if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1]))
|
|
7011
|
+
throw new Error("Did not expect successive traversals.");
|
|
7012
|
+
}
|
|
7013
|
+
function addTraversal(type) {
|
|
7014
|
+
if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
|
|
7015
|
+
tokens[tokens.length - 1].type = type;
|
|
7016
|
+
return;
|
|
7017
|
+
}
|
|
7018
|
+
ensureNotTraversal(), tokens.push({ type });
|
|
7019
|
+
}
|
|
7020
|
+
function addSpecialAttribute(name, action) {
|
|
7021
|
+
tokens.push({
|
|
7022
|
+
type: SelectorType.Attribute,
|
|
7023
|
+
name,
|
|
7024
|
+
action,
|
|
7025
|
+
value: getName(1),
|
|
7026
|
+
namespace: null,
|
|
7027
|
+
ignoreCase: "quirks"
|
|
7028
|
+
});
|
|
7029
|
+
}
|
|
7030
|
+
function finalizeSubselector() {
|
|
7031
|
+
if (tokens.length && tokens[tokens.length - 1].type === SelectorType.Descendant && tokens.pop(), tokens.length === 0)
|
|
7032
|
+
throw new Error("Empty sub-selector");
|
|
7033
|
+
subselects.push(tokens);
|
|
7034
|
+
}
|
|
7035
|
+
if (stripWhitespace(0), selector2.length === selectorIndex)
|
|
7036
|
+
return selectorIndex;
|
|
7037
|
+
loop: for (; selectorIndex < selector2.length; ) {
|
|
7038
|
+
const firstChar = selector2.charCodeAt(selectorIndex);
|
|
7039
|
+
switch (firstChar) {
|
|
7040
|
+
case 32:
|
|
7041
|
+
case 9:
|
|
7042
|
+
case 10:
|
|
7043
|
+
case 12:
|
|
7044
|
+
case 13: {
|
|
7045
|
+
(tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) && (ensureNotTraversal(), tokens.push({ type: SelectorType.Descendant })), stripWhitespace(1);
|
|
7046
|
+
break;
|
|
7047
|
+
}
|
|
7048
|
+
case 62: {
|
|
7049
|
+
addTraversal(SelectorType.Child), stripWhitespace(1);
|
|
7050
|
+
break;
|
|
7051
|
+
}
|
|
7052
|
+
case 60: {
|
|
7053
|
+
addTraversal(SelectorType.Parent), stripWhitespace(1);
|
|
7054
|
+
break;
|
|
7055
|
+
}
|
|
7056
|
+
case 126: {
|
|
7057
|
+
addTraversal(SelectorType.Sibling), stripWhitespace(1);
|
|
7058
|
+
break;
|
|
7059
|
+
}
|
|
7060
|
+
case 43: {
|
|
7061
|
+
addTraversal(SelectorType.Adjacent), stripWhitespace(1);
|
|
7062
|
+
break;
|
|
7063
|
+
}
|
|
7064
|
+
case 46: {
|
|
7065
|
+
addSpecialAttribute("class", AttributeAction.Element);
|
|
7066
|
+
break;
|
|
7067
|
+
}
|
|
7068
|
+
case 35: {
|
|
7069
|
+
addSpecialAttribute("id", AttributeAction.Equals);
|
|
7070
|
+
break;
|
|
7071
|
+
}
|
|
7072
|
+
case 91: {
|
|
7073
|
+
stripWhitespace(1);
|
|
7074
|
+
let name, namespace = null;
|
|
7075
|
+
selector2.charCodeAt(selectorIndex) === 124 ? name = getName(1) : selector2.startsWith("*|", selectorIndex) ? (namespace = "*", name = getName(2)) : (name = getName(0), selector2.charCodeAt(selectorIndex) === 124 && selector2.charCodeAt(selectorIndex + 1) !== 61 && (namespace = name, name = getName(1))), stripWhitespace(0);
|
|
7076
|
+
let action = AttributeAction.Exists;
|
|
7077
|
+
const possibleAction = actionTypes.get(selector2.charCodeAt(selectorIndex));
|
|
7078
|
+
if (possibleAction) {
|
|
7079
|
+
if (action = possibleAction, selector2.charCodeAt(selectorIndex + 1) !== 61)
|
|
7080
|
+
throw new Error("Expected `=`");
|
|
7081
|
+
stripWhitespace(2);
|
|
7082
|
+
} else selector2.charCodeAt(selectorIndex) === 61 && (action = AttributeAction.Equals, stripWhitespace(1));
|
|
7083
|
+
let value = "", ignoreCase = null;
|
|
7084
|
+
if (action !== "exists") {
|
|
7085
|
+
if (isQuote(selector2.charCodeAt(selectorIndex))) {
|
|
7086
|
+
const quote = selector2.charCodeAt(selectorIndex);
|
|
7087
|
+
let sectionEnd = selectorIndex + 1;
|
|
7088
|
+
for (; sectionEnd < selector2.length && (selector2.charCodeAt(sectionEnd) !== quote || isEscaped(sectionEnd)); )
|
|
7089
|
+
sectionEnd += 1;
|
|
7090
|
+
if (selector2.charCodeAt(sectionEnd) !== quote)
|
|
7091
|
+
throw new Error("Attribute value didn't end");
|
|
7092
|
+
value = unescapeCSS(selector2.slice(selectorIndex + 1, sectionEnd)), selectorIndex = sectionEnd + 1;
|
|
7093
|
+
} else {
|
|
7094
|
+
const valueStart = selectorIndex;
|
|
7095
|
+
for (; selectorIndex < selector2.length && (!isWhitespace(selector2.charCodeAt(selectorIndex)) && selector2.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex)); )
|
|
7096
|
+
selectorIndex += 1;
|
|
7097
|
+
value = unescapeCSS(selector2.slice(valueStart, selectorIndex));
|
|
7098
|
+
}
|
|
7099
|
+
stripWhitespace(0);
|
|
7100
|
+
const forceIgnore = selector2.charCodeAt(selectorIndex) | 32;
|
|
7101
|
+
forceIgnore === 115 ? (ignoreCase = !1, stripWhitespace(1)) : forceIgnore === 105 && (ignoreCase = !0, stripWhitespace(1));
|
|
7102
|
+
}
|
|
7103
|
+
if (selector2.charCodeAt(selectorIndex) !== 93)
|
|
7104
|
+
throw new Error("Attribute selector didn't terminate");
|
|
7105
|
+
selectorIndex += 1;
|
|
7106
|
+
const attributeSelector = {
|
|
7107
|
+
type: SelectorType.Attribute,
|
|
7108
|
+
name,
|
|
7109
|
+
action,
|
|
7110
|
+
value,
|
|
7111
|
+
namespace,
|
|
7112
|
+
ignoreCase
|
|
7113
|
+
};
|
|
7114
|
+
tokens.push(attributeSelector);
|
|
7115
|
+
break;
|
|
7116
|
+
}
|
|
7117
|
+
case 58: {
|
|
7118
|
+
if (selector2.charCodeAt(selectorIndex + 1) === 58) {
|
|
7119
|
+
tokens.push({
|
|
7120
|
+
type: SelectorType.PseudoElement,
|
|
7121
|
+
name: getName(2).toLowerCase(),
|
|
7122
|
+
data: selector2.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
|
|
7123
|
+
});
|
|
7124
|
+
continue;
|
|
7125
|
+
}
|
|
7126
|
+
const name = getName(1).toLowerCase();
|
|
7127
|
+
let data = null;
|
|
7128
|
+
if (selector2.charCodeAt(selectorIndex) === 40)
|
|
7129
|
+
if (unpackPseudos.has(name)) {
|
|
7130
|
+
if (isQuote(selector2.charCodeAt(selectorIndex + 1)))
|
|
7131
|
+
throw new Error(`Pseudo-selector ${name} cannot be quoted`);
|
|
7132
|
+
if (data = [], selectorIndex = parseSelector(data, selector2, selectorIndex + 1), selector2.charCodeAt(selectorIndex) !== 41)
|
|
7133
|
+
throw new Error(`Missing closing parenthesis in :${name} (${selector2})`);
|
|
7134
|
+
selectorIndex += 1;
|
|
7135
|
+
} else {
|
|
7136
|
+
if (data = readValueWithParenthesis(), stripQuotesFromPseudos.has(name)) {
|
|
7137
|
+
const quot = data.charCodeAt(0);
|
|
7138
|
+
quot === data.charCodeAt(data.length - 1) && isQuote(quot) && (data = data.slice(1, -1));
|
|
7139
|
+
}
|
|
7140
|
+
data = unescapeCSS(data);
|
|
7141
|
+
}
|
|
7142
|
+
tokens.push({ type: SelectorType.Pseudo, name, data });
|
|
7143
|
+
break;
|
|
7144
|
+
}
|
|
7145
|
+
case 44: {
|
|
7146
|
+
finalizeSubselector(), tokens = [], stripWhitespace(1);
|
|
7147
|
+
break;
|
|
7148
|
+
}
|
|
7149
|
+
default: {
|
|
7150
|
+
if (selector2.startsWith("/*", selectorIndex)) {
|
|
7151
|
+
const endIndex = selector2.indexOf("*/", selectorIndex + 2);
|
|
7152
|
+
if (endIndex < 0)
|
|
7153
|
+
throw new Error("Comment was not terminated");
|
|
7154
|
+
selectorIndex = endIndex + 2, tokens.length === 0 && stripWhitespace(0);
|
|
7155
|
+
break;
|
|
7156
|
+
}
|
|
7157
|
+
let namespace = null, name;
|
|
7158
|
+
if (firstChar === 42)
|
|
7159
|
+
selectorIndex += 1, name = "*";
|
|
7160
|
+
else if (firstChar === 124) {
|
|
7161
|
+
if (name = "", selector2.charCodeAt(selectorIndex + 1) === 124) {
|
|
7162
|
+
addTraversal(SelectorType.ColumnCombinator), stripWhitespace(2);
|
|
7163
|
+
break;
|
|
7164
|
+
}
|
|
7165
|
+
} else if (reName.test(selector2.slice(selectorIndex)))
|
|
7166
|
+
name = getName(0);
|
|
7167
|
+
else
|
|
7168
|
+
break loop;
|
|
7169
|
+
selector2.charCodeAt(selectorIndex) === 124 && selector2.charCodeAt(selectorIndex + 1) !== 124 && (namespace = name, selector2.charCodeAt(selectorIndex + 1) === 42 ? (name = "*", selectorIndex += 2) : name = getName(1)), tokens.push(name === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name, namespace });
|
|
7170
|
+
}
|
|
7171
|
+
}
|
|
7172
|
+
}
|
|
7173
|
+
return finalizeSubselector(), selectorIndex;
|
|
7174
|
+
}
|
|
7175
|
+
function ownKeys$1(object2, enumerableOnly) {
|
|
7176
|
+
var keys2 = Object.keys(object2);
|
|
7177
|
+
if (Object.getOwnPropertySymbols) {
|
|
7178
|
+
var symbols = Object.getOwnPropertySymbols(object2);
|
|
7179
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
7180
|
+
return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
|
|
7181
|
+
})), keys2.push.apply(keys2, symbols);
|
|
7182
|
+
}
|
|
7183
|
+
return keys2;
|
|
7184
|
+
}
|
|
7185
|
+
function _objectSpread(target) {
|
|
7186
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
7187
|
+
var source = arguments[i2] != null ? arguments[i2] : {};
|
|
7188
|
+
i2 % 2 ? ownKeys$1(Object(source), !0).forEach(function(key) {
|
|
7189
|
+
_defineProperty$1(target, key, source[key]);
|
|
7190
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
|
|
7191
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
7192
|
+
});
|
|
7193
|
+
}
|
|
7194
|
+
return target;
|
|
7195
|
+
}
|
|
7196
|
+
function _defineProperty$1(obj, key, value) {
|
|
7197
|
+
return key = _toPropertyKey(key), key in obj ? Object.defineProperty(obj, key, { value, enumerable: !0, configurable: !0, writable: !0 }) : obj[key] = value, obj;
|
|
7198
|
+
}
|
|
7199
|
+
function _toPropertyKey(arg) {
|
|
7200
|
+
var key = _toPrimitive(arg, "string");
|
|
7201
|
+
return typeof key == "symbol" ? key : String(key);
|
|
7202
|
+
}
|
|
7203
|
+
function _toPrimitive(input, hint) {
|
|
7204
|
+
if (typeof input != "object" || input === null) return input;
|
|
7205
|
+
var prim = input[Symbol.toPrimitive];
|
|
7206
|
+
if (prim !== void 0) {
|
|
7207
|
+
var res = prim.call(input, hint);
|
|
7208
|
+
if (typeof res != "object") return res;
|
|
7209
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
7210
|
+
}
|
|
7211
|
+
return String(input);
|
|
7212
|
+
}
|
|
7213
|
+
const dedent = createDedent({});
|
|
7214
|
+
function createDedent(options) {
|
|
7215
|
+
return dedent2.withOptions = (newOptions) => createDedent(_objectSpread(_objectSpread({}, options), newOptions)), dedent2;
|
|
7216
|
+
function dedent2(strings, ...values) {
|
|
7217
|
+
const raw = typeof strings == "string" ? [strings] : strings.raw, {
|
|
7218
|
+
escapeSpecialCharacters = Array.isArray(strings)
|
|
7219
|
+
} = options;
|
|
7220
|
+
let result = "";
|
|
7221
|
+
for (let i2 = 0; i2 < raw.length; i2++) {
|
|
7222
|
+
let next = raw[i2];
|
|
7223
|
+
escapeSpecialCharacters && (next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), result += next, i2 < values.length && (result += values[i2]);
|
|
7224
|
+
}
|
|
7225
|
+
const lines = result.split(`
|
|
7226
|
+
`);
|
|
7227
|
+
let mindent = null;
|
|
7228
|
+
for (const l2 of lines) {
|
|
7229
|
+
const m2 = l2.match(/^(\s+)\S+/);
|
|
7230
|
+
if (m2) {
|
|
7231
|
+
const indent = m2[1].length;
|
|
7232
|
+
mindent ? mindent = Math.min(mindent, indent) : mindent = indent;
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7235
|
+
if (mindent !== null) {
|
|
7236
|
+
const m2 = mindent;
|
|
7237
|
+
result = lines.map((l2) => l2[0] === " " || l2[0] === " " ? l2.slice(m2) : l2).join(`
|
|
7238
|
+
`);
|
|
7239
|
+
}
|
|
7240
|
+
return result = result.trim(), escapeSpecialCharacters && (result = result.replace(/\\n/g, `
|
|
7241
|
+
`)), result;
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
/*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) */
|
|
7245
|
+
/*! *****************************************************************************
|
|
7246
|
+
Copyright (c) Microsoft Corporation.
|
|
7247
|
+
|
|
7248
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7249
|
+
purpose with or without fee is hereby granted.
|
|
7250
|
+
|
|
7251
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7252
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
7253
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
7254
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
7255
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
7256
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
7257
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
7258
|
+
***************************************************************************** */
|
|
7259
|
+
var __assign = function() {
|
|
7260
|
+
return __assign = Object.assign || function(t2) {
|
|
7261
|
+
for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
|
|
7262
|
+
s2 = arguments[i2];
|
|
7263
|
+
for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && (t2[p2] = s2[p2]);
|
|
7264
|
+
}
|
|
7265
|
+
return t2;
|
|
7266
|
+
}, __assign.apply(this, arguments);
|
|
7267
|
+
};
|
|
7268
|
+
function __rest(s2, e2) {
|
|
7269
|
+
var t2 = {};
|
|
7270
|
+
for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0 && (t2[p2] = s2[p2]);
|
|
7271
|
+
if (s2 != null && typeof Object.getOwnPropertySymbols == "function")
|
|
7272
|
+
for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++)
|
|
7273
|
+
e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]) && (t2[p2[i2]] = s2[p2[i2]]);
|
|
7274
|
+
return t2;
|
|
7275
|
+
}
|
|
7276
|
+
function __values(o2) {
|
|
7277
|
+
var s2 = typeof Symbol == "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0;
|
|
7278
|
+
if (m2) return m2.call(o2);
|
|
7279
|
+
if (o2 && typeof o2.length == "number") return {
|
|
7280
|
+
next: function() {
|
|
7281
|
+
return o2 && i2 >= o2.length && (o2 = void 0), { value: o2 && o2[i2++], done: !o2 };
|
|
7282
|
+
}
|
|
7283
|
+
};
|
|
7284
|
+
throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
7285
|
+
}
|
|
7286
|
+
function __read(o2, n2) {
|
|
7287
|
+
var m2 = typeof Symbol == "function" && o2[Symbol.iterator];
|
|
7288
|
+
if (!m2) return o2;
|
|
7289
|
+
var i2 = m2.call(o2), r2, ar = [], e2;
|
|
7290
|
+
try {
|
|
7291
|
+
for (; (n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done; ) ar.push(r2.value);
|
|
7292
|
+
} catch (error) {
|
|
7293
|
+
e2 = { error };
|
|
7294
|
+
} finally {
|
|
7295
|
+
try {
|
|
7296
|
+
r2 && !r2.done && (m2 = i2.return) && m2.call(i2);
|
|
7297
|
+
} finally {
|
|
7298
|
+
if (e2) throw e2.error;
|
|
7299
|
+
}
|
|
7300
|
+
}
|
|
7301
|
+
return ar;
|
|
7302
|
+
}
|
|
7303
|
+
var weirdNewlines = /(\u000D|\u000C|\u000D\u000A)/g, nullOrSurrogates = /[\u0000\uD800-\uDFFF]/g, commentRegex = /(\/\*)[\s\S]*?(\*\/)/g, lexicalAnalysis = function(str, index2) {
|
|
7304
|
+
index2 === void 0 && (index2 = 0), str = str.replace(weirdNewlines, `
|
|
7305
|
+
`).replace(nullOrSurrogates, "�"), str = str.replace(commentRegex, "");
|
|
7306
|
+
for (var tokens = []; index2 < str.length; index2 += 1) {
|
|
7307
|
+
var code = str.charCodeAt(index2);
|
|
7308
|
+
if (code === 9 || code === 32 || code === 10) {
|
|
7309
|
+
for (var code_1 = str.charCodeAt(++index2); code_1 === 9 || code_1 === 32 || code_1 === 10; )
|
|
7310
|
+
code_1 = str.charCodeAt(++index2);
|
|
7311
|
+
index2 -= 1, tokens.push({
|
|
7312
|
+
type: "<whitespace-token>"
|
|
7313
|
+
});
|
|
7314
|
+
} else if (code === 34) {
|
|
7315
|
+
var result = consumeString(str, index2);
|
|
7316
|
+
if (result === null)
|
|
7317
|
+
return null;
|
|
7318
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
7319
|
+
tokens.push({
|
|
7320
|
+
type: "<string-token>",
|
|
7321
|
+
value
|
|
7322
|
+
}), index2 = lastIndex;
|
|
7323
|
+
} else if (code === 35) {
|
|
7324
|
+
if (index2 + 1 < str.length) {
|
|
7325
|
+
var nextCode = str.charCodeAt(index2 + 1);
|
|
7326
|
+
if (nextCode === 95 || nextCode >= 65 && nextCode <= 90 || nextCode >= 97 && nextCode <= 122 || nextCode >= 128 || nextCode >= 48 && nextCode <= 57 || nextCode === 92 && index2 + 2 < str.length && str.charCodeAt(index2 + 2) !== 10) {
|
|
7327
|
+
var flag = wouldStartIdentifier(str, index2 + 1) ? "id" : "unrestricted", result = consumeIdentUnsafe(str, index2 + 1);
|
|
7328
|
+
if (result !== null) {
|
|
7329
|
+
var _b = __read(result, 2), lastIndex = _b[0], value = _b[1];
|
|
7330
|
+
tokens.push({
|
|
7331
|
+
type: "<hash-token>",
|
|
7332
|
+
value: value.toLowerCase(),
|
|
7333
|
+
flag
|
|
7334
|
+
}), index2 = lastIndex;
|
|
7335
|
+
continue;
|
|
7336
|
+
}
|
|
7337
|
+
}
|
|
7338
|
+
}
|
|
7339
|
+
tokens.push({
|
|
7340
|
+
type: "<delim-token>",
|
|
7341
|
+
value: code
|
|
7342
|
+
});
|
|
7343
|
+
} else if (code === 39) {
|
|
7344
|
+
var result = consumeString(str, index2);
|
|
7345
|
+
if (result === null)
|
|
7346
|
+
return null;
|
|
7347
|
+
var _c = __read(result, 2), lastIndex = _c[0], value = _c[1];
|
|
7348
|
+
tokens.push({
|
|
7349
|
+
type: "<string-token>",
|
|
7350
|
+
value
|
|
7351
|
+
}), index2 = lastIndex;
|
|
7352
|
+
} else if (code === 40)
|
|
7353
|
+
tokens.push({
|
|
7354
|
+
type: "<(-token>"
|
|
7355
|
+
});
|
|
7356
|
+
else if (code === 41)
|
|
7357
|
+
tokens.push({
|
|
7358
|
+
type: "<)-token>"
|
|
7359
|
+
});
|
|
7360
|
+
else if (code === 43) {
|
|
7361
|
+
var plusNumeric = consumeNumeric(str, index2);
|
|
7362
|
+
if (plusNumeric === null)
|
|
7363
|
+
tokens.push({
|
|
7364
|
+
type: "<delim-token>",
|
|
7365
|
+
value: code
|
|
7366
|
+
});
|
|
7367
|
+
else {
|
|
7368
|
+
var _d = __read(plusNumeric, 2), lastIndex = _d[0], tokenTuple = _d[1];
|
|
7369
|
+
tokenTuple[0] === "<dimension-token>" ? tokens.push({
|
|
7370
|
+
type: "<dimension-token>",
|
|
7371
|
+
value: tokenTuple[1],
|
|
7372
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
7373
|
+
flag: "number"
|
|
7374
|
+
}) : tokenTuple[0] === "<number-token>" ? tokens.push({
|
|
7375
|
+
type: tokenTuple[0],
|
|
7376
|
+
value: tokenTuple[1],
|
|
7377
|
+
flag: tokenTuple[2]
|
|
7378
|
+
}) : tokens.push({
|
|
7379
|
+
type: tokenTuple[0],
|
|
7380
|
+
value: tokenTuple[1],
|
|
7381
|
+
flag: "number"
|
|
7382
|
+
}), index2 = lastIndex;
|
|
7383
|
+
}
|
|
7384
|
+
} else if (code === 44)
|
|
7385
|
+
tokens.push({
|
|
7386
|
+
type: "<comma-token>"
|
|
7387
|
+
});
|
|
7388
|
+
else if (code === 45) {
|
|
7389
|
+
var minusNumeric = consumeNumeric(str, index2);
|
|
7390
|
+
if (minusNumeric !== null) {
|
|
7391
|
+
var _e = __read(minusNumeric, 2), lastIndex = _e[0], tokenTuple = _e[1];
|
|
7392
|
+
tokenTuple[0] === "<dimension-token>" ? tokens.push({
|
|
7393
|
+
type: "<dimension-token>",
|
|
7394
|
+
value: tokenTuple[1],
|
|
7395
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
7396
|
+
flag: "number"
|
|
7397
|
+
}) : tokenTuple[0] === "<number-token>" ? tokens.push({
|
|
7398
|
+
type: tokenTuple[0],
|
|
7399
|
+
value: tokenTuple[1],
|
|
7400
|
+
flag: tokenTuple[2]
|
|
7401
|
+
}) : tokens.push({
|
|
7402
|
+
type: tokenTuple[0],
|
|
7403
|
+
value: tokenTuple[1],
|
|
7404
|
+
flag: "number"
|
|
7405
|
+
}), index2 = lastIndex;
|
|
7406
|
+
continue;
|
|
7407
|
+
}
|
|
7408
|
+
if (index2 + 2 < str.length) {
|
|
7409
|
+
var nextCode = str.charCodeAt(index2 + 1), nextNextCode = str.charCodeAt(index2 + 2);
|
|
7410
|
+
if (nextCode === 45 && nextNextCode === 62) {
|
|
7411
|
+
tokens.push({
|
|
7412
|
+
type: "<CDC-token>"
|
|
7413
|
+
}), index2 += 2;
|
|
7414
|
+
continue;
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
var result = consumeIdentLike(str, index2);
|
|
7418
|
+
if (result !== null) {
|
|
7419
|
+
var _f = __read(result, 3), lastIndex = _f[0], value = _f[1], type = _f[2];
|
|
7420
|
+
tokens.push({
|
|
7421
|
+
type,
|
|
7422
|
+
value
|
|
7423
|
+
}), index2 = lastIndex;
|
|
7424
|
+
continue;
|
|
7425
|
+
}
|
|
7426
|
+
tokens.push({
|
|
7427
|
+
type: "<delim-token>",
|
|
7428
|
+
value: code
|
|
7429
|
+
});
|
|
7430
|
+
} else if (code === 46) {
|
|
7431
|
+
var minusNumeric = consumeNumeric(str, index2);
|
|
7432
|
+
if (minusNumeric === null)
|
|
7433
|
+
tokens.push({
|
|
7434
|
+
type: "<delim-token>",
|
|
7435
|
+
value: code
|
|
7436
|
+
});
|
|
7437
|
+
else {
|
|
7438
|
+
var _g = __read(minusNumeric, 2), lastIndex = _g[0], tokenTuple = _g[1];
|
|
7439
|
+
tokenTuple[0] === "<dimension-token>" ? tokens.push({
|
|
7440
|
+
type: "<dimension-token>",
|
|
7441
|
+
value: tokenTuple[1],
|
|
7442
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
7443
|
+
flag: "number"
|
|
7444
|
+
}) : tokenTuple[0] === "<number-token>" ? tokens.push({
|
|
7445
|
+
type: tokenTuple[0],
|
|
7446
|
+
value: tokenTuple[1],
|
|
7447
|
+
flag: tokenTuple[2]
|
|
7448
|
+
}) : tokens.push({
|
|
7449
|
+
type: tokenTuple[0],
|
|
7450
|
+
value: tokenTuple[1],
|
|
7451
|
+
flag: "number"
|
|
7452
|
+
}), index2 = lastIndex;
|
|
7453
|
+
continue;
|
|
7454
|
+
}
|
|
7455
|
+
} else if (code === 58)
|
|
7456
|
+
tokens.push({
|
|
7457
|
+
type: "<colon-token>"
|
|
7458
|
+
});
|
|
7459
|
+
else if (code === 59)
|
|
7460
|
+
tokens.push({
|
|
7461
|
+
type: "<semicolon-token>"
|
|
7462
|
+
});
|
|
7463
|
+
else if (code === 60) {
|
|
7464
|
+
if (index2 + 3 < str.length) {
|
|
7465
|
+
var nextCode = str.charCodeAt(index2 + 1), nextNextCode = str.charCodeAt(index2 + 2), nextNextNextCode = str.charCodeAt(index2 + 3);
|
|
7466
|
+
if (nextCode === 33 && nextNextCode === 45 && nextNextNextCode === 45) {
|
|
7467
|
+
tokens.push({
|
|
7468
|
+
type: "<CDO-token>"
|
|
7469
|
+
}), index2 += 3;
|
|
7470
|
+
continue;
|
|
7471
|
+
}
|
|
7472
|
+
}
|
|
7473
|
+
tokens.push({
|
|
7474
|
+
type: "<delim-token>",
|
|
7475
|
+
value: code
|
|
7476
|
+
});
|
|
7477
|
+
} else if (code === 64) {
|
|
7478
|
+
var result = consumeIdent(str, index2 + 1);
|
|
7479
|
+
if (result !== null) {
|
|
7480
|
+
var _h = __read(result, 2), lastIndex = _h[0], value = _h[1];
|
|
7481
|
+
tokens.push({
|
|
7482
|
+
type: "<at-keyword-token>",
|
|
7483
|
+
value: value.toLowerCase()
|
|
7484
|
+
}), index2 = lastIndex;
|
|
7485
|
+
continue;
|
|
7486
|
+
}
|
|
7487
|
+
tokens.push({
|
|
7488
|
+
type: "<delim-token>",
|
|
7489
|
+
value: code
|
|
7490
|
+
});
|
|
7491
|
+
} else if (code === 91)
|
|
7492
|
+
tokens.push({
|
|
7493
|
+
type: "<[-token>"
|
|
7494
|
+
});
|
|
7495
|
+
else if (code === 92) {
|
|
7496
|
+
var result = consumeEscape(str, index2);
|
|
7497
|
+
if (result === null)
|
|
7498
|
+
return null;
|
|
7499
|
+
var _j = __read(result, 2), lastIndex = _j[0], value = _j[1];
|
|
7500
|
+
str = str.slice(0, index2) + value + str.slice(lastIndex + 1), index2 -= 1;
|
|
7501
|
+
} else if (code === 93)
|
|
7502
|
+
tokens.push({
|
|
7503
|
+
type: "<]-token>"
|
|
7504
|
+
});
|
|
7505
|
+
else if (code === 123)
|
|
7506
|
+
tokens.push({
|
|
7507
|
+
type: "<{-token>"
|
|
7508
|
+
});
|
|
7509
|
+
else if (code === 125)
|
|
7510
|
+
tokens.push({
|
|
7511
|
+
type: "<}-token>"
|
|
7512
|
+
});
|
|
7513
|
+
else if (code >= 48 && code <= 57) {
|
|
7514
|
+
var result = consumeNumeric(str, index2), _k = __read(result, 2), lastIndex = _k[0], tokenTuple = _k[1];
|
|
7515
|
+
tokenTuple[0] === "<dimension-token>" ? tokens.push({
|
|
7516
|
+
type: "<dimension-token>",
|
|
7517
|
+
value: tokenTuple[1],
|
|
7518
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
7519
|
+
flag: "number"
|
|
7520
|
+
}) : tokenTuple[0] === "<number-token>" ? tokens.push({
|
|
7521
|
+
type: tokenTuple[0],
|
|
7522
|
+
value: tokenTuple[1],
|
|
7523
|
+
flag: tokenTuple[2]
|
|
7524
|
+
}) : tokens.push({
|
|
7525
|
+
type: tokenTuple[0],
|
|
7526
|
+
value: tokenTuple[1],
|
|
7527
|
+
flag: "number"
|
|
7528
|
+
}), index2 = lastIndex;
|
|
7529
|
+
} else if (code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128) {
|
|
7530
|
+
var result = consumeIdentLike(str, index2);
|
|
7531
|
+
if (result === null)
|
|
7532
|
+
return null;
|
|
7533
|
+
var _l = __read(result, 3), lastIndex = _l[0], value = _l[1], type = _l[2];
|
|
7534
|
+
tokens.push({
|
|
7535
|
+
type,
|
|
7536
|
+
value
|
|
7537
|
+
}), index2 = lastIndex;
|
|
7538
|
+
} else
|
|
7539
|
+
tokens.push({
|
|
7540
|
+
type: "<delim-token>",
|
|
7541
|
+
value: code
|
|
7542
|
+
});
|
|
7543
|
+
}
|
|
7544
|
+
return tokens.push({
|
|
7545
|
+
type: "<EOF-token>"
|
|
7546
|
+
}), tokens;
|
|
7547
|
+
}, consumeString = function(str, index2) {
|
|
7548
|
+
if (str.length <= index2 + 1) return null;
|
|
7549
|
+
for (var firstCode = str.charCodeAt(index2), charCodes = [], i2 = index2 + 1; i2 < str.length; i2 += 1) {
|
|
7550
|
+
var code = str.charCodeAt(i2);
|
|
7551
|
+
if (code === firstCode)
|
|
7552
|
+
return [i2, String.fromCharCode.apply(null, charCodes)];
|
|
7553
|
+
if (code === 92) {
|
|
7554
|
+
var result = consumeEscape(str, i2);
|
|
7555
|
+
if (result === null) return null;
|
|
7556
|
+
var _a = __read(result, 2), lastIndex = _a[0], charCode = _a[1];
|
|
7557
|
+
charCodes.push(charCode), i2 = lastIndex;
|
|
7558
|
+
} else {
|
|
7559
|
+
if (code === 10)
|
|
7560
|
+
return null;
|
|
7561
|
+
charCodes.push(code);
|
|
7562
|
+
}
|
|
7563
|
+
}
|
|
7564
|
+
return null;
|
|
7565
|
+
}, wouldStartIdentifier = function(str, index2) {
|
|
7566
|
+
if (str.length <= index2) return !1;
|
|
7567
|
+
var code = str.charCodeAt(index2);
|
|
7568
|
+
if (code === 45) {
|
|
7569
|
+
if (str.length <= index2 + 1) return !1;
|
|
7570
|
+
var nextCode = str.charCodeAt(index2 + 1);
|
|
7571
|
+
if (nextCode === 45 || nextCode === 95 || nextCode >= 65 && nextCode <= 90 || nextCode >= 97 && nextCode <= 122 || nextCode >= 128)
|
|
7572
|
+
return !0;
|
|
7573
|
+
if (nextCode === 92) {
|
|
7574
|
+
if (str.length <= index2 + 2) return !1;
|
|
7575
|
+
var nextNextCode = str.charCodeAt(index2 + 2);
|
|
7576
|
+
return nextNextCode !== 10;
|
|
7577
|
+
} else
|
|
7578
|
+
return !1;
|
|
7579
|
+
} else {
|
|
7580
|
+
if (code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128)
|
|
7581
|
+
return !0;
|
|
7582
|
+
if (code === 92) {
|
|
7583
|
+
if (str.length <= index2 + 1) return !1;
|
|
7584
|
+
var nextCode = str.charCodeAt(index2 + 1);
|
|
7585
|
+
return nextCode !== 10;
|
|
7586
|
+
} else
|
|
7587
|
+
return !1;
|
|
7588
|
+
}
|
|
7589
|
+
}, consumeEscape = function(str, index2) {
|
|
7590
|
+
if (str.length <= index2 + 1 || str.charCodeAt(index2) !== 92) return null;
|
|
7591
|
+
var code = str.charCodeAt(index2 + 1);
|
|
7592
|
+
if (code === 10)
|
|
7593
|
+
return null;
|
|
7594
|
+
if (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102) {
|
|
7595
|
+
for (var hexCharCodes = [code], min2 = Math.min(index2 + 7, str.length), i2 = index2 + 2; i2 < min2; i2 += 1) {
|
|
7596
|
+
var code_2 = str.charCodeAt(i2);
|
|
7597
|
+
if (code_2 >= 48 && code_2 <= 57 || code_2 >= 65 && code_2 <= 70 || code_2 >= 97 && code_2 <= 102)
|
|
7598
|
+
hexCharCodes.push(code_2);
|
|
7599
|
+
else
|
|
7600
|
+
break;
|
|
7601
|
+
}
|
|
7602
|
+
if (i2 < str.length) {
|
|
7603
|
+
var code_3 = str.charCodeAt(i2);
|
|
7604
|
+
(code_3 === 9 || code_3 === 32 || code_3 === 10) && (i2 += 1);
|
|
7605
|
+
}
|
|
7606
|
+
return [i2 - 1, parseInt(String.fromCharCode.apply(null, hexCharCodes), 16)];
|
|
7607
|
+
} else
|
|
7608
|
+
return [index2 + 1, code];
|
|
7609
|
+
}, consumeNumeric = function(str, index2) {
|
|
7610
|
+
var numberResult = consumeNumber(str, index2);
|
|
7611
|
+
if (numberResult === null) return null;
|
|
7612
|
+
var _a = __read(numberResult, 3), numberEndIndex = _a[0], numberValue = _a[1], numberFlag = _a[2], identResult = consumeIdent(str, numberEndIndex + 1);
|
|
7613
|
+
if (identResult !== null) {
|
|
7614
|
+
var _b = __read(identResult, 2), identEndIndex = _b[0], identValue = _b[1];
|
|
7615
|
+
return [identEndIndex, ["<dimension-token>", numberValue, identValue]];
|
|
7616
|
+
}
|
|
7617
|
+
return numberEndIndex + 1 < str.length && str.charCodeAt(numberEndIndex + 1) === 37 ? [numberEndIndex + 1, ["<percentage-token>", numberValue]] : [numberEndIndex, ["<number-token>", numberValue, numberFlag]];
|
|
7618
|
+
}, consumeNumber = function(str, index2) {
|
|
7619
|
+
if (str.length <= index2) return null;
|
|
7620
|
+
var flag = "integer", numberChars = [], firstCode = str.charCodeAt(index2);
|
|
7621
|
+
for ((firstCode === 43 || firstCode === 45) && (index2 += 1, firstCode === 45 && numberChars.push(45)); index2 < str.length; ) {
|
|
7622
|
+
var code = str.charCodeAt(index2);
|
|
7623
|
+
if (code >= 48 && code <= 57)
|
|
7624
|
+
numberChars.push(code), index2 += 1;
|
|
7625
|
+
else
|
|
7626
|
+
break;
|
|
7627
|
+
}
|
|
7628
|
+
if (index2 + 1 < str.length) {
|
|
7629
|
+
var nextCode = str.charCodeAt(index2), nextNextCode = str.charCodeAt(index2 + 1);
|
|
7630
|
+
if (nextCode === 46 && nextNextCode >= 48 && nextNextCode <= 57)
|
|
7631
|
+
for (numberChars.push(nextCode, nextNextCode), flag = "number", index2 += 2; index2 < str.length; ) {
|
|
7632
|
+
var code = str.charCodeAt(index2);
|
|
7633
|
+
if (code >= 48 && code <= 57)
|
|
7634
|
+
numberChars.push(code), index2 += 1;
|
|
7635
|
+
else
|
|
7636
|
+
break;
|
|
7637
|
+
}
|
|
7638
|
+
}
|
|
7639
|
+
if (index2 + 1 < str.length) {
|
|
7640
|
+
var nextCode = str.charCodeAt(index2), nextNextCode = str.charCodeAt(index2 + 1), nextNextNextCode = str.charCodeAt(index2 + 2);
|
|
7641
|
+
if (nextCode === 69 || nextCode === 101) {
|
|
7642
|
+
var nextNextIsDigit = nextNextCode >= 48 && nextNextCode <= 57;
|
|
7643
|
+
if (nextNextIsDigit || (nextNextCode === 43 || nextNextCode === 45) && nextNextNextCode >= 48 && nextNextNextCode <= 57)
|
|
7644
|
+
for (flag = "number", nextNextIsDigit ? (numberChars.push(69, nextNextCode), index2 += 2) : nextNextCode === 45 ? (numberChars.push(69, 45, nextNextNextCode), index2 += 3) : (numberChars.push(69, nextNextNextCode), index2 += 3); index2 < str.length; ) {
|
|
7645
|
+
var code = str.charCodeAt(index2);
|
|
7646
|
+
if (code >= 48 && code <= 57)
|
|
7647
|
+
numberChars.push(code), index2 += 1;
|
|
7648
|
+
else
|
|
7649
|
+
break;
|
|
7650
|
+
}
|
|
7651
|
+
}
|
|
7652
|
+
}
|
|
7653
|
+
var numberString = String.fromCharCode.apply(null, numberChars), value = flag === "number" ? parseFloat(numberString) : parseInt(numberString);
|
|
7654
|
+
return value === -0 && (value = 0), Number.isNaN(value) ? null : [index2 - 1, value, flag];
|
|
7655
|
+
}, consumeIdentUnsafe = function(str, index2) {
|
|
7656
|
+
if (str.length <= index2)
|
|
7657
|
+
return null;
|
|
7658
|
+
for (var identChars = [], code = str.charCodeAt(index2); index2 < str.length; code = str.charCodeAt(++index2)) {
|
|
7659
|
+
if (code === 45 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128 || code >= 48 && code <= 57) {
|
|
7660
|
+
identChars.push(code);
|
|
7661
|
+
continue;
|
|
7662
|
+
} else {
|
|
7663
|
+
var result = consumeEscape(str, index2);
|
|
7664
|
+
if (result !== null) {
|
|
7665
|
+
var _a = __read(result, 2), lastIndex = _a[0], code_4 = _a[1];
|
|
7666
|
+
identChars.push(code_4), index2 = lastIndex;
|
|
7667
|
+
continue;
|
|
7668
|
+
}
|
|
7669
|
+
}
|
|
7670
|
+
break;
|
|
7671
|
+
}
|
|
7672
|
+
return index2 === 0 ? null : [index2 - 1, String.fromCharCode.apply(null, identChars)];
|
|
7673
|
+
}, consumeIdent = function(str, index2) {
|
|
7674
|
+
if (str.length <= index2 || !wouldStartIdentifier(str, index2))
|
|
7675
|
+
return null;
|
|
7676
|
+
for (var identChars = [], code = str.charCodeAt(index2); index2 < str.length; code = str.charCodeAt(++index2)) {
|
|
7677
|
+
if (code === 45 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128 || code >= 48 && code <= 57) {
|
|
7678
|
+
identChars.push(code);
|
|
7679
|
+
continue;
|
|
7680
|
+
} else {
|
|
7681
|
+
var result = consumeEscape(str, index2);
|
|
7682
|
+
if (result !== null) {
|
|
7683
|
+
var _a = __read(result, 2), lastIndex = _a[0], code_5 = _a[1];
|
|
7684
|
+
identChars.push(code_5), index2 = lastIndex;
|
|
7685
|
+
continue;
|
|
7686
|
+
}
|
|
7687
|
+
}
|
|
7688
|
+
break;
|
|
7689
|
+
}
|
|
7690
|
+
return [index2 - 1, String.fromCharCode.apply(null, identChars)];
|
|
7691
|
+
}, consumeUrl = function(str, index2) {
|
|
7692
|
+
for (var code = str.charCodeAt(index2); code === 9 || code === 32 || code === 10; )
|
|
7693
|
+
code = str.charCodeAt(++index2);
|
|
7694
|
+
for (var urlChars = [], hasFinishedWord = !1; index2 < str.length; ) {
|
|
7695
|
+
if (code === 41)
|
|
7696
|
+
return [index2, String.fromCharCode.apply(null, urlChars)];
|
|
7697
|
+
if (code === 34 || code === 39 || code === 40)
|
|
7698
|
+
return null;
|
|
7699
|
+
if (code === 9 || code === 32 || code === 10)
|
|
7700
|
+
!hasFinishedWord && urlChars.length !== 0 && (hasFinishedWord = !0);
|
|
7701
|
+
else if (code === 92) {
|
|
7702
|
+
var result = consumeEscape(str, index2);
|
|
7703
|
+
if (result === null || hasFinishedWord) return null;
|
|
7704
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
7705
|
+
urlChars.push(value), index2 = lastIndex;
|
|
7706
|
+
} else {
|
|
7707
|
+
if (hasFinishedWord) return null;
|
|
7708
|
+
urlChars.push(code);
|
|
7709
|
+
}
|
|
7710
|
+
code = str.charCodeAt(++index2);
|
|
7711
|
+
}
|
|
7712
|
+
return null;
|
|
7713
|
+
}, consumeIdentLike = function(str, index2) {
|
|
7714
|
+
var result = consumeIdent(str, index2);
|
|
7715
|
+
if (result === null) return null;
|
|
7716
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
7717
|
+
if (value.toLowerCase() === "url") {
|
|
7718
|
+
if (str.length > lastIndex + 1) {
|
|
7719
|
+
var nextCode = str.charCodeAt(lastIndex + 1);
|
|
7720
|
+
if (nextCode === 40) {
|
|
7721
|
+
for (var offset = 2; lastIndex + offset < str.length; offset += 1) {
|
|
7722
|
+
var nextNextCode = str.charCodeAt(lastIndex + offset);
|
|
7723
|
+
if (nextNextCode === 34 || nextNextCode === 39)
|
|
7724
|
+
return [lastIndex + 1, value.toLowerCase(), "<function-token>"];
|
|
7725
|
+
if (nextNextCode !== 9 && nextNextCode !== 32 && nextNextCode !== 10) {
|
|
7726
|
+
var result_1 = consumeUrl(str, lastIndex + offset);
|
|
7727
|
+
if (result_1 === null) return null;
|
|
7728
|
+
var _b = __read(result_1, 2), lastUrlIndex = _b[0], value_1 = _b[1];
|
|
7729
|
+
return [lastUrlIndex, value_1, "<url-token>"];
|
|
7730
|
+
}
|
|
7731
|
+
}
|
|
7732
|
+
return [lastIndex + 1, value.toLowerCase(), "<function-token>"];
|
|
7733
|
+
}
|
|
7734
|
+
}
|
|
7735
|
+
} else if (str.length > lastIndex + 1) {
|
|
7736
|
+
var nextCode = str.charCodeAt(lastIndex + 1);
|
|
7737
|
+
if (nextCode === 40)
|
|
7738
|
+
return [lastIndex + 1, value.toLowerCase(), "<function-token>"];
|
|
7739
|
+
}
|
|
7740
|
+
return [lastIndex, value.toLowerCase(), "<ident-token>"];
|
|
7741
|
+
}, simplifyAST = function(ast) {
|
|
7742
|
+
for (var i2 = ast.length - 1; i2 >= 0; i2--)
|
|
7743
|
+
ast[i2] = simplifyMediaQuery(ast[i2]);
|
|
7744
|
+
return ast;
|
|
7745
|
+
}, simplifyMediaQuery = function(mediaQuery) {
|
|
7746
|
+
if (mediaQuery.mediaCondition === null) return mediaQuery;
|
|
7747
|
+
var mediaCondition = simplifyMediaCondition(mediaQuery.mediaCondition);
|
|
7748
|
+
return mediaCondition.operator === null && mediaCondition.children.length === 1 && "children" in mediaCondition.children[0] && (mediaCondition = mediaCondition.children[0]), {
|
|
7749
|
+
mediaPrefix: mediaQuery.mediaPrefix,
|
|
7750
|
+
mediaType: mediaQuery.mediaType,
|
|
7751
|
+
mediaCondition
|
|
7752
|
+
};
|
|
7753
|
+
}, simplifyMediaCondition = function simplifyMediaCondition2(mediaCondition) {
|
|
7754
|
+
for (var i2 = mediaCondition.children.length - 1; i2 >= 0; i2--) {
|
|
7755
|
+
var unsimplifiedChild = mediaCondition.children[i2];
|
|
7756
|
+
if (!("context" in unsimplifiedChild)) {
|
|
7757
|
+
var child = simplifyMediaCondition2(unsimplifiedChild);
|
|
7758
|
+
if (child.operator === null && child.children.length === 1)
|
|
7759
|
+
mediaCondition.children[i2] = child.children[0];
|
|
7760
|
+
else if (child.operator === mediaCondition.operator && (child.operator === "and" || child.operator === "or")) {
|
|
7761
|
+
for (var spliceArgs = [i2, 1], i_1 = 0; i_1 < child.children.length; i_1++)
|
|
7762
|
+
spliceArgs.push(child.children[i_1]);
|
|
7763
|
+
mediaCondition.children.splice.apply(mediaCondition.children, spliceArgs);
|
|
7764
|
+
}
|
|
7765
|
+
}
|
|
7766
|
+
}
|
|
7767
|
+
return mediaCondition;
|
|
7768
|
+
}, createError = function(message, err) {
|
|
7769
|
+
return err instanceof Error ? new Error("".concat(err.message.trim(), `
|
|
7770
|
+
`).concat(message.trim())) : new Error(message.trim());
|
|
7771
|
+
}, toAST = function(str) {
|
|
7772
|
+
return simplifyAST(toUnflattenedAST(str));
|
|
7773
|
+
}, toUnflattenedAST = function(str) {
|
|
7774
|
+
var tokenList = lexicalAnalysis(str.trim());
|
|
7775
|
+
if (tokenList === null)
|
|
7776
|
+
throw createError("Failed tokenizing");
|
|
7777
|
+
var startIndex = 0, endIndex = tokenList.length - 1;
|
|
7778
|
+
if (tokenList[0].type === "<at-keyword-token>" && tokenList[0].value === "media") {
|
|
7779
|
+
if (tokenList[1].type !== "<whitespace-token>")
|
|
7780
|
+
throw createError("Expected whitespace after media");
|
|
7781
|
+
startIndex = 2;
|
|
7782
|
+
for (var i2 = 2; i2 < tokenList.length - 1; i2++) {
|
|
7783
|
+
var token = tokenList[i2];
|
|
7784
|
+
if (token.type === "<{-token>") {
|
|
7785
|
+
endIndex = i2;
|
|
7786
|
+
break;
|
|
7787
|
+
} else if (token.type === "<semicolon-token>")
|
|
7788
|
+
throw createError("Expected '{' in media query but found ';'");
|
|
7789
|
+
}
|
|
7790
|
+
}
|
|
7791
|
+
return tokenList = tokenList.slice(startIndex, endIndex), syntacticAnalysis(tokenList);
|
|
7792
|
+
}, removeWhitespace = function(tokenList) {
|
|
7793
|
+
for (var newTokenList = [], before = !1, i2 = 0; i2 < tokenList.length; i2++)
|
|
7794
|
+
tokenList[i2].type === "<whitespace-token>" ? (before = !0, newTokenList.length > 0 && (newTokenList[newTokenList.length - 1].wsAfter = !0)) : (newTokenList.push(__assign(__assign({}, tokenList[i2]), {
|
|
7795
|
+
wsBefore: before,
|
|
7796
|
+
wsAfter: !1
|
|
7797
|
+
})), before = !1);
|
|
7798
|
+
return newTokenList;
|
|
7799
|
+
}, syntacticAnalysis = function(tokenList) {
|
|
7800
|
+
for (var e_1, _a, mediaQueryList = [[]], i2 = 0; i2 < tokenList.length; i2++) {
|
|
7801
|
+
var token = tokenList[i2];
|
|
7802
|
+
token.type === "<comma-token>" ? mediaQueryList.push([]) : mediaQueryList[mediaQueryList.length - 1].push(token);
|
|
7803
|
+
}
|
|
7804
|
+
var mediaQueries = mediaQueryList.map(removeWhitespace);
|
|
7805
|
+
if (mediaQueries.length === 1 && mediaQueries[0].length === 0)
|
|
7806
|
+
return [{
|
|
7807
|
+
mediaCondition: null,
|
|
7808
|
+
mediaPrefix: null,
|
|
7809
|
+
mediaType: "all"
|
|
7810
|
+
}];
|
|
7811
|
+
var mediaQueryTokens = mediaQueries.map(function(mediaQueryTokens2) {
|
|
7812
|
+
return mediaQueryTokens2.length === 0 ? null : tokenizeMediaQuery(mediaQueryTokens2);
|
|
7813
|
+
}), nonNullMediaQueryTokens = [];
|
|
7814
|
+
try {
|
|
7815
|
+
for (var mediaQueryTokens_1 = __values(mediaQueryTokens), mediaQueryTokens_1_1 = mediaQueryTokens_1.next(); !mediaQueryTokens_1_1.done; mediaQueryTokens_1_1 = mediaQueryTokens_1.next()) {
|
|
7816
|
+
var mediaQueryToken = mediaQueryTokens_1_1.value;
|
|
7817
|
+
mediaQueryToken !== null && nonNullMediaQueryTokens.push(mediaQueryToken);
|
|
7818
|
+
}
|
|
7819
|
+
} catch (e_1_1) {
|
|
7820
|
+
e_1 = {
|
|
7821
|
+
error: e_1_1
|
|
7822
|
+
};
|
|
7823
|
+
} finally {
|
|
7824
|
+
try {
|
|
7825
|
+
mediaQueryTokens_1_1 && !mediaQueryTokens_1_1.done && (_a = mediaQueryTokens_1.return) && _a.call(mediaQueryTokens_1);
|
|
7826
|
+
} finally {
|
|
7827
|
+
if (e_1) throw e_1.error;
|
|
7828
|
+
}
|
|
7829
|
+
}
|
|
7830
|
+
if (nonNullMediaQueryTokens.length === 0)
|
|
7831
|
+
throw createError("No valid media queries");
|
|
7832
|
+
return nonNullMediaQueryTokens;
|
|
7833
|
+
}, tokenizeMediaQuery = function(tokens) {
|
|
7834
|
+
var firstToken = tokens[0];
|
|
7835
|
+
if (firstToken.type === "<(-token>")
|
|
7836
|
+
try {
|
|
7837
|
+
return {
|
|
7838
|
+
mediaPrefix: null,
|
|
7839
|
+
mediaType: "all",
|
|
7840
|
+
mediaCondition: tokenizeMediaCondition(tokens, !0)
|
|
7841
|
+
};
|
|
7842
|
+
} catch (err) {
|
|
7843
|
+
throw createError("Expected media condition after '('", err);
|
|
7844
|
+
}
|
|
7845
|
+
else if (firstToken.type === "<ident-token>") {
|
|
7846
|
+
var mediaPrefix = null, mediaType = void 0, value = firstToken.value;
|
|
7847
|
+
(value === "only" || value === "not") && (mediaPrefix = value);
|
|
7848
|
+
var firstIndex = mediaPrefix === null ? 0 : 1;
|
|
7849
|
+
if (tokens.length <= firstIndex)
|
|
7850
|
+
throw createError("Expected extra token in media query");
|
|
7851
|
+
var firstNonUnaryToken = tokens[firstIndex];
|
|
7852
|
+
if (firstNonUnaryToken.type === "<ident-token>") {
|
|
7853
|
+
var value_1 = firstNonUnaryToken.value;
|
|
7854
|
+
if (value_1 === "all")
|
|
7855
|
+
mediaType = "all";
|
|
7856
|
+
else if (value_1 === "print" || value_1 === "screen")
|
|
7857
|
+
mediaType = value_1;
|
|
7858
|
+
else if (value_1 === "tty" || value_1 === "tv" || value_1 === "projection" || value_1 === "handheld" || value_1 === "braille" || value_1 === "embossed" || value_1 === "aural" || value_1 === "speech")
|
|
7859
|
+
mediaPrefix = mediaPrefix === "not" ? null : "not", mediaType = "all";
|
|
7860
|
+
else
|
|
7861
|
+
throw createError("Unknown ident '".concat(value_1, "' in media query"));
|
|
7862
|
+
} else if (mediaPrefix === "not" && firstNonUnaryToken.type === "<(-token>") {
|
|
7863
|
+
var tokensWithParens = [{
|
|
7864
|
+
type: "<(-token>",
|
|
7865
|
+
wsBefore: !1,
|
|
7866
|
+
wsAfter: !1
|
|
7867
|
+
}];
|
|
7868
|
+
tokensWithParens.push.apply(tokensWithParens, tokens), tokensWithParens.push({
|
|
7869
|
+
type: "<)-token>",
|
|
7870
|
+
wsBefore: !1,
|
|
7871
|
+
wsAfter: !1
|
|
7872
|
+
});
|
|
7873
|
+
try {
|
|
7874
|
+
return {
|
|
7875
|
+
mediaPrefix: null,
|
|
7876
|
+
mediaType: "all",
|
|
7877
|
+
mediaCondition: tokenizeMediaCondition(tokensWithParens, !0)
|
|
7878
|
+
};
|
|
7879
|
+
} catch (err) {
|
|
7880
|
+
throw createError("Expected media condition after '('", err);
|
|
7881
|
+
}
|
|
7882
|
+
} else
|
|
7883
|
+
throw createError("Invalid media query");
|
|
7884
|
+
if (firstIndex + 1 === tokens.length)
|
|
7885
|
+
return {
|
|
7886
|
+
mediaPrefix,
|
|
7887
|
+
mediaType,
|
|
7888
|
+
mediaCondition: null
|
|
7889
|
+
};
|
|
7890
|
+
if (firstIndex + 4 < tokens.length) {
|
|
7891
|
+
var secondNonUnaryToken = tokens[firstIndex + 1];
|
|
7892
|
+
if (secondNonUnaryToken.type === "<ident-token>" && secondNonUnaryToken.value === "and")
|
|
7893
|
+
try {
|
|
7894
|
+
return {
|
|
7895
|
+
mediaPrefix,
|
|
7896
|
+
mediaType,
|
|
7897
|
+
mediaCondition: tokenizeMediaCondition(tokens.slice(firstIndex + 2), !1)
|
|
7898
|
+
};
|
|
7899
|
+
} catch (err) {
|
|
7900
|
+
throw createError("Expected media condition after 'and'", err);
|
|
7901
|
+
}
|
|
7902
|
+
else
|
|
7903
|
+
throw createError("Expected 'and' after media prefix");
|
|
7904
|
+
} else
|
|
7905
|
+
throw createError("Expected media condition after media prefix");
|
|
7906
|
+
} else
|
|
7907
|
+
throw createError("Expected media condition or media prefix");
|
|
7908
|
+
}, tokenizeMediaCondition = function tokenizeMediaCondition2(tokens, mayContainOr, previousOperator) {
|
|
7909
|
+
if (previousOperator === void 0 && (previousOperator = null), tokens.length < 3 || tokens[0].type !== "<(-token>" || tokens[tokens.length - 1].type !== "<)-token>")
|
|
7910
|
+
throw new Error("Invalid media condition");
|
|
7911
|
+
for (var endIndexOfFirstFeature = tokens.length - 1, maxDepth = 0, count = 0, i2 = 0; i2 < tokens.length; i2++) {
|
|
7912
|
+
var token = tokens[i2];
|
|
7913
|
+
if (token.type === "<(-token>" ? (count += 1, maxDepth = Math.max(maxDepth, count)) : token.type === "<)-token>" && (count -= 1), count === 0) {
|
|
7914
|
+
endIndexOfFirstFeature = i2;
|
|
7915
|
+
break;
|
|
7916
|
+
}
|
|
7917
|
+
}
|
|
7918
|
+
if (count !== 0)
|
|
7919
|
+
throw new Error(`Mismatched parens
|
|
7920
|
+
Invalid media condition`);
|
|
7921
|
+
var child, featureTokens = tokens.slice(0, endIndexOfFirstFeature + 1);
|
|
7922
|
+
if (maxDepth === 1 ? child = tokenizeMediaFeature(featureTokens) : featureTokens[1].type === "<ident-token>" && featureTokens[1].value === "not" ? child = tokenizeMediaCondition2(featureTokens.slice(2, -1), !0, "not") : child = tokenizeMediaCondition2(featureTokens.slice(1, -1), !0), endIndexOfFirstFeature === tokens.length - 1)
|
|
7923
|
+
return {
|
|
7924
|
+
operator: previousOperator,
|
|
7925
|
+
children: [child]
|
|
7926
|
+
};
|
|
7927
|
+
var nextToken = tokens[endIndexOfFirstFeature + 1];
|
|
7928
|
+
if (nextToken.type !== "<ident-token>")
|
|
7929
|
+
throw new Error(`Invalid operator
|
|
7930
|
+
Invalid media condition`);
|
|
7931
|
+
if (previousOperator !== null && previousOperator !== nextToken.value)
|
|
7932
|
+
throw new Error("'".concat(nextToken.value, "' and '").concat(previousOperator, `' must not be at same level
|
|
7933
|
+
Invalid media condition`));
|
|
7934
|
+
if (nextToken.value === "or" && !mayContainOr)
|
|
7935
|
+
throw new Error(`Cannot use 'or' at top level of a media query
|
|
7936
|
+
Invalid media condition`);
|
|
7937
|
+
if (nextToken.value !== "and" && nextToken.value !== "or")
|
|
7938
|
+
throw new Error("Invalid operator: '".concat(nextToken.value, `'
|
|
7939
|
+
Invalid media condition`));
|
|
7940
|
+
var siblings = tokenizeMediaCondition2(tokens.slice(endIndexOfFirstFeature + 2), mayContainOr, nextToken.value);
|
|
7941
|
+
return {
|
|
7942
|
+
operator: nextToken.value,
|
|
7943
|
+
children: [child].concat(siblings.children)
|
|
7944
|
+
};
|
|
7945
|
+
}, tokenizeMediaFeature = function(rawTokens) {
|
|
7946
|
+
if (rawTokens.length < 3 || rawTokens[0].type !== "<(-token>" || rawTokens[rawTokens.length - 1].type !== "<)-token>")
|
|
7947
|
+
throw new Error("Invalid media feature");
|
|
7948
|
+
for (var tokens = [rawTokens[0]], i2 = 1; i2 < rawTokens.length; i2++) {
|
|
7949
|
+
if (i2 < rawTokens.length - 2) {
|
|
7950
|
+
var a2 = rawTokens[i2], b2 = rawTokens[i2 + 1], c = rawTokens[i2 + 2];
|
|
7951
|
+
if (a2.type === "<number-token>" && a2.value > 0 && b2.type === "<delim-token>" && b2.value === 47 && c.type === "<number-token>" && c.value > 0) {
|
|
7952
|
+
tokens.push({
|
|
7953
|
+
type: "<ratio-token>",
|
|
7954
|
+
numerator: a2.value,
|
|
7955
|
+
denominator: c.value,
|
|
7956
|
+
wsBefore: a2.wsBefore,
|
|
7957
|
+
wsAfter: c.wsAfter
|
|
7958
|
+
}), i2 += 2;
|
|
7959
|
+
continue;
|
|
7960
|
+
}
|
|
7961
|
+
}
|
|
7962
|
+
tokens.push(rawTokens[i2]);
|
|
7963
|
+
}
|
|
7964
|
+
var nextToken = tokens[1];
|
|
7965
|
+
if (nextToken.type === "<ident-token>" && tokens.length === 3)
|
|
7966
|
+
return {
|
|
7967
|
+
context: "boolean",
|
|
7968
|
+
feature: nextToken.value
|
|
7969
|
+
};
|
|
7970
|
+
if (tokens.length === 5 && tokens[1].type === "<ident-token>" && tokens[2].type === "<colon-token>") {
|
|
7971
|
+
var valueToken = tokens[3];
|
|
7972
|
+
if (valueToken.type === "<number-token>" || valueToken.type === "<dimension-token>" || valueToken.type === "<ratio-token>" || valueToken.type === "<ident-token>") {
|
|
7973
|
+
var feature = tokens[1].value, prefix = null, slice = feature.slice(0, 4);
|
|
7974
|
+
slice === "min-" ? (prefix = "min", feature = feature.slice(4)) : slice === "max-" && (prefix = "max", feature = feature.slice(4)), valueToken.wsBefore, valueToken.wsAfter;
|
|
7975
|
+
var value = __rest(valueToken, ["wsBefore", "wsAfter"]);
|
|
7976
|
+
return {
|
|
7977
|
+
context: "value",
|
|
7978
|
+
prefix,
|
|
7979
|
+
feature,
|
|
7980
|
+
value
|
|
7981
|
+
};
|
|
7982
|
+
}
|
|
7983
|
+
} else if (tokens.length >= 5)
|
|
7984
|
+
try {
|
|
7985
|
+
var range = tokenizeRange(tokens);
|
|
7986
|
+
return {
|
|
7987
|
+
context: "range",
|
|
7988
|
+
feature: range.featureName,
|
|
7989
|
+
range
|
|
7990
|
+
};
|
|
7991
|
+
} catch (err) {
|
|
7992
|
+
throw createError("Invalid media feature", err);
|
|
7993
|
+
}
|
|
7994
|
+
throw new Error("Invalid media feature");
|
|
7995
|
+
}, tokenizeRange = function(tokens) {
|
|
7996
|
+
var _a, _b, _c, _d;
|
|
7997
|
+
if (tokens.length < 5 || tokens[0].type !== "<(-token>" || tokens[tokens.length - 1].type !== "<)-token>")
|
|
7998
|
+
throw new Error("Invalid range");
|
|
7999
|
+
var range = {
|
|
8000
|
+
leftToken: null,
|
|
8001
|
+
leftOp: null,
|
|
8002
|
+
featureName: "",
|
|
8003
|
+
rightOp: null,
|
|
8004
|
+
rightToken: null
|
|
8005
|
+
}, hasLeft = tokens[1].type === "<number-token>" || tokens[1].type === "<dimension-token>" || tokens[1].type === "<ratio-token>" || tokens[1].type === "<ident-token>" && tokens[1].value === "infinite";
|
|
8006
|
+
if (tokens[2].type === "<delim-token>") {
|
|
8007
|
+
if (tokens[2].value === 60)
|
|
8008
|
+
tokens[3].type === "<delim-token>" && tokens[3].value === 61 && !tokens[3].wsBefore ? range[hasLeft ? "leftOp" : "rightOp"] = "<=" : range[hasLeft ? "leftOp" : "rightOp"] = "<";
|
|
8009
|
+
else if (tokens[2].value === 62)
|
|
8010
|
+
tokens[3].type === "<delim-token>" && tokens[3].value === 61 && !tokens[3].wsBefore ? range[hasLeft ? "leftOp" : "rightOp"] = ">=" : range[hasLeft ? "leftOp" : "rightOp"] = ">";
|
|
8011
|
+
else if (tokens[2].value === 61)
|
|
8012
|
+
range[hasLeft ? "leftOp" : "rightOp"] = "=";
|
|
8013
|
+
else
|
|
8014
|
+
throw new Error("Invalid range");
|
|
8015
|
+
if (hasLeft)
|
|
8016
|
+
range.leftToken = tokens[1];
|
|
8017
|
+
else if (tokens[1].type === "<ident-token>")
|
|
8018
|
+
range.featureName = tokens[1].value;
|
|
8019
|
+
else
|
|
8020
|
+
throw new Error("Invalid range");
|
|
8021
|
+
var tokenIndexAfterFirstOp = 2 + ((_b = (_a = range[hasLeft ? "leftOp" : "rightOp"]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0), tokenAfterFirstOp = tokens[tokenIndexAfterFirstOp];
|
|
8022
|
+
if (hasLeft)
|
|
8023
|
+
if (tokenAfterFirstOp.type === "<ident-token>") {
|
|
8024
|
+
if (range.featureName = tokenAfterFirstOp.value, tokens.length >= 7) {
|
|
8025
|
+
var secondOpToken = tokens[tokenIndexAfterFirstOp + 1], followingToken = tokens[tokenIndexAfterFirstOp + 2];
|
|
8026
|
+
if (secondOpToken.type === "<delim-token>") {
|
|
8027
|
+
var charCode = secondOpToken.value;
|
|
8028
|
+
if (charCode === 60)
|
|
8029
|
+
followingToken.type === "<delim-token>" && followingToken.value === 61 && !followingToken.wsBefore ? range.rightOp = "<=" : range.rightOp = "<";
|
|
8030
|
+
else if (charCode === 62)
|
|
8031
|
+
followingToken.type === "<delim-token>" && followingToken.value === 61 && !followingToken.wsBefore ? range.rightOp = ">=" : range.rightOp = ">";
|
|
8032
|
+
else
|
|
8033
|
+
throw new Error("Invalid range");
|
|
8034
|
+
var tokenAfterSecondOp = tokens[tokenIndexAfterFirstOp + 1 + ((_d = (_c = range.rightOp) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0)];
|
|
8035
|
+
range.rightToken = tokenAfterSecondOp;
|
|
8036
|
+
} else
|
|
8037
|
+
throw new Error("Invalid range");
|
|
8038
|
+
} else if (tokenIndexAfterFirstOp + 2 !== tokens.length)
|
|
8039
|
+
throw new Error("Invalid range");
|
|
8040
|
+
} else
|
|
8041
|
+
throw new Error("Invalid range");
|
|
8042
|
+
else
|
|
8043
|
+
range.rightToken = tokenAfterFirstOp;
|
|
8044
|
+
var validRange = null, lt = range.leftToken, leftOp = range.leftOp, featureName = range.featureName, rightOp = range.rightOp, rt = range.rightToken, leftToken = null;
|
|
8045
|
+
if (lt !== null) {
|
|
8046
|
+
if (lt.type === "<ident-token>") {
|
|
8047
|
+
var type = lt.type, value = lt.value;
|
|
8048
|
+
value === "infinite" && (leftToken = {
|
|
8049
|
+
type,
|
|
8050
|
+
value
|
|
8051
|
+
});
|
|
8052
|
+
} else if (lt.type === "<number-token>" || lt.type === "<dimension-token>" || lt.type === "<ratio-token>") {
|
|
8053
|
+
lt.wsBefore, lt.wsAfter;
|
|
8054
|
+
var ltNoWS = __rest(lt, ["wsBefore", "wsAfter"]);
|
|
8055
|
+
leftToken = ltNoWS;
|
|
8056
|
+
}
|
|
8057
|
+
}
|
|
8058
|
+
var rightToken = null;
|
|
8059
|
+
if (rt !== null) {
|
|
8060
|
+
if (rt.type === "<ident-token>") {
|
|
8061
|
+
var type = rt.type, value = rt.value;
|
|
8062
|
+
value === "infinite" && (rightToken = {
|
|
8063
|
+
type,
|
|
8064
|
+
value
|
|
8065
|
+
});
|
|
8066
|
+
} else if (rt.type === "<number-token>" || rt.type === "<dimension-token>" || rt.type === "<ratio-token>") {
|
|
8067
|
+
rt.wsBefore, rt.wsAfter;
|
|
8068
|
+
var rtNoWS = __rest(rt, ["wsBefore", "wsAfter"]);
|
|
8069
|
+
rightToken = rtNoWS;
|
|
8070
|
+
}
|
|
8071
|
+
}
|
|
8072
|
+
if (leftToken !== null && rightToken !== null)
|
|
8073
|
+
if ((leftOp === "<" || leftOp === "<=") && (rightOp === "<" || rightOp === "<="))
|
|
8074
|
+
validRange = {
|
|
8075
|
+
leftToken,
|
|
8076
|
+
leftOp,
|
|
8077
|
+
featureName,
|
|
8078
|
+
rightOp,
|
|
8079
|
+
rightToken
|
|
8080
|
+
};
|
|
8081
|
+
else if ((leftOp === ">" || leftOp === ">=") && (rightOp === ">" || rightOp === ">="))
|
|
8082
|
+
validRange = {
|
|
8083
|
+
leftToken,
|
|
8084
|
+
leftOp,
|
|
8085
|
+
featureName,
|
|
8086
|
+
rightOp,
|
|
8087
|
+
rightToken
|
|
8088
|
+
};
|
|
8089
|
+
else
|
|
8090
|
+
throw new Error("Invalid range");
|
|
8091
|
+
else leftToken === null && leftOp === null && rightOp !== null && rightToken !== null ? validRange = {
|
|
8092
|
+
leftToken,
|
|
8093
|
+
leftOp,
|
|
8094
|
+
featureName,
|
|
8095
|
+
rightOp,
|
|
8096
|
+
rightToken
|
|
8097
|
+
} : leftToken !== null && leftOp !== null && rightOp === null && rightToken === null && (validRange = {
|
|
8098
|
+
leftToken,
|
|
8099
|
+
leftOp,
|
|
8100
|
+
featureName,
|
|
8101
|
+
rightOp,
|
|
8102
|
+
rightToken
|
|
8103
|
+
});
|
|
8104
|
+
return validRange;
|
|
8105
|
+
} else
|
|
8106
|
+
throw new Error("Invalid range");
|
|
8107
|
+
};
|
|
8108
|
+
function toPrimitive(t2, r2) {
|
|
8109
|
+
if (typeof t2 != "object" || !t2) return t2;
|
|
8110
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
8111
|
+
if (e2 !== void 0) {
|
|
8112
|
+
var i2 = e2.call(t2, r2);
|
|
8113
|
+
if (typeof i2 != "object") return i2;
|
|
8114
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
8115
|
+
}
|
|
8116
|
+
return String(t2);
|
|
8117
|
+
}
|
|
8118
|
+
function toPropertyKey(t2) {
|
|
8119
|
+
var i2 = toPrimitive(t2, "string");
|
|
8120
|
+
return typeof i2 == "symbol" ? i2 : String(i2);
|
|
8121
|
+
}
|
|
8122
|
+
function _defineProperty(obj, key, value) {
|
|
8123
|
+
return key = toPropertyKey(key), key in obj ? Object.defineProperty(obj, key, {
|
|
8124
|
+
value,
|
|
8125
|
+
enumerable: !0,
|
|
8126
|
+
configurable: !0,
|
|
8127
|
+
writable: !0
|
|
8128
|
+
}) : obj[key] = value, obj;
|
|
8129
|
+
}
|
|
8130
|
+
function ownKeys(e2, r2) {
|
|
8131
|
+
var t2 = Object.keys(e2);
|
|
8132
|
+
if (Object.getOwnPropertySymbols) {
|
|
8133
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
8134
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
8135
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
8136
|
+
})), t2.push.apply(t2, o2);
|
|
8137
|
+
}
|
|
8138
|
+
return t2;
|
|
8139
|
+
}
|
|
8140
|
+
function _objectSpread2(e2) {
|
|
8141
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
8142
|
+
var t2 = arguments[r2] != null ? arguments[r2] : {};
|
|
8143
|
+
r2 % 2 ? ownKeys(Object(t2), !0).forEach(function(r3) {
|
|
8144
|
+
_defineProperty(e2, r3, t2[r3]);
|
|
8145
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
8146
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
8147
|
+
});
|
|
8148
|
+
}
|
|
8149
|
+
return e2;
|
|
8150
|
+
}
|
|
8151
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8152
|
+
if (source == null) return {};
|
|
8153
|
+
var target = {}, sourceKeys = Object.keys(source), key, i2;
|
|
8154
|
+
for (i2 = 0; i2 < sourceKeys.length; i2++)
|
|
8155
|
+
key = sourceKeys[i2], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
8156
|
+
return target;
|
|
8157
|
+
}
|
|
8158
|
+
function _objectWithoutProperties(source, excluded) {
|
|
8159
|
+
if (source == null) return {};
|
|
8160
|
+
var target = _objectWithoutPropertiesLoose(source, excluded), key, i2;
|
|
8161
|
+
if (Object.getOwnPropertySymbols) {
|
|
8162
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
8163
|
+
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++)
|
|
8164
|
+
key = sourceSymbolKeys[i2], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
8165
|
+
}
|
|
8166
|
+
return target;
|
|
8167
|
+
}
|
|
8168
|
+
function forEach(obj, fn) {
|
|
8169
|
+
for (var _key in obj)
|
|
8170
|
+
fn(obj[_key], _key);
|
|
8171
|
+
}
|
|
8172
|
+
function omit(obj, omitKeys) {
|
|
8173
|
+
var result = {};
|
|
8174
|
+
for (var _key2 in obj)
|
|
8175
|
+
omitKeys.indexOf(_key2) === -1 && (result[_key2] = obj[_key2]);
|
|
8176
|
+
return result;
|
|
8177
|
+
}
|
|
8178
|
+
function mapKeys(obj, fn) {
|
|
8179
|
+
var result = {};
|
|
8180
|
+
for (var _key3 in obj)
|
|
8181
|
+
result[fn(obj[_key3], _key3)] = obj[_key3];
|
|
8182
|
+
return result;
|
|
8183
|
+
}
|
|
8184
|
+
var _templateObject$1;
|
|
8185
|
+
function escapeRegex(string) {
|
|
8186
|
+
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
8187
|
+
}
|
|
8188
|
+
var validateSelector = (selector2, targetClassName) => {
|
|
8189
|
+
var replaceTarget = () => {
|
|
8190
|
+
var targetRegex = new RegExp(".".concat(escapeRegex(cssesc$1(targetClassName, {
|
|
8191
|
+
isIdentifier: !0
|
|
8192
|
+
}))), "g");
|
|
8193
|
+
return selector2.replace(targetRegex, "&");
|
|
8194
|
+
}, selectorParts;
|
|
8195
|
+
try {
|
|
8196
|
+
selectorParts = parse(selector2);
|
|
8197
|
+
} catch {
|
|
8198
|
+
throw new Error("Invalid selector: ".concat(replaceTarget()));
|
|
8199
|
+
}
|
|
8200
|
+
selectorParts.forEach((tokens) => {
|
|
8201
|
+
try {
|
|
8202
|
+
for (var i2 = tokens.length - 1; i2 >= -1; i2--) {
|
|
8203
|
+
if (!tokens[i2])
|
|
8204
|
+
throw new Error();
|
|
8205
|
+
var token = tokens[i2];
|
|
8206
|
+
if (token.type === "child" || token.type === "parent" || token.type === "sibling" || token.type === "adjacent" || token.type === "descendant")
|
|
8207
|
+
throw new Error();
|
|
8208
|
+
if (token.type === "attribute" && token.name === "class" && token.value === targetClassName)
|
|
8209
|
+
return;
|
|
8210
|
+
}
|
|
8211
|
+
} catch {
|
|
8212
|
+
throw new Error(dedent(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral([`
|
|
8213
|
+
Invalid selector: `, `
|
|
8214
|
+
|
|
8215
|
+
Style selectors must target the '&' character (along with any modifiers), e.g. `, " or ", `.
|
|
8216
|
+
|
|
8217
|
+
This is to ensure that each style block only affects the styling of a single class.
|
|
8218
|
+
|
|
8219
|
+
If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `, ") to 'parent', you should add ", ` to 'child').
|
|
8220
|
+
|
|
8221
|
+
If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `, ", you should instead write 'globalStyle(", `, { ... })'
|
|
8222
|
+
`])), replaceTarget(), "`${parent} &`", "`${parent} &:hover`", "`& ${child}`", "`${parent} &`", "`& h1`", "`${parent} h1`"));
|
|
8223
|
+
}
|
|
8224
|
+
});
|
|
8225
|
+
};
|
|
8226
|
+
class ConditionalRuleset {
|
|
8227
|
+
/**
|
|
8228
|
+
* Stores information about where conditions must be in relation to other conditions
|
|
8229
|
+
*
|
|
8230
|
+
* e.g. mobile -> tablet, desktop
|
|
8231
|
+
*/
|
|
8232
|
+
constructor() {
|
|
8233
|
+
this.ruleset = /* @__PURE__ */ new Map(), this.precedenceLookup = /* @__PURE__ */ new Map();
|
|
8234
|
+
}
|
|
8235
|
+
findOrCreateCondition(conditionQuery) {
|
|
8236
|
+
var targetCondition = this.ruleset.get(conditionQuery);
|
|
8237
|
+
return targetCondition || (targetCondition = {
|
|
8238
|
+
query: conditionQuery,
|
|
8239
|
+
rules: [],
|
|
8240
|
+
children: new ConditionalRuleset()
|
|
8241
|
+
}, this.ruleset.set(conditionQuery, targetCondition)), targetCondition;
|
|
8242
|
+
}
|
|
8243
|
+
getConditionalRulesetByPath(conditionPath) {
|
|
8244
|
+
var currRuleset = this;
|
|
8245
|
+
for (var query of conditionPath) {
|
|
8246
|
+
var condition = currRuleset.findOrCreateCondition(query);
|
|
8247
|
+
currRuleset = condition.children;
|
|
8248
|
+
}
|
|
8249
|
+
return currRuleset;
|
|
8250
|
+
}
|
|
8251
|
+
addRule(rule, conditionQuery, conditionPath) {
|
|
8252
|
+
var ruleset = this.getConditionalRulesetByPath(conditionPath), targetCondition = ruleset.findOrCreateCondition(conditionQuery);
|
|
8253
|
+
if (!targetCondition)
|
|
8254
|
+
throw new Error("Failed to add conditional rule");
|
|
8255
|
+
targetCondition.rules.push(rule);
|
|
8256
|
+
}
|
|
8257
|
+
addConditionPrecedence(conditionPath, conditionOrder) {
|
|
8258
|
+
for (var ruleset = this.getConditionalRulesetByPath(conditionPath), i2 = 0; i2 < conditionOrder.length; i2++) {
|
|
8259
|
+
var _ruleset$precedenceLo, query = conditionOrder[i2], conditionPrecedence = (_ruleset$precedenceLo = ruleset.precedenceLookup.get(query)) !== null && _ruleset$precedenceLo !== void 0 ? _ruleset$precedenceLo : /* @__PURE__ */ new Set();
|
|
8260
|
+
for (var lowerPrecedenceCondition of conditionOrder.slice(i2 + 1))
|
|
8261
|
+
conditionPrecedence.add(lowerPrecedenceCondition);
|
|
8262
|
+
ruleset.precedenceLookup.set(query, conditionPrecedence);
|
|
8263
|
+
}
|
|
8264
|
+
}
|
|
8265
|
+
isCompatible(incomingRuleset) {
|
|
8266
|
+
for (var [condition, orderPrecedence] of this.precedenceLookup.entries())
|
|
8267
|
+
for (var lowerPrecedenceCondition of orderPrecedence) {
|
|
8268
|
+
var _incomingRuleset$prec;
|
|
8269
|
+
if ((_incomingRuleset$prec = incomingRuleset.precedenceLookup.get(lowerPrecedenceCondition)) !== null && _incomingRuleset$prec !== void 0 && _incomingRuleset$prec.has(condition))
|
|
8270
|
+
return !1;
|
|
8271
|
+
}
|
|
8272
|
+
for (var {
|
|
8273
|
+
query,
|
|
8274
|
+
children
|
|
8275
|
+
} of incomingRuleset.ruleset.values()) {
|
|
8276
|
+
var matchingCondition = this.ruleset.get(query);
|
|
8277
|
+
if (matchingCondition && !matchingCondition.children.isCompatible(children))
|
|
8278
|
+
return !1;
|
|
8279
|
+
}
|
|
8280
|
+
return !0;
|
|
8281
|
+
}
|
|
8282
|
+
merge(incomingRuleset) {
|
|
8283
|
+
for (var {
|
|
8284
|
+
query,
|
|
8285
|
+
rules,
|
|
8286
|
+
children
|
|
8287
|
+
} of incomingRuleset.ruleset.values()) {
|
|
8288
|
+
var matchingCondition = this.ruleset.get(query);
|
|
8289
|
+
matchingCondition ? (matchingCondition.rules.push(...rules), matchingCondition.children.merge(children)) : this.ruleset.set(query, {
|
|
8290
|
+
query,
|
|
8291
|
+
rules,
|
|
8292
|
+
children
|
|
8293
|
+
});
|
|
8294
|
+
}
|
|
8295
|
+
for (var [condition, incomingOrderPrecedence] of incomingRuleset.precedenceLookup.entries()) {
|
|
8296
|
+
var _this$precedenceLooku, orderPrecedence = (_this$precedenceLooku = this.precedenceLookup.get(condition)) !== null && _this$precedenceLooku !== void 0 ? _this$precedenceLooku : /* @__PURE__ */ new Set();
|
|
8297
|
+
this.precedenceLookup.set(condition, /* @__PURE__ */ new Set([...orderPrecedence, ...incomingOrderPrecedence]));
|
|
8298
|
+
}
|
|
8299
|
+
}
|
|
8300
|
+
/**
|
|
8301
|
+
* Merge another ConditionalRuleset into this one if they are compatible
|
|
8302
|
+
*
|
|
8303
|
+
* @returns true if successful, false if the ruleset is incompatible
|
|
8304
|
+
*/
|
|
8305
|
+
mergeIfCompatible(incomingRuleset) {
|
|
8306
|
+
return this.isCompatible(incomingRuleset) ? (this.merge(incomingRuleset), !0) : !1;
|
|
8307
|
+
}
|
|
8308
|
+
getSortedRuleset() {
|
|
8309
|
+
var _this = this, sortedRuleset = [], _loop = function(dependents2) {
|
|
8310
|
+
var conditionForQuery = _this.ruleset.get(query);
|
|
8311
|
+
if (!conditionForQuery)
|
|
8312
|
+
throw new Error("Can't find condition for ".concat(query));
|
|
8313
|
+
var firstMatchingDependent = sortedRuleset.findIndex((condition) => dependents2.has(condition.query));
|
|
8314
|
+
firstMatchingDependent > -1 ? sortedRuleset.splice(firstMatchingDependent, 0, conditionForQuery) : sortedRuleset.push(conditionForQuery);
|
|
8315
|
+
};
|
|
8316
|
+
for (var [query, dependents] of this.precedenceLookup.entries())
|
|
8317
|
+
_loop(dependents);
|
|
8318
|
+
return sortedRuleset;
|
|
8319
|
+
}
|
|
8320
|
+
renderToArray() {
|
|
8321
|
+
var arr = [];
|
|
8322
|
+
for (var {
|
|
8323
|
+
query,
|
|
8324
|
+
rules,
|
|
8325
|
+
children
|
|
8326
|
+
} of this.getSortedRuleset()) {
|
|
8327
|
+
var selectors = {};
|
|
8328
|
+
for (var rule of rules)
|
|
8329
|
+
selectors[rule.selector] = _objectSpread2(_objectSpread2({}, selectors[rule.selector]), rule.rule);
|
|
8330
|
+
Object.assign(selectors, ...children.renderToArray()), arr.push({
|
|
8331
|
+
[query]: selectors
|
|
8332
|
+
});
|
|
8333
|
+
}
|
|
8334
|
+
return arr;
|
|
8335
|
+
}
|
|
8336
|
+
}
|
|
8337
|
+
var simplePseudoMap = {
|
|
8338
|
+
":-moz-any-link": !0,
|
|
8339
|
+
":-moz-full-screen": !0,
|
|
8340
|
+
":-moz-placeholder": !0,
|
|
8341
|
+
":-moz-read-only": !0,
|
|
8342
|
+
":-moz-read-write": !0,
|
|
8343
|
+
":-ms-fullscreen": !0,
|
|
8344
|
+
":-ms-input-placeholder": !0,
|
|
8345
|
+
":-webkit-any-link": !0,
|
|
8346
|
+
":-webkit-full-screen": !0,
|
|
8347
|
+
"::-moz-color-swatch": !0,
|
|
8348
|
+
"::-moz-list-bullet": !0,
|
|
8349
|
+
"::-moz-list-number": !0,
|
|
8350
|
+
"::-moz-page-sequence": !0,
|
|
8351
|
+
"::-moz-page": !0,
|
|
8352
|
+
"::-moz-placeholder": !0,
|
|
8353
|
+
"::-moz-progress-bar": !0,
|
|
8354
|
+
"::-moz-range-progress": !0,
|
|
8355
|
+
"::-moz-range-thumb": !0,
|
|
8356
|
+
"::-moz-range-track": !0,
|
|
8357
|
+
"::-moz-scrolled-page-sequence": !0,
|
|
8358
|
+
"::-moz-selection": !0,
|
|
8359
|
+
"::-ms-backdrop": !0,
|
|
8360
|
+
"::-ms-browse": !0,
|
|
8361
|
+
"::-ms-check": !0,
|
|
8362
|
+
"::-ms-clear": !0,
|
|
8363
|
+
"::-ms-fill-lower": !0,
|
|
8364
|
+
"::-ms-fill-upper": !0,
|
|
8365
|
+
"::-ms-fill": !0,
|
|
8366
|
+
"::-ms-reveal": !0,
|
|
8367
|
+
"::-ms-thumb": !0,
|
|
8368
|
+
"::-ms-ticks-after": !0,
|
|
8369
|
+
"::-ms-ticks-before": !0,
|
|
8370
|
+
"::-ms-tooltip": !0,
|
|
8371
|
+
"::-ms-track": !0,
|
|
8372
|
+
"::-ms-value": !0,
|
|
8373
|
+
"::-webkit-backdrop": !0,
|
|
8374
|
+
"::-webkit-calendar-picker-indicator": !0,
|
|
8375
|
+
"::-webkit-inner-spin-button": !0,
|
|
8376
|
+
"::-webkit-input-placeholder": !0,
|
|
8377
|
+
"::-webkit-meter-bar": !0,
|
|
8378
|
+
"::-webkit-meter-even-less-good-value": !0,
|
|
8379
|
+
"::-webkit-meter-inner-element": !0,
|
|
8380
|
+
"::-webkit-meter-optimum-value": !0,
|
|
8381
|
+
"::-webkit-meter-suboptimum-value": !0,
|
|
8382
|
+
"::-webkit-outer-spin-button": !0,
|
|
8383
|
+
"::-webkit-progress-bar": !0,
|
|
8384
|
+
"::-webkit-progress-inner-element": !0,
|
|
8385
|
+
"::-webkit-progress-inner-value": !0,
|
|
8386
|
+
"::-webkit-progress-value": !0,
|
|
8387
|
+
"::-webkit-resizer": !0,
|
|
8388
|
+
"::-webkit-scrollbar-button": !0,
|
|
8389
|
+
"::-webkit-scrollbar-corner": !0,
|
|
8390
|
+
"::-webkit-scrollbar-thumb": !0,
|
|
8391
|
+
"::-webkit-scrollbar-track-piece": !0,
|
|
8392
|
+
"::-webkit-scrollbar-track": !0,
|
|
8393
|
+
"::-webkit-scrollbar": !0,
|
|
8394
|
+
"::-webkit-search-cancel-button": !0,
|
|
8395
|
+
"::-webkit-search-results-button": !0,
|
|
8396
|
+
"::-webkit-slider-runnable-track": !0,
|
|
8397
|
+
"::-webkit-slider-thumb": !0,
|
|
8398
|
+
"::after": !0,
|
|
8399
|
+
"::backdrop": !0,
|
|
8400
|
+
"::before": !0,
|
|
8401
|
+
"::cue": !0,
|
|
8402
|
+
"::file-selector-button": !0,
|
|
8403
|
+
"::first-letter": !0,
|
|
8404
|
+
"::first-line": !0,
|
|
8405
|
+
"::grammar-error": !0,
|
|
8406
|
+
"::marker": !0,
|
|
8407
|
+
"::placeholder": !0,
|
|
8408
|
+
"::selection": !0,
|
|
8409
|
+
"::spelling-error": !0,
|
|
8410
|
+
"::target-text": !0,
|
|
8411
|
+
"::view-transition-group": !0,
|
|
8412
|
+
"::view-transition-image-pair": !0,
|
|
8413
|
+
"::view-transition-new": !0,
|
|
8414
|
+
"::view-transition-old": !0,
|
|
8415
|
+
"::view-transition": !0,
|
|
8416
|
+
":active": !0,
|
|
8417
|
+
":after": !0,
|
|
8418
|
+
":any-link": !0,
|
|
8419
|
+
":before": !0,
|
|
8420
|
+
":blank": !0,
|
|
8421
|
+
":checked": !0,
|
|
8422
|
+
":default": !0,
|
|
8423
|
+
":defined": !0,
|
|
8424
|
+
":disabled": !0,
|
|
8425
|
+
":empty": !0,
|
|
8426
|
+
":enabled": !0,
|
|
8427
|
+
":first-child": !0,
|
|
8428
|
+
":first-letter": !0,
|
|
8429
|
+
":first-line": !0,
|
|
8430
|
+
":first-of-type": !0,
|
|
8431
|
+
":first": !0,
|
|
8432
|
+
":focus-visible": !0,
|
|
8433
|
+
":focus-within": !0,
|
|
8434
|
+
":focus": !0,
|
|
8435
|
+
":fullscreen": !0,
|
|
8436
|
+
":hover": !0,
|
|
8437
|
+
":in-range": !0,
|
|
8438
|
+
":indeterminate": !0,
|
|
8439
|
+
":invalid": !0,
|
|
8440
|
+
":last-child": !0,
|
|
8441
|
+
":last-of-type": !0,
|
|
8442
|
+
":left": !0,
|
|
8443
|
+
":link": !0,
|
|
8444
|
+
":only-child": !0,
|
|
8445
|
+
":only-of-type": !0,
|
|
8446
|
+
":optional": !0,
|
|
8447
|
+
":out-of-range": !0,
|
|
8448
|
+
":placeholder-shown": !0,
|
|
8449
|
+
":read-only": !0,
|
|
8450
|
+
":read-write": !0,
|
|
8451
|
+
":required": !0,
|
|
8452
|
+
":right": !0,
|
|
8453
|
+
":root": !0,
|
|
8454
|
+
":scope": !0,
|
|
8455
|
+
":target": !0,
|
|
8456
|
+
":valid": !0,
|
|
8457
|
+
":visited": !0
|
|
8458
|
+
}, simplePseudos = Object.keys(simplePseudoMap), simplePseudoLookup = simplePseudoMap, _templateObject, createMediaQueryError = (mediaQuery, msg) => new Error(dedent(_templateObject || (_templateObject = _taggedTemplateLiteral([`
|
|
8459
|
+
Invalid media query: "`, `"
|
|
8460
|
+
|
|
8461
|
+
`, `
|
|
8462
|
+
|
|
8463
|
+
Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
|
|
8464
|
+
`])), mediaQuery, msg)), validateMediaQuery = (mediaQuery) => {
|
|
8465
|
+
if (mediaQuery === "@media ")
|
|
8466
|
+
throw createMediaQueryError(mediaQuery, "Query is empty");
|
|
8467
|
+
try {
|
|
8468
|
+
toAST(mediaQuery);
|
|
8469
|
+
} catch (e2) {
|
|
8470
|
+
throw createMediaQueryError(mediaQuery, e2.message);
|
|
8471
|
+
}
|
|
8472
|
+
}, _excluded = ["vars"], _excluded2 = ["content"], DECLARATION = "__DECLARATION", UNITLESS = {
|
|
8473
|
+
animationIterationCount: !0,
|
|
8474
|
+
borderImage: !0,
|
|
8475
|
+
borderImageOutset: !0,
|
|
8476
|
+
borderImageSlice: !0,
|
|
8477
|
+
borderImageWidth: !0,
|
|
8478
|
+
boxFlex: !0,
|
|
8479
|
+
boxFlexGroup: !0,
|
|
8480
|
+
columnCount: !0,
|
|
8481
|
+
columns: !0,
|
|
8482
|
+
flex: !0,
|
|
8483
|
+
flexGrow: !0,
|
|
8484
|
+
flexShrink: !0,
|
|
8485
|
+
fontWeight: !0,
|
|
8486
|
+
gridArea: !0,
|
|
8487
|
+
gridColumn: !0,
|
|
8488
|
+
gridColumnEnd: !0,
|
|
8489
|
+
gridColumnStart: !0,
|
|
8490
|
+
gridRow: !0,
|
|
8491
|
+
gridRowEnd: !0,
|
|
8492
|
+
gridRowStart: !0,
|
|
8493
|
+
initialLetter: !0,
|
|
8494
|
+
lineClamp: !0,
|
|
8495
|
+
lineHeight: !0,
|
|
8496
|
+
maxLines: !0,
|
|
8497
|
+
opacity: !0,
|
|
8498
|
+
order: !0,
|
|
8499
|
+
orphans: !0,
|
|
8500
|
+
scale: !0,
|
|
8501
|
+
tabSize: !0,
|
|
8502
|
+
WebkitLineClamp: !0,
|
|
8503
|
+
widows: !0,
|
|
8504
|
+
zIndex: !0,
|
|
8505
|
+
zoom: !0,
|
|
8506
|
+
// svg properties
|
|
8507
|
+
fillOpacity: !0,
|
|
8508
|
+
floodOpacity: !0,
|
|
8509
|
+
maskBorder: !0,
|
|
8510
|
+
maskBorderOutset: !0,
|
|
8511
|
+
maskBorderSlice: !0,
|
|
8512
|
+
maskBorderWidth: !0,
|
|
8513
|
+
shapeImageThreshold: !0,
|
|
8514
|
+
stopOpacity: !0,
|
|
8515
|
+
strokeDashoffset: !0,
|
|
8516
|
+
strokeMiterlimit: !0,
|
|
8517
|
+
strokeOpacity: !0,
|
|
8518
|
+
strokeWidth: !0
|
|
8519
|
+
};
|
|
8520
|
+
function dashify(str) {
|
|
8521
|
+
return str.replace(/([A-Z])/g, "-$1").replace(/^ms-/, "-ms-").toLowerCase();
|
|
8522
|
+
}
|
|
8523
|
+
function replaceBetweenIndexes(target, startIndex, endIndex, replacement) {
|
|
8524
|
+
var start = target.slice(0, startIndex), end = target.slice(endIndex);
|
|
8525
|
+
return "".concat(start).concat(replacement).concat(end);
|
|
8526
|
+
}
|
|
8527
|
+
var DOUBLE_SPACE = " ", specialKeys = [...simplePseudos, "@layer", "@media", "@supports", "@container", "selectors"];
|
|
8528
|
+
class Stylesheet {
|
|
8529
|
+
constructor(localClassNames2, composedClassLists2) {
|
|
8530
|
+
this.rules = [], this.conditionalRulesets = [new ConditionalRuleset()], this.fontFaceRules = [], this.keyframesRules = [], this.localClassNamesMap = new Map(localClassNames2.map((localClassName) => [localClassName, localClassName])), this.localClassNamesSearch = new AhoCorasick(localClassNames2), this.layers = /* @__PURE__ */ new Map(), this.composedClassLists = composedClassLists2.map((_ref) => {
|
|
8531
|
+
var {
|
|
8532
|
+
identifier,
|
|
8533
|
+
classList
|
|
8534
|
+
} = _ref;
|
|
8535
|
+
return {
|
|
8536
|
+
identifier,
|
|
8537
|
+
regex: RegExp("(".concat(classList, ")"), "g")
|
|
8538
|
+
};
|
|
8539
|
+
}).reverse();
|
|
8540
|
+
}
|
|
8541
|
+
processCssObj(root2) {
|
|
8542
|
+
if (root2.type === "fontFace") {
|
|
8543
|
+
this.fontFaceRules.push(root2.rule);
|
|
8544
|
+
return;
|
|
8545
|
+
}
|
|
8546
|
+
if (root2.type === "keyframes") {
|
|
8547
|
+
root2.rule = Object.fromEntries(Object.entries(root2.rule).map((_ref2) => {
|
|
8548
|
+
var [keyframe, rule] = _ref2;
|
|
8549
|
+
return [keyframe, this.transformProperties(rule)];
|
|
8550
|
+
})), this.keyframesRules.push(root2);
|
|
8551
|
+
return;
|
|
8552
|
+
}
|
|
8553
|
+
if (this.currConditionalRuleset = new ConditionalRuleset(), root2.type === "layer") {
|
|
8554
|
+
var layerDefinition = "@layer ".concat(root2.name);
|
|
8555
|
+
this.addLayer([layerDefinition]);
|
|
8556
|
+
} else {
|
|
8557
|
+
var mainRule = omit(root2.rule, specialKeys);
|
|
8558
|
+
this.addRule({
|
|
8559
|
+
selector: root2.selector,
|
|
8560
|
+
rule: mainRule
|
|
8561
|
+
}), this.transformLayer(root2, root2.rule["@layer"]), this.transformMedia(root2, root2.rule["@media"]), this.transformSupports(root2, root2.rule["@supports"]), this.transformContainer(root2, root2.rule["@container"]), this.transformSimplePseudos(root2, root2.rule), this.transformSelectors(root2, root2.rule);
|
|
8562
|
+
}
|
|
8563
|
+
var activeConditionalRuleset = this.conditionalRulesets[this.conditionalRulesets.length - 1];
|
|
8564
|
+
activeConditionalRuleset.mergeIfCompatible(this.currConditionalRuleset) || this.conditionalRulesets.push(this.currConditionalRuleset);
|
|
8565
|
+
}
|
|
8566
|
+
addConditionalRule(cssRule, conditions) {
|
|
8567
|
+
var rule = this.transformVars(this.transformProperties(cssRule.rule)), selector2 = this.transformSelector(cssRule.selector);
|
|
8568
|
+
if (!this.currConditionalRuleset)
|
|
8569
|
+
throw new Error("Couldn't add conditional rule");
|
|
8570
|
+
var conditionQuery = conditions[conditions.length - 1], parentConditions = conditions.slice(0, conditions.length - 1);
|
|
8571
|
+
this.currConditionalRuleset.addRule({
|
|
8572
|
+
selector: selector2,
|
|
8573
|
+
rule
|
|
8574
|
+
}, conditionQuery, parentConditions);
|
|
8575
|
+
}
|
|
8576
|
+
addRule(cssRule) {
|
|
8577
|
+
var rule = this.transformVars(this.transformProperties(cssRule.rule)), selector2 = this.transformSelector(cssRule.selector);
|
|
8578
|
+
this.rules.push({
|
|
8579
|
+
selector: selector2,
|
|
8580
|
+
rule
|
|
8581
|
+
});
|
|
8582
|
+
}
|
|
8583
|
+
addLayer(layer) {
|
|
8584
|
+
var uniqueLayerKey = layer.join(" - ");
|
|
8585
|
+
this.layers.set(uniqueLayerKey, layer);
|
|
8586
|
+
}
|
|
8587
|
+
transformProperties(cssRule) {
|
|
8588
|
+
return this.transformContent(this.pixelifyProperties(cssRule));
|
|
8589
|
+
}
|
|
8590
|
+
pixelifyProperties(cssRule) {
|
|
8591
|
+
return forEach(cssRule, (value, key) => {
|
|
8592
|
+
typeof value == "number" && value !== 0 && !UNITLESS[key] && (cssRule[key] = "".concat(value, "px"));
|
|
8593
|
+
}), cssRule;
|
|
8594
|
+
}
|
|
8595
|
+
transformVars(_ref3) {
|
|
8596
|
+
var {
|
|
8597
|
+
vars: vars2
|
|
8598
|
+
} = _ref3, rest = _objectWithoutProperties(_ref3, _excluded);
|
|
8599
|
+
return vars2 ? _objectSpread2(_objectSpread2({}, mapKeys(vars2, (_value, key) => getVarName(key))), rest) : rest;
|
|
8600
|
+
}
|
|
8601
|
+
transformContent(_ref4) {
|
|
8602
|
+
var {
|
|
8603
|
+
content: content2
|
|
8604
|
+
} = _ref4, rest = _objectWithoutProperties(_ref4, _excluded2);
|
|
8605
|
+
if (typeof content2 > "u")
|
|
8606
|
+
return rest;
|
|
8607
|
+
var contentArray = Array.isArray(content2) ? content2 : [content2];
|
|
8608
|
+
return _objectSpread2({
|
|
8609
|
+
content: contentArray.map((value) => (
|
|
8610
|
+
// This logic was adapted from Stitches :)
|
|
8611
|
+
value && (value.includes('"') || value.includes("'") || /^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(value)) ? value : '"'.concat(value, '"')
|
|
8612
|
+
))
|
|
8613
|
+
}, rest);
|
|
8614
|
+
}
|
|
8615
|
+
transformClassname(identifier) {
|
|
8616
|
+
return ".".concat(cssesc$1(identifier, {
|
|
8617
|
+
isIdentifier: !0
|
|
8618
|
+
}));
|
|
8619
|
+
}
|
|
8620
|
+
transformSelector(selector2) {
|
|
8621
|
+
var transformedSelector = selector2, _loop = function(identifier2) {
|
|
8622
|
+
transformedSelector = transformedSelector.replace(regex, () => (markCompositionUsed(identifier2), identifier2));
|
|
8623
|
+
};
|
|
8624
|
+
for (var {
|
|
8625
|
+
identifier,
|
|
8626
|
+
regex
|
|
8627
|
+
} of this.composedClassLists)
|
|
8628
|
+
_loop(identifier);
|
|
8629
|
+
if (this.localClassNamesMap.has(transformedSelector))
|
|
8630
|
+
return this.transformClassname(transformedSelector);
|
|
8631
|
+
for (var results = this.localClassNamesSearch.search(transformedSelector), lastReplaceIndex = transformedSelector.length, i2 = results.length - 1; i2 >= 0; i2--) {
|
|
8632
|
+
var [endIndex, [firstMatch]] = results[i2], startIndex = endIndex - firstMatch.length + 1;
|
|
8633
|
+
startIndex >= lastReplaceIndex || (lastReplaceIndex = startIndex, transformedSelector[startIndex - 1] !== "." && (transformedSelector = replaceBetweenIndexes(transformedSelector, startIndex, endIndex + 1, this.transformClassname(firstMatch))));
|
|
8634
|
+
}
|
|
8635
|
+
return transformedSelector;
|
|
8636
|
+
}
|
|
8637
|
+
transformSelectors(root2, rule, conditions) {
|
|
8638
|
+
forEach(rule.selectors, (selectorRule, selector2) => {
|
|
8639
|
+
if (root2.type !== "local")
|
|
8640
|
+
throw new Error("Selectors are not allowed within ".concat(root2.type === "global" ? '"globalStyle"' : '"selectors"'));
|
|
8641
|
+
var transformedSelector = this.transformSelector(selector2.replace(RegExp("&", "g"), root2.selector));
|
|
8642
|
+
validateSelector(transformedSelector, root2.selector);
|
|
8643
|
+
var rule2 = {
|
|
8644
|
+
selector: transformedSelector,
|
|
8645
|
+
rule: omit(selectorRule, specialKeys)
|
|
8646
|
+
};
|
|
8647
|
+
conditions ? this.addConditionalRule(rule2, conditions) : this.addRule(rule2);
|
|
8648
|
+
var selectorRoot = {
|
|
8649
|
+
type: "selector",
|
|
8650
|
+
selector: transformedSelector,
|
|
8651
|
+
rule: selectorRule
|
|
8652
|
+
};
|
|
8653
|
+
this.transformLayer(selectorRoot, selectorRule["@layer"], conditions), this.transformSupports(selectorRoot, selectorRule["@supports"], conditions), this.transformMedia(selectorRoot, selectorRule["@media"], conditions);
|
|
8654
|
+
});
|
|
8655
|
+
}
|
|
8656
|
+
transformMedia(root2, rules) {
|
|
8657
|
+
var parentConditions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
8658
|
+
if (rules) {
|
|
8659
|
+
var _this$currConditional;
|
|
8660
|
+
(_this$currConditional = this.currConditionalRuleset) === null || _this$currConditional === void 0 || _this$currConditional.addConditionPrecedence(parentConditions, Object.keys(rules).map((query2) => "@media ".concat(query2)));
|
|
8661
|
+
for (var [query, mediaRule] of Object.entries(rules)) {
|
|
8662
|
+
var mediaQuery = "@media ".concat(query);
|
|
8663
|
+
validateMediaQuery(mediaQuery);
|
|
8664
|
+
var conditions = [...parentConditions, mediaQuery];
|
|
8665
|
+
this.addConditionalRule({
|
|
8666
|
+
selector: root2.selector,
|
|
8667
|
+
rule: omit(mediaRule, specialKeys)
|
|
8668
|
+
}, conditions), root2.type === "local" && (this.transformSimplePseudos(root2, mediaRule, conditions), this.transformSelectors(root2, mediaRule, conditions)), this.transformLayer(root2, mediaRule["@layer"], conditions), this.transformSupports(root2, mediaRule["@supports"], conditions), this.transformContainer(root2, mediaRule["@container"], conditions);
|
|
8669
|
+
}
|
|
8670
|
+
}
|
|
8671
|
+
}
|
|
8672
|
+
transformContainer(root2, rules) {
|
|
8673
|
+
var parentConditions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
8674
|
+
if (rules) {
|
|
8675
|
+
var _this$currConditional2;
|
|
8676
|
+
(_this$currConditional2 = this.currConditionalRuleset) === null || _this$currConditional2 === void 0 || _this$currConditional2.addConditionPrecedence(parentConditions, Object.keys(rules).map((query) => "@container ".concat(query))), forEach(rules, (containerRule, query) => {
|
|
8677
|
+
var containerQuery = "@container ".concat(query), conditions = [...parentConditions, containerQuery];
|
|
8678
|
+
this.addConditionalRule({
|
|
8679
|
+
selector: root2.selector,
|
|
8680
|
+
rule: omit(containerRule, specialKeys)
|
|
8681
|
+
}, conditions), root2.type === "local" && (this.transformSimplePseudos(root2, containerRule, conditions), this.transformSelectors(root2, containerRule, conditions)), this.transformLayer(root2, containerRule["@layer"], conditions), this.transformSupports(root2, containerRule["@supports"], conditions), this.transformMedia(root2, containerRule["@media"], conditions);
|
|
8682
|
+
});
|
|
8683
|
+
}
|
|
8684
|
+
}
|
|
8685
|
+
transformLayer(root2, rules) {
|
|
8686
|
+
var parentConditions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
8687
|
+
if (rules) {
|
|
8688
|
+
var _this$currConditional3;
|
|
8689
|
+
(_this$currConditional3 = this.currConditionalRuleset) === null || _this$currConditional3 === void 0 || _this$currConditional3.addConditionPrecedence(parentConditions, Object.keys(rules).map((name) => "@layer ".concat(name))), forEach(rules, (layerRule, name) => {
|
|
8690
|
+
var conditions = [...parentConditions, "@layer ".concat(name)];
|
|
8691
|
+
this.addLayer(conditions), this.addConditionalRule({
|
|
8692
|
+
selector: root2.selector,
|
|
8693
|
+
rule: omit(layerRule, specialKeys)
|
|
8694
|
+
}, conditions), root2.type === "local" && (this.transformSimplePseudos(root2, layerRule, conditions), this.transformSelectors(root2, layerRule, conditions)), this.transformMedia(root2, layerRule["@media"], conditions), this.transformSupports(root2, layerRule["@supports"], conditions), this.transformContainer(root2, layerRule["@container"], conditions);
|
|
8695
|
+
});
|
|
8696
|
+
}
|
|
8697
|
+
}
|
|
8698
|
+
transformSupports(root2, rules) {
|
|
8699
|
+
var parentConditions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
8700
|
+
if (rules) {
|
|
8701
|
+
var _this$currConditional4;
|
|
8702
|
+
(_this$currConditional4 = this.currConditionalRuleset) === null || _this$currConditional4 === void 0 || _this$currConditional4.addConditionPrecedence(parentConditions, Object.keys(rules).map((query) => "@supports ".concat(query))), forEach(rules, (supportsRule, query) => {
|
|
8703
|
+
var conditions = [...parentConditions, "@supports ".concat(query)];
|
|
8704
|
+
this.addConditionalRule({
|
|
8705
|
+
selector: root2.selector,
|
|
8706
|
+
rule: omit(supportsRule, specialKeys)
|
|
8707
|
+
}, conditions), root2.type === "local" && (this.transformSimplePseudos(root2, supportsRule, conditions), this.transformSelectors(root2, supportsRule, conditions)), this.transformLayer(root2, supportsRule["@layer"], conditions), this.transformMedia(root2, supportsRule["@media"], conditions), this.transformContainer(root2, supportsRule["@container"], conditions);
|
|
8708
|
+
});
|
|
8709
|
+
}
|
|
8710
|
+
}
|
|
8711
|
+
transformSimplePseudos(root2, rule, conditions) {
|
|
8712
|
+
for (var key of Object.keys(rule))
|
|
8713
|
+
if (simplePseudoLookup[key]) {
|
|
8714
|
+
if (root2.type !== "local")
|
|
8715
|
+
throw new Error("Simple pseudos are not valid in ".concat(root2.type === "global" ? '"globalStyle"' : '"selectors"'));
|
|
8716
|
+
conditions ? this.addConditionalRule({
|
|
8717
|
+
selector: "".concat(root2.selector).concat(key),
|
|
8718
|
+
rule: rule[key]
|
|
8719
|
+
}, conditions) : this.addRule({
|
|
8720
|
+
conditions,
|
|
8721
|
+
selector: "".concat(root2.selector).concat(key),
|
|
8722
|
+
rule: rule[key]
|
|
8723
|
+
});
|
|
8724
|
+
}
|
|
8725
|
+
}
|
|
8726
|
+
toCss() {
|
|
8727
|
+
var css = [];
|
|
8728
|
+
for (var fontFaceRule of this.fontFaceRules)
|
|
8729
|
+
css.push(renderCss({
|
|
8730
|
+
"@font-face": fontFaceRule
|
|
8731
|
+
}));
|
|
8732
|
+
for (var keyframe of this.keyframesRules)
|
|
8733
|
+
css.push(renderCss({
|
|
8734
|
+
["@keyframes ".concat(keyframe.name)]: keyframe.rule
|
|
8735
|
+
}));
|
|
8736
|
+
for (var layer of this.layers.values()) {
|
|
8737
|
+
var [definition, ...nesting] = layer.reverse(), cssObj = {
|
|
8738
|
+
[definition]: DECLARATION
|
|
8739
|
+
};
|
|
8740
|
+
for (var part of nesting)
|
|
8741
|
+
cssObj = {
|
|
8742
|
+
[part]: cssObj
|
|
8743
|
+
};
|
|
8744
|
+
css.push(renderCss(cssObj));
|
|
8745
|
+
}
|
|
8746
|
+
for (var rule of this.rules)
|
|
8747
|
+
css.push(renderCss({
|
|
8748
|
+
[rule.selector]: rule.rule
|
|
8749
|
+
}));
|
|
8750
|
+
for (var conditionalRuleset of this.conditionalRulesets)
|
|
8751
|
+
for (var conditionalRule of conditionalRuleset.renderToArray())
|
|
8752
|
+
css.push(renderCss(conditionalRule));
|
|
8753
|
+
return css.filter(Boolean);
|
|
8754
|
+
}
|
|
8755
|
+
}
|
|
8756
|
+
function renderCss(v) {
|
|
8757
|
+
var indent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", rules = [], _loop2 = function(key2) {
|
|
8758
|
+
var value = v[key2];
|
|
8759
|
+
if (value && Array.isArray(value))
|
|
8760
|
+
rules.push(...value.map((v2) => renderCss({
|
|
8761
|
+
[key2]: v2
|
|
8762
|
+
}, indent)));
|
|
8763
|
+
else if (value && typeof value == "object") {
|
|
8764
|
+
var isEmpty = Object.keys(value).length === 0;
|
|
8765
|
+
isEmpty || rules.push("".concat(indent).concat(key2, ` {
|
|
8766
|
+
`).concat(renderCss(value, indent + DOUBLE_SPACE), `
|
|
8767
|
+
`).concat(indent, "}"));
|
|
8768
|
+
} else value === DECLARATION ? rules.push("".concat(indent).concat(key2, ";")) : rules.push("".concat(indent).concat(key2.startsWith("--") ? key2 : dashify(key2), ": ").concat(value, ";"));
|
|
8769
|
+
};
|
|
8770
|
+
for (var key of Object.keys(v))
|
|
8771
|
+
_loop2(key);
|
|
8772
|
+
return rules.join(`
|
|
8773
|
+
`);
|
|
8774
|
+
}
|
|
8775
|
+
function transformCss(_ref5) {
|
|
8776
|
+
var {
|
|
8777
|
+
localClassNames: localClassNames2,
|
|
8778
|
+
cssObjs,
|
|
8779
|
+
composedClassLists: composedClassLists2
|
|
8780
|
+
} = _ref5, stylesheet = new Stylesheet(localClassNames2, composedClassLists2);
|
|
8781
|
+
for (var root2 of cssObjs)
|
|
8782
|
+
stylesheet.processCssObj(root2);
|
|
8783
|
+
return stylesheet.toCss();
|
|
8784
|
+
}
|
|
8785
|
+
const perf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, warned = /* @__PURE__ */ new Set(), PROCESS = typeof process == "object" && process ? process : {}, emitWarning = (msg, type, code, fn) => {
|
|
8786
|
+
typeof PROCESS.emitWarning == "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
|
|
8787
|
+
};
|
|
8788
|
+
let AC = globalThis.AbortController, AS = globalThis.AbortSignal;
|
|
8789
|
+
if (typeof AC > "u") {
|
|
8790
|
+
AS = class {
|
|
8791
|
+
onabort;
|
|
8792
|
+
_onabort = [];
|
|
8793
|
+
reason;
|
|
8794
|
+
aborted = !1;
|
|
8795
|
+
addEventListener(_, fn) {
|
|
8796
|
+
this._onabort.push(fn);
|
|
8797
|
+
}
|
|
8798
|
+
}, AC = class {
|
|
8799
|
+
constructor() {
|
|
8800
|
+
warnACPolyfill();
|
|
8801
|
+
}
|
|
8802
|
+
signal = new AS();
|
|
8803
|
+
abort(reason) {
|
|
8804
|
+
if (!this.signal.aborted) {
|
|
8805
|
+
this.signal.reason = reason, this.signal.aborted = !0;
|
|
8806
|
+
for (const fn of this.signal._onabort)
|
|
8807
|
+
fn(reason);
|
|
8808
|
+
this.signal.onabort?.(reason);
|
|
8809
|
+
}
|
|
8810
|
+
}
|
|
8811
|
+
};
|
|
8812
|
+
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
8813
|
+
const warnACPolyfill = () => {
|
|
8814
|
+
printACPolyfillWarning && (printACPolyfillWarning = !1, emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill));
|
|
8815
|
+
};
|
|
8816
|
+
}
|
|
8817
|
+
const shouldWarn = (code) => !warned.has(code), isPosInt = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2), getUintArray = (max2) => isPosInt(max2) ? max2 <= Math.pow(2, 8) ? Uint8Array : max2 <= Math.pow(2, 16) ? Uint16Array : max2 <= Math.pow(2, 32) ? Uint32Array : max2 <= Number.MAX_SAFE_INTEGER ? ZeroArray : null : null;
|
|
8818
|
+
class ZeroArray extends Array {
|
|
8819
|
+
constructor(size) {
|
|
8820
|
+
super(size), this.fill(0);
|
|
8821
|
+
}
|
|
8822
|
+
}
|
|
8823
|
+
class Stack {
|
|
8824
|
+
heap;
|
|
8825
|
+
length;
|
|
8826
|
+
// private constructor
|
|
8827
|
+
static #constructing = !1;
|
|
8828
|
+
static create(max2) {
|
|
8829
|
+
const HeapCls = getUintArray(max2);
|
|
8830
|
+
if (!HeapCls)
|
|
8831
|
+
return [];
|
|
8832
|
+
Stack.#constructing = !0;
|
|
8833
|
+
const s2 = new Stack(max2, HeapCls);
|
|
8834
|
+
return Stack.#constructing = !1, s2;
|
|
8835
|
+
}
|
|
8836
|
+
constructor(max2, HeapCls) {
|
|
8837
|
+
if (!Stack.#constructing)
|
|
8838
|
+
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
8839
|
+
this.heap = new HeapCls(max2), this.length = 0;
|
|
8840
|
+
}
|
|
8841
|
+
push(n2) {
|
|
8842
|
+
this.heap[this.length++] = n2;
|
|
8843
|
+
}
|
|
8844
|
+
pop() {
|
|
8845
|
+
return this.heap[--this.length];
|
|
8846
|
+
}
|
|
8847
|
+
}
|
|
8848
|
+
class LRUCache {
|
|
8849
|
+
// options that cannot be changed without disaster
|
|
8850
|
+
#max;
|
|
8851
|
+
#maxSize;
|
|
8852
|
+
#dispose;
|
|
8853
|
+
#disposeAfter;
|
|
8854
|
+
#fetchMethod;
|
|
8855
|
+
#memoMethod;
|
|
8856
|
+
/**
|
|
8857
|
+
* {@link LRUCache.OptionsBase.ttl}
|
|
8858
|
+
*/
|
|
8859
|
+
ttl;
|
|
8860
|
+
/**
|
|
8861
|
+
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
8862
|
+
*/
|
|
8863
|
+
ttlResolution;
|
|
8864
|
+
/**
|
|
8865
|
+
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
8866
|
+
*/
|
|
8867
|
+
ttlAutopurge;
|
|
8868
|
+
/**
|
|
8869
|
+
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
8870
|
+
*/
|
|
8871
|
+
updateAgeOnGet;
|
|
8872
|
+
/**
|
|
8873
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
8874
|
+
*/
|
|
8875
|
+
updateAgeOnHas;
|
|
8876
|
+
/**
|
|
8877
|
+
* {@link LRUCache.OptionsBase.allowStale}
|
|
8878
|
+
*/
|
|
8879
|
+
allowStale;
|
|
8880
|
+
/**
|
|
8881
|
+
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
8882
|
+
*/
|
|
8883
|
+
noDisposeOnSet;
|
|
8884
|
+
/**
|
|
8885
|
+
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
8886
|
+
*/
|
|
8887
|
+
noUpdateTTL;
|
|
8888
|
+
/**
|
|
8889
|
+
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
8890
|
+
*/
|
|
8891
|
+
maxEntrySize;
|
|
8892
|
+
/**
|
|
8893
|
+
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
8894
|
+
*/
|
|
8895
|
+
sizeCalculation;
|
|
8896
|
+
/**
|
|
8897
|
+
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
8898
|
+
*/
|
|
8899
|
+
noDeleteOnFetchRejection;
|
|
8900
|
+
/**
|
|
8901
|
+
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
8902
|
+
*/
|
|
8903
|
+
noDeleteOnStaleGet;
|
|
8904
|
+
/**
|
|
8905
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
8906
|
+
*/
|
|
8907
|
+
allowStaleOnFetchAbort;
|
|
8908
|
+
/**
|
|
8909
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
8910
|
+
*/
|
|
8911
|
+
allowStaleOnFetchRejection;
|
|
8912
|
+
/**
|
|
8913
|
+
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
8914
|
+
*/
|
|
8915
|
+
ignoreFetchAbort;
|
|
8916
|
+
// computed properties
|
|
8917
|
+
#size;
|
|
8918
|
+
#calculatedSize;
|
|
8919
|
+
#keyMap;
|
|
8920
|
+
#keyList;
|
|
8921
|
+
#valList;
|
|
8922
|
+
#next;
|
|
8923
|
+
#prev;
|
|
8924
|
+
#head;
|
|
8925
|
+
#tail;
|
|
8926
|
+
#free;
|
|
8927
|
+
#disposed;
|
|
8928
|
+
#sizes;
|
|
8929
|
+
#starts;
|
|
8930
|
+
#ttls;
|
|
8931
|
+
#hasDispose;
|
|
8932
|
+
#hasFetchMethod;
|
|
8933
|
+
#hasDisposeAfter;
|
|
8934
|
+
/**
|
|
8935
|
+
* Do not call this method unless you need to inspect the
|
|
8936
|
+
* inner workings of the cache. If anything returned by this
|
|
8937
|
+
* object is modified in any way, strange breakage may occur.
|
|
8938
|
+
*
|
|
8939
|
+
* These fields are private for a reason!
|
|
8940
|
+
*
|
|
8941
|
+
* @internal
|
|
8942
|
+
*/
|
|
8943
|
+
static unsafeExposeInternals(c) {
|
|
8944
|
+
return {
|
|
8945
|
+
// properties
|
|
8946
|
+
starts: c.#starts,
|
|
8947
|
+
ttls: c.#ttls,
|
|
8948
|
+
sizes: c.#sizes,
|
|
8949
|
+
keyMap: c.#keyMap,
|
|
8950
|
+
keyList: c.#keyList,
|
|
8951
|
+
valList: c.#valList,
|
|
8952
|
+
next: c.#next,
|
|
8953
|
+
prev: c.#prev,
|
|
8954
|
+
get head() {
|
|
8955
|
+
return c.#head;
|
|
8956
|
+
},
|
|
8957
|
+
get tail() {
|
|
8958
|
+
return c.#tail;
|
|
8959
|
+
},
|
|
8960
|
+
free: c.#free,
|
|
8961
|
+
// methods
|
|
8962
|
+
isBackgroundFetch: (p2) => c.#isBackgroundFetch(p2),
|
|
8963
|
+
backgroundFetch: (k, index2, options, context) => c.#backgroundFetch(k, index2, options, context),
|
|
8964
|
+
moveToTail: (index2) => c.#moveToTail(index2),
|
|
8965
|
+
indexes: (options) => c.#indexes(options),
|
|
8966
|
+
rindexes: (options) => c.#rindexes(options),
|
|
8967
|
+
isStale: (index2) => c.#isStale(index2)
|
|
8968
|
+
};
|
|
8969
|
+
}
|
|
8970
|
+
// Protected read-only members
|
|
8971
|
+
/**
|
|
8972
|
+
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
8973
|
+
*/
|
|
8974
|
+
get max() {
|
|
8975
|
+
return this.#max;
|
|
8976
|
+
}
|
|
8977
|
+
/**
|
|
8978
|
+
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
8979
|
+
*/
|
|
8980
|
+
get maxSize() {
|
|
8981
|
+
return this.#maxSize;
|
|
8982
|
+
}
|
|
8983
|
+
/**
|
|
8984
|
+
* The total computed size of items in the cache (read-only)
|
|
8985
|
+
*/
|
|
8986
|
+
get calculatedSize() {
|
|
8987
|
+
return this.#calculatedSize;
|
|
8988
|
+
}
|
|
8989
|
+
/**
|
|
8990
|
+
* The number of items stored in the cache (read-only)
|
|
8991
|
+
*/
|
|
8992
|
+
get size() {
|
|
8993
|
+
return this.#size;
|
|
8994
|
+
}
|
|
8995
|
+
/**
|
|
8996
|
+
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
8997
|
+
*/
|
|
8998
|
+
get fetchMethod() {
|
|
8999
|
+
return this.#fetchMethod;
|
|
9000
|
+
}
|
|
9001
|
+
get memoMethod() {
|
|
9002
|
+
return this.#memoMethod;
|
|
9003
|
+
}
|
|
9004
|
+
/**
|
|
9005
|
+
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
9006
|
+
*/
|
|
9007
|
+
get dispose() {
|
|
9008
|
+
return this.#dispose;
|
|
9009
|
+
}
|
|
9010
|
+
/**
|
|
9011
|
+
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
9012
|
+
*/
|
|
9013
|
+
get disposeAfter() {
|
|
9014
|
+
return this.#disposeAfter;
|
|
9015
|
+
}
|
|
9016
|
+
constructor(options) {
|
|
9017
|
+
const { max: max2 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
|
|
9018
|
+
if (max2 !== 0 && !isPosInt(max2))
|
|
9019
|
+
throw new TypeError("max option must be a nonnegative integer");
|
|
9020
|
+
const UintArray = max2 ? getUintArray(max2) : Array;
|
|
9021
|
+
if (!UintArray)
|
|
9022
|
+
throw new Error("invalid max value: " + max2);
|
|
9023
|
+
if (this.#max = max2, this.#maxSize = maxSize, this.maxEntrySize = maxEntrySize || this.#maxSize, this.sizeCalculation = sizeCalculation, this.sizeCalculation) {
|
|
9024
|
+
if (!this.#maxSize && !this.maxEntrySize)
|
|
9025
|
+
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
9026
|
+
if (typeof this.sizeCalculation != "function")
|
|
9027
|
+
throw new TypeError("sizeCalculation set to non-function");
|
|
9028
|
+
}
|
|
9029
|
+
if (memoMethod !== void 0 && typeof memoMethod != "function")
|
|
9030
|
+
throw new TypeError("memoMethod must be a function if defined");
|
|
9031
|
+
if (this.#memoMethod = memoMethod, fetchMethod !== void 0 && typeof fetchMethod != "function")
|
|
9032
|
+
throw new TypeError("fetchMethod must be a function if specified");
|
|
9033
|
+
if (this.#fetchMethod = fetchMethod, this.#hasFetchMethod = !!fetchMethod, this.#keyMap = /* @__PURE__ */ new Map(), this.#keyList = new Array(max2).fill(void 0), this.#valList = new Array(max2).fill(void 0), this.#next = new UintArray(max2), this.#prev = new UintArray(max2), this.#head = 0, this.#tail = 0, this.#free = Stack.create(max2), this.#size = 0, this.#calculatedSize = 0, typeof dispose == "function" && (this.#dispose = dispose), typeof disposeAfter == "function" ? (this.#disposeAfter = disposeAfter, this.#disposed = []) : (this.#disposeAfter = void 0, this.#disposed = void 0), this.#hasDispose = !!this.#dispose, this.#hasDisposeAfter = !!this.#disposeAfter, this.noDisposeOnSet = !!noDisposeOnSet, this.noUpdateTTL = !!noUpdateTTL, this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection, this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection, this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort, this.ignoreFetchAbort = !!ignoreFetchAbort, this.maxEntrySize !== 0) {
|
|
9034
|
+
if (this.#maxSize !== 0 && !isPosInt(this.#maxSize))
|
|
9035
|
+
throw new TypeError("maxSize must be a positive integer if specified");
|
|
9036
|
+
if (!isPosInt(this.maxEntrySize))
|
|
9037
|
+
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
9038
|
+
this.#initializeSizeTracking();
|
|
9039
|
+
}
|
|
9040
|
+
if (this.allowStale = !!allowStale, this.noDeleteOnStaleGet = !!noDeleteOnStaleGet, this.updateAgeOnGet = !!updateAgeOnGet, this.updateAgeOnHas = !!updateAgeOnHas, this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1, this.ttlAutopurge = !!ttlAutopurge, this.ttl = ttl || 0, this.ttl) {
|
|
9041
|
+
if (!isPosInt(this.ttl))
|
|
9042
|
+
throw new TypeError("ttl must be a positive integer if specified");
|
|
9043
|
+
this.#initializeTTLTracking();
|
|
9044
|
+
}
|
|
9045
|
+
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0)
|
|
9046
|
+
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
9047
|
+
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
|
9048
|
+
const code = "LRU_CACHE_UNBOUNDED";
|
|
9049
|
+
shouldWarn(code) && (warned.add(code), emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", code, LRUCache));
|
|
9050
|
+
}
|
|
9051
|
+
}
|
|
9052
|
+
/**
|
|
9053
|
+
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
9054
|
+
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
9055
|
+
*/
|
|
9056
|
+
getRemainingTTL(key) {
|
|
9057
|
+
return this.#keyMap.has(key) ? 1 / 0 : 0;
|
|
9058
|
+
}
|
|
9059
|
+
#initializeTTLTracking() {
|
|
9060
|
+
const ttls = new ZeroArray(this.#max), starts = new ZeroArray(this.#max);
|
|
9061
|
+
this.#ttls = ttls, this.#starts = starts, this.#setItemTTL = (index2, ttl, start = perf.now()) => {
|
|
9062
|
+
if (starts[index2] = ttl !== 0 ? start : 0, ttls[index2] = ttl, ttl !== 0 && this.ttlAutopurge) {
|
|
9063
|
+
const t2 = setTimeout(() => {
|
|
9064
|
+
this.#isStale(index2) && this.#delete(this.#keyList[index2], "expire");
|
|
9065
|
+
}, ttl + 1);
|
|
9066
|
+
t2.unref && t2.unref();
|
|
9067
|
+
}
|
|
9068
|
+
}, this.#updateItemAge = (index2) => {
|
|
9069
|
+
starts[index2] = ttls[index2] !== 0 ? perf.now() : 0;
|
|
9070
|
+
}, this.#statusTTL = (status, index2) => {
|
|
9071
|
+
if (ttls[index2]) {
|
|
9072
|
+
const ttl = ttls[index2], start = starts[index2];
|
|
9073
|
+
if (!ttl || !start)
|
|
9074
|
+
return;
|
|
9075
|
+
status.ttl = ttl, status.start = start, status.now = cachedNow || getNow();
|
|
9076
|
+
const age = status.now - start;
|
|
9077
|
+
status.remainingTTL = ttl - age;
|
|
9078
|
+
}
|
|
9079
|
+
};
|
|
9080
|
+
let cachedNow = 0;
|
|
9081
|
+
const getNow = () => {
|
|
9082
|
+
const n2 = perf.now();
|
|
9083
|
+
if (this.ttlResolution > 0) {
|
|
9084
|
+
cachedNow = n2;
|
|
9085
|
+
const t2 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
9086
|
+
t2.unref && t2.unref();
|
|
9087
|
+
}
|
|
9088
|
+
return n2;
|
|
9089
|
+
};
|
|
9090
|
+
this.getRemainingTTL = (key) => {
|
|
9091
|
+
const index2 = this.#keyMap.get(key);
|
|
9092
|
+
if (index2 === void 0)
|
|
9093
|
+
return 0;
|
|
9094
|
+
const ttl = ttls[index2], start = starts[index2];
|
|
9095
|
+
if (!ttl || !start)
|
|
9096
|
+
return 1 / 0;
|
|
9097
|
+
const age = (cachedNow || getNow()) - start;
|
|
9098
|
+
return ttl - age;
|
|
9099
|
+
}, this.#isStale = (index2) => {
|
|
9100
|
+
const s2 = starts[index2], t2 = ttls[index2];
|
|
9101
|
+
return !!t2 && !!s2 && (cachedNow || getNow()) - s2 > t2;
|
|
9102
|
+
};
|
|
9103
|
+
}
|
|
9104
|
+
// conditionally set private methods related to TTL
|
|
9105
|
+
#updateItemAge = () => {
|
|
9106
|
+
};
|
|
9107
|
+
#statusTTL = () => {
|
|
9108
|
+
};
|
|
9109
|
+
#setItemTTL = () => {
|
|
9110
|
+
};
|
|
9111
|
+
/* c8 ignore stop */
|
|
9112
|
+
#isStale = () => !1;
|
|
9113
|
+
#initializeSizeTracking() {
|
|
9114
|
+
const sizes = new ZeroArray(this.#max);
|
|
9115
|
+
this.#calculatedSize = 0, this.#sizes = sizes, this.#removeItemSize = (index2) => {
|
|
9116
|
+
this.#calculatedSize -= sizes[index2], sizes[index2] = 0;
|
|
9117
|
+
}, this.#requireSize = (k, v, size, sizeCalculation) => {
|
|
9118
|
+
if (this.#isBackgroundFetch(v))
|
|
9119
|
+
return 0;
|
|
9120
|
+
if (!isPosInt(size))
|
|
9121
|
+
if (sizeCalculation) {
|
|
9122
|
+
if (typeof sizeCalculation != "function")
|
|
9123
|
+
throw new TypeError("sizeCalculation must be a function");
|
|
9124
|
+
if (size = sizeCalculation(v, k), !isPosInt(size))
|
|
9125
|
+
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
9126
|
+
} else
|
|
9127
|
+
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
9128
|
+
return size;
|
|
9129
|
+
}, this.#addItemSize = (index2, size, status) => {
|
|
9130
|
+
if (sizes[index2] = size, this.#maxSize) {
|
|
9131
|
+
const maxSize = this.#maxSize - sizes[index2];
|
|
9132
|
+
for (; this.#calculatedSize > maxSize; )
|
|
9133
|
+
this.#evict(!0);
|
|
9134
|
+
}
|
|
9135
|
+
this.#calculatedSize += sizes[index2], status && (status.entrySize = size, status.totalCalculatedSize = this.#calculatedSize);
|
|
9136
|
+
};
|
|
9137
|
+
}
|
|
9138
|
+
#removeItemSize = (_i) => {
|
|
9139
|
+
};
|
|
9140
|
+
#addItemSize = (_i, _s, _st) => {
|
|
9141
|
+
};
|
|
9142
|
+
#requireSize = (_k, _v, size, sizeCalculation) => {
|
|
9143
|
+
if (size || sizeCalculation)
|
|
9144
|
+
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
9145
|
+
return 0;
|
|
9146
|
+
};
|
|
9147
|
+
*#indexes({ allowStale = this.allowStale } = {}) {
|
|
9148
|
+
if (this.#size)
|
|
9149
|
+
for (let i2 = this.#tail; !(!this.#isValidIndex(i2) || ((allowStale || !this.#isStale(i2)) && (yield i2), i2 === this.#head)); )
|
|
9150
|
+
i2 = this.#prev[i2];
|
|
9151
|
+
}
|
|
9152
|
+
*#rindexes({ allowStale = this.allowStale } = {}) {
|
|
9153
|
+
if (this.#size)
|
|
9154
|
+
for (let i2 = this.#head; !(!this.#isValidIndex(i2) || ((allowStale || !this.#isStale(i2)) && (yield i2), i2 === this.#tail)); )
|
|
9155
|
+
i2 = this.#next[i2];
|
|
9156
|
+
}
|
|
9157
|
+
#isValidIndex(index2) {
|
|
9158
|
+
return index2 !== void 0 && this.#keyMap.get(this.#keyList[index2]) === index2;
|
|
9159
|
+
}
|
|
9160
|
+
/**
|
|
9161
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
9162
|
+
* in order from most recently used to least recently used.
|
|
9163
|
+
*/
|
|
9164
|
+
*entries() {
|
|
9165
|
+
for (const i2 of this.#indexes())
|
|
9166
|
+
this.#valList[i2] !== void 0 && this.#keyList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield [this.#keyList[i2], this.#valList[i2]]);
|
|
9167
|
+
}
|
|
9168
|
+
/**
|
|
9169
|
+
* Inverse order version of {@link LRUCache.entries}
|
|
9170
|
+
*
|
|
9171
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
9172
|
+
* in order from least recently used to most recently used.
|
|
9173
|
+
*/
|
|
9174
|
+
*rentries() {
|
|
9175
|
+
for (const i2 of this.#rindexes())
|
|
9176
|
+
this.#valList[i2] !== void 0 && this.#keyList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield [this.#keyList[i2], this.#valList[i2]]);
|
|
9177
|
+
}
|
|
9178
|
+
/**
|
|
9179
|
+
* Return a generator yielding the keys in the cache,
|
|
9180
|
+
* in order from most recently used to least recently used.
|
|
9181
|
+
*/
|
|
9182
|
+
*keys() {
|
|
9183
|
+
for (const i2 of this.#indexes()) {
|
|
9184
|
+
const k = this.#keyList[i2];
|
|
9185
|
+
k !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield k);
|
|
9186
|
+
}
|
|
9187
|
+
}
|
|
9188
|
+
/**
|
|
9189
|
+
* Inverse order version of {@link LRUCache.keys}
|
|
9190
|
+
*
|
|
9191
|
+
* Return a generator yielding the keys in the cache,
|
|
9192
|
+
* in order from least recently used to most recently used.
|
|
9193
|
+
*/
|
|
9194
|
+
*rkeys() {
|
|
9195
|
+
for (const i2 of this.#rindexes()) {
|
|
9196
|
+
const k = this.#keyList[i2];
|
|
9197
|
+
k !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield k);
|
|
9198
|
+
}
|
|
9199
|
+
}
|
|
9200
|
+
/**
|
|
9201
|
+
* Return a generator yielding the values in the cache,
|
|
9202
|
+
* in order from most recently used to least recently used.
|
|
9203
|
+
*/
|
|
9204
|
+
*values() {
|
|
9205
|
+
for (const i2 of this.#indexes())
|
|
9206
|
+
this.#valList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield this.#valList[i2]);
|
|
9207
|
+
}
|
|
9208
|
+
/**
|
|
9209
|
+
* Inverse order version of {@link LRUCache.values}
|
|
9210
|
+
*
|
|
9211
|
+
* Return a generator yielding the values in the cache,
|
|
9212
|
+
* in order from least recently used to most recently used.
|
|
9213
|
+
*/
|
|
9214
|
+
*rvalues() {
|
|
9215
|
+
for (const i2 of this.#rindexes())
|
|
9216
|
+
this.#valList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2]) && (yield this.#valList[i2]);
|
|
9217
|
+
}
|
|
9218
|
+
/**
|
|
9219
|
+
* Iterating over the cache itself yields the same results as
|
|
9220
|
+
* {@link LRUCache.entries}
|
|
9221
|
+
*/
|
|
9222
|
+
[Symbol.iterator]() {
|
|
9223
|
+
return this.entries();
|
|
9224
|
+
}
|
|
9225
|
+
/**
|
|
9226
|
+
* A String value that is used in the creation of the default string
|
|
9227
|
+
* description of an object. Called by the built-in method
|
|
9228
|
+
* `Object.prototype.toString`.
|
|
9229
|
+
*/
|
|
9230
|
+
[Symbol.toStringTag] = "LRUCache";
|
|
9231
|
+
/**
|
|
9232
|
+
* Find a value for which the supplied fn method returns a truthy value,
|
|
9233
|
+
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
9234
|
+
*/
|
|
9235
|
+
find(fn, getOptions = {}) {
|
|
9236
|
+
for (const i2 of this.#indexes()) {
|
|
9237
|
+
const v = this.#valList[i2], value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9238
|
+
if (value !== void 0 && fn(value, this.#keyList[i2], this))
|
|
9239
|
+
return this.get(this.#keyList[i2], getOptions);
|
|
9240
|
+
}
|
|
9241
|
+
}
|
|
9242
|
+
/**
|
|
9243
|
+
* Call the supplied function on each item in the cache, in order from most
|
|
9244
|
+
* recently used to least recently used.
|
|
9245
|
+
*
|
|
9246
|
+
* `fn` is called as `fn(value, key, cache)`.
|
|
9247
|
+
*
|
|
9248
|
+
* If `thisp` is provided, function will be called in the `this`-context of
|
|
9249
|
+
* the provided object, or the cache if no `thisp` object is provided.
|
|
9250
|
+
*
|
|
9251
|
+
* Does not update age or recenty of use, or iterate over stale values.
|
|
9252
|
+
*/
|
|
9253
|
+
forEach(fn, thisp = this) {
|
|
9254
|
+
for (const i2 of this.#indexes()) {
|
|
9255
|
+
const v = this.#valList[i2], value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9256
|
+
value !== void 0 && fn.call(thisp, value, this.#keyList[i2], this);
|
|
9257
|
+
}
|
|
9258
|
+
}
|
|
9259
|
+
/**
|
|
9260
|
+
* The same as {@link LRUCache.forEach} but items are iterated over in
|
|
9261
|
+
* reverse order. (ie, less recently used items are iterated over first.)
|
|
9262
|
+
*/
|
|
9263
|
+
rforEach(fn, thisp = this) {
|
|
9264
|
+
for (const i2 of this.#rindexes()) {
|
|
9265
|
+
const v = this.#valList[i2], value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9266
|
+
value !== void 0 && fn.call(thisp, value, this.#keyList[i2], this);
|
|
9267
|
+
}
|
|
9268
|
+
}
|
|
9269
|
+
/**
|
|
9270
|
+
* Delete any stale entries. Returns true if anything was removed,
|
|
9271
|
+
* false otherwise.
|
|
9272
|
+
*/
|
|
9273
|
+
purgeStale() {
|
|
9274
|
+
let deleted = !1;
|
|
9275
|
+
for (const i2 of this.#rindexes({ allowStale: !0 }))
|
|
9276
|
+
this.#isStale(i2) && (this.#delete(this.#keyList[i2], "expire"), deleted = !0);
|
|
9277
|
+
return deleted;
|
|
9278
|
+
}
|
|
9279
|
+
/**
|
|
9280
|
+
* Get the extended info about a given entry, to get its value, size, and
|
|
9281
|
+
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
9282
|
+
*
|
|
9283
|
+
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
9284
|
+
* serialization, the `start` value is always the current timestamp, and the
|
|
9285
|
+
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
9286
|
+
*
|
|
9287
|
+
* Always returns stale values, if their info is found in the cache, so be
|
|
9288
|
+
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
9289
|
+
* if relevant.
|
|
9290
|
+
*/
|
|
9291
|
+
info(key) {
|
|
9292
|
+
const i2 = this.#keyMap.get(key);
|
|
9293
|
+
if (i2 === void 0)
|
|
9294
|
+
return;
|
|
9295
|
+
const v = this.#valList[i2], value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9296
|
+
if (value === void 0)
|
|
9297
|
+
return;
|
|
9298
|
+
const entry = { value };
|
|
9299
|
+
if (this.#ttls && this.#starts) {
|
|
9300
|
+
const ttl = this.#ttls[i2], start = this.#starts[i2];
|
|
9301
|
+
if (ttl && start) {
|
|
9302
|
+
const remain = ttl - (perf.now() - start);
|
|
9303
|
+
entry.ttl = remain, entry.start = Date.now();
|
|
9304
|
+
}
|
|
9305
|
+
}
|
|
9306
|
+
return this.#sizes && (entry.size = this.#sizes[i2]), entry;
|
|
9307
|
+
}
|
|
9308
|
+
/**
|
|
9309
|
+
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
9310
|
+
* passed to {@link LRLUCache#load}.
|
|
9311
|
+
*
|
|
9312
|
+
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
9313
|
+
* timestamp, even if `performance.now()` is available.
|
|
9314
|
+
*
|
|
9315
|
+
* Stale entries are always included in the `dump`, even if
|
|
9316
|
+
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
9317
|
+
*
|
|
9318
|
+
* Note: this returns an actual array, not a generator, so it can be more
|
|
9319
|
+
* easily passed around.
|
|
9320
|
+
*/
|
|
9321
|
+
dump() {
|
|
9322
|
+
const arr = [];
|
|
9323
|
+
for (const i2 of this.#indexes({ allowStale: !0 })) {
|
|
9324
|
+
const key = this.#keyList[i2], v = this.#valList[i2], value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9325
|
+
if (value === void 0 || key === void 0)
|
|
9326
|
+
continue;
|
|
9327
|
+
const entry = { value };
|
|
9328
|
+
if (this.#ttls && this.#starts) {
|
|
9329
|
+
entry.ttl = this.#ttls[i2];
|
|
9330
|
+
const age = perf.now() - this.#starts[i2];
|
|
9331
|
+
entry.start = Math.floor(Date.now() - age);
|
|
9332
|
+
}
|
|
9333
|
+
this.#sizes && (entry.size = this.#sizes[i2]), arr.unshift([key, entry]);
|
|
9334
|
+
}
|
|
9335
|
+
return arr;
|
|
9336
|
+
}
|
|
9337
|
+
/**
|
|
9338
|
+
* Reset the cache and load in the items in entries in the order listed.
|
|
9339
|
+
*
|
|
9340
|
+
* The shape of the resulting cache may be different if the same options are
|
|
9341
|
+
* not used in both caches.
|
|
9342
|
+
*
|
|
9343
|
+
* The `start` fields are assumed to be calculated relative to a portable
|
|
9344
|
+
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
9345
|
+
*/
|
|
9346
|
+
load(arr) {
|
|
9347
|
+
this.clear();
|
|
9348
|
+
for (const [key, entry] of arr) {
|
|
9349
|
+
if (entry.start) {
|
|
9350
|
+
const age = Date.now() - entry.start;
|
|
9351
|
+
entry.start = perf.now() - age;
|
|
9352
|
+
}
|
|
9353
|
+
this.set(key, entry.value, entry);
|
|
9354
|
+
}
|
|
9355
|
+
}
|
|
9356
|
+
/**
|
|
9357
|
+
* Add a value to the cache.
|
|
9358
|
+
*
|
|
9359
|
+
* Note: if `undefined` is specified as a value, this is an alias for
|
|
9360
|
+
* {@link LRUCache#delete}
|
|
9361
|
+
*
|
|
9362
|
+
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
9363
|
+
* their corresponding values in the constructor options for the scope
|
|
9364
|
+
* of this single `set()` operation.
|
|
9365
|
+
*
|
|
9366
|
+
* If `start` is provided, then that will set the effective start
|
|
9367
|
+
* time for the TTL calculation. Note that this must be a previous
|
|
9368
|
+
* value of `performance.now()` if supported, or a previous value of
|
|
9369
|
+
* `Date.now()` if not.
|
|
9370
|
+
*
|
|
9371
|
+
* Options object may also include `size`, which will prevent
|
|
9372
|
+
* calling the `sizeCalculation` function and just use the specified
|
|
9373
|
+
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
9374
|
+
* will prevent calling a `dispose` function in the case of
|
|
9375
|
+
* overwrites.
|
|
9376
|
+
*
|
|
9377
|
+
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
9378
|
+
* entry is greater than `maxEntrySize`, then the item will not be
|
|
9379
|
+
* added to the cache.
|
|
9380
|
+
*
|
|
9381
|
+
* Will update the recency of the entry.
|
|
9382
|
+
*
|
|
9383
|
+
* If the value is `undefined`, then this is an alias for
|
|
9384
|
+
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
9385
|
+
*/
|
|
9386
|
+
set(k, v, setOptions = {}) {
|
|
9387
|
+
if (v === void 0)
|
|
9388
|
+
return this.delete(k), this;
|
|
9389
|
+
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
|
9390
|
+
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
9391
|
+
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
|
9392
|
+
if (this.maxEntrySize && size > this.maxEntrySize)
|
|
9393
|
+
return status && (status.set = "miss", status.maxEntrySizeExceeded = !0), this.#delete(k, "set"), this;
|
|
9394
|
+
let index2 = this.#size === 0 ? void 0 : this.#keyMap.get(k);
|
|
9395
|
+
if (index2 === void 0)
|
|
9396
|
+
index2 = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(!1) : this.#size, this.#keyList[index2] = k, this.#valList[index2] = v, this.#keyMap.set(k, index2), this.#next[this.#tail] = index2, this.#prev[index2] = this.#tail, this.#tail = index2, this.#size++, this.#addItemSize(index2, size, status), status && (status.set = "add"), noUpdateTTL = !1;
|
|
9397
|
+
else {
|
|
9398
|
+
this.#moveToTail(index2);
|
|
9399
|
+
const oldVal = this.#valList[index2];
|
|
9400
|
+
if (v !== oldVal) {
|
|
9401
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
|
9402
|
+
oldVal.__abortController.abort(new Error("replaced"));
|
|
9403
|
+
const { __staleWhileFetching: s2 } = oldVal;
|
|
9404
|
+
s2 !== void 0 && !noDisposeOnSet && (this.#hasDispose && this.#dispose?.(s2, k, "set"), this.#hasDisposeAfter && this.#disposed?.push([s2, k, "set"]));
|
|
9405
|
+
} else noDisposeOnSet || (this.#hasDispose && this.#dispose?.(oldVal, k, "set"), this.#hasDisposeAfter && this.#disposed?.push([oldVal, k, "set"]));
|
|
9406
|
+
if (this.#removeItemSize(index2), this.#addItemSize(index2, size, status), this.#valList[index2] = v, status) {
|
|
9407
|
+
status.set = "replace";
|
|
9408
|
+
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
9409
|
+
oldValue !== void 0 && (status.oldValue = oldValue);
|
|
9410
|
+
}
|
|
9411
|
+
} else status && (status.set = "update");
|
|
9412
|
+
}
|
|
9413
|
+
if (ttl !== 0 && !this.#ttls && this.#initializeTTLTracking(), this.#ttls && (noUpdateTTL || this.#setItemTTL(index2, ttl, start), status && this.#statusTTL(status, index2)), !noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
|
9414
|
+
const dt = this.#disposed;
|
|
9415
|
+
let task;
|
|
9416
|
+
for (; task = dt?.shift(); )
|
|
9417
|
+
this.#disposeAfter?.(...task);
|
|
9418
|
+
}
|
|
9419
|
+
return this;
|
|
9420
|
+
}
|
|
9421
|
+
/**
|
|
9422
|
+
* Evict the least recently used item, returning its value or
|
|
9423
|
+
* `undefined` if cache is empty.
|
|
9424
|
+
*/
|
|
9425
|
+
pop() {
|
|
9426
|
+
try {
|
|
9427
|
+
for (; this.#size; ) {
|
|
9428
|
+
const val = this.#valList[this.#head];
|
|
9429
|
+
if (this.#evict(!0), this.#isBackgroundFetch(val)) {
|
|
9430
|
+
if (val.__staleWhileFetching)
|
|
9431
|
+
return val.__staleWhileFetching;
|
|
9432
|
+
} else if (val !== void 0)
|
|
9433
|
+
return val;
|
|
9434
|
+
}
|
|
9435
|
+
} finally {
|
|
9436
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
|
9437
|
+
const dt = this.#disposed;
|
|
9438
|
+
let task;
|
|
9439
|
+
for (; task = dt?.shift(); )
|
|
9440
|
+
this.#disposeAfter?.(...task);
|
|
9441
|
+
}
|
|
9442
|
+
}
|
|
9443
|
+
}
|
|
9444
|
+
#evict(free) {
|
|
9445
|
+
const head = this.#head, k = this.#keyList[head], v = this.#valList[head];
|
|
9446
|
+
return this.#hasFetchMethod && this.#isBackgroundFetch(v) ? v.__abortController.abort(new Error("evicted")) : (this.#hasDispose || this.#hasDisposeAfter) && (this.#hasDispose && this.#dispose?.(v, k, "evict"), this.#hasDisposeAfter && this.#disposed?.push([v, k, "evict"])), this.#removeItemSize(head), free && (this.#keyList[head] = void 0, this.#valList[head] = void 0, this.#free.push(head)), this.#size === 1 ? (this.#head = this.#tail = 0, this.#free.length = 0) : this.#head = this.#next[head], this.#keyMap.delete(k), this.#size--, head;
|
|
9447
|
+
}
|
|
9448
|
+
/**
|
|
9449
|
+
* Check if a key is in the cache, without updating the recency of use.
|
|
9450
|
+
* Will return false if the item is stale, even though it is technically
|
|
9451
|
+
* in the cache.
|
|
9452
|
+
*
|
|
9453
|
+
* Check if a key is in the cache, without updating the recency of
|
|
9454
|
+
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
9455
|
+
* to `true` in either the options or the constructor.
|
|
9456
|
+
*
|
|
9457
|
+
* Will return `false` if the item is stale, even though it is technically in
|
|
9458
|
+
* the cache. The difference can be determined (if it matters) by using a
|
|
9459
|
+
* `status` argument, and inspecting the `has` field.
|
|
9460
|
+
*
|
|
9461
|
+
* Will not update item age unless
|
|
9462
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
9463
|
+
*/
|
|
9464
|
+
has(k, hasOptions = {}) {
|
|
9465
|
+
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions, index2 = this.#keyMap.get(k);
|
|
9466
|
+
if (index2 !== void 0) {
|
|
9467
|
+
const v = this.#valList[index2];
|
|
9468
|
+
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === void 0)
|
|
9469
|
+
return !1;
|
|
9470
|
+
if (this.#isStale(index2))
|
|
9471
|
+
status && (status.has = "stale", this.#statusTTL(status, index2));
|
|
9472
|
+
else return updateAgeOnHas && this.#updateItemAge(index2), status && (status.has = "hit", this.#statusTTL(status, index2)), !0;
|
|
9473
|
+
} else status && (status.has = "miss");
|
|
9474
|
+
return !1;
|
|
9475
|
+
}
|
|
9476
|
+
/**
|
|
9477
|
+
* Like {@link LRUCache#get} but doesn't update recency or delete stale
|
|
9478
|
+
* items.
|
|
9479
|
+
*
|
|
9480
|
+
* Returns `undefined` if the item is stale, unless
|
|
9481
|
+
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
9482
|
+
*/
|
|
9483
|
+
peek(k, peekOptions = {}) {
|
|
9484
|
+
const { allowStale = this.allowStale } = peekOptions, index2 = this.#keyMap.get(k);
|
|
9485
|
+
if (index2 === void 0 || !allowStale && this.#isStale(index2))
|
|
9486
|
+
return;
|
|
9487
|
+
const v = this.#valList[index2];
|
|
9488
|
+
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
9489
|
+
}
|
|
9490
|
+
#backgroundFetch(k, index2, options, context) {
|
|
9491
|
+
const v = index2 === void 0 ? void 0 : this.#valList[index2];
|
|
9492
|
+
if (this.#isBackgroundFetch(v))
|
|
9493
|
+
return v;
|
|
9494
|
+
const ac = new AC(), { signal } = options;
|
|
9495
|
+
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
9496
|
+
signal: ac.signal
|
|
9497
|
+
});
|
|
9498
|
+
const fetchOpts = {
|
|
9499
|
+
signal: ac.signal,
|
|
9500
|
+
options,
|
|
9501
|
+
context
|
|
9502
|
+
}, cb = (v2, updateCache = !1) => {
|
|
9503
|
+
const { aborted } = ac.signal, ignoreAbort = options.ignoreFetchAbort && v2 !== void 0;
|
|
9504
|
+
if (options.status && (aborted && !updateCache ? (options.status.fetchAborted = !0, options.status.fetchError = ac.signal.reason, ignoreAbort && (options.status.fetchAbortIgnored = !0)) : options.status.fetchResolved = !0), aborted && !ignoreAbort && !updateCache)
|
|
9505
|
+
return fetchFail(ac.signal.reason);
|
|
9506
|
+
const bf2 = p2;
|
|
9507
|
+
return this.#valList[index2] === p2 && (v2 === void 0 ? bf2.__staleWhileFetching ? this.#valList[index2] = bf2.__staleWhileFetching : this.#delete(k, "fetch") : (options.status && (options.status.fetchUpdated = !0), this.set(k, v2, fetchOpts.options))), v2;
|
|
9508
|
+
}, eb = (er) => (options.status && (options.status.fetchRejected = !0, options.status.fetchError = er), fetchFail(er)), fetchFail = (er) => {
|
|
9509
|
+
const { aborted } = ac.signal, allowStaleAborted = aborted && options.allowStaleOnFetchAbort, allowStale = allowStaleAborted || options.allowStaleOnFetchRejection, noDelete = allowStale || options.noDeleteOnFetchRejection, bf2 = p2;
|
|
9510
|
+
if (this.#valList[index2] === p2 && (!noDelete || bf2.__staleWhileFetching === void 0 ? this.#delete(k, "fetch") : allowStaleAborted || (this.#valList[index2] = bf2.__staleWhileFetching)), allowStale)
|
|
9511
|
+
return options.status && bf2.__staleWhileFetching !== void 0 && (options.status.returnedStale = !0), bf2.__staleWhileFetching;
|
|
9512
|
+
if (bf2.__returned === bf2)
|
|
9513
|
+
throw er;
|
|
9514
|
+
}, pcall = (res, rej) => {
|
|
9515
|
+
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
9516
|
+
fmp && fmp instanceof Promise && fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej), ac.signal.addEventListener("abort", () => {
|
|
9517
|
+
(!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) && (res(void 0), options.allowStaleOnFetchAbort && (res = (v2) => cb(v2, !0)));
|
|
9518
|
+
});
|
|
9519
|
+
};
|
|
9520
|
+
options.status && (options.status.fetchDispatched = !0);
|
|
9521
|
+
const p2 = new Promise(pcall).then(cb, eb), bf = Object.assign(p2, {
|
|
9522
|
+
__abortController: ac,
|
|
9523
|
+
__staleWhileFetching: v,
|
|
9524
|
+
__returned: void 0
|
|
9525
|
+
});
|
|
9526
|
+
return index2 === void 0 ? (this.set(k, bf, { ...fetchOpts.options, status: void 0 }), index2 = this.#keyMap.get(k)) : this.#valList[index2] = bf, bf;
|
|
9527
|
+
}
|
|
9528
|
+
#isBackgroundFetch(p2) {
|
|
9529
|
+
if (!this.#hasFetchMethod)
|
|
9530
|
+
return !1;
|
|
9531
|
+
const b2 = p2;
|
|
9532
|
+
return !!b2 && b2 instanceof Promise && b2.hasOwnProperty("__staleWhileFetching") && b2.__abortController instanceof AC;
|
|
9533
|
+
}
|
|
9534
|
+
async fetch(k, fetchOptions = {}) {
|
|
9535
|
+
const {
|
|
9536
|
+
// get options
|
|
9537
|
+
allowStale = this.allowStale,
|
|
9538
|
+
updateAgeOnGet = this.updateAgeOnGet,
|
|
9539
|
+
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
|
9540
|
+
// set options
|
|
9541
|
+
ttl = this.ttl,
|
|
9542
|
+
noDisposeOnSet = this.noDisposeOnSet,
|
|
9543
|
+
size = 0,
|
|
9544
|
+
sizeCalculation = this.sizeCalculation,
|
|
9545
|
+
noUpdateTTL = this.noUpdateTTL,
|
|
9546
|
+
// fetch exclusive options
|
|
9547
|
+
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
|
9548
|
+
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
9549
|
+
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
9550
|
+
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
9551
|
+
context,
|
|
9552
|
+
forceRefresh = !1,
|
|
9553
|
+
status,
|
|
9554
|
+
signal
|
|
9555
|
+
} = fetchOptions;
|
|
9556
|
+
if (!this.#hasFetchMethod)
|
|
9557
|
+
return status && (status.fetch = "get"), this.get(k, {
|
|
9558
|
+
allowStale,
|
|
9559
|
+
updateAgeOnGet,
|
|
9560
|
+
noDeleteOnStaleGet,
|
|
9561
|
+
status
|
|
9562
|
+
});
|
|
9563
|
+
const options = {
|
|
9564
|
+
allowStale,
|
|
9565
|
+
updateAgeOnGet,
|
|
9566
|
+
noDeleteOnStaleGet,
|
|
9567
|
+
ttl,
|
|
9568
|
+
noDisposeOnSet,
|
|
9569
|
+
size,
|
|
9570
|
+
sizeCalculation,
|
|
9571
|
+
noUpdateTTL,
|
|
9572
|
+
noDeleteOnFetchRejection,
|
|
9573
|
+
allowStaleOnFetchRejection,
|
|
9574
|
+
allowStaleOnFetchAbort,
|
|
9575
|
+
ignoreFetchAbort,
|
|
9576
|
+
status,
|
|
9577
|
+
signal
|
|
9578
|
+
};
|
|
9579
|
+
let index2 = this.#keyMap.get(k);
|
|
9580
|
+
if (index2 === void 0) {
|
|
9581
|
+
status && (status.fetch = "miss");
|
|
9582
|
+
const p2 = this.#backgroundFetch(k, index2, options, context);
|
|
9583
|
+
return p2.__returned = p2;
|
|
9584
|
+
} else {
|
|
9585
|
+
const v = this.#valList[index2];
|
|
9586
|
+
if (this.#isBackgroundFetch(v)) {
|
|
9587
|
+
const stale = allowStale && v.__staleWhileFetching !== void 0;
|
|
9588
|
+
return status && (status.fetch = "inflight", stale && (status.returnedStale = !0)), stale ? v.__staleWhileFetching : v.__returned = v;
|
|
9589
|
+
}
|
|
9590
|
+
const isStale = this.#isStale(index2);
|
|
9591
|
+
if (!forceRefresh && !isStale)
|
|
9592
|
+
return status && (status.fetch = "hit"), this.#moveToTail(index2), updateAgeOnGet && this.#updateItemAge(index2), status && this.#statusTTL(status, index2), v;
|
|
9593
|
+
const p2 = this.#backgroundFetch(k, index2, options, context), staleVal = p2.__staleWhileFetching !== void 0 && allowStale;
|
|
9594
|
+
return status && (status.fetch = isStale ? "stale" : "refresh", staleVal && isStale && (status.returnedStale = !0)), staleVal ? p2.__staleWhileFetching : p2.__returned = p2;
|
|
9595
|
+
}
|
|
9596
|
+
}
|
|
9597
|
+
async forceFetch(k, fetchOptions = {}) {
|
|
9598
|
+
const v = await this.fetch(k, fetchOptions);
|
|
9599
|
+
if (v === void 0)
|
|
9600
|
+
throw new Error("fetch() returned undefined");
|
|
9601
|
+
return v;
|
|
9602
|
+
}
|
|
9603
|
+
memo(k, memoOptions = {}) {
|
|
9604
|
+
const memoMethod = this.#memoMethod;
|
|
9605
|
+
if (!memoMethod)
|
|
9606
|
+
throw new Error("no memoMethod provided to constructor");
|
|
9607
|
+
const { context, forceRefresh, ...options } = memoOptions, v = this.get(k, options);
|
|
9608
|
+
if (!forceRefresh && v !== void 0)
|
|
9609
|
+
return v;
|
|
9610
|
+
const vv = memoMethod(k, v, {
|
|
9611
|
+
options,
|
|
9612
|
+
context
|
|
9613
|
+
});
|
|
9614
|
+
return this.set(k, vv, options), vv;
|
|
9615
|
+
}
|
|
9616
|
+
/**
|
|
9617
|
+
* Return a value from the cache. Will update the recency of the cache
|
|
9618
|
+
* entry found.
|
|
9619
|
+
*
|
|
9620
|
+
* If the key is not found, get() will return `undefined`.
|
|
9621
|
+
*/
|
|
9622
|
+
get(k, getOptions = {}) {
|
|
9623
|
+
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions, index2 = this.#keyMap.get(k);
|
|
9624
|
+
if (index2 !== void 0) {
|
|
9625
|
+
const value = this.#valList[index2], fetching = this.#isBackgroundFetch(value);
|
|
9626
|
+
return status && this.#statusTTL(status, index2), this.#isStale(index2) ? (status && (status.get = "stale"), fetching ? (status && allowStale && value.__staleWhileFetching !== void 0 && (status.returnedStale = !0), allowStale ? value.__staleWhileFetching : void 0) : (noDeleteOnStaleGet || this.#delete(k, "expire"), status && allowStale && (status.returnedStale = !0), allowStale ? value : void 0)) : (status && (status.get = "hit"), fetching ? value.__staleWhileFetching : (this.#moveToTail(index2), updateAgeOnGet && this.#updateItemAge(index2), value));
|
|
9627
|
+
} else status && (status.get = "miss");
|
|
9628
|
+
}
|
|
9629
|
+
#connect(p2, n2) {
|
|
9630
|
+
this.#prev[n2] = p2, this.#next[p2] = n2;
|
|
9631
|
+
}
|
|
9632
|
+
#moveToTail(index2) {
|
|
9633
|
+
index2 !== this.#tail && (index2 === this.#head ? this.#head = this.#next[index2] : this.#connect(this.#prev[index2], this.#next[index2]), this.#connect(this.#tail, index2), this.#tail = index2);
|
|
9634
|
+
}
|
|
9635
|
+
/**
|
|
9636
|
+
* Deletes a key out of the cache.
|
|
9637
|
+
*
|
|
9638
|
+
* Returns true if the key was deleted, false otherwise.
|
|
9639
|
+
*/
|
|
9640
|
+
delete(k) {
|
|
9641
|
+
return this.#delete(k, "delete");
|
|
9642
|
+
}
|
|
9643
|
+
#delete(k, reason) {
|
|
9644
|
+
let deleted = !1;
|
|
9645
|
+
if (this.#size !== 0) {
|
|
9646
|
+
const index2 = this.#keyMap.get(k);
|
|
9647
|
+
if (index2 !== void 0)
|
|
9648
|
+
if (deleted = !0, this.#size === 1)
|
|
9649
|
+
this.#clear(reason);
|
|
9650
|
+
else {
|
|
9651
|
+
this.#removeItemSize(index2);
|
|
9652
|
+
const v = this.#valList[index2];
|
|
9653
|
+
if (this.#isBackgroundFetch(v) ? v.__abortController.abort(new Error("deleted")) : (this.#hasDispose || this.#hasDisposeAfter) && (this.#hasDispose && this.#dispose?.(v, k, reason), this.#hasDisposeAfter && this.#disposed?.push([v, k, reason])), this.#keyMap.delete(k), this.#keyList[index2] = void 0, this.#valList[index2] = void 0, index2 === this.#tail)
|
|
9654
|
+
this.#tail = this.#prev[index2];
|
|
9655
|
+
else if (index2 === this.#head)
|
|
9656
|
+
this.#head = this.#next[index2];
|
|
9657
|
+
else {
|
|
9658
|
+
const pi2 = this.#prev[index2];
|
|
9659
|
+
this.#next[pi2] = this.#next[index2];
|
|
9660
|
+
const ni = this.#next[index2];
|
|
9661
|
+
this.#prev[ni] = this.#prev[index2];
|
|
9662
|
+
}
|
|
9663
|
+
this.#size--, this.#free.push(index2);
|
|
6714
9664
|
}
|
|
6715
|
-
},
|
|
6716
|
-
children: /* @__PURE__ */ jsx(DiagramContext.Provider, { value: store.current, children })
|
|
6717
9665
|
}
|
|
6718
|
-
|
|
9666
|
+
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
|
9667
|
+
const dt = this.#disposed;
|
|
9668
|
+
let task;
|
|
9669
|
+
for (; task = dt?.shift(); )
|
|
9670
|
+
this.#disposeAfter?.(...task);
|
|
9671
|
+
}
|
|
9672
|
+
return deleted;
|
|
9673
|
+
}
|
|
9674
|
+
/**
|
|
9675
|
+
* Clear the cache entirely, throwing away all values.
|
|
9676
|
+
*/
|
|
9677
|
+
clear() {
|
|
9678
|
+
return this.#clear("delete");
|
|
9679
|
+
}
|
|
9680
|
+
#clear(reason) {
|
|
9681
|
+
for (const index2 of this.#rindexes({ allowStale: !0 })) {
|
|
9682
|
+
const v = this.#valList[index2];
|
|
9683
|
+
if (this.#isBackgroundFetch(v))
|
|
9684
|
+
v.__abortController.abort(new Error("deleted"));
|
|
9685
|
+
else {
|
|
9686
|
+
const k = this.#keyList[index2];
|
|
9687
|
+
this.#hasDispose && this.#dispose?.(v, k, reason), this.#hasDisposeAfter && this.#disposed?.push([v, k, reason]);
|
|
9688
|
+
}
|
|
9689
|
+
}
|
|
9690
|
+
if (this.#keyMap.clear(), this.#valList.fill(void 0), this.#keyList.fill(void 0), this.#ttls && this.#starts && (this.#ttls.fill(0), this.#starts.fill(0)), this.#sizes && this.#sizes.fill(0), this.#head = 0, this.#tail = 0, this.#free.length = 0, this.#calculatedSize = 0, this.#size = 0, this.#hasDisposeAfter && this.#disposed) {
|
|
9691
|
+
const dt = this.#disposed;
|
|
9692
|
+
let task;
|
|
9693
|
+
for (; task = dt?.shift(); )
|
|
9694
|
+
this.#disposeAfter?.(...task);
|
|
9695
|
+
}
|
|
9696
|
+
}
|
|
6719
9697
|
}
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
return useStoreWithEqualityFn(store, selector2, equalityFn ?? shallowEqual);
|
|
9698
|
+
var isMergeableObject = function(value) {
|
|
9699
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
9700
|
+
};
|
|
9701
|
+
function isNonNullObject(value) {
|
|
9702
|
+
return !!value && typeof value == "object";
|
|
6726
9703
|
}
|
|
6727
|
-
function
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
9704
|
+
function isSpecial(value) {
|
|
9705
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
9706
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
9707
|
+
}
|
|
9708
|
+
var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
9709
|
+
function isReactElement(value) {
|
|
9710
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
9711
|
+
}
|
|
9712
|
+
function emptyTarget(val) {
|
|
9713
|
+
return Array.isArray(val) ? [] : {};
|
|
9714
|
+
}
|
|
9715
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
9716
|
+
return options.clone !== !1 && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
9717
|
+
}
|
|
9718
|
+
function defaultArrayMerge(target, source, options) {
|
|
9719
|
+
return target.concat(source).map(function(element) {
|
|
9720
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
9721
|
+
});
|
|
9722
|
+
}
|
|
9723
|
+
function getMergeFunction(key, options) {
|
|
9724
|
+
if (!options.customMerge)
|
|
9725
|
+
return deepmerge;
|
|
9726
|
+
var customMerge = options.customMerge(key);
|
|
9727
|
+
return typeof customMerge == "function" ? customMerge : deepmerge;
|
|
9728
|
+
}
|
|
9729
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
9730
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
9731
|
+
return Object.propertyIsEnumerable.call(target, symbol);
|
|
9732
|
+
}) : [];
|
|
9733
|
+
}
|
|
9734
|
+
function getKeys(target) {
|
|
9735
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
9736
|
+
}
|
|
9737
|
+
function propertyIsOnObject(object2, property) {
|
|
9738
|
+
try {
|
|
9739
|
+
return property in object2;
|
|
9740
|
+
} catch {
|
|
9741
|
+
return !1;
|
|
9742
|
+
}
|
|
9743
|
+
}
|
|
9744
|
+
function propertyIsUnsafe(target, key) {
|
|
9745
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
9746
|
+
}
|
|
9747
|
+
function mergeObject(target, source, options) {
|
|
9748
|
+
var destination = {};
|
|
9749
|
+
return options.isMergeableObject(target) && getKeys(target).forEach(function(key) {
|
|
9750
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
9751
|
+
}), getKeys(source).forEach(function(key) {
|
|
9752
|
+
propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options)(target[key], source[key], options) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options));
|
|
9753
|
+
}), destination;
|
|
9754
|
+
}
|
|
9755
|
+
function deepmerge(target, source, options) {
|
|
9756
|
+
options = options || {}, options.arrayMerge = options.arrayMerge || defaultArrayMerge, options.isMergeableObject = options.isMergeableObject || isMergeableObject, options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
9757
|
+
var sourceIsArray = Array.isArray(source), targetIsArray = Array.isArray(target), sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
9758
|
+
return sourceAndTargetTypesMatch ? sourceIsArray ? options.arrayMerge(target, source, options) : mergeObject(target, source, options) : cloneUnlessOtherwiseSpecified(source, options);
|
|
9759
|
+
}
|
|
9760
|
+
deepmerge.all = function(array2, options) {
|
|
9761
|
+
if (!Array.isArray(array2))
|
|
9762
|
+
throw new Error("first argument should be an array");
|
|
9763
|
+
return array2.reduce(function(prev, next) {
|
|
9764
|
+
return deepmerge(prev, next, options);
|
|
9765
|
+
}, {});
|
|
9766
|
+
};
|
|
9767
|
+
var localClassNames = /* @__PURE__ */ new Set(), composedClassLists = [], bufferedCSSObjs = [], browserRuntimeAdapter = {
|
|
9768
|
+
appendCss: (cssObj) => {
|
|
9769
|
+
bufferedCSSObjs.push(cssObj);
|
|
9770
|
+
},
|
|
9771
|
+
registerClassName: (className) => {
|
|
9772
|
+
localClassNames.add(className);
|
|
9773
|
+
},
|
|
9774
|
+
registerComposition: (composition) => {
|
|
9775
|
+
composedClassLists.push(composition);
|
|
9776
|
+
},
|
|
9777
|
+
markCompositionUsed: () => {
|
|
9778
|
+
},
|
|
9779
|
+
onEndFileScope: (fileScope) => {
|
|
9780
|
+
var css = transformCss({
|
|
9781
|
+
localClassNames: Array.from(localClassNames),
|
|
9782
|
+
composedClassLists,
|
|
9783
|
+
cssObjs: bufferedCSSObjs
|
|
9784
|
+
}).join(`
|
|
9785
|
+
`);
|
|
9786
|
+
injectStyles({
|
|
9787
|
+
fileScope,
|
|
9788
|
+
css
|
|
9789
|
+
}), bufferedCSSObjs = [];
|
|
9790
|
+
},
|
|
9791
|
+
getIdentOption: () => "short"
|
|
9792
|
+
};
|
|
9793
|
+
setAdapterIfNotSet(browserRuntimeAdapter);
|
|
9794
|
+
var getLastSlashBeforeIndex = (path, index2) => {
|
|
9795
|
+
for (var pathIndex = index2 - 1; pathIndex >= 0; ) {
|
|
9796
|
+
if (path[pathIndex] === "/")
|
|
9797
|
+
return pathIndex;
|
|
9798
|
+
pathIndex--;
|
|
9799
|
+
}
|
|
9800
|
+
return -1;
|
|
9801
|
+
}, _getDebugFileName = (path) => {
|
|
9802
|
+
var file, lastIndexOfDotCss = path.lastIndexOf(".css");
|
|
9803
|
+
if (lastIndexOfDotCss === -1)
|
|
9804
|
+
return "";
|
|
9805
|
+
var lastSlashIndex = getLastSlashBeforeIndex(path, lastIndexOfDotCss);
|
|
9806
|
+
if (file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss), lastSlashIndex === -1)
|
|
9807
|
+
return file;
|
|
9808
|
+
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1), dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex), debugFileName = file !== "index" ? file : dir;
|
|
9809
|
+
return debugFileName;
|
|
9810
|
+
}, memoizedGetDebugFileName = () => {
|
|
9811
|
+
var cache = new LRUCache({
|
|
9812
|
+
max: 500
|
|
9813
|
+
});
|
|
9814
|
+
return (path) => {
|
|
9815
|
+
var cachedResult = cache.get(path);
|
|
9816
|
+
if (cachedResult)
|
|
9817
|
+
return cachedResult;
|
|
9818
|
+
var result = _getDebugFileName(path);
|
|
9819
|
+
return cache.set(path, result), result;
|
|
9820
|
+
};
|
|
9821
|
+
};
|
|
9822
|
+
memoizedGetDebugFileName();
|
|
9823
|
+
function createGlobalThemeContract(tokens, mapFn) {
|
|
9824
|
+
return walkObject(tokens, (value, path) => {
|
|
9825
|
+
var rawVarName = typeof mapFn == "function" ? mapFn(value, path) : value, varName = typeof rawVarName == "string" ? rawVarName.replace(/^\-\-/, "") : null;
|
|
9826
|
+
if (typeof varName != "string" || varName !== cssesc$1(varName, {
|
|
9827
|
+
isIdentifier: !0
|
|
9828
|
+
}))
|
|
9829
|
+
throw new Error('Invalid variable name for "'.concat(path.join("."), '": ').concat(varName));
|
|
9830
|
+
return "var(--".concat(varName, ")");
|
|
9831
|
+
});
|
|
6732
9832
|
}
|
|
6733
|
-
|
|
9833
|
+
const vars = createGlobalThemeContract({
|
|
9834
|
+
safariAnimationHook: "safari-animation-hook",
|
|
9835
|
+
default: {
|
|
9836
|
+
font: "default-font-family"
|
|
9837
|
+
},
|
|
9838
|
+
likec4: {
|
|
9839
|
+
font: "font-family",
|
|
9840
|
+
background: {
|
|
9841
|
+
color: "background-color",
|
|
9842
|
+
pattern: {
|
|
9843
|
+
color: "background-pattern-color"
|
|
9844
|
+
}
|
|
9845
|
+
}
|
|
9846
|
+
},
|
|
9847
|
+
compound: {
|
|
9848
|
+
font: "compound-font-family",
|
|
9849
|
+
titleColor: "compound-title-color"
|
|
9850
|
+
},
|
|
9851
|
+
element: {
|
|
9852
|
+
font: "element-font-family",
|
|
9853
|
+
fill: "element-fill",
|
|
9854
|
+
stroke: "element-stroke",
|
|
9855
|
+
hiContrast: "element-hiContrast",
|
|
9856
|
+
loContrast: "element-loContrast"
|
|
9857
|
+
},
|
|
9858
|
+
relation: {
|
|
9859
|
+
lineColor: "relation-lineColor",
|
|
9860
|
+
labelColor: "relation-labelColor",
|
|
9861
|
+
labelBgColor: "relation-labelBg"
|
|
9862
|
+
},
|
|
9863
|
+
optionsPanel: {
|
|
9864
|
+
top: "options-webview-top",
|
|
9865
|
+
right: "options-webview-right"
|
|
9866
|
+
},
|
|
9867
|
+
navigationPanel: {
|
|
9868
|
+
top: "navigation-webview-top",
|
|
9869
|
+
left: "navigation-webview-left"
|
|
9870
|
+
}
|
|
9871
|
+
}, (value) => `likec4-${value}`);
|
|
9872
|
+
createGlobalThemeContract({
|
|
9873
|
+
background: {
|
|
9874
|
+
color: "background-color",
|
|
9875
|
+
pattern: {
|
|
9876
|
+
color: "background-pattern-color"
|
|
9877
|
+
// dots: 'background-pattern-dots-color',
|
|
9878
|
+
// lines: 'background-pattern-lines-color',
|
|
9879
|
+
// cross: 'background-pattern-cross-color'
|
|
9880
|
+
}
|
|
9881
|
+
},
|
|
9882
|
+
edge: {
|
|
9883
|
+
stroke: "edge-stroke",
|
|
9884
|
+
strokeSelected: "edge-stroke-selected",
|
|
9885
|
+
labelColor: "edge-label-color",
|
|
9886
|
+
labelBgColor: "edge-label-background-color",
|
|
9887
|
+
strokeWidth: "edge-stroke-width"
|
|
9888
|
+
},
|
|
9889
|
+
node: {
|
|
9890
|
+
color: "node-color",
|
|
9891
|
+
border: "node-border",
|
|
9892
|
+
backgroundColor: "node-background-color",
|
|
9893
|
+
groupBackgroundColor: "node-group-background-color",
|
|
9894
|
+
boxshadowHover: "node-boxshadow-hover",
|
|
9895
|
+
boxshadowSelected: "node-boxshadow-selected",
|
|
9896
|
+
borderRadius: "node-border-radius"
|
|
9897
|
+
}
|
|
9898
|
+
}, (value) => `xy-${value}`);
|
|
9899
|
+
const mantine = themeToVars({});
|
|
6734
9900
|
function LikeC4CustomColors({ customColors }) {
|
|
6735
9901
|
function toStyle(name, colorValues) {
|
|
6736
9902
|
const rules = new Array(
|
|
@@ -6902,10 +10068,6 @@ function SelectEdgesOnNodeFocus() {
|
|
|
6902
10068
|
] : []
|
|
6903
10069
|
), null;
|
|
6904
10070
|
}
|
|
6905
|
-
function getVarName(variable) {
|
|
6906
|
-
var matches = variable.match(/^var\((.*)\)$/);
|
|
6907
|
-
return matches ? matches[1] : variable;
|
|
6908
|
-
}
|
|
6909
10071
|
function assignInlineVars(varsOrContract, tokens) {
|
|
6910
10072
|
var styles = {};
|
|
6911
10073
|
{
|
|
@@ -7439,7 +10601,7 @@ const curveCatmullRomOpen = function custom4(alpha2) {
|
|
|
7439
10601
|
ODot
|
|
7440
10602
|
};
|
|
7441
10603
|
/**
|
|
7442
|
-
* @license @tabler/icons-react v3.
|
|
10604
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7443
10605
|
*
|
|
7444
10606
|
* This source code is licensed under the MIT license.
|
|
7445
10607
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -7466,7 +10628,7 @@ var defaultAttributes = {
|
|
|
7466
10628
|
}
|
|
7467
10629
|
};
|
|
7468
10630
|
/**
|
|
7469
|
-
* @license @tabler/icons-react v3.
|
|
10631
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7470
10632
|
*
|
|
7471
10633
|
* This source code is licensed under the MIT license.
|
|
7472
10634
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -7499,216 +10661,216 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
7499
10661
|
return Component2.displayName = `${iconNamePascal}`, Component2;
|
|
7500
10662
|
};
|
|
7501
10663
|
/**
|
|
7502
|
-
* @license @tabler/icons-react v3.
|
|
10664
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7503
10665
|
*
|
|
7504
10666
|
* This source code is licensed under the MIT license.
|
|
7505
10667
|
* See the LICENSE file in the root directory of this source tree.
|
|
7506
10668
|
*/
|
|
7507
10669
|
var IconAlertTriangle = createReactComponent("outline", "alert-triangle", "IconAlertTriangle", [["path", { d: "M12 9v4", key: "svg-0" }], ["path", { d: "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", key: "svg-1" }], ["path", { d: "M12 16h.01", key: "svg-2" }]]);
|
|
7508
10670
|
/**
|
|
7509
|
-
* @license @tabler/icons-react v3.
|
|
10671
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7510
10672
|
*
|
|
7511
10673
|
* This source code is licensed under the MIT license.
|
|
7512
10674
|
* See the LICENSE file in the root directory of this source tree.
|
|
7513
10675
|
*/
|
|
7514
10676
|
var IconArrowBigDownLines = createReactComponent("outline", "arrow-big-down-lines", "IconArrowBigDownLines", [["path", { d: "M15 12h3.586a1 1 0 0 1 .707 1.707l-6.586 6.586a1 1 0 0 1 -1.414 0l-6.586 -6.586a1 1 0 0 1 .707 -1.707h3.586v-3h6v3z", key: "svg-0" }], ["path", { d: "M15 3h-6", key: "svg-1" }], ["path", { d: "M15 6h-6", key: "svg-2" }]]);
|
|
7515
10677
|
/**
|
|
7516
|
-
* @license @tabler/icons-react v3.
|
|
10678
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7517
10679
|
*
|
|
7518
10680
|
* This source code is licensed under the MIT license.
|
|
7519
10681
|
* See the LICENSE file in the root directory of this source tree.
|
|
7520
10682
|
*/
|
|
7521
10683
|
var IconArrowDownRight = createReactComponent("outline", "arrow-down-right", "IconArrowDownRight", [["path", { d: "M7 7l10 10", key: "svg-0" }], ["path", { d: "M17 8l0 9l-9 0", key: "svg-1" }]]);
|
|
7522
10684
|
/**
|
|
7523
|
-
* @license @tabler/icons-react v3.
|
|
10685
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7524
10686
|
*
|
|
7525
10687
|
* This source code is licensed under the MIT license.
|
|
7526
10688
|
* See the LICENSE file in the root directory of this source tree.
|
|
7527
10689
|
*/
|
|
7528
10690
|
var IconArrowLeft = createReactComponent("outline", "arrow-left", "IconArrowLeft", [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M5 12l6 6", key: "svg-1" }], ["path", { d: "M5 12l6 -6", key: "svg-2" }]]);
|
|
7529
10691
|
/**
|
|
7530
|
-
* @license @tabler/icons-react v3.
|
|
10692
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7531
10693
|
*
|
|
7532
10694
|
* This source code is licensed under the MIT license.
|
|
7533
10695
|
* See the LICENSE file in the root directory of this source tree.
|
|
7534
10696
|
*/
|
|
7535
10697
|
var IconArrowRight = createReactComponent("outline", "arrow-right", "IconArrowRight", [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]]);
|
|
7536
10698
|
/**
|
|
7537
|
-
* @license @tabler/icons-react v3.
|
|
10699
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7538
10700
|
*
|
|
7539
10701
|
* This source code is licensed under the MIT license.
|
|
7540
10702
|
* See the LICENSE file in the root directory of this source tree.
|
|
7541
10703
|
*/
|
|
7542
10704
|
var IconCheck = createReactComponent("outline", "check", "IconCheck", [["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]]);
|
|
7543
10705
|
/**
|
|
7544
|
-
* @license @tabler/icons-react v3.
|
|
10706
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7545
10707
|
*
|
|
7546
10708
|
* This source code is licensed under the MIT license.
|
|
7547
10709
|
* See the LICENSE file in the root directory of this source tree.
|
|
7548
10710
|
*/
|
|
7549
10711
|
var IconChevronDown = createReactComponent("outline", "chevron-down", "IconChevronDown", [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]]);
|
|
7550
10712
|
/**
|
|
7551
|
-
* @license @tabler/icons-react v3.
|
|
10713
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7552
10714
|
*
|
|
7553
10715
|
* This source code is licensed under the MIT license.
|
|
7554
10716
|
* See the LICENSE file in the root directory of this source tree.
|
|
7555
10717
|
*/
|
|
7556
10718
|
var IconChevronLeft = createReactComponent("outline", "chevron-left", "IconChevronLeft", [["path", { d: "M15 6l-6 6l6 6", key: "svg-0" }]]);
|
|
7557
10719
|
/**
|
|
7558
|
-
* @license @tabler/icons-react v3.
|
|
10720
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7559
10721
|
*
|
|
7560
10722
|
* This source code is licensed under the MIT license.
|
|
7561
10723
|
* See the LICENSE file in the root directory of this source tree.
|
|
7562
10724
|
*/
|
|
7563
10725
|
var IconChevronRight = createReactComponent("outline", "chevron-right", "IconChevronRight", [["path", { d: "M9 6l6 6l-6 6", key: "svg-0" }]]);
|
|
7564
10726
|
/**
|
|
7565
|
-
* @license @tabler/icons-react v3.
|
|
10727
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7566
10728
|
*
|
|
7567
10729
|
* This source code is licensed under the MIT license.
|
|
7568
10730
|
* See the LICENSE file in the root directory of this source tree.
|
|
7569
10731
|
*/
|
|
7570
10732
|
var IconCopy = createReactComponent("outline", "copy", "IconCopy", [["path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z", key: "svg-0" }], ["path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", key: "svg-1" }]]);
|
|
7571
10733
|
/**
|
|
7572
|
-
* @license @tabler/icons-react v3.
|
|
10734
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7573
10735
|
*
|
|
7574
10736
|
* This source code is licensed under the MIT license.
|
|
7575
10737
|
* See the LICENSE file in the root directory of this source tree.
|
|
7576
10738
|
*/
|
|
7577
10739
|
var IconExternalLink = createReactComponent("outline", "external-link", "IconExternalLink", [["path", { d: "M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6", key: "svg-0" }], ["path", { d: "M11 13l9 -9", key: "svg-1" }], ["path", { d: "M15 4h5v5", key: "svg-2" }]]);
|
|
7578
10740
|
/**
|
|
7579
|
-
* @license @tabler/icons-react v3.
|
|
10741
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7580
10742
|
*
|
|
7581
10743
|
* This source code is licensed under the MIT license.
|
|
7582
10744
|
* See the LICENSE file in the root directory of this source tree.
|
|
7583
10745
|
*/
|
|
7584
10746
|
var IconFileCode = createReactComponent("outline", "file-code", "IconFileCode", [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z", key: "svg-1" }], ["path", { d: "M10 13l-1 2l1 2", key: "svg-2" }], ["path", { d: "M14 13l1 2l-1 2", key: "svg-3" }]]);
|
|
7585
10747
|
/**
|
|
7586
|
-
* @license @tabler/icons-react v3.
|
|
10748
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7587
10749
|
*
|
|
7588
10750
|
* This source code is licensed under the MIT license.
|
|
7589
10751
|
* See the LICENSE file in the root directory of this source tree.
|
|
7590
10752
|
*/
|
|
7591
10753
|
var IconFileSymlink = createReactComponent("outline", "file-symlink", "IconFileSymlink", [["path", { d: "M4 21v-4a3 3 0 0 1 3 -3h5", key: "svg-0" }], ["path", { d: "M9 17l3 -3l-3 -3", key: "svg-1" }], ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-2" }], ["path", { d: "M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5", key: "svg-3" }]]);
|
|
7592
10754
|
/**
|
|
7593
|
-
* @license @tabler/icons-react v3.
|
|
10755
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7594
10756
|
*
|
|
7595
10757
|
* This source code is licensed under the MIT license.
|
|
7596
10758
|
* See the LICENSE file in the root directory of this source tree.
|
|
7597
10759
|
*/
|
|
7598
10760
|
var IconFocusCentered = createReactComponent("outline", "focus-centered", "IconFocusCentered", [["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }], ["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-1" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-2" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-3" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-4" }]]);
|
|
7599
10761
|
/**
|
|
7600
|
-
* @license @tabler/icons-react v3.
|
|
10762
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7601
10763
|
*
|
|
7602
10764
|
* This source code is licensed under the MIT license.
|
|
7603
10765
|
* See the LICENSE file in the root directory of this source tree.
|
|
7604
10766
|
*/
|
|
7605
10767
|
var IconFolderOpen = createReactComponent("outline", "folder-open", "IconFolderOpen", [["path", { d: "M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2", key: "svg-0" }]]);
|
|
7606
10768
|
/**
|
|
7607
|
-
* @license @tabler/icons-react v3.
|
|
10769
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7608
10770
|
*
|
|
7609
10771
|
* This source code is licensed under the MIT license.
|
|
7610
10772
|
* See the LICENSE file in the root directory of this source tree.
|
|
7611
10773
|
*/
|
|
7612
10774
|
var IconHelpCircle = createReactComponent("outline", "help-circle", "IconHelpCircle", [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", key: "svg-0" }], ["path", { d: "M12 16v.01", key: "svg-1" }], ["path", { d: "M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483", key: "svg-2" }]]);
|
|
7613
10775
|
/**
|
|
7614
|
-
* @license @tabler/icons-react v3.
|
|
10776
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7615
10777
|
*
|
|
7616
10778
|
* This source code is licensed under the MIT license.
|
|
7617
10779
|
* See the LICENSE file in the root directory of this source tree.
|
|
7618
10780
|
*/
|
|
7619
10781
|
var IconLayoutDashboard = createReactComponent("outline", "layout-dashboard", "IconLayoutDashboard", [["path", { d: "M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-0" }], ["path", { d: "M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-1" }], ["path", { d: "M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-2" }], ["path", { d: "M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-3" }]]);
|
|
7620
10782
|
/**
|
|
7621
|
-
* @license @tabler/icons-react v3.
|
|
10783
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7622
10784
|
*
|
|
7623
10785
|
* This source code is licensed under the MIT license.
|
|
7624
10786
|
* See the LICENSE file in the root directory of this source tree.
|
|
7625
10787
|
*/
|
|
7626
10788
|
var IconLink = createReactComponent("outline", "link", "IconLink", [["path", { d: "M9 15l6 -6", key: "svg-0" }], ["path", { d: "M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464", key: "svg-1" }], ["path", { d: "M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463", key: "svg-2" }]]);
|
|
7627
10789
|
/**
|
|
7628
|
-
* @license @tabler/icons-react v3.
|
|
10790
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7629
10791
|
*
|
|
7630
10792
|
* This source code is licensed under the MIT license.
|
|
7631
10793
|
* See the LICENSE file in the root directory of this source tree.
|
|
7632
10794
|
*/
|
|
7633
10795
|
var IconMenu2 = createReactComponent("outline", "menu-2", "IconMenu2", [["path", { d: "M4 6l16 0", key: "svg-0" }], ["path", { d: "M4 12l16 0", key: "svg-1" }], ["path", { d: "M4 18l16 0", key: "svg-2" }]]);
|
|
7634
10796
|
/**
|
|
7635
|
-
* @license @tabler/icons-react v3.
|
|
10797
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7636
10798
|
*
|
|
7637
10799
|
* This source code is licensed under the MIT license.
|
|
7638
10800
|
* See the LICENSE file in the root directory of this source tree.
|
|
7639
10801
|
*/
|
|
7640
10802
|
var IconMenu = createReactComponent("outline", "menu", "IconMenu", [["path", { d: "M4 8l16 0", key: "svg-0" }], ["path", { d: "M4 16l16 0", key: "svg-1" }]]);
|
|
7641
10803
|
/**
|
|
7642
|
-
* @license @tabler/icons-react v3.
|
|
10804
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7643
10805
|
*
|
|
7644
10806
|
* This source code is licensed under the MIT license.
|
|
7645
10807
|
* See the LICENSE file in the root directory of this source tree.
|
|
7646
10808
|
*/
|
|
7647
10809
|
var IconMoonStars = createReactComponent("outline", "moon-stars", "IconMoonStars", [["path", { d: "M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z", key: "svg-0" }], ["path", { d: "M17 4a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2", key: "svg-1" }], ["path", { d: "M19 11h2m-1 -1v2", key: "svg-2" }]]);
|
|
7648
10810
|
/**
|
|
7649
|
-
* @license @tabler/icons-react v3.
|
|
10811
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7650
10812
|
*
|
|
7651
10813
|
* This source code is licensed under the MIT license.
|
|
7652
10814
|
* See the LICENSE file in the root directory of this source tree.
|
|
7653
10815
|
*/
|
|
7654
10816
|
var IconRouteOff = createReactComponent("outline", "route-off", "IconRouteOff", [["path", { d: "M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-0" }], ["path", { d: "M18 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-1" }], ["path", { d: "M12 19h4.5c.71 0 1.372 -.212 1.924 -.576m1.545 -2.459a3.5 3.5 0 0 0 -3.469 -3.965h-.499m-4 0h-3.501a3.5 3.5 0 0 1 -2.477 -5.972m2.477 -1.028h3.5", key: "svg-2" }], ["path", { d: "M3 3l18 18", key: "svg-3" }]]);
|
|
7655
10817
|
/**
|
|
7656
|
-
* @license @tabler/icons-react v3.
|
|
10818
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7657
10819
|
*
|
|
7658
10820
|
* This source code is licensed under the MIT license.
|
|
7659
10821
|
* See the LICENSE file in the root directory of this source tree.
|
|
7660
10822
|
*/
|
|
7661
10823
|
var IconShare = createReactComponent("outline", "share", "IconShare", [["path", { d: "M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-0" }], ["path", { d: "M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-1" }], ["path", { d: "M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-2" }], ["path", { d: "M8.7 10.7l6.6 -3.4", key: "svg-3" }], ["path", { d: "M8.7 13.3l6.6 3.4", key: "svg-4" }]]);
|
|
7662
10824
|
/**
|
|
7663
|
-
* @license @tabler/icons-react v3.
|
|
10825
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7664
10826
|
*
|
|
7665
10827
|
* This source code is licensed under the MIT license.
|
|
7666
10828
|
* See the LICENSE file in the root directory of this source tree.
|
|
7667
10829
|
*/
|
|
7668
10830
|
var IconSun = createReactComponent("outline", "sun", "IconSun", [["path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-0" }], ["path", { d: "M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7", key: "svg-1" }]]);
|
|
7669
10831
|
/**
|
|
7670
|
-
* @license @tabler/icons-react v3.
|
|
10832
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7671
10833
|
*
|
|
7672
10834
|
* This source code is licensed under the MIT license.
|
|
7673
10835
|
* See the LICENSE file in the root directory of this source tree.
|
|
7674
10836
|
*/
|
|
7675
10837
|
var IconZoomScan = createReactComponent("outline", "zoom-scan", "IconZoomScan", [["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-0" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-1" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-2" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-3" }], ["path", { d: "M8 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", key: "svg-4" }], ["path", { d: "M16 16l-2.5 -2.5", key: "svg-5" }]]);
|
|
7676
10838
|
/**
|
|
7677
|
-
* @license @tabler/icons-react v3.
|
|
10839
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7678
10840
|
*
|
|
7679
10841
|
* This source code is licensed under the MIT license.
|
|
7680
10842
|
* See the LICENSE file in the root directory of this source tree.
|
|
7681
10843
|
*/
|
|
7682
10844
|
var IconFolderFilled = createReactComponent("filled", "folder-filled", "IconFolderFilled", [["path", { d: "M9 3a1 1 0 0 1 .608 .206l.1 .087l2.706 2.707h6.586a3 3 0 0 1 2.995 2.824l.005 .176v8a3 3 0 0 1 -2.824 2.995l-.176 .005h-14a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-11a3 3 0 0 1 2.824 -2.995l.176 -.005h4z", key: "svg-0" }]]);
|
|
7683
10845
|
/**
|
|
7684
|
-
* @license @tabler/icons-react v3.
|
|
10846
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7685
10847
|
*
|
|
7686
10848
|
* This source code is licensed under the MIT license.
|
|
7687
10849
|
* See the LICENSE file in the root directory of this source tree.
|
|
7688
10850
|
*/
|
|
7689
10851
|
var IconPlayerPlayFilled = createReactComponent("filled", "player-play-filled", "IconPlayerPlayFilled", [["path", { d: "M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z", key: "svg-0" }]]);
|
|
7690
10852
|
/**
|
|
7691
|
-
* @license @tabler/icons-react v3.
|
|
10853
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7692
10854
|
*
|
|
7693
10855
|
* This source code is licensed under the MIT license.
|
|
7694
10856
|
* See the LICENSE file in the root directory of this source tree.
|
|
7695
10857
|
*/
|
|
7696
10858
|
var IconPlayerSkipBackFilled = createReactComponent("filled", "player-skip-back-filled", "IconPlayerSkipBackFilled", [["path", { d: "M19.496 4.136l-12 7a1 1 0 0 0 0 1.728l12 7a1 1 0 0 0 1.504 -.864v-14a1 1 0 0 0 -1.504 -.864z", key: "svg-0" }], ["path", { d: "M4 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
|
|
7697
10859
|
/**
|
|
7698
|
-
* @license @tabler/icons-react v3.
|
|
10860
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7699
10861
|
*
|
|
7700
10862
|
* This source code is licensed under the MIT license.
|
|
7701
10863
|
* See the LICENSE file in the root directory of this source tree.
|
|
7702
10864
|
*/
|
|
7703
10865
|
var IconPlayerSkipForwardFilled = createReactComponent("filled", "player-skip-forward-filled", "IconPlayerSkipForwardFilled", [["path", { d: "M3 5v14a1 1 0 0 0 1.504 .864l12 -7a1 1 0 0 0 0 -1.728l-12 -7a1 1 0 0 0 -1.504 .864z", key: "svg-0" }], ["path", { d: "M20 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
|
|
7704
10866
|
/**
|
|
7705
|
-
* @license @tabler/icons-react v3.
|
|
10867
|
+
* @license @tabler/icons-react v3.19.0 - MIT
|
|
7706
10868
|
*
|
|
7707
10869
|
* This source code is licensed under the MIT license.
|
|
7708
10870
|
* See the LICENSE file in the root directory of this source tree.
|
|
7709
10871
|
*/
|
|
7710
10872
|
var IconPlayerStopFilled = createReactComponent("filled", "player-stop-filled", "IconPlayerStopFilled", [["path", { d: "M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z", key: "svg-0" }]]), container$5 = "yi2p6v1", dimmed$2 = "yi2p6v2", edgePathBg = "yi2p6v3", markerContext = "yi2p6v4", controlPoint = "yi2p6v5", controlDragging = "yi2p6v6", cssEdgePath = "yi2p6v8", stepEdgeNumber = "yi2p6v9", varLabelX = "var(--yi2p6va)", varLabelY = "var(--yi2p6vb)", edgeLabel = "yi2p6vd", edgeLabelText = "yi2p6ve", edgeNoteCloseButton = "yi2p6vf", edgeNoteText = "yi2p6vg", cssNavigateBtn$1 = "yi2p6vh", cssNavigateBtnIcon = "yi2p6vi", menuDropdown = "_1gqkcc30", menuItemRelationship = "_1gqkcc31", endpoint = "_1gqkcc32", title$3 = "_1gqkcc33";
|
|
7711
|
-
const stopPropagation = (e2) => e2.stopPropagation(), Tooltip$
|
|
10873
|
+
const stopPropagation = (e2) => e2.stopPropagation(), Tooltip$1 = Tooltip$2.withProps({
|
|
7712
10874
|
color: "gray",
|
|
7713
10875
|
fz: "xs",
|
|
7714
10876
|
openDelay: 300,
|
|
@@ -7743,17 +10905,19 @@ function RelationshipsDropdownMenu({
|
|
|
7743
10905
|
);
|
|
7744
10906
|
if (direct.length + nested.length === 0)
|
|
7745
10907
|
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
7746
|
-
const renderRelationship = (relationship) => /* @__PURE__ */
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
10908
|
+
const renderRelationship = (relationship, index2) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10909
|
+
index2 > 0 && /* @__PURE__ */ jsx(MenuDivider, { opacity: 0.65 }),
|
|
10910
|
+
/* @__PURE__ */ jsx(
|
|
10911
|
+
MenuItem,
|
|
10912
|
+
{
|
|
10913
|
+
component: Relationship,
|
|
10914
|
+
relationship,
|
|
10915
|
+
sourceNode: sourceXYNode.data.element,
|
|
10916
|
+
targetNode: targetXYNode.data.element,
|
|
10917
|
+
edge
|
|
10918
|
+
}
|
|
10919
|
+
)
|
|
10920
|
+
] }, relationship.id);
|
|
7757
10921
|
return /* @__PURE__ */ jsxs(
|
|
7758
10922
|
Menu,
|
|
7759
10923
|
{
|
|
@@ -7811,20 +10975,20 @@ const Relationship = forwardRef$1(({
|
|
|
7811
10975
|
hasOnOpenSourceRelation: !!s2.onOpenSourceRelation,
|
|
7812
10976
|
hasOnNavigateTo: !!s2.onNavigateTo
|
|
7813
10977
|
})), sourceId = nameFromFqn(edge.source) + r2.source.id.slice(edge.source.length), targetId = nameFromFqn(edge.target) + r2.target.id.slice(edge.target.length), navigateTo = hasOnNavigateTo && r2.relationship.navigateTo !== viewId ? r2.relationship.navigateTo : void 0;
|
|
7814
|
-
return /* @__PURE__ */ jsxs(Stack, { ref, className: clsx(menuItemRelationship, className), ...props2, children: [
|
|
10978
|
+
return /* @__PURE__ */ jsxs(Stack$1, { ref, className: clsx(menuItemRelationship, className), ...props2, children: [
|
|
7815
10979
|
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
7816
10980
|
/* @__PURE__ */ jsx(Text$1, { component: "div", className: endpoint, "data-likec4-color": sourceNode.color, children: sourceId }),
|
|
7817
10981
|
/* @__PURE__ */ jsx(IconArrowRight, { stroke: 2.5, size: 11 }),
|
|
7818
10982
|
/* @__PURE__ */ jsx(Text$1, { component: "div", className: endpoint, "data-likec4-color": targetNode.color, children: targetId }),
|
|
7819
10983
|
(navigateTo || hasOnOpenSourceRelation) && /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 100, children: [
|
|
7820
10984
|
/* @__PURE__ */ jsx(Space, { w: "xs" }),
|
|
7821
|
-
navigateTo && /* @__PURE__ */ jsx(Tooltip$
|
|
7822
|
-
ActionIcon$
|
|
10985
|
+
navigateTo && /* @__PURE__ */ jsx(Tooltip$1, { label: "Open dynamic view", children: /* @__PURE__ */ jsx(
|
|
10986
|
+
ActionIcon$1,
|
|
7823
10987
|
{
|
|
7824
10988
|
className: clsx("nodrag nopan"),
|
|
7825
10989
|
size: "sm",
|
|
7826
10990
|
radius: "sm",
|
|
7827
|
-
variant: "
|
|
10991
|
+
variant: "default",
|
|
7828
10992
|
onPointerDownCapture: stopPropagation,
|
|
7829
10993
|
onClick: (event) => {
|
|
7830
10994
|
diagramApi.getState().onNavigateTo?.(navigateTo, event);
|
|
@@ -7833,13 +10997,13 @@ const Relationship = forwardRef$1(({
|
|
|
7833
10997
|
children: /* @__PURE__ */ jsx(IconZoomScan, { size: "80%", stroke: 2 })
|
|
7834
10998
|
}
|
|
7835
10999
|
) }),
|
|
7836
|
-
hasOnOpenSourceRelation && /* @__PURE__ */ jsx(Tooltip$
|
|
7837
|
-
ActionIcon$
|
|
11000
|
+
hasOnOpenSourceRelation && /* @__PURE__ */ jsx(Tooltip$1, { label: "Open source", children: /* @__PURE__ */ jsx(
|
|
11001
|
+
ActionIcon$1,
|
|
7838
11002
|
{
|
|
7839
11003
|
className: clsx("nodrag nopan"),
|
|
7840
11004
|
size: "sm",
|
|
7841
11005
|
radius: "sm",
|
|
7842
|
-
variant: "
|
|
11006
|
+
variant: "default",
|
|
7843
11007
|
onPointerDownCapture: stopPropagation,
|
|
7844
11008
|
onClick: (event) => {
|
|
7845
11009
|
event.stopPropagation(), diagramApi.getState().onOpenSourceRelation?.(r2.id);
|
|
@@ -7913,7 +11077,7 @@ const Relationship = forwardRef$1(({
|
|
|
7913
11077
|
/* @__PURE__ */ jsxs(
|
|
7914
11078
|
PopoverDropdown,
|
|
7915
11079
|
{
|
|
7916
|
-
component: Stack,
|
|
11080
|
+
component: Stack$1,
|
|
7917
11081
|
p: "xs",
|
|
7918
11082
|
onPointerDownCapture: (e2) => e2.stopPropagation(),
|
|
7919
11083
|
onClick: (e2) => e2.stopPropagation(),
|
|
@@ -7951,7 +11115,7 @@ const Relationship = forwardRef$1(({
|
|
|
7951
11115
|
function NavigateToBtn$1({ viewId }) {
|
|
7952
11116
|
const diagramApi = useDiagramStoreApi();
|
|
7953
11117
|
return /* @__PURE__ */ jsx(
|
|
7954
|
-
ActionIcon$
|
|
11118
|
+
ActionIcon$1,
|
|
7955
11119
|
{
|
|
7956
11120
|
className: clsx("nodrag nopan", cssNavigateBtn$1),
|
|
7957
11121
|
size: "sm",
|
|
@@ -8096,21 +11260,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => is
|
|
|
8096
11260
|
50,
|
|
8097
11261
|
300
|
|
8098
11262
|
), (isModified || isControlPointDragging) && (labelX = labelPos.x, labelY = labelPos.y);
|
|
8099
|
-
const
|
|
8100
|
-
const {
|
|
8101
|
-
if (!domNode || e2.pointerType !== "mouse")
|
|
8102
|
-
return;
|
|
11263
|
+
const onLmbControlPointerDown = (index2, e2, domNode) => {
|
|
11264
|
+
const { addSelectedEdges } = xyflowStore.getState(), { xyflow } = diagramStore.getState();
|
|
8103
11265
|
addSelectedEdges([id2]);
|
|
8104
|
-
const { xyflow } = diagramStore.getState();
|
|
8105
|
-
if (e2.button === 2 && controlPoints.length > 1) {
|
|
8106
|
-
const newControlPoints = controlPoints.slice();
|
|
8107
|
-
newControlPoints.splice(index2, 1), e2.stopPropagation(), setTimeout(() => {
|
|
8108
|
-
xyflow.updateEdgeData(id2, { controlPoints: newControlPoints }), diagramStore.getState().scheduleSaveManualLayout();
|
|
8109
|
-
}, 10);
|
|
8110
|
-
return;
|
|
8111
|
-
}
|
|
8112
|
-
if (e2.button !== 0)
|
|
8113
|
-
return;
|
|
8114
11266
|
const wasCanceled = diagramStore.getState().cancelSaveManualLayout();
|
|
8115
11267
|
e2.stopPropagation();
|
|
8116
11268
|
let hasMoved = !1, pointer = { x: e2.clientX, y: e2.clientY };
|
|
@@ -8144,6 +11296,33 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => is
|
|
|
8144
11296
|
once: !0,
|
|
8145
11297
|
capture: !0
|
|
8146
11298
|
});
|
|
11299
|
+
}, onRmbControlPointerDown = (index2, e2, domNode) => {
|
|
11300
|
+
const { xyflow } = diagramStore.getState();
|
|
11301
|
+
if (controlPoints.length <= 1)
|
|
11302
|
+
return;
|
|
11303
|
+
const onPointerUp = (e22) => {
|
|
11304
|
+
const newControlPoints = controlPoints.slice();
|
|
11305
|
+
newControlPoints.splice(index2, 1), e22.stopPropagation(), setTimeout(() => {
|
|
11306
|
+
xyflow.updateEdgeData(id2, { controlPoints: newControlPoints }), diagramStore.getState().scheduleSaveManualLayout();
|
|
11307
|
+
}, 10), domNode.removeEventListener("pointerup", onPointerUp, {
|
|
11308
|
+
capture: !0
|
|
11309
|
+
}), e22.stopPropagation();
|
|
11310
|
+
};
|
|
11311
|
+
domNode.addEventListener("pointerup", onPointerUp, {
|
|
11312
|
+
once: !0,
|
|
11313
|
+
capture: !0
|
|
11314
|
+
}), e2.stopPropagation();
|
|
11315
|
+
}, onControlPointerDown = (index2, e2) => {
|
|
11316
|
+
const { domNode } = xyflowStore.getState();
|
|
11317
|
+
if (!(!domNode || e2.pointerType !== "mouse"))
|
|
11318
|
+
switch (e2.button) {
|
|
11319
|
+
case 0:
|
|
11320
|
+
onLmbControlPointerDown(index2, e2, domNode);
|
|
11321
|
+
break;
|
|
11322
|
+
case 2:
|
|
11323
|
+
onRmbControlPointerDown(index2, e2, domNode);
|
|
11324
|
+
break;
|
|
11325
|
+
}
|
|
8147
11326
|
}, onEdgePointerDown = (e2) => {
|
|
8148
11327
|
const { domNode } = xyflowStore.getState(), { xyflow, scheduleSaveManualLayout } = diagramStore.getState();
|
|
8149
11328
|
!domNode || e2.pointerType !== "mouse" || e2.button === 2 && (xyflow.updateEdgeData(id2, (edge) => {
|
|
@@ -8279,7 +11458,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => is
|
|
|
8279
11458
|
function NavigateToBtn({ xynodeId, className }) {
|
|
8280
11459
|
const diagramApi = useDiagramStoreApi();
|
|
8281
11460
|
return /* @__PURE__ */ jsx(
|
|
8282
|
-
ActionIcon$
|
|
11461
|
+
ActionIcon$1,
|
|
8283
11462
|
{
|
|
8284
11463
|
className: clsx("nodrag nopan", className),
|
|
8285
11464
|
radius: "md",
|
|
@@ -8442,7 +11621,7 @@ function ElementLink({
|
|
|
8442
11621
|
onPointerDownCapture: (e2) => e2.stopPropagation(),
|
|
8443
11622
|
onClick: (e2) => e2.stopPropagation(),
|
|
8444
11623
|
p: "xs",
|
|
8445
|
-
children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: element.links.map((link) => /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: "sm", children: [
|
|
11624
|
+
children: /* @__PURE__ */ jsx(Stack$1, { gap: "xs", children: element.links.map((link) => /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: "sm", children: [
|
|
8446
11625
|
/* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "clip", maxWidth: u(element.width, { min: 200, max: 400 }) }, children: /* @__PURE__ */ jsx(Anchor, { href: link.url, target: "_blank", fz: "13", truncate: "end", children: link.title || link.url }) }),
|
|
8447
11626
|
/* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
|
|
8448
11627
|
Button,
|
|
@@ -10009,8 +13188,9 @@ function createLayoutConstraints(xyflowApi, draggingNodeId) {
|
|
|
10009
13188
|
xynode,
|
|
10010
13189
|
parent: null
|
|
10011
13190
|
});
|
|
13191
|
+
const draggingNodes = new Set(nodeLookup.values().filter((x2) => x2.dragging === !0 || x2.id === draggingNodeId || x2.selected).map((x2) => x2.id));
|
|
10012
13192
|
for (; traverse.length > 0; ) {
|
|
10013
|
-
const { xynode, parent } = traverse.shift(), isDragging =
|
|
13193
|
+
const { xynode, parent } = traverse.shift(), isDragging = draggingNodes.has(xynode.id), shouldTraverse = !isDragging && xynode.type === "compound" && draggingNodes.values().some((x2) => isAncestor(xynode.id, x2)), rect = shouldTraverse ? new Compound(solver, xynode, parent) : new Leaf(solver, xynode, parent, isDragging);
|
|
10014
13194
|
rects.set(xynode.id, rect), shouldTraverse && parentLookup.get(xynode.id)?.forEach((child) => {
|
|
10015
13195
|
traverse.push({
|
|
10016
13196
|
xynode: child,
|
|
@@ -10019,7 +13199,7 @@ function createLayoutConstraints(xyflowApi, draggingNodeId) {
|
|
|
10019
13199
|
});
|
|
10020
13200
|
}
|
|
10021
13201
|
solver.updateVariables(), solver.maxIterations = 1e3;
|
|
10022
|
-
const rectsToUpdate = [...rects.values()].filter((r2) => r2.id
|
|
13202
|
+
const rectsToUpdate = [...rects.values()].filter((r2) => !draggingNodes.has(r2.id));
|
|
10023
13203
|
function updateXYFlowNodes() {
|
|
10024
13204
|
solver.updateVariables(), xyflowApi.getState().triggerNodeChanges(
|
|
10025
13205
|
rectsToUpdate.reduce((acc, r2) => (acc.push({
|
|
@@ -10502,7 +13682,7 @@ function DiagramTitlePanel() {
|
|
|
10502
13682
|
}
|
|
10503
13683
|
),
|
|
10504
13684
|
links && /* @__PURE__ */ jsx(
|
|
10505
|
-
Stack,
|
|
13685
|
+
Stack$1,
|
|
10506
13686
|
{
|
|
10507
13687
|
gap: 3,
|
|
10508
13688
|
justify: "stretch",
|
|
@@ -10731,7 +13911,7 @@ const ElementNotation = ({ value }) => {
|
|
|
10731
13911
|
)
|
|
10732
13912
|
}
|
|
10733
13913
|
),
|
|
10734
|
-
/* @__PURE__ */ jsxs(Stack, { gap: 4, flex: 1, children: [
|
|
13914
|
+
/* @__PURE__ */ jsxs(Stack$1, { gap: 4, flex: 1, children: [
|
|
10735
13915
|
/* @__PURE__ */ jsx(Group, { gap: 4, flex: "0 0 auto", children: value.kinds.map((kind) => /* @__PURE__ */ jsx(
|
|
10736
13916
|
Badge,
|
|
10737
13917
|
{
|
|
@@ -10794,10 +13974,10 @@ function NotationPanel() {
|
|
|
10794
13974
|
opacity: 0.6
|
|
10795
13975
|
},
|
|
10796
13976
|
className: clsx("react-flow__panel", container),
|
|
10797
|
-
children: /* @__PURE__ */ jsx(Tooltip$
|
|
13977
|
+
children: /* @__PURE__ */ jsx(Tooltip$2, { label: "View has no notations", color: "orange", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
10798
13978
|
ThemeIcon,
|
|
10799
13979
|
{
|
|
10800
|
-
size: "
|
|
13980
|
+
size: "lg",
|
|
10801
13981
|
variant: "light",
|
|
10802
13982
|
color: "orange",
|
|
10803
13983
|
radius: "md",
|
|
@@ -10817,10 +13997,10 @@ function NotationPanel() {
|
|
|
10817
13997
|
opacity: 0.6
|
|
10818
13998
|
},
|
|
10819
13999
|
className: clsx("react-flow__panel", container),
|
|
10820
|
-
children: /* @__PURE__ */ jsx(Tooltip$
|
|
10821
|
-
ActionIcon$
|
|
14000
|
+
children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Show notation", color: "dark", fz: "xs", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
14001
|
+
ActionIcon$1,
|
|
10822
14002
|
{
|
|
10823
|
-
size: "
|
|
14003
|
+
size: "lg",
|
|
10824
14004
|
variant: "light",
|
|
10825
14005
|
color: "gray",
|
|
10826
14006
|
radius: "md",
|
|
@@ -10858,7 +14038,7 @@ function NotationPanel() {
|
|
|
10858
14038
|
children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "first", radius: "xs", children: [
|
|
10859
14039
|
/* @__PURE__ */ jsxs(TabsList, { children: [
|
|
10860
14040
|
/* @__PURE__ */ jsx(
|
|
10861
|
-
ActionIcon$
|
|
14041
|
+
ActionIcon$1,
|
|
10862
14042
|
{
|
|
10863
14043
|
size: "md",
|
|
10864
14044
|
variant: "subtle",
|
|
@@ -10882,7 +14062,7 @@ function NotationPanel() {
|
|
|
10882
14062
|
maxHeight: `min(40vh, ${Math.max(height - 60, 50)}px)`
|
|
10883
14063
|
}
|
|
10884
14064
|
},
|
|
10885
|
-
children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: notations.map((n2, i2) => /* @__PURE__ */ jsx(ElementNotation, { value: n2 }, i2)) })
|
|
14065
|
+
children: /* @__PURE__ */ jsx(Stack$1, { gap: 0, children: notations.map((n2, i2) => /* @__PURE__ */ jsx(ElementNotation, { value: n2 }, i2)) })
|
|
10886
14066
|
}
|
|
10887
14067
|
) })
|
|
10888
14068
|
] })
|
|
@@ -10919,9 +14099,9 @@ const {
|
|
|
10919
14099
|
targets
|
|
10920
14100
|
});
|
|
10921
14101
|
};
|
|
10922
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
14102
|
+
return /* @__PURE__ */ jsxs(Stack$1, { gap: "xs", children: [
|
|
10923
14103
|
/* @__PURE__ */ jsxs(Group, { wrap: "nowrap", align: "flex-start", children: [
|
|
10924
|
-
/* @__PURE__ */ jsxs(Box, { flex: 1, children: [
|
|
14104
|
+
/* @__PURE__ */ jsxs(Box, { flex: 1, miw: 0, children: [
|
|
10925
14105
|
/* @__PURE__ */ jsxs(Text$1, { fz: rem(9), fw: "500", c: "dimmed", children: [
|
|
10926
14106
|
"ELEMENT",
|
|
10927
14107
|
rest.length > 0 ? "S" : ""
|
|
@@ -10929,7 +14109,7 @@ const {
|
|
|
10929
14109
|
/* @__PURE__ */ jsx(Text$1, { size: "xs", c: rest.length > 0 ? "dimmed" : "", truncate: !0, children: rest.length === 0 ? firstNode.data.element.title : "[ multiple ]" })
|
|
10930
14110
|
] }),
|
|
10931
14111
|
showGoToSource && /* @__PURE__ */ jsx(Box, { flex: 0, children: /* @__PURE__ */ jsx(
|
|
10932
|
-
ActionIcon$
|
|
14112
|
+
ActionIcon$1,
|
|
10933
14113
|
{
|
|
10934
14114
|
size: "sm",
|
|
10935
14115
|
variant: "light",
|
|
@@ -11006,7 +14186,7 @@ function Colors({
|
|
|
11006
14186
|
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(TooltipGroup, { openDelay: 400, closeDelay: 300, children: [
|
|
11007
14187
|
/* @__PURE__ */ jsx(Divider, { label: "color", labelPosition: "left" }),
|
|
11008
14188
|
/* @__PURE__ */ jsx(Flex, { mt: "xs", maw: 150, gap: "xs", justify: "flex-start", align: "flex-start", direction: "row", wrap: "wrap", children: themedColors.map(({ key, value }) => /* @__PURE__ */ jsx(
|
|
11009
|
-
Tooltip$
|
|
14189
|
+
Tooltip$2,
|
|
11010
14190
|
{
|
|
11011
14191
|
label: key,
|
|
11012
14192
|
fz: "xs",
|
|
@@ -11028,7 +14208,7 @@ function Colors({
|
|
|
11028
14208
|
key
|
|
11029
14209
|
)) }),
|
|
11030
14210
|
/* @__PURE__ */ jsx(Flex, { mt: "sm", maw: 150, gap: "xs", justify: "flex-start", align: "flex-start", direction: "row", wrap: "wrap", children: colors.map(({ key, value }) => /* @__PURE__ */ jsx(
|
|
11031
|
-
Tooltip$
|
|
14211
|
+
Tooltip$2,
|
|
11032
14212
|
{
|
|
11033
14213
|
label: key,
|
|
11034
14214
|
fz: "xs",
|
|
@@ -11184,35 +14364,27 @@ function OptionsPanel() {
|
|
|
11184
14364
|
viewId
|
|
11185
14365
|
) });
|
|
11186
14366
|
}
|
|
11187
|
-
const Tooltip
|
|
11188
|
-
color: "
|
|
14367
|
+
const Tooltip = Tooltip$2.withProps({
|
|
14368
|
+
color: "dark",
|
|
11189
14369
|
fz: "xs",
|
|
11190
14370
|
position: "right",
|
|
11191
14371
|
openDelay: 400,
|
|
11192
|
-
closeDelay:
|
|
14372
|
+
closeDelay: 150,
|
|
11193
14373
|
label: "",
|
|
11194
14374
|
children: null,
|
|
11195
|
-
offset: 8
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
14375
|
+
offset: 8
|
|
14376
|
+
}), ActionIcon = ActionIcon$1.withProps({
|
|
14377
|
+
classNames: {
|
|
14378
|
+
root: "action-icon"
|
|
14379
|
+
},
|
|
14380
|
+
variant: "default",
|
|
11200
14381
|
color: "gray"
|
|
11201
14382
|
});
|
|
11202
|
-
var backwardForwardButtons = "syg3oy0", panel = "syg3oy1",
|
|
11203
|
-
const
|
|
14383
|
+
var backwardForwardButtons = "syg3oy0", panel = "syg3oy1", actionIconGroup = "syg3oy2", autolayoutIcon = "syg3oy3", autolayoutIndicator = "syg3oy4";
|
|
14384
|
+
const DirectionActionIcon = ActionIcon$1.withProps({
|
|
11204
14385
|
size: "md",
|
|
11205
14386
|
variant: "subtle",
|
|
11206
14387
|
color: "gray"
|
|
11207
|
-
}), Tooltip = Tooltip$3.withProps({
|
|
11208
|
-
color: "gray",
|
|
11209
|
-
fz: "xs",
|
|
11210
|
-
position: "right",
|
|
11211
|
-
openDelay: 300,
|
|
11212
|
-
label: "",
|
|
11213
|
-
children: null,
|
|
11214
|
-
offset: 5,
|
|
11215
|
-
transitionProps: { transition: "fade", duration: 200 }
|
|
11216
14388
|
}), ChangeAutoLayoutButton = (props2) => {
|
|
11217
14389
|
const store = useDiagramStoreApi(), [rootRef, setRootRef] = useState$1(null), [controlsRefs, setControlsRefs] = useState$1({}), autoLayout = useDiagramState((s2) => s2.view.autoLayout), setControlRef = (name) => (node) => {
|
|
11218
14390
|
controlsRefs[name] = node, setControlsRefs(controlsRefs);
|
|
@@ -11238,62 +14410,54 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11238
14410
|
},
|
|
11239
14411
|
...props2,
|
|
11240
14412
|
children: [
|
|
11241
|
-
/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(
|
|
11242
|
-
ActionIcon$2,
|
|
11243
|
-
{
|
|
11244
|
-
className: "action-icon",
|
|
11245
|
-
variant: "light",
|
|
11246
|
-
color: "gray",
|
|
11247
|
-
children: /* @__PURE__ */ jsx(IconLayoutDashboard, { stroke: 1.3 })
|
|
11248
|
-
}
|
|
11249
|
-
) }),
|
|
14413
|
+
/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(Tooltip, { label: "Change Auto Layout", children: /* @__PURE__ */ jsx(ActionIcon, { children: /* @__PURE__ */ jsx(IconLayoutDashboard, {}) }) }) }),
|
|
11250
14414
|
/* @__PURE__ */ jsx(PopoverDropdown, { className: "likec4-top-left-panel", p: 8, pt: 4, children: /* @__PURE__ */ jsxs(Box, { pos: "relative", ref: setRootRef, children: [
|
|
11251
14415
|
/* @__PURE__ */ jsx(
|
|
11252
14416
|
FloatingIndicator,
|
|
11253
14417
|
{
|
|
11254
|
-
target: controlsRefs[autoLayout],
|
|
14418
|
+
target: controlsRefs[autoLayout.direction],
|
|
11255
14419
|
parent: rootRef,
|
|
11256
14420
|
className: autolayoutIndicator
|
|
11257
14421
|
}
|
|
11258
14422
|
),
|
|
11259
14423
|
/* @__PURE__ */ jsx(Box, { mb: 10, children: /* @__PURE__ */ jsx(Text$1, { inline: !0, fz: "xs", c: "dimmed", fw: 500, children: "Auto layout:" }) }),
|
|
11260
|
-
/* @__PURE__ */ jsx(TooltipGroup, { openDelay: 100, children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: 1, children: [
|
|
14424
|
+
/* @__PURE__ */ jsx(TooltipGroup, { openDelay: 100, children: /* @__PURE__ */ jsxs(Stack$1, { align: "center", gap: 1, children: [
|
|
11261
14425
|
/* @__PURE__ */ jsx(Tooltip, { label: "Top to Bottom", children: /* @__PURE__ */ jsx(
|
|
11262
|
-
|
|
14426
|
+
DirectionActionIcon,
|
|
11263
14427
|
{
|
|
11264
14428
|
className: autolayoutIcon,
|
|
11265
14429
|
ref: setControlRef("TB"),
|
|
11266
14430
|
onClick: setAutoLayout("TB"),
|
|
11267
|
-
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, {
|
|
14431
|
+
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, {})
|
|
11268
14432
|
}
|
|
11269
14433
|
) }),
|
|
11270
14434
|
/* @__PURE__ */ jsxs(Group, { gap: 30, children: [
|
|
11271
14435
|
/* @__PURE__ */ jsx(Tooltip, { label: "Left to Right", children: /* @__PURE__ */ jsx(
|
|
11272
|
-
|
|
14436
|
+
DirectionActionIcon,
|
|
11273
14437
|
{
|
|
11274
14438
|
className: autolayoutIcon,
|
|
11275
14439
|
ref: setControlRef("LR"),
|
|
11276
14440
|
onClick: setAutoLayout("LR"),
|
|
11277
|
-
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, {
|
|
14441
|
+
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, { style: { rotate: "270deg" } })
|
|
11278
14442
|
}
|
|
11279
14443
|
) }),
|
|
11280
14444
|
/* @__PURE__ */ jsx(Tooltip, { label: "Right to Left", children: /* @__PURE__ */ jsx(
|
|
11281
|
-
|
|
14445
|
+
DirectionActionIcon,
|
|
11282
14446
|
{
|
|
11283
14447
|
className: autolayoutIcon,
|
|
11284
14448
|
ref: setControlRef("RL"),
|
|
11285
14449
|
onClick: setAutoLayout("RL"),
|
|
11286
|
-
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, {
|
|
14450
|
+
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, { style: { rotate: "90deg" } })
|
|
11287
14451
|
}
|
|
11288
14452
|
) })
|
|
11289
14453
|
] }),
|
|
11290
14454
|
/* @__PURE__ */ jsx(Tooltip, { label: "Bottom to Top", children: /* @__PURE__ */ jsx(
|
|
11291
|
-
|
|
14455
|
+
DirectionActionIcon,
|
|
11292
14456
|
{
|
|
11293
14457
|
className: autolayoutIcon,
|
|
11294
14458
|
ref: setControlRef("BT"),
|
|
11295
14459
|
onClick: setAutoLayout("BT"),
|
|
11296
|
-
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, {
|
|
14460
|
+
children: /* @__PURE__ */ jsx(IconArrowBigDownLines, { style: { rotate: "180deg" } })
|
|
11297
14461
|
}
|
|
11298
14462
|
) })
|
|
11299
14463
|
] }) })
|
|
@@ -11311,14 +14475,15 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11311
14475
|
hasStepBack,
|
|
11312
14476
|
hasStepForward
|
|
11313
14477
|
} = useDiagramState(historySelector);
|
|
11314
|
-
return /* @__PURE__ */ jsxs(
|
|
14478
|
+
return /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsxs(
|
|
11315
14479
|
Group,
|
|
11316
14480
|
{
|
|
11317
14481
|
className: clsx(backwardForwardButtons, "likec4-navigation-webview"),
|
|
14482
|
+
align: "flex-start",
|
|
11318
14483
|
gap: "xs",
|
|
11319
14484
|
children: [
|
|
11320
14485
|
showBurgerMenu && /* @__PURE__ */ jsx(
|
|
11321
|
-
ActionIcon
|
|
14486
|
+
ActionIcon,
|
|
11322
14487
|
{
|
|
11323
14488
|
onClick: (e2) => {
|
|
11324
14489
|
e2.stopPropagation(), store.getState().onBurgerMenuClick?.();
|
|
@@ -11338,7 +14503,7 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11338
14503
|
transform: "translateX(-10px)"
|
|
11339
14504
|
},
|
|
11340
14505
|
children: /* @__PURE__ */ jsx(
|
|
11341
|
-
ActionIcon
|
|
14506
|
+
ActionIcon,
|
|
11342
14507
|
{
|
|
11343
14508
|
onClick: (e2) => {
|
|
11344
14509
|
e2.stopPropagation(), store.getState().goBack();
|
|
@@ -11360,7 +14525,7 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11360
14525
|
transform: "translateX(10px)"
|
|
11361
14526
|
},
|
|
11362
14527
|
children: /* @__PURE__ */ jsx(
|
|
11363
|
-
ActionIcon
|
|
14528
|
+
ActionIcon,
|
|
11364
14529
|
{
|
|
11365
14530
|
onClick: (e2) => {
|
|
11366
14531
|
e2.stopPropagation(), store.getState().goForward();
|
|
@@ -11374,7 +14539,7 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11374
14539
|
] })
|
|
11375
14540
|
]
|
|
11376
14541
|
}
|
|
11377
|
-
);
|
|
14542
|
+
) });
|
|
11378
14543
|
}, LayoutDriftNotification = (props2) => /* @__PURE__ */ jsxs(
|
|
11379
14544
|
HoverCard,
|
|
11380
14545
|
{
|
|
@@ -11383,15 +14548,10 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11383
14548
|
closeDelay: 100,
|
|
11384
14549
|
...props2,
|
|
11385
14550
|
children: [
|
|
11386
|
-
/* @__PURE__ */ jsx(HoverCardTarget, { children: /* @__PURE__ */
|
|
11387
|
-
|
|
11388
|
-
{
|
|
11389
|
-
|
|
11390
|
-
variant: "light",
|
|
11391
|
-
color: "orange",
|
|
11392
|
-
children: /* @__PURE__ */ jsx(IconAlertTriangle, {})
|
|
11393
|
-
}
|
|
11394
|
-
) }),
|
|
14551
|
+
/* @__PURE__ */ jsx(HoverCardTarget, { children: /* @__PURE__ */ jsxs(ActionIcon, { c: "orange", children: [
|
|
14552
|
+
/* @__PURE__ */ jsx(Overlay, { color: mantine.colors.orange.lightHover, backgroundOpacity: 1 }),
|
|
14553
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, {})
|
|
14554
|
+
] }) }),
|
|
11395
14555
|
/* @__PURE__ */ jsx(HoverCardDropdown, { p: "0", children: /* @__PURE__ */ jsxs(
|
|
11396
14556
|
Notification,
|
|
11397
14557
|
{
|
|
@@ -11416,8 +14576,8 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11416
14576
|
}
|
|
11417
14577
|
), ResetControlPointsButton = (props2) => {
|
|
11418
14578
|
const store = useDiagramStoreApi();
|
|
11419
|
-
return /* @__PURE__ */ jsx(Tooltip
|
|
11420
|
-
ActionIcon
|
|
14579
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: "Reset all control points", ...props2, children: /* @__PURE__ */ jsx(
|
|
14580
|
+
ActionIcon,
|
|
11421
14581
|
{
|
|
11422
14582
|
onClick: (e2) => {
|
|
11423
14583
|
e2.stopPropagation(), store.getState().resetEdgeControlPoints();
|
|
@@ -11446,70 +14606,45 @@ const ActionIcon = ActionIcon$2.withProps({
|
|
|
11446
14606
|
showResetControlPoints: s2.readonly !== !0 && s2.experimentalEdgeEditing === !0
|
|
11447
14607
|
};
|
|
11448
14608
|
}), portalProps = useMantinePortalProps();
|
|
11449
|
-
return /* @__PURE__ */ jsxs(
|
|
11450
|
-
Stack,
|
|
14609
|
+
return /* @__PURE__ */ jsx(TooltipGroup, { openDelay: 500, closeDelay: 150, children: /* @__PURE__ */ jsxs(
|
|
14610
|
+
Stack$1,
|
|
11451
14611
|
{
|
|
11452
14612
|
className: clsx(
|
|
11453
14613
|
"react-flow__panel",
|
|
11454
14614
|
panel,
|
|
11455
|
-
"likec4-top-left-
|
|
14615
|
+
"likec4-top-left-panel"
|
|
11456
14616
|
),
|
|
14617
|
+
align: "flex-start",
|
|
11457
14618
|
onClick: (e2) => e2.stopPropagation(),
|
|
11458
14619
|
gap: "xs",
|
|
11459
14620
|
children: [
|
|
11460
14621
|
showNavigationButtons && /* @__PURE__ */ jsx(BackwardForwardButtons, {}),
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
className: "action-icon",
|
|
11465
|
-
onClick: (e2) => {
|
|
11466
|
-
e2.stopPropagation(), store.getState().onOpenSourceView?.();
|
|
11467
|
-
},
|
|
11468
|
-
children: /* @__PURE__ */ jsx(IconFileSymlink, { stroke: 1.5 })
|
|
11469
|
-
}
|
|
11470
|
-
) }),
|
|
11471
|
-
showChangeAutoLayout && /* @__PURE__ */ jsx(ChangeAutoLayoutButton, { ...portalProps }),
|
|
11472
|
-
/* @__PURE__ */ jsxs(AnimatePresence, { children: [
|
|
11473
|
-
showLayoutDriftWarning && /* @__PURE__ */ jsx(
|
|
11474
|
-
m$1.div,
|
|
14622
|
+
/* @__PURE__ */ jsxs(ActionIconGroup, { className: actionIconGroup, orientation: "vertical", children: [
|
|
14623
|
+
showGoToSource && /* @__PURE__ */ jsx(Tooltip, { label: "Open source", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
14624
|
+
ActionIcon,
|
|
11475
14625
|
{
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
exit: {
|
|
11479
|
-
opacity: 0,
|
|
11480
|
-
transform: "translateX(-40%)"
|
|
14626
|
+
onClick: (e2) => {
|
|
14627
|
+
e2.stopPropagation(), store.getState().onOpenSourceView?.();
|
|
11481
14628
|
},
|
|
11482
|
-
children: /* @__PURE__ */ jsx(
|
|
11483
|
-
}
|
|
11484
|
-
|
|
11485
|
-
),
|
|
14629
|
+
children: /* @__PURE__ */ jsx(IconFileSymlink, { stroke: 1.5 })
|
|
14630
|
+
}
|
|
14631
|
+
) }),
|
|
14632
|
+
showChangeAutoLayout && /* @__PURE__ */ jsx(ChangeAutoLayoutButton, { ...portalProps }),
|
|
14633
|
+
showLayoutDriftWarning && /* @__PURE__ */ jsx(LayoutDriftNotification, { ...portalProps }),
|
|
11486
14634
|
showResetControlPoints && /* @__PURE__ */ jsx(ResetControlPointsButton, { ...portalProps }),
|
|
11487
|
-
showFitDiagram && /* @__PURE__ */ jsx(
|
|
11488
|
-
|
|
14635
|
+
showFitDiagram && /* @__PURE__ */ jsx(Tooltip, { label: viewportChanged ? "Center camera" : "Camera is centered", ...portalProps, children: /* @__PURE__ */ jsx(
|
|
14636
|
+
ActionIcon,
|
|
11489
14637
|
{
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
exit: {
|
|
11493
|
-
opacity: 0,
|
|
11494
|
-
transform: "translateX(-30%)"
|
|
14638
|
+
onClick: (e2) => {
|
|
14639
|
+
e2.stopPropagation(), store.getState().fitDiagram();
|
|
11495
14640
|
},
|
|
11496
|
-
children: /* @__PURE__ */ jsx(
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
className: "action-icon",
|
|
11500
|
-
onClick: (e2) => {
|
|
11501
|
-
e2.stopPropagation(), store.getState().fitDiagram();
|
|
11502
|
-
},
|
|
11503
|
-
children: /* @__PURE__ */ jsx(IconFocusCentered, {})
|
|
11504
|
-
}
|
|
11505
|
-
) })
|
|
11506
|
-
},
|
|
11507
|
-
"fit-view"
|
|
11508
|
-
)
|
|
14641
|
+
children: /* @__PURE__ */ jsx(IconFocusCentered, {})
|
|
14642
|
+
}
|
|
14643
|
+
) })
|
|
11509
14644
|
] })
|
|
11510
14645
|
]
|
|
11511
14646
|
}
|
|
11512
|
-
);
|
|
14647
|
+
) });
|
|
11513
14648
|
};
|
|
11514
14649
|
TopLeftPanel.displayName = "TopLeftPanel";
|
|
11515
14650
|
function literalToEnum(value) {
|
|
@@ -11551,7 +14686,7 @@ const XYFlowInner = /* @__PURE__ */ memo$1(function({
|
|
|
11551
14686
|
}));
|
|
11552
14687
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
11553
14688
|
background !== "transparent" && background !== "solid" && /* @__PURE__ */ jsx(XYFlowBackground, { background }),
|
|
11554
|
-
controls && /* @__PURE__ */ jsx(Controls, { position: "
|
|
14689
|
+
controls && /* @__PURE__ */ jsx(Controls, { showInteractive: !1, position: "top-center" }),
|
|
11555
14690
|
/* @__PURE__ */ jsx(TopLeftPanel, {}),
|
|
11556
14691
|
!readonly && /* @__PURE__ */ jsx(OptionsPanel, {}),
|
|
11557
14692
|
showDiagramTitle && !isDynamicViewActive && /* @__PURE__ */ jsx(DiagramTitlePanel, {}),
|
|
@@ -11839,7 +14974,7 @@ const ViewCard = memo$1(({ viewId }) => {
|
|
|
11839
14974
|
radius: "sm",
|
|
11840
14975
|
withBorder: !0,
|
|
11841
14976
|
children: [
|
|
11842
|
-
/* @__PURE__ */ jsx(Card.Section, { children: /* @__PURE__ */ jsx(DiagramPreview, { diagram }) }),
|
|
14977
|
+
/* @__PURE__ */ jsx(Card.Section, { children: /* @__PURE__ */ jsx(DiagramPreview$1, { diagram }) }),
|
|
11843
14978
|
/* @__PURE__ */ jsx(Group, { justify: "space-between", mt: "md", mb: "xs", children: /* @__PURE__ */ jsx(Text$1, { fw: 500, children: title2 }) }),
|
|
11844
14979
|
/* @__PURE__ */ jsx(Text$1, { size: "sm", c: "dimmed", children: description2 }),
|
|
11845
14980
|
/* @__PURE__ */ jsx(Link, { to: "/view/$viewId", params: { viewId: id2 }, search: !0, className: cardLink })
|
|
@@ -11847,7 +14982,7 @@ const ViewCard = memo$1(({ viewId }) => {
|
|
|
11847
14982
|
}
|
|
11848
14983
|
);
|
|
11849
14984
|
});
|
|
11850
|
-
function DiagramPreview({ diagram }) {
|
|
14985
|
+
function DiagramPreview$1({ diagram }) {
|
|
11851
14986
|
const { ref, inViewport } = useInViewport(), [visible, setVisible] = useState$1(inViewport);
|
|
11852
14987
|
return useLayoutEffect$1(() => {
|
|
11853
14988
|
inViewport && !visible && setVisible(!0);
|
|
@@ -11863,7 +14998,7 @@ function DiagramPreview({ diagram }) {
|
|
|
11863
14998
|
}
|
|
11864
14999
|
) });
|
|
11865
15000
|
}
|
|
11866
|
-
const OverviewGraph = /* @__PURE__ */ lazy(() => import("./-index-overview-
|
|
15001
|
+
const OverviewGraph = /* @__PURE__ */ lazy(() => import("./-index-overview-Csz814YU.js"));
|
|
11867
15002
|
function WithOverviewGraph() {
|
|
11868
15003
|
return /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(OverviewGraph, {}) });
|
|
11869
15004
|
}
|
|
@@ -12058,14 +15193,14 @@ let atom = (initialValue) => {
|
|
|
12058
15193
|
return $atom;
|
|
12059
15194
|
};
|
|
12060
15195
|
const MOUNT = 5, UNMOUNT = 6, REVERT_MUTATION = 10;
|
|
12061
|
-
let on = (
|
|
12062
|
-
|
|
15196
|
+
let on = (object2, listener, eventKey, mutateStore) => (object2.events = object2.events || {}, object2.events[eventKey + REVERT_MUTATION] || (object2.events[eventKey + REVERT_MUTATION] = mutateStore((eventProps) => {
|
|
15197
|
+
object2.events[eventKey].reduceRight((event, l2) => (l2(event), event), {
|
|
12063
15198
|
shared: {},
|
|
12064
15199
|
...eventProps
|
|
12065
15200
|
});
|
|
12066
|
-
})),
|
|
12067
|
-
let currentListeners =
|
|
12068
|
-
currentListeners.splice(index2, 1), currentListeners.length || (delete
|
|
15201
|
+
})), object2.events[eventKey] = object2.events[eventKey] || [], object2.events[eventKey].push(listener), () => {
|
|
15202
|
+
let currentListeners = object2.events[eventKey], index2 = currentListeners.indexOf(listener);
|
|
15203
|
+
currentListeners.splice(index2, 1), currentListeners.length || (delete object2.events[eventKey], object2.events[eventKey + REVERT_MUTATION](), delete object2.events[eventKey + REVERT_MUTATION]);
|
|
12069
15204
|
}), STORE_UNMOUNT_DELAY = 1e3, onMount = ($store, initialize) => on($store, (payload) => {
|
|
12070
15205
|
let destroy = initialize(payload);
|
|
12071
15206
|
destroy && $store.events[UNMOUNT].push(destroy);
|
|
@@ -12164,7 +15299,7 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
|
|
|
12164
15299
|
}
|
|
12165
15300
|
},
|
|
12166
15301
|
levelOffset: "md",
|
|
12167
|
-
renderNode: ({ node, expanded, elementProps, hasChildren }) => /* @__PURE__ */ jsx(
|
|
15302
|
+
renderNode: ({ node, expanded, elementProps, hasChildren }) => /* @__PURE__ */ jsx(DiagramPreviewHoverCard, { viewId: hasChildren ? null : node.value, ...elementProps, children: /* @__PURE__ */ jsx(
|
|
12168
15303
|
Button,
|
|
12169
15304
|
{
|
|
12170
15305
|
fullWidth: !0,
|
|
@@ -12192,7 +15327,40 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
|
|
|
12192
15327
|
) })
|
|
12193
15328
|
}
|
|
12194
15329
|
) });
|
|
12195
|
-
})
|
|
15330
|
+
});
|
|
15331
|
+
function DiagramPreviewHoverCard({
|
|
15332
|
+
viewId,
|
|
15333
|
+
children,
|
|
15334
|
+
...props2
|
|
15335
|
+
}) {
|
|
15336
|
+
return viewId ? /* @__PURE__ */ jsx(Box, { ...props2, children: /* @__PURE__ */ jsx(DiagramPreview, { viewId, onClick: props2.onClick, children }) }) : /* @__PURE__ */ jsx(Box, { ...props2, children });
|
|
15337
|
+
}
|
|
15338
|
+
function DiagramPreview({
|
|
15339
|
+
viewId,
|
|
15340
|
+
children,
|
|
15341
|
+
onClick
|
|
15342
|
+
}) {
|
|
15343
|
+
const diagram = useLikeC4DiagramView(viewId);
|
|
15344
|
+
if (!diagram)
|
|
15345
|
+
return children;
|
|
15346
|
+
const ratio = Math.max(diagram.bounds.width / 400, diagram.bounds.height / 300), width = Math.round(diagram.bounds.width / ratio), height = Math.round(diagram.bounds.height / ratio);
|
|
15347
|
+
return /* @__PURE__ */ jsxs(HoverCard, { position: "right-start", openDelay: 300, keepMounted: !1, shadow: "lg", children: [
|
|
15348
|
+
/* @__PURE__ */ jsx(HoverCardTarget, { children }),
|
|
15349
|
+
/* @__PURE__ */ jsx(HoverCardDropdown, { style: { width, height }, p: "xs", onClick, children: /* @__PURE__ */ jsx(
|
|
15350
|
+
StaticLikeC4Diagram,
|
|
15351
|
+
{
|
|
15352
|
+
view: diagram,
|
|
15353
|
+
keepAspectRatio: !1,
|
|
15354
|
+
renderIcon: RenderIcon,
|
|
15355
|
+
fitView: !0,
|
|
15356
|
+
fitViewPadding: 0,
|
|
15357
|
+
initialWidth: width,
|
|
15358
|
+
initialHeight: height
|
|
15359
|
+
}
|
|
15360
|
+
) })
|
|
15361
|
+
] });
|
|
15362
|
+
}
|
|
15363
|
+
const drawerOpenedAtom = atom(!1);
|
|
12196
15364
|
onMount(drawerOpenedAtom, () => {
|
|
12197
15365
|
drawerOpenedAtom.set(!1);
|
|
12198
15366
|
});
|
|
@@ -12229,7 +15397,7 @@ function SidebarDrawer() {
|
|
|
12229
15397
|
function ColorSchemeToggle() {
|
|
12230
15398
|
const { setColorScheme } = useMantineColorScheme(), computedColorScheme = useComputedColorScheme("light", { getInitialValueInEffect: !0 });
|
|
12231
15399
|
return /* @__PURE__ */ jsx(
|
|
12232
|
-
ActionIcon$
|
|
15400
|
+
ActionIcon$1,
|
|
12233
15401
|
{
|
|
12234
15402
|
visibleFrom: "sm",
|
|
12235
15403
|
size: "md",
|
|
@@ -12277,14 +15445,14 @@ const AlertLocalhost = () => /* @__PURE__ */ jsx(
|
|
|
12277
15445
|
<iframe src="${href}" width="100%" height="100%" style="border:0;background:transparent;"></iframe>
|
|
12278
15446
|
</div>
|
|
12279
15447
|
`.trim();
|
|
12280
|
-
return /* @__PURE__ */ jsxs(Stack, { children: [
|
|
15448
|
+
return /* @__PURE__ */ jsxs(Stack$1, { children: [
|
|
12281
15449
|
code.includes("http://localhost") && /* @__PURE__ */ jsx(AlertLocalhost, {}),
|
|
12282
15450
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { size: "sm", children: "Embedded view is an iframe with a static diagram" }) }),
|
|
12283
|
-
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
15451
|
+
/* @__PURE__ */ jsxs(Stack$1, { gap: "xs", children: [
|
|
12284
15452
|
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
12285
15453
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { fw: "500", size: "sm", children: "HTML" }) }),
|
|
12286
15454
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
12287
|
-
/* @__PURE__ */ jsx(ActionIcon$
|
|
15455
|
+
/* @__PURE__ */ jsx(ActionIcon$1, { component: "a", href, target: "_blank", variant: "light", color: "gray", children: /* @__PURE__ */ jsx(IconExternalLink, {}) }),
|
|
12288
15456
|
/* @__PURE__ */ jsx(CopyButton$1, { value: code, timeout: 1500, children: CopyButtonChild })
|
|
12289
15457
|
] })
|
|
12290
15458
|
] }),
|
|
@@ -12331,14 +15499,14 @@ function WebcomponentsPanel({ diagram }) {
|
|
|
12331
15499
|
search: !0
|
|
12332
15500
|
}
|
|
12333
15501
|
);
|
|
12334
|
-
return /* @__PURE__ */ jsxs(Stack, { children: [
|
|
15502
|
+
return /* @__PURE__ */ jsxs(Stack$1, { children: [
|
|
12335
15503
|
jscode.includes("http://localhost") && /* @__PURE__ */ jsx(AlertLocalhost, {}),
|
|
12336
15504
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { size: "sm", children: "Add this script to your page:" }) }),
|
|
12337
|
-
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
15505
|
+
/* @__PURE__ */ jsxs(Stack$1, { gap: "xs", children: [
|
|
12338
15506
|
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
12339
15507
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { fw: "500", size: "sm", children: "JavaScript" }) }),
|
|
12340
15508
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
12341
|
-
/* @__PURE__ */ jsx(ActionIcon$
|
|
15509
|
+
/* @__PURE__ */ jsx(ActionIcon$1, { component: "a", href: webcomponentPreview.href, target: "_blank", variant: "light", color: "gray", children: /* @__PURE__ */ jsx(IconExternalLink, {}) }),
|
|
12342
15510
|
/* @__PURE__ */ jsx(
|
|
12343
15511
|
CopyButton$1,
|
|
12344
15512
|
{
|
|
@@ -12361,7 +15529,7 @@ function WebcomponentsPanel({ diagram }) {
|
|
|
12361
15529
|
"tag."
|
|
12362
15530
|
] }) })
|
|
12363
15531
|
] }),
|
|
12364
|
-
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
15532
|
+
/* @__PURE__ */ jsxs(Stack$1, { gap: "xs", children: [
|
|
12365
15533
|
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
12366
15534
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { fw: "500", size: "sm", children: "HTML" }) }),
|
|
12367
15535
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
@@ -13037,7 +16205,7 @@ function registerResizeHandle(resizeHandleId, element, direction, hitAreaMargins
|
|
|
13037
16205
|
const count2 = (_ownerDocumentCounts$2 = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$2 !== void 0 ? _ownerDocumentCounts$2 : 1;
|
|
13038
16206
|
if (ownerDocumentCounts.set(ownerDocument, count2 - 1), updateListeners(), count2 === 1 && ownerDocumentCounts.delete(ownerDocument), intersectingHandles.includes(data)) {
|
|
13039
16207
|
const index2 = intersectingHandles.indexOf(data);
|
|
13040
|
-
index2 >= 0 && intersectingHandles.splice(index2, 1), updateCursor();
|
|
16208
|
+
index2 >= 0 && intersectingHandles.splice(index2, 1), updateCursor(), setResizeHandlerState("up", !0, null);
|
|
13041
16209
|
}
|
|
13042
16210
|
};
|
|
13043
16211
|
}
|
|
@@ -14164,7 +17332,7 @@ function PanelResizeHandle({
|
|
|
14164
17332
|
if (isActive)
|
|
14165
17333
|
switch (action) {
|
|
14166
17334
|
case "down": {
|
|
14167
|
-
setState("drag"), startDragging(resizeHandleId, event);
|
|
17335
|
+
setState("drag"), assert(event, 'Expected event to be defined for "down" action'), startDragging(resizeHandleId, event);
|
|
14168
17336
|
const {
|
|
14169
17337
|
onDragging: onDragging2
|
|
14170
17338
|
} = callbacksRef.current;
|
|
@@ -14175,7 +17343,7 @@ function PanelResizeHandle({
|
|
|
14175
17343
|
const {
|
|
14176
17344
|
state: state2
|
|
14177
17345
|
} = committedValuesRef.current;
|
|
14178
|
-
state2 !== "drag" && setState("hover"), resizeHandler(event);
|
|
17346
|
+
state2 !== "drag" && setState("hover"), assert(event, 'Expected event to be defined for "move" action'), resizeHandler(event);
|
|
14179
17347
|
break;
|
|
14180
17348
|
}
|
|
14181
17349
|
case "up": {
|
|
@@ -14228,7 +17396,7 @@ function PanelResizeHandle({
|
|
|
14228
17396
|
}
|
|
14229
17397
|
PanelResizeHandle.displayName = "PanelResizeHandle";
|
|
14230
17398
|
function CopyButton({ text }) {
|
|
14231
|
-
return /* @__PURE__ */ jsx(CopyButton$1, { value: text, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip$
|
|
17399
|
+
return /* @__PURE__ */ jsx(CopyButton$1, { value: text, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip$2, { label: copied ? "Copied" : "Copy", withArrow: !0, position: "right", children: /* @__PURE__ */ jsx(ActionIcon$1, { color: copied ? "teal" : "gray", variant: copied ? "light" : "subtle", onClick: copy, children: copied ? /* @__PURE__ */ jsx(IconCheck, { style: { width: rem(16) } }) : /* @__PURE__ */ jsx(IconCopy, { style: { width: rem(16) } }) }) }) });
|
|
14232
17400
|
}
|
|
14233
17401
|
function CopyToClipboard({ text }) {
|
|
14234
17402
|
return /* @__PURE__ */ jsx(Box, { pos: "absolute", top: "0", right: "0", p: "4", children: /* @__PURE__ */ jsx(CopyButton, { text }) });
|
|
@@ -14338,6 +17506,7 @@ function ViewEditor() {
|
|
|
14338
17506
|
enableFocusMode: !1,
|
|
14339
17507
|
onNavigateTo,
|
|
14340
17508
|
renderIcon: RenderIcon,
|
|
17509
|
+
onChange: (e2) => console.log(e2),
|
|
14341
17510
|
onBurgerMenuClick: withOverviewGraph ? () => {
|
|
14342
17511
|
router.navigate({
|
|
14343
17512
|
to: "/",
|
|
@@ -14423,7 +17592,7 @@ const Route = createFileRoute("/view/$viewId/d2")({
|
|
|
14423
17592
|
throw notFound();
|
|
14424
17593
|
}
|
|
14425
17594
|
}
|
|
14426
|
-
}), fetchFromKroki = async (d2) => await (await fetch(
|
|
17595
|
+
}), fetchFromKroki = async (d2) => await (await fetch(krokiD2SvgUrl, {
|
|
14427
17596
|
method: "POST",
|
|
14428
17597
|
cache: "force-cache",
|
|
14429
17598
|
body: JSON.stringify({
|