diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md new file mode 100644 index 0000000..e1e63a6 --- /dev/null +++ b/CHANGELOG.fr.md @@ -0,0 +1,140 @@ +# Changelog + +## [prod] v0.1.3 — 14 mai 2026 + +**Branche :** `main` | **Tag :** `0.1.3` + +### Nouvelles fonctionnalités +- **Système de dictionnaires structurés** — format `DictionaryFile` v1.1 : champs `roles` (détection / remplacement / classes), `configSchema` (variables configurables avec valeurs possibles), `config` (valeurs actives), `author`, `doi` +- **`DictionaryLoader`** — service de chargement, index de détection normalisé, résolution de classes par conditions/regex/word-to-word, calcul d'index incrémental par portée +- **Repo dédié [`pseudobsidian-dictionaries`](https://github.com/core-hn/pseudobsidian-dictionaries)** — catalogue de dictionnaires téléchargeables, premier dictionnaire : communes françaises GeoAPI INSEE (34 957 entrées, classes Village → Métropole) +- **Wizard — catalogue de dictionnaires** : tableau scrollable avec bouton icône `cloud-download` → `refresh-cw` (spin) → `cloud-check` ; installation depuis le repo dédié sans quitter Obsidian +- **`scripts/build-cities.mjs`** — script one-shot de génération du dictionnaire communes depuis GeoAPI INSEE +- **Scan par dictionnaire** (`Onglet Dictionnaires → Scanner`) : fenêtre glissante de n-grammes, filtre par dictionnaires cochés, commande Ctrl+P disponible +- **`DictScanReviewModal`** — modale de révision en cards : terme source, catégorie (tiny), extrait de contexte avec terme surligné, préfixe éditable + index calculé en lecture seule (recalcul dynamique si décoché), checkbox par card +- **`MappingScanReviewModal`** — modale de révision pour le scan par règles : tableau source → remplacement · occurrences, application directe dans le fichier source +- **Onglet Mappings** — bouton "Scanner le fichier" ouvre `MappingScanReviewModal` +- **Onglet NER** — bouton "Identifier des candidats" en haut de l'onglet +- **`RuleModal`** — suggestions de remplacement par classe (dictionnaire) séparées des suggestions Coulmont ; modal Coulmont n'affiche plus les suggestions dictionnaire (prénoms ≠ lieux) + +### Suppressions +- **Onglet "Candidats"** supprimé — le scan par règles est maintenant dans Mappings, le scan NER dans NER + +### Corrections +- `DictScanReviewModal` : l'index n'est plus modifiable manuellement — seul le préfixe l'est, l'index se recalcule quand on coche/décoche des items +- CSS : animation spin sur l'icône de téléchargement en cours, mini cards dictionnaires dans le panneau + +--- + +## [prod] v0.1.2 — 13 mai 2026 + +**Branche :** `main` | **Tag :** `0.1.2` + +### Corrections +- `setInterval`/`clearInterval` remplacés par partage de Promise dans `OnnxNerScanner` — plus de polling, appels concurrents correctement gérés + +--- + +## [prod] v0.1.1 — 13 mai 2026 + +**Branche :** `main` | **Tag :** `0.1.1` + +### Nouvelles fonctionnalités +- **Onglet Dictionnaires** — liste les `.dict.json` du vault avec nombre d'entrées, import et suppression + +### Corrections portail communautaire Obsidian +- `onunload` : suppression de `detachLeavesOfType` +- `eslint-disable` et `any` : type `TransformersModule` explicite dans `OnnxNerScanner` +- `window.setInterval`/`clearInterval`, `window.setTimeout`, `activeDocument` +- `FileManager.trashFile()` à la place de `Vault.delete()` +- `activeLeaf` déprécié → `getActiveViewOfType(ItemView)` +- Imports inutilisés supprimés (`Setting`, `RuleLocation`, `fs`) +- Promises dans les event listeners wrappées avec `void (async () => {})()` +- CSS `text-decoration-color` → `border-bottom` (support partiel) +- Workflow `.github/workflows/release.yml` — attestations GitHub Actions +- Régénération `package-lock.json` (erreur CI `concat-map` 404) + +--- + +## [prod] v0.1.0 — 13 mai 2026 + +**Branche :** `main` | **Tag :** `0.1.0` + +## [dev] v0.1.0 — en cours + +**Branche :** `dev` | **Publié :** non + +### Nouvelles fonctionnalités +- **Panneau latéral** (`PseudonymizationView`) — 5 onglets : Candidats, Mappings, Dictionnaires, Exports, NER +- **Détection NER** (`OnnxNerScanner`) — modèle BERT-NER multilingue via `transformers.js` (WASM, 100 % local) + - Surlignage bleu des candidats dans l'éditeur + - Filtrage des sous-termes de règles composées (Saint-Jean-de-Luz filtre Jean/Luz) + - Paramètres ajustables : seuil de confiance, mots fonctionnels exclus (onglet NER) +- **Wizard onboarding** — 3 étapes : bienvenue, setup NER (téléchargement WASM ~19 Mo), import dictionnaires +- **Marqueurs `{{...}}`** activés par défaut dans les remplacements en direct et les exports +- **Clic droit → Annuler la pseudonymisation** — restaure le terme original (sur termes verts) +- **Surlignage** : vert + souligné pour les remplacements en direct ; fichiers `*.pseudonymized.*` surlignés avec les règles du fichier source +- **Import de dictionnaires `.dict.json`** depuis le wizard +- **Paramètres NER** : `nerBackend`, `nerMinScore`, `nerFunctionWords` dans les settings +- **eslint_violations.md** — référence du lint Obsidian et commande de test local + +### Corrections +- `style.marginLeft` → classe CSS (`no-static-styles-assignment`) +- Icônes UI (✓ ✗ ← → +) déplacées en CSS `::before`/`::after` +- `getActiveFile()` polyfill pour le panneau latéral (garde le dernier fichier connu) +- `import.meta.url` polyfill dans esbuild pour `@xenova/transformers/src/env.js` +- Alias `onnxruntime-node → ort-web.node.js` pour éviter les binaires natifs non bundlables +- `env.cacheDir` fixé avant `pipeline()` (évite `path.join(null, ...)`) +- Références institutionnelles incorrectes supprimées (ICAR, CNRS) + +### Technique +- `@xenova/transformers` v2.17.2 ajouté comme dépendance +- esbuild : `target: es2020`, `platform: browser` retiré, banner polyfill `import.meta.url` +- `tsconfig.json` : target ES2020, lib ES2020 + +--- + +## [prod] v0.0.4 — 12 mai 2026 + +**Branche :** `main` | **Tag :** `0.0.4` | **Publié :** GitLab + GitHub (`core-hn/pseudobsidian-ization`) + +### Corrections bot Obsidian +- Suppression du heading "Pseudonymizer tool" en tête des settings (`settings-tab/no-manual-html-headings`) + +--- + +## [prod] v0.0.3 — mai 2026 + +**Branche :** `main` | **Tag :** `0.0.3` + +### Corrections bot Obsidian (Required) +- `style.cssText` et `setAttribute('style')` → classes CSS (`no-static-styles-assignment`) +- Headings `

`/`

` dans les settings → `new Setting().setHeading()` (`settings-tab/no-manual-html-headings`) +- Promesses flottantes → opérateur `void` (`no-floating-promises`) +- Sentence case sur les labels UI + +--- + +## [prod] v0.0.2 — mai 2026 + +**Branche :** `main` | **Tag :** `0.0.2` + +### Changements +- Rename du plugin : `pseudobsidianization` → `pseudonymizer-tool` (exigence répertoire communautaire) +- Description `manifest.json` en anglais + +--- + +## [prod] v0.0.1 — mai 2026 + +**Branche :** `main` | **Tag :** `0.0.1` + +### Première release +- Parsers SRT et CHAT/CHA avec round-trip garanti +- Moteur de pseudonymisation (spans, priorité z-index, protection chevauchements) +- Portées fichier / dossier / vault +- Surlignage CM6 (orange = sources, vert = remplacements) +- Validation sélective par occurrence (OccurrencesModal) +- Import de transcriptions avec conversion automatique +- Intégration Coulmont (suggestions de prénoms sociologiquement équivalents) +- Soumission PR #12766 au répertoire communautaire Obsidian diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e63a6..bf94532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +> Previous entries in French: [CHANGELOG.fr.md](CHANGELOG.fr.md) + +## [dev] v0.1.4 — 16 May 2026 + +**Branch:** `main` | **Tag:** upcoming + +### New features +- **Internationalization (i18n)** — all UI strings externalized into `src/i18n/locales/en.json` and `fr.json`; language switchable from wizard and settings without restart +- **Language step in wizard** — first step after welcome; bilingual display before a language is chosen +- **Storage step in wizard** — folder configuration + "one vault per corpus" recommendation +- **Settings reorganization** — 6 sections in order of usage frequency: General · Text detection · Pseudonymization · NER · Storage · Security; language dropdown at the top +- **Corpus organization** (`Organize corpus` command) — named classes (sub-folders) mirrored across transcriptions/, mappings/ and exports/; class selection on import +- **Broad-scope warning for name rules** — dynamic callout in `RuleModal` and `EditRuleModal` when a first name/surname rule is set to folder or vault scope; green success callout for file scope +- **Mappings tab — grouped by scope** — three sections (File / Folder / Vault) with "Active file only" checkbox (checked by default) + +### Changes +- README, CHANGELOG, ROADMAP now in English; French versions archived as `*.fr.md` +- `EditRuleModal`, `QuickPseudonymizeModal` fully migrated to `t()` + +--- + ## [prod] v0.1.3 — 14 mai 2026 **Branche :** `main` | **Tag :** `0.1.3` diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..b759c4d --- /dev/null +++ b/README.fr.md @@ -0,0 +1,248 @@ +# Pseudonymizer Tool +alias `PseudObsidian-ization` pour les intimes. + +Plugin Obsidian de **pseudonymisation et de correction de transcriptions** pour chercheurs en sciences du langage. Il comble un manque : les outils existants (Sonal, Whispurge) ne s'intègrent pas dans un environnement de prise de notes et d'analyse, et peu de logiciels acceptent les conventions de transcription multimodales (Jefferson, ICOR). + +> **English summary** — An Obsidian plugin for pseudonymizing and correcting interactional transcripts (Jefferson / ICOR conventions, .srt, .cha formats). Designed for qualitative researchers in linguistics and conversation analysis. See [SPECS.md](SPECS.md) for full technical specifications. + +--- + +## Workflow + +``` +Transcription brute (.srt, .cha, .md, .txt) + ↓ import automatique +Obsidian — édition native Markdown + ↓ pseudonymisation (manuelle ou NER) +Fichier source annoté + table de correspondance (séparée) + ↓ export +Transcription pseudonymisée (.pseudonymized.*) +``` + +Deux approches, combinables librement : + +- **Manuelle** — clic droit sur un terme → choisir un pseudonyme → le plugin remplace et enregistre la règle +- **Automatique (NER)** — un modèle d'IA détecte les entités identifiantes et les surligne en bleu dans l'éditeur → le chercheur valide ou rejette chaque candidat par clic droit + +Les pseudonymes sont encadrés de marqueurs `{{...}}` dans le fichier source et l'export pour rester visuellement distincts des données brutes. Les tables de correspondance ne sont jamais incluses dans les exports. + +--- + +## Prise en main + +### Premier lancement + +Au premier chargement, un assistant de configuration s'ouvre automatiquement en trois étapes : + +1. **Bienvenue** — présentation du plugin +2. **Détection NER** — choisir d'activer le modèle IA local (téléchargement WASM ~19 Mo) ou de travailler uniquement avec des règles manuelles +3. **Dictionnaires** — importer des fichiers `.dict.json` existants si vous avez déjà des listes de candidats de remplacement + +L'assistant est relançable à tout moment : Paramètres → Pseudonymizer tool → Reconfigurer. + +### Formats pris en charge + +| Format | Extension | Notes | +|---|---|---| +| Sous-titres horodatés | `.srt` | Sortie Whisper / IA — horodatages et structure préservés | +| CHAT / CLAN | `.cha`, `.chat` | Lignes `@`, `*`, `%` préservées | +| Markdown annoté | `.md` | Conventions Jefferson ou ICOR | +| Texte brut | `.txt` | Sans marqueurs de convention | + +Les fichiers `.srt` et `.cha` sont automatiquement convertis en Markdown à l'import. Un fichier de mapping JSON vide est créé en même temps. + +> Installez le plugin [Data Files Editor](https://github.com/zuktol/obsidian-data-files-editor) pour visionner les fichiers de mapping JSON directement depuis votre vault. + +### Installation + +**Via le répertoire communautaire Obsidian** (validation en cours) : +1. Obsidian → Paramètres → Extensions communautaires → Parcourir → "Pseudonymizer Tool" + +**Installation manuelle** depuis la [dernière release GitHub](https://github.com/core-hn/pseudobsidian-ization/releases) : +1. Télécharger `main.js`, `manifest.json`, `styles.css` +2. Copier dans `.obsidian/plugins/pseudonymizer-tool/` de votre vault +3. Activer dans Paramètres → Extensions communautaires + +> Les fichiers WASM (NER) sont téléchargés automatiquement par l'assistant au premier lancement si vous activez la détection automatique. Vous pouvez aussi les télécharger manuellement depuis la release. + +--- + +## Fonctionnalités + +### Pseudonymisation manuelle + +Toutes les actions sont disponibles via le **clic droit** sur une sélection dans l'éditeur : + +| Action | Description | +|---|---| +| **Pseudonymiser** | Remplace le terme (cette occurrence ou toutes) avec marqueurs `{{...}}` | +| **Pseudonymiser avec Pr Baptiste Coulmont** | Interroge [coulmont.com](https://coulmont.com) — propose des prénoms sociologiquement équivalents (même milieu social, même décennie) | +| **Créer une règle** | Enregistre la correspondance dans le mapping JSON sans modifier le texte | +| **Modifier la règle** | Modifie une règle existante (disponible sur les termes en orange ou en vert) | +| **Annuler la pseudonymisation** | Restaure le terme original pour cette occurrence (disponible sur les termes en vert) | + +### Détection automatique par NER + +Le moteur de **reconnaissance d'entités nommées** détecte prénoms, noms, lieux et institutions sans liste préexistante, en exploitant le contexte syntaxique. Contrairement à une approche par dictionnaire, il distingue "Florence" la personne de "Florence" la ville. Les sous-termes d'une entité composée connue sont filtrés automatiquement (si "Saint-Jean-de-Luz" est une règle, "Jean" et "Luz" ne remontent pas comme candidats NER). + +> Pour comprendre ce que sont les modèles NER : [blog Vaniila](https://blog.vaniila.ai/NER/). + +**Utilisation :** +1. Panneau latéral → onglet **Candidats** → **Identifier des candidats** +2. Les entités apparaissent **surlignées en bleu** dans l'éditeur +3. Clic droit sur un terme bleu → **Pseudonymiser** ou **Créer une règle** + +**Modèle :** `Xenova/bert-base-multilingual-cased-ner-hrl` via `transformers.js`. Exécution 100 % locale. Téléchargements uniques au premier usage : WASM (~19 Mo) + modèle NER (~66 Mo). **Fonctionnement hors-ligne après le premier téléchargement.** + +**Paramètres (onglet NER du panneau)** : +- **Seuil de confiance** (0,50–1,00) : augmenter réduit les faux positifs +- **Mots fonctionnels exclus** : liste éditable des tokens à toujours ignorer ("de", "du", "la"…) + +### Panneau latéral + +Accessible via l'icône dans le ruban ou `Ctrl+P → Pseudonymisation : ouvrir le panneau`. + +| Onglet | Contenu | +|---|---| +| **Mappings** | Règles actives · Modifier · Supprimer · Ajouter · Scanner le fichier | +| **Dictionnaires** | Mini cards · Scan par dictionnaire · Import local | +| **Exports** | Pseudonymiser et exporter · Exporter la table de correspondance | +| **NER** | Visible si NER activé · Identifier des candidats · Seuil de confiance · Mots fonctionnels | + +### Surlignage et marqueurs + +Le surlignage est actif dans tout fichier ouvert, y compris les fichiers export `.pseudonymized.*` qui héritent automatiquement des règles du fichier source. + +| Couleur | Signification | +|---|---| +| 🟠 Orange + contour | Terme source encore présent — à pseudonymiser | +| 🟢 Vert + souligné | Pseudonyme appliqué en direct dans le fichier | +| 🔵 Bleu + contour | Candidat NER — pas encore de règle | + +Dans les fichiers exportés, les pseudonymes sont encadrés de marqueurs `{{Pierre}}` pour les distinguer des données brutes (activé par défaut, configurable dans les paramètres). + +### Tables de correspondance + +- Trois niveaux de portée : `fichier.mapping.json` · `dossier.mapping.json` · `vault.mapping.json` +- Statuts par occurrence : `validated`, `ignored`, `partial`, `conflict`, `needs_review` +- **Priorité z-index** : entier libre — les entités longues priment (`Saint-Jean-de-Luz` > `Jean`) +- Format JSON documenté dans `SPECS.md §5` + +### Dictionnaires de pseudonymisation + +Les dictionnaires fournissent des **candidats de remplacement** et alimentent la **détection automatique** de termes à pseudonymiser. Ils sont hébergés dans un dépôt dédié et téléchargés dans votre vault — aucun texte de transcription ne quitte Obsidian. + +**Installation depuis le catalogue :** +1. Wizard → étape Dictionnaires → choisir dans le catalogue en ligne +2. Ou : Paramètres → Reconfigurer → étape Dictionnaires + +**Utilisation :** +1. Panneau latéral → onglet **Dictionnaires** +2. Cocher les dictionnaires à activer pour le scan +3. Bouton **Scanner le fichier actif** (ou le bouton loupe sur chaque card pour un dictionnaire seul) +4. Une modale de révision s'ouvre : chaque entité détectée est présentée avec son extrait de contexte, sa classe proposée et son remplacement calculé automatiquement (`Ville_1`, `Métropole_2`…) +5. Décocher les faux positifs · modifier le préfixe si besoin · **Créer les règles** + +**Dictionnaire disponible — Communes françaises (GeoAPI INSEE) :** +- 34 957 communes françaises, 5 classes : Village · Petite_Ville · Ville · Grande_Ville · Métropole +- Rôles : détection + remplacement par classe avec index d'incrémentation +- Portée recommandée : fichier (chaque fichier reçoit sa propre numérotation) + +> Dépôt dédié : [core-hn/pseudobsidian-dictionaries](https://github.com/core-hn/pseudobsidian-dictionaries) — contributions bienvenues. + +### Sécurité et confidentialité + +- Tout traitement est **local** — aucun texte de transcription n'est envoyé à un serveur externe +- Le modèle NER s'exécute dans Obsidian via WASM, sans appel réseau +- **Exception documentée :** "Pseudonymiser avec Coulmont" propose des *prénoms de remplacement* à partir d'une requête du *prénom à pseudonymiser* (pas le contenu de la transcription) à l'outil `coulmont.com/bac`. Sur son site web, B. Coulmont précise que "recherches ne sont pas enregistrées". +- Les tables de correspondance ne sont jamais incluses dans les exports pseudonymisés. + +--- + +## Pour les développeurs + +```bash +git clone https://gitlab.huma-num.fr/aabbadie/pseudobsidian-ization.git +cd pseudobsidian-ization +npm install +npm run dev # build en mode watch +npm test # suite de tests Jest +npm run build # build de production +npm run deploy # build + copie dans test_vault/ +``` + +Structure du dépôt : + +``` +src/ +├── main.ts # Point d'entrée Obsidian +├── settings.ts # Paramètres persistants +├── types.ts # Types partagés +├── parsers/ # SrtParser, ChatParser, TranscriptConverter +├── mappings/ # MappingStore, ScopeResolver +├── pseudonymizer/ # Moteur, ReplacementPlanner, SpanProtector +├── scanner/ # OccurrenceScanner, OnnxNerScanner +└── ui/ # PseudonymizationView, modales, surlignage CM6 +``` + +--- + +## Statut — v0.1.x + +| Phase | Statut | Description | +|---|---|---| +| 0–6 | ✅ | Parsers · Moteur · Commandes · Portées · Surlignage · Validation | +| 7 — Coulmont | ✅ | Suggestions de prénoms équivalents · Import JSON/CSV | +| 8 — Panneau latéral | ✅ | 3 onglets · NER embarqué · Wizard · Annulation · Surlignage export | +| 9 — Dictionnaires structurés | 🔄 | Format v1.1 · DictionaryLoader · Scan par dictionnaire · Modale de révision · Communes françaises | +| 10 — Affinage | ⏳ | Stabilisation v0.2.0 | +| 11 — Fonctions EMCA | ⏳ | Navigation tours · Correction Jefferson/ICOR · Export ELAN | + +Voir [ROADMAP.md](ROADMAP.md) pour le détail des phases et les features envisagées. + +--- + +## Contribuer + +Les contributions sont les bienvenues, en particulier : + +- **Dictionnaires** : listes de prénoms, toponymes, institutions pour des corpus spécifiques (langues régionales, terrains non francophones, périodes historiques) +- **Conventions de transcription** : parsers pour d'autres systèmes (ELAN, Praat TextGrid, EXMARaLDA) +- **Retours d'usage** : issues pour signaler des cas limites rencontrés sur de vrais corpus + +Merci d'ouvrir une issue avant de proposer une pull request pour les fonctionnalités importantes. + +--- + +## Licence + +GPL 3.0 + +### Code + +*The Beerware License* (Revision 42) + +``` +Axelle Abbadie a conçu ce code. Vous pouvez faire ce que vous voulez avec, +tant que vous conservez cette notice. Si on se croise un jour et que vous +pensez que ça valait le coup, vous pouvez m'offrir une bière. +``` + +**Ce plugin est fait pour être modifié.** Si votre terrain implique des conventions de transcription particulières, un dialecte régional, des corpus multilingues ou des formats d'export spécifiques à votre institution, adaptez le code à vos besoins. + +--- + +## Crédits + + +### Propriété intellectuelle +- **Axelle Abbadie** — conception, spécifications, direction du développement, recherche UX. ([cvHAL](https://cv.hal.science/axelle-abbadie)) +- Vibe-coding avec **Claude Sonnet 4.6** (Anthropic) + +### Inspiration +- **Sonal pi** — À la suite d'une rencontre avec [Maxime Beligné](https://umr5600.cnrs.fr/fr/lequipe/name/max-beligne/) au cours de [la journée "Pseudonymiser, Anonymiser ?" organisée par la MSH-Sud](https://www.mshsud.org/agenda/anonymiser-pseudonymiser/). Lien vers le logiciel : [Sonal-pi](https://www.sonal-info.com/), développé par depuis 2008 par Alex Alber. + +### Travaux valorisés +- **Baptiste Coulmont** — outil de pseudonymisation ([coulmont.com/bac](https://coulmont.com/bac)) utilisé pour la suggestion de prénoms. +- **Stefan Schweter** (Bayerische Staatsbibliothek) — modèle NER multilingue [`bert-base-multilingual-cased-ner-hrl`](https://huggingface.co/stefan-it/bert-base-multilingual-cased-ner-hrl), utilisé pour la détection automatique des entités nommées. +- **Joshua Lochner / Xenova** — conversion ONNX du modèle et bibliothèque [`transformers.js`](https://github.com/xenova/transformers.js), qui permettent l'exécution locale dans Obsidian sans dépendance Python. diff --git a/README.md b/README.md index b759c4d..9787789 100644 --- a/README.md +++ b/README.md @@ -1,216 +1,224 @@ # Pseudonymizer Tool -alias `PseudObsidian-ization` pour les intimes. -Plugin Obsidian de **pseudonymisation et de correction de transcriptions** pour chercheurs en sciences du langage. Il comble un manque : les outils existants (Sonal, Whispurge) ne s'intègrent pas dans un environnement de prise de notes et d'analyse, et peu de logiciels acceptent les conventions de transcription multimodales (Jefferson, ICOR). +An Obsidian plugin for **pseudonymizing and correcting interactional transcripts** for researchers in linguistics and conversation analysis. It fills a gap: existing tools (Sonal, Whispurge) do not integrate into a note-taking and analysis environment, and few applications support multimodal transcription conventions (Jefferson, ICOR). -> **English summary** — An Obsidian plugin for pseudonymizing and correcting interactional transcripts (Jefferson / ICOR conventions, .srt, .cha formats). Designed for qualitative researchers in linguistics and conversation analysis. See [SPECS.md](SPECS.md) for full technical specifications. +> **Français** — [README.fr.md](README.fr.md) --- ## Workflow ``` -Transcription brute (.srt, .cha, .md, .txt) - ↓ import automatique -Obsidian — édition native Markdown - ↓ pseudonymisation (manuelle ou NER) -Fichier source annoté + table de correspondance (séparée) +Raw transcript (.srt, .cha, .md, .txt) + ↓ automatic import +Obsidian — native Markdown editing + ↓ pseudonymization (manual or NER) +Annotated source file + correspondence table (separate) ↓ export -Transcription pseudonymisée (.pseudonymized.*) +Pseudonymized transcript (.pseudonymized.*) ``` -Deux approches, combinables librement : +Two approaches, freely combined: -- **Manuelle** — clic droit sur un terme → choisir un pseudonyme → le plugin remplace et enregistre la règle -- **Automatique (NER)** — un modèle d'IA détecte les entités identifiantes et les surligne en bleu dans l'éditeur → le chercheur valide ou rejette chaque candidat par clic droit +- **Manual** — right-click a term → choose a pseudonym → the plugin replaces it and saves the rule +- **Automatic (NER)** — an AI model detects identifying entities and highlights them in blue in the editor → the researcher validates or rejects each candidate -Les pseudonymes sont encadrés de marqueurs `{{...}}` dans le fichier source et l'export pour rester visuellement distincts des données brutes. Les tables de correspondance ne sont jamais incluses dans les exports. +Pseudonyms are wrapped in `{{...}}` markers in the source file and export to remain visually distinct from raw data. Correspondence tables are never included in exports. --- -## Prise en main +## Getting started -### Premier lancement +### First launch -Au premier chargement, un assistant de configuration s'ouvre automatiquement en trois étapes : +A setup wizard opens automatically on first load: -1. **Bienvenue** — présentation du plugin -2. **Détection NER** — choisir d'activer le modèle IA local (téléchargement WASM ~19 Mo) ou de travailler uniquement avec des règles manuelles -3. **Dictionnaires** — importer des fichiers `.dict.json` existants si vous avez déjà des listes de candidats de remplacement +1. **Welcome** — plugin overview +2. **Language** — choose the interface language +3. **Storage** — configure vault folders (we recommend one vault per corpus) +4. **NER detection** — enable the local AI model (WASM download ~19 MB) or work with manual rules only +5. **Dictionaries** — install replacement candidate dictionaries from the online catalogue -L'assistant est relançable à tout moment : Paramètres → Pseudonymizer tool → Reconfigurer. +The wizard can be relaunched at any time: Settings → Pseudonymizer Tool → Setup wizard. -### Formats pris en charge +### Supported formats | Format | Extension | Notes | |---|---|---| -| Sous-titres horodatés | `.srt` | Sortie Whisper / IA — horodatages et structure préservés | -| CHAT / CLAN | `.cha`, `.chat` | Lignes `@`, `*`, `%` préservées | -| Markdown annoté | `.md` | Conventions Jefferson ou ICOR | -| Texte brut | `.txt` | Sans marqueurs de convention | +| Timestamped subtitles | `.srt` | Whisper / AI output — timestamps and structure preserved | +| CHAT / CLAN | `.cha`, `.chat` | `@`, `*`, `%` lines preserved | +| Annotated Markdown | `.md` | Jefferson or ICOR conventions | +| Plain text | `.txt` | No convention markers | -Les fichiers `.srt` et `.cha` sont automatiquement convertis en Markdown à l'import. Un fichier de mapping JSON vide est créé en même temps. +`.srt` and `.cha` files are automatically converted to Markdown on import. An empty mapping JSON file is created at the same time. -> Installez le plugin [Data Files Editor](https://github.com/zuktol/obsidian-data-files-editor) pour visionner les fichiers de mapping JSON directement depuis votre vault. +> Install the [Data Files Editor](https://github.com/zuktol/obsidian-data-files-editor) plugin to view mapping JSON files directly in your vault. ### Installation -**Via le répertoire communautaire Obsidian** (validation en cours) : -1. Obsidian → Paramètres → Extensions communautaires → Parcourir → "Pseudonymizer Tool" +**Via the Obsidian community plugins directory** (under review): +1. Obsidian → Settings → Community plugins → Browse → "Pseudonymizer Tool" -**Installation manuelle** depuis la [dernière release GitHub](https://github.com/core-hn/pseudobsidian-ization/releases) : -1. Télécharger `main.js`, `manifest.json`, `styles.css` -2. Copier dans `.obsidian/plugins/pseudonymizer-tool/` de votre vault -3. Activer dans Paramètres → Extensions communautaires +**Manual installation** from the [latest GitHub release](https://github.com/core-hn/pseudobsidian-ization/releases): +1. Download `main.js`, `manifest.json`, `styles.css` +2. Copy into `.obsidian/plugins/pseudonymizer-tool/` in your vault +3. Enable in Settings → Community plugins -> Les fichiers WASM (NER) sont téléchargés automatiquement par l'assistant au premier lancement si vous activez la détection automatique. Vous pouvez aussi les télécharger manuellement depuis la release. +> WASM files (NER) are downloaded automatically by the wizard on first launch if you enable automatic detection. They can also be downloaded manually from the release. --- -## Fonctionnalités +## Features -### Pseudonymisation manuelle +### Manual pseudonymization -Toutes les actions sont disponibles via le **clic droit** sur une sélection dans l'éditeur : +All actions are available via **right-click** on a selection in the editor: | Action | Description | |---|---| -| **Pseudonymiser** | Remplace le terme (cette occurrence ou toutes) avec marqueurs `{{...}}` | -| **Pseudonymiser avec Pr Baptiste Coulmont** | Interroge [coulmont.com](https://coulmont.com) — propose des prénoms sociologiquement équivalents (même milieu social, même décennie) | -| **Créer une règle** | Enregistre la correspondance dans le mapping JSON sans modifier le texte | -| **Modifier la règle** | Modifie une règle existante (disponible sur les termes en orange ou en vert) | -| **Annuler la pseudonymisation** | Restaure le terme original pour cette occurrence (disponible sur les termes en vert) | +| **Pseudonymize** | Replace the term (this occurrence or all) with `{{...}}` markers | +| **Pseudonymize with Prof. Baptiste Coulmont** | Queries [coulmont.com](https://coulmont.com) — suggests sociologically equivalent first names (same social background, same decade) | +| **Create a rule** | Saves the correspondence in the mapping JSON without modifying the text | +| **Edit rule** | Modifies an existing rule (available on orange or green highlighted terms) | +| **Cancel pseudonymization** | Restores the original term for this occurrence (available on green terms) | -### Détection automatique par NER +### Automatic NER detection -Le moteur de **reconnaissance d'entités nommées** détecte prénoms, noms, lieux et institutions sans liste préexistante, en exploitant le contexte syntaxique. Contrairement à une approche par dictionnaire, il distingue "Florence" la personne de "Florence" la ville. Les sous-termes d'une entité composée connue sont filtrés automatiquement (si "Saint-Jean-de-Luz" est une règle, "Jean" et "Luz" ne remontent pas comme candidats NER). +The **named entity recognition** engine detects first names, surnames, places and institutions without a pre-existing list, using syntactic context. Unlike a dictionary approach, it distinguishes "Florence" the person from "Florence" the city. Sub-terms of a known compound entity are automatically filtered (if "Saint-Jean-de-Luz" is a rule, "Jean" and "Luz" do not appear as NER candidates). -> Pour comprendre ce que sont les modèles NER : [blog Vaniila](https://blog.vaniila.ai/NER/). +**Usage:** +1. Side panel → **NER** tab → **Identify candidates** +2. Entities appear **highlighted in blue** in the editor +3. Right-click a blue term → **Pseudonymize** or **Create a rule** -**Utilisation :** -1. Panneau latéral → onglet **Candidats** → **Identifier des candidats** -2. Les entités apparaissent **surlignées en bleu** dans l'éditeur -3. Clic droit sur un terme bleu → **Pseudonymiser** ou **Créer une règle** +**Model:** `Xenova/bert-base-multilingual-cased-ner-hrl` via `transformers.js`. 100% local execution. One-time downloads on first use: WASM (~19 MB) + NER model (~66 MB). **Works offline after the first download.** -**Modèle :** `Xenova/bert-base-multilingual-cased-ner-hrl` via `transformers.js`. Exécution 100 % locale. Téléchargements uniques au premier usage : WASM (~19 Mo) + modèle NER (~66 Mo). **Fonctionnement hors-ligne après le premier téléchargement.** +**Settings (NER tab in the panel):** +- **Confidence threshold** (0.50–1.00): increasing it reduces false positives +- **Excluded function words**: editable list of tokens to always ignore ("de", "du", "la"…) -**Paramètres (onglet NER du panneau)** : -- **Seuil de confiance** (0,50–1,00) : augmenter réduit les faux positifs -- **Mots fonctionnels exclus** : liste éditable des tokens à toujours ignorer ("de", "du", "la"…) +### Side panel -### Panneau latéral +Accessible via the ribbon icon or `Ctrl+P → Pseudonymization: open panel`. -Accessible via l'icône dans le ruban ou `Ctrl+P → Pseudonymisation : ouvrir le panneau`. - -| Onglet | Contenu | +| Tab | Content | |---|---| -| **Mappings** | Règles actives · Modifier · Supprimer · Ajouter · Scanner le fichier | -| **Dictionnaires** | Mini cards · Scan par dictionnaire · Import local | -| **Exports** | Pseudonymiser et exporter · Exporter la table de correspondance | -| **NER** | Visible si NER activé · Identifier des candidats · Seuil de confiance · Mots fonctionnels | +| **Mappings** | Active rules · Edit · Delete · Add · Scan file | +| **Dictionaries** | Mini cards · Dictionary scan · Local import | +| **Exports** | Pseudonymize and export · Export correspondence table | +| **NER** | Visible if NER enabled · Identify candidates · Confidence threshold · Function words | -### Surlignage et marqueurs +### Highlighting and markers -Le surlignage est actif dans tout fichier ouvert, y compris les fichiers export `.pseudonymized.*` qui héritent automatiquement des règles du fichier source. +Highlighting is active in all open files, including `.pseudonymized.*` export files, which automatically inherit rules from the source file. -| Couleur | Signification | +| Colour | Meaning | |---|---| -| 🟠 Orange + contour | Terme source encore présent — à pseudonymiser | -| 🟢 Vert + souligné | Pseudonyme appliqué en direct dans le fichier | -| 🔵 Bleu + contour | Candidat NER — pas encore de règle | +| 🟠 Orange + outline | Source term still present — to be pseudonymized | +| 🟢 Green + underline | Pseudonym applied directly in the file | +| 🔵 Blue + outline | NER candidate — no rule yet | -Dans les fichiers exportés, les pseudonymes sont encadrés de marqueurs `{{Pierre}}` pour les distinguer des données brutes (activé par défaut, configurable dans les paramètres). +In exported files, pseudonyms are wrapped in `{{Pierre}}` markers to distinguish them from raw data (enabled by default, configurable in settings). -### Tables de correspondance +### Correspondence tables -- Trois niveaux de portée : `fichier.mapping.json` · `dossier.mapping.json` · `vault.mapping.json` -- Statuts par occurrence : `validated`, `ignored`, `partial`, `conflict`, `needs_review` -- **Priorité z-index** : entier libre — les entités longues priment (`Saint-Jean-de-Luz` > `Jean`) -- Format JSON documenté dans `SPECS.md §5` +- Three scope levels: `file.mapping.json` · `folder.mapping.json` · `vault.mapping.json` +- Per-occurrence statuses: `validated`, `ignored`, `partial`, `conflict`, `needs_review` +- **Z-index priority**: free integer — longer entities take precedence (`Saint-Jean-de-Luz` > `Jean`) +- JSON format documented in `SPECS.md §5` -### Dictionnaires de pseudonymisation +### Pseudonymization dictionaries -Les dictionnaires fournissent des **candidats de remplacement** et alimentent la **détection automatique** de termes à pseudonymiser. Ils sont hébergés dans un dépôt dédié et téléchargés dans votre vault — aucun texte de transcription ne quitte Obsidian. +Dictionaries provide **replacement candidates** and feed **automatic detection**. They are hosted in a dedicated repository and downloaded into your vault — no transcript text ever leaves Obsidian. -**Installation depuis le catalogue :** -1. Wizard → étape Dictionnaires → choisir dans le catalogue en ligne -2. Ou : Paramètres → Reconfigurer → étape Dictionnaires +**Installing from the catalogue:** +1. Wizard → Dictionaries step → choose from the online catalogue +2. Or: Settings → Setup wizard → Dictionaries step -**Utilisation :** -1. Panneau latéral → onglet **Dictionnaires** -2. Cocher les dictionnaires à activer pour le scan -3. Bouton **Scanner le fichier actif** (ou le bouton loupe sur chaque card pour un dictionnaire seul) -4. Une modale de révision s'ouvre : chaque entité détectée est présentée avec son extrait de contexte, sa classe proposée et son remplacement calculé automatiquement (`Ville_1`, `Métropole_2`…) -5. Décocher les faux positifs · modifier le préfixe si besoin · **Créer les règles** +**Usage:** +1. Side panel → **Dictionaries** tab +2. Check the dictionaries to activate for the scan +3. Click **Scan active file** (or the magnifier button on each card for a single dictionary) +4. A review modal opens: each detected entity is shown with its context excerpt, proposed class and automatically computed replacement (`Ville_1`, `Métropole_2`…) +5. Uncheck false positives · edit the prefix if needed · **Create rules** -**Dictionnaire disponible — Communes françaises (GeoAPI INSEE) :** -- 34 957 communes françaises, 5 classes : Village · Petite_Ville · Ville · Grande_Ville · Métropole -- Rôles : détection + remplacement par classe avec index d'incrémentation -- Portée recommandée : fichier (chaque fichier reçoit sa propre numérotation) +**Available dictionary — French communes (GeoAPI INSEE):** +- 34,957 French communes, 5 classes: Village · Petite_Ville · Ville · Grande_Ville · Métropole +- Roles: detection + class-based replacement with incremental index +- Recommended scope: file (each file gets its own numbering) -> Dépôt dédié : [core-hn/pseudobsidian-dictionaries](https://github.com/core-hn/pseudobsidian-dictionaries) — contributions bienvenues. +> Dedicated repository: [core-hn/pseudobsidian-dictionaries](https://github.com/core-hn/pseudobsidian-dictionaries) — contributions welcome. -### Sécurité et confidentialité +### Corpus organization -- Tout traitement est **local** — aucun texte de transcription n'est envoyé à un serveur externe -- Le modèle NER s'exécute dans Obsidian via WASM, sans appel réseau -- **Exception documentée :** "Pseudonymiser avec Coulmont" propose des *prénoms de remplacement* à partir d'une requête du *prénom à pseudonymiser* (pas le contenu de la transcription) à l'outil `coulmont.com/bac`. Sur son site web, B. Coulmont précise que "recherches ne sont pas enregistrées". -- Les tables de correspondance ne sont jamais incluses dans les exports pseudonymisés. +The plugin helps you structure your corpus in folders before starting work. Use the command **Organize corpus** (Ctrl+P) to define classes (sub-folders). Each class automatically creates mirrored folders for transcriptions, mapping tables and exports. When adding a transcription, you are prompted to select a class. + +> We recommend **one Obsidian vault per corpus**. This keeps mapping files, dictionaries and exports together with their transcriptions, and makes archiving or sharing a corpus straightforward. + +### Privacy and security + +- All processing is **local** — no transcript text is sent to an external server +- The NER model runs in Obsidian via WASM, without any network call +- **Documented exception:** "Pseudonymize with Coulmont" sends the *source first name* (not transcript content) to `coulmont.com/bac` to suggest equivalent names. B. Coulmont states on his website that searches are not logged. +- Correspondence tables are never included in pseudonymized exports. --- -## Pour les développeurs +## For developers ```bash git clone https://gitlab.huma-num.fr/aabbadie/pseudobsidian-ization.git cd pseudobsidian-ization npm install -npm run dev # build en mode watch -npm test # suite de tests Jest -npm run build # build de production -npm run deploy # build + copie dans test_vault/ +npm run dev # watch build (esbuild) +npm test # Jest test suite +npm run build # production build +npm run deploy # build + copy to test_vault/ +npm run build:cities # regenerate assets/cities.dict.json from GeoAPI INSEE ``` -Structure du dépôt : +Repository structure: ``` src/ -├── main.ts # Point d'entrée Obsidian -├── settings.ts # Paramètres persistants -├── types.ts # Types partagés +├── main.ts # Obsidian entry point +├── settings.ts # Persistent settings +├── types.ts # Shared types +├── i18n/ # Internationalization (en, fr) ├── parsers/ # SrtParser, ChatParser, TranscriptConverter ├── mappings/ # MappingStore, ScopeResolver -├── pseudonymizer/ # Moteur, ReplacementPlanner, SpanProtector +├── pseudonymizer/ # Engine, ReplacementPlanner, SpanProtector ├── scanner/ # OccurrenceScanner, OnnxNerScanner -└── ui/ # PseudonymizationView, modales, surlignage CM6 +├── dictionaries/ # DictionaryLoader +└── ui/ # PseudonymizationView, modals, CM6 highlighting ``` --- -## Statut — v0.1.x +## Status — v0.1.x -| Phase | Statut | Description | +| Phase | Status | Description | |---|---|---| -| 0–6 | ✅ | Parsers · Moteur · Commandes · Portées · Surlignage · Validation | -| 7 — Coulmont | ✅ | Suggestions de prénoms équivalents · Import JSON/CSV | -| 8 — Panneau latéral | ✅ | 3 onglets · NER embarqué · Wizard · Annulation · Surlignage export | -| 9 — Dictionnaires structurés | 🔄 | Format v1.1 · DictionaryLoader · Scan par dictionnaire · Modale de révision · Communes françaises | -| 10 — Affinage | ⏳ | Stabilisation v0.2.0 | -| 11 — Fonctions EMCA | ⏳ | Navigation tours · Correction Jefferson/ICOR · Export ELAN | +| 0–6 | ✅ | Parsers · Engine · Commands · Scopes · Highlighting · Validation | +| 7 — Coulmont | ✅ | Equivalent first name suggestions · JSON/CSV import | +| 8 — Side panel | ✅ | 3 tabs · Embedded NER · Wizard · Cancellation · Export highlighting | +| 9 — Structured dictionaries | ✅ | Format v1.1 · DictionaryLoader · Dictionary scan · Review modal · French communes | +| 10 — Refinement | 🔄 | i18n · Corpus organization · Settings redesign · Phase in progress | +| 11 — EMCA functions | ⏳ | Turn navigation · Jefferson/ICOR correction · ELAN export | -Voir [ROADMAP.md](ROADMAP.md) pour le détail des phases et les features envisagées. +See [ROADMAP.md](ROADMAP.md) for the full phase breakdown and planned features. --- -## Contribuer +## Contributing -Les contributions sont les bienvenues, en particulier : +Contributions are welcome, particularly: -- **Dictionnaires** : listes de prénoms, toponymes, institutions pour des corpus spécifiques (langues régionales, terrains non francophones, périodes historiques) -- **Conventions de transcription** : parsers pour d'autres systèmes (ELAN, Praat TextGrid, EXMARaLDA) -- **Retours d'usage** : issues pour signaler des cas limites rencontrés sur de vrais corpus +- **Dictionaries**: first name lists, place names, institutions for specific corpora (regional languages, non-French fields, historical periods) — see [core-hn/pseudobsidian-dictionaries](https://github.com/core-hn/pseudobsidian-dictionaries) +- **Transcription conventions**: parsers for other systems (ELAN, Praat TextGrid, EXMARaLDA) +- **Usage feedback**: issues to report edge cases encountered on real corpora -Merci d'ouvrir une issue avant de proposer une pull request pour les fonctionnalités importantes. +Please open an issue before submitting a pull request for significant features. --- @@ -223,26 +231,25 @@ GPL 3.0 *The Beerware License* (Revision 42) ``` -Axelle Abbadie a conçu ce code. Vous pouvez faire ce que vous voulez avec, -tant que vous conservez cette notice. Si on se croise un jour et que vous -pensez que ça valait le coup, vous pouvez m'offrir une bière. +Axelle Abbadie wrote this code. You can do whatever you want with it +as long as you keep this notice. If we meet someday, and you think +it was worth it, you can buy me a beer. ``` -**Ce plugin est fait pour être modifié.** Si votre terrain implique des conventions de transcription particulières, un dialecte régional, des corpus multilingues ou des formats d'export spécifiques à votre institution, adaptez le code à vos besoins. +**This plugin is made to be modified.** If your fieldwork involves particular transcription conventions, a regional dialect, multilingual corpora or institution-specific export formats, adapt the code to your needs. --- -## Crédits +## Credits - -### Propriété intellectuelle -- **Axelle Abbadie** — conception, spécifications, direction du développement, recherche UX. ([cvHAL](https://cv.hal.science/axelle-abbadie)) -- Vibe-coding avec **Claude Sonnet 4.6** (Anthropic) +### Intellectual property +- **Axelle Abbadie** — design, specifications, development direction, UX research. ([cvHAL](https://cv.hal.science/axelle-abbadie)) +- Vibe-coded with **Claude Sonnet 4.6** (Anthropic) ### Inspiration -- **Sonal pi** — À la suite d'une rencontre avec [Maxime Beligné](https://umr5600.cnrs.fr/fr/lequipe/name/max-beligne/) au cours de [la journée "Pseudonymiser, Anonymiser ?" organisée par la MSH-Sud](https://www.mshsud.org/agenda/anonymiser-pseudonymiser/). Lien vers le logiciel : [Sonal-pi](https://www.sonal-info.com/), développé par depuis 2008 par Alex Alber. +- **Sonal pi** — Following a meeting with [Maxime Beligné](https://umr5600.cnrs.fr/fr/lequipe/name/max-beligne/) at the ["Pseudonymiser, Anonymiser?" day organized by MSH-Sud](https://www.mshsud.org/agenda/anonymiser-pseudonymiser/). Software: [Sonal-pi](https://www.sonal-info.com/), developed since 2008 by Alex Alber. -### Travaux valorisés -- **Baptiste Coulmont** — outil de pseudonymisation ([coulmont.com/bac](https://coulmont.com/bac)) utilisé pour la suggestion de prénoms. -- **Stefan Schweter** (Bayerische Staatsbibliothek) — modèle NER multilingue [`bert-base-multilingual-cased-ner-hrl`](https://huggingface.co/stefan-it/bert-base-multilingual-cased-ner-hrl), utilisé pour la détection automatique des entités nommées. -- **Joshua Lochner / Xenova** — conversion ONNX du modèle et bibliothèque [`transformers.js`](https://github.com/xenova/transformers.js), qui permettent l'exécution locale dans Obsidian sans dépendance Python. +### Acknowledged work +- **Baptiste Coulmont** — pseudonymization tool ([coulmont.com/bac](https://coulmont.com/bac)) used for first name suggestions. +- **Stefan Schweter** (Bayerische Staatsbibliothek) — multilingual NER model [`bert-base-multilingual-cased-ner-hrl`](https://huggingface.co/stefan-it/bert-base-multilingual-cased-ner-hrl), used for automatic entity detection. +- **Joshua Lochner / Xenova** — ONNX model conversion and [`transformers.js`](https://github.com/xenova/transformers.js) library, enabling local execution in Obsidian without a Python dependency. diff --git a/ROADMAP.fr.md b/ROADMAP.fr.md new file mode 100644 index 0000000..fe85b47 --- /dev/null +++ b/ROADMAP.fr.md @@ -0,0 +1,281 @@ +# ROADMAP — PseudObsidian-ization + +Plugin Obsidian de pseudonymisation et correction de transcriptions (conventions Jefferson / ICOR / SRT / CHAT). + +Chaque phase produit quelque chose de testable. Les critères d'acceptation renvoient aux sections de SPECS.md. + +## État actuel (mai 2026) — v0.1.0 + +**Phases 0 à 8 terminées.** La Phase 9 (dictionnaires de remplacement pour lieux/institutions) est la prochaine cible. + +Décision architecturale adoptée en mai 2026 : la **détection des entités identifiantes** repose sur du **NER** (`transformers.js` + `bert-base-multilingual-cased-ner-hrl`) plutôt que sur des dictionnaires lexicaux exhaustifs. Les dictionnaires restent des ressources de **remplacement** (candidats de substitution), pas de détection. + +``` +✅ Phases 0–8 Parsers · Moteur · UI · Portées · Surlignage · Validation · Coulmont · Panneau · NER · Wizard +🔄 Phase 9 Dictionnaires de remplacement (lieux/institutions) (v0.1.0) +⏳ Phase 10 Affinage et stabilisation (v0.2.0) +⏳ Phase 11 Fonctions d'analyse interactionnelle et conversationnelle (v1.0.0) +``` + +La publication sur le répertoire communautaire Obsidian se fait **au fil des versions** (PR #12766 en cours de validation). + +--- + +--- + +## ✅ Phase 0 — Boilerplate + +- [x] Initialiser le plugin avec le template officiel Obsidian (TypeScript + esbuild) +- [x] Configurer ESLint, Prettier, Jest +- [x] Définir les types partagés de SPECS.md §11.3 : `ScopeType`, `MappingStatus`, `EntityCategory`, `MappingRule`, `Scope`, `Occurrence`, `ReplacementSpan` +- [x] Créer un vault de test avec des fichiers fictifs : `entretien_01.srt`, `entretien_02.cha`, `entretien_03.md` +- [x] Mettre en place le dossier `_pseudonymisation/` dans le vault de test (§13.3) + +**Testable :** le plugin se charge dans Obsidian sans erreur. + +--- + +## ✅ Phase 1 — Parser SRT + +Objectif : ouvrir un `.srt`, le lire sans l'altérer, identifier les zones textuelles. Priorité haute car c'est le format le plus courant en sortie de Whisper. + +- [ ] Implémenter `parsers/SrtParser.ts` : + - Découpage en blocs (numéro / horodatage / texte) + - Identification des zones remplaçables (texte uniquement, pas les timestamps) + - Représentation interne : tableau de `SrtBlock { index, start, end, lines[] }` +- [ ] Tests unitaires sur `entretien_01.srt` fictif +- [ ] Vérifier que la reconstruction du fichier à partir de l'AST est identique à l'original (round-trip) + +**Testable — SPECS §17.4 :** après parse + reconstruction, les horodatages et numéros de blocs sont inchangés. + +--- + +## ✅ Phase 2 — Parser CHAT / CHA + +Objectif : ouvrir un `.cha`, distinguer métadonnées, tours de parole et lignes dépendantes. + +- [ ] Implémenter `parsers/ChatParser.ts` : + - Lignes `@` (métadonnées) → préservées telles quelles + - Lignes `*LOCUTEUR:` → tour de parole, zone remplaçable + - Lignes `%` (dépendantes) → préservées ou traitées séparément selon action explicite + - Représentation interne : `ChatLine { type: 'meta'|'turn'|'dependent', speaker?, content }` +- [ ] Tests unitaires sur `entretien_02.cha` fictif +- [ ] Vérifier le round-trip + +**Testable — SPECS §17.5 :** les lignes `@`, `*` et `%` sont conservées après parse + reconstruction. + +--- + +## ✅ Phase 3 — Mapping basique : sélection → règle → application fichier + +Objectif : premier flux complet, portée fichier uniquement. C'est le cœur du MVP v0.1 (SPECS §16.1). + +- [ ] Commande "Créer une règle depuis la sélection" (§10.1) : modale minimale (source, remplacement, catégorie, portée = fichier par défaut) +- [ ] `mappings/MappingStore.ts` : lecture / écriture de `entretien_XX.mapping.json` (portée `file`) +- [ ] `scanner/OccurrenceScanner.ts` : scan du fichier courant, liste des occurrences avec contexte gauche/droite (§7.2) +- [ ] Vue latérale minimale — onglet **Occurrences** : fichier, ligne, contexte, remplacement proposé, bouton valider/ignorer (§10.3) +- [ ] `pseudonymizer/ReplacementPlanner.ts` : construit le plan de remplacement (§12.1) +- [ ] `pseudonymizer/SpanProtector.ts` : résolution des spans, application droite-à-gauche (§12.4, §12.5) +- [ ] Export du fichier pseudonymisé (`nom.pseudonymized.srt` / `.cha` / `.md`) sans table de correspondance (§14.1) +- [ ] Export de la table JSON séparément (§14.2) + +**Testable — SPECS §17.1 :** `Bonjour Jean.` → règle Jean → Pierre → export contient `Bonjour Pierre.` et la table JSON contient le mapping. + +--- + +## ✅ Phase 4 — Priorité z-index et protection des spans imbriqués + +Objectif : garantir qu'un remplacement court ne s'applique pas à l'intérieur d'un segment long déjà traité. + +- [x] Champ `priority` dans `MappingRule` : entier libre, défaut 0 (comme z-index CSS — §8.4) +- [x] `sortRules` : tri par `priority` décroissant, puis longueur source décroissante, puis portée locale (§12.3) +- [x] `resolveSpans` : élimination des chevauchements selon ce tri (§12.4) +- [x] Tests de non-régression obligatoires (§18.2) : Jean/Saint-Jean-de-Luz, Paul/Saint-Paul, Montpellier/CHU, Marie/Sainte-Marie +- [ ] **Exploitable dans Obsidian** : + - Commande `Pseudonymisation : ajouter une transcription` (Ctrl+P) : ouvre un sélecteur de fichier natif, importe le fichier dans le vault, initialise un mapping JSON vide, ouvre le fichier + - Commande `Pseudonymisation : pseudonymiser le fichier courant` : lit le fichier actif (SRT, CHA/CHAT, MD), charge le mapping JSON correspondant, écrit `[nom].pseudonymized.[ext]` dans `_pseudonymisation/exports/` + - Commande `Pseudonymisation : créer une règle` (disponible sur sélection dans l'éditeur) : modale minimale — source, remplacement, catégorie, portée, priority — écrit dans le mapping JSON du fichier courant + - Tester manuellement : importer `entretien_01.srt`, créer les règles Jean → Pierre et Saint-Jean-de-Luz → Ville littorale, pseudonymiser, vérifier l'export + +**Testable — SPECS §17.2 :** `Jean habite Saint-Jean-de-Luz.` → `Pierre habite Ville littorale.` visible dans le fichier exporté dans Obsidian. + +--- + +## ✅ Phase 5 — Portée dossier et vault + surlignage éditeur + +Objectif : charger automatiquement les trois niveaux de mapping et visualiser dans l'éditeur les termes déjà pseudonymisés. + +- [ ] `mappings/ScopeResolver.ts` : parcourir le dossier `_pseudonymisation/mappings/`, charger tous les fichiers JSON, filtrer et fusionner les règles applicables à un fichier donné (§4, §12.2) +- [ ] Cascade de résolution : fichier → dossier le plus proche → vault — géré par le tri `sortRules` existant via `scopeWeight` (§4.4) +- [ ] **Surlignage éditeur** : extension CodeMirror 6 (`registerEditorExtension`) qui marque dans le fichier ouvert : + - en **orange** : les termes sources (encore à pseudonymiser) + - en **vert** : les termes de remplacement (déjà pseudonymisés) + - se met à jour à chaque changement de fichier actif +- [ ] **Exploitable dans Obsidian** : + - La commande "pseudonymiser" utilise ScopeResolver pour charger les trois niveaux automatiquement + - Commande `Pseudonymisation : créer une règle au niveau dossier / vault` + - Le surlignage apparaît dès qu'un mapping existe pour le fichier ouvert + - Tester : une règle vault s'applique à deux entretiens différents ; les termes s'affichent surlignés dans les deux fichiers + +**Testable :** ouvrir un fichier avec des règles de mapping → termes sources en orange, pseudonymes déjà appliqués en vert. + +--- + +## ✅ Phase 6 — Validation sélective et statuts + +Objectif : pouvoir remplacer certaines occurrences et en ignorer d'autres. + +- [ ] Statuts par occurrence : `suggested`, `validated`, `ignored`, `partial`, `conflict`, `disabled`, `needs_review` (§5.4) +- [ ] Validation occurrence par occurrence, par lot, ou globale (§10.5) +- [ ] Mapping au statut `partial` quand certaines occurrences seulement sont remplacées (§17.3) +- [ ] **Exploitable dans Obsidian** : + - Commande `Pseudonymisation : scanner le fichier courant` → liste les occurrences candidates dans une modale + - Chaque occurrence : bouton Valider / Ignorer / Faux positif + - Prévisualisation diff par occurrence avant application (§7.4) + - Menu contextuel sur sélection : Créer une règle / Pseudonymiser cette occurrence (§10.2) + - Tester : trois occurrences de `Jean`, en valider deux, ignorer une → statut `partial` dans le JSON + +**Testable — SPECS §17.3 :** mapping `Jean → Pierre` passe au statut `partial` après validation sélective. + +--- + +## ✅ Phase 7 — Prénoms : suggestions Coulmont et import de dictionnaires + +Objectif : générer des suggestions de prénoms sociologiquement équivalents et permettre l'import de dictionnaires existants. + +- [x] Intégration de l'outil Coulmont : appel HTTP → suggestions de prénoms équivalents (genre, décennie, milieu social) +- [x] Format interne `DictionaryEntry` avec `gender`, `decade`, `socialClass`, `replacementCandidates[]` (§6.3) +- [x] `dictionaries/JsonDictionaryImporter.ts` : import JSON format SPECS §6.3 +- [x] `dictionaries/CsvDictionaryImporter.ts` : import CSV + mapping des colonnes (§6.4) +- [x] `adapters/coulmont.ts` : CSV Coulmont → `DictionaryEntry[]` +- [x] `dictionaries/DictionaryManager.ts` : activation / désactivation, portée par dictionnaire (§6.5) +- [x] `adapters/insee.ts` : CSV INSEE prénoms → `DictionaryEntry[]` +- [x] Dans la modale de création de règle : suggestions Coulmont affichées sous forme de boutons cliquables + +> **Note :** les dictionnaires embarqués massifs (`cities.json`, `lastnames.json`, etc.) sont **dépriorisés** — la détection des entités sera déléguée au NER en Phase 9. Seuls les dictionnaires de **remplacement** (prénoms Coulmont/INSEE) sont maintenus ici. + +**Testable :** sélectionner un prénom dans une transcription → suggestions Coulmont affichées → cliquer pour pré-remplir le champ de remplacement. + +--- + +## ✅ Phase 8 — Interface complète (panneau latéral 4 onglets) + +Objectif : interface de travail complète pour le workflow pseudonymisation. + +- [x] Vue latérale 5 onglets : **Candidats / Mappings / Dictionnaires / Exports / NER** + - Onglet **Candidats** (ex-Occurrences) : scanner le fichier + identifier des candidats NER · Valider / Ignorer / Faux positif · Appliquer + - Onglet **Mappings** : tableau des règles actives — modifier, supprimer, ajouter + - Onglet **Dictionnaires** : import de fichiers `.dict.json` + - Onglet **Exports** : pseudonymiser + exporter · exporter la table de correspondance + - Onglet **NER** : seuil de confiance + mots fonctionnels exclus (visible si NER activé) +- [x] Surlignage tri-couleur dans l'éditeur : orange (sources) · vert souligné (remplacements) · bleu (candidats NER) +- [x] Surlignage actif dans les fichiers exportés `.pseudonymized.*` +- [x] Clic droit → Annuler la pseudonymisation (sur termes verts) +- [x] Marqueurs `{{...}}` activés par défaut dans les remplacements en direct et les exports +- [x] Wizard onboarding (3 étapes) avec téléchargement WASM et import de dictionnaires +- [x] NER embarqué via `transformers.js` + `bert-base-multilingual-cased-ner-hrl` +- [x] Filtrage des sous-termes de règles composées (Saint-Jean-de-Luz filtre Jean/Luz en NER) +- [ ] `correction/checker.ts` : vérification des conventions Jefferson/ICOR *(reporté Phase 10)* + +**Livré en v0.1.0.** + +--- + +## 🔄 Phase 9 — Dictionnaires structurés (v0.1.3) + +Objectif : permettre la détection et le remplacement automatiques des entités identifiantes à partir de dictionnaires locaux, téléchargeables hors-ligne depuis un dépôt dédié. + +**Décision architecturale :** le NER (transformers.js) reste le moteur de détection principal pour les entités contextuelles (prénoms, noms, institutions). Les dictionnaires ajoutent une détection exhaustive par liste pour les types dénombrables (communes, institutions connues) et fournissent les remplacements structurés (classes + index). + +### Tâches + +- [x] `scanner/OnnxNerScanner.ts` : pipeline BERT-NER via `@xenova/transformers`, filtres score et mots fonctionnels +- [x] Surlignage bleu des entités détectées dans l'éditeur +- [x] Onglet NER dans le panneau latéral : seuil de confiance + mots fonctionnels · bouton "Identifier des candidats" +- [x] Wizard : téléchargement WASM + catalogue de dictionnaires depuis le repo dédié +- [x] Format `DictionaryFile` v1.1 : `roles`, `configSchema`, `config`, `author`, `doi` +- [x] `src/dictionaries/DictionaryLoader.ts` : chargement, index de détection, résolution de classes (conditions / regex / word-to-word), `nextReplacement()`, `scanText()` (fenêtre glissante n-grammes) +- [x] Repo dédié [`pseudobsidian-dictionaries`](https://github.com/core-hn/pseudobsidian-dictionaries) + `fr-communes.dict.json` (34 957 communes GeoAPI INSEE) +- [x] `scripts/build-cities.mjs` : génération du dictionnaire communes depuis GeoAPI +- [x] Onglet Dictionnaires : mini cards (checkbox · scan individuel · suppression) + scan groupé +- [x] `DictScanReviewModal` : modale de révision en cards (contexte, préfixe éditable, index calculé) +- [x] `MappingScanReviewModal` : modale de révision pour le scan par règles existantes +- [x] Scan par dictionnaire accessible depuis l'onglet Dictionnaires et commande Ctrl+P +- [x] Suppression onglet "Candidats" — scan règles → Mappings · scan NER → NER + + +**Testable (v0.1.3) :** installer le dictionnaire communes → scanner un fichier → modale de révision → décocher les faux positifs → créer les règles → pseudonymiser. + +--- + +## ⏳ Phase 10 — Affinage et stabilisation (v0.1.x) + +Objectif : consolider l'ensemble des features en place avant d'aborder les fonctions avancées. + +- [ ] Couverture de tests unitaires ≥ 80 % sur parsers, moteur, NER scanner +- [ ] Tests de non-régression Phase 4 (§18.2) maintenus verts avec les règles NER actives +- [ ] Correction des conventions Jefferson / ICOR : suggestions au survol, highlighting éditeur +- [ ] Exports dans le format d'origine pour l'ouverture de corpus +- [ ] Exports pour publication en EMCA (PNG) +- [ ] Performance : mesurer et optimiser le temps de scan NER sur un fichier de 500 tours +- [ ] **Internationalisation (i18n)** : externaliser toutes les chaînes UI dans un fichier de traduction (`locales/fr.json`, `locales/en.json`) — architecture à définir (standard Obsidian ou `i18next`) +- [ ] Intégration [Meld Encrypt](https://github.com/meld-cp/obsidian-encrypt) dans l'onglet Exports pour le chiffrement des tables de correspondance et des exports pseudonymisés +- [ ] Trancher les questions ouvertes persistantes (SPECS §20) +- [ ] Comportement UI (view) conditionnel au dossier du fichier actif (rel aux dossiers d'export et de mapping) + +**Testable (v0.2.0) :** workflow de bout en bout stable sur un corpus synthétique de 10 entretiens. + +--- + +## ⏳ Phase 11 — Fonctions d'analyse interactionnelle et conversationnelle (v0.2.0) + +Objectif : aller au-delà de la pseudonymisation pour offrir des fonctions adaptées aux besoins spécifiques de l'EMCA et de l'analyse conversationnelle. + +Périmètre à définir lors de la Phase 10 — pistes envisagées : + +- Vérification et correction assistée des conventions Jefferson / ICOR (chevauchements `[`, enchaînements `=`, pauses `(0.5)`, allongements `:`, prosodie `.` `,` `?`) +- Navigation structurée par tour de parole / séquence (vue panoptique inspirée de Sonal) +- Annotation thématique des tours (codes libres, portée fichier/dossier/vault) +- Export ELAN (`.eaf`) ou Praat (`.TextGrid`) depuis les fichiers annotés +- Couplage audio optionnel via fichier local (Obsidian API `app.vault`) — synchronisation tour ↔ segment audio +- Compatibilité avec le JSON d'échange Whispurge / Sonal pi (SPECS §20.6) + +**Testable (v1.0.0) :** un chercheur peut ouvrir une transcription CHAT, la naviguer tour par tour, corriger les conventions, pseudonymiser, annoter thématiquement, et exporter vers ELAN — sans quitter Obsidian. + +--- + +## Pahse 12 – Processus d'affinage de nettoyage des données +- [ ] `mappings/ConflictDetector.ts` : détection des chevauchements entre spans NER et règles manuelles (§8.5) +- [ ] `ambiguous.json` : tokens historiquement ambigus prénom/lieu (Florence, Nancy, Lorraine…) — badge ⚠ dans la modale de révision +- [ ] Seuil de population minimum configurable pour la détection (exclure les communes < N hab) +- [ ] Amélioration modèle : évaluer CamemBERT-NER (`Jean-Baptiste/camembert-ner`) + +--- + +## Features envisagées (hors phases planifiées) + +Ces fonctionnalités sont identifiées comme utiles mais non planifiées dans les phases actuelles. + +| Feature | Description | Prérequis | +|---|---|---| +| **Backend spaCy** | Serveur Python sidecar (`fr_core_news_sm`) appelé via HTTP — meilleure précision sur le français, pas de téléchargement de modèle, temps de réponse plus rapide. Requiert Python ≥ 3.9 côté utilisateur. | Phase 9 stable | +| **Modèle CamemBERT-NER** | Remplacer le modèle multilingue BERT par `Jean-Baptiste/camembert-ner` ou `cmarkea/distilcamembert-base-ner` — spécifiquement entraîné sur le français. Nécessite une conversion ONNX et un hébergement HuggingFace. | Phase 9 stable | +| **Score de confiance spaCy** | Exposer les scores d'entités de spaCy (via `displacy` ou scorer) pour filtrer comme avec transformers.js. | Backend spaCy | +| **Désambiguïsation interactive** | Modale contextuelle pour les tokens ambigus ville/prénom (Nancy, Florence…) : affichage du contexte + boutons Personne / Lieu / Ignorer. | Phase 9 | + +--- + +## Questions ouvertes (SPECS §20) + +| # | Question | Statut | +|---|---|---| +| 1 | Modifier les fichiers originaux ou fonctionner uniquement par export ? | **Décidé** — export en `.md` pour relire dans Obsidian, puis re-export dans le format inscrit dans les métadonnées du fichier source. L'onglet Exports affiche conditionnellement une option de chiffrement via [Meld Encrypt](https://github.com/meld-cp/obsidian-encrypt) quand on est dans un `*.pseudonymized.*`. | +| 2 | Tables de correspondance dans le vault ou hors vault par défaut ? | À trancher | +| 3 | Chiffrement des tables dès la v1 ? | **Décidé** — recommander le plugin [Meld Encrypt](https://github.com/meld-cp/obsidian-encrypt) pour le chiffrement des tables et des exports. Intégration dans l'onglet Exports (Phase 10). | +| 4 | Métadonnées CHAT dès le MVP ou à partir de la v0.3 ? | À trancher | +| 5 | NER avancé plus tard, ou rester sur dictionnaires + regex + validation humaine ? | **Décidé : NER (Phase 9)** — l'objectif du dictionnaire (détection ou remplacement) est déterminé à l'import. Le NER assure la détection ; les dictionnaires fournissent les candidats de substitution. | +| 6 | Compatibilité exacte à viser avec les JSON de Sonal pi / Whispurge ? | À explorer | +| 7 | Couplage audio optionnel via fichier local (API Obsidian) ? | À explorer | +| 8 | Export ELAN ou Praat ? | À explorer | +| 9 | Liste canonique pour `ambiguous.json` (Nancy, Florence, Lorraine…) ? | À constituer | +| 10 | Internationalisation (i18n) du plugin ? | **Décidé** — l'architecture doit permettre la traduction de l'interface. Toutes les chaînes UI doivent être externalisées dans un fichier de traduction. Implémentation en Phase 10. | diff --git a/ROADMAP.md b/ROADMAP.md index da79ded..22f3034 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,23 +1,25 @@ # ROADMAP — PseudObsidian-ization -Plugin Obsidian de pseudonymisation et correction de transcriptions (conventions Jefferson / ICOR / SRT / CHAT). +An Obsidian plugin for pseudonymizing and correcting interactional transcripts (Jefferson / ICOR / SRT / CHAT conventions). -Chaque phase produit quelque chose de testable. Les critères d'acceptation renvoient aux sections de SPECS.md. +> French version: [ROADMAP.fr.md](ROADMAP.fr.md) -## État actuel (mai 2026) — v0.1.0 +Each phase produces something testable. Acceptance criteria reference SPECS.md sections. -**Phases 0 à 8 terminées.** La Phase 9 (dictionnaires de remplacement pour lieux/institutions) est la prochaine cible. +## Current status (May 2026) — v0.1.x -Décision architecturale adoptée en mai 2026 : la **détection des entités identifiantes** repose sur du **NER** (`transformers.js` + `bert-base-multilingual-cased-ner-hrl`) plutôt que sur des dictionnaires lexicaux exhaustifs. Les dictionnaires restent des ressources de **remplacement** (candidats de substitution), pas de détection. +**Phases 0–9 complete.** Phase 10 (refinement & EMCA specialization) is the current target. + +Architectural decision (May 2026): **identifying entity detection** is handled by **NER** (`transformers.js` + `bert-base-multilingual-cased-ner-hrl`) rather than exhaustive lexical dictionaries. Dictionaries serve as **replacement** resources (substitution candidates), not detection. ``` -✅ Phases 0–8 Parsers · Moteur · UI · Portées · Surlignage · Validation · Coulmont · Panneau · NER · Wizard -🔄 Phase 9 Dictionnaires de remplacement (lieux/institutions) (v0.1.0) -⏳ Phase 10 Affinage et stabilisation (v0.2.0) -⏳ Phase 11 Fonctions d'analyse interactionnelle et conversationnelle (v1.0.0) +✅ Phases 0–8 Parsers · Engine · UI · Scopes · Highlighting · Validation · Coulmont · Panel · NER · Wizard +✅ Phase 9 Structured dictionaries · DictionaryLoader · Review modals · French communes +🔄 Phase 10 Refinement & EMCA specialization (v0.1.x → v0.2.0) +⏳ Phase 11 Interactional analysis functions (v1.0.0) ``` -La publication sur le répertoire communautaire Obsidian se fait **au fil des versions** (PR #12766 en cours de validation). +Community portal publication is ongoing with each version (PR #12766 under review). --- @@ -202,58 +204,67 @@ Objectif : permettre la détection et le remplacement automatiques des entités - [x] `MappingScanReviewModal` : modale de révision pour le scan par règles existantes - [x] Scan par dictionnaire accessible depuis l'onglet Dictionnaires et commande Ctrl+P - [x] Suppression onglet "Candidats" — scan règles → Mappings · scan NER → NER -- [ ] `mappings/ConflictDetector.ts` : détection des chevauchements entre spans NER et règles manuelles (§8.5) -- [ ] `ambiguous.json` : tokens historiquement ambigus prénom/lieu (Florence, Nancy, Lorraine…) — badge ⚠ dans la modale de révision -- [ ] Seuil de population minimum configurable pour la détection (exclure les communes < N hab) -- [ ] Amélioration modèle : évaluer CamemBERT-NER (`Jean-Baptiste/camembert-ner`) + **Testable (v0.1.3) :** installer le dictionnaire communes → scanner un fichier → modale de révision → décocher les faux positifs → créer les règles → pseudonymiser. --- -## ⏳ Phase 10 — Affinage et stabilisation (v0.2.0) +## 🔄 Phase 10 — Refinement & EMCA specialization (v0.1.x → v0.2.0) -Objectif : consolider l'ensemble des features en place avant d'aborder les fonctions avancées. +Goal: consolidate all existing features and add the EMCA-specific functions that make the plugin genuinely useful for interactional research. -- [ ] Couverture de tests unitaires ≥ 80 % sur parsers, moteur, NER scanner -- [ ] Tests de non-régression Phase 4 (§18.2) maintenus verts avec les règles NER actives -- [ ] Correction des conventions Jefferson / ICOR : suggestions au survol, highlighting éditeur -- [ ] Performance : mesurer et optimiser le temps de scan NER sur un fichier de 500 tours -- [ ] **Internationalisation (i18n)** : externaliser toutes les chaînes UI dans un fichier de traduction (`locales/fr.json`, `locales/en.json`) — architecture à définir (standard Obsidian ou `i18next`) -- [ ] Intégration [Meld Encrypt](https://github.com/meld-cp/obsidian-encrypt) dans l'onglet Exports pour le chiffrement des tables de correspondance et des exports pseudonymisés -- [ ] Trancher les questions ouvertes persistantes (SPECS §20) +- [x] **i18n** — all UI strings externalized in `locales/en.json` and `fr.json`; language selectable in wizard and settings +- [x] **Corpus organization** — named classes with mirrored folder structure; class selection on import +- [x] **Settings redesign** — 6 sections ordered by frequency of use +- [x] **Broad-scope warning** — callout in RuleModal / EditRuleModal for name rules with folder/vault scope +- [x] **Mappings tab grouped by scope** — File / Folder / Vault sections with active-file filter +- [ ] Unit test coverage ≥ 80% for parsers, engine, NER scanner, DictionaryLoader +- [ ] Jefferson / ICOR convention checker: hover suggestions, editor highlighting +- [ ] Exports in original format for corpus re-opening +- [ ] EMCA publication exports (PNG) +- [ ] NER performance: measure and optimize on a 500-turn file +- [ ] [Meld Encrypt](https://github.com/meld-cp/obsidian-encrypt) integration in Exports tab for encrypting correspondence tables and pseudonymized exports +- [ ] Resolve remaining open questions (SPECS §20) -**Testable (v0.2.0) :** workflow de bout en bout stable sur un corpus réel de 10 entretiens. +**Testable (v0.2.0):** stable end-to-end workflow on a real corpus of 10 interviews. --- -## ⏳ Phase 11 — Fonctions d'analyse interactionnelle et conversationnelle (v1.0.0) +## ⏳ Phase 11 — Interactional analysis functions (v1.0.0) -Objectif : aller au-delà de la pseudonymisation pour offrir des fonctions adaptées aux besoins spécifiques de l'EMCA et de l'analyse conversationnelle. +Goal: go beyond pseudonymization to offer functions tailored to EMCA and conversation analysis research. -Périmètre à définir lors de la Phase 10 — pistes envisagées : +Scope to be defined during Phase 10 — planned directions: -- Vérification et correction assistée des conventions Jefferson / ICOR (chevauchements `[`, enchaînements `=`, pauses `(0.5)`, allongements `:`, prosodie `.` `,` `?`) -- Navigation structurée par tour de parole / séquence (vue panoptique inspirée de Sonal) -- Annotation thématique des tours (codes libres, portée fichier/dossier/vault) -- Export ELAN (`.eaf`) ou Praat (`.TextGrid`) depuis les fichiers annotés -- Couplage audio optionnel via fichier local (Obsidian API `app.vault`) — synchronisation tour ↔ segment audio -- Compatibilité avec le JSON d'échange Whispurge / Sonal pi (SPECS §20.6) +- Assisted verification and correction of Jefferson / ICOR conventions (overlaps `[`, latching `=`, pauses `(0.5)`, lengthening `:`, prosody `.` `,` `?`) +- Structured navigation by turn / sequence (panoptic view inspired by Sonal) +- Thematic annotation of turns (free codes, file/folder/vault scope) +- ELAN (`.eaf`) or Praat (`.TextGrid`) export from annotated files +- Optional audio coupling via local file (Obsidian API `app.vault`) — turn ↔ audio segment synchronization +- Compatibility with Whispurge / Sonal pi exchange JSON (SPECS §20.6) -**Testable (v1.0.0) :** un chercheur peut ouvrir une transcription CHAT, la naviguer tour par tour, corriger les conventions, pseudonymiser, annoter thématiquement, et exporter vers ELAN — sans quitter Obsidian. +**Testable (v1.0.0):** a researcher can open a CHAT transcript, navigate turn by turn, correct conventions, pseudonymize, annotate thematically, and export to ELAN — without leaving Obsidian. --- -## Features envisagées (hors phases planifiées) +## Phase 12 — Data quality refinement -Ces fonctionnalités sont identifiées comme utiles mais non planifiées dans les phases actuelles. +- [ ] `mappings/ConflictDetector.ts`: overlap detection between NER spans and manual rules (§8.5) +- [ ] `ambiguous.json`: historically ambiguous first name / place tokens (Florence, Nancy, Lorraine…) — ⚠ badge in the review modal +- [ ] Configurable minimum population threshold for detection (exclude communes < N inhabitants) +- [ ] Model evaluation: CamemBERT-NER (`Jean-Baptiste/camembert-ner`) -| Feature | Description | Prérequis | +--- + +## Planned features (outside current phases) + +| Feature | Description | Prerequisite | |---|---|---| -| **Backend spaCy** | Serveur Python sidecar (`fr_core_news_sm`) appelé via HTTP — meilleure précision sur le français, pas de téléchargement de modèle, temps de réponse plus rapide. Requiert Python ≥ 3.9 côté utilisateur. | Phase 9 stable | -| **Modèle CamemBERT-NER** | Remplacer le modèle multilingue BERT par `Jean-Baptiste/camembert-ner` ou `cmarkea/distilcamembert-base-ner` — spécifiquement entraîné sur le français. Nécessite une conversion ONNX et un hébergement HuggingFace. | Phase 9 stable | -| **Score de confiance spaCy** | Exposer les scores d'entités de spaCy (via `displacy` ou scorer) pour filtrer comme avec transformers.js. | Backend spaCy | -| **Désambiguïsation interactive** | Modale contextuelle pour les tokens ambigus ville/prénom (Nancy, Florence…) : affichage du contexte + boutons Personne / Lieu / Ignorer. | Phase 9 | +| **spaCy backend** | Python sidecar server (`fr_core_news_sm`) called via HTTP — better precision on French, no model download, faster response. Requires Python ≥ 3.9. | Phase 9 stable | +| **CamemBERT-NER** | Replace the multilingual BERT model with `Jean-Baptiste/camembert-ner` or `cmarkea/distilcamembert-base-ner` — specifically trained on French. Requires ONNX conversion and HuggingFace hosting. | Phase 9 stable | +| **spaCy confidence scores** | Expose spaCy entity scores for filtering, as with transformers.js. | spaCy backend | +| **Interactive disambiguation** | Contextual modal for ambiguous city/first-name tokens (Nancy, Florence…): context display + Person / Place / Ignore buttons. | Phase 9 | --- diff --git a/esbuild.config.mjs b/esbuild.config.mjs index c1f2e5d..2127a49 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -55,7 +55,9 @@ const context = await esbuild.context({ logLevel: "info", sourcemap: prod ? false : "inline", treeShaking: true, - outfile: "main.js", + outfile: prod + ? "main.js" + : "test_vault/.obsidian/plugins/pseudonymizer-tool/main.js", }); if (prod) { diff --git a/main.js b/main.js index fcad7e0..b6aa66a 100644 --- a/main.js +++ b/main.js @@ -39,14 +39,649 @@ var __publicField = (obj, key, value) => { return value; }; +// src/i18n/locales/en.json +var en_default; +var init_en = __esm({ + "src/i18n/locales/en.json"() { + en_default = { + "corpus.modal.title": "Organize corpus", + "corpus.modal.hint": "Each class creates mirrored folders for transcriptions, mappings and exports.", + "corpus.modal.noClasses": "No classes defined. Add one to organize your documents by folder.", + "corpus.modal.addClass": "Add a class", + "corpus.modal.classNamePlaceholder": "Class name (e.g. Session_A, Informant_1\u2026)", + "corpus.modal.classNameEmpty": "Class name cannot be empty.", + "corpus.modal.classExists": "A class with this name already exists.", + "corpus.modal.deleteConfirm": 'Delete class "{0}"? The folders will be removed from the vault (files inside will be trashed).', + "corpus.modal.files": "{0} file(s)", + "corpus.modal.close": "Close", + "corpus.select.title": "Add to which class?", + "corpus.select.hint": "Choose the class (folder) for this transcription.", + "corpus.select.none": "No class (root)", + "corpus.select.confirm": "Add", + "quickModal.title": "Pseudonymize", + "quickModal.source": "Selected expression", + "quickModal.sourceDesc": "Term to replace \u2014 cannot be modified", + "quickModal.replaceBy": "Replace with", + "quickModal.replacementPlaceholder": "Pseudonym or analytical category", + "quickModal.scope": "Replacement scope", + "quickModal.scopeFile": "All occurrences in this file", + "quickModal.scopeOccurrence": "This occurrence only", + "quickModal.submit": "Pseudonymize", + "notice.appliedOccurrence": '\u2713 "{0}" \u2192 "{1}" (this occurrence)', + "notice.appliedFile": '\u2713 "{0}" \u2192 "{1}" ({2} occurrence{3})', + "onboarding.dict.importOk": "{0} dictionary imported", + "onboarding.dict.importOkMany": "{0} dictionaries imported", + "onboarding.dict.importErr": "{0} file rejected", + "onboarding.dict.importErrMany": "{0} files rejected", + "onboarding.dict.importError": "Error importing {0} \u2014 check the .dict.json format", + "notice.noActiveFile": "No active file.", + "notice.formatUnsupported": "Unsupported format: .{0}", + "notice.noRules": 'No rules for this file.\nCreate rules via Ctrl+P \u2192 "Create a rule".', + "notice.noOccurrences": "No occurrences found for the active rules.", + "notice.noNerEntities": "No entities detected by NER.", + "notice.nerEntitiesFound": "\u2713 {0} {1} detected \u2014 highlighted in blue.\nRight-click to create a rule.", + "notice.nerEntitiesFound.entity": "entity", + "notice.nerEntitiesFound.entities": "entities", + "notice.nerNotEnabled": "transformers.js NER detection is not enabled.\nEnable it in Settings \u2192 Pseudonymizer Tool.", + "notice.noDictDetection": "No detection dictionary loaded.\nInstall a dictionary from the Dictionaries panel.", + "notice.noDictEntities": "No entities found in the detection dictionaries.", + "notice.noDictReplacements": "No replacements available for the found entities.", + "notice.ruleCreated": '\u2713 Rule created: "{0}" \u2192 "{1}"', + "notice.rulesCreated": "\u2713 {0} {1} created", + "notice.rulesCreated.rule": "rule", + "notice.rulesCreated.rules": "rules", + "notice.occurrencesPseudonymized": '\u2713 {0} {1} pseudonymized in "{2}"', + "notice.occurrencesPseudonymized.occurrence": "occurrence", + "notice.occurrencesPseudonymized.occurrences": "occurrences", + "notice.converted": "\u2713 {0} \u2192 {1}", + "notice.conversionError": "Conversion error for {0}: {1}", + "notice.fileExists": "File already exists in vault: {0}", + "notice.conversionSkipped": "\u26A0 {0}.md already exists \u2014 conversion skipped for {1}", + "notice.exportDone": "\u2713 {0} rule(s) applied\n\u2192 {1}", + "notice.mappingExported": "\u2713 Mapping exported \u2192 {0}", + "notice.noMapping": "No mapping found for {0}", + "notice.invalidFormat": "Invalid format: {0}", + "notice.dictImported": "\u2713 {0} {1} imported", + "notice.dictImported.one": "dictionary", + "notice.dictImported.many": "dictionaries", + "notice.dictRejected": "{0} {1} rejected", + "notice.dictRejected.one": "file", + "notice.dictRejected.many": "files", + "notice.nerModelLoaded": "\u2713 NER model loaded", + "notice.nerModelLoading": "Loading NER model (first use \u2014 ~66 MB)\u2026", + "notice.ruleNotFound": "Rule not found in mappings.", + "notice.noCheckedDicts": "No dictionary checked.", + "command.organizeCorpus": "Organize corpus", + "command.addTranscription": "Add a transcription", + "command.pseudonymizeFile": "Pseudonymize current file", + "command.createRule": "Create a replacement rule", + "command.scanFile": "Scan current file", + "command.scanNer": "Scan file with NER detection", + "command.scanDictionaries": "Scan file with dictionaries", + "command.pseudonymizeSelection": "Pseudonymize selection", + "command.openPanel": "Pseudonymization: open panel", + "contextMenu.cancelPseudonymization": 'Cancel pseudonymization of "{0}"', + "contextMenu.editRule": 'Edit rule for "{0}"', + "contextMenu.pseudonymize": 'Pseudonymize "{0}"', + "ruleModal.delete": "Delete rule", + "ruleModal.scopeWarnTitle": "Longitudinal scope", + "ruleModal.scopeOkTitle": "File scope", + "ruleModal.scopeOk": "Good practice. This pseudonym will only apply to this transcription \u2014 each file remains independent.", + "contextMenu.coulmont": "Pseudonymize with Prof. Baptiste Coulmont", + "contextMenu.createRule": "Create a replacement rule\u2026", + "ruleModal.title": "Create a replacement rule", + "ruleModal.source": "Source", + "ruleModal.sourceDesc": "Original term to replace", + "ruleModal.replacement": "Replacement", + "ruleModal.replacementDesc": "Pseudonym or analytical category", + "ruleModal.replacementDescClass": "The exact index will be calculated at creation based on existing rules in the scope.", + "ruleModal.category": "Category", + "ruleModal.scope": "Scope", + "ruleModal.scopeFile": "This file only", + "ruleModal.scopeFolder": "This folder", + "ruleModal.scopeVault": "Entire vault", + "ruleModal.priority": "Priority", + "ruleModal.priorityDesc": "Free integer, like a CSS z-index \u2014 default 0, higher = applied first", + "ruleModal.submit": "Create rule", + "ruleModal.errorMissing": "Source and replacement are required.", + "ruleModal.errorNoFile": "No active file.", + "ruleModal.coulomontLabel": "Equivalent first name suggestions \u2014 choose:", + "ruleModal.dictLabel": 'Dictionary: "{0}" \u2192 class {1}', + "ruleModal.dictUseClass": 'Use "{0}" (scope: {1})', + "category.first_name": "First name", + "category.last_name": "Last name", + "category.full_name": "Full name", + "category.place": "Place", + "category.institution": "Institution", + "category.date": "Date", + "category.age": "Age", + "category.profession": "Profession", + "category.custom": "Other", + "scope.file": "File", + "scope.folder": "Folder", + "scope.vault": "Vault", + "status.validated": "\u2713", + "status.ignored": "\u2717", + "status.partial": "\u25D1", + "status.suggested": "?", + "status.conflict": "\u26A0", + "status.disabled": "\u2013", + "status.needs_review": "\u{1F441}", + "panel.tab.mappings": "Mappings", + "panel.tab.dictionaries": "Dictionaries", + "panel.tab.exports": "Exports", + "panel.tab.ner": "NER", + "panel.mappings.filterActive": "Active file only", + "panel.mappings.warnBroadName": "\u26A0 Generalizing a first name or surname beyond file scope should only be done as a deliberate analytical choice \u2014 for example, to consistently track the same participant in a longitudinal study. Even when the same individual appears in multiple files, file-level pseudonymization is generally preferable: it keeps each transcription independent and reduces the risk of cross-file identification.", + "panel.mappings.addRule": "Add a rule", + "panel.mappings.scanFile": "Scan file", + "panel.mappings.scanning": "Scanning\u2026", + "panel.mappings.noFile": "No active file.", + "panel.mappings.noRules": "No rules for {0}.", + "panel.mappings.noRulesHint": 'No active rules for this file. Create rules via the context menu or the "create a rule" command.', + "panel.mappings.col.source": "Source", + "panel.mappings.col.replacement": "Replacement", + "panel.mappings.col.category": "Category", + "panel.mappings.col.scope": "Scope", + "panel.mappings.col.priority": "P.", + "panel.mappings.col.status": "Status", + "panel.dict.noneInstalled": "No dictionary installed. Install one from the wizard (Settings \u2192 Reconfigure) or import a local file.", + "panel.dict.checkbox": "Include in grouped scan", + "panel.dict.scanAll": "Scan checked dictionaries", + "panel.dict.importLocal": "Import a local file (.dict.json)", + "panel.dict.scanWith": 'Scan active file with "{0}"', + "panel.dict.remove": "Remove this dictionary", + "panel.exports.pseudonymize": "Pseudonymize and export", + "panel.exports.exportMapping": "Export correspondence table", + "panel.ner.scanBtn": "Identify candidates", + "panel.ner.hint": "Settings for the automatic named entity detection scanner.", + "panel.ner.threshold": "Confidence threshold", + "panel.ner.thresholdDesc": "Entities with a score below this value are ignored. Higher = fewer false positives but fewer detections.", + "panel.ner.functionWords": "Excluded function words", + "panel.ner.functionWordsDesc": "One word per line. These tokens will never be retained as named entities, even if detected by the model.", + "panel.ner.save": "Save", + "panel.ner.saved": "Saved", + "panel.ner.reset": "Reset to defaults", + "dictScanModal.title": "Dictionary scan review", + "dictScanModal.summary": "{0} {1} detected \xB7 {2}", + "dictScanModal.summary.entity": "entity", + "dictScanModal.summary.entities": "entities", + "dictScanModal.hint": "Uncheck false positives. The prefix is editable; the index is calculated automatically.", + "dictScanModal.apply": "Create {0} {1}", + "dictScanModal.apply.rule": "rule", + "dictScanModal.apply.rules": "rules", + "dictScanModal.noRules": "No rules to apply", + "dictScanModal.cancel": "Cancel", + "mappingScanModal.title": "Mapping scan review", + "mappingScanModal.summary": '{0} active {1} with occurrences in "{2}"', + "mappingScanModal.summary.rule": "rule", + "mappingScanModal.summary.rules": "rules", + "mappingScanModal.hint": "Uncheck rules not to apply. Replacements will be written to the source file.", + "mappingScanModal.col.source": "", + "mappingScanModal.col.replacement": "Replacement", + "mappingScanModal.col.occurrences": "Occ.", + "mappingScanModal.apply": "Pseudonymize ({0} {1}, {2} {3})", + "mappingScanModal.apply.rule": "rule", + "mappingScanModal.apply.rules": "rules", + "mappingScanModal.apply.occurrence": "occurrence", + "mappingScanModal.apply.occurrences": "occurrences", + "mappingScanModal.noRules": "No rules to apply", + "mappingScanModal.cancel": "Cancel", + "onboarding.step.storage": "Storage", + "onboarding.step.language": "Language", + "onboarding.step.welcome": "Welcome", + "onboarding.step.ner": "NER Detection", + "onboarding.step.dictionaries": "Dictionaries", + "onboarding.step.summary": "Summary", + "onboarding.welcome.title": "Pseudonymizer Tool", + "onboarding.welcome.desc": "This plugin helps you correct and pseudonymize transcripts of interviews and interactional corpora (Jefferson, ICOR, .srt, .cha formats).", + "onboarding.welcome.steps": "The wizard will guide you in a few quick steps:", + "onboarding.welcome.step1": "Choose the interface language.", + "onboarding.welcome.step2": "Choose an automatic named entity detection engine (optional).", + "onboarding.welcome.step3": "Install replacement candidate dictionaries if you need them.", + "onboarding.welcome.hint": "You can reconfigure these options at any time via the plugin settings.", + "onboarding.storage.title": "Storage", + "onboarding.storage.vaultPerCorpus": "One vault per corpus", + "onboarding.storage.vaultPerCorpusDesc": "We recommend using a dedicated Obsidian vault for each corpus. This keeps mapping files, dictionaries and exports together with their transcriptions, and makes it easier to share or archive a corpus.", + "onboarding.storage.transcriptionsFolder": "Transcriptions folder", + "onboarding.storage.mappingFolder": "Correspondence tables", + "onboarding.storage.dictionariesFolder": "Dictionaries", + "onboarding.storage.exportsFolder": "Exports", + "onboarding.storage.hint": "These paths are relative to the vault root. You can change them later in Settings.", + "onboarding.language.title": "Interface language", + "onboarding.language.hint": "The interface language does not affect transcript analysis. Conventions (Jefferson, ICOR) are language-independent.", + "onboarding.ner.desc": "A NER model (named entity recognition) can automatically detect first names, surnames, places and institutions in your transcripts \u2014 without an exhaustive list, running locally in Obsidian.", + "onboarding.ner.tfjsTitle": "transformers.js \u2014 embedded ONNX model", + "onboarding.ner.tfjsBadge": "No Python required", + "onboarding.ner.tfjsDesc": "Multilingual NER model running locally in the vault. WASM files (~19 MB) are downloaded once. The model (~66 MB) is downloaded on first scan.", + "onboarding.ner.wasmReady": "WASM files already installed", + "onboarding.ner.installBtn": "Install and use transformers.js", + "onboarding.ner.selectedBtn": "Selected", + "onboarding.ner.noneActive": "Disabled (manual rules only)", + "onboarding.ner.noneSkip": "Skip \u2014 I will work manually", + "onboarding.dict.title": "Replacement candidate dictionaries", + "onboarding.dict.desc": "Dictionaries provide replacement candidates (cities, first names\u2026) and feed automatic detection. They are hosted in a dedicated repository and downloaded into your vault \u2014 no transcript data leaves Obsidian.", + "onboarding.dict.catalogueLoading": "Loading catalogue\u2026", + "onboarding.dict.catalogueError": "Unable to reach the online catalogue. Check your connection or import a local file below.", + "onboarding.dict.recommended": "Recommended", + "onboarding.dict.col.dict": "Dictionary", + "onboarding.dict.col.lang": "Language", + "onboarding.dict.col.roles": "Roles", + "onboarding.dict.col.size": "Size", + "onboarding.dict.role.detection": "detection", + "onboarding.dict.role.replacement": "replacement", + "onboarding.dict.role.classes": "classes", + "onboarding.dict.install": "Install", + "onboarding.dict.reinstall": "Reinstall", + "onboarding.dict.installed": "Installed", + "onboarding.dict.manualHint": "Already have a .dict.json file? Import it manually:", + "onboarding.dict.importBtn": "Import a local file (.dict.json)", + "onboarding.dict.listTitle": "Dictionaries installed in this vault ({0}):", + "onboarding.dict.remove": "Remove this dictionary", + "onboarding.summary.ner.none": "Disabled \u2014 manual rules only", + "onboarding.summary.ner.tfjs": "transformers.js \u2014 ONNX model (download on first scan)", + "onboarding.nav.cancel": "Cancel", + "onboarding.nav.back": "Back", + "onboarding.nav.skip": "Skip this step", + "onboarding.nav.next": "Next", + "onboarding.nav.start": "Get started", + "onboarding.nav.finish": "Start working", + "onboarding.summary.title": "Configuration complete", + "onboarding.summary.intro": "Here is what was configured:", + "onboarding.summary.ner": "NER Detection", + "onboarding.summary.dicts": "Dictionaries", + "onboarding.summary.dicts.count": "{0} file(s) in vault", + "onboarding.summary.hint": "These settings can be changed at any time via plugin settings: Reconfigure.", + "settings.heading.general": "General", + "settings.heading.textDetection": "Text detection", + "settings.heading.pseudonymization": "Pseudonymization", + "settings.heading.ner": "Automatic detection (NER)", + "settings.heading.storage": "Storage", + "settings.heading.security": "Security", + "settings.language": "Interface language", + "settings.languageDesc": "Does not affect transcript analysis. Conventions (Jefferson, ICOR) are language-independent.", + "settings.vaultPerCorpus": "One vault per corpus", + "settings.vaultPerCorpusDesc": "We recommend using a dedicated Obsidian vault for each corpus. This ensures mapping files, dictionaries and exports stay together with their transcriptions.", + "settings.transcriptionsFolder": "Imported transcriptions", + "settings.transcriptionsFolderDesc": "Destination folder for imported transcriptions.", + "settings.mappingFolder": "Correspondence tables", + "settings.mappingFolderDesc": "Relative path in the vault.", + "settings.dictionariesFolder": "Dictionaries", + "settings.dictionariesFolderDesc": "Relative path in the vault.", + "settings.exportsFolder": "Exports", + "settings.accentSensitive": "Accent sensitive", + "settings.preserveCase": "Preserve case", + "settings.preserveCaseDesc": "Adapt the replacement case to match the source (e.g. JEAN \u2192 PIERRE, jean \u2192 pierre, Jean \u2192 Pierre).", + "settings.preserveAnalyticNotation": "Preserve analytical notation", + "settings.preserveAnalyticNotationDesc": "Never replace Jefferson or ICOR analytical convention symbols.", + "settings.useMarkerInExport": "Add marker around pseudonyms in export", + "settings.useMarkerInExportDesc": "Allows visual identification of pseudonymized terms in the exported file.", + "settings.markerOpen": "Opening marker", + "settings.markerOpenDesc": "Example: {{ \u27E6 [ \xAB", + "settings.markerClose": "Closing marker", + "settings.markerCloseDesc": "Example: }} \u27E7 ] \xBB", + "settings.nerBackend": "Detection engine", + "settings.nerBackendDesc": "Backend used for automatic detection of identifying named entities.", + "settings.nerBackend.none": "Disabled \u2014 manual rules only", + "settings.nerBackend.tfjs": "transformers.js (embedded ONNX model)", + "settings.reconfigure": "Setup wizard", + "settings.reconfigureDesc2": "Relaunch the wizard to reconfigure NER detection and dictionaries.", + "settings.reconfigureBtn2": "Reconfigure\u2026", + "settings.warnIfSyncedFolder": "Warn if folder is synced", + "settings.warnIfSyncedFolderDesc": "Alert if correspondence tables are in a Git, iCloud or Synology Drive folder.", + "settings.caseSensitive": "Case sensitive", + "settings.caseSensitiveDesc": 'If enabled, "Jean" and "jean" are treated as distinct.', + "settings.wholeWordOnly": "Whole words only", + "settings.wholeWordOnlyDesc": "If enabled, only complete word occurrences are replaced." + }; + } +}); + +// src/i18n/locales/fr.json +var fr_default; +var init_fr = __esm({ + "src/i18n/locales/fr.json"() { + fr_default = { + "corpus.modal.title": "Organiser le corpus", + "corpus.modal.hint": "Chaque classe cr\xE9e des dossiers en miroir pour les transcriptions, les mappings et les exports.", + "corpus.modal.noClasses": "Aucune classe d\xE9finie. Ajoutez-en une pour organiser vos documents par dossier.", + "corpus.modal.addClass": "Ajouter une classe", + "corpus.modal.classNamePlaceholder": "Nom de la classe (ex. Session_A, Informateur_1\u2026)", + "corpus.modal.classNameEmpty": "Le nom de la classe ne peut pas \xEAtre vide.", + "corpus.modal.classExists": "Une classe avec ce nom existe d\xE9j\xE0.", + "corpus.modal.deleteConfirm": "Supprimer la classe \xAB {0} \xBB ? Les dossiers seront retir\xE9s du vault (les fichiers \xE0 l'int\xE9rieur seront mis \xE0 la corbeille).", + "corpus.modal.files": "{0} fichier(s)", + "corpus.modal.close": "Fermer", + "corpus.select.title": "Ajouter dans quelle classe ?", + "corpus.select.hint": "Choisissez la classe (dossier) pour cette transcription.", + "corpus.select.none": "Sans classe (racine)", + "corpus.select.confirm": "Ajouter", + "quickModal.title": "Pseudonymiser", + "quickModal.source": "Expression s\xE9lectionn\xE9e", + "quickModal.sourceDesc": "Terme \xE0 remplacer \u2014 non modifiable", + "quickModal.replaceBy": "Remplacer par", + "quickModal.replacementPlaceholder": "Pseudonyme ou cat\xE9gorie analytique", + "quickModal.scope": "Port\xE9e du remplacement", + "quickModal.scopeFile": "Toutes les occurrences dans ce fichier", + "quickModal.scopeOccurrence": "Cette occurrence uniquement", + "quickModal.submit": "Pseudonymiser", + "notice.appliedOccurrence": '\u2713 "{0}" \u2192 "{1}" (cette occurrence)', + "notice.appliedFile": '\u2713 "{0}" \u2192 "{1}" ({2} occurrence{3})', + "onboarding.dict.importOk": "{0} dictionnaire import\xE9", + "onboarding.dict.importOkMany": "{0} dictionnaires import\xE9s", + "onboarding.dict.importErr": "{0} fichier rejet\xE9", + "onboarding.dict.importErrMany": "{0} fichiers rejet\xE9s", + "onboarding.dict.importError": "Erreur lors de l'import de {0} \u2014 v\xE9rifiez le format .dict.json", + "notice.noActiveFile": "Aucun fichier actif.", + "notice.formatUnsupported": "Format non pris en charge : .{0}", + "notice.noRules": 'Aucune r\xE8gle pour ce fichier.\nCr\xE9ez des r\xE8gles via Ctrl+P \u2192 "Cr\xE9er une r\xE8gle".', + "notice.noOccurrences": "Aucune occurrence trouv\xE9e pour les r\xE8gles actives.", + "notice.noNerEntities": "Aucune entit\xE9 d\xE9tect\xE9e par le NER.", + "notice.nerEntitiesFound": "\u2713 {0} {1} d\xE9tect\xE9e{2} \u2014 surlign\xE9e{2} en bleu.\nClic droit pour cr\xE9er une r\xE8gle.", + "notice.nerEntitiesFound.entity": "entit\xE9", + "notice.nerEntitiesFound.entities": "entit\xE9s", + "notice.nerNotEnabled": "La d\xE9tection NER transformers.js n'est pas activ\xE9e.\nActivez-la dans Param\xE8tres \u2192 Pseudonymizer Tool.", + "notice.noDictDetection": "Aucun dictionnaire de d\xE9tection charg\xE9.\nInstallez un dictionnaire depuis le panneau Dictionnaires.", + "notice.noDictEntities": "Aucune entit\xE9 trouv\xE9e dans les dictionnaires de d\xE9tection.", + "notice.noDictReplacements": "Aucun remplacement disponible pour les entit\xE9s trouv\xE9es.", + "notice.ruleCreated": '\u2713 R\xE8gle cr\xE9\xE9e : "{0}" \u2192 "{1}"', + "notice.rulesCreated": "\u2713 {0} r\xE8gle{1} cr\xE9\xE9e{1}", + "notice.rulesCreated.rule": "", + "notice.rulesCreated.rules": "s", + "notice.occurrencesPseudonymized": '\u2713 {0} occurrence{1} pseudonymis\xE9e{1} dans "{2}"', + "notice.occurrencesPseudonymized.occurrence": "", + "notice.occurrencesPseudonymized.occurrences": "s", + "notice.converted": "\u2713 {0} \u2192 {1}", + "notice.conversionError": "Erreur de conversion de {0} : {1}", + "notice.fileExists": "Le fichier existe d\xE9j\xE0 dans le vault : {0}", + "notice.conversionSkipped": "\u26A0 {0}.md existe d\xE9j\xE0 \u2014 conversion ignor\xE9e pour {1}", + "notice.exportDone": "\u2713 {0} r\xE8gle(s) appliqu\xE9e(s)\n\u2192 {1}", + "notice.mappingExported": "\u2713 Mapping export\xE9 \u2192 {0}", + "notice.noMapping": "Aucun mapping trouv\xE9 pour {0}", + "notice.invalidFormat": "Format invalide : {0}", + "notice.dictImported": "\u2713 {0} dictionnaire{1} import\xE9{1}", + "notice.dictImported.one": "", + "notice.dictImported.many": "s", + "notice.dictRejected": "{0} fichier{1} rejet\xE9{1}", + "notice.dictRejected.one": "", + "notice.dictRejected.many": "s", + "notice.nerModelLoaded": "\u2713 Mod\xE8le NER charg\xE9", + "notice.nerModelLoading": "Chargement du mod\xE8le NER (premi\xE8re utilisation \u2014 ~66 Mo)\u2026", + "notice.ruleNotFound": "R\xE8gle introuvable dans les mappings.", + "notice.noCheckedDicts": "Aucun dictionnaire coch\xE9.", + "command.organizeCorpus": "Organiser le corpus", + "command.addTranscription": "Ajouter une transcription", + "command.pseudonymizeFile": "Pseudonymiser le fichier courant", + "command.createRule": "Cr\xE9er une r\xE8gle de remplacement", + "command.scanFile": "Scanner le fichier courant", + "command.scanNer": "Scanner le fichier avec d\xE9tection NER", + "command.scanDictionaries": "Scanner le fichier avec les dictionnaires", + "command.pseudonymizeSelection": "Pseudonymiser la s\xE9lection", + "command.openPanel": "Pseudonymisation : ouvrir le panneau", + "contextMenu.cancelPseudonymization": 'Annuler la pseudonymisation de "{0}"', + "contextMenu.editRule": 'Modifier la r\xE8gle pour "{0}"', + "contextMenu.pseudonymize": 'Pseudonymiser "{0}"', + "ruleModal.delete": "Supprimer la r\xE8gle", + "ruleModal.scopeWarnTitle": "Port\xE9e longitudinale", + "ruleModal.scopeOkTitle": "Port\xE9e fichier", + "ruleModal.scopeOk": "Bonne pratique. Ce pseudonyme ne s'appliquera qu'\xE0 cette transcription \u2014 chaque fichier reste ind\xE9pendant.", + "contextMenu.coulmont": "Pseudonymiser avec Pr Baptiste Coulmont", + "contextMenu.createRule": "Cr\xE9er une r\xE8gle de remplacement\u2026", + "ruleModal.title": "Cr\xE9er une r\xE8gle de remplacement", + "ruleModal.source": "Source", + "ruleModal.sourceDesc": "Terme original \xE0 remplacer", + "ruleModal.replacement": "Remplacement", + "ruleModal.replacementDesc": "Pseudonyme ou cat\xE9gorie analytique", + "ruleModal.replacementDescClass": "L'index exact sera calcul\xE9 \xE0 la cr\xE9ation selon les r\xE8gles existantes dans la port\xE9e.", + "ruleModal.category": "Cat\xE9gorie", + "ruleModal.scope": "Port\xE9e", + "ruleModal.scopeFile": "Ce fichier uniquement", + "ruleModal.scopeFolder": "Ce dossier", + "ruleModal.scopeVault": "Tout le vault", + "ruleModal.priority": "Priorit\xE9", + "ruleModal.priorityDesc": "Entier libre, comme un z-index CSS \u2014 d\xE9faut 0, plus grand = appliqu\xE9 en premier", + "ruleModal.submit": "Cr\xE9er la r\xE8gle", + "ruleModal.errorMissing": "La source et le remplacement sont obligatoires.", + "ruleModal.errorNoFile": "Aucun fichier actif.", + "ruleModal.coulomontLabel": "Suggestions de pr\xE9noms \xE9quivalents \u2014 choisissez :", + "ruleModal.dictLabel": 'Dictionnaire : "{0}" \u2192 classe {1}', + "ruleModal.dictUseClass": 'Utiliser "{0}" (port\xE9e : {1})', + "category.first_name": "Pr\xE9nom", + "category.last_name": "Nom de famille", + "category.full_name": "Nom complet", + "category.place": "Lieu", + "category.institution": "Institution", + "category.date": "Date", + "category.age": "\xC2ge", + "category.profession": "Profession", + "category.custom": "Autre", + "scope.file": "Fichier", + "scope.folder": "Dossier", + "scope.vault": "Vault", + "status.validated": "\u2713", + "status.ignored": "\u2717", + "status.partial": "\u25D1", + "status.suggested": "?", + "status.conflict": "\u26A0", + "status.disabled": "\u2013", + "status.needs_review": "\u{1F441}", + "panel.tab.mappings": "Mappings", + "panel.tab.dictionaries": "Dictionnaires", + "panel.tab.exports": "Exports", + "panel.tab.ner": "NER", + "panel.mappings.filterActive": "Fichier actif uniquement", + "panel.mappings.warnBroadName": "\u26A0 G\xE9n\xE9raliser un pr\xE9nom ou un nom de famille au-del\xE0 du fichier ne doit \xEAtre fait que comme choix analytique d\xE9lib\xE9r\xE9 \u2014 par exemple pour suivre de mani\xE8re coh\xE9rente le m\xEAme participant dans une \xE9tude longitudinale. M\xEAme si le m\xEAme individu appara\xEEt dans plusieurs fichiers, la pseudonymisation \xE0 l'\xE9chelle du fichier reste pr\xE9f\xE9rable : elle pr\xE9serve l'ind\xE9pendance de chaque transcription et r\xE9duit le risque d'identification crois\xE9e.", + "panel.mappings.addRule": "Ajouter une r\xE8gle", + "panel.mappings.scanFile": "Scanner le fichier", + "panel.mappings.scanning": "Scan en cours\u2026", + "panel.mappings.noFile": "Aucun fichier actif.", + "panel.mappings.noRules": "Aucune r\xE8gle pour {0}.", + "panel.mappings.noRulesHint": 'Aucune r\xE8gle active pour ce fichier. Cr\xE9ez des r\xE8gles via le menu contextuel ou la commande "cr\xE9er une r\xE8gle".', + "panel.mappings.col.source": "Source", + "panel.mappings.col.replacement": "Remplacement", + "panel.mappings.col.category": "Cat\xE9gorie", + "panel.mappings.col.scope": "Port\xE9e", + "panel.mappings.col.priority": "P.", + "panel.mappings.col.status": "Statut", + "panel.dict.noneInstalled": "Aucun dictionnaire install\xE9. Installez-en un depuis le wizard (Param\xE8tres \u2192 Reconfigurer) ou importez un fichier local.", + "panel.dict.checkbox": "Inclure dans le scan group\xE9", + "panel.dict.scanAll": "Scanner les dictionnaires coch\xE9s", + "panel.dict.importLocal": "Importer un fichier local (.dict.json)", + "panel.dict.scanWith": 'Scanner le fichier actif avec "{0}"', + "panel.dict.remove": "Supprimer ce dictionnaire", + "panel.exports.pseudonymize": "Pseudonymiser et exporter", + "panel.exports.exportMapping": "Exporter la table de correspondance", + "panel.ner.scanBtn": "Identifier des candidats", + "panel.ner.hint": "Param\xE8tres du scanner de d\xE9tection automatique des entit\xE9s nomm\xE9es.", + "panel.ner.threshold": "Seuil de confiance", + "panel.ner.thresholdDesc": "Les entit\xE9s dont le score est inf\xE9rieur \xE0 cette valeur sont ignor\xE9es. Plus la valeur est haute, moins de faux positifs mais aussi moins de d\xE9tections.", + "panel.ner.functionWords": "Mots fonctionnels exclus", + "panel.ner.functionWordsDesc": "Un mot par ligne. Ces termes ne seront jamais retenus comme entit\xE9s nomm\xE9es, m\xEAme si le mod\xE8le les d\xE9tecte (artefacts de tokenisation).", + "panel.ner.save": "Enregistrer", + "panel.ner.saved": "Enregistr\xE9", + "panel.ner.reset": "R\xE9initialiser par d\xE9faut", + "dictScanModal.title": "R\xE9vision du scan \u2014 dictionnaires", + "dictScanModal.summary": "{0} entit\xE9{1} d\xE9tect\xE9e{1} \xB7 {2}", + "dictScanModal.summary.entity": "", + "dictScanModal.summary.entities": "s", + "dictScanModal.hint": "D\xE9cochez les faux positifs. Le pr\xE9fixe est \xE9ditable ; l'index est calcul\xE9 automatiquement.", + "dictScanModal.apply": "Cr\xE9er {0} r\xE8gle{1}", + "dictScanModal.apply.rule": "", + "dictScanModal.apply.rules": "s", + "dictScanModal.noRules": "Aucune r\xE8gle \xE0 appliquer", + "dictScanModal.cancel": "Annuler", + "mappingScanModal.title": "R\xE9vision du scan \u2014 mappings", + "mappingScanModal.summary": '{0} r\xE8gle{1} active{1} avec des occurrences dans "{2}"', + "mappingScanModal.summary.rule": "", + "mappingScanModal.summary.rules": "s", + "mappingScanModal.hint": "D\xE9cochez les r\xE8gles \xE0 ne pas appliquer. Les remplacements seront \xE9crits dans le fichier source.", + "mappingScanModal.col.source": "", + "mappingScanModal.col.replacement": "Remplacement", + "mappingScanModal.col.occurrences": "Occ.", + "mappingScanModal.apply": "Pseudonymiser ({0} r\xE8gle{1}, {2} occurrence{3})", + "mappingScanModal.apply.rule": "", + "mappingScanModal.apply.rules": "s", + "mappingScanModal.apply.occurrence": "", + "mappingScanModal.apply.occurrences": "s", + "mappingScanModal.noRules": "Aucune r\xE8gle \xE0 appliquer", + "mappingScanModal.cancel": "Annuler", + "onboarding.step.storage": "Stockage", + "onboarding.step.language": "Langue", + "onboarding.step.welcome": "Bienvenue", + "onboarding.step.ner": "D\xE9tection NER", + "onboarding.step.dictionaries": "Dictionnaires", + "onboarding.step.summary": "R\xE9sum\xE9", + "onboarding.welcome.title": "Pseudonymizer Tool", + "onboarding.welcome.desc": "Ce plugin vous aide \xE0 corriger et pseudonymiser des transcriptions d'entretiens et de corpus interactionnels (conventions Jefferson, ICOR, formats .srt, .cha).", + "onboarding.welcome.steps": "L'assistant va vous guider en quelques \xE9tapes rapides :", + "onboarding.welcome.step1": "Choisir la langue de l'interface.", + "onboarding.welcome.step2": "Choisir un moteur de d\xE9tection automatique des entit\xE9s nomm\xE9es (optionnel).", + "onboarding.welcome.step3": "Installer des dictionnaires de candidats de remplacement si vous en avez besoin.", + "onboarding.welcome.hint": "Vous pourrez reconfigurer ces options \xE0 tout moment via les param\xE8tres du plugin.", + "onboarding.storage.title": "Stockage", + "onboarding.storage.vaultPerCorpus": "Un vault par corpus", + "onboarding.storage.vaultPerCorpusDesc": "Nous recommandons d'utiliser un vault Obsidian d\xE9di\xE9 par corpus. Cela garantit que les fichiers de mapping, les dictionnaires et les exports restent avec leurs transcriptions, et facilite le partage ou l'archivage d'un corpus.", + "onboarding.storage.transcriptionsFolder": "Transcriptions", + "onboarding.storage.mappingFolder": "Tables de correspondance", + "onboarding.storage.dictionariesFolder": "Dictionnaires", + "onboarding.storage.exportsFolder": "Exports", + "onboarding.storage.hint": "Ces chemins sont relatifs \xE0 la racine du vault. Vous pouvez les modifier ult\xE9rieurement dans les Param\xE8tres.", + "onboarding.language.title": "Langue de l'interface", + "onboarding.language.hint": "La langue de l'interface n'a aucun effet sur l'analyse des transcriptions. Les conventions (Jefferson, ICOR) sont ind\xE9pendantes de la langue.", + "onboarding.ner.desc": "Un mod\xE8le NER (reconnaissance d'entit\xE9s nomm\xE9es) peut d\xE9tecter automatiquement les pr\xE9noms, noms, lieux et institutions dans vos transcriptions \u2014 sans liste exhaustive, directement dans Obsidian.", + "onboarding.ner.tfjsTitle": "transformers.js \u2014 mod\xE8le ONNX embarqu\xE9", + "onboarding.ner.tfjsBadge": "Python n'est pas requis", + "onboarding.ner.tfjsDesc": "Mod\xE8le NER multilingue ex\xE9cut\xE9 localement dans le vault. Les fichiers .wasm (~19 Mo) sont t\xE9l\xE9charg\xE9s une seule fois ici. Le mod\xE8le (~66 Mo) est t\xE9l\xE9charg\xE9 au premier scan.", + "onboarding.ner.wasmReady": "Fichiers .wasm d\xE9j\xE0 install\xE9s", + "onboarding.ner.installBtn": "Installer et utiliser transformers.js", + "onboarding.ner.selectedBtn": "S\xE9lectionn\xE9", + "onboarding.ner.noneActive": "D\xE9sactiv\xE9 (r\xE8gles manuelles uniquement)", + "onboarding.ner.noneSkip": "Passer \u2014 je travaillerai manuellement", + "onboarding.dict.title": "Dictionnaires de candidats de remplacement", + "onboarding.dict.desc": "Les dictionnaires fournissent des candidats de remplacement (villes, pr\xE9noms\u2026) et alimentent la d\xE9tection automatique. Ils sont h\xE9berg\xE9s dans un d\xE9p\xF4t d\xE9di\xE9 et t\xE9l\xE9charg\xE9s dans votre vault \u2014 aucune donn\xE9e de transcription ne quitte Obsidian.", + "onboarding.dict.catalogueLoading": "Chargement du catalogue\u2026", + "onboarding.dict.catalogueError": "Impossible de contacter le catalogue en ligne. V\xE9rifiez votre connexion ou importez un fichier local ci-dessous.", + "onboarding.dict.recommended": "Recommand\xE9", + "onboarding.dict.col.dict": "Dictionnaire", + "onboarding.dict.col.lang": "Langue", + "onboarding.dict.col.roles": "R\xF4les", + "onboarding.dict.col.size": "Taille", + "onboarding.dict.role.detection": "d\xE9tection", + "onboarding.dict.role.replacement": "remplacement", + "onboarding.dict.role.classes": "classes", + "onboarding.dict.install": "Installer", + "onboarding.dict.reinstall": "R\xE9installer", + "onboarding.dict.installed": "Install\xE9", + "onboarding.dict.manualHint": "Vous avez d\xE9j\xE0 un fichier .dict.json ? Importez-le manuellement :", + "onboarding.dict.importBtn": "Importer un fichier local (.dict.json)", + "onboarding.dict.listTitle": "Dictionnaires install\xE9s dans ce vault ({0}) :", + "onboarding.dict.remove": "Retirer ce dictionnaire", + "onboarding.summary.ner.none": "D\xE9sactiv\xE9 \u2014 r\xE8gles manuelles uniquement", + "onboarding.summary.ner.tfjs": "transformers.js \u2014 mod\xE8le ONNX (t\xE9l\xE9chargement au premier scan)", + "onboarding.nav.cancel": "Annuler", + "onboarding.nav.back": "Retour", + "onboarding.nav.skip": "Passer cette \xE9tape", + "onboarding.nav.next": "Suivant", + "onboarding.nav.start": "Commencer", + "onboarding.nav.finish": "Commencer \xE0 travailler", + "onboarding.summary.title": "Configuration termin\xE9e", + "onboarding.summary.intro": "Voici ce qui a \xE9t\xE9 configur\xE9 :", + "onboarding.summary.ner": "D\xE9tection NER", + "onboarding.summary.dicts": "Dictionnaires", + "onboarding.summary.dicts.count": "{0} fichier(s) dans le vault", + "onboarding.summary.hint": "Ces param\xE8tres sont modifiables \xE0 tout moment via les param\xE8tres du plugin : Reconfigurer.", + "settings.heading.general": "G\xE9n\xE9ral", + "settings.heading.textDetection": "D\xE9tection du texte", + "settings.heading.pseudonymization": "Pseudonymisation", + "settings.heading.ner": "D\xE9tection automatique (NER)", + "settings.heading.storage": "Stockage", + "settings.heading.security": "S\xE9curit\xE9", + "settings.language": "Langue de l'interface", + "settings.languageDesc": "N'affecte pas l'analyse des transcriptions. Les conventions (Jefferson, ICOR) sont ind\xE9pendantes de la langue.", + "settings.vaultPerCorpus": "Un vault par corpus", + "settings.vaultPerCorpusDesc": "Nous recommandons d'utiliser un vault Obsidian d\xE9di\xE9 par corpus. Cela garantit que les fichiers de mapping, les dictionnaires et les exports restent avec leurs transcriptions.", + "settings.transcriptionsFolder": "Transcriptions import\xE9es", + "settings.transcriptionsFolderDesc": "Dossier de destination des transcriptions import\xE9es.", + "settings.mappingFolder": "Tables de correspondance", + "settings.mappingFolderDesc": "Chemin relatif dans le vault.", + "settings.dictionariesFolder": "Dictionnaires", + "settings.dictionariesFolderDesc": "Chemin relatif dans le vault.", + "settings.exportsFolder": "Exports", + "settings.accentSensitive": "Sensible aux accents", + "settings.preserveCase": "Pr\xE9server la casse", + "settings.preserveCaseDesc": "Adapter la casse du remplacement \xE0 celle de la source (ex. : JEAN \u2192 PIERRE, jean \u2192 pierre, Jean \u2192 Pierre).", + "settings.preserveAnalyticNotation": "Pr\xE9server les notations analytiques", + "settings.preserveAnalyticNotationDesc": "Ne jamais remplacer les symboles de convention analytique de type Jefferson ou ICOR.", + "settings.useMarkerInExport": "Ajouter un marqueur autour des pseudonymes dans l'export", + "settings.useMarkerInExportDesc": "Permet d'identifier visuellement les termes pseudonymis\xE9s dans le fichier export\xE9.", + "settings.markerOpen": "Marqueur ouvrant", + "settings.markerOpenDesc": "Exemple : {{ \u27E6 [ \xAB", + "settings.markerClose": "Marqueur fermant", + "settings.markerCloseDesc": "Exemple : }} \u27E7 ] \xBB", + "settings.nerBackend": "Moteur de d\xE9tection", + "settings.nerBackendDesc": "Backend utilis\xE9 pour la d\xE9tection automatique des entit\xE9s nomm\xE9es identifiantes.", + "settings.nerBackend.none": "D\xE9sactiv\xE9 \u2014 r\xE8gles manuelles uniquement", + "settings.nerBackend.tfjs": "transformers.js (mod\xE8le ONNX embarqu\xE9)", + "settings.reconfigure": "Assistant de configuration", + "settings.reconfigureDesc2": "Relancer l'assistant pour reconfigurer la d\xE9tection NER et les dictionnaires.", + "settings.reconfigureBtn2": "Reconfigurer\u2026", + "settings.warnIfSyncedFolder": "Avertir si le dossier est synchronis\xE9", + "settings.warnIfSyncedFolderDesc": "Alerter si les tables de correspondance sont dans un dossier Git, iCloud ou Synology Drive.", + "settings.caseSensitive": "Sensible \xE0 la casse", + "settings.caseSensitiveDesc": 'Si activ\xE9, "Jean" et "jean" sont trait\xE9s comme distincts.', + "settings.wholeWordOnly": "Mots entiers uniquement", + "settings.wholeWordOnlyDesc": "Si activ\xE9, seules les occurrences de mots complets sont remplac\xE9es." + }; + } +}); + +// src/i18n/index.ts +function setLocale(lang) { + _locale = LOCALES[lang] ? lang : FALLBACK; +} +function t(key, ...args) { + const locale = LOCALES[_locale] ?? LOCALES[FALLBACK]; + let s = locale[key] ?? LOCALES[FALLBACK][key] ?? key; + for (let i2 = 0; i2 < args.length; i2++) { + s = s.replace(`{${i2}}`, String(args[i2])); + } + return s; +} +var LOCALES, FALLBACK, _locale, AVAILABLE_LANGUAGES; +var init_i18n = __esm({ + "src/i18n/index.ts"() { + "use strict"; + init_en(); + init_fr(); + LOCALES = { en: en_default, fr: fr_default }; + FALLBACK = "en"; + _locale = FALLBACK; + AVAILABLE_LANGUAGES = { + en: "English", + fr: "Fran\xE7ais" + }; + } +}); + // src/ui/OnboardingModal.ts -var import_obsidian, fs, path, TRANSFORMERS_VERSION, WASM_CDN_BASE, DICT_MANIFEST_URL, WASM_FILES, STEPS, STEP_LABELS, OnboardingModal; +function stepLabels() { + return { + welcome: t("onboarding.step.welcome"), + language: t("onboarding.step.language"), + storage: t("onboarding.step.storage"), + ner: t("onboarding.step.ner"), + dictionaries: t("onboarding.step.dictionaries"), + summary: t("onboarding.step.summary") + }; +} +var import_obsidian, fs, path, TRANSFORMERS_VERSION, WASM_CDN_BASE, DICT_MANIFEST_URL, WASM_FILES, STEPS, OnboardingModal; var init_OnboardingModal = __esm({ "src/ui/OnboardingModal.ts"() { "use strict"; import_obsidian = require("obsidian"); fs = __toESM(require("fs")); path = __toESM(require("path")); + init_i18n(); TRANSFORMERS_VERSION = "2.17.2"; WASM_CDN_BASE = `https://cdn.jsdelivr.net/npm/@xenova/transformers@${TRANSFORMERS_VERSION}/dist`; DICT_MANIFEST_URL = "https://raw.githubusercontent.com/core-hn/pseudobsidian-dictionaries/main/index.json"; @@ -56,13 +691,7 @@ var init_OnboardingModal = __esm({ "ort-wasm-threaded.wasm", "ort-wasm.wasm" ]; - STEPS = ["welcome", "ner", "dictionaries", "summary"]; - STEP_LABELS = { - welcome: "Bienvenue", - ner: "D\xE9tection NER", - dictionaries: "Dictionnaires", - summary: "R\xE9sum\xE9" - }; + STEPS = ["welcome", "language", "storage", "ner", "dictionaries", "summary"]; OnboardingModal = class extends import_obsidian.Modal { // noms des fichiers copiés dans cette session constructor(app, plugin) { @@ -87,6 +716,10 @@ var init_OnboardingModal = __esm({ const body = contentEl.createDiv("pseudobs-onboarding-body"); if (this.currentStep === "welcome") this.renderWelcome(body); + else if (this.currentStep === "language") + this.renderLanguage(body); + else if (this.currentStep === "storage") + this.renderStorage(body); else if (this.currentStep === "ner") this.renderNer(body); else if (this.currentStep === "dictionaries") @@ -104,50 +737,97 @@ var init_OnboardingModal = __esm({ dot2.addClass("pseudobs-onboarding-step-current"); else if (STEPS.indexOf(step) < STEPS.indexOf(this.currentStep)) dot2.addClass("pseudobs-onboarding-step-done"); - dot2.createSpan({ text: STEP_LABELS[step] }); + dot2.createSpan({ text: stepLabels()[step] }); } } // ---- Étape 1 : Bienvenue ---------------------------------------- renderWelcome(el) { - el.createEl("h2", { text: "Pseudonymizer tool" }); - el.createEl("p", { - text: "Ce plugin vous aide \xE0 corriger et pseudonymiser des transcriptions d'entretiens et de corpus interactionnels (formats Jefferson, ICOR, .srt, .cha)." - }); - el.createEl("p", { - text: "L'assistant va vous guider en deux \xE9tapes rapides :" - }); + el.createEl("h2", { text: t("onboarding.welcome.title") }); + el.createEl("p", { text: t("onboarding.welcome.desc") }); + el.createEl("p", { text: t("onboarding.welcome.steps") }); const list = el.createEl("ul"); - list.createEl("li", { text: "Choisir un moteur de d\xE9tection automatique des entit\xE9s nomm\xE9es (optionnel)." }); - list.createEl("li", { text: "Importer des dictionnaires de candidats de remplacement (.dict.json) si vous en avez." }); + list.createEl("li", { text: t("onboarding.welcome.step1") }); + list.createEl("li", { text: t("onboarding.welcome.step2") }); + list.createEl("li", { text: t("onboarding.welcome.step3") }); + el.createEl("p", { text: t("onboarding.welcome.hint"), cls: "pseudobs-onboarding-hint" }); + } + // ---- Étape 2 : Langue ------------------------------------------- + renderLanguage(el) { + el.createEl("h2", { text: "Interface language / Langue de l'interface" }); el.createEl("p", { - text: "Vous pourrez reconfigurer ces options \xE0 tout moment via les param\xE8tres du plugin.", + text: "The interface language does not affect transcript analysis. / La langue de l'interface n'affecte pas l'analyse des transcriptions.", cls: "pseudobs-onboarding-hint" }); + const currentLang = this.plugin.settings.language; + for (const [code, name2] of Object.entries(AVAILABLE_LANGUAGES)) { + const card = el.createDiv("pseudobs-onboarding-ner-card"); + if (currentLang === code) + card.addClass("pseudobs-onboarding-ner-card-selected"); + card.createEl("strong", { text: name2 }); + const btn = card.createEl("button", { + text: currentLang === code ? "Selected" : "Select", + cls: "pseudobs-onboarding-select-btn" + }); + if (currentLang === code) + btn.addClass("pseudobs-onboarding-select-btn-active"); + btn.addEventListener("click", () => { + void (async () => { + this.plugin.settings.language = code; + await this.plugin.saveSettings(); + setLocale(code); + this.scheduleRender(); + })(); + }); + } } - // ---- Étape 2 : NER ---------------------------------------------- + // ---- Étape 3 : Stockage ----------------------------------------- + renderStorage(el) { + el.createEl("h2", { text: t("onboarding.storage.title") }); + const rec = el.createDiv("pseudobs-onboarding-ner-card pseudobs-onboarding-ner-card-selected"); + const recHeader = rec.createDiv("pseudobs-onboarding-ner-card-header"); + recHeader.createEl("strong", { text: t("onboarding.storage.vaultPerCorpus") }); + rec.createEl("p", { text: t("onboarding.storage.vaultPerCorpusDesc") }); + el.createEl("hr"); + el.createEl("p", { text: t("onboarding.storage.hint"), cls: "pseudobs-onboarding-hint" }); + const fields = [ + [t("onboarding.storage.transcriptionsFolder"), "transcriptionsFolder"], + [t("onboarding.storage.mappingFolder"), "mappingFolder"], + [t("onboarding.storage.dictionariesFolder"), "dictionariesFolder"], + [t("onboarding.storage.exportsFolder"), "exportsFolder"] + ]; + for (const [label, key] of fields) { + const row = el.createDiv("pseudobs-onboarding-url-row"); + row.createEl("small", { text: label }); + const input = row.createEl("input"); + input.type = "text"; + input.value = String(this.plugin.settings[key]); + input.addEventListener("change", () => { + void (async () => { + this.plugin.settings[key] = input.value.trim() || String(this.plugin.settings[key]); + await this.plugin.saveSettings(); + })(); + }); + } + } + // ---- Étape 4 : NER ---------------------------------------------- renderNer(el) { - el.createEl("h2", { text: "D\xE9tection automatique des entit\xE9s" }); - el.createEl("p", { - text: "Un mod\xE8le NER (reconnaissance d'entit\xE9s nomm\xE9es) peut d\xE9tecter automatiquement les pr\xE9noms, noms, lieux et institutions dans vos transcriptions \u2014 sans liste exhaustive, directement dans Obsidian." - }); + el.createEl("h2", { text: t("onboarding.step.ner") }); + el.createEl("p", { text: t("onboarding.ner.desc") }); const cardTfjs = el.createDiv("pseudobs-onboarding-ner-card"); if (this.nerBackend === "transformers-js") cardTfjs.addClass("pseudobs-onboarding-ner-card-selected"); const tfjsHeader = cardTfjs.createDiv("pseudobs-onboarding-ner-card-header"); - tfjsHeader.createEl("strong", { text: "transformers.js \u2014 mod\xE8le ONNX embarqu\xE9" }); - tfjsHeader.createEl("span", { text: "Python n'est pas requis", cls: "pseudobs-onboarding-badge" }); - cardTfjs.createEl("p", { - text: "Mod\xE8le NER multilingue ex\xE9cut\xE9 localement dans le vault. Les fichiers .wasm (~19 Mo) sont t\xE9l\xE9charg\xE9s une seule fois ici. Le mod\xE8le (~66 Mo) est t\xE9l\xE9charg\xE9 au premier scan." - }); + tfjsHeader.createEl("strong", { text: t("onboarding.ner.tfjsTitle") }); + tfjsHeader.createEl("span", { text: t("onboarding.ner.tfjsBadge"), cls: "pseudobs-onboarding-badge" }); + cardTfjs.createEl("p", { text: t("onboarding.ner.tfjsDesc") }); const wasmRow = cardTfjs.createDiv("pseudobs-onboarding-url-row"); const wasmStatus = wasmRow.createSpan({ cls: "pseudobs-onboarding-test-status" }); - const wasmAlreadyPresent = this.checkWasmFiles(); - if (wasmAlreadyPresent) { - wasmStatus.setText("Fichiers .wasm d\xE9j\xE0 install\xE9s"); + if (this.checkWasmFiles()) { + wasmStatus.setText(t("onboarding.ner.wasmReady")); wasmStatus.classList.add("pseudobs-onboarding-test-ok"); } const selectTfjs = cardTfjs.createEl("button", { - text: this.nerBackend === "transformers-js" ? "S\xE9lectionn\xE9" : "Installer et utiliser transformers.js", + text: this.nerBackend === "transformers-js" ? t("onboarding.ner.selectedBtn") : t("onboarding.ner.installBtn"), cls: "pseudobs-onboarding-select-btn" }); if (this.nerBackend === "transformers-js") @@ -166,7 +846,7 @@ var init_OnboardingModal = __esm({ }); const noneRow = el.createDiv("pseudobs-onboarding-none-row"); const noneBtn = noneRow.createEl("button", { - text: this.nerBackend === "none" ? "D\xE9sactiv\xE9 (r\xE8gles manuelles uniquement)" : "Passer \u2014 je travaillerai manuellement", + text: this.nerBackend === "none" ? t("onboarding.ner.noneActive") : t("onboarding.ner.noneSkip"), cls: "pseudobs-onboarding-none-btn" }); if (this.nerBackend === "none") @@ -231,21 +911,16 @@ var init_OnboardingModal = __esm({ } // ---- Étape 3 : Dictionnaires ------------------------------------ renderDictionaries(el) { - el.createEl("h2", { text: "Dictionnaires de candidats" }); - el.createEl("p", { - text: "Les dictionnaires proposent des candidats de remplacement (villes, pr\xE9noms\u2026) et alimentent la d\xE9tection. Ils sont h\xE9berg\xE9s dans un d\xE9p\xF4t d\xE9di\xE9 et t\xE9l\xE9charg\xE9s dans votre vault \u2014 aucune donn\xE9e ne quitte Obsidian." - }); + el.createEl("h2", { text: t("onboarding.dict.title") }); + el.createEl("p", { text: t("onboarding.dict.desc") }); const catalogueEl = el.createDiv("pseudobs-onboarding-catalogue"); - catalogueEl.createEl("p", { text: "Chargement du catalogue\u2026", cls: "pseudobs-onboarding-hint" }); + catalogueEl.createEl("p", { text: t("onboarding.dict.catalogueLoading"), cls: "pseudobs-onboarding-hint" }); void this.renderCatalogue(catalogueEl); el.createEl("hr"); const manualRow = el.createDiv("pseudobs-onboarding-import-row"); - manualRow.createEl("small", { - text: "Vous avez d\xE9j\xE0 un fichier .dict.json ? Importez-le manuellement :", - cls: "pseudobs-onboarding-hint" - }); + manualRow.createEl("small", { text: t("onboarding.dict.manualHint"), cls: "pseudobs-onboarding-hint" }); const importBtn = manualRow.createEl("button", { - text: "Importer un fichier local (.dict.json)", + text: t("onboarding.dict.importBtn"), cls: "pseudobs-onboarding-import-btn" }); const importStatus = manualRow.createSpan({ cls: "pseudobs-onboarding-test-status" }); @@ -268,10 +943,7 @@ var init_OnboardingModal = __esm({ manifest = res.json; } catch { container.empty(); - container.createEl("p", { - text: "Impossible de contacter le catalogue en ligne. V\xE9rifiez votre connexion ou importez un fichier local ci-dessous.", - cls: "pseudobs-onboarding-hint" - }); + container.createEl("p", { text: t("onboarding.dict.catalogueError"), cls: "pseudobs-onboarding-hint" }); return; } container.empty(); @@ -279,7 +951,7 @@ var init_OnboardingModal = __esm({ const table = scroll.createEl("table", { cls: "pseudobs-onboarding-dict-table" }); const thead = table.createEl("thead"); const headerRow = thead.createEl("tr"); - ["Dictionnaire", "Langue", "R\xF4les", "Taille", ""].forEach( + [t("onboarding.dict.col.dict"), t("onboarding.dict.col.lang"), t("onboarding.dict.col.roles"), t("onboarding.dict.col.size"), ""].forEach( (h) => headerRow.createEl("th", { text: h }) ); const tbody = table.createEl("tbody"); @@ -295,21 +967,21 @@ var init_OnboardingModal = __esm({ const nameCell = tr.createEl("td", { cls: "pseudobs-onboarding-dict-name-cell" }); nameCell.createEl("span", { text: entry.label }); if (entry.recommended) { - nameCell.createEl("span", { text: "Recommand\xE9", cls: "pseudobs-onboarding-badge" }); + nameCell.createEl("span", { text: t("onboarding.dict.recommended"), cls: "pseudobs-onboarding-badge" }); } tr.createEl("td", { text: entry.language.toUpperCase() }); const roles = []; if (entry.roles.detection) - roles.push("d\xE9tection"); + roles.push(t("onboarding.dict.role.detection")); if (entry.roles.replacement) - roles.push("remplacement"); + roles.push(t("onboarding.dict.role.replacement")); if (entry.roles.classes) - roles.push("classes"); + roles.push(t("onboarding.dict.role.classes")); tr.createEl("td", { text: roles.join(" \xB7 "), cls: "pseudobs-onboarding-dict-roles" }); tr.createEl("td", { text: this.formatSize(entry.size), cls: "pseudobs-onboarding-dict-size" }); const actionCell = tr.createEl("td", { cls: "pseudobs-onboarding-dict-action" }); const btn = actionCell.createEl("button", { cls: "pseudobs-onboarding-icon-btn" }); - btn.setAttribute("aria-label", alreadyInstalled ? "R\xE9installer" : "Installer"); + btn.setAttribute("aria-label", alreadyInstalled ? t("onboarding.dict.reinstall") : t("onboarding.dict.install")); (0, import_obsidian.setIcon)(btn, alreadyInstalled ? "cloud-check" : "cloud-download"); if (alreadyInstalled) btn.addClass("pseudobs-onboarding-icon-btn-done"); @@ -392,16 +1064,16 @@ var init_OnboardingModal = __esm({ ok++; } catch { err++; - new import_obsidian.Notice(`Erreur lors de l'import de ${f.name} \u2014 v\xE9rifiez le format .dict.json`); + new import_obsidian.Notice(t("onboarding.dict.importError", f.name)); } } if (ok > 0) { - statusEl.setText(`${ok} dictionnaire${ok > 1 ? "s" : ""} import\xE9${ok > 1 ? "s" : ""}`); + statusEl.setText(ok > 1 ? t("onboarding.dict.importOkMany", String(ok)) : t("onboarding.dict.importOk", String(ok))); statusEl.addClass("pseudobs-onboarding-test-ok"); void this.plugin.dictionaryLoader.load(); } if (err > 0) { - statusEl.setText(`${err} fichier${err > 1 ? "s" : ""} rejet\xE9${err > 1 ? "s" : ""}`); + statusEl.setText(err > 1 ? t("onboarding.dict.importErrMany", String(err)) : t("onboarding.dict.importErr", String(err))); statusEl.addClass("pseudobs-onboarding-test-err"); } this.scheduleRender(); @@ -419,7 +1091,7 @@ var init_OnboardingModal = __esm({ if (files.length === 0) return; el.createEl("p", { - text: `Dictionnaires install\xE9s dans ce vault (${files.length}) :`, + text: t("onboarding.dict.listTitle", String(files.length)), cls: "pseudobs-onboarding-dict-count" }); const list = el.createEl("ul", { cls: "pseudobs-onboarding-dict-list" }); @@ -427,7 +1099,7 @@ var init_OnboardingModal = __esm({ const li = list.createEl("li"); li.createSpan({ text: f.name }); const removeBtn = li.createEl("button", { text: "\u2715", cls: "pseudobs-onboarding-dict-remove" }); - removeBtn.title = "Retirer ce dictionnaire du vault"; + removeBtn.title = t("onboarding.dict.remove"); removeBtn.addEventListener("click", () => { void (async () => { await this.app.fileManager.trashFile(f); @@ -439,16 +1111,16 @@ var init_OnboardingModal = __esm({ } // ---- Étape 4 : Résumé ------------------------------------------ renderSummary(el) { - el.createEl("h2", { text: "Configuration termin\xE9e" }); + el.createEl("h2", { text: t("onboarding.summary.title") }); const NER_LABELS = { - none: "D\xE9sactiv\xE9 \u2014 r\xE8gles manuelles uniquement", + none: t("onboarding.summary.ner.none"), spacy: `spaCy local (${this.plugin.settings.spacyServerUrl})`, - "transformers-js": "transformers.js \u2014 mod\xE8le ONNX (t\xE9l\xE9chargement au premier scan)" + "transformers-js": t("onboarding.summary.ner.tfjs") }; - el.createEl("p", { text: "Voici ce qui a \xE9t\xE9 configur\xE9 :" }); + el.createEl("p", { text: t("onboarding.summary.intro") }); const table = el.createEl("table", { cls: "pseudobs-onboarding-summary-table" }); const rows = [ - ["D\xE9tection NER", NER_LABELS[this.plugin.settings.nerBackend]] + [t("onboarding.summary.ner"), NER_LABELS[this.plugin.settings.nerBackend]] ]; const folder = this.app.vault.getAbstractFileByPath(this.plugin.settings.dictionariesFolder); let dictCount = 0; @@ -458,38 +1130,35 @@ var init_OnboardingModal = __esm({ dictCount++; } } - rows.push(["Dictionnaires", `${dictCount} fichier${dictCount > 1 ? "s" : ""} dans le vault`]); + rows.push([t("onboarding.summary.dicts"), t("onboarding.summary.dicts.count", String(dictCount))]); for (const [label, value] of rows) { const tr = table.createEl("tr"); tr.createEl("td", { text: label, cls: "pseudobs-onboarding-summary-label" }); tr.createEl("td", { text: value }); } - el.createEl("p", { - text: "Ces param\xE8tres sont modifiables \xE0 tout moment via les param\xE8tres du plugin : Reconfigurer.", - cls: "pseudobs-onboarding-hint" - }); + el.createEl("p", { text: t("onboarding.summary.hint"), cls: "pseudobs-onboarding-hint" }); } // ---- Navigation ------------------------------------------------ renderNav(el) { const nav = el.createDiv("pseudobs-onboarding-nav"); const idx = STEPS.indexOf(this.currentStep); if (this.currentStep !== "summary") { - nav.createEl("button", { text: "Annuler", cls: "pseudobs-onboarding-cancel-btn" }).addEventListener("click", () => this.close()); + nav.createEl("button", { text: t("onboarding.nav.cancel"), cls: "pseudobs-onboarding-cancel-btn" }).addEventListener("click", () => this.close()); } const rightBtns = nav.createDiv("pseudobs-onboarding-nav-right"); if (idx > 0) { - rightBtns.createEl("button", { text: "Retour", cls: "pseudobs-onboarding-back-btn" }).addEventListener("click", () => { + rightBtns.createEl("button", { text: t("onboarding.nav.back"), cls: "pseudobs-onboarding-back-btn" }).addEventListener("click", () => { this.currentStep = STEPS[idx - 1]; this.scheduleRender(); }); } if (this.currentStep === "welcome") { - rightBtns.createEl("button", { text: "Commencer", cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { + rightBtns.createEl("button", { text: t("onboarding.nav.start"), cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); }); } else if (this.currentStep === "summary") { - rightBtns.createEl("button", { text: "Commencer \xE0 travailler", cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { + rightBtns.createEl("button", { text: t("onboarding.nav.finish"), cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { void (async () => { this.plugin.settings.onboardingCompleted = true; await this.plugin.saveSettings(); @@ -497,11 +1166,11 @@ var init_OnboardingModal = __esm({ })(); }); } else { - rightBtns.createEl("button", { text: "Passer cette \xE9tape", cls: "pseudobs-onboarding-skip-btn" }).addEventListener("click", () => { + rightBtns.createEl("button", { text: t("onboarding.nav.skip"), cls: "pseudobs-onboarding-skip-btn" }).addEventListener("click", () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); }); - rightBtns.createEl("button", { text: "Suivant", cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { + rightBtns.createEl("button", { text: t("onboarding.nav.next"), cls: "pseudobs-onboarding-next-btn mod-cta" }).addEventListener("click", () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); }); @@ -526,6 +1195,7 @@ var init_settings = __esm({ "use strict"; import_obsidian2 = require("obsidian"); init_OnboardingModal(); + init_i18n(); DEFAULT_SETTINGS = { transcriptionsFolder: "Transcriptions", mappingFolder: "_pseudonymisation/mappings", @@ -541,6 +1211,7 @@ var init_settings = __esm({ useMarkerInExport: true, markerOpen: "{{", markerClose: "}}", + language: "en", onboardingCompleted: false, nerBackend: "none", spacyServerUrl: "http://localhost:5757", @@ -588,85 +1259,78 @@ var init_settings = __esm({ display() { const { containerEl } = this; containerEl.empty(); - new import_obsidian2.Setting(containerEl).setName("Dossiers").setHeading(); - new import_obsidian2.Setting(containerEl).setName("Transcriptions import\xE9es").setDesc("Dossier de destination des transcriptions import\xE9es").addText( - (text) => text.setValue(this.plugin.settings.transcriptionsFolder).onChange(async (value) => { - this.plugin.settings.transcriptionsFolder = value; + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.general")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.language")).setDesc(t("settings.languageDesc")).addDropdown((d) => { + for (const [code, name2] of Object.entries(AVAILABLE_LANGUAGES)) { + d.addOption(code, name2); + } + d.setValue(this.plugin.settings.language); + d.onChange(async (v) => { + this.plugin.settings.language = v; await this.plugin.saveSettings(); + setLocale(v); + this.display(); + }); + }); + new import_obsidian2.Setting(containerEl).setName(t("settings.reconfigure")).setDesc(t("settings.reconfigureDesc2")).addButton( + (btn) => btn.setButtonText(t("settings.reconfigureBtn2")).onClick(() => { + new OnboardingModal(this.app, this.plugin).open(); }) ); - new import_obsidian2.Setting(containerEl).setName("Tables de correspondance").setDesc("Chemin relatif dans le vault").addText( - (text) => text.setValue(this.plugin.settings.mappingFolder).onChange(async (value) => { - this.plugin.settings.mappingFolder = value; - await this.plugin.saveSettings(); - }) - ); - new import_obsidian2.Setting(containerEl).setName("Dictionnaires").setDesc("Chemin relatif dans le vault").addText( - (text) => text.setValue(this.plugin.settings.dictionariesFolder).onChange(async (value) => { - this.plugin.settings.dictionariesFolder = value; - await this.plugin.saveSettings(); - }) - ); - new import_obsidian2.Setting(containerEl).setName("Exports").addText( - (text) => text.setValue(this.plugin.settings.exportsFolder).onChange(async (value) => { - this.plugin.settings.exportsFolder = value; - await this.plugin.saveSettings(); - }) - ); - new import_obsidian2.Setting(containerEl).setName("Remplacement").setHeading(); - new import_obsidian2.Setting(containerEl).setName("Sensible \xE0 la casse").addToggle( - (toggle) => toggle.setValue(this.plugin.settings.caseSensitive).onChange(async (value) => { - this.plugin.settings.caseSensitive = value; - await this.plugin.saveSettings(); - }) - ); - new import_obsidian2.Setting(containerEl).setName("Sensible aux accents").addToggle( - (toggle) => toggle.setValue(this.plugin.settings.accentSensitive).onChange(async (value) => { - this.plugin.settings.accentSensitive = value; - await this.plugin.saveSettings(); - }) - ); - new import_obsidian2.Setting(containerEl).setName("Mots entiers uniquement").addToggle( + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.textDetection")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.wholeWordOnly")).setDesc(t("settings.wholeWordOnlyDesc")).addToggle( (toggle) => toggle.setValue(this.plugin.settings.wholeWordOnly).onChange(async (value) => { this.plugin.settings.wholeWordOnly = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("Pr\xE9server la casse").setDesc("Adapter la casse du remplacement \xE0 celle de la source (ex. : JEAN \u2192 PIERRE, jean \u2192 pierre, Jean \u2192 Pierre)").addToggle( + new import_obsidian2.Setting(containerEl).setName(t("settings.caseSensitive")).setDesc(t("settings.caseSensitiveDesc")).addToggle( + (toggle) => toggle.setValue(this.plugin.settings.caseSensitive).onChange(async (value) => { + this.plugin.settings.caseSensitive = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName(t("settings.accentSensitive")).addToggle( + (toggle) => toggle.setValue(this.plugin.settings.accentSensitive).onChange(async (value) => { + this.plugin.settings.accentSensitive = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.pseudonymization")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.preserveCase")).setDesc(t("settings.preserveCaseDesc")).addToggle( (toggle) => toggle.setValue(this.plugin.settings.preserveCase).onChange(async (value) => { this.plugin.settings.preserveCase = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("Pr\xE9server les notations analytiques").setDesc("Ne jamais remplacer les symboles de convention analytique de type Jefferson ou ICOR").addToggle( + new import_obsidian2.Setting(containerEl).setName(t("settings.preserveAnalyticNotation")).setDesc(t("settings.preserveAnalyticNotationDesc")).addToggle( (toggle) => toggle.setValue(this.plugin.settings.preserveAnalyticNotation).onChange(async (value) => { this.plugin.settings.preserveAnalyticNotation = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("Marqueur d'export").setHeading(); - new import_obsidian2.Setting(containerEl).setName("Ajouter un marqueur autour des pseudonymes dans l'export").setDesc("Permet d'identifier visuellement les termes pseudonymis\xE9s dans le fichier export\xE9").addToggle( + new import_obsidian2.Setting(containerEl).setName(t("settings.useMarkerInExport")).setDesc(t("settings.useMarkerInExportDesc")).addToggle( (toggle) => toggle.setValue(this.plugin.settings.useMarkerInExport).onChange(async (value) => { this.plugin.settings.useMarkerInExport = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("Marqueur ouvrant").setDesc("Exemple : {{ \u27E6 [ \xAB").addText( + new import_obsidian2.Setting(containerEl).setName(t("settings.markerOpen")).setDesc(t("settings.markerOpenDesc")).addText( (text) => text.setValue(this.plugin.settings.markerOpen).onChange(async (value) => { this.plugin.settings.markerOpen = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("Marqueur fermant").setDesc("Exemple : }} \u27E7 ] \xBB").addText( + new import_obsidian2.Setting(containerEl).setName(t("settings.markerClose")).setDesc(t("settings.markerCloseDesc")).addText( (text) => text.setValue(this.plugin.settings.markerClose).onChange(async (value) => { this.plugin.settings.markerClose = value; await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("D\xE9tection automatique (NER)").setHeading(); - new import_obsidian2.Setting(containerEl).setName("Moteur de d\xE9tection").setDesc("Backend utilis\xE9 pour la d\xE9tection automatique des entit\xE9s nomm\xE9es identifiantes").addDropdown((d) => { - d.addOption("none", "D\xE9sactiv\xE9 \u2014 r\xE8gles manuelles uniquement"); - d.addOption("transformers-js", "transformers.js (mod\xE8le ONNX embarqu\xE9)"); + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.ner")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.nerBackend")).setDesc(t("settings.nerBackendDesc")).addDropdown((d) => { + d.addOption("none", t("settings.nerBackend.none")); + d.addOption("transformers-js", t("settings.nerBackend.tfjs")); d.setValue(this.plugin.settings.nerBackend); d.onChange(async (v) => { this.plugin.settings.nerBackend = v; @@ -674,13 +1338,34 @@ var init_settings = __esm({ this.display(); }); }); - new import_obsidian2.Setting(containerEl).setName("Assistant de configuration").setDesc("Relancer l'assistant pour reconfigurer la d\xE9tection NER et les dictionnaires").addButton( - (btn) => btn.setButtonText("Reconfigurer\u2026").onClick(() => { - new OnboardingModal(this.app, this.plugin).open(); + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.storage")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.transcriptionsFolder")).setDesc(t("settings.transcriptionsFolderDesc")).addText( + (text) => text.setValue(this.plugin.settings.transcriptionsFolder).onChange(async (value) => { + this.plugin.settings.transcriptionsFolder = value; + await this.plugin.saveSettings(); }) ); - new import_obsidian2.Setting(containerEl).setName("S\xE9curit\xE9").setHeading(); - new import_obsidian2.Setting(containerEl).setName("Avertir si le dossier est synchronis\xE9").setDesc("Alerter si les tables de correspondance sont dans un dossier Git, iCloud ou Synology Drive").addToggle( + new import_obsidian2.Setting(containerEl).setName(t("settings.mappingFolder")).setDesc(t("settings.mappingFolderDesc")).addText( + (text) => text.setValue(this.plugin.settings.mappingFolder).onChange(async (value) => { + this.plugin.settings.mappingFolder = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName(t("settings.dictionariesFolder")).setDesc(t("settings.dictionariesFolderDesc")).addText( + (text) => text.setValue(this.plugin.settings.dictionariesFolder).onChange(async (value) => { + this.plugin.settings.dictionariesFolder = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName(t("settings.exportsFolder")).addText( + (text) => text.setValue(this.plugin.settings.exportsFolder).onChange(async (value) => { + this.plugin.settings.exportsFolder = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName(t("settings.heading.security")).setHeading(); + new import_obsidian2.Setting(containerEl).setName(t("settings.vaultPerCorpus")).setDesc(t("settings.vaultPerCorpusDesc")); + new import_obsidian2.Setting(containerEl).setName(t("settings.warnIfSyncedFolder")).setDesc(t("settings.warnIfSyncedFolderDesc")).addToggle( (toggle) => toggle.setValue(this.plugin.settings.warnIfSyncedFolder).onChange(async (value) => { this.plugin.settings.warnIfSyncedFolder = value; await this.plugin.saveSettings(); @@ -773,32 +1458,32 @@ var require_ort_common_node = __commonJS({ "node_modules/onnxruntime-common/dist/ort-common.node.js"(exports2) { (() => { "use strict"; - var e = { d: (t2, r2) => { + var e = { d: (t3, r2) => { for (var n2 in r2) - e.o(r2, n2) && !e.o(t2, n2) && Object.defineProperty(t2, n2, { enumerable: true, get: r2[n2] }); - }, o: (e2, t2) => Object.prototype.hasOwnProperty.call(e2, t2), r: (e2) => { + e.o(r2, n2) && !e.o(t3, n2) && Object.defineProperty(t3, n2, { enumerable: true, get: r2[n2] }); + }, o: (e2, t3) => Object.prototype.hasOwnProperty.call(e2, t3), r: (e2) => { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true }); - } }, t = {}; - e.r(t), e.d(t, { InferenceSession: () => c, Tensor: () => g, env: () => i2, registerBackend: () => o }); - const r = {}, n = [], o = (e2, t2, o2) => { - if (!t2 || "function" != typeof t2.init || "function" != typeof t2.createSessionHandler) + } }, t2 = {}; + e.r(t2), e.d(t2, { InferenceSession: () => c, Tensor: () => g, env: () => i2, registerBackend: () => o }); + const r = {}, n = [], o = (e2, t3, o2) => { + if (!t3 || "function" != typeof t3.init || "function" != typeof t3.createSessionHandler) throw new TypeError("not a valid backend"); { const i3 = r[e2]; if (void 0 === i3) - r[e2] = { backend: t2, priority: o2 }; + r[e2] = { backend: t3, priority: o2 }; else { if (i3.priority > o2) return; - if (i3.priority === o2 && i3.backend !== t2) + if (i3.priority === o2 && i3.backend !== t3) throw new Error(`cannot register backend "${e2}" using priority ${o2}`); } if (o2 >= 0) { - const t3 = n.indexOf(e2); - -1 !== t3 && n.splice(t3, 1); - for (let t4 = 0; t4 < n.length; t4++) - if (r[n[t4]].priority <= o2) - return void n.splice(t4, 0, e2); + const t4 = n.indexOf(e2); + -1 !== t4 && n.splice(t4, 1); + for (let t5 = 0; t5 < n.length; t5++) + if (r[n[t5]].priority <= o2) + return void n.splice(t5, 0, e2); n.push(e2); } } @@ -819,78 +1504,78 @@ var require_ort_common_node = __commonJS({ }(), a = "undefined" != typeof BigInt64Array && "function" == typeof BigInt64Array.from, s = "undefined" != typeof BigUint64Array && "function" == typeof BigUint64Array.from, d = /* @__PURE__ */ new Map([["float32", Float32Array], ["uint8", Uint8Array], ["int8", Int8Array], ["uint16", Uint16Array], ["int16", Int16Array], ["int32", Int32Array], ["bool", Uint8Array], ["float64", Float64Array], ["uint32", Uint32Array]]), f = /* @__PURE__ */ new Map([[Float32Array, "float32"], [Uint8Array, "uint8"], [Int8Array, "int8"], [Uint16Array, "uint16"], [Int16Array, "int16"], [Int32Array, "int32"], [Float64Array, "float64"], [Uint32Array, "uint32"]]); a && (d.set("int64", BigInt64Array), f.set(BigInt64Array, "int64")), s && (d.set("uint64", BigUint64Array), f.set(BigUint64Array, "uint64")); class h { - constructor(e2, t2, r2) { + constructor(e2, t3, r2) { let n2, o2, i3; if ("string" == typeof e2) if (n2 = e2, i3 = r2, "string" === e2) { - if (!Array.isArray(t2)) + if (!Array.isArray(t3)) throw new TypeError("A string tensor's data must be a string array."); - o2 = t2; + o2 = t3; } else { const r3 = d.get(e2); if (void 0 === r3) throw new TypeError(`Unsupported tensor type: ${e2}.`); - if (Array.isArray(t2)) - o2 = r3.from(t2); + if (Array.isArray(t3)) + o2 = r3.from(t3); else { - if (!(t2 instanceof r3)) + if (!(t3 instanceof r3)) throw new TypeError(`A ${n2} tensor's data must be type of ${r3}`); - o2 = t2; + o2 = t3; } } - else if (i3 = t2, Array.isArray(e2)) { + else if (i3 = t3, Array.isArray(e2)) { if (0 === e2.length) throw new TypeError("Tensor type cannot be inferred from an empty array."); - const t3 = typeof e2[0]; - if ("string" === t3) + const t4 = typeof e2[0]; + if ("string" === t4) n2 = "string", o2 = e2; else { - if ("boolean" !== t3) - throw new TypeError(`Invalid element type of data array: ${t3}.`); + if ("boolean" !== t4) + throw new TypeError(`Invalid element type of data array: ${t4}.`); n2 = "bool", o2 = Uint8Array.from(e2); } } else { - const t3 = f.get(e2.constructor); - if (void 0 === t3) + const t4 = f.get(e2.constructor); + if (void 0 === t4) throw new TypeError(`Unsupported type for tensor data: ${e2.constructor}.`); - n2 = t3, o2 = e2; + n2 = t4, o2 = e2; } if (void 0 === i3) i3 = [o2.length]; else if (!Array.isArray(i3)) throw new TypeError("A tensor's dims must be a number array"); const a2 = ((e3) => { - let t3 = 1; + let t4 = 1; for (let r3 = 0; r3 < e3.length; r3++) { const n3 = e3[r3]; if ("number" != typeof n3 || !Number.isSafeInteger(n3)) throw new TypeError(`dims[${r3}] must be an integer, got: ${n3}`); if (n3 < 0) throw new RangeError(`dims[${r3}] must be a non-negative integer, got: ${n3}`); - t3 *= n3; + t4 *= n3; } - return t3; + return t4; })(i3); if (a2 !== o2.length) throw new Error(`Tensor's size(${a2}) does not match data length(${o2.length}).`); this.dims = i3, this.type = n2, this.data = o2, this.size = a2; } - static bufferToTensor(e2, t2) { + static bufferToTensor(e2, t3) { if (void 0 === e2) throw new Error("Image buffer must be defined"); - if (void 0 === t2.height || void 0 === t2.width) + if (void 0 === t3.height || void 0 === t3.width) throw new Error("Image height and width must be defined"); - const { height: r2, width: n2 } = t2, o2 = t2.norm; + const { height: r2, width: n2 } = t3, o2 = t3.norm; let i3, a2; i3 = void 0 === o2 || void 0 === o2.mean ? 255 : o2.mean, a2 = void 0 === o2 || void 0 === o2.bias ? 0 : o2.bias; - const s2 = void 0 !== t2.bitmapFormat ? t2.bitmapFormat : "RGBA", d2 = void 0 !== t2.tensorFormat && void 0 !== t2.tensorFormat ? t2.tensorFormat : "RGB", f2 = r2 * n2, g2 = "RGBA" === d2 ? new Float32Array(4 * f2) : new Float32Array(3 * f2); + const s2 = void 0 !== t3.bitmapFormat ? t3.bitmapFormat : "RGBA", d2 = void 0 !== t3.tensorFormat && void 0 !== t3.tensorFormat ? t3.tensorFormat : "RGB", f2 = r2 * n2, g2 = "RGBA" === d2 ? new Float32Array(4 * f2) : new Float32Array(3 * f2); let m2 = 4, c2 = 0, l2 = 1, w2 = 2, u = 3, p = 0, y = f2, b = 2 * f2, v = -1; "RGB" === s2 && (m2 = 3, c2 = 0, l2 = 1, w2 = 2, u = -1), "RGBA" === d2 ? v = 3 * f2 : "RBG" === d2 ? (p = 0, b = f2, y = 2 * f2) : "BGR" === d2 && (b = 0, y = f2, p = 2 * f2); - for (let t3 = 0; t3 < f2; t3++, c2 += m2, w2 += m2, l2 += m2, u += m2) + for (let t4 = 0; t4 < f2; t4++, c2 += m2, w2 += m2, l2 += m2, u += m2) g2[p++] = (e2[c2] + a2) / i3, g2[y++] = (e2[l2] + a2) / i3, g2[b++] = (e2[w2] + a2) / i3, -1 !== v && -1 !== u && (g2[v++] = (e2[u] + a2) / i3); return new h("float32", g2, "RGBA" === d2 ? [1, 4, r2, n2] : [1, 3, r2, n2]); } - static async fromImage(e2, t2) { + static async fromImage(e2, t3) { const r2 = "undefined" != typeof HTMLImageElement && e2 instanceof HTMLImageElement, n2 = "undefined" != typeof ImageData && e2 instanceof ImageData, o2 = "undefined" != typeof ImageBitmap && e2 instanceof ImageBitmap, i3 = "undefined" != typeof String && (e2 instanceof String || "string" == typeof e2); let a2, s2 = {}; if (r2) { @@ -899,12 +1584,12 @@ var require_ort_common_node = __commonJS({ throw new Error("Can not access image data"); { let o3 = e2.naturalHeight, i4 = e2.naturalWidth; - if (void 0 !== t2 && void 0 !== t2.resizedHeight && void 0 !== t2.resizedWidth && (o3 = t2.resizedHeight, i4 = t2.resizedWidth), void 0 !== t2) { - if (s2 = t2, void 0 !== t2.tensorFormat) + if (void 0 !== t3 && void 0 !== t3.resizedHeight && void 0 !== t3.resizedWidth && (o3 = t3.resizedHeight, i4 = t3.resizedWidth), void 0 !== t3) { + if (s2 = t3, void 0 !== t3.tensorFormat) throw new Error("Image input config format must be RGBA for HTMLImageElement"); - if (s2.tensorFormat = "RGBA", void 0 !== t2.height && t2.height !== o3) + if (s2.tensorFormat = "RGBA", void 0 !== t3.height && t3.height !== o3) throw new Error("Image input config height doesn't match HTMLImageElement height"); - if (s2.height = o3, void 0 !== t2.width && t2.width !== i4) + if (s2.height = o3, void 0 !== t3.width && t3.width !== i4) throw new Error("Image input config width doesn't match HTMLImageElement width"); s2.width = i4; } else @@ -914,17 +1599,17 @@ var require_ort_common_node = __commonJS({ } else { if (!n2) { if (o2) { - if (void 0 === t2) + if (void 0 === t3) throw new Error("Please provide image config with format for Imagebitmap"); - if (void 0 !== t2.bitmapFormat) + if (void 0 !== t3.bitmapFormat) throw new Error("Image input config format must be defined for ImageBitmap"); const r3 = document.createElement("canvas").getContext("2d"); if (null != r3) { const n3 = e2.height, o3 = e2.width; - if (r3.drawImage(e2, 0, 0, o3, n3), a2 = r3.getImageData(0, 0, o3, n3).data, void 0 !== t2) { - if (void 0 !== t2.height && t2.height !== n3) + if (r3.drawImage(e2, 0, 0, o3, n3), a2 = r3.getImageData(0, 0, o3, n3).data, void 0 !== t3) { + if (void 0 !== t3.height && t3.height !== n3) throw new Error("Image input config height doesn't match ImageBitmap height"); - if (s2.height = n3, void 0 !== t2.width && t2.width !== o3) + if (s2.height = n3, void 0 !== t3.width && t3.width !== o3) throw new Error("Image input config width doesn't match ImageBitmap width"); s2.width = o3; } else @@ -942,10 +1627,10 @@ var require_ort_common_node = __commonJS({ a3.crossOrigin = "Anonymous", a3.src = e2, a3.onload = () => { o3.width = a3.width, o3.height = a3.height, i4.drawImage(a3, 0, 0, o3.width, o3.height); const e3 = i4.getImageData(0, 0, o3.width, o3.height); - if (void 0 !== t2) { - if (void 0 !== t2.height && t2.height !== o3.height) + if (void 0 !== t3) { + if (void 0 !== t3.height && t3.height !== o3.height) throw new Error("Image input config height doesn't match ImageBitmap height"); - if (s2.height = o3.height, void 0 !== t2.width && t2.width !== o3.width) + if (s2.height = o3.height, void 0 !== t3.width && t3.width !== o3.width) throw new Error("Image input config width doesn't match ImageBitmap width"); s2.width = o3.width; } else @@ -958,16 +1643,16 @@ var require_ort_common_node = __commonJS({ { const r3 = "RGBA"; let n3, o3; - if (void 0 !== t2 && void 0 !== t2.resizedWidth && void 0 !== t2.resizedHeight ? (n3 = t2.resizedHeight, o3 = t2.resizedWidth) : (n3 = e2.height, o3 = e2.width), void 0 !== t2) { - if (s2 = t2, void 0 !== t2.bitmapFormat && t2.bitmapFormat !== r3) + if (void 0 !== t3 && void 0 !== t3.resizedWidth && void 0 !== t3.resizedHeight ? (n3 = t3.resizedHeight, o3 = t3.resizedWidth) : (n3 = e2.height, o3 = e2.width), void 0 !== t3) { + if (s2 = t3, void 0 !== t3.bitmapFormat && t3.bitmapFormat !== r3) throw new Error("Image input config format must be RGBA for ImageData"); s2.bitmapFormat = "RGBA"; } else s2.bitmapFormat = "RGBA"; - if (s2.height = n3, s2.width = o3, void 0 !== t2) { - const t3 = document.createElement("canvas"); - t3.width = o3, t3.height = n3; - const r4 = t3.getContext("2d"); + if (s2.height = n3, s2.width = o3, void 0 !== t3) { + const t4 = document.createElement("canvas"); + t4.width = o3, t4.height = n3; + const r4 = t4.getContext("2d"); if (null == r4) throw new Error("Can not access image data"); r4.putImageData(e2, 0, 0), a2 = r4.getImageData(0, 0, o3, n3).data; @@ -980,13 +1665,13 @@ var require_ort_common_node = __commonJS({ throw new Error("Input data provided is not supported - aborted tensor creation"); } toImageData(e2) { - var t2, r2; + var t3, r2; const n2 = document.createElement("canvas").getContext("2d"); let o2; if (null == n2) throw new Error("Can not access image data"); { - const i3 = this.dims[3], a2 = this.dims[2], s2 = this.dims[1], d2 = void 0 !== e2 && void 0 !== e2.format ? e2.format : "RGB", f2 = void 0 !== e2 && void 0 !== (null === (t2 = e2.norm) || void 0 === t2 ? void 0 : t2.mean) ? e2.norm.mean : 255, h2 = void 0 !== e2 && void 0 !== (null === (r2 = e2.norm) || void 0 === r2 ? void 0 : r2.bias) ? e2.norm.bias : 0, g2 = a2 * i3; + const i3 = this.dims[3], a2 = this.dims[2], s2 = this.dims[1], d2 = void 0 !== e2 && void 0 !== e2.format ? e2.format : "RGB", f2 = void 0 !== e2 && void 0 !== (null === (t3 = e2.norm) || void 0 === t3 ? void 0 : t3.mean) ? e2.norm.mean : 255, h2 = void 0 !== e2 && void 0 !== (null === (r2 = e2.norm) || void 0 === r2 ? void 0 : r2.bias) ? e2.norm.bias : 0, g2 = a2 * i3; if (void 0 !== e2) { if (void 0 !== e2.height && e2.height !== a2) throw new Error("Image output config height doesn't match tensor height"); @@ -1012,22 +1697,22 @@ var require_ort_common_node = __commonJS({ constructor(e2) { this.handler = e2; } - async run(e2, t2, r2) { + async run(e2, t3, r2) { const n2 = {}; let o2 = {}; if ("object" != typeof e2 || null === e2 || e2 instanceof g || Array.isArray(e2)) throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values."); let i3 = true; - if ("object" == typeof t2) { - if (null === t2) + if ("object" == typeof t3) { + if (null === t3) throw new TypeError("Unexpected argument[1]: cannot be null."); - if (t2 instanceof g) + if (t3 instanceof g) throw new TypeError("'fetches' cannot be a Tensor"); - if (Array.isArray(t2)) { - if (0 === t2.length) + if (Array.isArray(t3)) { + if (0 === t3.length) throw new TypeError("'fetches' cannot be an empty array."); i3 = false; - for (const e3 of t2) { + for (const e3 of t3) { if ("string" != typeof e3) throw new TypeError("'fetches' must be a string array or an object."); if (-1 === this.outputNames.indexOf(e3)) @@ -1040,10 +1725,10 @@ var require_ort_common_node = __commonJS({ throw new TypeError("'options' must be an object."); } else { let e3 = false; - const a3 = Object.getOwnPropertyNames(t2); + const a3 = Object.getOwnPropertyNames(t3); for (const r3 of this.outputNames) if (-1 !== a3.indexOf(r3)) { - const o3 = t2[r3]; + const o3 = t3[r3]; (null === o3 || o3 instanceof g) && (e3 = true, i3 = false, n2[r3] = o3); } if (e3) { @@ -1052,13 +1737,13 @@ var require_ort_common_node = __commonJS({ else if (void 0 !== r2) throw new TypeError("'options' must be an object."); } else - o2 = t2; + o2 = t3; } - } else if (void 0 !== t2) + } else if (void 0 !== t3) throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'."); - for (const t3 of this.inputNames) - if (void 0 === e2[t3]) - throw new Error(`input '${t3}' is missing in 'feeds'.`); + for (const t4 of this.inputNames) + if (void 0 === e2[t4]) + throw new Error(`input '${t4}' is missing in 'feeds'.`); if (i3) for (const e3 of this.outputNames) n2[e3] = null; @@ -1067,17 +1752,17 @@ var require_ort_common_node = __commonJS({ Object.hasOwnProperty.call(a2, e3) && (s2[e3] = new g(a2[e3].type, a2[e3].data, a2[e3].dims)); return s2; } - static async create(e2, t2, o2, i3) { + static async create(e2, t3, o2, i3) { let a2, s2 = {}; if ("string" == typeof e2) { - if (a2 = e2, "object" == typeof t2 && null !== t2) - s2 = t2; - else if (void 0 !== t2) + if (a2 = e2, "object" == typeof t3 && null !== t3) + s2 = t3; + else if (void 0 !== t3) throw new TypeError("'options' must be an object."); } else if (e2 instanceof Uint8Array) { - if (a2 = e2, "object" == typeof t2 && null !== t2) - s2 = t2; - else if (void 0 !== t2) + if (a2 = e2, "object" == typeof t3 && null !== t3) + s2 = t3; + else if (void 0 !== t3) throw new TypeError("'options' must be an object."); } else { if (!(e2 instanceof ArrayBuffer || "undefined" != typeof SharedArrayBuffer && e2 instanceof SharedArrayBuffer)) @@ -1085,10 +1770,10 @@ var require_ort_common_node = __commonJS({ { const r2 = e2; let n2 = 0, d3 = e2.byteLength; - if ("object" == typeof t2 && null !== t2) - s2 = t2; - else if ("number" == typeof t2) { - if (n2 = t2, !Number.isSafeInteger(n2)) + if ("object" == typeof t3 && null !== t3) + s2 = t3; + else if ("number" == typeof t3) { + if (n2 = t3, !Number.isSafeInteger(n2)) throw new RangeError("'byteOffset' must be an integer."); if (n2 < 0 || n2 >= r2.byteLength) throw new RangeError(`'byteOffset' is out of range [0, ${r2.byteLength}).`); @@ -1103,27 +1788,27 @@ var require_ort_common_node = __commonJS({ throw new TypeError("'options' must be an object."); } else if (void 0 !== o2) throw new TypeError("'byteLength' must be a number."); - } else if (void 0 !== t2) + } else if (void 0 !== t3) throw new TypeError("'options' must be an object."); a2 = new Uint8Array(r2, n2, d3); } } const d2 = (s2.executionProviders || []).map((e3) => "string" == typeof e3 ? e3 : e3.name), f2 = await (async (e3) => { - const t3 = 0 === e3.length ? n : e3, o3 = []; - for (const e4 of t3) { - const t4 = r[e4]; - if (t4) { - if (t4.initialized) - return t4.backend; - if (t4.aborted) + const t4 = 0 === e3.length ? n : e3, o3 = []; + for (const e4 of t4) { + const t5 = r[e4]; + if (t5) { + if (t5.initialized) + return t5.backend; + if (t5.aborted) continue; - const r2 = !!t4.initPromise; + const r2 = !!t5.initPromise; try { - return r2 || (t4.initPromise = t4.backend.init()), await t4.initPromise, t4.initialized = true, t4.backend; + return r2 || (t5.initPromise = t5.backend.init()), await t5.initPromise, t5.initialized = true, t5.backend; } catch (n2) { - r2 || o3.push({ name: e4, err: n2 }), t4.aborted = true; + r2 || o3.push({ name: e4, err: n2 }), t5.aborted = true; } finally { - delete t4.initPromise; + delete t5.initPromise; } } } @@ -1146,9 +1831,9 @@ var require_ort_common_node = __commonJS({ } const c = m; var l = exports2; - for (var w in t) - l[w] = t[w]; - t.__esModule && Object.defineProperty(l, "__esModule", { value: true }); + for (var w in t2) + l[w] = t2[w]; + t2.__esModule && Object.defineProperty(l, "__esModule", { value: true }); })(); } }); @@ -1157,8 +1842,8 @@ var require_ort_common_node = __commonJS({ var require_ort_web_node = __commonJS({ "node_modules/onnxruntime-web/dist/ort-web.node.js"(exports, module) { (() => { - var __webpack_modules__ = { 3474: (t, e, n) => { - var _scriptDir, r = (_scriptDir = (_scriptDir = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || __filename, function(t2) { + var __webpack_modules__ = { 3474: (t2, e, n) => { + var _scriptDir, r = (_scriptDir = (_scriptDir = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || __filename, function(t3) { function e2() { return $.buffer != C && H($.buffer), F; } @@ -1175,96 +1860,96 @@ var require_ort_web_node = __commonJS({ return $.buffer != C && H($.buffer), M; } var s, u, c; - t2 = t2 || {}, s || (s = void 0 !== t2 ? t2 : {}), s.ready = new Promise(function(t3, e3) { - u = t3, c = e3; + t3 = t3 || {}, s || (s = void 0 !== t3 ? t3 : {}), s.ready = new Promise(function(t4, e3) { + u = t4, c = e3; }); - var l, p, f, d, h, g, b = Object.assign({}, s), m = "./this.program", y = (t3, e3) => { + var l, p, f, d, h, g, b = Object.assign({}, s), m = "./this.program", y = (t4, e3) => { throw e3; }, _ = "object" == typeof window, v = "function" == typeof importScripts, w = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, x = s.ENVIRONMENT_IS_PTHREAD || false, T = ""; - function S(t3) { - return s.locateFile ? s.locateFile(t3, T) : T + t3; + function S(t4) { + return s.locateFile ? s.locateFile(t4, T) : T + t4; } if (w) { let e3; T = v ? n(1423).dirname(T) + "/" : __dirname + "/", g = () => { h || (d = n(6231), h = n(1423)); - }, l = function(t3, e4) { - return g(), t3 = h.normalize(t3), d.readFileSync(t3, e4 ? void 0 : "utf8"); - }, f = (t3) => ((t3 = l(t3, true)).buffer || (t3 = new Uint8Array(t3)), t3), p = (t3, e4, n2) => { - g(), t3 = h.normalize(t3), d.readFile(t3, function(t4, r3) { - t4 ? n2(t4) : e4(r3.buffer); + }, l = function(t4, e4) { + return g(), t4 = h.normalize(t4), d.readFileSync(t4, e4 ? void 0 : "utf8"); + }, f = (t4) => ((t4 = l(t4, true)).buffer || (t4 = new Uint8Array(t4)), t4), p = (t4, e4, n2) => { + g(), t4 = h.normalize(t4), d.readFile(t4, function(t5, r3) { + t5 ? n2(t5) : e4(r3.buffer); }); - }, 1 < process.argv.length && (m = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), process.on("uncaughtException", function(t3) { - if (!(t3 instanceof ut)) - throw t3; - }), process.on("unhandledRejection", function(t3) { - throw t3; - }), y = (t3, e4) => { + }, 1 < process.argv.length && (m = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), process.on("uncaughtException", function(t4) { + if (!(t4 instanceof ut)) + throw t4; + }), process.on("unhandledRejection", function(t4) { + throw t4; + }), y = (t4, e4) => { if (J()) - throw process.exitCode = t3, e4; - e4 instanceof ut || P("exiting due to exception: " + e4), process.exit(t3); + throw process.exitCode = t4, e4; + e4 instanceof ut || P("exiting due to exception: " + e4), process.exit(t4); }, s.inspect = function() { return "[Emscripten Module object]"; }; try { e3 = n(4564); - } catch (t3) { - throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), t3; + } catch (t4) { + throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), t4; } global.Worker = e3.Worker; } else - (_ || v) && (v ? T = self.location.href : "undefined" != typeof document && document.currentScript && (T = document.currentScript.src), _scriptDir && (T = _scriptDir), T = 0 !== T.indexOf("blob:") ? T.substr(0, T.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", w || (l = (t3) => { + (_ || v) && (v ? T = self.location.href : "undefined" != typeof document && document.currentScript && (T = document.currentScript.src), _scriptDir && (T = _scriptDir), T = 0 !== T.indexOf("blob:") ? T.substr(0, T.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", w || (l = (t4) => { var e3 = new XMLHttpRequest(); - return e3.open("GET", t3, false), e3.send(null), e3.responseText; - }, v && (f = (t3) => { + return e3.open("GET", t4, false), e3.send(null), e3.responseText; + }, v && (f = (t4) => { var e3 = new XMLHttpRequest(); - return e3.open("GET", t3, false), e3.responseType = "arraybuffer", e3.send(null), new Uint8Array(e3.response); - }), p = (t3, e3, n2) => { + return e3.open("GET", t4, false), e3.responseType = "arraybuffer", e3.send(null), new Uint8Array(e3.response); + }), p = (t4, e3, n2) => { var r3 = new XMLHttpRequest(); - r3.open("GET", t3, true), r3.responseType = "arraybuffer", r3.onload = () => { + r3.open("GET", t4, true), r3.responseType = "arraybuffer", r3.onload = () => { 200 == r3.status || 0 == r3.status && r3.response ? e3(r3.response) : n2(); }, r3.onerror = n2, r3.send(null); })); w && "undefined" == typeof performance && (global.performance = n(498).performance); var O = console.log.bind(console), A = console.warn.bind(console); - w && (g(), O = (t3) => d.writeSync(1, t3 + "\n"), A = (t3) => d.writeSync(2, t3 + "\n")); + w && (g(), O = (t4) => d.writeSync(1, t4 + "\n"), A = (t4) => d.writeSync(2, t4 + "\n")); var E, I = s.print || O, P = s.printErr || A; Object.assign(s, b), b = null, s.thisProgram && (m = s.thisProgram), s.quit && (y = s.quit), s.wasmBinary && (E = s.wasmBinary); var D = s.noExitRuntime || false; "object" != typeof WebAssembly && it("no native wasm support detected"); var $, k, C, F, N, R, L, M, j = false, U = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; - function V(t3, e3, n2) { + function V(t4, e3, n2) { var r3 = (e3 >>>= 0) + n2; - for (n2 = e3; t3[n2] && !(n2 >= r3); ) + for (n2 = e3; t4[n2] && !(n2 >= r3); ) ++n2; - if (16 < n2 - e3 && t3.buffer && U) - return U.decode(t3.buffer instanceof SharedArrayBuffer ? t3.slice(e3, n2) : t3.subarray(e3, n2)); + if (16 < n2 - e3 && t4.buffer && U) + return U.decode(t4.buffer instanceof SharedArrayBuffer ? t4.slice(e3, n2) : t4.subarray(e3, n2)); for (r3 = ""; e3 < n2; ) { - var i3 = t3[e3++]; + var i3 = t4[e3++]; if (128 & i3) { - var o2 = 63 & t3[e3++]; + var o2 = 63 & t4[e3++]; if (192 == (224 & i3)) r3 += String.fromCharCode((31 & i3) << 6 | o2); else { - var a2 = 63 & t3[e3++]; - 65536 > (i3 = 224 == (240 & i3) ? (15 & i3) << 12 | o2 << 6 | a2 : (7 & i3) << 18 | o2 << 12 | a2 << 6 | 63 & t3[e3++]) ? r3 += String.fromCharCode(i3) : (i3 -= 65536, r3 += String.fromCharCode(55296 | i3 >> 10, 56320 | 1023 & i3)); + var a2 = 63 & t4[e3++]; + 65536 > (i3 = 224 == (240 & i3) ? (15 & i3) << 12 | o2 << 6 | a2 : (7 & i3) << 18 | o2 << 12 | a2 << 6 | 63 & t4[e3++]) ? r3 += String.fromCharCode(i3) : (i3 -= 65536, r3 += String.fromCharCode(55296 | i3 >> 10, 56320 | 1023 & i3)); } } else r3 += String.fromCharCode(i3); } return r3; } - function B(t3, e3) { - return (t3 >>>= 0) ? V(r2(), t3, e3) : ""; + function B(t4, e3) { + return (t4 >>>= 0) ? V(r2(), t4, e3) : ""; } - function z(t3, e3, n2, r3) { + function z(t4, e3, n2, r3) { if (!(0 < r3)) return 0; var i3 = n2 >>>= 0; r3 = n2 + r3 - 1; - for (var o2 = 0; o2 < t3.length; ++o2) { - var a2 = t3.charCodeAt(o2); - if (55296 <= a2 && 57343 >= a2 && (a2 = 65536 + ((1023 & a2) << 10) | 1023 & t3.charCodeAt(++o2)), 127 >= a2) { + for (var o2 = 0; o2 < t4.length; ++o2) { + var a2 = t4.charCodeAt(o2); + if (55296 <= a2 && 57343 >= a2 && (a2 = 65536 + ((1023 & a2) << 10) | 1023 & t4.charCodeAt(++o2)), 127 >= a2) { if (n2 >= r3) break; e3[n2++ >>> 0] = a2; @@ -1290,15 +1975,15 @@ var require_ort_web_node = __commonJS({ } return e3[n2 >>> 0] = 0, n2 - i3; } - function G(t3) { - for (var e3 = 0, n2 = 0; n2 < t3.length; ++n2) { - var r3 = t3.charCodeAt(n2); + function G(t4) { + for (var e3 = 0, n2 = 0; n2 < t4.length; ++n2) { + var r3 = t4.charCodeAt(n2); 127 >= r3 ? e3++ : 2047 >= r3 ? e3 += 2 : 55296 <= r3 && 57343 >= r3 ? (e3 += 4, ++n2) : e3 += 3; } return e3; } - function H(t3) { - C = t3, s.HEAP8 = F = new Int8Array(t3), s.HEAP16 = new Int16Array(t3), s.HEAP32 = R = new Int32Array(t3), s.HEAPU8 = N = new Uint8Array(t3), s.HEAPU16 = new Uint16Array(t3), s.HEAPU32 = L = new Uint32Array(t3), s.HEAPF32 = new Float32Array(t3), s.HEAPF64 = M = new Float64Array(t3); + function H(t4) { + C = t4, s.HEAP8 = F = new Int8Array(t4), s.HEAP16 = new Int16Array(t4), s.HEAP32 = R = new Int32Array(t4), s.HEAPU8 = N = new Uint8Array(t4), s.HEAPU16 = new Uint16Array(t4), s.HEAPU32 = L = new Uint32Array(t4), s.HEAPF32 = new Float32Array(t4), s.HEAPF64 = M = new Float64Array(t4); } x && (C = s.buffer); var q = s.INITIAL_MEMORY || 16777216; @@ -1314,55 +1999,55 @@ var require_ort_web_node = __commonJS({ return D || false; } function Q() { - var t3 = s.preRun.shift(); - X.unshift(t3); + var t4 = s.preRun.shift(); + X.unshift(t4); } var tt, et = 0, nt = null, rt = null; - function it(t3) { - throw x ? postMessage({ cmd: "onAbort", arg: t3 }) : s.onAbort && s.onAbort(t3), P(t3 = "Aborted(" + t3 + ")"), j = true, t3 = new WebAssembly.RuntimeError(t3 + ". Build with -sASSERTIONS for more info."), c(t3), t3; + function it(t4) { + throw x ? postMessage({ cmd: "onAbort", arg: t4 }) : s.onAbort && s.onAbort(t4), P(t4 = "Aborted(" + t4 + ")"), j = true, t4 = new WebAssembly.RuntimeError(t4 + ". Build with -sASSERTIONS for more info."), c(t4), t4; } function ot() { return tt.startsWith("data:application/octet-stream;base64,"); } function at() { - var t3 = tt; + var t4 = tt; try { - if (t3 == tt && E) + if (t4 == tt && E) return new Uint8Array(E); if (f) - return f(t3); + return f(t4); throw "both async and sync fetching of the wasm failed"; - } catch (t4) { - it(t4); + } catch (t5) { + it(t5); } } tt = "ort-wasm-threaded.wasm", ot() || (tt = S(tt)); var st = {}; - function ut(t3) { - this.name = "ExitStatus", this.message = "Program terminated with exit(" + t3 + ")", this.status = t3; + function ut(t4) { + this.name = "ExitStatus", this.message = "Program terminated with exit(" + t4 + ")", this.status = t4; } - function ct(t3) { - (t3 = dt.Vb[t3]) || it(), dt.mc(t3); + function ct(t4) { + (t4 = dt.Vb[t4]) || it(), dt.mc(t4); } - function lt(t3) { + function lt(t4) { var e3 = dt.Cc(); if (!e3) return 6; - dt.ac.push(e3), dt.Vb[t3.Ub] = e3, e3.Ub = t3.Ub; - var n2 = { cmd: "run", start_routine: t3.Ic, arg: t3.zc, pthread_ptr: t3.Ub }; + dt.ac.push(e3), dt.Vb[t4.Ub] = e3, e3.Ub = t4.Ub; + var n2 = { cmd: "run", start_routine: t4.Ic, arg: t4.zc, pthread_ptr: t4.Ub }; return e3.$b = () => { - n2.time = performance.now(), e3.postMessage(n2, t3.Nc); + n2.time = performance.now(), e3.postMessage(n2, t4.Nc); }, e3.loaded && (e3.$b(), delete e3.$b), 0; } - function pt(t3) { + function pt(t4) { if (x) - return Wt(1, 1, t3); - J() || (dt.oc(), s.onExit && s.onExit(t3), j = true), y(t3, new ut(t3)); + return Wt(1, 1, t4); + J() || (dt.oc(), s.onExit && s.onExit(t4), j = true), y(t4, new ut(t4)); } - function ft(t3, e3) { + function ft(t4, e3) { if (!e3 && x) - throw bt(t3), "unwind"; - J() || x || (me(), ht(K), be(0), re[1].length && ie(1, 10), re[2].length && ie(2, 10), dt.oc()), pt(t3); + throw bt(t4), "unwind"; + J() || x || (me(), ht(K), be(0), re[1].length && ie(1, 10), re[2].length && ie(2, 10), dt.oc()), pt(t4); } var dt = { Yb: [], ac: [], qc: [], Vb: {}, fc: function() { x && dt.Ec(); @@ -1371,482 +2056,482 @@ var require_ort_web_node = __commonJS({ dt.receiveObjectTransfer = dt.Gc, dt.threadInitTLS = dt.pc, dt.setExitStatus = dt.nc, D = false; }, nc: function() { }, oc: function() { - for (var t3 of Object.values(dt.Vb)) - dt.mc(t3); - for (t3 of dt.Yb) - t3.terminate(); + for (var t4 of Object.values(dt.Vb)) + dt.mc(t4); + for (t4 of dt.Yb) + t4.terminate(); dt.Yb = []; - }, mc: function(t3) { - var e3 = t3.Ub; - delete dt.Vb[e3], dt.Yb.push(t3), dt.ac.splice(dt.ac.indexOf(t3), 1), t3.Ub = 0, xe(e3); + }, mc: function(t4) { + var e3 = t4.Ub; + delete dt.Vb[e3], dt.Yb.push(t4), dt.ac.splice(dt.ac.indexOf(t4), 1), t4.Ub = 0, xe(e3); }, Gc: function() { }, pc: function() { - dt.qc.forEach((t3) => t3()); - }, Fc: function(t3, e3) { - t3.onmessage = (n2) => { + dt.qc.forEach((t4) => t4()); + }, Fc: function(t4, e3) { + t4.onmessage = (n2) => { var r3 = (n2 = n2.data).cmd; - if (t3.Ub && (dt.Bc = t3.Ub), n2.targetThread && n2.targetThread != de()) { + if (t4.Ub && (dt.Bc = t4.Ub), n2.targetThread && n2.targetThread != de()) { var i3 = dt.Vb[n2.Qc]; i3 ? i3.postMessage(n2, n2.transferList) : P('Internal error! Worker sent a message "' + r3 + '" to target pthread ' + n2.targetThread + ", but that thread no longer exists!"); } else - "processProxyingQueue" === r3 ? Vt(n2.queue) : "spawnThread" === r3 ? lt(n2) : "cleanupThread" === r3 ? ct(n2.thread) : "killThread" === r3 ? (n2 = n2.thread, r3 = dt.Vb[n2], delete dt.Vb[n2], r3.terminate(), xe(n2), dt.ac.splice(dt.ac.indexOf(r3), 1), r3.Ub = 0) : "cancelThread" === r3 ? dt.Vb[n2.thread].postMessage({ cmd: "cancel" }) : "loaded" === r3 ? (t3.loaded = true, e3 && e3(t3), t3.$b && (t3.$b(), delete t3.$b)) : "print" === r3 ? I("Thread " + n2.threadId + ": " + n2.text) : "printErr" === r3 ? P("Thread " + n2.threadId + ": " + n2.text) : "alert" === r3 ? alert("Thread " + n2.threadId + ": " + n2.text) : "setimmediate" === n2.target ? t3.postMessage(n2) : "onAbort" === r3 ? s.onAbort && s.onAbort(n2.arg) : r3 && P("worker sent an unknown command " + r3); + "processProxyingQueue" === r3 ? Vt(n2.queue) : "spawnThread" === r3 ? lt(n2) : "cleanupThread" === r3 ? ct(n2.thread) : "killThread" === r3 ? (n2 = n2.thread, r3 = dt.Vb[n2], delete dt.Vb[n2], r3.terminate(), xe(n2), dt.ac.splice(dt.ac.indexOf(r3), 1), r3.Ub = 0) : "cancelThread" === r3 ? dt.Vb[n2.thread].postMessage({ cmd: "cancel" }) : "loaded" === r3 ? (t4.loaded = true, e3 && e3(t4), t4.$b && (t4.$b(), delete t4.$b)) : "print" === r3 ? I("Thread " + n2.threadId + ": " + n2.text) : "printErr" === r3 ? P("Thread " + n2.threadId + ": " + n2.text) : "alert" === r3 ? alert("Thread " + n2.threadId + ": " + n2.text) : "setimmediate" === n2.target ? t4.postMessage(n2) : "onAbort" === r3 ? s.onAbort && s.onAbort(n2.arg) : r3 && P("worker sent an unknown command " + r3); dt.Bc = void 0; - }, t3.onerror = (t4) => { - throw P("worker sent an error! " + t4.filename + ":" + t4.lineno + ": " + t4.message), t4; - }, w && (t3.on("message", function(e4) { - t3.onmessage({ data: e4 }); - }), t3.on("error", function(e4) { - t3.onerror(e4); - }), t3.on("detachedExit", function() { - })), t3.postMessage({ cmd: "load", urlOrBlob: s.mainScriptUrlOrBlob || _scriptDir, wasmMemory: $, wasmModule: k }); + }, t4.onerror = (t5) => { + throw P("worker sent an error! " + t5.filename + ":" + t5.lineno + ": " + t5.message), t5; + }, w && (t4.on("message", function(e4) { + t4.onmessage({ data: e4 }); + }), t4.on("error", function(e4) { + t4.onerror(e4); + }), t4.on("detachedExit", function() { + })), t4.postMessage({ cmd: "load", urlOrBlob: s.mainScriptUrlOrBlob || _scriptDir, wasmMemory: $, wasmModule: k }); }, yc: function() { - var t3 = S("ort-wasm-threaded.worker.js"); - dt.Yb.push(new Worker(t3)); + var t4 = S("ort-wasm-threaded.worker.js"); + dt.Yb.push(new Worker(t4)); }, Cc: function() { return 0 == dt.Yb.length && (dt.yc(), dt.Fc(dt.Yb[0])), dt.Yb.pop(); } }; - function ht(t3) { - for (; 0 < t3.length; ) - t3.shift()(s); + function ht(t4) { + for (; 0 < t4.length; ) + t4.shift()(s); } - function gt(t3) { + function gt(t4) { var e3 = Ae(); - return t3 = t3(), Ee(e3), t3; + return t4 = t4(), Ee(e3), t4; } - function bt(t3) { + function bt(t4) { if (x) - return Wt(2, 0, t3); + return Wt(2, 0, t4); try { - ft(t3); - } catch (t4) { - t4 instanceof ut || "unwind" == t4 || y(1, t4); + ft(t4); + } catch (t5) { + t5 instanceof ut || "unwind" == t5 || y(1, t5); } } s.PThread = dt, s.establishStackSpace = function() { - var t3 = de(), e3 = i2()[t3 + 44 >> 2 >>> 0]; - t3 = i2()[t3 + 48 >> 2 >>> 0], Oe(e3, e3 - t3), Ee(e3); + var t4 = de(), e3 = i2()[t4 + 44 >> 2 >>> 0]; + t4 = i2()[t4 + 48 >> 2 >>> 0], Oe(e3, e3 - t4), Ee(e3); }; var mt = []; - function yt(t3) { - var e3 = mt[t3]; - return e3 || (t3 >= mt.length && (mt.length = t3 + 1), mt[t3] = e3 = W.get(t3)), e3; + function yt(t4) { + var e3 = mt[t4]; + return e3 || (t4 >= mt.length && (mt.length = t4 + 1), mt[t4] = e3 = W.get(t4)), e3; } - s.invokeEntryPoint = function(t3, e3) { - t3 = yt(t3)(e3), J() ? dt.nc(t3) : Te(t3); + s.invokeEntryPoint = function(t4, e3) { + t4 = yt(t4)(e3), J() ? dt.nc(t4) : Te(t4); }; var _t, vt, wt = [], xt = 0, Tt = 0; - function St(t3) { - this.Zb = t3, this.Sb = t3 - 24, this.xc = function(t4) { - o()[this.Sb + 4 >> 2 >>> 0] = t4; + function St(t4) { + this.Zb = t4, this.Sb = t4 - 24, this.xc = function(t5) { + o()[this.Sb + 4 >> 2 >>> 0] = t5; }, this.bc = function() { return o()[this.Sb + 4 >> 2 >>> 0]; - }, this.wc = function(t4) { - o()[this.Sb + 8 >> 2 >>> 0] = t4; + }, this.wc = function(t5) { + o()[this.Sb + 8 >> 2 >>> 0] = t5; }, this.Dc = function() { return o()[this.Sb + 8 >> 2 >>> 0]; }, this.rc = function() { i2()[this.Sb >> 2 >>> 0] = 0; - }, this.hc = function(t4) { - t4 = t4 ? 1 : 0, e2()[this.Sb + 12 >> 0 >>> 0] = t4; + }, this.hc = function(t5) { + t5 = t5 ? 1 : 0, e2()[this.Sb + 12 >> 0 >>> 0] = t5; }, this.uc = function() { return 0 != e2()[this.Sb + 12 >> 0 >>> 0]; - }, this.ic = function(t4) { - t4 = t4 ? 1 : 0, e2()[this.Sb + 13 >> 0 >>> 0] = t4; + }, this.ic = function(t5) { + t5 = t5 ? 1 : 0, e2()[this.Sb + 13 >> 0 >>> 0] = t5; }, this.kc = function() { return 0 != e2()[this.Sb + 13 >> 0 >>> 0]; - }, this.fc = function(t4, e3) { - this.cc(0), this.xc(t4), this.wc(e3), this.rc(), this.hc(false), this.ic(false); + }, this.fc = function(t5, e3) { + this.cc(0), this.xc(t5), this.wc(e3), this.rc(), this.hc(false), this.ic(false); }, this.sc = function() { Atomics.add(i2(), this.Sb >> 2, 1); }, this.Hc = function() { return 1 === Atomics.sub(i2(), this.Sb >> 2, 1); - }, this.cc = function(t4) { - o()[this.Sb + 16 >> 2 >>> 0] = t4; + }, this.cc = function(t5) { + o()[this.Sb + 16 >> 2 >>> 0] = t5; }, this.tc = function() { return o()[this.Sb + 16 >> 2 >>> 0]; }, this.vc = function() { if (De(this.bc())) return o()[this.Zb >> 2 >>> 0]; - var t4 = this.tc(); - return 0 !== t4 ? t4 : this.Zb; + var t5 = this.tc(); + return 0 !== t5 ? t5 : this.Zb; }; } - function Ot(t3) { - return ge(new St(t3).Sb); + function Ot(t4) { + return ge(new St(t4).Sb); } - function At(t3, e3, n2, r3) { - return x ? Wt(3, 1, t3, e3, n2, r3) : Et(t3, e3, n2, r3); + function At(t4, e3, n2, r3) { + return x ? Wt(3, 1, t4, e3, n2, r3) : Et(t4, e3, n2, r3); } - function Et(t3, e3, n2, r3) { + function Et(t4, e3, n2, r3) { if ("undefined" == typeof SharedArrayBuffer) return P("Current environment does not support SharedArrayBuffer, pthreads are not available!"), 6; var i3 = []; - return x && 0 === i3.length ? At(t3, e3, n2, r3) : (t3 = { Ic: n2, Ub: t3, zc: r3, Nc: i3 }, x ? (t3.Oc = "spawnThread", postMessage(t3, i3), 0) : lt(t3)); + return x && 0 === i3.length ? At(t4, e3, n2, r3) : (t4 = { Ic: n2, Ub: t4, zc: r3, Nc: i3 }, x ? (t4.Oc = "spawnThread", postMessage(t4, i3), 0) : lt(t4)); } - function It(t3, e3, n2) { - return x ? Wt(4, 1, t3, e3, n2) : 0; + function It(t4, e3, n2) { + return x ? Wt(4, 1, t4, e3, n2) : 0; } - function Pt(t3, e3) { + function Pt(t4, e3) { if (x) - return Wt(5, 1, t3, e3); + return Wt(5, 1, t4, e3); } - function Dt(t3, e3) { + function Dt(t4, e3) { if (x) - return Wt(6, 1, t3, e3); + return Wt(6, 1, t4, e3); } - function $t(t3, e3, n2) { + function $t(t4, e3, n2) { if (x) - return Wt(7, 1, t3, e3, n2); + return Wt(7, 1, t4, e3, n2); } - function kt(t3, e3, n2) { - return x ? Wt(8, 1, t3, e3, n2) : 0; + function kt(t4, e3, n2) { + return x ? Wt(8, 1, t4, e3, n2) : 0; } - function Ct(t3, e3) { + function Ct(t4, e3) { if (x) - return Wt(9, 1, t3, e3); + return Wt(9, 1, t4, e3); } - function Ft(t3, e3, n2) { + function Ft(t4, e3, n2) { if (x) - return Wt(10, 1, t3, e3, n2); + return Wt(10, 1, t4, e3, n2); } - function Nt(t3, e3, n2, r3) { + function Nt(t4, e3, n2, r3) { if (x) - return Wt(11, 1, t3, e3, n2, r3); + return Wt(11, 1, t4, e3, n2, r3); } - function Rt(t3, e3, n2, r3) { + function Rt(t4, e3, n2, r3) { if (x) - return Wt(12, 1, t3, e3, n2, r3); + return Wt(12, 1, t4, e3, n2, r3); } - function Lt(t3, e3, n2, r3) { + function Lt(t4, e3, n2, r3) { if (x) - return Wt(13, 1, t3, e3, n2, r3); + return Wt(13, 1, t4, e3, n2, r3); } - function Mt(t3) { + function Mt(t4) { if (x) - return Wt(14, 1, t3); + return Wt(14, 1, t4); } - function jt(t3, e3) { + function jt(t4, e3) { if (x) - return Wt(15, 1, t3, e3); + return Wt(15, 1, t4, e3); } - function Ut(t3, e3, n2) { + function Ut(t4, e3, n2) { if (x) - return Wt(16, 1, t3, e3, n2); + return Wt(16, 1, t4, e3, n2); } - function Vt(t3) { - Atomics.store(i2(), t3 >> 2, 1), de() && we(t3), Atomics.compareExchange(i2(), t3 >> 2, 1, 0); + function Vt(t4) { + Atomics.store(i2(), t4 >> 2, 1), de() && we(t4), Atomics.compareExchange(i2(), t4 >> 2, 1, 0); } - function Bt(t3) { - return o()[t3 >>> 2] + 4294967296 * i2()[t3 + 4 >>> 2]; + function Bt(t4) { + return o()[t4 >>> 2] + 4294967296 * i2()[t4 + 4 >>> 2]; } - function zt(t3, e3, n2, r3, i3, o2) { - return x ? Wt(17, 1, t3, e3, n2, r3, i3, o2) : -52; + function zt(t4, e3, n2, r3, i3, o2) { + return x ? Wt(17, 1, t4, e3, n2, r3, i3, o2) : -52; } - function Gt(t3, e3, n2, r3, i3, o2) { + function Gt(t4, e3, n2, r3, i3, o2) { if (x) - return Wt(18, 1, t3, e3, n2, r3, i3, o2); + return Wt(18, 1, t4, e3, n2, r3, i3, o2); } - function Ht(t3) { - var n2 = G(t3) + 1, r3 = he(n2); - return r3 && z(t3, e2(), r3, n2), r3; + function Ht(t4) { + var n2 = G(t4) + 1, r3 = he(n2); + return r3 && z(t4, e2(), r3, n2), r3; } - function qt(t3, e3, n2) { - function r3(t4) { - return (t4 = t4.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? t4[1] : "GMT"; + function qt(t4, e3, n2) { + function r3(t5) { + return (t5 = t5.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? t5[1] : "GMT"; } if (x) - return Wt(19, 1, t3, e3, n2); + return Wt(19, 1, t4, e3, n2); var a2 = (/* @__PURE__ */ new Date()).getFullYear(), s2 = new Date(a2, 0, 1), u2 = new Date(a2, 6, 1); a2 = s2.getTimezoneOffset(); var c2 = u2.getTimezoneOffset(), l2 = Math.max(a2, c2); - i2()[t3 >> 2 >>> 0] = 60 * l2, i2()[e3 >> 2 >>> 0] = Number(a2 != c2), t3 = r3(s2), e3 = r3(u2), t3 = Ht(t3), e3 = Ht(e3), c2 < a2 ? (o()[n2 >> 2 >>> 0] = t3, o()[n2 + 4 >> 2 >>> 0] = e3) : (o()[n2 >> 2 >>> 0] = e3, o()[n2 + 4 >> 2 >>> 0] = t3); + i2()[t4 >> 2 >>> 0] = 60 * l2, i2()[e3 >> 2 >>> 0] = Number(a2 != c2), t4 = r3(s2), e3 = r3(u2), t4 = Ht(t4), e3 = Ht(e3), c2 < a2 ? (o()[n2 >> 2 >>> 0] = t4, o()[n2 + 4 >> 2 >>> 0] = e3) : (o()[n2 >> 2 >>> 0] = e3, o()[n2 + 4 >> 2 >>> 0] = t4); } - function Wt(t3, e3) { + function Wt(t4, e3) { var n2 = arguments.length - 2, r3 = arguments; return gt(() => { for (var i3 = Ie(8 * n2), o2 = i3 >> 3, s2 = 0; s2 < n2; s2++) { var u2 = r3[2 + s2]; a()[o2 + s2 >>> 0] = u2; } - return ve(t3, n2, i3, e3); + return ve(t4, n2, i3, e3); }); } s.executeNotifiedProxyingQueue = Vt, vt = w ? () => { - var t3 = process.hrtime(); - return 1e3 * t3[0] + t3[1] / 1e6; + var t4 = process.hrtime(); + return 1e3 * t4[0] + t4[1] / 1e6; } : x ? () => performance.now() - s.__performance_now_clock_drift : () => performance.now(); var Xt, Yt = [], Kt = {}; function Zt() { if (!Xt) { - var t3, e3 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: m || "./this.program" }; - for (t3 in Kt) - void 0 === Kt[t3] ? delete e3[t3] : e3[t3] = Kt[t3]; + var t4, e3 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: m || "./this.program" }; + for (t4 in Kt) + void 0 === Kt[t4] ? delete e3[t4] : e3[t4] = Kt[t4]; var n2 = []; - for (t3 in e3) - n2.push(t3 + "=" + e3[t3]); + for (t4 in e3) + n2.push(t4 + "=" + e3[t4]); Xt = n2; } return Xt; } - function Jt(t3, n2) { + function Jt(t4, n2) { if (x) - return Wt(20, 1, t3, n2); + return Wt(20, 1, t4, n2); var r3 = 0; return Zt().forEach(function(i3, a2) { var s2 = n2 + r3; - for (a2 = o()[t3 + 4 * a2 >> 2 >>> 0] = s2, s2 = 0; s2 < i3.length; ++s2) + for (a2 = o()[t4 + 4 * a2 >> 2 >>> 0] = s2, s2 = 0; s2 < i3.length; ++s2) e2()[a2++ >> 0 >>> 0] = i3.charCodeAt(s2); e2()[a2 >> 0 >>> 0] = 0, r3 += i3.length + 1; }), 0; } - function Qt(t3, e3) { + function Qt(t4, e3) { if (x) - return Wt(21, 1, t3, e3); + return Wt(21, 1, t4, e3); var n2 = Zt(); - o()[t3 >> 2 >>> 0] = n2.length; + o()[t4 >> 2 >>> 0] = n2.length; var r3 = 0; - return n2.forEach(function(t4) { - r3 += t4.length + 1; + return n2.forEach(function(t5) { + r3 += t5.length + 1; }), o()[e3 >> 2 >>> 0] = r3, 0; } - function te(t3) { - return x ? Wt(22, 1, t3) : 52; + function te(t4) { + return x ? Wt(22, 1, t4) : 52; } - function ee(t3, e3, n2, r3) { - return x ? Wt(23, 1, t3, e3, n2, r3) : 52; + function ee(t4, e3, n2, r3) { + return x ? Wt(23, 1, t4, e3, n2, r3) : 52; } - function ne(t3, e3, n2, r3, i3) { - return x ? Wt(24, 1, t3, e3, n2, r3, i3) : 70; + function ne(t4, e3, n2, r3, i3) { + return x ? Wt(24, 1, t4, e3, n2, r3, i3) : 70; } var re = [null, [], []]; - function ie(t3, e3) { - var n2 = re[t3]; - 0 === e3 || 10 === e3 ? ((1 === t3 ? I : P)(V(n2, 0)), n2.length = 0) : n2.push(e3); + function ie(t4, e3) { + var n2 = re[t4]; + 0 === e3 || 10 === e3 ? ((1 === t4 ? I : P)(V(n2, 0)), n2.length = 0) : n2.push(e3); } - function oe(t3, e3, n2, i3) { + function oe(t4, e3, n2, i3) { if (x) - return Wt(25, 1, t3, e3, n2, i3); + return Wt(25, 1, t4, e3, n2, i3); for (var a2 = 0, s2 = 0; s2 < n2; s2++) { var u2 = o()[e3 >> 2 >>> 0], c2 = o()[e3 + 4 >> 2 >>> 0]; e3 += 8; for (var l2 = 0; l2 < c2; l2++) - ie(t3, r2()[u2 + l2 >>> 0]); + ie(t4, r2()[u2 + l2 >>> 0]); a2 += c2; } return o()[i3 >> 2 >>> 0] = a2, 0; } var ae = 0; - function se(t3) { - return 0 == t3 % 4 && (0 != t3 % 100 || 0 == t3 % 400); + function se(t4) { + return 0 == t4 % 4 && (0 != t4 % 100 || 0 == t4 % 400); } var ue = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ce = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function le(t3, n2, r3, o2) { - function a2(t4, e3, n3) { - for (t4 = "number" == typeof t4 ? t4.toString() : t4 || ""; t4.length < e3; ) - t4 = n3[0] + t4; - return t4; + function le(t4, n2, r3, o2) { + function a2(t5, e3, n3) { + for (t5 = "number" == typeof t5 ? t5.toString() : t5 || ""; t5.length < e3; ) + t5 = n3[0] + t5; + return t5; } - function s2(t4, e3) { - return a2(t4, e3, "0"); + function s2(t5, e3) { + return a2(t5, e3, "0"); } - function u2(t4, e3) { - function n3(t5) { - return 0 > t5 ? -1 : 0 < t5 ? 1 : 0; + function u2(t5, e3) { + function n3(t6) { + return 0 > t6 ? -1 : 0 < t6 ? 1 : 0; } var r4; - return 0 === (r4 = n3(t4.getFullYear() - e3.getFullYear())) && 0 === (r4 = n3(t4.getMonth() - e3.getMonth())) && (r4 = n3(t4.getDate() - e3.getDate())), r4; + return 0 === (r4 = n3(t5.getFullYear() - e3.getFullYear())) && 0 === (r4 = n3(t5.getMonth() - e3.getMonth())) && (r4 = n3(t5.getDate() - e3.getDate())), r4; } - function c2(t4) { - switch (t4.getDay()) { + function c2(t5) { + switch (t5.getDay()) { case 0: - return new Date(t4.getFullYear() - 1, 11, 29); + return new Date(t5.getFullYear() - 1, 11, 29); case 1: - return t4; + return t5; case 2: - return new Date(t4.getFullYear(), 0, 3); + return new Date(t5.getFullYear(), 0, 3); case 3: - return new Date(t4.getFullYear(), 0, 2); + return new Date(t5.getFullYear(), 0, 2); case 4: - return new Date(t4.getFullYear(), 0, 1); + return new Date(t5.getFullYear(), 0, 1); case 5: - return new Date(t4.getFullYear() - 1, 11, 31); + return new Date(t5.getFullYear() - 1, 11, 31); case 6: - return new Date(t4.getFullYear() - 1, 11, 30); + return new Date(t5.getFullYear() - 1, 11, 30); } } - function l2(t4) { - var e3 = t4.Wb; - for (t4 = new Date(new Date(t4.Xb + 1900, 0, 1).getTime()); 0 < e3; ) { - var n3 = t4.getMonth(), r4 = (se(t4.getFullYear()) ? ue : ce)[n3]; - if (!(e3 > r4 - t4.getDate())) { - t4.setDate(t4.getDate() + e3); + function l2(t5) { + var e3 = t5.Wb; + for (t5 = new Date(new Date(t5.Xb + 1900, 0, 1).getTime()); 0 < e3; ) { + var n3 = t5.getMonth(), r4 = (se(t5.getFullYear()) ? ue : ce)[n3]; + if (!(e3 > r4 - t5.getDate())) { + t5.setDate(t5.getDate() + e3); break; } - e3 -= r4 - t4.getDate() + 1, t4.setDate(1), 11 > n3 ? t4.setMonth(n3 + 1) : (t4.setMonth(0), t4.setFullYear(t4.getFullYear() + 1)); + e3 -= r4 - t5.getDate() + 1, t5.setDate(1), 11 > n3 ? t5.setMonth(n3 + 1) : (t5.setMonth(0), t5.setFullYear(t5.getFullYear() + 1)); } - return n3 = new Date(t4.getFullYear() + 1, 0, 4), e3 = c2(new Date(t4.getFullYear(), 0, 4)), n3 = c2(n3), 0 >= u2(e3, t4) ? 0 >= u2(n3, t4) ? t4.getFullYear() + 1 : t4.getFullYear() : t4.getFullYear() - 1; + return n3 = new Date(t5.getFullYear() + 1, 0, 4), e3 = c2(new Date(t5.getFullYear(), 0, 4)), n3 = c2(n3), 0 >= u2(e3, t5) ? 0 >= u2(n3, t5) ? t5.getFullYear() + 1 : t5.getFullYear() : t5.getFullYear() - 1; } var p2 = i2()[o2 + 40 >> 2 >>> 0]; for (var f2 in o2 = { Lc: i2()[o2 >> 2 >>> 0], Kc: i2()[o2 + 4 >> 2 >>> 0], dc: i2()[o2 + 8 >> 2 >>> 0], jc: i2()[o2 + 12 >> 2 >>> 0], ec: i2()[o2 + 16 >> 2 >>> 0], Xb: i2()[o2 + 20 >> 2 >>> 0], Tb: i2()[o2 + 24 >> 2 >>> 0], Wb: i2()[o2 + 28 >> 2 >>> 0], Rc: i2()[o2 + 32 >> 2 >>> 0], Jc: i2()[o2 + 36 >> 2 >>> 0], Mc: p2 ? B(p2) : "" }, r3 = B(r3), p2 = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" }) r3 = r3.replace(new RegExp(f2, "g"), p2[f2]); var d2 = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), h2 = "January February March April May June July August September October November December".split(" "); - for (f2 in p2 = { "%a": function(t4) { - return d2[t4.Tb].substring(0, 3); - }, "%A": function(t4) { - return d2[t4.Tb]; - }, "%b": function(t4) { - return h2[t4.ec].substring(0, 3); - }, "%B": function(t4) { - return h2[t4.ec]; - }, "%C": function(t4) { - return s2((t4.Xb + 1900) / 100 | 0, 2); - }, "%d": function(t4) { - return s2(t4.jc, 2); - }, "%e": function(t4) { - return a2(t4.jc, 2, " "); - }, "%g": function(t4) { - return l2(t4).toString().substring(2); - }, "%G": function(t4) { - return l2(t4); - }, "%H": function(t4) { - return s2(t4.dc, 2); - }, "%I": function(t4) { - return 0 == (t4 = t4.dc) ? t4 = 12 : 12 < t4 && (t4 -= 12), s2(t4, 2); - }, "%j": function(t4) { - for (var e3 = 0, n3 = 0; n3 <= t4.ec - 1; e3 += (se(t4.Xb + 1900) ? ue : ce)[n3++]) + for (f2 in p2 = { "%a": function(t5) { + return d2[t5.Tb].substring(0, 3); + }, "%A": function(t5) { + return d2[t5.Tb]; + }, "%b": function(t5) { + return h2[t5.ec].substring(0, 3); + }, "%B": function(t5) { + return h2[t5.ec]; + }, "%C": function(t5) { + return s2((t5.Xb + 1900) / 100 | 0, 2); + }, "%d": function(t5) { + return s2(t5.jc, 2); + }, "%e": function(t5) { + return a2(t5.jc, 2, " "); + }, "%g": function(t5) { + return l2(t5).toString().substring(2); + }, "%G": function(t5) { + return l2(t5); + }, "%H": function(t5) { + return s2(t5.dc, 2); + }, "%I": function(t5) { + return 0 == (t5 = t5.dc) ? t5 = 12 : 12 < t5 && (t5 -= 12), s2(t5, 2); + }, "%j": function(t5) { + for (var e3 = 0, n3 = 0; n3 <= t5.ec - 1; e3 += (se(t5.Xb + 1900) ? ue : ce)[n3++]) ; - return s2(t4.jc + e3, 3); - }, "%m": function(t4) { - return s2(t4.ec + 1, 2); - }, "%M": function(t4) { - return s2(t4.Kc, 2); + return s2(t5.jc + e3, 3); + }, "%m": function(t5) { + return s2(t5.ec + 1, 2); + }, "%M": function(t5) { + return s2(t5.Kc, 2); }, "%n": function() { return "\n"; - }, "%p": function(t4) { - return 0 <= t4.dc && 12 > t4.dc ? "AM" : "PM"; - }, "%S": function(t4) { - return s2(t4.Lc, 2); + }, "%p": function(t5) { + return 0 <= t5.dc && 12 > t5.dc ? "AM" : "PM"; + }, "%S": function(t5) { + return s2(t5.Lc, 2); }, "%t": function() { return " "; - }, "%u": function(t4) { - return t4.Tb || 7; - }, "%U": function(t4) { - return s2(Math.floor((t4.Wb + 7 - t4.Tb) / 7), 2); - }, "%V": function(t4) { - var e3 = Math.floor((t4.Wb + 7 - (t4.Tb + 6) % 7) / 7); - if (2 >= (t4.Tb + 371 - t4.Wb - 2) % 7 && e3++, e3) - 53 == e3 && (4 == (n3 = (t4.Tb + 371 - t4.Wb) % 7) || 3 == n3 && se(t4.Xb) || (e3 = 1)); + }, "%u": function(t5) { + return t5.Tb || 7; + }, "%U": function(t5) { + return s2(Math.floor((t5.Wb + 7 - t5.Tb) / 7), 2); + }, "%V": function(t5) { + var e3 = Math.floor((t5.Wb + 7 - (t5.Tb + 6) % 7) / 7); + if (2 >= (t5.Tb + 371 - t5.Wb - 2) % 7 && e3++, e3) + 53 == e3 && (4 == (n3 = (t5.Tb + 371 - t5.Wb) % 7) || 3 == n3 && se(t5.Xb) || (e3 = 1)); else { e3 = 52; - var n3 = (t4.Tb + 7 - t4.Wb - 1) % 7; - (4 == n3 || 5 == n3 && se(t4.Xb % 400 - 1)) && e3++; + var n3 = (t5.Tb + 7 - t5.Wb - 1) % 7; + (4 == n3 || 5 == n3 && se(t5.Xb % 400 - 1)) && e3++; } return s2(e3, 2); - }, "%w": function(t4) { - return t4.Tb; - }, "%W": function(t4) { - return s2(Math.floor((t4.Wb + 7 - (t4.Tb + 6) % 7) / 7), 2); - }, "%y": function(t4) { - return (t4.Xb + 1900).toString().substring(2); - }, "%Y": function(t4) { - return t4.Xb + 1900; - }, "%z": function(t4) { - var e3 = 0 <= (t4 = t4.Jc); - return t4 = Math.abs(t4) / 60, (e3 ? "+" : "-") + String("0000" + (t4 / 60 * 100 + t4 % 60)).slice(-4); - }, "%Z": function(t4) { - return t4.Mc; + }, "%w": function(t5) { + return t5.Tb; + }, "%W": function(t5) { + return s2(Math.floor((t5.Wb + 7 - (t5.Tb + 6) % 7) / 7), 2); + }, "%y": function(t5) { + return (t5.Xb + 1900).toString().substring(2); + }, "%Y": function(t5) { + return t5.Xb + 1900; + }, "%z": function(t5) { + var e3 = 0 <= (t5 = t5.Jc); + return t5 = Math.abs(t5) / 60, (e3 ? "+" : "-") + String("0000" + (t5 / 60 * 100 + t5 % 60)).slice(-4); + }, "%Z": function(t5) { + return t5.Mc; }, "%%": function() { return "%"; } }, r3 = r3.replace(/%%/g, "\0\0"), p2) r3.includes(f2) && (r3 = r3.replace(new RegExp(f2, "g"), p2[f2](o2))); - return f2 = function(t4) { - var e3 = Array(G(t4) + 1); - return z(t4, e3, 0, e3.length), e3; - }(r3 = r3.replace(/\0\0/g, "%")), f2.length > n2 ? 0 : (function(t4, n3) { - e2().set(t4, n3 >>> 0); - }(f2, t3), f2.length - 1); + return f2 = function(t5) { + var e3 = Array(G(t5) + 1); + return z(t5, e3, 0, e3.length), e3; + }(r3 = r3.replace(/\0\0/g, "%")), f2.length > n2 ? 0 : (function(t5, n3) { + e2().set(t5, n3 >>> 0); + }(f2, t4), f2.length - 1); } dt.fc(); - var pe = [null, pt, bt, At, It, Pt, Dt, $t, kt, Ct, Ft, Nt, Rt, Lt, Mt, jt, Ut, zt, Gt, qt, Jt, Qt, te, ee, ne, oe], fe = { b: function(t3) { - return he(t3 + 24) + 24; - }, n: function(t3) { - return (t3 = new St(t3)).uc() || (t3.hc(true), xt--), t3.ic(false), wt.push(t3), t3.sc(), t3.vc(); - }, ma: function(t3) { - throw P("Unexpected exception thrown, this is not properly supported - aborting"), j = true, t3; + var pe = [null, pt, bt, At, It, Pt, Dt, $t, kt, Ct, Ft, Nt, Rt, Lt, Mt, jt, Ut, zt, Gt, qt, Jt, Qt, te, ee, ne, oe], fe = { b: function(t4) { + return he(t4 + 24) + 24; + }, n: function(t4) { + return (t4 = new St(t4)).uc() || (t4.hc(true), xt--), t4.ic(false), wt.push(t4), t4.sc(), t4.vc(); + }, ma: function(t4) { + throw P("Unexpected exception thrown, this is not properly supported - aborting"), j = true, t4; }, x: function() { Se(0); - var t3 = wt.pop(); - if (t3.Hc() && !t3.kc()) { - var e3 = t3.Dc(); - e3 && yt(e3)(t3.Zb), Ot(t3.Zb); + var t4 = wt.pop(); + if (t4.Hc() && !t4.kc()) { + var e3 = t4.Dc(); + e3 && yt(e3)(t4.Zb), Ot(t4.Zb); } Tt = 0; }, e: function() { - var t3 = Tt; - if (!t3) + var t4 = Tt; + if (!t4) return ae = 0; - var e3 = new St(t3); - e3.cc(t3); + var e3 = new St(t4); + e3.cc(t4); var n2 = e3.bc(); if (!n2) - return ae = 0, t3; + return ae = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (Pe(o2, n2, e3.Sb + 16)) - return ae = o2, t3; + return ae = o2, t4; } - return ae = n2, t3; + return ae = n2, t4; }, l: function() { - var t3 = Tt; - if (!t3) + var t4 = Tt; + if (!t4) return ae = 0; - var e3 = new St(t3); - e3.cc(t3); + var e3 = new St(t4); + e3.cc(t4); var n2 = e3.bc(); if (!n2) - return ae = 0, t3; + return ae = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (Pe(o2, n2, e3.Sb + 16)) - return ae = o2, t3; + return ae = o2, t4; } - return ae = n2, t3; + return ae = n2, t4; }, h: function() { - var t3 = Tt; - if (!t3) + var t4 = Tt; + if (!t4) return ae = 0; - var e3 = new St(t3); - e3.cc(t3); + var e3 = new St(t4); + e3.cc(t4); var n2 = e3.bc(); if (!n2) - return ae = 0, t3; + return ae = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (Pe(o2, n2, e3.Sb + 16)) - return ae = o2, t3; + return ae = o2, t4; } - return ae = n2, t3; + return ae = n2, t4; }, t: Ot, M: function() { - var t3 = wt.pop(); - t3 || it("no exception to throw"); - var e3 = t3.Zb; - throw t3.kc() || (wt.push(t3), t3.ic(true), t3.hc(false), xt++), Tt = e3, e3; - }, c: function(t3, e3, n2) { - throw new St(t3).fc(e3, n2), Tt = t3, xt++, t3; + var t4 = wt.pop(); + t4 || it("no exception to throw"); + var e3 = t4.Zb; + throw t4.kc() || (wt.push(t4), t4.ic(true), t4.hc(false), xt++), Tt = e3, e3; + }, c: function(t4, e3, n2) { + throw new St(t4).fc(e3, n2), Tt = t4, xt++, t4; }, pa: function() { return xt; - }, Fa: function(t3) { - ye(t3, !v, 1, !_), dt.pc(); - }, T: function(t3) { - x ? postMessage({ cmd: "cleanupThread", thread: t3 }) : ct(t3); - }, xa: Et, j: function(t3) { - throw Tt || (Tt = t3), t3; + }, Fa: function(t4) { + ye(t4, !v, 1, !_), dt.pc(); + }, T: function(t4) { + x ? postMessage({ cmd: "cleanupThread", thread: t4 }) : ct(t4); + }, xa: Et, j: function(t4) { + throw Tt || (Tt = t4), t4; }, H: It, Ma: Pt, ua: Dt, wa: $t, oa: kt, Ka: Ct, Ca: Ft, Ja: Nt, V: Rt, va: Lt, sa: Mt, La: jt, ta: Ut, Ta: function() { }, X: function() { it("To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking"); @@ -1858,63 +2543,63 @@ var require_ort_web_node = __commonJS({ return 2097152; }, Oa: function() { return true; - }, za: function(t3, e3, n2, r3) { - if (t3 == e3) + }, za: function(t4, e3, n2, r3) { + if (t4 == e3) setTimeout(() => Vt(r3)); else if (x) - postMessage({ targetThread: t3, cmd: "processProxyingQueue", queue: r3 }); + postMessage({ targetThread: t4, cmd: "processProxyingQueue", queue: r3 }); else { - if (!(t3 = dt.Vb[t3])) + if (!(t4 = dt.Vb[t4])) return; - t3.postMessage({ cmd: "processProxyingQueue", queue: r3 }); + t4.postMessage({ cmd: "processProxyingQueue", queue: r3 }); } return 1; }, Ea: function() { return -1; - }, Pa: function(t3, e3) { - t3 = new Date(1e3 * Bt(t3)), i2()[e3 >> 2 >>> 0] = t3.getUTCSeconds(), i2()[e3 + 4 >> 2 >>> 0] = t3.getUTCMinutes(), i2()[e3 + 8 >> 2 >>> 0] = t3.getUTCHours(), i2()[e3 + 12 >> 2 >>> 0] = t3.getUTCDate(), i2()[e3 + 16 >> 2 >>> 0] = t3.getUTCMonth(), i2()[e3 + 20 >> 2 >>> 0] = t3.getUTCFullYear() - 1900, i2()[e3 + 24 >> 2 >>> 0] = t3.getUTCDay(), t3 = (t3.getTime() - Date.UTC(t3.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5 | 0, i2()[e3 + 28 >> 2 >>> 0] = t3; - }, Qa: function(t3, e3) { - t3 = new Date(1e3 * Bt(t3)), i2()[e3 >> 2 >>> 0] = t3.getSeconds(), i2()[e3 + 4 >> 2 >>> 0] = t3.getMinutes(), i2()[e3 + 8 >> 2 >>> 0] = t3.getHours(), i2()[e3 + 12 >> 2 >>> 0] = t3.getDate(), i2()[e3 + 16 >> 2 >>> 0] = t3.getMonth(), i2()[e3 + 20 >> 2 >>> 0] = t3.getFullYear() - 1900, i2()[e3 + 24 >> 2 >>> 0] = t3.getDay(); - var n2 = new Date(t3.getFullYear(), 0, 1), r3 = (t3.getTime() - n2.getTime()) / 864e5 | 0; - i2()[e3 + 28 >> 2 >>> 0] = r3, i2()[e3 + 36 >> 2 >>> 0] = -60 * t3.getTimezoneOffset(), r3 = new Date(t3.getFullYear(), 6, 1).getTimezoneOffset(), t3 = 0 | (r3 != (n2 = n2.getTimezoneOffset()) && t3.getTimezoneOffset() == Math.min(n2, r3)), i2()[e3 + 32 >> 2 >>> 0] = t3; - }, Ra: function(t3) { - var e3 = new Date(i2()[t3 + 20 >> 2 >>> 0] + 1900, i2()[t3 + 16 >> 2 >>> 0], i2()[t3 + 12 >> 2 >>> 0], i2()[t3 + 8 >> 2 >>> 0], i2()[t3 + 4 >> 2 >>> 0], i2()[t3 >> 2 >>> 0], 0), n2 = i2()[t3 + 32 >> 2 >>> 0], r3 = e3.getTimezoneOffset(), o2 = new Date(e3.getFullYear(), 0, 1), a2 = new Date(e3.getFullYear(), 6, 1).getTimezoneOffset(), s2 = o2.getTimezoneOffset(), u2 = Math.min(s2, a2); - return 0 > n2 ? i2()[t3 + 32 >> 2 >>> 0] = Number(a2 != s2 && u2 == r3) : 0 < n2 != (u2 == r3) && (a2 = Math.max(s2, a2), e3.setTime(e3.getTime() + 6e4 * ((0 < n2 ? u2 : a2) - r3))), i2()[t3 + 24 >> 2 >>> 0] = e3.getDay(), n2 = (e3.getTime() - o2.getTime()) / 864e5 | 0, i2()[t3 + 28 >> 2 >>> 0] = n2, i2()[t3 >> 2 >>> 0] = e3.getSeconds(), i2()[t3 + 4 >> 2 >>> 0] = e3.getMinutes(), i2()[t3 + 8 >> 2 >>> 0] = e3.getHours(), i2()[t3 + 12 >> 2 >>> 0] = e3.getDate(), i2()[t3 + 16 >> 2 >>> 0] = e3.getMonth(), e3.getTime() / 1e3 | 0; - }, Aa: zt, Ba: Gt, Sa: function t3(e3, n2, r3) { - t3.Ac || (t3.Ac = true, qt(e3, n2, r3)); + }, Pa: function(t4, e3) { + t4 = new Date(1e3 * Bt(t4)), i2()[e3 >> 2 >>> 0] = t4.getUTCSeconds(), i2()[e3 + 4 >> 2 >>> 0] = t4.getUTCMinutes(), i2()[e3 + 8 >> 2 >>> 0] = t4.getUTCHours(), i2()[e3 + 12 >> 2 >>> 0] = t4.getUTCDate(), i2()[e3 + 16 >> 2 >>> 0] = t4.getUTCMonth(), i2()[e3 + 20 >> 2 >>> 0] = t4.getUTCFullYear() - 1900, i2()[e3 + 24 >> 2 >>> 0] = t4.getUTCDay(), t4 = (t4.getTime() - Date.UTC(t4.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5 | 0, i2()[e3 + 28 >> 2 >>> 0] = t4; + }, Qa: function(t4, e3) { + t4 = new Date(1e3 * Bt(t4)), i2()[e3 >> 2 >>> 0] = t4.getSeconds(), i2()[e3 + 4 >> 2 >>> 0] = t4.getMinutes(), i2()[e3 + 8 >> 2 >>> 0] = t4.getHours(), i2()[e3 + 12 >> 2 >>> 0] = t4.getDate(), i2()[e3 + 16 >> 2 >>> 0] = t4.getMonth(), i2()[e3 + 20 >> 2 >>> 0] = t4.getFullYear() - 1900, i2()[e3 + 24 >> 2 >>> 0] = t4.getDay(); + var n2 = new Date(t4.getFullYear(), 0, 1), r3 = (t4.getTime() - n2.getTime()) / 864e5 | 0; + i2()[e3 + 28 >> 2 >>> 0] = r3, i2()[e3 + 36 >> 2 >>> 0] = -60 * t4.getTimezoneOffset(), r3 = new Date(t4.getFullYear(), 6, 1).getTimezoneOffset(), t4 = 0 | (r3 != (n2 = n2.getTimezoneOffset()) && t4.getTimezoneOffset() == Math.min(n2, r3)), i2()[e3 + 32 >> 2 >>> 0] = t4; + }, Ra: function(t4) { + var e3 = new Date(i2()[t4 + 20 >> 2 >>> 0] + 1900, i2()[t4 + 16 >> 2 >>> 0], i2()[t4 + 12 >> 2 >>> 0], i2()[t4 + 8 >> 2 >>> 0], i2()[t4 + 4 >> 2 >>> 0], i2()[t4 >> 2 >>> 0], 0), n2 = i2()[t4 + 32 >> 2 >>> 0], r3 = e3.getTimezoneOffset(), o2 = new Date(e3.getFullYear(), 0, 1), a2 = new Date(e3.getFullYear(), 6, 1).getTimezoneOffset(), s2 = o2.getTimezoneOffset(), u2 = Math.min(s2, a2); + return 0 > n2 ? i2()[t4 + 32 >> 2 >>> 0] = Number(a2 != s2 && u2 == r3) : 0 < n2 != (u2 == r3) && (a2 = Math.max(s2, a2), e3.setTime(e3.getTime() + 6e4 * ((0 < n2 ? u2 : a2) - r3))), i2()[t4 + 24 >> 2 >>> 0] = e3.getDay(), n2 = (e3.getTime() - o2.getTime()) / 864e5 | 0, i2()[t4 + 28 >> 2 >>> 0] = n2, i2()[t4 >> 2 >>> 0] = e3.getSeconds(), i2()[t4 + 4 >> 2 >>> 0] = e3.getMinutes(), i2()[t4 + 8 >> 2 >>> 0] = e3.getHours(), i2()[t4 + 12 >> 2 >>> 0] = e3.getDate(), i2()[t4 + 16 >> 2 >>> 0] = e3.getMonth(), e3.getTime() / 1e3 | 0; + }, Aa: zt, Ba: Gt, Sa: function t4(e3, n2, r3) { + t4.Ac || (t4.Ac = true, qt(e3, n2, r3)); }, y: function() { it(""); }, U: function() { if (!w && !v) { - var t3 = "Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"; - _t || (_t = {}), _t[t3] || (_t[t3] = 1, w && (t3 = "warning: " + t3), P(t3)); + var t4 = "Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"; + _t || (_t = {}), _t[t4] || (_t[t4] = 1, w && (t4 = "warning: " + t4), P(t4)); } }, ra: function() { return 4294901760; - }, B: vt, Ia: function(t3, e3, n2) { - r2().copyWithin(t3 >>> 0, e3 >>> 0, e3 + n2 >>> 0); + }, B: vt, Ia: function(t4, e3, n2) { + r2().copyWithin(t4 >>> 0, e3 >>> 0, e3 + n2 >>> 0); }, F: function() { return w ? n(9719).cpus().length : navigator.hardwareConcurrency; - }, Da: function(t3, e3, n2) { + }, Da: function(t4, e3, n2) { Yt.length = e3, n2 >>= 3; for (var r3 = 0; r3 < e3; r3++) Yt[r3] = a()[n2 + r3 >>> 0]; - return (0 > t3 ? st[-t3 - 1] : pe[t3]).apply(null, Yt); - }, qa: function(t3) { + return (0 > t4 ? st[-t4 - 1] : pe[t4]).apply(null, Yt); + }, qa: function(t4) { var e3 = r2().length; - if ((t3 >>>= 0) <= e3 || 4294901760 < t3) + if ((t4 >>>= 0) <= e3 || 4294901760 < t4) return false; for (var n2 = 1; 4 >= n2; n2 *= 2) { var i3 = e3 * (1 + 0.2 / n2); - i3 = Math.min(i3, t3 + 100663296); + i3 = Math.min(i3, t4 + 100663296); var o2 = Math; - i3 = Math.max(t3, i3), o2 = o2.min.call(o2, 4294901760, i3 + (65536 - i3 % 65536) % 65536); + i3 = Math.max(t4, i3), o2 = o2.min.call(o2, 4294901760, i3 + (65536 - i3 % 65536) % 65536); t: { try { $.grow(o2 - C.byteLength + 65535 >>> 16), H($.buffer); var a2 = 1; break t; - } catch (t4) { + } catch (t5) { } a2 = void 0; } @@ -1926,400 +2611,400 @@ var require_ort_web_node = __commonJS({ throw "unwind"; }, Ga: Jt, Ha: Qt, J: ft, I: te, S: ee, ga: ne, R: oe, d: function() { return ae; - }, na: function t3(r3, i3) { - t3.lc || (t3.lc = function() { + }, na: function t4(r3, i3) { + t4.lc || (t4.lc = function() { if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { - var t4 = new Uint8Array(1); - return () => (crypto.getRandomValues(t4), t4[0]); + var t5 = new Uint8Array(1); + return () => (crypto.getRandomValues(t5), t5[0]); } if (w) try { var e3 = n(6113); return () => e3.randomBytes(1)[0]; - } catch (t5) { + } catch (t6) { } return () => it("randomDevice"); }()); for (var o2 = 0; o2 < i3; o2++) - e2()[r3 + o2 >> 0 >>> 0] = t3.lc(); + e2()[r3 + o2 >> 0 >>> 0] = t4.lc(); return 0; - }, ia: function(t3, e3, n2) { + }, ia: function(t4, e3, n2) { var r3 = Ae(); try { - return yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ja: function(t3, e3, n2) { + }, ja: function(t4, e3, n2) { var r3 = Ae(); try { - return yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, K: function(t3) { + }, K: function(t4) { var e3 = Ae(); try { - return yt(t3)(); - } catch (t4) { - if (Ee(e3), t4 !== t4 + 0) - throw t4; + return yt(t4)(); + } catch (t5) { + if (Ee(e3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, f: function(t3, e3) { + }, f: function(t4, e3) { var n2 = Ae(); try { - return yt(t3)(e3); - } catch (t4) { - if (Ee(n2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3); + } catch (t5) { + if (Ee(n2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, P: function(t3, e3, n2) { + }, P: function(t4, e3, n2) { var r3 = Ae(); try { - return yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, Q: function(t3, e3, n2) { + }, Q: function(t4, e3, n2) { var r3 = Ae(); try { - return yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, k: function(t3, e3, n2) { + }, k: function(t4, e3, n2) { var r3 = Ae(); try { - return yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, p: function(t3, e3, n2, r3) { + }, p: function(t4, e3, n2, r3) { var i3 = Ae(); try { - return yt(t3)(e3, n2, r3); - } catch (t4) { - if (Ee(i3), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3); + } catch (t5) { + if (Ee(i3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, q: function(t3, e3, n2, r3, i3) { + }, q: function(t4, e3, n2, r3, i3) { var o2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3); - } catch (t4) { - if (Ee(o2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3); + } catch (t5) { + if (Ee(o2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, N: function(t3, e3, n2, r3, i3, o2) { + }, N: function(t4, e3, n2, r3, i3, o2) { var a2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (Ee(a2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (Ee(a2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, s: function(t3, e3, n2, r3, i3, o2) { + }, s: function(t4, e3, n2, r3, i3, o2) { var a2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (Ee(a2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (Ee(a2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, w: function(t3, e3, n2, r3, i3, o2, a2) { + }, w: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (Ee(s2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (Ee(s2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, L: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, L: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (Ee(u2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (Ee(u2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, E: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { + }, E: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { var f2 = Ae(); try { - return yt(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); - } catch (t4) { - if (Ee(f2), t4 !== t4 + 0) - throw t4; + return yt(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); + } catch (t5) { + if (Ee(f2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, aa: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, aa: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Ae(); try { - return je(t3, e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (Ee(u2), t4 !== t4 + 0) - throw t4; + return je(t4, e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (Ee(u2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, _: function(t3, e3, n2, r3, i3, o2, a2) { + }, _: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Ae(); try { - return ke(t3, e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (Ee(s2), t4 !== t4 + 0) - throw t4; + return ke(t4, e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (Ee(s2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, Z: function(t3, e3, n2, r3, i3) { + }, Z: function(t4, e3, n2, r3, i3) { var o2 = Ae(); try { - return Ue(t3, e3, n2, r3, i3); - } catch (t4) { - if (Ee(o2), t4 !== t4 + 0) - throw t4; + return Ue(t4, e3, n2, r3, i3); + } catch (t5) { + if (Ee(o2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ca: function(t3, e3, n2, r3) { + }, ca: function(t4, e3, n2, r3) { var i3 = Ae(); try { - return Le(t3, e3, n2, r3); - } catch (t4) { - if (Ee(i3), t4 !== t4 + 0) - throw t4; + return Le(t4, e3, n2, r3); + } catch (t5) { + if (Ee(i3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, $: function(t3) { + }, $: function(t4) { var e3 = Ae(); try { - return $e(t3); - } catch (t4) { - if (Ee(e3), t4 !== t4 + 0) - throw t4; + return $e(t4); + } catch (t5) { + if (Ee(e3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ba: function(t3, e3) { + }, ba: function(t4, e3) { var n2 = Ae(); try { - return Me(t3, e3); - } catch (t4) { - if (Ee(n2), t4 !== t4 + 0) - throw t4; + return Me(t4, e3); + } catch (t5) { + if (Ee(n2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, Y: function(t3, e3, n2) { + }, Y: function(t4, e3, n2) { var r3 = Ae(); try { - return Ce(t3, e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + return Ce(t4, e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, g: function(t3) { + }, g: function(t4) { var e3 = Ae(); try { - yt(t3)(); - } catch (t4) { - if (Ee(e3), t4 !== t4 + 0) - throw t4; + yt(t4)(); + } catch (t5) { + if (Ee(e3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, r: function(t3, e3) { + }, r: function(t4, e3) { var n2 = Ae(); try { - yt(t3)(e3); - } catch (t4) { - if (Ee(n2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3); + } catch (t5) { + if (Ee(n2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, i: function(t3, e3, n2) { + }, i: function(t4, e3, n2) { var r3 = Ae(); try { - yt(t3)(e3, n2); - } catch (t4) { - if (Ee(r3), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2); + } catch (t5) { + if (Ee(r3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ha: function(t3, e3, n2, r3) { + }, ha: function(t4, e3, n2, r3) { var i3 = Ae(); try { - yt(t3)(e3, n2, r3); - } catch (t4) { - if (Ee(i3), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3); + } catch (t5) { + if (Ee(i3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, m: function(t3, e3, n2, r3) { + }, m: function(t4, e3, n2, r3) { var i3 = Ae(); try { - yt(t3)(e3, n2, r3); - } catch (t4) { - if (Ee(i3), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3); + } catch (t5) { + if (Ee(i3), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, v: function(t3, e3, n2, r3, i3) { + }, v: function(t4, e3, n2, r3, i3) { var o2 = Ae(); try { - yt(t3)(e3, n2, r3, i3); - } catch (t4) { - if (Ee(o2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3); + } catch (t5) { + if (Ee(o2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, u: function(t3, e3, n2, r3, i3, o2) { + }, u: function(t4, e3, n2, r3, i3, o2) { var a2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (Ee(a2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (Ee(a2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, O: function(t3, e3, n2, r3, i3, o2, a2) { + }, O: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (Ee(s2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (Ee(s2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, A: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, A: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (Ee(u2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (Ee(u2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ka: function(t3, e3, n2, r3, i3, o2, a2, s2, u2) { + }, ka: function(t4, e3, n2, r3, i3, o2, a2, s2, u2) { var c2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2, a2, s2, u2); - } catch (t4) { - if (Ee(c2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2, a2, s2, u2); + } catch (t5) { + if (Ee(c2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, C: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2) { + }, C: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2) { var p2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2); - } catch (t4) { - if (Ee(p2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2); + } catch (t5) { + if (Ee(p2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, D: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2) { + }, D: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2) { var b2 = Ae(); try { - yt(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2); - } catch (t4) { - if (Ee(b2), t4 !== t4 + 0) - throw t4; + yt(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2); + } catch (t5) { + if (Ee(b2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, fa: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, fa: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Ae(); try { - Fe(t3, e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (Ee(u2), t4 !== t4 + 0) - throw t4; + Fe(t4, e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (Ee(u2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, da: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { + }, da: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { var f2 = Ae(); try { - Re(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); - } catch (t4) { - if (Ee(f2), t4 !== t4 + 0) - throw t4; + Re(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); + } catch (t5) { + if (Ee(f2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, ea: function(t3, e3, n2, r3, i3, o2) { + }, ea: function(t4, e3, n2, r3, i3, o2) { var a2 = Ae(); try { - Ne(t3, e3, n2, r3, i3, o2); - } catch (t4) { - if (Ee(a2), t4 !== t4 + 0) - throw t4; + Ne(t4, e3, n2, r3, i3, o2); + } catch (t5) { + if (Ee(a2), t5 !== t5 + 0) + throw t5; Se(1, 0); } - }, o: function(t3) { - return t3; - }, a: $ || s.wasmMemory, G: function(t3) { - ae = t3; - }, la: le, z: function(t3, e3, n2, r3) { - return le(t3, e3, n2, r3); + }, o: function(t4) { + return t4; + }, a: $ || s.wasmMemory, G: function(t4) { + ae = t4; + }, la: le, z: function(t4, e3, n2, r3) { + return le(t4, e3, n2, r3); } }; !function() { - function t3(t4, e4) { - s.asm = t4.exports, dt.qc.push(s.asm.sb), W = s.asm.ub, Y.unshift(s.asm.Va), k = e4, x || (et--, s.monitorRunDependencies && s.monitorRunDependencies(et), 0 == et && (null !== nt && (clearInterval(nt), nt = null), rt && (t4 = rt, rt = null, t4()))); + function t4(t5, e4) { + s.asm = t5.exports, dt.qc.push(s.asm.sb), W = s.asm.ub, Y.unshift(s.asm.Va), k = e4, x || (et--, s.monitorRunDependencies && s.monitorRunDependencies(et), 0 == et && (null !== nt && (clearInterval(nt), nt = null), rt && (t5 = rt, rt = null, t5()))); } function e3(e4) { - t3(e4.instance, e4.module); + t4(e4.instance, e4.module); } - function n2(t4) { + function n2(t5) { return function() { if (!E && (_ || v)) { if ("function" == typeof fetch && !tt.startsWith("file://")) - return fetch(tt, { credentials: "same-origin" }).then(function(t5) { - if (!t5.ok) + return fetch(tt, { credentials: "same-origin" }).then(function(t6) { + if (!t6.ok) throw "failed to load wasm binary file at '" + tt + "'"; - return t5.arrayBuffer(); + return t6.arrayBuffer(); }).catch(function() { return at(); }); if (p) - return new Promise(function(t5, e4) { + return new Promise(function(t6, e4) { p(tt, function(e5) { - t5(new Uint8Array(e5)); + t6(new Uint8Array(e5)); }, e4); }); } return Promise.resolve().then(function() { return at(); }); - }().then(function(t5) { - return WebAssembly.instantiate(t5, r3); - }).then(function(t5) { - return t5; - }).then(t4, function(t5) { - P("failed to asynchronously prepare wasm: " + t5), it(t5); + }().then(function(t6) { + return WebAssembly.instantiate(t6, r3); + }).then(function(t6) { + return t6; + }).then(t5, function(t6) { + P("failed to asynchronously prepare wasm: " + t6), it(t6); }); } var r3 = { a: fe }; if (x || (et++, s.monitorRunDependencies && s.monitorRunDependencies(et)), s.instantiateWasm) try { - return s.instantiateWasm(r3, t3); - } catch (t4) { - return P("Module.instantiateWasm callback failed with error: " + t4), false; + return s.instantiateWasm(r3, t4); + } catch (t5) { + return P("Module.instantiateWasm callback failed with error: " + t5), false; } - (E || "function" != typeof WebAssembly.instantiateStreaming || ot() || tt.startsWith("file://") || w || "function" != typeof fetch ? n2(e3) : fetch(tt, { credentials: "same-origin" }).then(function(t4) { - return WebAssembly.instantiateStreaming(t4, r3).then(e3, function(t5) { - return P("wasm streaming compile failed: " + t5), P("falling back to ArrayBuffer instantiation"), n2(e3); + (E || "function" != typeof WebAssembly.instantiateStreaming || ot() || tt.startsWith("file://") || w || "function" != typeof fetch ? n2(e3) : fetch(tt, { credentials: "same-origin" }).then(function(t5) { + return WebAssembly.instantiateStreaming(t5, r3).then(e3, function(t6) { + return P("wasm streaming compile failed: " + t6), P("falling back to ArrayBuffer instantiation"), n2(e3); }); })).catch(c); }(), s.___wasm_call_ctors = function() { @@ -2429,12 +3114,12 @@ var require_ort_web_node = __commonJS({ return (Ue = s.dynCall_iiij = s.asm.Rb).apply(null, arguments); }; function Ve() { - function t3() { + function t4() { if (!_e && (_e = true, s.calledRun = true, !j) && (x || ht(Y), u(s), s.onRuntimeInitialized && s.onRuntimeInitialized(), !x)) { if (s.postRun) for ("function" == typeof s.postRun && (s.postRun = [s.postRun]); s.postRun.length; ) { - var t4 = s.postRun.shift(); - Z.unshift(t4); + var t5 = s.postRun.shift(); + Z.unshift(t5); } ht(Z); } @@ -2449,57 +3134,57 @@ var require_ort_web_node = __commonJS({ ht(X), 0 < et || (s.setStatus ? (s.setStatus("Running..."), setTimeout(function() { setTimeout(function() { s.setStatus(""); - }, 1), t3(); - }, 1)) : t3()); + }, 1), t4(); + }, 1)) : t4()); } } - if (s.UTF8ToString = B, s.stringToUTF8 = function(t3, e3, n2) { - return z(t3, r2(), e3, n2); - }, s.lengthBytesUTF8 = G, s.keepRuntimeAlive = J, s.wasmMemory = $, s.stackSave = Ae, s.stackRestore = Ee, s.stackAlloc = Ie, s.ExitStatus = ut, s.PThread = dt, rt = function t3() { - _e || Ve(), _e || (rt = t3); + if (s.UTF8ToString = B, s.stringToUTF8 = function(t4, e3, n2) { + return z(t4, r2(), e3, n2); + }, s.lengthBytesUTF8 = G, s.keepRuntimeAlive = J, s.wasmMemory = $, s.stackSave = Ae, s.stackRestore = Ee, s.stackAlloc = Ie, s.ExitStatus = ut, s.PThread = dt, rt = function t4() { + _e || Ve(), _e || (rt = t4); }, s.preInit) for ("function" == typeof s.preInit && (s.preInit = [s.preInit]); 0 < s.preInit.length; ) s.preInit.pop()(); - return Ve(), t2.ready; + return Ve(), t3.ready; }); - t.exports = r; - }, 932: (t, e, n) => { - var _scriptDir, r = (_scriptDir = (_scriptDir = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || __filename, function(t2) { + t2.exports = r; + }, 932: (t2, e, n) => { + var _scriptDir, r = (_scriptDir = (_scriptDir = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || __filename, function(t3) { var e2, r2, i2; - t2 = t2 || {}, e2 || (e2 = void 0 !== t2 ? t2 : {}), e2.ready = new Promise(function(t3, e3) { - r2 = t3, i2 = e3; + t3 = t3 || {}, e2 || (e2 = void 0 !== t3 ? t3 : {}), e2.ready = new Promise(function(t4, e3) { + r2 = t4, i2 = e3; }); - var o, a, s, u, c, l, p = Object.assign({}, e2), f = "./this.program", d = (t3, e3) => { + var o, a, s, u, c, l, p = Object.assign({}, e2), f = "./this.program", d = (t4, e3) => { throw e3; }, h = "object" == typeof window, g = "function" == typeof importScripts, b = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, m = ""; b ? (m = g ? n(1423).dirname(m) + "/" : __dirname + "/", l = () => { c || (u = n(6231), c = n(1423)); - }, o = function(t3, e3) { - return l(), t3 = c.normalize(t3), u.readFileSync(t3, e3 ? void 0 : "utf8"); - }, s = (t3) => ((t3 = o(t3, true)).buffer || (t3 = new Uint8Array(t3)), t3), a = (t3, e3, n2) => { - l(), t3 = c.normalize(t3), u.readFile(t3, function(t4, r3) { - t4 ? n2(t4) : e3(r3.buffer); + }, o = function(t4, e3) { + return l(), t4 = c.normalize(t4), u.readFileSync(t4, e3 ? void 0 : "utf8"); + }, s = (t4) => ((t4 = o(t4, true)).buffer || (t4 = new Uint8Array(t4)), t4), a = (t4, e3, n2) => { + l(), t4 = c.normalize(t4), u.readFile(t4, function(t5, r3) { + t5 ? n2(t5) : e3(r3.buffer); }); - }, 1 < process.argv.length && (f = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), process.on("uncaughtException", function(t3) { - if (!(t3 instanceof K)) - throw t3; - }), process.on("unhandledRejection", function(t3) { - throw t3; - }), d = (t3, e3) => { + }, 1 < process.argv.length && (f = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), process.on("uncaughtException", function(t4) { + if (!(t4 instanceof K)) + throw t4; + }), process.on("unhandledRejection", function(t4) { + throw t4; + }), d = (t4, e3) => { if (w || 0 < U) - throw process.exitCode = t3, e3; - e3 instanceof K || v("exiting due to exception: " + e3), process.exit(t3); + throw process.exitCode = t4, e3; + e3 instanceof K || v("exiting due to exception: " + e3), process.exit(t4); }, e2.inspect = function() { return "[Emscripten Module object]"; - }) : (h || g) && (g ? m = self.location.href : "undefined" != typeof document && document.currentScript && (m = document.currentScript.src), _scriptDir && (m = _scriptDir), m = 0 !== m.indexOf("blob:") ? m.substr(0, m.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", o = (t3) => { + }) : (h || g) && (g ? m = self.location.href : "undefined" != typeof document && document.currentScript && (m = document.currentScript.src), _scriptDir && (m = _scriptDir), m = 0 !== m.indexOf("blob:") ? m.substr(0, m.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", o = (t4) => { var e3 = new XMLHttpRequest(); - return e3.open("GET", t3, false), e3.send(null), e3.responseText; - }, g && (s = (t3) => { + return e3.open("GET", t4, false), e3.send(null), e3.responseText; + }, g && (s = (t4) => { var e3 = new XMLHttpRequest(); - return e3.open("GET", t3, false), e3.responseType = "arraybuffer", e3.send(null), new Uint8Array(e3.response); - }), a = (t3, e3, n2) => { + return e3.open("GET", t4, false), e3.responseType = "arraybuffer", e3.send(null), new Uint8Array(e3.response); + }), a = (t4, e3, n2) => { var r3 = new XMLHttpRequest(); - r3.open("GET", t3, true), r3.responseType = "arraybuffer", r3.onload = () => { + r3.open("GET", t4, true), r3.responseType = "arraybuffer", r3.onload = () => { 200 == r3.status || 0 == r3.status && r3.response ? e3(r3.response) : n2(); }, r3.onerror = n2, r3.send(null); }); @@ -2508,38 +3193,38 @@ var require_ort_web_node = __commonJS({ var w = e2.noExitRuntime || false; "object" != typeof WebAssembly && q("no native wasm support detected"); var x, T, S, O, A, E, I = false, P = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0; - function D(t3, e3, n2) { + function D(t4, e3, n2) { var r3 = (e3 >>>= 0) + n2; - for (n2 = e3; t3[n2] && !(n2 >= r3); ) + for (n2 = e3; t4[n2] && !(n2 >= r3); ) ++n2; - if (16 < n2 - e3 && t3.buffer && P) - return P.decode(t3.subarray(e3, n2)); + if (16 < n2 - e3 && t4.buffer && P) + return P.decode(t4.subarray(e3, n2)); for (r3 = ""; e3 < n2; ) { - var i3 = t3[e3++]; + var i3 = t4[e3++]; if (128 & i3) { - var o2 = 63 & t3[e3++]; + var o2 = 63 & t4[e3++]; if (192 == (224 & i3)) r3 += String.fromCharCode((31 & i3) << 6 | o2); else { - var a2 = 63 & t3[e3++]; - 65536 > (i3 = 224 == (240 & i3) ? (15 & i3) << 12 | o2 << 6 | a2 : (7 & i3) << 18 | o2 << 12 | a2 << 6 | 63 & t3[e3++]) ? r3 += String.fromCharCode(i3) : (i3 -= 65536, r3 += String.fromCharCode(55296 | i3 >> 10, 56320 | 1023 & i3)); + var a2 = 63 & t4[e3++]; + 65536 > (i3 = 224 == (240 & i3) ? (15 & i3) << 12 | o2 << 6 | a2 : (7 & i3) << 18 | o2 << 12 | a2 << 6 | 63 & t4[e3++]) ? r3 += String.fromCharCode(i3) : (i3 -= 65536, r3 += String.fromCharCode(55296 | i3 >> 10, 56320 | 1023 & i3)); } } else r3 += String.fromCharCode(i3); } return r3; } - function $(t3, e3) { - return (t3 >>>= 0) ? D(O, t3, e3) : ""; + function $(t4, e3) { + return (t4 >>>= 0) ? D(O, t4, e3) : ""; } - function k(t3, e3, n2, r3) { + function k(t4, e3, n2, r3) { if (!(0 < r3)) return 0; var i3 = n2 >>>= 0; r3 = n2 + r3 - 1; - for (var o2 = 0; o2 < t3.length; ++o2) { - var a2 = t3.charCodeAt(o2); - if (55296 <= a2 && 57343 >= a2 && (a2 = 65536 + ((1023 & a2) << 10) | 1023 & t3.charCodeAt(++o2)), 127 >= a2) { + for (var o2 = 0; o2 < t4.length; ++o2) { + var a2 = t4.charCodeAt(o2); + if (55296 <= a2 && 57343 >= a2 && (a2 = 65536 + ((1023 & a2) << 10) | 1023 & t4.charCodeAt(++o2)), 127 >= a2) { if (n2 >= r3) break; e3[n2++ >>> 0] = a2; @@ -2565,25 +3250,25 @@ var require_ort_web_node = __commonJS({ } return e3[n2 >>> 0] = 0, n2 - i3; } - function C(t3) { - for (var e3 = 0, n2 = 0; n2 < t3.length; ++n2) { - var r3 = t3.charCodeAt(n2); + function C(t4) { + for (var e3 = 0, n2 = 0; n2 < t4.length; ++n2) { + var r3 = t4.charCodeAt(n2); 127 >= r3 ? e3++ : 2047 >= r3 ? e3 += 2 : 55296 <= r3 && 57343 >= r3 ? (e3 += 4, ++n2) : e3 += 3; } return e3; } function F() { - var t3 = x.buffer; - T = t3, e2.HEAP8 = S = new Int8Array(t3), e2.HEAP16 = new Int16Array(t3), e2.HEAP32 = A = new Int32Array(t3), e2.HEAPU8 = O = new Uint8Array(t3), e2.HEAPU16 = new Uint16Array(t3), e2.HEAPU32 = E = new Uint32Array(t3), e2.HEAPF32 = new Float32Array(t3), e2.HEAPF64 = new Float64Array(t3); + var t4 = x.buffer; + T = t4, e2.HEAP8 = S = new Int8Array(t4), e2.HEAP16 = new Int16Array(t4), e2.HEAP32 = A = new Int32Array(t4), e2.HEAPU8 = O = new Uint8Array(t4), e2.HEAPU16 = new Uint16Array(t4), e2.HEAPU32 = E = new Uint32Array(t4), e2.HEAPF32 = new Float32Array(t4), e2.HEAPF64 = new Float64Array(t4); } var N, R = [], L = [], M = [], j = [], U = 0; function V() { - var t3 = e2.preRun.shift(); - R.unshift(t3); + var t4 = e2.preRun.shift(); + R.unshift(t4); } var B, z = 0, G = null, H = null; - function q(t3) { - throw e2.onAbort && e2.onAbort(t3), v(t3 = "Aborted(" + t3 + ")"), I = true, t3 = new WebAssembly.RuntimeError(t3 + ". Build with -sASSERTIONS for more info."), i2(t3), t3; + function q(t4) { + throw e2.onAbort && e2.onAbort(t4), v(t4 = "Aborted(" + t4 + ")"), I = true, t4 = new WebAssembly.RuntimeError(t4 + ". Build with -sASSERTIONS for more info."), i2(t4), t4; } function W() { return B.startsWith("data:application/octet-stream;base64,"); @@ -2593,297 +3278,297 @@ var require_ort_web_node = __commonJS({ B = e2.locateFile ? e2.locateFile(X, m) : m + X; } function Y() { - var t3 = B; + var t4 = B; try { - if (t3 == B && y) + if (t4 == B && y) return new Uint8Array(y); if (s) - return s(t3); + return s(t4); throw "both async and sync fetching of the wasm failed"; - } catch (t4) { - q(t4); + } catch (t5) { + q(t5); } } - function K(t3) { - this.name = "ExitStatus", this.message = "Program terminated with exit(" + t3 + ")", this.status = t3; + function K(t4) { + this.name = "ExitStatus", this.message = "Program terminated with exit(" + t4 + ")", this.status = t4; } - function Z(t3) { - for (; 0 < t3.length; ) - t3.shift()(e2); + function Z(t4) { + for (; 0 < t4.length; ) + t4.shift()(e2); } var J = [], Q = 0, tt = 0; - function et(t3) { - this.Db = t3, this.zb = t3 - 24, this.Ub = function(t4) { - E[this.zb + 4 >> 2 >>> 0] = t4; + function et(t4) { + this.Db = t4, this.zb = t4 - 24, this.Ub = function(t5) { + E[this.zb + 4 >> 2 >>> 0] = t5; }, this.Eb = function() { return E[this.zb + 4 >> 2 >>> 0]; - }, this.Sb = function(t4) { - E[this.zb + 8 >> 2 >>> 0] = t4; + }, this.Sb = function(t5) { + E[this.zb + 8 >> 2 >>> 0] = t5; }, this.Wb = function() { return E[this.zb + 8 >> 2 >>> 0]; }, this.Tb = function() { A[this.zb >> 2 >>> 0] = 0; - }, this.Ib = function(t4) { - S[this.zb + 12 >> 0 >>> 0] = t4 ? 1 : 0; + }, this.Ib = function(t5) { + S[this.zb + 12 >> 0 >>> 0] = t5 ? 1 : 0; }, this.Pb = function() { return 0 != S[this.zb + 12 >> 0 >>> 0]; - }, this.Jb = function(t4) { - S[this.zb + 13 >> 0 >>> 0] = t4 ? 1 : 0; + }, this.Jb = function(t5) { + S[this.zb + 13 >> 0 >>> 0] = t5 ? 1 : 0; }, this.Lb = function() { return 0 != S[this.zb + 13 >> 0 >>> 0]; - }, this.Rb = function(t4, e3) { - this.Fb(0), this.Ub(t4), this.Sb(e3), this.Tb(), this.Ib(false), this.Jb(false); + }, this.Rb = function(t5, e3) { + this.Fb(0), this.Ub(t5), this.Sb(e3), this.Tb(), this.Ib(false), this.Jb(false); }, this.Nb = function() { A[this.zb >> 2 >>> 0] += 1; }, this.Xb = function() { - var t4 = A[this.zb >> 2 >>> 0]; - return A[this.zb >> 2 >>> 0] = t4 - 1, 1 === t4; - }, this.Fb = function(t4) { - E[this.zb + 16 >> 2 >>> 0] = t4; + var t5 = A[this.zb >> 2 >>> 0]; + return A[this.zb >> 2 >>> 0] = t5 - 1, 1 === t5; + }, this.Fb = function(t5) { + E[this.zb + 16 >> 2 >>> 0] = t5; }, this.Ob = function() { return E[this.zb + 16 >> 2 >>> 0]; }, this.Qb = function() { if (Et(this.Eb())) return E[this.Db >> 2 >>> 0]; - var t4 = this.Ob(); - return 0 !== t4 ? t4 : this.Db; + var t5 = this.Ob(); + return 0 !== t5 ? t5 : this.Db; }; } - function nt(t3) { - return _t(new et(t3).zb); + function nt(t4) { + return _t(new et(t4).zb); } var rt = []; - function it(t3) { - var e3 = rt[t3]; - return e3 || (t3 >= rt.length && (rt.length = t3 + 1), rt[t3] = e3 = N.get(t3)), e3; + function it(t4) { + var e3 = rt[t4]; + return e3 || (t4 >= rt.length && (rt.length = t4 + 1), rt[t4] = e3 = N.get(t4)), e3; } - function ot(t3) { - var e3 = C(t3) + 1, n2 = yt(e3); - return n2 && k(t3, S, n2, e3), n2; + function ot(t4) { + var e3 = C(t4) + 1, n2 = yt(e3); + return n2 && k(t4, S, n2, e3), n2; } var at = {}; function st() { if (!ut) { - var t3, e3 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: f || "./this.program" }; - for (t3 in at) - void 0 === at[t3] ? delete e3[t3] : e3[t3] = at[t3]; + var t4, e3 = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: f || "./this.program" }; + for (t4 in at) + void 0 === at[t4] ? delete e3[t4] : e3[t4] = at[t4]; var n2 = []; - for (t3 in e3) - n2.push(t3 + "=" + e3[t3]); + for (t4 in e3) + n2.push(t4 + "=" + e3[t4]); ut = n2; } return ut; } var ut, ct = [null, [], []]; - function lt(t3, e3) { - var n2 = ct[t3]; - 0 === e3 || 10 === e3 ? ((1 === t3 ? _ : v)(D(n2, 0)), n2.length = 0) : n2.push(e3); + function lt(t4, e3) { + var n2 = ct[t4]; + 0 === e3 || 10 === e3 ? ((1 === t4 ? _ : v)(D(n2, 0)), n2.length = 0) : n2.push(e3); } var pt = 0; - function ft(t3) { - return 0 == t3 % 4 && (0 != t3 % 100 || 0 == t3 % 400); + function ft(t4) { + return 0 == t4 % 4 && (0 != t4 % 100 || 0 == t4 % 400); } var dt = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ht = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function gt(t3, e3, n2, r3) { - function i3(t4, e4, n3) { - for (t4 = "number" == typeof t4 ? t4.toString() : t4 || ""; t4.length < e4; ) - t4 = n3[0] + t4; - return t4; + function gt(t4, e3, n2, r3) { + function i3(t5, e4, n3) { + for (t5 = "number" == typeof t5 ? t5.toString() : t5 || ""; t5.length < e4; ) + t5 = n3[0] + t5; + return t5; } - function o2(t4, e4) { - return i3(t4, e4, "0"); + function o2(t5, e4) { + return i3(t5, e4, "0"); } - function a2(t4, e4) { - function n3(t5) { - return 0 > t5 ? -1 : 0 < t5 ? 1 : 0; + function a2(t5, e4) { + function n3(t6) { + return 0 > t6 ? -1 : 0 < t6 ? 1 : 0; } var r4; - return 0 === (r4 = n3(t4.getFullYear() - e4.getFullYear())) && 0 === (r4 = n3(t4.getMonth() - e4.getMonth())) && (r4 = n3(t4.getDate() - e4.getDate())), r4; + return 0 === (r4 = n3(t5.getFullYear() - e4.getFullYear())) && 0 === (r4 = n3(t5.getMonth() - e4.getMonth())) && (r4 = n3(t5.getDate() - e4.getDate())), r4; } - function s2(t4) { - switch (t4.getDay()) { + function s2(t5) { + switch (t5.getDay()) { case 0: - return new Date(t4.getFullYear() - 1, 11, 29); + return new Date(t5.getFullYear() - 1, 11, 29); case 1: - return t4; + return t5; case 2: - return new Date(t4.getFullYear(), 0, 3); + return new Date(t5.getFullYear(), 0, 3); case 3: - return new Date(t4.getFullYear(), 0, 2); + return new Date(t5.getFullYear(), 0, 2); case 4: - return new Date(t4.getFullYear(), 0, 1); + return new Date(t5.getFullYear(), 0, 1); case 5: - return new Date(t4.getFullYear() - 1, 11, 31); + return new Date(t5.getFullYear() - 1, 11, 31); case 6: - return new Date(t4.getFullYear() - 1, 11, 30); + return new Date(t5.getFullYear() - 1, 11, 30); } } - function u2(t4) { - var e4 = t4.Bb; - for (t4 = new Date(new Date(t4.Cb + 1900, 0, 1).getTime()); 0 < e4; ) { - var n3 = t4.getMonth(), r4 = (ft(t4.getFullYear()) ? dt : ht)[n3]; - if (!(e4 > r4 - t4.getDate())) { - t4.setDate(t4.getDate() + e4); + function u2(t5) { + var e4 = t5.Bb; + for (t5 = new Date(new Date(t5.Cb + 1900, 0, 1).getTime()); 0 < e4; ) { + var n3 = t5.getMonth(), r4 = (ft(t5.getFullYear()) ? dt : ht)[n3]; + if (!(e4 > r4 - t5.getDate())) { + t5.setDate(t5.getDate() + e4); break; } - e4 -= r4 - t4.getDate() + 1, t4.setDate(1), 11 > n3 ? t4.setMonth(n3 + 1) : (t4.setMonth(0), t4.setFullYear(t4.getFullYear() + 1)); + e4 -= r4 - t5.getDate() + 1, t5.setDate(1), 11 > n3 ? t5.setMonth(n3 + 1) : (t5.setMonth(0), t5.setFullYear(t5.getFullYear() + 1)); } - return n3 = new Date(t4.getFullYear() + 1, 0, 4), e4 = s2(new Date(t4.getFullYear(), 0, 4)), n3 = s2(n3), 0 >= a2(e4, t4) ? 0 >= a2(n3, t4) ? t4.getFullYear() + 1 : t4.getFullYear() : t4.getFullYear() - 1; + return n3 = new Date(t5.getFullYear() + 1, 0, 4), e4 = s2(new Date(t5.getFullYear(), 0, 4)), n3 = s2(n3), 0 >= a2(e4, t5) ? 0 >= a2(n3, t5) ? t5.getFullYear() + 1 : t5.getFullYear() : t5.getFullYear() - 1; } var c2 = A[r3 + 40 >> 2 >>> 0]; for (var l2 in r3 = { $b: A[r3 >> 2 >>> 0], Zb: A[r3 + 4 >> 2 >>> 0], Gb: A[r3 + 8 >> 2 >>> 0], Kb: A[r3 + 12 >> 2 >>> 0], Hb: A[r3 + 16 >> 2 >>> 0], Cb: A[r3 + 20 >> 2 >>> 0], Ab: A[r3 + 24 >> 2 >>> 0], Bb: A[r3 + 28 >> 2 >>> 0], bc: A[r3 + 32 >> 2 >>> 0], Yb: A[r3 + 36 >> 2 >>> 0], ac: c2 ? $(c2) : "" }, n2 = $(n2), c2 = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" }) n2 = n2.replace(new RegExp(l2, "g"), c2[l2]); var p2 = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), f2 = "January February March April May June July August September October November December".split(" "); - for (l2 in c2 = { "%a": function(t4) { - return p2[t4.Ab].substring(0, 3); - }, "%A": function(t4) { - return p2[t4.Ab]; - }, "%b": function(t4) { - return f2[t4.Hb].substring(0, 3); - }, "%B": function(t4) { - return f2[t4.Hb]; - }, "%C": function(t4) { - return o2((t4.Cb + 1900) / 100 | 0, 2); - }, "%d": function(t4) { - return o2(t4.Kb, 2); - }, "%e": function(t4) { - return i3(t4.Kb, 2, " "); - }, "%g": function(t4) { - return u2(t4).toString().substring(2); - }, "%G": function(t4) { - return u2(t4); - }, "%H": function(t4) { - return o2(t4.Gb, 2); - }, "%I": function(t4) { - return 0 == (t4 = t4.Gb) ? t4 = 12 : 12 < t4 && (t4 -= 12), o2(t4, 2); - }, "%j": function(t4) { - for (var e4 = 0, n3 = 0; n3 <= t4.Hb - 1; e4 += (ft(t4.Cb + 1900) ? dt : ht)[n3++]) + for (l2 in c2 = { "%a": function(t5) { + return p2[t5.Ab].substring(0, 3); + }, "%A": function(t5) { + return p2[t5.Ab]; + }, "%b": function(t5) { + return f2[t5.Hb].substring(0, 3); + }, "%B": function(t5) { + return f2[t5.Hb]; + }, "%C": function(t5) { + return o2((t5.Cb + 1900) / 100 | 0, 2); + }, "%d": function(t5) { + return o2(t5.Kb, 2); + }, "%e": function(t5) { + return i3(t5.Kb, 2, " "); + }, "%g": function(t5) { + return u2(t5).toString().substring(2); + }, "%G": function(t5) { + return u2(t5); + }, "%H": function(t5) { + return o2(t5.Gb, 2); + }, "%I": function(t5) { + return 0 == (t5 = t5.Gb) ? t5 = 12 : 12 < t5 && (t5 -= 12), o2(t5, 2); + }, "%j": function(t5) { + for (var e4 = 0, n3 = 0; n3 <= t5.Hb - 1; e4 += (ft(t5.Cb + 1900) ? dt : ht)[n3++]) ; - return o2(t4.Kb + e4, 3); - }, "%m": function(t4) { - return o2(t4.Hb + 1, 2); - }, "%M": function(t4) { - return o2(t4.Zb, 2); + return o2(t5.Kb + e4, 3); + }, "%m": function(t5) { + return o2(t5.Hb + 1, 2); + }, "%M": function(t5) { + return o2(t5.Zb, 2); }, "%n": function() { return "\n"; - }, "%p": function(t4) { - return 0 <= t4.Gb && 12 > t4.Gb ? "AM" : "PM"; - }, "%S": function(t4) { - return o2(t4.$b, 2); + }, "%p": function(t5) { + return 0 <= t5.Gb && 12 > t5.Gb ? "AM" : "PM"; + }, "%S": function(t5) { + return o2(t5.$b, 2); }, "%t": function() { return " "; - }, "%u": function(t4) { - return t4.Ab || 7; - }, "%U": function(t4) { - return o2(Math.floor((t4.Bb + 7 - t4.Ab) / 7), 2); - }, "%V": function(t4) { - var e4 = Math.floor((t4.Bb + 7 - (t4.Ab + 6) % 7) / 7); - if (2 >= (t4.Ab + 371 - t4.Bb - 2) % 7 && e4++, e4) - 53 == e4 && (4 == (n3 = (t4.Ab + 371 - t4.Bb) % 7) || 3 == n3 && ft(t4.Cb) || (e4 = 1)); + }, "%u": function(t5) { + return t5.Ab || 7; + }, "%U": function(t5) { + return o2(Math.floor((t5.Bb + 7 - t5.Ab) / 7), 2); + }, "%V": function(t5) { + var e4 = Math.floor((t5.Bb + 7 - (t5.Ab + 6) % 7) / 7); + if (2 >= (t5.Ab + 371 - t5.Bb - 2) % 7 && e4++, e4) + 53 == e4 && (4 == (n3 = (t5.Ab + 371 - t5.Bb) % 7) || 3 == n3 && ft(t5.Cb) || (e4 = 1)); else { e4 = 52; - var n3 = (t4.Ab + 7 - t4.Bb - 1) % 7; - (4 == n3 || 5 == n3 && ft(t4.Cb % 400 - 1)) && e4++; + var n3 = (t5.Ab + 7 - t5.Bb - 1) % 7; + (4 == n3 || 5 == n3 && ft(t5.Cb % 400 - 1)) && e4++; } return o2(e4, 2); - }, "%w": function(t4) { - return t4.Ab; - }, "%W": function(t4) { - return o2(Math.floor((t4.Bb + 7 - (t4.Ab + 6) % 7) / 7), 2); - }, "%y": function(t4) { - return (t4.Cb + 1900).toString().substring(2); - }, "%Y": function(t4) { - return t4.Cb + 1900; - }, "%z": function(t4) { - var e4 = 0 <= (t4 = t4.Yb); - return t4 = Math.abs(t4) / 60, (e4 ? "+" : "-") + String("0000" + (t4 / 60 * 100 + t4 % 60)).slice(-4); - }, "%Z": function(t4) { - return t4.ac; + }, "%w": function(t5) { + return t5.Ab; + }, "%W": function(t5) { + return o2(Math.floor((t5.Bb + 7 - (t5.Ab + 6) % 7) / 7), 2); + }, "%y": function(t5) { + return (t5.Cb + 1900).toString().substring(2); + }, "%Y": function(t5) { + return t5.Cb + 1900; + }, "%z": function(t5) { + var e4 = 0 <= (t5 = t5.Yb); + return t5 = Math.abs(t5) / 60, (e4 ? "+" : "-") + String("0000" + (t5 / 60 * 100 + t5 % 60)).slice(-4); + }, "%Z": function(t5) { + return t5.ac; }, "%%": function() { return "%"; } }, n2 = n2.replace(/%%/g, "\0\0"), c2) n2.includes(l2) && (n2 = n2.replace(new RegExp(l2, "g"), c2[l2](r3))); - return l2 = function(t4) { - var e4 = Array(C(t4) + 1); - return k(t4, e4, 0, e4.length), e4; - }(n2 = n2.replace(/\0\0/g, "%")), l2.length > e3 ? 0 : (S.set(l2, t3 >>> 0), l2.length - 1); + return l2 = function(t5) { + var e4 = Array(C(t5) + 1); + return k(t5, e4, 0, e4.length), e4; + }(n2 = n2.replace(/\0\0/g, "%")), l2.length > e3 ? 0 : (S.set(l2, t4 >>> 0), l2.length - 1); } - var bt = { a: function(t3) { - return yt(t3 + 24) + 24; - }, m: function(t3) { - return (t3 = new et(t3)).Pb() || (t3.Ib(true), Q--), t3.Jb(false), J.push(t3), t3.Nb(), t3.Qb(); - }, ia: function(t3) { - throw v("Unexpected exception thrown, this is not properly supported - aborting"), I = true, t3; + var bt = { a: function(t4) { + return yt(t4 + 24) + 24; + }, m: function(t4) { + return (t4 = new et(t4)).Pb() || (t4.Ib(true), Q--), t4.Jb(false), J.push(t4), t4.Nb(), t4.Qb(); + }, ia: function(t4) { + throw v("Unexpected exception thrown, this is not properly supported - aborting"), I = true, t4; }, w: function() { xt(0); - var t3 = J.pop(); - if (t3.Xb() && !t3.Lb()) { - var e3 = t3.Wb(); - e3 && it(e3)(t3.Db), nt(t3.Db); + var t4 = J.pop(); + if (t4.Xb() && !t4.Lb()) { + var e3 = t4.Wb(); + e3 && it(e3)(t4.Db), nt(t4.Db); } tt = 0; }, d: function() { - var t3 = tt; - if (!t3) + var t4 = tt; + if (!t4) return pt = 0; - var e3 = new et(t3); - e3.Fb(t3); + var e3 = new et(t4); + e3.Fb(t4); var n2 = e3.Eb(); if (!n2) - return pt = 0, t3; + return pt = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (At(o2, n2, e3.zb + 16)) - return pt = o2, t3; + return pt = o2, t4; } - return pt = n2, t3; + return pt = n2, t4; }, k: function() { - var t3 = tt; - if (!t3) + var t4 = tt; + if (!t4) return pt = 0; - var e3 = new et(t3); - e3.Fb(t3); + var e3 = new et(t4); + e3.Fb(t4); var n2 = e3.Eb(); if (!n2) - return pt = 0, t3; + return pt = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (At(o2, n2, e3.zb + 16)) - return pt = o2, t3; + return pt = o2, t4; } - return pt = n2, t3; + return pt = n2, t4; }, g: function() { - var t3 = tt; - if (!t3) + var t4 = tt; + if (!t4) return pt = 0; - var e3 = new et(t3); - e3.Fb(t3); + var e3 = new et(t4); + e3.Fb(t4); var n2 = e3.Eb(); if (!n2) - return pt = 0, t3; + return pt = 0, t4; for (var r3 = Array.prototype.slice.call(arguments), i3 = 0; i3 < r3.length; i3++) { var o2 = r3[i3]; if (0 === o2 || o2 === n2) break; if (At(o2, n2, e3.zb + 16)) - return pt = o2, t3; + return pt = o2, t4; } - return pt = n2, t3; + return pt = n2, t4; }, s: nt, L: function() { - var t3 = J.pop(); - t3 || q("no exception to throw"); - var e3 = t3.Db; - throw t3.Lb() || (J.push(t3), t3.Jb(true), t3.Ib(false), Q++), tt = e3, e3; - }, b: function(t3, e3, n2) { - throw new et(t3).Rb(e3, n2), tt = t3, Q++, t3; + var t4 = J.pop(); + t4 || q("no exception to throw"); + var e3 = t4.Db; + throw t4.Lb() || (J.push(t4), t4.Jb(true), t4.Ib(false), Q++), tt = e3, e3; + }, b: function(t4, e3, n2) { + throw new et(t4).Rb(e3, n2), tt = t4, Q++, t4; }, la: function() { return Q; - }, i: function(t3) { - throw tt || (tt = t3), t3; + }, i: function(t4) { + throw tt || (tt = t4), t4; }, H: function() { return 0; }, Ba: function() { @@ -2908,54 +3593,54 @@ var require_ort_web_node = __commonJS({ return Date.now(); }, Ca: function() { return true; - }, Da: function(t3, e3) { - t3 = new Date(1e3 * (E[t3 >>> 2] + 4294967296 * A[t3 + 4 >>> 2])), A[e3 >> 2 >>> 0] = t3.getUTCSeconds(), A[e3 + 4 >> 2 >>> 0] = t3.getUTCMinutes(), A[e3 + 8 >> 2 >>> 0] = t3.getUTCHours(), A[e3 + 12 >> 2 >>> 0] = t3.getUTCDate(), A[e3 + 16 >> 2 >>> 0] = t3.getUTCMonth(), A[e3 + 20 >> 2 >>> 0] = t3.getUTCFullYear() - 1900, A[e3 + 24 >> 2 >>> 0] = t3.getUTCDay(), A[e3 + 28 >> 2 >>> 0] = (t3.getTime() - Date.UTC(t3.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5 | 0; - }, Ea: function(t3, e3) { - t3 = new Date(1e3 * (E[t3 >>> 2] + 4294967296 * A[t3 + 4 >>> 2])), A[e3 >> 2 >>> 0] = t3.getSeconds(), A[e3 + 4 >> 2 >>> 0] = t3.getMinutes(), A[e3 + 8 >> 2 >>> 0] = t3.getHours(), A[e3 + 12 >> 2 >>> 0] = t3.getDate(), A[e3 + 16 >> 2 >>> 0] = t3.getMonth(), A[e3 + 20 >> 2 >>> 0] = t3.getFullYear() - 1900, A[e3 + 24 >> 2 >>> 0] = t3.getDay(); - var n2 = new Date(t3.getFullYear(), 0, 1); - A[e3 + 28 >> 2 >>> 0] = (t3.getTime() - n2.getTime()) / 864e5 | 0, A[e3 + 36 >> 2 >>> 0] = -60 * t3.getTimezoneOffset(); - var r3 = new Date(t3.getFullYear(), 6, 1).getTimezoneOffset(); - n2 = n2.getTimezoneOffset(), A[e3 + 32 >> 2 >>> 0] = 0 | (r3 != n2 && t3.getTimezoneOffset() == Math.min(n2, r3)); - }, Fa: function(t3) { - var e3 = new Date(A[t3 + 20 >> 2 >>> 0] + 1900, A[t3 + 16 >> 2 >>> 0], A[t3 + 12 >> 2 >>> 0], A[t3 + 8 >> 2 >>> 0], A[t3 + 4 >> 2 >>> 0], A[t3 >> 2 >>> 0], 0), n2 = A[t3 + 32 >> 2 >>> 0], r3 = e3.getTimezoneOffset(), i3 = new Date(e3.getFullYear(), 0, 1), o2 = new Date(e3.getFullYear(), 6, 1).getTimezoneOffset(), a2 = i3.getTimezoneOffset(), s2 = Math.min(a2, o2); - return 0 > n2 ? A[t3 + 32 >> 2 >>> 0] = Number(o2 != a2 && s2 == r3) : 0 < n2 != (s2 == r3) && (o2 = Math.max(a2, o2), e3.setTime(e3.getTime() + 6e4 * ((0 < n2 ? s2 : o2) - r3))), A[t3 + 24 >> 2 >>> 0] = e3.getDay(), A[t3 + 28 >> 2 >>> 0] = (e3.getTime() - i3.getTime()) / 864e5 | 0, A[t3 >> 2 >>> 0] = e3.getSeconds(), A[t3 + 4 >> 2 >>> 0] = e3.getMinutes(), A[t3 + 8 >> 2 >>> 0] = e3.getHours(), A[t3 + 12 >> 2 >>> 0] = e3.getDate(), A[t3 + 16 >> 2 >>> 0] = e3.getMonth(), e3.getTime() / 1e3 | 0; + }, Da: function(t4, e3) { + t4 = new Date(1e3 * (E[t4 >>> 2] + 4294967296 * A[t4 + 4 >>> 2])), A[e3 >> 2 >>> 0] = t4.getUTCSeconds(), A[e3 + 4 >> 2 >>> 0] = t4.getUTCMinutes(), A[e3 + 8 >> 2 >>> 0] = t4.getUTCHours(), A[e3 + 12 >> 2 >>> 0] = t4.getUTCDate(), A[e3 + 16 >> 2 >>> 0] = t4.getUTCMonth(), A[e3 + 20 >> 2 >>> 0] = t4.getUTCFullYear() - 1900, A[e3 + 24 >> 2 >>> 0] = t4.getUTCDay(), A[e3 + 28 >> 2 >>> 0] = (t4.getTime() - Date.UTC(t4.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5 | 0; + }, Ea: function(t4, e3) { + t4 = new Date(1e3 * (E[t4 >>> 2] + 4294967296 * A[t4 + 4 >>> 2])), A[e3 >> 2 >>> 0] = t4.getSeconds(), A[e3 + 4 >> 2 >>> 0] = t4.getMinutes(), A[e3 + 8 >> 2 >>> 0] = t4.getHours(), A[e3 + 12 >> 2 >>> 0] = t4.getDate(), A[e3 + 16 >> 2 >>> 0] = t4.getMonth(), A[e3 + 20 >> 2 >>> 0] = t4.getFullYear() - 1900, A[e3 + 24 >> 2 >>> 0] = t4.getDay(); + var n2 = new Date(t4.getFullYear(), 0, 1); + A[e3 + 28 >> 2 >>> 0] = (t4.getTime() - n2.getTime()) / 864e5 | 0, A[e3 + 36 >> 2 >>> 0] = -60 * t4.getTimezoneOffset(); + var r3 = new Date(t4.getFullYear(), 6, 1).getTimezoneOffset(); + n2 = n2.getTimezoneOffset(), A[e3 + 32 >> 2 >>> 0] = 0 | (r3 != n2 && t4.getTimezoneOffset() == Math.min(n2, r3)); + }, Fa: function(t4) { + var e3 = new Date(A[t4 + 20 >> 2 >>> 0] + 1900, A[t4 + 16 >> 2 >>> 0], A[t4 + 12 >> 2 >>> 0], A[t4 + 8 >> 2 >>> 0], A[t4 + 4 >> 2 >>> 0], A[t4 >> 2 >>> 0], 0), n2 = A[t4 + 32 >> 2 >>> 0], r3 = e3.getTimezoneOffset(), i3 = new Date(e3.getFullYear(), 0, 1), o2 = new Date(e3.getFullYear(), 6, 1).getTimezoneOffset(), a2 = i3.getTimezoneOffset(), s2 = Math.min(a2, o2); + return 0 > n2 ? A[t4 + 32 >> 2 >>> 0] = Number(o2 != a2 && s2 == r3) : 0 < n2 != (s2 == r3) && (o2 = Math.max(a2, o2), e3.setTime(e3.getTime() + 6e4 * ((0 < n2 ? s2 : o2) - r3))), A[t4 + 24 >> 2 >>> 0] = e3.getDay(), A[t4 + 28 >> 2 >>> 0] = (e3.getTime() - i3.getTime()) / 864e5 | 0, A[t4 >> 2 >>> 0] = e3.getSeconds(), A[t4 + 4 >> 2 >>> 0] = e3.getMinutes(), A[t4 + 8 >> 2 >>> 0] = e3.getHours(), A[t4 + 12 >> 2 >>> 0] = e3.getDate(), A[t4 + 16 >> 2 >>> 0] = e3.getMonth(), e3.getTime() / 1e3 | 0; }, sa: function() { return -52; }, ta: function() { - }, Ga: function t3(e3, n2, r3) { - t3.Vb || (t3.Vb = true, function(t4, e4, n3) { - function r4(t5) { - return (t5 = t5.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? t5[1] : "GMT"; + }, Ga: function t4(e3, n2, r3) { + t4.Vb || (t4.Vb = true, function(t5, e4, n3) { + function r4(t6) { + return (t6 = t6.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? t6[1] : "GMT"; } var i3 = (/* @__PURE__ */ new Date()).getFullYear(), o2 = new Date(i3, 0, 1), a2 = new Date(i3, 6, 1); i3 = o2.getTimezoneOffset(); var s2 = a2.getTimezoneOffset(); - A[t4 >> 2 >>> 0] = 60 * Math.max(i3, s2), A[e4 >> 2 >>> 0] = Number(i3 != s2), t4 = r4(o2), e4 = r4(a2), t4 = ot(t4), e4 = ot(e4), s2 < i3 ? (E[n3 >> 2 >>> 0] = t4, E[n3 + 4 >> 2 >>> 0] = e4) : (E[n3 >> 2 >>> 0] = e4, E[n3 + 4 >> 2 >>> 0] = t4); + A[t5 >> 2 >>> 0] = 60 * Math.max(i3, s2), A[e4 >> 2 >>> 0] = Number(i3 != s2), t5 = r4(o2), e4 = r4(a2), t5 = ot(t5), e4 = ot(e4), s2 < i3 ? (E[n3 >> 2 >>> 0] = t5, E[n3 + 4 >> 2 >>> 0] = e4) : (E[n3 >> 2 >>> 0] = e4, E[n3 + 4 >> 2 >>> 0] = t5); }(e3, n2, r3)); }, B: function() { q(""); }, ma: function() { return 4294901760; }, I: b ? () => { - var t3 = process.hrtime(); - return 1e3 * t3[0] + t3[1] / 1e6; - } : () => performance.now(), xa: function(t3, e3, n2) { - O.copyWithin(t3 >>> 0, e3 >>> 0, e3 + n2 >>> 0); - }, G: function(t3) { + var t4 = process.hrtime(); + return 1e3 * t4[0] + t4[1] / 1e6; + } : () => performance.now(), xa: function(t4, e3, n2) { + O.copyWithin(t4 >>> 0, e3 >>> 0, e3 + n2 >>> 0); + }, G: function(t4) { var e3 = O.length; - if (4294901760 < (t3 >>>= 0)) + if (4294901760 < (t4 >>>= 0)) return false; for (var n2 = 1; 4 >= n2; n2 *= 2) { var r3 = e3 * (1 + 0.2 / n2); - r3 = Math.min(r3, t3 + 100663296); + r3 = Math.min(r3, t4 + 100663296); var i3 = Math; - r3 = Math.max(t3, r3), i3 = i3.min.call(i3, 4294901760, r3 + (65536 - r3 % 65536) % 65536); + r3 = Math.max(t4, r3), i3 = i3.min.call(i3, 4294901760, r3 + (65536 - r3 % 65536) % 65536); t: { try { x.grow(i3 - T.byteLength + 65535 >>> 16), F(); var o2 = 1; break t; - } catch (t4) { + } catch (t5) { } o2 = void 0; } @@ -2963,434 +3648,434 @@ var require_ort_web_node = __commonJS({ return true; } return false; - }, va: function(t3, e3) { + }, va: function(t4, e3) { var n2 = 0; return st().forEach(function(r3, i3) { var o2 = e3 + n2; - for (i3 = E[t3 + 4 * i3 >> 2 >>> 0] = o2, o2 = 0; o2 < r3.length; ++o2) + for (i3 = E[t4 + 4 * i3 >> 2 >>> 0] = o2, o2 = 0; o2 < r3.length; ++o2) S[i3++ >> 0 >>> 0] = r3.charCodeAt(o2); S[i3 >> 0 >>> 0] = 0, n2 += r3.length + 1; }), 0; - }, wa: function(t3, e3) { + }, wa: function(t4, e3) { var n2 = st(); - E[t3 >> 2 >>> 0] = n2.length; + E[t4 >> 2 >>> 0] = n2.length; var r3 = 0; - return n2.forEach(function(t4) { - r3 += t4.length + 1; + return n2.forEach(function(t5) { + r3 += t5.length + 1; }), E[e3 >> 2 >>> 0] = r3, 0; - }, ba: function(t3) { - w || 0 < U || (wt(), Z(M), vt(0), ct[1].length && lt(1, 10), ct[2].length && lt(2, 10)), w || 0 < U || (e2.onExit && e2.onExit(t3), I = true), d(t3, new K(t3)); + }, ba: function(t4) { + w || 0 < U || (wt(), Z(M), vt(0), ct[1].length && lt(1, 10), ct[2].length && lt(2, 10)), w || 0 < U || (e2.onExit && e2.onExit(t4), I = true), d(t4, new K(t4)); }, E: function() { return 52; }, Q: function() { return 52; }, ca: function() { return 70; - }, P: function(t3, e3, n2, r3) { + }, P: function(t4, e3, n2, r3) { for (var i3 = 0, o2 = 0; o2 < n2; o2++) { var a2 = E[e3 >> 2 >>> 0], s2 = E[e3 + 4 >> 2 >>> 0]; e3 += 8; for (var u2 = 0; u2 < s2; u2++) - lt(t3, O[a2 + u2 >>> 0]); + lt(t4, O[a2 + u2 >>> 0]); i3 += s2; } return E[r3 >> 2 >>> 0] = i3, 0; }, c: function() { return pt; - }, ja: function t3(e3, r3) { - t3.Mb || (t3.Mb = function() { + }, ja: function t4(e3, r3) { + t4.Mb || (t4.Mb = function() { if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { - var t4 = new Uint8Array(1); - return () => (crypto.getRandomValues(t4), t4[0]); + var t5 = new Uint8Array(1); + return () => (crypto.getRandomValues(t5), t5[0]); } if (b) try { var e4 = n(6113); return () => e4.randomBytes(1)[0]; - } catch (t5) { + } catch (t6) { } return () => q("randomDevice"); }()); for (var i3 = 0; i3 < r3; i3++) - S[e3 + i3 >> 0 >>> 0] = t3.Mb(); + S[e3 + i3 >> 0 >>> 0] = t4.Mb(); return 0; - }, ea: function(t3, e3, n2) { + }, ea: function(t4, e3, n2) { var r3 = Tt(); try { - return it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, fa: function(t3, e3, n2) { + }, fa: function(t4, e3, n2) { var r3 = Tt(); try { - return it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, J: function(t3) { + }, J: function(t4) { var e3 = Tt(); try { - return it(t3)(); - } catch (t4) { - if (St(e3), t4 !== t4 + 0) - throw t4; + return it(t4)(); + } catch (t5) { + if (St(e3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, e: function(t3, e3) { + }, e: function(t4, e3) { var n2 = Tt(); try { - return it(t3)(e3); - } catch (t4) { - if (St(n2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3); + } catch (t5) { + if (St(n2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, N: function(t3, e3, n2) { + }, N: function(t4, e3, n2) { var r3 = Tt(); try { - return it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, O: function(t3, e3, n2) { + }, O: function(t4, e3, n2) { var r3 = Tt(); try { - return it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, j: function(t3, e3, n2) { + }, j: function(t4, e3, n2) { var r3 = Tt(); try { - return it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, o: function(t3, e3, n2, r3) { + }, o: function(t4, e3, n2, r3) { var i3 = Tt(); try { - return it(t3)(e3, n2, r3); - } catch (t4) { - if (St(i3), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3); + } catch (t5) { + if (St(i3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, p: function(t3, e3, n2, r3, i3) { + }, p: function(t4, e3, n2, r3, i3) { var o2 = Tt(); try { - return it(t3)(e3, n2, r3, i3); - } catch (t4) { - if (St(o2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3); + } catch (t5) { + if (St(o2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, M: function(t3, e3, n2, r3, i3, o2) { + }, M: function(t4, e3, n2, r3, i3, o2) { var a2 = Tt(); try { - return it(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (St(a2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (St(a2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, r: function(t3, e3, n2, r3, i3, o2) { + }, r: function(t4, e3, n2, r3, i3, o2) { var a2 = Tt(); try { - return it(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (St(a2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (St(a2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, v: function(t3, e3, n2, r3, i3, o2, a2) { + }, v: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Tt(); try { - return it(t3)(e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (St(s2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (St(s2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, K: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, K: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Tt(); try { - return it(t3)(e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (St(u2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (St(u2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, D: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { + }, D: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { var f2 = Tt(); try { - return it(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); - } catch (t4) { - if (St(f2), t4 !== t4 + 0) - throw t4; + return it(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); + } catch (t5) { + if (St(f2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, X: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, X: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Tt(); try { - return Rt(t3, e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (St(u2), t4 !== t4 + 0) - throw t4; + return Rt(t4, e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (St(u2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, V: function(t3, e3, n2, r3, i3, o2, a2) { + }, V: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Tt(); try { - return Pt(t3, e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (St(s2), t4 !== t4 + 0) - throw t4; + return Pt(t4, e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (St(s2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, U: function(t3, e3, n2, r3, i3) { + }, U: function(t4, e3, n2, r3, i3) { var o2 = Tt(); try { - return Lt(t3, e3, n2, r3, i3); - } catch (t4) { - if (St(o2), t4 !== t4 + 0) - throw t4; + return Lt(t4, e3, n2, r3, i3); + } catch (t5) { + if (St(o2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, Z: function(t3, e3, n2, r3) { + }, Z: function(t4, e3, n2, r3) { var i3 = Tt(); try { - return Ft(t3, e3, n2, r3); - } catch (t4) { - if (St(i3), t4 !== t4 + 0) - throw t4; + return Ft(t4, e3, n2, r3); + } catch (t5) { + if (St(i3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, W: function(t3) { + }, W: function(t4) { var e3 = Tt(); try { - return It(t3); - } catch (t4) { - if (St(e3), t4 !== t4 + 0) - throw t4; + return It(t4); + } catch (t5) { + if (St(e3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, Y: function(t3, e3) { + }, Y: function(t4, e3) { var n2 = Tt(); try { - return Nt(t3, e3); - } catch (t4) { - if (St(n2), t4 !== t4 + 0) - throw t4; + return Nt(t4, e3); + } catch (t5) { + if (St(n2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, T: function(t3, e3, n2) { + }, T: function(t4, e3, n2) { var r3 = Tt(); try { - return Dt(t3, e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + return Dt(t4, e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, f: function(t3) { + }, f: function(t4) { var e3 = Tt(); try { - it(t3)(); - } catch (t4) { - if (St(e3), t4 !== t4 + 0) - throw t4; + it(t4)(); + } catch (t5) { + if (St(e3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, q: function(t3, e3) { + }, q: function(t4, e3) { var n2 = Tt(); try { - it(t3)(e3); - } catch (t4) { - if (St(n2), t4 !== t4 + 0) - throw t4; + it(t4)(e3); + } catch (t5) { + if (St(n2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, h: function(t3, e3, n2) { + }, h: function(t4, e3, n2) { var r3 = Tt(); try { - it(t3)(e3, n2); - } catch (t4) { - if (St(r3), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2); + } catch (t5) { + if (St(r3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, da: function(t3, e3, n2, r3) { + }, da: function(t4, e3, n2, r3) { var i3 = Tt(); try { - it(t3)(e3, n2, r3); - } catch (t4) { - if (St(i3), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3); + } catch (t5) { + if (St(i3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, l: function(t3, e3, n2, r3) { + }, l: function(t4, e3, n2, r3) { var i3 = Tt(); try { - it(t3)(e3, n2, r3); - } catch (t4) { - if (St(i3), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3); + } catch (t5) { + if (St(i3), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, t: function(t3, e3, n2, r3, i3) { + }, t: function(t4, e3, n2, r3, i3) { var o2 = Tt(); try { - it(t3)(e3, n2, r3, i3); - } catch (t4) { - if (St(o2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3); + } catch (t5) { + if (St(o2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, u: function(t3, e3, n2, r3, i3, o2) { + }, u: function(t4, e3, n2, r3, i3, o2) { var a2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2); - } catch (t4) { - if (St(a2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2); + } catch (t5) { + if (St(a2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, x: function(t3, e3, n2, r3, i3, o2, a2) { + }, x: function(t4, e3, n2, r3, i3, o2, a2) { var s2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2, a2); - } catch (t4) { - if (St(s2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2, a2); + } catch (t5) { + if (St(s2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, z: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, z: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (St(u2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (St(u2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, ga: function(t3, e3, n2, r3, i3, o2, a2, s2, u2) { + }, ga: function(t4, e3, n2, r3, i3, o2, a2, s2, u2) { var c2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2, a2, s2, u2); - } catch (t4) { - if (St(c2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2, a2, s2, u2); + } catch (t5) { + if (St(c2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, A: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2) { + }, A: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2) { var p2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2); - } catch (t4) { - if (St(p2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2); + } catch (t5) { + if (St(p2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, C: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2) { + }, C: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2) { var b2 = Tt(); try { - it(t3)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2); - } catch (t4) { - if (St(b2), t4 !== t4 + 0) - throw t4; + it(t4)(e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2, f2, d2, h2, g2); + } catch (t5) { + if (St(b2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, aa: function(t3, e3, n2, r3, i3, o2, a2, s2) { + }, aa: function(t4, e3, n2, r3, i3, o2, a2, s2) { var u2 = Tt(); try { - $t(t3, e3, n2, r3, i3, o2, a2, s2); - } catch (t4) { - if (St(u2), t4 !== t4 + 0) - throw t4; + $t(t4, e3, n2, r3, i3, o2, a2, s2); + } catch (t5) { + if (St(u2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, _: function(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { + }, _: function(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2) { var f2 = Tt(); try { - Ct(t3, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); - } catch (t4) { - if (St(f2), t4 !== t4 + 0) - throw t4; + Ct(t4, e3, n2, r3, i3, o2, a2, s2, u2, c2, l2, p2); + } catch (t5) { + if (St(f2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, $: function(t3, e3, n2, r3, i3, o2) { + }, $: function(t4, e3, n2, r3, i3, o2) { var a2 = Tt(); try { - kt(t3, e3, n2, r3, i3, o2); - } catch (t4) { - if (St(a2), t4 !== t4 + 0) - throw t4; + kt(t4, e3, n2, r3, i3, o2); + } catch (t5) { + if (St(a2), t5 !== t5 + 0) + throw t5; xt(1, 0); } - }, n: function(t3) { - return t3; - }, F: function(t3) { - pt = t3; - }, ha: gt, y: function(t3, e3, n2, r3) { - return gt(t3, e3, n2, r3); + }, n: function(t4) { + return t4; + }, F: function(t4) { + pt = t4; + }, ha: gt, y: function(t4, e3, n2, r3) { + return gt(t4, e3, n2, r3); } }; !function() { - function t3(t4) { - e2.asm = t4.exports, x = e2.asm.Ka, F(), N = e2.asm.ib, L.unshift(e2.asm.La), z--, e2.monitorRunDependencies && e2.monitorRunDependencies(z), 0 == z && (null !== G && (clearInterval(G), G = null), H && (t4 = H, H = null, t4())); + function t4(t5) { + e2.asm = t5.exports, x = e2.asm.Ka, F(), N = e2.asm.ib, L.unshift(e2.asm.La), z--, e2.monitorRunDependencies && e2.monitorRunDependencies(z), 0 == z && (null !== G && (clearInterval(G), G = null), H && (t5 = H, H = null, t5())); } function n2(e3) { - t3(e3.instance); + t4(e3.instance); } - function r3(t4) { + function r3(t5) { return function() { if (!y && (h || g)) { if ("function" == typeof fetch && !B.startsWith("file://")) - return fetch(B, { credentials: "same-origin" }).then(function(t5) { - if (!t5.ok) + return fetch(B, { credentials: "same-origin" }).then(function(t6) { + if (!t6.ok) throw "failed to load wasm binary file at '" + B + "'"; - return t5.arrayBuffer(); + return t6.arrayBuffer(); }).catch(function() { return Y(); }); if (a) - return new Promise(function(t5, e3) { + return new Promise(function(t6, e3) { a(B, function(e4) { - t5(new Uint8Array(e4)); + t6(new Uint8Array(e4)); }, e3); }); } return Promise.resolve().then(function() { return Y(); }); - }().then(function(t5) { - return WebAssembly.instantiate(t5, o2); - }).then(function(t5) { - return t5; - }).then(t4, function(t5) { - v("failed to asynchronously prepare wasm: " + t5), q(t5); + }().then(function(t6) { + return WebAssembly.instantiate(t6, o2); + }).then(function(t6) { + return t6; + }).then(t5, function(t6) { + v("failed to asynchronously prepare wasm: " + t6), q(t6); }); } var o2 = { a: bt }; if (z++, e2.monitorRunDependencies && e2.monitorRunDependencies(z), e2.instantiateWasm) try { - return e2.instantiateWasm(o2, t3); - } catch (t4) { - return v("Module.instantiateWasm callback failed with error: " + t4), false; + return e2.instantiateWasm(o2, t4); + } catch (t5) { + return v("Module.instantiateWasm callback failed with error: " + t5), false; } - (y || "function" != typeof WebAssembly.instantiateStreaming || W() || B.startsWith("file://") || b || "function" != typeof fetch ? r3(n2) : fetch(B, { credentials: "same-origin" }).then(function(t4) { - return WebAssembly.instantiateStreaming(t4, o2).then(n2, function(t5) { - return v("wasm streaming compile failed: " + t5), v("falling back to ArrayBuffer instantiation"), r3(n2); + (y || "function" != typeof WebAssembly.instantiateStreaming || W() || B.startsWith("file://") || b || "function" != typeof fetch ? r3(n2) : fetch(B, { credentials: "same-origin" }).then(function(t5) { + return WebAssembly.instantiateStreaming(t5, o2).then(n2, function(t6) { + return v("wasm streaming compile failed: " + t6), v("falling back to ArrayBuffer instantiation"), r3(n2); }); })).catch(i2); }(), e2.___wasm_call_ctors = function() { @@ -3478,12 +4163,12 @@ var require_ort_web_node = __commonJS({ return (Lt = e2.dynCall_iiij = e2.asm.yb).apply(null, arguments); }; function Mt() { - function t3() { + function t4() { if (!mt && (mt = true, e2.calledRun = true, !I)) { if (Z(L), r2(e2), e2.onRuntimeInitialized && e2.onRuntimeInitialized(), e2.postRun) for ("function" == typeof e2.postRun && (e2.postRun = [e2.postRun]); e2.postRun.length; ) { - var t4 = e2.postRun.shift(); - j.unshift(t4); + var t5 = e2.postRun.shift(); + j.unshift(t5); } Z(j); } @@ -3495,30 +4180,30 @@ var require_ort_web_node = __commonJS({ Z(R), 0 < z || (e2.setStatus ? (e2.setStatus("Running..."), setTimeout(function() { setTimeout(function() { e2.setStatus(""); - }, 1), t3(); - }, 1)) : t3()); + }, 1), t4(); + }, 1)) : t4()); } } - if (e2.UTF8ToString = $, e2.stringToUTF8 = function(t3, e3, n2) { - return k(t3, O, e3, n2); - }, e2.lengthBytesUTF8 = C, e2.stackSave = Tt, e2.stackRestore = St, e2.stackAlloc = Ot, H = function t3() { - mt || Mt(), mt || (H = t3); + if (e2.UTF8ToString = $, e2.stringToUTF8 = function(t4, e3, n2) { + return k(t4, O, e3, n2); + }, e2.lengthBytesUTF8 = C, e2.stackSave = Tt, e2.stackRestore = St, e2.stackAlloc = Ot, H = function t4() { + mt || Mt(), mt || (H = t4); }, e2.preInit) for ("function" == typeof e2.preInit && (e2.preInit = [e2.preInit]); 0 < e2.preInit.length; ) e2.preInit.pop()(); - return Mt(), t2.ready; + return Mt(), t3.ready; }); - t.exports = r; - }, 4537: (t) => { + t2.exports = r; + }, 4537: (t2) => { "use strict"; - t.exports = function(t2, e) { + t2.exports = function(t3, e) { for (var n = new Array(arguments.length - 1), r = 0, i2 = 2, o = true; i2 < arguments.length; ) n[r++] = arguments[i2++]; return new Promise(function(i3, a) { - n[r] = function(t3) { + n[r] = function(t4) { if (o) - if (o = false, t3) - a(t3); + if (o = false, t4) + a(t4); else { for (var e2 = new Array(arguments.length - 1), n2 = 0; n2 < e2.length; ) e2[n2++] = arguments[n2]; @@ -3526,28 +4211,28 @@ var require_ort_web_node = __commonJS({ } }; try { - t2.apply(e || null, n); - } catch (t3) { - o && (o = false, a(t3)); + t3.apply(e || null, n); + } catch (t4) { + o && (o = false, a(t4)); } }); }; - }, 7419: (t, e) => { + }, 7419: (t2, e) => { "use strict"; var n = e; - n.length = function(t2) { - var e2 = t2.length; + n.length = function(t3) { + var e2 = t3.length; if (!e2) return 0; - for (var n2 = 0; --e2 % 4 > 1 && "=" === t2.charAt(e2); ) + for (var n2 = 0; --e2 % 4 > 1 && "=" === t3.charAt(e2); ) ++n2; - return Math.ceil(3 * t2.length) / 4 - n2; + return Math.ceil(3 * t3.length) / 4 - n2; }; for (var r = new Array(64), i2 = new Array(123), o = 0; o < 64; ) i2[r[o] = o < 26 ? o + 65 : o < 52 ? o + 71 : o < 62 ? o - 4 : o - 59 | 43] = o++; - n.encode = function(t2, e2, n2) { + n.encode = function(t3, e2, n2) { for (var i3, o2 = null, a2 = [], s = 0, u = 0; e2 < n2; ) { - var c = t2[e2++]; + var c = t3[e2++]; switch (u) { case 0: a2[s++] = r[c >> 2], i3 = (3 & c) << 4, u = 1; @@ -3563,9 +4248,9 @@ var require_ort_web_node = __commonJS({ return u && (a2[s++] = r[i3], a2[s++] = 61, 1 === u && (a2[s++] = 61)), o2 ? (s && o2.push(String.fromCharCode.apply(String, a2.slice(0, s))), o2.join("")) : String.fromCharCode.apply(String, a2.slice(0, s)); }; var a = "invalid encoding"; - n.decode = function(t2, e2, n2) { - for (var r2, o2 = n2, s = 0, u = 0; u < t2.length; ) { - var c = t2.charCodeAt(u++); + n.decode = function(t3, e2, n2) { + for (var r2, o2 = n2, s = 0, u = 0; u < t3.length; ) { + var c = t3.charCodeAt(u++); if (61 === c && s > 1) break; if (void 0 === (c = i2[c])) @@ -3587,27 +4272,27 @@ var require_ort_web_node = __commonJS({ if (1 === s) throw Error(a); return n2 - o2; - }, n.test = function(t2) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t2); + }, n.test = function(t3) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t3); }; - }, 9211: (t) => { + }, 9211: (t2) => { "use strict"; function e() { this._listeners = {}; } - t.exports = e, e.prototype.on = function(t2, e2, n) { - return (this._listeners[t2] || (this._listeners[t2] = [])).push({ fn: e2, ctx: n || this }), this; - }, e.prototype.off = function(t2, e2) { - if (void 0 === t2) + t2.exports = e, e.prototype.on = function(t3, e2, n) { + return (this._listeners[t3] || (this._listeners[t3] = [])).push({ fn: e2, ctx: n || this }), this; + }, e.prototype.off = function(t3, e2) { + if (void 0 === t3) this._listeners = {}; else if (void 0 === e2) - this._listeners[t2] = []; + this._listeners[t3] = []; else - for (var n = this._listeners[t2], r = 0; r < n.length; ) + for (var n = this._listeners[t3], r = 0; r < n.length; ) n[r].fn === e2 ? n.splice(r, 1) : ++r; return this; - }, e.prototype.emit = function(t2) { - var e2 = this._listeners[t2]; + }, e.prototype.emit = function(t3) { + var e2 = this._listeners[t3]; if (e2) { for (var n = [], r = 1; r < arguments.length; ) n.push(arguments[r++]); @@ -3616,99 +4301,99 @@ var require_ort_web_node = __commonJS({ } return this; }; - }, 945: (t) => { + }, 945: (t2) => { "use strict"; - function e(t2) { + function e(t3) { return "undefined" != typeof Float32Array ? function() { var e2 = new Float32Array([-0]), n2 = new Uint8Array(e2.buffer), r2 = 128 === n2[3]; - function i3(t3, r3, i4) { - e2[0] = t3, r3[i4] = n2[0], r3[i4 + 1] = n2[1], r3[i4 + 2] = n2[2], r3[i4 + 3] = n2[3]; + function i3(t4, r3, i4) { + e2[0] = t4, r3[i4] = n2[0], r3[i4 + 1] = n2[1], r3[i4 + 2] = n2[2], r3[i4 + 3] = n2[3]; } - function o2(t3, r3, i4) { - e2[0] = t3, r3[i4] = n2[3], r3[i4 + 1] = n2[2], r3[i4 + 2] = n2[1], r3[i4 + 3] = n2[0]; + function o2(t4, r3, i4) { + e2[0] = t4, r3[i4] = n2[3], r3[i4 + 1] = n2[2], r3[i4 + 2] = n2[1], r3[i4 + 3] = n2[0]; } - function a(t3, r3) { - return n2[0] = t3[r3], n2[1] = t3[r3 + 1], n2[2] = t3[r3 + 2], n2[3] = t3[r3 + 3], e2[0]; + function a(t4, r3) { + return n2[0] = t4[r3], n2[1] = t4[r3 + 1], n2[2] = t4[r3 + 2], n2[3] = t4[r3 + 3], e2[0]; } - function s(t3, r3) { - return n2[3] = t3[r3], n2[2] = t3[r3 + 1], n2[1] = t3[r3 + 2], n2[0] = t3[r3 + 3], e2[0]; + function s(t4, r3) { + return n2[3] = t4[r3], n2[2] = t4[r3 + 1], n2[1] = t4[r3 + 2], n2[0] = t4[r3 + 3], e2[0]; } - t2.writeFloatLE = r2 ? i3 : o2, t2.writeFloatBE = r2 ? o2 : i3, t2.readFloatLE = r2 ? a : s, t2.readFloatBE = r2 ? s : a; + t3.writeFloatLE = r2 ? i3 : o2, t3.writeFloatBE = r2 ? o2 : i3, t3.readFloatLE = r2 ? a : s, t3.readFloatBE = r2 ? s : a; }() : function() { - function e2(t3, e3, n2, r2) { + function e2(t4, e3, n2, r2) { var i3 = e3 < 0 ? 1 : 0; if (i3 && (e3 = -e3), 0 === e3) - t3(1 / e3 > 0 ? 0 : 2147483648, n2, r2); + t4(1 / e3 > 0 ? 0 : 2147483648, n2, r2); else if (isNaN(e3)) - t3(2143289344, n2, r2); + t4(2143289344, n2, r2); else if (e3 > 34028234663852886e22) - t3((i3 << 31 | 2139095040) >>> 0, n2, r2); + t4((i3 << 31 | 2139095040) >>> 0, n2, r2); else if (e3 < 11754943508222875e-54) - t3((i3 << 31 | Math.round(e3 / 1401298464324817e-60)) >>> 0, n2, r2); + t4((i3 << 31 | Math.round(e3 / 1401298464324817e-60)) >>> 0, n2, r2); else { var o2 = Math.floor(Math.log(e3) / Math.LN2); - t3((i3 << 31 | o2 + 127 << 23 | 8388607 & Math.round(e3 * Math.pow(2, -o2) * 8388608)) >>> 0, n2, r2); + t4((i3 << 31 | o2 + 127 << 23 | 8388607 & Math.round(e3 * Math.pow(2, -o2) * 8388608)) >>> 0, n2, r2); } } - function a(t3, e3, n2) { - var r2 = t3(e3, n2), i3 = 2 * (r2 >> 31) + 1, o2 = r2 >>> 23 & 255, a2 = 8388607 & r2; + function a(t4, e3, n2) { + var r2 = t4(e3, n2), i3 = 2 * (r2 >> 31) + 1, o2 = r2 >>> 23 & 255, a2 = 8388607 & r2; return 255 === o2 ? a2 ? NaN : i3 * (1 / 0) : 0 === o2 ? 1401298464324817e-60 * i3 * a2 : i3 * Math.pow(2, o2 - 150) * (a2 + 8388608); } - t2.writeFloatLE = e2.bind(null, n), t2.writeFloatBE = e2.bind(null, r), t2.readFloatLE = a.bind(null, i2), t2.readFloatBE = a.bind(null, o); + t3.writeFloatLE = e2.bind(null, n), t3.writeFloatBE = e2.bind(null, r), t3.readFloatLE = a.bind(null, i2), t3.readFloatBE = a.bind(null, o); }(), "undefined" != typeof Float64Array ? function() { var e2 = new Float64Array([-0]), n2 = new Uint8Array(e2.buffer), r2 = 128 === n2[7]; - function i3(t3, r3, i4) { - e2[0] = t3, r3[i4] = n2[0], r3[i4 + 1] = n2[1], r3[i4 + 2] = n2[2], r3[i4 + 3] = n2[3], r3[i4 + 4] = n2[4], r3[i4 + 5] = n2[5], r3[i4 + 6] = n2[6], r3[i4 + 7] = n2[7]; + function i3(t4, r3, i4) { + e2[0] = t4, r3[i4] = n2[0], r3[i4 + 1] = n2[1], r3[i4 + 2] = n2[2], r3[i4 + 3] = n2[3], r3[i4 + 4] = n2[4], r3[i4 + 5] = n2[5], r3[i4 + 6] = n2[6], r3[i4 + 7] = n2[7]; } - function o2(t3, r3, i4) { - e2[0] = t3, r3[i4] = n2[7], r3[i4 + 1] = n2[6], r3[i4 + 2] = n2[5], r3[i4 + 3] = n2[4], r3[i4 + 4] = n2[3], r3[i4 + 5] = n2[2], r3[i4 + 6] = n2[1], r3[i4 + 7] = n2[0]; + function o2(t4, r3, i4) { + e2[0] = t4, r3[i4] = n2[7], r3[i4 + 1] = n2[6], r3[i4 + 2] = n2[5], r3[i4 + 3] = n2[4], r3[i4 + 4] = n2[3], r3[i4 + 5] = n2[2], r3[i4 + 6] = n2[1], r3[i4 + 7] = n2[0]; } - function a(t3, r3) { - return n2[0] = t3[r3], n2[1] = t3[r3 + 1], n2[2] = t3[r3 + 2], n2[3] = t3[r3 + 3], n2[4] = t3[r3 + 4], n2[5] = t3[r3 + 5], n2[6] = t3[r3 + 6], n2[7] = t3[r3 + 7], e2[0]; + function a(t4, r3) { + return n2[0] = t4[r3], n2[1] = t4[r3 + 1], n2[2] = t4[r3 + 2], n2[3] = t4[r3 + 3], n2[4] = t4[r3 + 4], n2[5] = t4[r3 + 5], n2[6] = t4[r3 + 6], n2[7] = t4[r3 + 7], e2[0]; } - function s(t3, r3) { - return n2[7] = t3[r3], n2[6] = t3[r3 + 1], n2[5] = t3[r3 + 2], n2[4] = t3[r3 + 3], n2[3] = t3[r3 + 4], n2[2] = t3[r3 + 5], n2[1] = t3[r3 + 6], n2[0] = t3[r3 + 7], e2[0]; + function s(t4, r3) { + return n2[7] = t4[r3], n2[6] = t4[r3 + 1], n2[5] = t4[r3 + 2], n2[4] = t4[r3 + 3], n2[3] = t4[r3 + 4], n2[2] = t4[r3 + 5], n2[1] = t4[r3 + 6], n2[0] = t4[r3 + 7], e2[0]; } - t2.writeDoubleLE = r2 ? i3 : o2, t2.writeDoubleBE = r2 ? o2 : i3, t2.readDoubleLE = r2 ? a : s, t2.readDoubleBE = r2 ? s : a; + t3.writeDoubleLE = r2 ? i3 : o2, t3.writeDoubleBE = r2 ? o2 : i3, t3.readDoubleLE = r2 ? a : s, t3.readDoubleBE = r2 ? s : a; }() : function() { - function e2(t3, e3, n2, r2, i3, o2) { + function e2(t4, e3, n2, r2, i3, o2) { var a2 = r2 < 0 ? 1 : 0; if (a2 && (r2 = -r2), 0 === r2) - t3(0, i3, o2 + e3), t3(1 / r2 > 0 ? 0 : 2147483648, i3, o2 + n2); + t4(0, i3, o2 + e3), t4(1 / r2 > 0 ? 0 : 2147483648, i3, o2 + n2); else if (isNaN(r2)) - t3(0, i3, o2 + e3), t3(2146959360, i3, o2 + n2); + t4(0, i3, o2 + e3), t4(2146959360, i3, o2 + n2); else if (r2 > 17976931348623157e292) - t3(0, i3, o2 + e3), t3((a2 << 31 | 2146435072) >>> 0, i3, o2 + n2); + t4(0, i3, o2 + e3), t4((a2 << 31 | 2146435072) >>> 0, i3, o2 + n2); else { var s; if (r2 < 22250738585072014e-324) - t3((s = r2 / 5e-324) >>> 0, i3, o2 + e3), t3((a2 << 31 | s / 4294967296) >>> 0, i3, o2 + n2); + t4((s = r2 / 5e-324) >>> 0, i3, o2 + e3), t4((a2 << 31 | s / 4294967296) >>> 0, i3, o2 + n2); else { var u = Math.floor(Math.log(r2) / Math.LN2); - 1024 === u && (u = 1023), t3(4503599627370496 * (s = r2 * Math.pow(2, -u)) >>> 0, i3, o2 + e3), t3((a2 << 31 | u + 1023 << 20 | 1048576 * s & 1048575) >>> 0, i3, o2 + n2); + 1024 === u && (u = 1023), t4(4503599627370496 * (s = r2 * Math.pow(2, -u)) >>> 0, i3, o2 + e3), t4((a2 << 31 | u + 1023 << 20 | 1048576 * s & 1048575) >>> 0, i3, o2 + n2); } } } - function a(t3, e3, n2, r2, i3) { - var o2 = t3(r2, i3 + e3), a2 = t3(r2, i3 + n2), s = 2 * (a2 >> 31) + 1, u = a2 >>> 20 & 2047, c = 4294967296 * (1048575 & a2) + o2; + function a(t4, e3, n2, r2, i3) { + var o2 = t4(r2, i3 + e3), a2 = t4(r2, i3 + n2), s = 2 * (a2 >> 31) + 1, u = a2 >>> 20 & 2047, c = 4294967296 * (1048575 & a2) + o2; return 2047 === u ? c ? NaN : s * (1 / 0) : 0 === u ? 5e-324 * s * c : s * Math.pow(2, u - 1075) * (c + 4503599627370496); } - t2.writeDoubleLE = e2.bind(null, n, 0, 4), t2.writeDoubleBE = e2.bind(null, r, 4, 0), t2.readDoubleLE = a.bind(null, i2, 0, 4), t2.readDoubleBE = a.bind(null, o, 4, 0); - }(), t2; + t3.writeDoubleLE = e2.bind(null, n, 0, 4), t3.writeDoubleBE = e2.bind(null, r, 4, 0), t3.readDoubleLE = a.bind(null, i2, 0, 4), t3.readDoubleBE = a.bind(null, o, 4, 0); + }(), t3; } - function n(t2, e2, n2) { - e2[n2] = 255 & t2, e2[n2 + 1] = t2 >>> 8 & 255, e2[n2 + 2] = t2 >>> 16 & 255, e2[n2 + 3] = t2 >>> 24; + function n(t3, e2, n2) { + e2[n2] = 255 & t3, e2[n2 + 1] = t3 >>> 8 & 255, e2[n2 + 2] = t3 >>> 16 & 255, e2[n2 + 3] = t3 >>> 24; } - function r(t2, e2, n2) { - e2[n2] = t2 >>> 24, e2[n2 + 1] = t2 >>> 16 & 255, e2[n2 + 2] = t2 >>> 8 & 255, e2[n2 + 3] = 255 & t2; + function r(t3, e2, n2) { + e2[n2] = t3 >>> 24, e2[n2 + 1] = t3 >>> 16 & 255, e2[n2 + 2] = t3 >>> 8 & 255, e2[n2 + 3] = 255 & t3; } - function i2(t2, e2) { - return (t2[e2] | t2[e2 + 1] << 8 | t2[e2 + 2] << 16 | t2[e2 + 3] << 24) >>> 0; + function i2(t3, e2) { + return (t3[e2] | t3[e2 + 1] << 8 | t3[e2 + 2] << 16 | t3[e2 + 3] << 24) >>> 0; } - function o(t2, e2) { - return (t2[e2] << 24 | t2[e2 + 1] << 16 | t2[e2 + 2] << 8 | t2[e2 + 3]) >>> 0; + function o(t3, e2) { + return (t3[e2] << 24 | t3[e2 + 1] << 16 | t3[e2 + 2] << 8 | t3[e2 + 3]) >>> 0; } - t.exports = e(e); + t2.exports = e(e); }, 7199: (module) => { "use strict"; function inquire(moduleName) { @@ -3716,130 +4401,130 @@ var require_ort_web_node = __commonJS({ var mod = eval("quire".replace(/^/, "re"))(moduleName); if (mod && (mod.length || Object.keys(mod).length)) return mod; - } catch (t) { + } catch (t2) { } return null; } module.exports = inquire; - }, 6662: (t) => { + }, 6662: (t2) => { "use strict"; - t.exports = function(t2, e, n) { + t2.exports = function(t3, e, n) { var r = n || 8192, i2 = r >>> 1, o = null, a = r; return function(n2) { if (n2 < 1 || n2 > i2) - return t2(n2); - a + n2 > r && (o = t2(r), a = 0); + return t3(n2); + a + n2 > r && (o = t3(r), a = 0); var s = e.call(o, a, a += n2); return 7 & a && (a = 1 + (7 | a)), s; }; }; - }, 4997: (t, e) => { + }, 4997: (t2, e) => { "use strict"; var n = e; - n.length = function(t2) { - for (var e2 = 0, n2 = 0, r = 0; r < t2.length; ++r) - (n2 = t2.charCodeAt(r)) < 128 ? e2 += 1 : n2 < 2048 ? e2 += 2 : 55296 == (64512 & n2) && 56320 == (64512 & t2.charCodeAt(r + 1)) ? (++r, e2 += 4) : e2 += 3; + n.length = function(t3) { + for (var e2 = 0, n2 = 0, r = 0; r < t3.length; ++r) + (n2 = t3.charCodeAt(r)) < 128 ? e2 += 1 : n2 < 2048 ? e2 += 2 : 55296 == (64512 & n2) && 56320 == (64512 & t3.charCodeAt(r + 1)) ? (++r, e2 += 4) : e2 += 3; return e2; - }, n.read = function(t2, e2, n2) { + }, n.read = function(t3, e2, n2) { if (n2 - e2 < 1) return ""; for (var r, i2 = null, o = [], a = 0; e2 < n2; ) - (r = t2[e2++]) < 128 ? o[a++] = r : r > 191 && r < 224 ? o[a++] = (31 & r) << 6 | 63 & t2[e2++] : r > 239 && r < 365 ? (r = ((7 & r) << 18 | (63 & t2[e2++]) << 12 | (63 & t2[e2++]) << 6 | 63 & t2[e2++]) - 65536, o[a++] = 55296 + (r >> 10), o[a++] = 56320 + (1023 & r)) : o[a++] = (15 & r) << 12 | (63 & t2[e2++]) << 6 | 63 & t2[e2++], a > 8191 && ((i2 || (i2 = [])).push(String.fromCharCode.apply(String, o)), a = 0); + (r = t3[e2++]) < 128 ? o[a++] = r : r > 191 && r < 224 ? o[a++] = (31 & r) << 6 | 63 & t3[e2++] : r > 239 && r < 365 ? (r = ((7 & r) << 18 | (63 & t3[e2++]) << 12 | (63 & t3[e2++]) << 6 | 63 & t3[e2++]) - 65536, o[a++] = 55296 + (r >> 10), o[a++] = 56320 + (1023 & r)) : o[a++] = (15 & r) << 12 | (63 & t3[e2++]) << 6 | 63 & t3[e2++], a > 8191 && ((i2 || (i2 = [])).push(String.fromCharCode.apply(String, o)), a = 0); return i2 ? (a && i2.push(String.fromCharCode.apply(String, o.slice(0, a))), i2.join("")) : String.fromCharCode.apply(String, o.slice(0, a)); - }, n.write = function(t2, e2, n2) { - for (var r, i2, o = n2, a = 0; a < t2.length; ++a) - (r = t2.charCodeAt(a)) < 128 ? e2[n2++] = r : r < 2048 ? (e2[n2++] = r >> 6 | 192, e2[n2++] = 63 & r | 128) : 55296 == (64512 & r) && 56320 == (64512 & (i2 = t2.charCodeAt(a + 1))) ? (r = 65536 + ((1023 & r) << 10) + (1023 & i2), ++a, e2[n2++] = r >> 18 | 240, e2[n2++] = r >> 12 & 63 | 128, e2[n2++] = r >> 6 & 63 | 128, e2[n2++] = 63 & r | 128) : (e2[n2++] = r >> 12 | 224, e2[n2++] = r >> 6 & 63 | 128, e2[n2++] = 63 & r | 128); + }, n.write = function(t3, e2, n2) { + for (var r, i2, o = n2, a = 0; a < t3.length; ++a) + (r = t3.charCodeAt(a)) < 128 ? e2[n2++] = r : r < 2048 ? (e2[n2++] = r >> 6 | 192, e2[n2++] = 63 & r | 128) : 55296 == (64512 & r) && 56320 == (64512 & (i2 = t3.charCodeAt(a + 1))) ? (r = 65536 + ((1023 & r) << 10) + (1023 & i2), ++a, e2[n2++] = r >> 18 | 240, e2[n2++] = r >> 12 & 63 | 128, e2[n2++] = r >> 6 & 63 | 128, e2[n2++] = 63 & r | 128) : (e2[n2++] = r >> 12 | 224, e2[n2++] = r >> 6 & 63 | 128, e2[n2++] = 63 & r | 128); return n2 - o; }; - }, 3442: (t, e) => { + }, 3442: (t2, e) => { "use strict"; e.__esModule = true; var n = function() { - function t2(e2) { + function t3(e2) { if (!e2) throw new TypeError("Invalid argument; `value` has no value."); - this.value = t2.EMPTY, e2 && t2.isGuid(e2) && (this.value = e2); + this.value = t3.EMPTY, e2 && t3.isGuid(e2) && (this.value = e2); } - return t2.isGuid = function(e2) { + return t3.isGuid = function(e2) { var n2 = e2.toString(); - return e2 && (e2 instanceof t2 || t2.validator.test(n2)); - }, t2.create = function() { - return new t2([t2.gen(2), t2.gen(1), t2.gen(1), t2.gen(1), t2.gen(3)].join("-")); - }, t2.createEmpty = function() { - return new t2("emptyguid"); - }, t2.parse = function(e2) { - return new t2(e2); - }, t2.raw = function() { - return [t2.gen(2), t2.gen(1), t2.gen(1), t2.gen(1), t2.gen(3)].join("-"); - }, t2.gen = function(t3) { - for (var e2 = "", n2 = 0; n2 < t3; n2++) + return e2 && (e2 instanceof t3 || t3.validator.test(n2)); + }, t3.create = function() { + return new t3([t3.gen(2), t3.gen(1), t3.gen(1), t3.gen(1), t3.gen(3)].join("-")); + }, t3.createEmpty = function() { + return new t3("emptyguid"); + }, t3.parse = function(e2) { + return new t3(e2); + }, t3.raw = function() { + return [t3.gen(2), t3.gen(1), t3.gen(1), t3.gen(1), t3.gen(3)].join("-"); + }, t3.gen = function(t4) { + for (var e2 = "", n2 = 0; n2 < t4; n2++) e2 += (65536 * (1 + Math.random()) | 0).toString(16).substring(1); return e2; - }, t2.prototype.equals = function(e2) { - return t2.isGuid(e2) && this.value === e2.toString(); - }, t2.prototype.isEmpty = function() { - return this.value === t2.EMPTY; - }, t2.prototype.toString = function() { + }, t3.prototype.equals = function(e2) { + return t3.isGuid(e2) && this.value === e2.toString(); + }, t3.prototype.isEmpty = function() { + return this.value === t3.EMPTY; + }, t3.prototype.toString = function() { return this.value; - }, t2.prototype.toJSON = function() { + }, t3.prototype.toJSON = function() { return { value: this.value }; - }, t2.validator = new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", "i"), t2.EMPTY = "00000000-0000-0000-0000-000000000000", t2; + }, t3.validator = new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", "i"), t3.EMPTY = "00000000-0000-0000-0000-000000000000", t3; }(); e.Guid = n; - }, 3720: (t) => { - t.exports = n; + }, 3720: (t2) => { + t2.exports = n; var e = null; try { e = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; - } catch (t2) { + } catch (t3) { } - function n(t2, e2, n2) { - this.low = 0 | t2, this.high = 0 | e2, this.unsigned = !!n2; + function n(t3, e2, n2) { + this.low = 0 | t3, this.high = 0 | e2, this.unsigned = !!n2; } - function r(t2) { - return true === (t2 && t2.__isLong__); + function r(t3) { + return true === (t3 && t3.__isLong__); } n.prototype.__isLong__, Object.defineProperty(n.prototype, "__isLong__", { value: true }), n.isLong = r; var i2 = {}, o = {}; - function a(t2, e2) { + function a(t3, e2) { var n2, r2, a2; - return e2 ? (a2 = 0 <= (t2 >>>= 0) && t2 < 256) && (r2 = o[t2]) ? r2 : (n2 = u(t2, (0 | t2) < 0 ? -1 : 0, true), a2 && (o[t2] = n2), n2) : (a2 = -128 <= (t2 |= 0) && t2 < 128) && (r2 = i2[t2]) ? r2 : (n2 = u(t2, t2 < 0 ? -1 : 0, false), a2 && (i2[t2] = n2), n2); + return e2 ? (a2 = 0 <= (t3 >>>= 0) && t3 < 256) && (r2 = o[t3]) ? r2 : (n2 = u(t3, (0 | t3) < 0 ? -1 : 0, true), a2 && (o[t3] = n2), n2) : (a2 = -128 <= (t3 |= 0) && t3 < 128) && (r2 = i2[t3]) ? r2 : (n2 = u(t3, t3 < 0 ? -1 : 0, false), a2 && (i2[t3] = n2), n2); } - function s(t2, e2) { - if (isNaN(t2)) + function s(t3, e2) { + if (isNaN(t3)) return e2 ? m : b; if (e2) { - if (t2 < 0) + if (t3 < 0) return m; - if (t2 >= d) + if (t3 >= d) return x; } else { - if (t2 <= -h) + if (t3 <= -h) return T; - if (t2 + 1 >= h) + if (t3 + 1 >= h) return w; } - return t2 < 0 ? s(-t2, e2).neg() : u(t2 % f | 0, t2 / f | 0, e2); + return t3 < 0 ? s(-t3, e2).neg() : u(t3 % f | 0, t3 / f | 0, e2); } - function u(t2, e2, r2) { - return new n(t2, e2, r2); + function u(t3, e2, r2) { + return new n(t3, e2, r2); } n.fromInt = a, n.fromNumber = s, n.fromBits = u; var c = Math.pow; - function l(t2, e2, n2) { - if (0 === t2.length) + function l(t3, e2, n2) { + if (0 === t3.length) throw Error("empty string"); - if ("NaN" === t2 || "Infinity" === t2 || "+Infinity" === t2 || "-Infinity" === t2) + if ("NaN" === t3 || "Infinity" === t3 || "+Infinity" === t3 || "-Infinity" === t3) return b; if ("number" == typeof e2 ? (n2 = e2, e2 = false) : e2 = !!e2, (n2 = n2 || 10) < 2 || 36 < n2) throw RangeError("radix"); var r2; - if ((r2 = t2.indexOf("-")) > 0) + if ((r2 = t3.indexOf("-")) > 0) throw Error("interior hyphen"); if (0 === r2) - return l(t2.substring(1), e2, n2).neg(); - for (var i3 = s(c(n2, 8)), o2 = b, a2 = 0; a2 < t2.length; a2 += 8) { - var u2 = Math.min(8, t2.length - a2), p2 = parseInt(t2.substring(a2, a2 + u2), n2); + return l(t3.substring(1), e2, n2).neg(); + for (var i3 = s(c(n2, 8)), o2 = b, a2 = 0; a2 < t3.length; a2 += 8) { + var u2 = Math.min(8, t3.length - a2), p2 = parseInt(t3.substring(a2, a2 + u2), n2); if (u2 < 8) { var f2 = s(c(n2, u2)); o2 = o2.mul(f2).add(s(p2)); @@ -3848,8 +4533,8 @@ var require_ort_web_node = __commonJS({ } return o2.unsigned = e2, o2; } - function p(t2, e2) { - return "number" == typeof t2 ? s(t2, e2) : "string" == typeof t2 ? l(t2, e2) : u(t2.low, t2.high, "boolean" == typeof e2 ? e2 : t2.unsigned); + function p(t3, e2) { + return "number" == typeof t3 ? s(t3, e2) : "string" == typeof t3 ? l(t3, e2) : u(t3.low, t3.high, "boolean" == typeof e2 ? e2 : t3.unsigned); } n.fromString = l, n.fromValue = p; var f = 4294967296, d = f * f, h = d / 2, g = a(1 << 24), b = a(0); @@ -3873,20 +4558,20 @@ var require_ort_web_node = __commonJS({ return this.unsigned ? this.low >>> 0 : this.low; }, S.toNumber = function() { return this.unsigned ? (this.high >>> 0) * f + (this.low >>> 0) : this.high * f + (this.low >>> 0); - }, S.toString = function(t2) { - if ((t2 = t2 || 10) < 2 || 36 < t2) + }, S.toString = function(t3) { + if ((t3 = t3 || 10) < 2 || 36 < t3) throw RangeError("radix"); if (this.isZero()) return "0"; if (this.isNegative()) { if (this.eq(T)) { - var e2 = s(t2), n2 = this.div(e2), r2 = n2.mul(e2).sub(this); - return n2.toString(t2) + r2.toInt().toString(t2); + var e2 = s(t3), n2 = this.div(e2), r2 = n2.mul(e2).sub(this); + return n2.toString(t3) + r2.toInt().toString(t3); } - return "-" + this.neg().toString(t2); + return "-" + this.neg().toString(t3); } - for (var i3 = s(c(t2, 6), this.unsigned), o2 = this, a2 = ""; ; ) { - var u2 = o2.div(i3), l2 = (o2.sub(u2.mul(i3)).toInt() >>> 0).toString(t2); + for (var i3 = s(c(t3, 6), this.unsigned), o2 = this, a2 = ""; ; ) { + var u2 = o2.div(i3), l2 = (o2.sub(u2.mul(i3)).toInt() >>> 0).toString(t3); if ((o2 = u2).isZero()) return l2 + a2; for (; l2.length < 6; ) @@ -3904,7 +4589,7 @@ var require_ort_web_node = __commonJS({ }, S.getNumBitsAbs = function() { if (this.isNegative()) return this.eq(T) ? 64 : this.neg().getNumBitsAbs(); - for (var t2 = 0 != this.high ? this.high : this.low, e2 = 31; e2 > 0 && 0 == (t2 & 1 << e2); e2--) + for (var t3 = 0 != this.high ? this.high : this.low, e2 = 31; e2 > 0 && 0 == (t3 & 1 << e2); e2--) ; return 0 != this.high ? e2 + 33 : e2 + 1; }, S.isZero = function() { @@ -3917,228 +4602,228 @@ var require_ort_web_node = __commonJS({ return 1 == (1 & this.low); }, S.isEven = function() { return 0 == (1 & this.low); - }, S.equals = function(t2) { - return r(t2) || (t2 = p(t2)), (this.unsigned === t2.unsigned || this.high >>> 31 != 1 || t2.high >>> 31 != 1) && this.high === t2.high && this.low === t2.low; - }, S.eq = S.equals, S.notEquals = function(t2) { - return !this.eq(t2); - }, S.neq = S.notEquals, S.ne = S.notEquals, S.lessThan = function(t2) { - return this.comp(t2) < 0; - }, S.lt = S.lessThan, S.lessThanOrEqual = function(t2) { - return this.comp(t2) <= 0; - }, S.lte = S.lessThanOrEqual, S.le = S.lessThanOrEqual, S.greaterThan = function(t2) { - return this.comp(t2) > 0; - }, S.gt = S.greaterThan, S.greaterThanOrEqual = function(t2) { - return this.comp(t2) >= 0; - }, S.gte = S.greaterThanOrEqual, S.ge = S.greaterThanOrEqual, S.compare = function(t2) { - if (r(t2) || (t2 = p(t2)), this.eq(t2)) + }, S.equals = function(t3) { + return r(t3) || (t3 = p(t3)), (this.unsigned === t3.unsigned || this.high >>> 31 != 1 || t3.high >>> 31 != 1) && this.high === t3.high && this.low === t3.low; + }, S.eq = S.equals, S.notEquals = function(t3) { + return !this.eq(t3); + }, S.neq = S.notEquals, S.ne = S.notEquals, S.lessThan = function(t3) { + return this.comp(t3) < 0; + }, S.lt = S.lessThan, S.lessThanOrEqual = function(t3) { + return this.comp(t3) <= 0; + }, S.lte = S.lessThanOrEqual, S.le = S.lessThanOrEqual, S.greaterThan = function(t3) { + return this.comp(t3) > 0; + }, S.gt = S.greaterThan, S.greaterThanOrEqual = function(t3) { + return this.comp(t3) >= 0; + }, S.gte = S.greaterThanOrEqual, S.ge = S.greaterThanOrEqual, S.compare = function(t3) { + if (r(t3) || (t3 = p(t3)), this.eq(t3)) return 0; - var e2 = this.isNegative(), n2 = t2.isNegative(); - return e2 && !n2 ? -1 : !e2 && n2 ? 1 : this.unsigned ? t2.high >>> 0 > this.high >>> 0 || t2.high === this.high && t2.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(t2).isNegative() ? -1 : 1; + var e2 = this.isNegative(), n2 = t3.isNegative(); + return e2 && !n2 ? -1 : !e2 && n2 ? 1 : this.unsigned ? t3.high >>> 0 > this.high >>> 0 || t3.high === this.high && t3.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(t3).isNegative() ? -1 : 1; }, S.comp = S.compare, S.negate = function() { return !this.unsigned && this.eq(T) ? T : this.not().add(y); - }, S.neg = S.negate, S.add = function(t2) { - r(t2) || (t2 = p(t2)); - var e2 = this.high >>> 16, n2 = 65535 & this.high, i3 = this.low >>> 16, o2 = 65535 & this.low, a2 = t2.high >>> 16, s2 = 65535 & t2.high, c2 = t2.low >>> 16, l2 = 0, f2 = 0, d2 = 0, h2 = 0; - return d2 += (h2 += o2 + (65535 & t2.low)) >>> 16, f2 += (d2 += i3 + c2) >>> 16, l2 += (f2 += n2 + s2) >>> 16, l2 += e2 + a2, u((d2 &= 65535) << 16 | (h2 &= 65535), (l2 &= 65535) << 16 | (f2 &= 65535), this.unsigned); - }, S.subtract = function(t2) { - return r(t2) || (t2 = p(t2)), this.add(t2.neg()); - }, S.sub = S.subtract, S.multiply = function(t2) { + }, S.neg = S.negate, S.add = function(t3) { + r(t3) || (t3 = p(t3)); + var e2 = this.high >>> 16, n2 = 65535 & this.high, i3 = this.low >>> 16, o2 = 65535 & this.low, a2 = t3.high >>> 16, s2 = 65535 & t3.high, c2 = t3.low >>> 16, l2 = 0, f2 = 0, d2 = 0, h2 = 0; + return d2 += (h2 += o2 + (65535 & t3.low)) >>> 16, f2 += (d2 += i3 + c2) >>> 16, l2 += (f2 += n2 + s2) >>> 16, l2 += e2 + a2, u((d2 &= 65535) << 16 | (h2 &= 65535), (l2 &= 65535) << 16 | (f2 &= 65535), this.unsigned); + }, S.subtract = function(t3) { + return r(t3) || (t3 = p(t3)), this.add(t3.neg()); + }, S.sub = S.subtract, S.multiply = function(t3) { if (this.isZero()) return b; - if (r(t2) || (t2 = p(t2)), e) - return u(e.mul(this.low, this.high, t2.low, t2.high), e.get_high(), this.unsigned); - if (t2.isZero()) + if (r(t3) || (t3 = p(t3)), e) + return u(e.mul(this.low, this.high, t3.low, t3.high), e.get_high(), this.unsigned); + if (t3.isZero()) return b; if (this.eq(T)) - return t2.isOdd() ? T : b; - if (t2.eq(T)) + return t3.isOdd() ? T : b; + if (t3.eq(T)) return this.isOdd() ? T : b; if (this.isNegative()) - return t2.isNegative() ? this.neg().mul(t2.neg()) : this.neg().mul(t2).neg(); - if (t2.isNegative()) - return this.mul(t2.neg()).neg(); - if (this.lt(g) && t2.lt(g)) - return s(this.toNumber() * t2.toNumber(), this.unsigned); - var n2 = this.high >>> 16, i3 = 65535 & this.high, o2 = this.low >>> 16, a2 = 65535 & this.low, c2 = t2.high >>> 16, l2 = 65535 & t2.high, f2 = t2.low >>> 16, d2 = 65535 & t2.low, h2 = 0, m2 = 0, y2 = 0, _2 = 0; + return t3.isNegative() ? this.neg().mul(t3.neg()) : this.neg().mul(t3).neg(); + if (t3.isNegative()) + return this.mul(t3.neg()).neg(); + if (this.lt(g) && t3.lt(g)) + return s(this.toNumber() * t3.toNumber(), this.unsigned); + var n2 = this.high >>> 16, i3 = 65535 & this.high, o2 = this.low >>> 16, a2 = 65535 & this.low, c2 = t3.high >>> 16, l2 = 65535 & t3.high, f2 = t3.low >>> 16, d2 = 65535 & t3.low, h2 = 0, m2 = 0, y2 = 0, _2 = 0; return y2 += (_2 += a2 * d2) >>> 16, m2 += (y2 += o2 * d2) >>> 16, y2 &= 65535, m2 += (y2 += a2 * f2) >>> 16, h2 += (m2 += i3 * d2) >>> 16, m2 &= 65535, h2 += (m2 += o2 * f2) >>> 16, m2 &= 65535, h2 += (m2 += a2 * l2) >>> 16, h2 += n2 * d2 + i3 * f2 + o2 * l2 + a2 * c2, u((y2 &= 65535) << 16 | (_2 &= 65535), (h2 &= 65535) << 16 | (m2 &= 65535), this.unsigned); - }, S.mul = S.multiply, S.divide = function(t2) { - if (r(t2) || (t2 = p(t2)), t2.isZero()) + }, S.mul = S.multiply, S.divide = function(t3) { + if (r(t3) || (t3 = p(t3)), t3.isZero()) throw Error("division by zero"); var n2, i3, o2; if (e) - return this.unsigned || -2147483648 !== this.high || -1 !== t2.low || -1 !== t2.high ? u((this.unsigned ? e.div_u : e.div_s)(this.low, this.high, t2.low, t2.high), e.get_high(), this.unsigned) : this; + return this.unsigned || -2147483648 !== this.high || -1 !== t3.low || -1 !== t3.high ? u((this.unsigned ? e.div_u : e.div_s)(this.low, this.high, t3.low, t3.high), e.get_high(), this.unsigned) : this; if (this.isZero()) return this.unsigned ? m : b; if (this.unsigned) { - if (t2.unsigned || (t2 = t2.toUnsigned()), t2.gt(this)) + if (t3.unsigned || (t3 = t3.toUnsigned()), t3.gt(this)) return m; - if (t2.gt(this.shru(1))) + if (t3.gt(this.shru(1))) return _; o2 = m; } else { if (this.eq(T)) - return t2.eq(y) || t2.eq(v) ? T : t2.eq(T) ? y : (n2 = this.shr(1).div(t2).shl(1)).eq(b) ? t2.isNegative() ? y : v : (i3 = this.sub(t2.mul(n2)), o2 = n2.add(i3.div(t2))); - if (t2.eq(T)) + return t3.eq(y) || t3.eq(v) ? T : t3.eq(T) ? y : (n2 = this.shr(1).div(t3).shl(1)).eq(b) ? t3.isNegative() ? y : v : (i3 = this.sub(t3.mul(n2)), o2 = n2.add(i3.div(t3))); + if (t3.eq(T)) return this.unsigned ? m : b; if (this.isNegative()) - return t2.isNegative() ? this.neg().div(t2.neg()) : this.neg().div(t2).neg(); - if (t2.isNegative()) - return this.div(t2.neg()).neg(); + return t3.isNegative() ? this.neg().div(t3.neg()) : this.neg().div(t3).neg(); + if (t3.isNegative()) + return this.div(t3.neg()).neg(); o2 = b; } - for (i3 = this; i3.gte(t2); ) { - n2 = Math.max(1, Math.floor(i3.toNumber() / t2.toNumber())); - for (var a2 = Math.ceil(Math.log(n2) / Math.LN2), l2 = a2 <= 48 ? 1 : c(2, a2 - 48), f2 = s(n2), d2 = f2.mul(t2); d2.isNegative() || d2.gt(i3); ) - d2 = (f2 = s(n2 -= l2, this.unsigned)).mul(t2); + for (i3 = this; i3.gte(t3); ) { + n2 = Math.max(1, Math.floor(i3.toNumber() / t3.toNumber())); + for (var a2 = Math.ceil(Math.log(n2) / Math.LN2), l2 = a2 <= 48 ? 1 : c(2, a2 - 48), f2 = s(n2), d2 = f2.mul(t3); d2.isNegative() || d2.gt(i3); ) + d2 = (f2 = s(n2 -= l2, this.unsigned)).mul(t3); f2.isZero() && (f2 = y), o2 = o2.add(f2), i3 = i3.sub(d2); } return o2; - }, S.div = S.divide, S.modulo = function(t2) { - return r(t2) || (t2 = p(t2)), e ? u((this.unsigned ? e.rem_u : e.rem_s)(this.low, this.high, t2.low, t2.high), e.get_high(), this.unsigned) : this.sub(this.div(t2).mul(t2)); + }, S.div = S.divide, S.modulo = function(t3) { + return r(t3) || (t3 = p(t3)), e ? u((this.unsigned ? e.rem_u : e.rem_s)(this.low, this.high, t3.low, t3.high), e.get_high(), this.unsigned) : this.sub(this.div(t3).mul(t3)); }, S.mod = S.modulo, S.rem = S.modulo, S.not = function() { return u(~this.low, ~this.high, this.unsigned); - }, S.and = function(t2) { - return r(t2) || (t2 = p(t2)), u(this.low & t2.low, this.high & t2.high, this.unsigned); - }, S.or = function(t2) { - return r(t2) || (t2 = p(t2)), u(this.low | t2.low, this.high | t2.high, this.unsigned); - }, S.xor = function(t2) { - return r(t2) || (t2 = p(t2)), u(this.low ^ t2.low, this.high ^ t2.high, this.unsigned); - }, S.shiftLeft = function(t2) { - return r(t2) && (t2 = t2.toInt()), 0 == (t2 &= 63) ? this : t2 < 32 ? u(this.low << t2, this.high << t2 | this.low >>> 32 - t2, this.unsigned) : u(0, this.low << t2 - 32, this.unsigned); - }, S.shl = S.shiftLeft, S.shiftRight = function(t2) { - return r(t2) && (t2 = t2.toInt()), 0 == (t2 &= 63) ? this : t2 < 32 ? u(this.low >>> t2 | this.high << 32 - t2, this.high >> t2, this.unsigned) : u(this.high >> t2 - 32, this.high >= 0 ? 0 : -1, this.unsigned); - }, S.shr = S.shiftRight, S.shiftRightUnsigned = function(t2) { - if (r(t2) && (t2 = t2.toInt()), 0 == (t2 &= 63)) + }, S.and = function(t3) { + return r(t3) || (t3 = p(t3)), u(this.low & t3.low, this.high & t3.high, this.unsigned); + }, S.or = function(t3) { + return r(t3) || (t3 = p(t3)), u(this.low | t3.low, this.high | t3.high, this.unsigned); + }, S.xor = function(t3) { + return r(t3) || (t3 = p(t3)), u(this.low ^ t3.low, this.high ^ t3.high, this.unsigned); + }, S.shiftLeft = function(t3) { + return r(t3) && (t3 = t3.toInt()), 0 == (t3 &= 63) ? this : t3 < 32 ? u(this.low << t3, this.high << t3 | this.low >>> 32 - t3, this.unsigned) : u(0, this.low << t3 - 32, this.unsigned); + }, S.shl = S.shiftLeft, S.shiftRight = function(t3) { + return r(t3) && (t3 = t3.toInt()), 0 == (t3 &= 63) ? this : t3 < 32 ? u(this.low >>> t3 | this.high << 32 - t3, this.high >> t3, this.unsigned) : u(this.high >> t3 - 32, this.high >= 0 ? 0 : -1, this.unsigned); + }, S.shr = S.shiftRight, S.shiftRightUnsigned = function(t3) { + if (r(t3) && (t3 = t3.toInt()), 0 == (t3 &= 63)) return this; var e2 = this.high; - return t2 < 32 ? u(this.low >>> t2 | e2 << 32 - t2, e2 >>> t2, this.unsigned) : u(32 === t2 ? e2 : e2 >>> t2 - 32, 0, this.unsigned); + return t3 < 32 ? u(this.low >>> t3 | e2 << 32 - t3, e2 >>> t3, this.unsigned) : u(32 === t3 ? e2 : e2 >>> t3 - 32, 0, this.unsigned); }, S.shru = S.shiftRightUnsigned, S.shr_u = S.shiftRightUnsigned, S.toSigned = function() { return this.unsigned ? u(this.low, this.high, false) : this; }, S.toUnsigned = function() { return this.unsigned ? this : u(this.low, this.high, true); - }, S.toBytes = function(t2) { - return t2 ? this.toBytesLE() : this.toBytesBE(); + }, S.toBytes = function(t3) { + return t3 ? this.toBytesLE() : this.toBytesBE(); }, S.toBytesLE = function() { - var t2 = this.high, e2 = this.low; - return [255 & e2, e2 >>> 8 & 255, e2 >>> 16 & 255, e2 >>> 24, 255 & t2, t2 >>> 8 & 255, t2 >>> 16 & 255, t2 >>> 24]; + var t3 = this.high, e2 = this.low; + return [255 & e2, e2 >>> 8 & 255, e2 >>> 16 & 255, e2 >>> 24, 255 & t3, t3 >>> 8 & 255, t3 >>> 16 & 255, t3 >>> 24]; }, S.toBytesBE = function() { - var t2 = this.high, e2 = this.low; - return [t2 >>> 24, t2 >>> 16 & 255, t2 >>> 8 & 255, 255 & t2, e2 >>> 24, e2 >>> 16 & 255, e2 >>> 8 & 255, 255 & e2]; - }, n.fromBytes = function(t2, e2, r2) { - return r2 ? n.fromBytesLE(t2, e2) : n.fromBytesBE(t2, e2); - }, n.fromBytesLE = function(t2, e2) { - return new n(t2[0] | t2[1] << 8 | t2[2] << 16 | t2[3] << 24, t2[4] | t2[5] << 8 | t2[6] << 16 | t2[7] << 24, e2); - }, n.fromBytesBE = function(t2, e2) { - return new n(t2[4] << 24 | t2[5] << 16 | t2[6] << 8 | t2[7], t2[0] << 24 | t2[1] << 16 | t2[2] << 8 | t2[3], e2); + var t3 = this.high, e2 = this.low; + return [t3 >>> 24, t3 >>> 16 & 255, t3 >>> 8 & 255, 255 & t3, e2 >>> 24, e2 >>> 16 & 255, e2 >>> 8 & 255, 255 & e2]; + }, n.fromBytes = function(t3, e2, r2) { + return r2 ? n.fromBytesLE(t3, e2) : n.fromBytesBE(t3, e2); + }, n.fromBytesLE = function(t3, e2) { + return new n(t3[0] | t3[1] << 8 | t3[2] << 16 | t3[3] << 24, t3[4] | t3[5] << 8 | t3[6] << 16 | t3[7] << 24, e2); + }, n.fromBytesBE = function(t3, e2) { + return new n(t3[4] << 24 | t3[5] << 16 | t3[6] << 8 | t3[7], t3[0] << 24 | t3[1] << 16 | t3[2] << 8 | t3[3], e2); }; - }, 1446: (t, e, n) => { + }, 1446: (t2, e, n) => { "use strict"; var r, i2, o, a = n(2100), s = a.Reader, u = a.Writer, c = a.util, l = a.roots.default || (a.roots.default = {}); l.onnx = ((o = {}).Version = (r = {}, (i2 = Object.create(r))[r[0] = "_START_VERSION"] = 0, i2[r[1] = "IR_VERSION_2017_10_10"] = 1, i2[r[2] = "IR_VERSION_2017_10_30"] = 2, i2[r[3] = "IR_VERSION_2017_11_3"] = 3, i2[r[4] = "IR_VERSION_2019_1_22"] = 4, i2[r[5] = "IR_VERSION"] = 5, i2), o.AttributeProto = function() { - function t2(t3) { - if (this.floats = [], this.ints = [], this.strings = [], this.tensors = [], this.graphs = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.floats = [], this.ints = [], this.strings = [], this.tensors = [], this.graphs = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.name = "", t2.prototype.refAttrName = "", t2.prototype.docString = "", t2.prototype.type = 0, t2.prototype.f = 0, t2.prototype.i = c.Long ? c.Long.fromBits(0, 0, false) : 0, t2.prototype.s = c.newBuffer([]), t2.prototype.t = null, t2.prototype.g = null, t2.prototype.floats = c.emptyArray, t2.prototype.ints = c.emptyArray, t2.prototype.strings = c.emptyArray, t2.prototype.tensors = c.emptyArray, t2.prototype.graphs = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.name && t3.hasOwnProperty("name") && e2.uint32(10).string(t3.name), null != t3.f && t3.hasOwnProperty("f") && e2.uint32(21).float(t3.f), null != t3.i && t3.hasOwnProperty("i") && e2.uint32(24).int64(t3.i), null != t3.s && t3.hasOwnProperty("s") && e2.uint32(34).bytes(t3.s), null != t3.t && t3.hasOwnProperty("t") && l.onnx.TensorProto.encode(t3.t, e2.uint32(42).fork()).ldelim(), null != t3.g && t3.hasOwnProperty("g") && l.onnx.GraphProto.encode(t3.g, e2.uint32(50).fork()).ldelim(), null != t3.floats && t3.floats.length) { + return t3.prototype.name = "", t3.prototype.refAttrName = "", t3.prototype.docString = "", t3.prototype.type = 0, t3.prototype.f = 0, t3.prototype.i = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.prototype.s = c.newBuffer([]), t3.prototype.t = null, t3.prototype.g = null, t3.prototype.floats = c.emptyArray, t3.prototype.ints = c.emptyArray, t3.prototype.strings = c.emptyArray, t3.prototype.tensors = c.emptyArray, t3.prototype.graphs = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.name && t4.hasOwnProperty("name") && e2.uint32(10).string(t4.name), null != t4.f && t4.hasOwnProperty("f") && e2.uint32(21).float(t4.f), null != t4.i && t4.hasOwnProperty("i") && e2.uint32(24).int64(t4.i), null != t4.s && t4.hasOwnProperty("s") && e2.uint32(34).bytes(t4.s), null != t4.t && t4.hasOwnProperty("t") && l.onnx.TensorProto.encode(t4.t, e2.uint32(42).fork()).ldelim(), null != t4.g && t4.hasOwnProperty("g") && l.onnx.GraphProto.encode(t4.g, e2.uint32(50).fork()).ldelim(), null != t4.floats && t4.floats.length) { e2.uint32(58).fork(); - for (var n2 = 0; n2 < t3.floats.length; ++n2) - e2.float(t3.floats[n2]); + for (var n2 = 0; n2 < t4.floats.length; ++n2) + e2.float(t4.floats[n2]); e2.ldelim(); } - if (null != t3.ints && t3.ints.length) { - for (e2.uint32(66).fork(), n2 = 0; n2 < t3.ints.length; ++n2) - e2.int64(t3.ints[n2]); + if (null != t4.ints && t4.ints.length) { + for (e2.uint32(66).fork(), n2 = 0; n2 < t4.ints.length; ++n2) + e2.int64(t4.ints[n2]); e2.ldelim(); } - if (null != t3.strings && t3.strings.length) - for (n2 = 0; n2 < t3.strings.length; ++n2) - e2.uint32(74).bytes(t3.strings[n2]); - if (null != t3.tensors && t3.tensors.length) - for (n2 = 0; n2 < t3.tensors.length; ++n2) - l.onnx.TensorProto.encode(t3.tensors[n2], e2.uint32(82).fork()).ldelim(); - if (null != t3.graphs && t3.graphs.length) - for (n2 = 0; n2 < t3.graphs.length; ++n2) - l.onnx.GraphProto.encode(t3.graphs[n2], e2.uint32(90).fork()).ldelim(); - return null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(106).string(t3.docString), null != t3.type && t3.hasOwnProperty("type") && e2.uint32(160).int32(t3.type), null != t3.refAttrName && t3.hasOwnProperty("refAttrName") && e2.uint32(170).string(t3.refAttrName), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.AttributeProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + if (null != t4.strings && t4.strings.length) + for (n2 = 0; n2 < t4.strings.length; ++n2) + e2.uint32(74).bytes(t4.strings[n2]); + if (null != t4.tensors && t4.tensors.length) + for (n2 = 0; n2 < t4.tensors.length; ++n2) + l.onnx.TensorProto.encode(t4.tensors[n2], e2.uint32(82).fork()).ldelim(); + if (null != t4.graphs && t4.graphs.length) + for (n2 = 0; n2 < t4.graphs.length; ++n2) + l.onnx.GraphProto.encode(t4.graphs[n2], e2.uint32(90).fork()).ldelim(); + return null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(106).string(t4.docString), null != t4.type && t4.hasOwnProperty("type") && e2.uint32(160).int32(t4.type), null != t4.refAttrName && t4.hasOwnProperty("refAttrName") && e2.uint32(170).string(t4.refAttrName), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.AttributeProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.name = t3.string(); + r2.name = t4.string(); break; case 21: - r2.refAttrName = t3.string(); + r2.refAttrName = t4.string(); break; case 13: - r2.docString = t3.string(); + r2.docString = t4.string(); break; case 20: - r2.type = t3.int32(); + r2.type = t4.int32(); break; case 2: - r2.f = t3.float(); + r2.f = t4.float(); break; case 3: - r2.i = t3.int64(); + r2.i = t4.int64(); break; case 4: - r2.s = t3.bytes(); + r2.s = t4.bytes(); break; case 5: - r2.t = l.onnx.TensorProto.decode(t3, t3.uint32()); + r2.t = l.onnx.TensorProto.decode(t4, t4.uint32()); break; case 6: - r2.g = l.onnx.GraphProto.decode(t3, t3.uint32()); + r2.g = l.onnx.GraphProto.decode(t4, t4.uint32()); break; case 7: if (r2.floats && r2.floats.length || (r2.floats = []), 2 == (7 & i3)) - for (var o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.floats.push(t3.float()); + for (var o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.floats.push(t4.float()); else - r2.floats.push(t3.float()); + r2.floats.push(t4.float()); break; case 8: if (r2.ints && r2.ints.length || (r2.ints = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.ints.push(t3.int64()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.ints.push(t4.int64()); else - r2.ints.push(t3.int64()); + r2.ints.push(t4.int64()); break; case 9: - r2.strings && r2.strings.length || (r2.strings = []), r2.strings.push(t3.bytes()); + r2.strings && r2.strings.length || (r2.strings = []), r2.strings.push(t4.bytes()); break; case 10: - r2.tensors && r2.tensors.length || (r2.tensors = []), r2.tensors.push(l.onnx.TensorProto.decode(t3, t3.uint32())); + r2.tensors && r2.tensors.length || (r2.tensors = []), r2.tensors.push(l.onnx.TensorProto.decode(t4, t4.uint32())); break; case 11: - r2.graphs && r2.graphs.length || (r2.graphs = []), r2.graphs.push(l.onnx.GraphProto.decode(t3, t3.uint32())); + r2.graphs && r2.graphs.length || (r2.graphs = []), r2.graphs.push(l.onnx.GraphProto.decode(t4, t4.uint32())); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.name && t3.hasOwnProperty("name") && !c.isString(t3.name)) + if (null != t4.name && t4.hasOwnProperty("name") && !c.isString(t4.name)) return "name: string expected"; - if (null != t3.refAttrName && t3.hasOwnProperty("refAttrName") && !c.isString(t3.refAttrName)) + if (null != t4.refAttrName && t4.hasOwnProperty("refAttrName") && !c.isString(t4.refAttrName)) return "refAttrName: string expected"; - if (null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString)) + if (null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString)) return "docString: string expected"; - if (null != t3.type && t3.hasOwnProperty("type")) - switch (t3.type) { + if (null != t4.type && t4.hasOwnProperty("type")) + switch (t4.type) { default: return "type: enum value expected"; case 0: @@ -4153,59 +4838,59 @@ var require_ort_web_node = __commonJS({ case 9: case 10: } - if (null != t3.f && t3.hasOwnProperty("f") && "number" != typeof t3.f) + if (null != t4.f && t4.hasOwnProperty("f") && "number" != typeof t4.f) return "f: number expected"; - if (null != t3.i && t3.hasOwnProperty("i") && !(c.isInteger(t3.i) || t3.i && c.isInteger(t3.i.low) && c.isInteger(t3.i.high))) + if (null != t4.i && t4.hasOwnProperty("i") && !(c.isInteger(t4.i) || t4.i && c.isInteger(t4.i.low) && c.isInteger(t4.i.high))) return "i: integer|Long expected"; - if (null != t3.s && t3.hasOwnProperty("s") && !(t3.s && "number" == typeof t3.s.length || c.isString(t3.s))) + if (null != t4.s && t4.hasOwnProperty("s") && !(t4.s && "number" == typeof t4.s.length || c.isString(t4.s))) return "s: buffer expected"; - if (null != t3.t && t3.hasOwnProperty("t") && (n2 = l.onnx.TensorProto.verify(t3.t))) + if (null != t4.t && t4.hasOwnProperty("t") && (n2 = l.onnx.TensorProto.verify(t4.t))) return "t." + n2; - if (null != t3.g && t3.hasOwnProperty("g") && (n2 = l.onnx.GraphProto.verify(t3.g))) + if (null != t4.g && t4.hasOwnProperty("g") && (n2 = l.onnx.GraphProto.verify(t4.g))) return "g." + n2; - if (null != t3.floats && t3.hasOwnProperty("floats")) { - if (!Array.isArray(t3.floats)) + if (null != t4.floats && t4.hasOwnProperty("floats")) { + if (!Array.isArray(t4.floats)) return "floats: array expected"; - for (var e2 = 0; e2 < t3.floats.length; ++e2) - if ("number" != typeof t3.floats[e2]) + for (var e2 = 0; e2 < t4.floats.length; ++e2) + if ("number" != typeof t4.floats[e2]) return "floats: number[] expected"; } - if (null != t3.ints && t3.hasOwnProperty("ints")) { - if (!Array.isArray(t3.ints)) + if (null != t4.ints && t4.hasOwnProperty("ints")) { + if (!Array.isArray(t4.ints)) return "ints: array expected"; - for (e2 = 0; e2 < t3.ints.length; ++e2) - if (!(c.isInteger(t3.ints[e2]) || t3.ints[e2] && c.isInteger(t3.ints[e2].low) && c.isInteger(t3.ints[e2].high))) + for (e2 = 0; e2 < t4.ints.length; ++e2) + if (!(c.isInteger(t4.ints[e2]) || t4.ints[e2] && c.isInteger(t4.ints[e2].low) && c.isInteger(t4.ints[e2].high))) return "ints: integer|Long[] expected"; } - if (null != t3.strings && t3.hasOwnProperty("strings")) { - if (!Array.isArray(t3.strings)) + if (null != t4.strings && t4.hasOwnProperty("strings")) { + if (!Array.isArray(t4.strings)) return "strings: array expected"; - for (e2 = 0; e2 < t3.strings.length; ++e2) - if (!(t3.strings[e2] && "number" == typeof t3.strings[e2].length || c.isString(t3.strings[e2]))) + for (e2 = 0; e2 < t4.strings.length; ++e2) + if (!(t4.strings[e2] && "number" == typeof t4.strings[e2].length || c.isString(t4.strings[e2]))) return "strings: buffer[] expected"; } - if (null != t3.tensors && t3.hasOwnProperty("tensors")) { - if (!Array.isArray(t3.tensors)) + if (null != t4.tensors && t4.hasOwnProperty("tensors")) { + if (!Array.isArray(t4.tensors)) return "tensors: array expected"; - for (e2 = 0; e2 < t3.tensors.length; ++e2) - if (n2 = l.onnx.TensorProto.verify(t3.tensors[e2])) + for (e2 = 0; e2 < t4.tensors.length; ++e2) + if (n2 = l.onnx.TensorProto.verify(t4.tensors[e2])) return "tensors." + n2; } - if (null != t3.graphs && t3.hasOwnProperty("graphs")) { - if (!Array.isArray(t3.graphs)) + if (null != t4.graphs && t4.hasOwnProperty("graphs")) { + if (!Array.isArray(t4.graphs)) return "graphs: array expected"; - for (e2 = 0; e2 < t3.graphs.length; ++e2) { + for (e2 = 0; e2 < t4.graphs.length; ++e2) { var n2; - if (n2 = l.onnx.GraphProto.verify(t3.graphs[e2])) + if (n2 = l.onnx.GraphProto.verify(t4.graphs[e2])) return "graphs." + n2; } } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.AttributeProto) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.AttributeProto) + return t4; var e2 = new l.onnx.AttributeProto(); - switch (null != t3.name && (e2.name = String(t3.name)), null != t3.refAttrName && (e2.refAttrName = String(t3.refAttrName)), null != t3.docString && (e2.docString = String(t3.docString)), t3.type) { + switch (null != t4.name && (e2.name = String(t4.name)), null != t4.refAttrName && (e2.refAttrName = String(t4.refAttrName)), null != t4.docString && (e2.docString = String(t4.docString)), t4.type) { case "UNDEFINED": case 0: e2.type = 0; @@ -4250,55 +4935,55 @@ var require_ort_web_node = __commonJS({ case 10: e2.type = 10; } - if (null != t3.f && (e2.f = Number(t3.f)), null != t3.i && (c.Long ? (e2.i = c.Long.fromValue(t3.i)).unsigned = false : "string" == typeof t3.i ? e2.i = parseInt(t3.i, 10) : "number" == typeof t3.i ? e2.i = t3.i : "object" == typeof t3.i && (e2.i = new c.LongBits(t3.i.low >>> 0, t3.i.high >>> 0).toNumber())), null != t3.s && ("string" == typeof t3.s ? c.base64.decode(t3.s, e2.s = c.newBuffer(c.base64.length(t3.s)), 0) : t3.s.length && (e2.s = t3.s)), null != t3.t) { - if ("object" != typeof t3.t) + if (null != t4.f && (e2.f = Number(t4.f)), null != t4.i && (c.Long ? (e2.i = c.Long.fromValue(t4.i)).unsigned = false : "string" == typeof t4.i ? e2.i = parseInt(t4.i, 10) : "number" == typeof t4.i ? e2.i = t4.i : "object" == typeof t4.i && (e2.i = new c.LongBits(t4.i.low >>> 0, t4.i.high >>> 0).toNumber())), null != t4.s && ("string" == typeof t4.s ? c.base64.decode(t4.s, e2.s = c.newBuffer(c.base64.length(t4.s)), 0) : t4.s.length && (e2.s = t4.s)), null != t4.t) { + if ("object" != typeof t4.t) throw TypeError(".onnx.AttributeProto.t: object expected"); - e2.t = l.onnx.TensorProto.fromObject(t3.t); + e2.t = l.onnx.TensorProto.fromObject(t4.t); } - if (null != t3.g) { - if ("object" != typeof t3.g) + if (null != t4.g) { + if ("object" != typeof t4.g) throw TypeError(".onnx.AttributeProto.g: object expected"); - e2.g = l.onnx.GraphProto.fromObject(t3.g); + e2.g = l.onnx.GraphProto.fromObject(t4.g); } - if (t3.floats) { - if (!Array.isArray(t3.floats)) + if (t4.floats) { + if (!Array.isArray(t4.floats)) throw TypeError(".onnx.AttributeProto.floats: array expected"); e2.floats = []; - for (var n2 = 0; n2 < t3.floats.length; ++n2) - e2.floats[n2] = Number(t3.floats[n2]); + for (var n2 = 0; n2 < t4.floats.length; ++n2) + e2.floats[n2] = Number(t4.floats[n2]); } - if (t3.ints) { - if (!Array.isArray(t3.ints)) + if (t4.ints) { + if (!Array.isArray(t4.ints)) throw TypeError(".onnx.AttributeProto.ints: array expected"); - for (e2.ints = [], n2 = 0; n2 < t3.ints.length; ++n2) - c.Long ? (e2.ints[n2] = c.Long.fromValue(t3.ints[n2])).unsigned = false : "string" == typeof t3.ints[n2] ? e2.ints[n2] = parseInt(t3.ints[n2], 10) : "number" == typeof t3.ints[n2] ? e2.ints[n2] = t3.ints[n2] : "object" == typeof t3.ints[n2] && (e2.ints[n2] = new c.LongBits(t3.ints[n2].low >>> 0, t3.ints[n2].high >>> 0).toNumber()); + for (e2.ints = [], n2 = 0; n2 < t4.ints.length; ++n2) + c.Long ? (e2.ints[n2] = c.Long.fromValue(t4.ints[n2])).unsigned = false : "string" == typeof t4.ints[n2] ? e2.ints[n2] = parseInt(t4.ints[n2], 10) : "number" == typeof t4.ints[n2] ? e2.ints[n2] = t4.ints[n2] : "object" == typeof t4.ints[n2] && (e2.ints[n2] = new c.LongBits(t4.ints[n2].low >>> 0, t4.ints[n2].high >>> 0).toNumber()); } - if (t3.strings) { - if (!Array.isArray(t3.strings)) + if (t4.strings) { + if (!Array.isArray(t4.strings)) throw TypeError(".onnx.AttributeProto.strings: array expected"); - for (e2.strings = [], n2 = 0; n2 < t3.strings.length; ++n2) - "string" == typeof t3.strings[n2] ? c.base64.decode(t3.strings[n2], e2.strings[n2] = c.newBuffer(c.base64.length(t3.strings[n2])), 0) : t3.strings[n2].length && (e2.strings[n2] = t3.strings[n2]); + for (e2.strings = [], n2 = 0; n2 < t4.strings.length; ++n2) + "string" == typeof t4.strings[n2] ? c.base64.decode(t4.strings[n2], e2.strings[n2] = c.newBuffer(c.base64.length(t4.strings[n2])), 0) : t4.strings[n2].length && (e2.strings[n2] = t4.strings[n2]); } - if (t3.tensors) { - if (!Array.isArray(t3.tensors)) + if (t4.tensors) { + if (!Array.isArray(t4.tensors)) throw TypeError(".onnx.AttributeProto.tensors: array expected"); - for (e2.tensors = [], n2 = 0; n2 < t3.tensors.length; ++n2) { - if ("object" != typeof t3.tensors[n2]) + for (e2.tensors = [], n2 = 0; n2 < t4.tensors.length; ++n2) { + if ("object" != typeof t4.tensors[n2]) throw TypeError(".onnx.AttributeProto.tensors: object expected"); - e2.tensors[n2] = l.onnx.TensorProto.fromObject(t3.tensors[n2]); + e2.tensors[n2] = l.onnx.TensorProto.fromObject(t4.tensors[n2]); } } - if (t3.graphs) { - if (!Array.isArray(t3.graphs)) + if (t4.graphs) { + if (!Array.isArray(t4.graphs)) throw TypeError(".onnx.AttributeProto.graphs: array expected"); - for (e2.graphs = [], n2 = 0; n2 < t3.graphs.length; ++n2) { - if ("object" != typeof t3.graphs[n2]) + for (e2.graphs = [], n2 = 0; n2 < t4.graphs.length; ++n2) { + if ("object" != typeof t4.graphs[n2]) throw TypeError(".onnx.AttributeProto.graphs: object expected"); - e2.graphs[n2] = l.onnx.GraphProto.fromObject(t3.graphs[n2]); + e2.graphs[n2] = l.onnx.GraphProto.fromObject(t4.graphs[n2]); } } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; if ((e2.arrays || e2.defaults) && (n2.floats = [], n2.ints = [], n2.strings = [], n2.tensors = [], n2.graphs = []), e2.defaults) { @@ -4309,344 +4994,344 @@ var require_ort_web_node = __commonJS({ n2.i = e2.longs === String ? "0" : 0; e2.bytes === String ? n2.s = "" : (n2.s = [], e2.bytes !== Array && (n2.s = c.newBuffer(n2.s))), n2.t = null, n2.g = null, n2.docString = "", n2.type = e2.enums === String ? "UNDEFINED" : 0, n2.refAttrName = ""; } - if (null != t3.name && t3.hasOwnProperty("name") && (n2.name = t3.name), null != t3.f && t3.hasOwnProperty("f") && (n2.f = e2.json && !isFinite(t3.f) ? String(t3.f) : t3.f), null != t3.i && t3.hasOwnProperty("i") && ("number" == typeof t3.i ? n2.i = e2.longs === String ? String(t3.i) : t3.i : n2.i = e2.longs === String ? c.Long.prototype.toString.call(t3.i) : e2.longs === Number ? new c.LongBits(t3.i.low >>> 0, t3.i.high >>> 0).toNumber() : t3.i), null != t3.s && t3.hasOwnProperty("s") && (n2.s = e2.bytes === String ? c.base64.encode(t3.s, 0, t3.s.length) : e2.bytes === Array ? Array.prototype.slice.call(t3.s) : t3.s), null != t3.t && t3.hasOwnProperty("t") && (n2.t = l.onnx.TensorProto.toObject(t3.t, e2)), null != t3.g && t3.hasOwnProperty("g") && (n2.g = l.onnx.GraphProto.toObject(t3.g, e2)), t3.floats && t3.floats.length) { + if (null != t4.name && t4.hasOwnProperty("name") && (n2.name = t4.name), null != t4.f && t4.hasOwnProperty("f") && (n2.f = e2.json && !isFinite(t4.f) ? String(t4.f) : t4.f), null != t4.i && t4.hasOwnProperty("i") && ("number" == typeof t4.i ? n2.i = e2.longs === String ? String(t4.i) : t4.i : n2.i = e2.longs === String ? c.Long.prototype.toString.call(t4.i) : e2.longs === Number ? new c.LongBits(t4.i.low >>> 0, t4.i.high >>> 0).toNumber() : t4.i), null != t4.s && t4.hasOwnProperty("s") && (n2.s = e2.bytes === String ? c.base64.encode(t4.s, 0, t4.s.length) : e2.bytes === Array ? Array.prototype.slice.call(t4.s) : t4.s), null != t4.t && t4.hasOwnProperty("t") && (n2.t = l.onnx.TensorProto.toObject(t4.t, e2)), null != t4.g && t4.hasOwnProperty("g") && (n2.g = l.onnx.GraphProto.toObject(t4.g, e2)), t4.floats && t4.floats.length) { n2.floats = []; - for (var i3 = 0; i3 < t3.floats.length; ++i3) - n2.floats[i3] = e2.json && !isFinite(t3.floats[i3]) ? String(t3.floats[i3]) : t3.floats[i3]; + for (var i3 = 0; i3 < t4.floats.length; ++i3) + n2.floats[i3] = e2.json && !isFinite(t4.floats[i3]) ? String(t4.floats[i3]) : t4.floats[i3]; } - if (t3.ints && t3.ints.length) - for (n2.ints = [], i3 = 0; i3 < t3.ints.length; ++i3) - "number" == typeof t3.ints[i3] ? n2.ints[i3] = e2.longs === String ? String(t3.ints[i3]) : t3.ints[i3] : n2.ints[i3] = e2.longs === String ? c.Long.prototype.toString.call(t3.ints[i3]) : e2.longs === Number ? new c.LongBits(t3.ints[i3].low >>> 0, t3.ints[i3].high >>> 0).toNumber() : t3.ints[i3]; - if (t3.strings && t3.strings.length) - for (n2.strings = [], i3 = 0; i3 < t3.strings.length; ++i3) - n2.strings[i3] = e2.bytes === String ? c.base64.encode(t3.strings[i3], 0, t3.strings[i3].length) : e2.bytes === Array ? Array.prototype.slice.call(t3.strings[i3]) : t3.strings[i3]; - if (t3.tensors && t3.tensors.length) - for (n2.tensors = [], i3 = 0; i3 < t3.tensors.length; ++i3) - n2.tensors[i3] = l.onnx.TensorProto.toObject(t3.tensors[i3], e2); - if (t3.graphs && t3.graphs.length) - for (n2.graphs = [], i3 = 0; i3 < t3.graphs.length; ++i3) - n2.graphs[i3] = l.onnx.GraphProto.toObject(t3.graphs[i3], e2); - return null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), null != t3.type && t3.hasOwnProperty("type") && (n2.type = e2.enums === String ? l.onnx.AttributeProto.AttributeType[t3.type] : t3.type), null != t3.refAttrName && t3.hasOwnProperty("refAttrName") && (n2.refAttrName = t3.refAttrName), n2; - }, t2.prototype.toJSON = function() { + if (t4.ints && t4.ints.length) + for (n2.ints = [], i3 = 0; i3 < t4.ints.length; ++i3) + "number" == typeof t4.ints[i3] ? n2.ints[i3] = e2.longs === String ? String(t4.ints[i3]) : t4.ints[i3] : n2.ints[i3] = e2.longs === String ? c.Long.prototype.toString.call(t4.ints[i3]) : e2.longs === Number ? new c.LongBits(t4.ints[i3].low >>> 0, t4.ints[i3].high >>> 0).toNumber() : t4.ints[i3]; + if (t4.strings && t4.strings.length) + for (n2.strings = [], i3 = 0; i3 < t4.strings.length; ++i3) + n2.strings[i3] = e2.bytes === String ? c.base64.encode(t4.strings[i3], 0, t4.strings[i3].length) : e2.bytes === Array ? Array.prototype.slice.call(t4.strings[i3]) : t4.strings[i3]; + if (t4.tensors && t4.tensors.length) + for (n2.tensors = [], i3 = 0; i3 < t4.tensors.length; ++i3) + n2.tensors[i3] = l.onnx.TensorProto.toObject(t4.tensors[i3], e2); + if (t4.graphs && t4.graphs.length) + for (n2.graphs = [], i3 = 0; i3 < t4.graphs.length; ++i3) + n2.graphs[i3] = l.onnx.GraphProto.toObject(t4.graphs[i3], e2); + return null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), null != t4.type && t4.hasOwnProperty("type") && (n2.type = e2.enums === String ? l.onnx.AttributeProto.AttributeType[t4.type] : t4.type), null != t4.refAttrName && t4.hasOwnProperty("refAttrName") && (n2.refAttrName = t4.refAttrName), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2.AttributeType = function() { - var t3 = {}, e2 = Object.create(t3); - return e2[t3[0] = "UNDEFINED"] = 0, e2[t3[1] = "FLOAT"] = 1, e2[t3[2] = "INT"] = 2, e2[t3[3] = "STRING"] = 3, e2[t3[4] = "TENSOR"] = 4, e2[t3[5] = "GRAPH"] = 5, e2[t3[6] = "FLOATS"] = 6, e2[t3[7] = "INTS"] = 7, e2[t3[8] = "STRINGS"] = 8, e2[t3[9] = "TENSORS"] = 9, e2[t3[10] = "GRAPHS"] = 10, e2; - }(), t2; + }, t3.AttributeType = function() { + var t4 = {}, e2 = Object.create(t4); + return e2[t4[0] = "UNDEFINED"] = 0, e2[t4[1] = "FLOAT"] = 1, e2[t4[2] = "INT"] = 2, e2[t4[3] = "STRING"] = 3, e2[t4[4] = "TENSOR"] = 4, e2[t4[5] = "GRAPH"] = 5, e2[t4[6] = "FLOATS"] = 6, e2[t4[7] = "INTS"] = 7, e2[t4[8] = "STRINGS"] = 8, e2[t4[9] = "TENSORS"] = 9, e2[t4[10] = "GRAPHS"] = 10, e2; + }(), t3; }(), o.ValueInfoProto = function() { - function t2(t3) { - if (t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.name = "", t2.prototype.type = null, t2.prototype.docString = "", t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - return e2 || (e2 = u.create()), null != t3.name && t3.hasOwnProperty("name") && e2.uint32(10).string(t3.name), null != t3.type && t3.hasOwnProperty("type") && l.onnx.TypeProto.encode(t3.type, e2.uint32(18).fork()).ldelim(), null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(26).string(t3.docString), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.ValueInfoProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + return t3.prototype.name = "", t3.prototype.type = null, t3.prototype.docString = "", t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + return e2 || (e2 = u.create()), null != t4.name && t4.hasOwnProperty("name") && e2.uint32(10).string(t4.name), null != t4.type && t4.hasOwnProperty("type") && l.onnx.TypeProto.encode(t4.type, e2.uint32(18).fork()).ldelim(), null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(26).string(t4.docString), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.ValueInfoProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.name = t3.string(); + r2.name = t4.string(); break; case 2: - r2.type = l.onnx.TypeProto.decode(t3, t3.uint32()); + r2.type = l.onnx.TypeProto.decode(t4, t4.uint32()); break; case 3: - r2.docString = t3.string(); + r2.docString = t4.string(); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.name && t3.hasOwnProperty("name") && !c.isString(t3.name)) + if (null != t4.name && t4.hasOwnProperty("name") && !c.isString(t4.name)) return "name: string expected"; - if (null != t3.type && t3.hasOwnProperty("type")) { - var e2 = l.onnx.TypeProto.verify(t3.type); + if (null != t4.type && t4.hasOwnProperty("type")) { + var e2 = l.onnx.TypeProto.verify(t4.type); if (e2) return "type." + e2; } - return null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString) ? "docString: string expected" : null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.ValueInfoProto) - return t3; + return null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString) ? "docString: string expected" : null; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.ValueInfoProto) + return t4; var e2 = new l.onnx.ValueInfoProto(); - if (null != t3.name && (e2.name = String(t3.name)), null != t3.type) { - if ("object" != typeof t3.type) + if (null != t4.name && (e2.name = String(t4.name)), null != t4.type) { + if ("object" != typeof t4.type) throw TypeError(".onnx.ValueInfoProto.type: object expected"); - e2.type = l.onnx.TypeProto.fromObject(t3.type); + e2.type = l.onnx.TypeProto.fromObject(t4.type); } - return null != t3.docString && (e2.docString = String(t3.docString)), e2; - }, t2.toObject = function(t3, e2) { + return null != t4.docString && (e2.docString = String(t4.docString)), e2; + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - return e2.defaults && (n2.name = "", n2.type = null, n2.docString = ""), null != t3.name && t3.hasOwnProperty("name") && (n2.name = t3.name), null != t3.type && t3.hasOwnProperty("type") && (n2.type = l.onnx.TypeProto.toObject(t3.type, e2)), null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), n2; - }, t2.prototype.toJSON = function() { + return e2.defaults && (n2.name = "", n2.type = null, n2.docString = ""), null != t4.name && t4.hasOwnProperty("name") && (n2.name = t4.name), null != t4.type && t4.hasOwnProperty("type") && (n2.type = l.onnx.TypeProto.toObject(t4.type, e2)), null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.NodeProto = function() { - function t2(t3) { - if (this.input = [], this.output = [], this.attribute = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.input = [], this.output = [], this.attribute = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.input = c.emptyArray, t2.prototype.output = c.emptyArray, t2.prototype.name = "", t2.prototype.opType = "", t2.prototype.domain = "", t2.prototype.attribute = c.emptyArray, t2.prototype.docString = "", t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.input && t3.input.length) - for (var n2 = 0; n2 < t3.input.length; ++n2) - e2.uint32(10).string(t3.input[n2]); - if (null != t3.output && t3.output.length) - for (n2 = 0; n2 < t3.output.length; ++n2) - e2.uint32(18).string(t3.output[n2]); - if (null != t3.name && t3.hasOwnProperty("name") && e2.uint32(26).string(t3.name), null != t3.opType && t3.hasOwnProperty("opType") && e2.uint32(34).string(t3.opType), null != t3.attribute && t3.attribute.length) - for (n2 = 0; n2 < t3.attribute.length; ++n2) - l.onnx.AttributeProto.encode(t3.attribute[n2], e2.uint32(42).fork()).ldelim(); - return null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(50).string(t3.docString), null != t3.domain && t3.hasOwnProperty("domain") && e2.uint32(58).string(t3.domain), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.NodeProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + return t3.prototype.input = c.emptyArray, t3.prototype.output = c.emptyArray, t3.prototype.name = "", t3.prototype.opType = "", t3.prototype.domain = "", t3.prototype.attribute = c.emptyArray, t3.prototype.docString = "", t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.input && t4.input.length) + for (var n2 = 0; n2 < t4.input.length; ++n2) + e2.uint32(10).string(t4.input[n2]); + if (null != t4.output && t4.output.length) + for (n2 = 0; n2 < t4.output.length; ++n2) + e2.uint32(18).string(t4.output[n2]); + if (null != t4.name && t4.hasOwnProperty("name") && e2.uint32(26).string(t4.name), null != t4.opType && t4.hasOwnProperty("opType") && e2.uint32(34).string(t4.opType), null != t4.attribute && t4.attribute.length) + for (n2 = 0; n2 < t4.attribute.length; ++n2) + l.onnx.AttributeProto.encode(t4.attribute[n2], e2.uint32(42).fork()).ldelim(); + return null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(50).string(t4.docString), null != t4.domain && t4.hasOwnProperty("domain") && e2.uint32(58).string(t4.domain), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.NodeProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.input && r2.input.length || (r2.input = []), r2.input.push(t3.string()); + r2.input && r2.input.length || (r2.input = []), r2.input.push(t4.string()); break; case 2: - r2.output && r2.output.length || (r2.output = []), r2.output.push(t3.string()); + r2.output && r2.output.length || (r2.output = []), r2.output.push(t4.string()); break; case 3: - r2.name = t3.string(); + r2.name = t4.string(); break; case 4: - r2.opType = t3.string(); + r2.opType = t4.string(); break; case 7: - r2.domain = t3.string(); + r2.domain = t4.string(); break; case 5: - r2.attribute && r2.attribute.length || (r2.attribute = []), r2.attribute.push(l.onnx.AttributeProto.decode(t3, t3.uint32())); + r2.attribute && r2.attribute.length || (r2.attribute = []), r2.attribute.push(l.onnx.AttributeProto.decode(t4, t4.uint32())); break; case 6: - r2.docString = t3.string(); + r2.docString = t4.string(); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.input && t3.hasOwnProperty("input")) { - if (!Array.isArray(t3.input)) + if (null != t4.input && t4.hasOwnProperty("input")) { + if (!Array.isArray(t4.input)) return "input: array expected"; - for (var e2 = 0; e2 < t3.input.length; ++e2) - if (!c.isString(t3.input[e2])) + for (var e2 = 0; e2 < t4.input.length; ++e2) + if (!c.isString(t4.input[e2])) return "input: string[] expected"; } - if (null != t3.output && t3.hasOwnProperty("output")) { - if (!Array.isArray(t3.output)) + if (null != t4.output && t4.hasOwnProperty("output")) { + if (!Array.isArray(t4.output)) return "output: array expected"; - for (e2 = 0; e2 < t3.output.length; ++e2) - if (!c.isString(t3.output[e2])) + for (e2 = 0; e2 < t4.output.length; ++e2) + if (!c.isString(t4.output[e2])) return "output: string[] expected"; } - if (null != t3.name && t3.hasOwnProperty("name") && !c.isString(t3.name)) + if (null != t4.name && t4.hasOwnProperty("name") && !c.isString(t4.name)) return "name: string expected"; - if (null != t3.opType && t3.hasOwnProperty("opType") && !c.isString(t3.opType)) + if (null != t4.opType && t4.hasOwnProperty("opType") && !c.isString(t4.opType)) return "opType: string expected"; - if (null != t3.domain && t3.hasOwnProperty("domain") && !c.isString(t3.domain)) + if (null != t4.domain && t4.hasOwnProperty("domain") && !c.isString(t4.domain)) return "domain: string expected"; - if (null != t3.attribute && t3.hasOwnProperty("attribute")) { - if (!Array.isArray(t3.attribute)) + if (null != t4.attribute && t4.hasOwnProperty("attribute")) { + if (!Array.isArray(t4.attribute)) return "attribute: array expected"; - for (e2 = 0; e2 < t3.attribute.length; ++e2) { - var n2 = l.onnx.AttributeProto.verify(t3.attribute[e2]); + for (e2 = 0; e2 < t4.attribute.length; ++e2) { + var n2 = l.onnx.AttributeProto.verify(t4.attribute[e2]); if (n2) return "attribute." + n2; } } - return null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString) ? "docString: string expected" : null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.NodeProto) - return t3; + return null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString) ? "docString: string expected" : null; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.NodeProto) + return t4; var e2 = new l.onnx.NodeProto(); - if (t3.input) { - if (!Array.isArray(t3.input)) + if (t4.input) { + if (!Array.isArray(t4.input)) throw TypeError(".onnx.NodeProto.input: array expected"); e2.input = []; - for (var n2 = 0; n2 < t3.input.length; ++n2) - e2.input[n2] = String(t3.input[n2]); + for (var n2 = 0; n2 < t4.input.length; ++n2) + e2.input[n2] = String(t4.input[n2]); } - if (t3.output) { - if (!Array.isArray(t3.output)) + if (t4.output) { + if (!Array.isArray(t4.output)) throw TypeError(".onnx.NodeProto.output: array expected"); - for (e2.output = [], n2 = 0; n2 < t3.output.length; ++n2) - e2.output[n2] = String(t3.output[n2]); + for (e2.output = [], n2 = 0; n2 < t4.output.length; ++n2) + e2.output[n2] = String(t4.output[n2]); } - if (null != t3.name && (e2.name = String(t3.name)), null != t3.opType && (e2.opType = String(t3.opType)), null != t3.domain && (e2.domain = String(t3.domain)), t3.attribute) { - if (!Array.isArray(t3.attribute)) + if (null != t4.name && (e2.name = String(t4.name)), null != t4.opType && (e2.opType = String(t4.opType)), null != t4.domain && (e2.domain = String(t4.domain)), t4.attribute) { + if (!Array.isArray(t4.attribute)) throw TypeError(".onnx.NodeProto.attribute: array expected"); - for (e2.attribute = [], n2 = 0; n2 < t3.attribute.length; ++n2) { - if ("object" != typeof t3.attribute[n2]) + for (e2.attribute = [], n2 = 0; n2 < t4.attribute.length; ++n2) { + if ("object" != typeof t4.attribute[n2]) throw TypeError(".onnx.NodeProto.attribute: object expected"); - e2.attribute[n2] = l.onnx.AttributeProto.fromObject(t3.attribute[n2]); + e2.attribute[n2] = l.onnx.AttributeProto.fromObject(t4.attribute[n2]); } } - return null != t3.docString && (e2.docString = String(t3.docString)), e2; - }, t2.toObject = function(t3, e2) { + return null != t4.docString && (e2.docString = String(t4.docString)), e2; + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - if ((e2.arrays || e2.defaults) && (n2.input = [], n2.output = [], n2.attribute = []), e2.defaults && (n2.name = "", n2.opType = "", n2.docString = "", n2.domain = ""), t3.input && t3.input.length) { + if ((e2.arrays || e2.defaults) && (n2.input = [], n2.output = [], n2.attribute = []), e2.defaults && (n2.name = "", n2.opType = "", n2.docString = "", n2.domain = ""), t4.input && t4.input.length) { n2.input = []; - for (var r2 = 0; r2 < t3.input.length; ++r2) - n2.input[r2] = t3.input[r2]; + for (var r2 = 0; r2 < t4.input.length; ++r2) + n2.input[r2] = t4.input[r2]; } - if (t3.output && t3.output.length) - for (n2.output = [], r2 = 0; r2 < t3.output.length; ++r2) - n2.output[r2] = t3.output[r2]; - if (null != t3.name && t3.hasOwnProperty("name") && (n2.name = t3.name), null != t3.opType && t3.hasOwnProperty("opType") && (n2.opType = t3.opType), t3.attribute && t3.attribute.length) - for (n2.attribute = [], r2 = 0; r2 < t3.attribute.length; ++r2) - n2.attribute[r2] = l.onnx.AttributeProto.toObject(t3.attribute[r2], e2); - return null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), null != t3.domain && t3.hasOwnProperty("domain") && (n2.domain = t3.domain), n2; - }, t2.prototype.toJSON = function() { + if (t4.output && t4.output.length) + for (n2.output = [], r2 = 0; r2 < t4.output.length; ++r2) + n2.output[r2] = t4.output[r2]; + if (null != t4.name && t4.hasOwnProperty("name") && (n2.name = t4.name), null != t4.opType && t4.hasOwnProperty("opType") && (n2.opType = t4.opType), t4.attribute && t4.attribute.length) + for (n2.attribute = [], r2 = 0; r2 < t4.attribute.length; ++r2) + n2.attribute[r2] = l.onnx.AttributeProto.toObject(t4.attribute[r2], e2); + return null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), null != t4.domain && t4.hasOwnProperty("domain") && (n2.domain = t4.domain), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.ModelProto = function() { - function t2(t3) { - if (this.opsetImport = [], this.metadataProps = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.opsetImport = [], this.metadataProps = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.irVersion = c.Long ? c.Long.fromBits(0, 0, false) : 0, t2.prototype.opsetImport = c.emptyArray, t2.prototype.producerName = "", t2.prototype.producerVersion = "", t2.prototype.domain = "", t2.prototype.modelVersion = c.Long ? c.Long.fromBits(0, 0, false) : 0, t2.prototype.docString = "", t2.prototype.graph = null, t2.prototype.metadataProps = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.irVersion && t3.hasOwnProperty("irVersion") && e2.uint32(8).int64(t3.irVersion), null != t3.producerName && t3.hasOwnProperty("producerName") && e2.uint32(18).string(t3.producerName), null != t3.producerVersion && t3.hasOwnProperty("producerVersion") && e2.uint32(26).string(t3.producerVersion), null != t3.domain && t3.hasOwnProperty("domain") && e2.uint32(34).string(t3.domain), null != t3.modelVersion && t3.hasOwnProperty("modelVersion") && e2.uint32(40).int64(t3.modelVersion), null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(50).string(t3.docString), null != t3.graph && t3.hasOwnProperty("graph") && l.onnx.GraphProto.encode(t3.graph, e2.uint32(58).fork()).ldelim(), null != t3.opsetImport && t3.opsetImport.length) - for (var n2 = 0; n2 < t3.opsetImport.length; ++n2) - l.onnx.OperatorSetIdProto.encode(t3.opsetImport[n2], e2.uint32(66).fork()).ldelim(); - if (null != t3.metadataProps && t3.metadataProps.length) - for (n2 = 0; n2 < t3.metadataProps.length; ++n2) - l.onnx.StringStringEntryProto.encode(t3.metadataProps[n2], e2.uint32(114).fork()).ldelim(); + return t3.prototype.irVersion = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.prototype.opsetImport = c.emptyArray, t3.prototype.producerName = "", t3.prototype.producerVersion = "", t3.prototype.domain = "", t3.prototype.modelVersion = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.prototype.docString = "", t3.prototype.graph = null, t3.prototype.metadataProps = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.irVersion && t4.hasOwnProperty("irVersion") && e2.uint32(8).int64(t4.irVersion), null != t4.producerName && t4.hasOwnProperty("producerName") && e2.uint32(18).string(t4.producerName), null != t4.producerVersion && t4.hasOwnProperty("producerVersion") && e2.uint32(26).string(t4.producerVersion), null != t4.domain && t4.hasOwnProperty("domain") && e2.uint32(34).string(t4.domain), null != t4.modelVersion && t4.hasOwnProperty("modelVersion") && e2.uint32(40).int64(t4.modelVersion), null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(50).string(t4.docString), null != t4.graph && t4.hasOwnProperty("graph") && l.onnx.GraphProto.encode(t4.graph, e2.uint32(58).fork()).ldelim(), null != t4.opsetImport && t4.opsetImport.length) + for (var n2 = 0; n2 < t4.opsetImport.length; ++n2) + l.onnx.OperatorSetIdProto.encode(t4.opsetImport[n2], e2.uint32(66).fork()).ldelim(); + if (null != t4.metadataProps && t4.metadataProps.length) + for (n2 = 0; n2 < t4.metadataProps.length; ++n2) + l.onnx.StringStringEntryProto.encode(t4.metadataProps[n2], e2.uint32(114).fork()).ldelim(); return e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.ModelProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.ModelProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.irVersion = t3.int64(); + r2.irVersion = t4.int64(); break; case 8: - r2.opsetImport && r2.opsetImport.length || (r2.opsetImport = []), r2.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t3, t3.uint32())); + r2.opsetImport && r2.opsetImport.length || (r2.opsetImport = []), r2.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t4, t4.uint32())); break; case 2: - r2.producerName = t3.string(); + r2.producerName = t4.string(); break; case 3: - r2.producerVersion = t3.string(); + r2.producerVersion = t4.string(); break; case 4: - r2.domain = t3.string(); + r2.domain = t4.string(); break; case 5: - r2.modelVersion = t3.int64(); + r2.modelVersion = t4.int64(); break; case 6: - r2.docString = t3.string(); + r2.docString = t4.string(); break; case 7: - r2.graph = l.onnx.GraphProto.decode(t3, t3.uint32()); + r2.graph = l.onnx.GraphProto.decode(t4, t4.uint32()); break; case 14: - r2.metadataProps && r2.metadataProps.length || (r2.metadataProps = []), r2.metadataProps.push(l.onnx.StringStringEntryProto.decode(t3, t3.uint32())); + r2.metadataProps && r2.metadataProps.length || (r2.metadataProps = []), r2.metadataProps.push(l.onnx.StringStringEntryProto.decode(t4, t4.uint32())); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.irVersion && t3.hasOwnProperty("irVersion") && !(c.isInteger(t3.irVersion) || t3.irVersion && c.isInteger(t3.irVersion.low) && c.isInteger(t3.irVersion.high))) + if (null != t4.irVersion && t4.hasOwnProperty("irVersion") && !(c.isInteger(t4.irVersion) || t4.irVersion && c.isInteger(t4.irVersion.low) && c.isInteger(t4.irVersion.high))) return "irVersion: integer|Long expected"; - if (null != t3.opsetImport && t3.hasOwnProperty("opsetImport")) { - if (!Array.isArray(t3.opsetImport)) + if (null != t4.opsetImport && t4.hasOwnProperty("opsetImport")) { + if (!Array.isArray(t4.opsetImport)) return "opsetImport: array expected"; - for (var e2 = 0; e2 < t3.opsetImport.length; ++e2) - if (n2 = l.onnx.OperatorSetIdProto.verify(t3.opsetImport[e2])) + for (var e2 = 0; e2 < t4.opsetImport.length; ++e2) + if (n2 = l.onnx.OperatorSetIdProto.verify(t4.opsetImport[e2])) return "opsetImport." + n2; } - if (null != t3.producerName && t3.hasOwnProperty("producerName") && !c.isString(t3.producerName)) + if (null != t4.producerName && t4.hasOwnProperty("producerName") && !c.isString(t4.producerName)) return "producerName: string expected"; - if (null != t3.producerVersion && t3.hasOwnProperty("producerVersion") && !c.isString(t3.producerVersion)) + if (null != t4.producerVersion && t4.hasOwnProperty("producerVersion") && !c.isString(t4.producerVersion)) return "producerVersion: string expected"; - if (null != t3.domain && t3.hasOwnProperty("domain") && !c.isString(t3.domain)) + if (null != t4.domain && t4.hasOwnProperty("domain") && !c.isString(t4.domain)) return "domain: string expected"; - if (null != t3.modelVersion && t3.hasOwnProperty("modelVersion") && !(c.isInteger(t3.modelVersion) || t3.modelVersion && c.isInteger(t3.modelVersion.low) && c.isInteger(t3.modelVersion.high))) + if (null != t4.modelVersion && t4.hasOwnProperty("modelVersion") && !(c.isInteger(t4.modelVersion) || t4.modelVersion && c.isInteger(t4.modelVersion.low) && c.isInteger(t4.modelVersion.high))) return "modelVersion: integer|Long expected"; - if (null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString)) + if (null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString)) return "docString: string expected"; - if (null != t3.graph && t3.hasOwnProperty("graph") && (n2 = l.onnx.GraphProto.verify(t3.graph))) + if (null != t4.graph && t4.hasOwnProperty("graph") && (n2 = l.onnx.GraphProto.verify(t4.graph))) return "graph." + n2; - if (null != t3.metadataProps && t3.hasOwnProperty("metadataProps")) { - if (!Array.isArray(t3.metadataProps)) + if (null != t4.metadataProps && t4.hasOwnProperty("metadataProps")) { + if (!Array.isArray(t4.metadataProps)) return "metadataProps: array expected"; - for (e2 = 0; e2 < t3.metadataProps.length; ++e2) { + for (e2 = 0; e2 < t4.metadataProps.length; ++e2) { var n2; - if (n2 = l.onnx.StringStringEntryProto.verify(t3.metadataProps[e2])) + if (n2 = l.onnx.StringStringEntryProto.verify(t4.metadataProps[e2])) return "metadataProps." + n2; } } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.ModelProto) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.ModelProto) + return t4; var e2 = new l.onnx.ModelProto(); - if (null != t3.irVersion && (c.Long ? (e2.irVersion = c.Long.fromValue(t3.irVersion)).unsigned = false : "string" == typeof t3.irVersion ? e2.irVersion = parseInt(t3.irVersion, 10) : "number" == typeof t3.irVersion ? e2.irVersion = t3.irVersion : "object" == typeof t3.irVersion && (e2.irVersion = new c.LongBits(t3.irVersion.low >>> 0, t3.irVersion.high >>> 0).toNumber())), t3.opsetImport) { - if (!Array.isArray(t3.opsetImport)) + if (null != t4.irVersion && (c.Long ? (e2.irVersion = c.Long.fromValue(t4.irVersion)).unsigned = false : "string" == typeof t4.irVersion ? e2.irVersion = parseInt(t4.irVersion, 10) : "number" == typeof t4.irVersion ? e2.irVersion = t4.irVersion : "object" == typeof t4.irVersion && (e2.irVersion = new c.LongBits(t4.irVersion.low >>> 0, t4.irVersion.high >>> 0).toNumber())), t4.opsetImport) { + if (!Array.isArray(t4.opsetImport)) throw TypeError(".onnx.ModelProto.opsetImport: array expected"); e2.opsetImport = []; - for (var n2 = 0; n2 < t3.opsetImport.length; ++n2) { - if ("object" != typeof t3.opsetImport[n2]) + for (var n2 = 0; n2 < t4.opsetImport.length; ++n2) { + if ("object" != typeof t4.opsetImport[n2]) throw TypeError(".onnx.ModelProto.opsetImport: object expected"); - e2.opsetImport[n2] = l.onnx.OperatorSetIdProto.fromObject(t3.opsetImport[n2]); + e2.opsetImport[n2] = l.onnx.OperatorSetIdProto.fromObject(t4.opsetImport[n2]); } } - if (null != t3.producerName && (e2.producerName = String(t3.producerName)), null != t3.producerVersion && (e2.producerVersion = String(t3.producerVersion)), null != t3.domain && (e2.domain = String(t3.domain)), null != t3.modelVersion && (c.Long ? (e2.modelVersion = c.Long.fromValue(t3.modelVersion)).unsigned = false : "string" == typeof t3.modelVersion ? e2.modelVersion = parseInt(t3.modelVersion, 10) : "number" == typeof t3.modelVersion ? e2.modelVersion = t3.modelVersion : "object" == typeof t3.modelVersion && (e2.modelVersion = new c.LongBits(t3.modelVersion.low >>> 0, t3.modelVersion.high >>> 0).toNumber())), null != t3.docString && (e2.docString = String(t3.docString)), null != t3.graph) { - if ("object" != typeof t3.graph) + if (null != t4.producerName && (e2.producerName = String(t4.producerName)), null != t4.producerVersion && (e2.producerVersion = String(t4.producerVersion)), null != t4.domain && (e2.domain = String(t4.domain)), null != t4.modelVersion && (c.Long ? (e2.modelVersion = c.Long.fromValue(t4.modelVersion)).unsigned = false : "string" == typeof t4.modelVersion ? e2.modelVersion = parseInt(t4.modelVersion, 10) : "number" == typeof t4.modelVersion ? e2.modelVersion = t4.modelVersion : "object" == typeof t4.modelVersion && (e2.modelVersion = new c.LongBits(t4.modelVersion.low >>> 0, t4.modelVersion.high >>> 0).toNumber())), null != t4.docString && (e2.docString = String(t4.docString)), null != t4.graph) { + if ("object" != typeof t4.graph) throw TypeError(".onnx.ModelProto.graph: object expected"); - e2.graph = l.onnx.GraphProto.fromObject(t3.graph); + e2.graph = l.onnx.GraphProto.fromObject(t4.graph); } - if (t3.metadataProps) { - if (!Array.isArray(t3.metadataProps)) + if (t4.metadataProps) { + if (!Array.isArray(t4.metadataProps)) throw TypeError(".onnx.ModelProto.metadataProps: array expected"); - for (e2.metadataProps = [], n2 = 0; n2 < t3.metadataProps.length; ++n2) { - if ("object" != typeof t3.metadataProps[n2]) + for (e2.metadataProps = [], n2 = 0; n2 < t4.metadataProps.length; ++n2) { + if ("object" != typeof t4.metadataProps[n2]) throw TypeError(".onnx.ModelProto.metadataProps: object expected"); - e2.metadataProps[n2] = l.onnx.StringStringEntryProto.fromObject(t3.metadataProps[n2]); + e2.metadataProps[n2] = l.onnx.StringStringEntryProto.fromObject(t4.metadataProps[n2]); } } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; if ((e2.arrays || e2.defaults) && (n2.opsetImport = [], n2.metadataProps = []), e2.defaults) { @@ -4657,598 +5342,598 @@ var require_ort_web_node = __commonJS({ n2.irVersion = e2.longs === String ? "0" : 0; n2.producerName = "", n2.producerVersion = "", n2.domain = "", c.Long ? (r2 = new c.Long(0, 0, false), n2.modelVersion = e2.longs === String ? r2.toString() : e2.longs === Number ? r2.toNumber() : r2) : n2.modelVersion = e2.longs === String ? "0" : 0, n2.docString = "", n2.graph = null; } - if (null != t3.irVersion && t3.hasOwnProperty("irVersion") && ("number" == typeof t3.irVersion ? n2.irVersion = e2.longs === String ? String(t3.irVersion) : t3.irVersion : n2.irVersion = e2.longs === String ? c.Long.prototype.toString.call(t3.irVersion) : e2.longs === Number ? new c.LongBits(t3.irVersion.low >>> 0, t3.irVersion.high >>> 0).toNumber() : t3.irVersion), null != t3.producerName && t3.hasOwnProperty("producerName") && (n2.producerName = t3.producerName), null != t3.producerVersion && t3.hasOwnProperty("producerVersion") && (n2.producerVersion = t3.producerVersion), null != t3.domain && t3.hasOwnProperty("domain") && (n2.domain = t3.domain), null != t3.modelVersion && t3.hasOwnProperty("modelVersion") && ("number" == typeof t3.modelVersion ? n2.modelVersion = e2.longs === String ? String(t3.modelVersion) : t3.modelVersion : n2.modelVersion = e2.longs === String ? c.Long.prototype.toString.call(t3.modelVersion) : e2.longs === Number ? new c.LongBits(t3.modelVersion.low >>> 0, t3.modelVersion.high >>> 0).toNumber() : t3.modelVersion), null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), null != t3.graph && t3.hasOwnProperty("graph") && (n2.graph = l.onnx.GraphProto.toObject(t3.graph, e2)), t3.opsetImport && t3.opsetImport.length) { + if (null != t4.irVersion && t4.hasOwnProperty("irVersion") && ("number" == typeof t4.irVersion ? n2.irVersion = e2.longs === String ? String(t4.irVersion) : t4.irVersion : n2.irVersion = e2.longs === String ? c.Long.prototype.toString.call(t4.irVersion) : e2.longs === Number ? new c.LongBits(t4.irVersion.low >>> 0, t4.irVersion.high >>> 0).toNumber() : t4.irVersion), null != t4.producerName && t4.hasOwnProperty("producerName") && (n2.producerName = t4.producerName), null != t4.producerVersion && t4.hasOwnProperty("producerVersion") && (n2.producerVersion = t4.producerVersion), null != t4.domain && t4.hasOwnProperty("domain") && (n2.domain = t4.domain), null != t4.modelVersion && t4.hasOwnProperty("modelVersion") && ("number" == typeof t4.modelVersion ? n2.modelVersion = e2.longs === String ? String(t4.modelVersion) : t4.modelVersion : n2.modelVersion = e2.longs === String ? c.Long.prototype.toString.call(t4.modelVersion) : e2.longs === Number ? new c.LongBits(t4.modelVersion.low >>> 0, t4.modelVersion.high >>> 0).toNumber() : t4.modelVersion), null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), null != t4.graph && t4.hasOwnProperty("graph") && (n2.graph = l.onnx.GraphProto.toObject(t4.graph, e2)), t4.opsetImport && t4.opsetImport.length) { n2.opsetImport = []; - for (var i3 = 0; i3 < t3.opsetImport.length; ++i3) - n2.opsetImport[i3] = l.onnx.OperatorSetIdProto.toObject(t3.opsetImport[i3], e2); + for (var i3 = 0; i3 < t4.opsetImport.length; ++i3) + n2.opsetImport[i3] = l.onnx.OperatorSetIdProto.toObject(t4.opsetImport[i3], e2); } - if (t3.metadataProps && t3.metadataProps.length) - for (n2.metadataProps = [], i3 = 0; i3 < t3.metadataProps.length; ++i3) - n2.metadataProps[i3] = l.onnx.StringStringEntryProto.toObject(t3.metadataProps[i3], e2); + if (t4.metadataProps && t4.metadataProps.length) + for (n2.metadataProps = [], i3 = 0; i3 < t4.metadataProps.length; ++i3) + n2.metadataProps[i3] = l.onnx.StringStringEntryProto.toObject(t4.metadataProps[i3], e2); return n2; - }, t2.prototype.toJSON = function() { + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.StringStringEntryProto = function() { - function t2(t3) { - if (t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.key = "", t2.prototype.value = "", t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - return e2 || (e2 = u.create()), null != t3.key && t3.hasOwnProperty("key") && e2.uint32(10).string(t3.key), null != t3.value && t3.hasOwnProperty("value") && e2.uint32(18).string(t3.value), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.StringStringEntryProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + return t3.prototype.key = "", t3.prototype.value = "", t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + return e2 || (e2 = u.create()), null != t4.key && t4.hasOwnProperty("key") && e2.uint32(10).string(t4.key), null != t4.value && t4.hasOwnProperty("value") && e2.uint32(18).string(t4.value), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.StringStringEntryProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.key = t3.string(); + r2.key = t4.string(); break; case 2: - r2.value = t3.string(); + r2.value = t4.string(); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - return "object" != typeof t3 || null === t3 ? "object expected" : null != t3.key && t3.hasOwnProperty("key") && !c.isString(t3.key) ? "key: string expected" : null != t3.value && t3.hasOwnProperty("value") && !c.isString(t3.value) ? "value: string expected" : null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.StringStringEntryProto) - return t3; + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + return "object" != typeof t4 || null === t4 ? "object expected" : null != t4.key && t4.hasOwnProperty("key") && !c.isString(t4.key) ? "key: string expected" : null != t4.value && t4.hasOwnProperty("value") && !c.isString(t4.value) ? "value: string expected" : null; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.StringStringEntryProto) + return t4; var e2 = new l.onnx.StringStringEntryProto(); - return null != t3.key && (e2.key = String(t3.key)), null != t3.value && (e2.value = String(t3.value)), e2; - }, t2.toObject = function(t3, e2) { + return null != t4.key && (e2.key = String(t4.key)), null != t4.value && (e2.value = String(t4.value)), e2; + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - return e2.defaults && (n2.key = "", n2.value = ""), null != t3.key && t3.hasOwnProperty("key") && (n2.key = t3.key), null != t3.value && t3.hasOwnProperty("value") && (n2.value = t3.value), n2; - }, t2.prototype.toJSON = function() { + return e2.defaults && (n2.key = "", n2.value = ""), null != t4.key && t4.hasOwnProperty("key") && (n2.key = t4.key), null != t4.value && t4.hasOwnProperty("value") && (n2.value = t4.value), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.TensorAnnotation = function() { - function t2(t3) { - if (this.quantParameterTensorNames = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.quantParameterTensorNames = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.tensorName = "", t2.prototype.quantParameterTensorNames = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.tensorName && t3.hasOwnProperty("tensorName") && e2.uint32(10).string(t3.tensorName), null != t3.quantParameterTensorNames && t3.quantParameterTensorNames.length) - for (var n2 = 0; n2 < t3.quantParameterTensorNames.length; ++n2) - l.onnx.StringStringEntryProto.encode(t3.quantParameterTensorNames[n2], e2.uint32(18).fork()).ldelim(); + return t3.prototype.tensorName = "", t3.prototype.quantParameterTensorNames = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.tensorName && t4.hasOwnProperty("tensorName") && e2.uint32(10).string(t4.tensorName), null != t4.quantParameterTensorNames && t4.quantParameterTensorNames.length) + for (var n2 = 0; n2 < t4.quantParameterTensorNames.length; ++n2) + l.onnx.StringStringEntryProto.encode(t4.quantParameterTensorNames[n2], e2.uint32(18).fork()).ldelim(); return e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.TensorAnnotation(); t3.pos < n2; ) { - var i3 = t3.uint32(); + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.TensorAnnotation(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.tensorName = t3.string(); + r2.tensorName = t4.string(); break; case 2: - r2.quantParameterTensorNames && r2.quantParameterTensorNames.length || (r2.quantParameterTensorNames = []), r2.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t3, t3.uint32())); + r2.quantParameterTensorNames && r2.quantParameterTensorNames.length || (r2.quantParameterTensorNames = []), r2.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t4, t4.uint32())); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.tensorName && t3.hasOwnProperty("tensorName") && !c.isString(t3.tensorName)) + if (null != t4.tensorName && t4.hasOwnProperty("tensorName") && !c.isString(t4.tensorName)) return "tensorName: string expected"; - if (null != t3.quantParameterTensorNames && t3.hasOwnProperty("quantParameterTensorNames")) { - if (!Array.isArray(t3.quantParameterTensorNames)) + if (null != t4.quantParameterTensorNames && t4.hasOwnProperty("quantParameterTensorNames")) { + if (!Array.isArray(t4.quantParameterTensorNames)) return "quantParameterTensorNames: array expected"; - for (var e2 = 0; e2 < t3.quantParameterTensorNames.length; ++e2) { - var n2 = l.onnx.StringStringEntryProto.verify(t3.quantParameterTensorNames[e2]); + for (var e2 = 0; e2 < t4.quantParameterTensorNames.length; ++e2) { + var n2 = l.onnx.StringStringEntryProto.verify(t4.quantParameterTensorNames[e2]); if (n2) return "quantParameterTensorNames." + n2; } } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.TensorAnnotation) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.TensorAnnotation) + return t4; var e2 = new l.onnx.TensorAnnotation(); - if (null != t3.tensorName && (e2.tensorName = String(t3.tensorName)), t3.quantParameterTensorNames) { - if (!Array.isArray(t3.quantParameterTensorNames)) + if (null != t4.tensorName && (e2.tensorName = String(t4.tensorName)), t4.quantParameterTensorNames) { + if (!Array.isArray(t4.quantParameterTensorNames)) throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected"); e2.quantParameterTensorNames = []; - for (var n2 = 0; n2 < t3.quantParameterTensorNames.length; ++n2) { - if ("object" != typeof t3.quantParameterTensorNames[n2]) + for (var n2 = 0; n2 < t4.quantParameterTensorNames.length; ++n2) { + if ("object" != typeof t4.quantParameterTensorNames[n2]) throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected"); - e2.quantParameterTensorNames[n2] = l.onnx.StringStringEntryProto.fromObject(t3.quantParameterTensorNames[n2]); + e2.quantParameterTensorNames[n2] = l.onnx.StringStringEntryProto.fromObject(t4.quantParameterTensorNames[n2]); } } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - if ((e2.arrays || e2.defaults) && (n2.quantParameterTensorNames = []), e2.defaults && (n2.tensorName = ""), null != t3.tensorName && t3.hasOwnProperty("tensorName") && (n2.tensorName = t3.tensorName), t3.quantParameterTensorNames && t3.quantParameterTensorNames.length) { + if ((e2.arrays || e2.defaults) && (n2.quantParameterTensorNames = []), e2.defaults && (n2.tensorName = ""), null != t4.tensorName && t4.hasOwnProperty("tensorName") && (n2.tensorName = t4.tensorName), t4.quantParameterTensorNames && t4.quantParameterTensorNames.length) { n2.quantParameterTensorNames = []; - for (var r2 = 0; r2 < t3.quantParameterTensorNames.length; ++r2) - n2.quantParameterTensorNames[r2] = l.onnx.StringStringEntryProto.toObject(t3.quantParameterTensorNames[r2], e2); + for (var r2 = 0; r2 < t4.quantParameterTensorNames.length; ++r2) + n2.quantParameterTensorNames[r2] = l.onnx.StringStringEntryProto.toObject(t4.quantParameterTensorNames[r2], e2); } return n2; - }, t2.prototype.toJSON = function() { + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.GraphProto = function() { - function t2(t3) { - if (this.node = [], this.initializer = [], this.input = [], this.output = [], this.valueInfo = [], this.quantizationAnnotation = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.node = [], this.initializer = [], this.input = [], this.output = [], this.valueInfo = [], this.quantizationAnnotation = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.node = c.emptyArray, t2.prototype.name = "", t2.prototype.initializer = c.emptyArray, t2.prototype.docString = "", t2.prototype.input = c.emptyArray, t2.prototype.output = c.emptyArray, t2.prototype.valueInfo = c.emptyArray, t2.prototype.quantizationAnnotation = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.node && t3.node.length) - for (var n2 = 0; n2 < t3.node.length; ++n2) - l.onnx.NodeProto.encode(t3.node[n2], e2.uint32(10).fork()).ldelim(); - if (null != t3.name && t3.hasOwnProperty("name") && e2.uint32(18).string(t3.name), null != t3.initializer && t3.initializer.length) - for (n2 = 0; n2 < t3.initializer.length; ++n2) - l.onnx.TensorProto.encode(t3.initializer[n2], e2.uint32(42).fork()).ldelim(); - if (null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(82).string(t3.docString), null != t3.input && t3.input.length) - for (n2 = 0; n2 < t3.input.length; ++n2) - l.onnx.ValueInfoProto.encode(t3.input[n2], e2.uint32(90).fork()).ldelim(); - if (null != t3.output && t3.output.length) - for (n2 = 0; n2 < t3.output.length; ++n2) - l.onnx.ValueInfoProto.encode(t3.output[n2], e2.uint32(98).fork()).ldelim(); - if (null != t3.valueInfo && t3.valueInfo.length) - for (n2 = 0; n2 < t3.valueInfo.length; ++n2) - l.onnx.ValueInfoProto.encode(t3.valueInfo[n2], e2.uint32(106).fork()).ldelim(); - if (null != t3.quantizationAnnotation && t3.quantizationAnnotation.length) - for (n2 = 0; n2 < t3.quantizationAnnotation.length; ++n2) - l.onnx.TensorAnnotation.encode(t3.quantizationAnnotation[n2], e2.uint32(114).fork()).ldelim(); + return t3.prototype.node = c.emptyArray, t3.prototype.name = "", t3.prototype.initializer = c.emptyArray, t3.prototype.docString = "", t3.prototype.input = c.emptyArray, t3.prototype.output = c.emptyArray, t3.prototype.valueInfo = c.emptyArray, t3.prototype.quantizationAnnotation = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.node && t4.node.length) + for (var n2 = 0; n2 < t4.node.length; ++n2) + l.onnx.NodeProto.encode(t4.node[n2], e2.uint32(10).fork()).ldelim(); + if (null != t4.name && t4.hasOwnProperty("name") && e2.uint32(18).string(t4.name), null != t4.initializer && t4.initializer.length) + for (n2 = 0; n2 < t4.initializer.length; ++n2) + l.onnx.TensorProto.encode(t4.initializer[n2], e2.uint32(42).fork()).ldelim(); + if (null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(82).string(t4.docString), null != t4.input && t4.input.length) + for (n2 = 0; n2 < t4.input.length; ++n2) + l.onnx.ValueInfoProto.encode(t4.input[n2], e2.uint32(90).fork()).ldelim(); + if (null != t4.output && t4.output.length) + for (n2 = 0; n2 < t4.output.length; ++n2) + l.onnx.ValueInfoProto.encode(t4.output[n2], e2.uint32(98).fork()).ldelim(); + if (null != t4.valueInfo && t4.valueInfo.length) + for (n2 = 0; n2 < t4.valueInfo.length; ++n2) + l.onnx.ValueInfoProto.encode(t4.valueInfo[n2], e2.uint32(106).fork()).ldelim(); + if (null != t4.quantizationAnnotation && t4.quantizationAnnotation.length) + for (n2 = 0; n2 < t4.quantizationAnnotation.length; ++n2) + l.onnx.TensorAnnotation.encode(t4.quantizationAnnotation[n2], e2.uint32(114).fork()).ldelim(); return e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.GraphProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.GraphProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.node && r2.node.length || (r2.node = []), r2.node.push(l.onnx.NodeProto.decode(t3, t3.uint32())); + r2.node && r2.node.length || (r2.node = []), r2.node.push(l.onnx.NodeProto.decode(t4, t4.uint32())); break; case 2: - r2.name = t3.string(); + r2.name = t4.string(); break; case 5: - r2.initializer && r2.initializer.length || (r2.initializer = []), r2.initializer.push(l.onnx.TensorProto.decode(t3, t3.uint32())); + r2.initializer && r2.initializer.length || (r2.initializer = []), r2.initializer.push(l.onnx.TensorProto.decode(t4, t4.uint32())); break; case 10: - r2.docString = t3.string(); + r2.docString = t4.string(); break; case 11: - r2.input && r2.input.length || (r2.input = []), r2.input.push(l.onnx.ValueInfoProto.decode(t3, t3.uint32())); + r2.input && r2.input.length || (r2.input = []), r2.input.push(l.onnx.ValueInfoProto.decode(t4, t4.uint32())); break; case 12: - r2.output && r2.output.length || (r2.output = []), r2.output.push(l.onnx.ValueInfoProto.decode(t3, t3.uint32())); + r2.output && r2.output.length || (r2.output = []), r2.output.push(l.onnx.ValueInfoProto.decode(t4, t4.uint32())); break; case 13: - r2.valueInfo && r2.valueInfo.length || (r2.valueInfo = []), r2.valueInfo.push(l.onnx.ValueInfoProto.decode(t3, t3.uint32())); + r2.valueInfo && r2.valueInfo.length || (r2.valueInfo = []), r2.valueInfo.push(l.onnx.ValueInfoProto.decode(t4, t4.uint32())); break; case 14: - r2.quantizationAnnotation && r2.quantizationAnnotation.length || (r2.quantizationAnnotation = []), r2.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t3, t3.uint32())); + r2.quantizationAnnotation && r2.quantizationAnnotation.length || (r2.quantizationAnnotation = []), r2.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t4, t4.uint32())); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.node && t3.hasOwnProperty("node")) { - if (!Array.isArray(t3.node)) + if (null != t4.node && t4.hasOwnProperty("node")) { + if (!Array.isArray(t4.node)) return "node: array expected"; - for (var e2 = 0; e2 < t3.node.length; ++e2) - if (n2 = l.onnx.NodeProto.verify(t3.node[e2])) + for (var e2 = 0; e2 < t4.node.length; ++e2) + if (n2 = l.onnx.NodeProto.verify(t4.node[e2])) return "node." + n2; } - if (null != t3.name && t3.hasOwnProperty("name") && !c.isString(t3.name)) + if (null != t4.name && t4.hasOwnProperty("name") && !c.isString(t4.name)) return "name: string expected"; - if (null != t3.initializer && t3.hasOwnProperty("initializer")) { - if (!Array.isArray(t3.initializer)) + if (null != t4.initializer && t4.hasOwnProperty("initializer")) { + if (!Array.isArray(t4.initializer)) return "initializer: array expected"; - for (e2 = 0; e2 < t3.initializer.length; ++e2) - if (n2 = l.onnx.TensorProto.verify(t3.initializer[e2])) + for (e2 = 0; e2 < t4.initializer.length; ++e2) + if (n2 = l.onnx.TensorProto.verify(t4.initializer[e2])) return "initializer." + n2; } - if (null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString)) + if (null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString)) return "docString: string expected"; - if (null != t3.input && t3.hasOwnProperty("input")) { - if (!Array.isArray(t3.input)) + if (null != t4.input && t4.hasOwnProperty("input")) { + if (!Array.isArray(t4.input)) return "input: array expected"; - for (e2 = 0; e2 < t3.input.length; ++e2) - if (n2 = l.onnx.ValueInfoProto.verify(t3.input[e2])) + for (e2 = 0; e2 < t4.input.length; ++e2) + if (n2 = l.onnx.ValueInfoProto.verify(t4.input[e2])) return "input." + n2; } - if (null != t3.output && t3.hasOwnProperty("output")) { - if (!Array.isArray(t3.output)) + if (null != t4.output && t4.hasOwnProperty("output")) { + if (!Array.isArray(t4.output)) return "output: array expected"; - for (e2 = 0; e2 < t3.output.length; ++e2) - if (n2 = l.onnx.ValueInfoProto.verify(t3.output[e2])) + for (e2 = 0; e2 < t4.output.length; ++e2) + if (n2 = l.onnx.ValueInfoProto.verify(t4.output[e2])) return "output." + n2; } - if (null != t3.valueInfo && t3.hasOwnProperty("valueInfo")) { - if (!Array.isArray(t3.valueInfo)) + if (null != t4.valueInfo && t4.hasOwnProperty("valueInfo")) { + if (!Array.isArray(t4.valueInfo)) return "valueInfo: array expected"; - for (e2 = 0; e2 < t3.valueInfo.length; ++e2) - if (n2 = l.onnx.ValueInfoProto.verify(t3.valueInfo[e2])) + for (e2 = 0; e2 < t4.valueInfo.length; ++e2) + if (n2 = l.onnx.ValueInfoProto.verify(t4.valueInfo[e2])) return "valueInfo." + n2; } - if (null != t3.quantizationAnnotation && t3.hasOwnProperty("quantizationAnnotation")) { - if (!Array.isArray(t3.quantizationAnnotation)) + if (null != t4.quantizationAnnotation && t4.hasOwnProperty("quantizationAnnotation")) { + if (!Array.isArray(t4.quantizationAnnotation)) return "quantizationAnnotation: array expected"; - for (e2 = 0; e2 < t3.quantizationAnnotation.length; ++e2) { + for (e2 = 0; e2 < t4.quantizationAnnotation.length; ++e2) { var n2; - if (n2 = l.onnx.TensorAnnotation.verify(t3.quantizationAnnotation[e2])) + if (n2 = l.onnx.TensorAnnotation.verify(t4.quantizationAnnotation[e2])) return "quantizationAnnotation." + n2; } } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.GraphProto) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.GraphProto) + return t4; var e2 = new l.onnx.GraphProto(); - if (t3.node) { - if (!Array.isArray(t3.node)) + if (t4.node) { + if (!Array.isArray(t4.node)) throw TypeError(".onnx.GraphProto.node: array expected"); e2.node = []; - for (var n2 = 0; n2 < t3.node.length; ++n2) { - if ("object" != typeof t3.node[n2]) + for (var n2 = 0; n2 < t4.node.length; ++n2) { + if ("object" != typeof t4.node[n2]) throw TypeError(".onnx.GraphProto.node: object expected"); - e2.node[n2] = l.onnx.NodeProto.fromObject(t3.node[n2]); + e2.node[n2] = l.onnx.NodeProto.fromObject(t4.node[n2]); } } - if (null != t3.name && (e2.name = String(t3.name)), t3.initializer) { - if (!Array.isArray(t3.initializer)) + if (null != t4.name && (e2.name = String(t4.name)), t4.initializer) { + if (!Array.isArray(t4.initializer)) throw TypeError(".onnx.GraphProto.initializer: array expected"); - for (e2.initializer = [], n2 = 0; n2 < t3.initializer.length; ++n2) { - if ("object" != typeof t3.initializer[n2]) + for (e2.initializer = [], n2 = 0; n2 < t4.initializer.length; ++n2) { + if ("object" != typeof t4.initializer[n2]) throw TypeError(".onnx.GraphProto.initializer: object expected"); - e2.initializer[n2] = l.onnx.TensorProto.fromObject(t3.initializer[n2]); + e2.initializer[n2] = l.onnx.TensorProto.fromObject(t4.initializer[n2]); } } - if (null != t3.docString && (e2.docString = String(t3.docString)), t3.input) { - if (!Array.isArray(t3.input)) + if (null != t4.docString && (e2.docString = String(t4.docString)), t4.input) { + if (!Array.isArray(t4.input)) throw TypeError(".onnx.GraphProto.input: array expected"); - for (e2.input = [], n2 = 0; n2 < t3.input.length; ++n2) { - if ("object" != typeof t3.input[n2]) + for (e2.input = [], n2 = 0; n2 < t4.input.length; ++n2) { + if ("object" != typeof t4.input[n2]) throw TypeError(".onnx.GraphProto.input: object expected"); - e2.input[n2] = l.onnx.ValueInfoProto.fromObject(t3.input[n2]); + e2.input[n2] = l.onnx.ValueInfoProto.fromObject(t4.input[n2]); } } - if (t3.output) { - if (!Array.isArray(t3.output)) + if (t4.output) { + if (!Array.isArray(t4.output)) throw TypeError(".onnx.GraphProto.output: array expected"); - for (e2.output = [], n2 = 0; n2 < t3.output.length; ++n2) { - if ("object" != typeof t3.output[n2]) + for (e2.output = [], n2 = 0; n2 < t4.output.length; ++n2) { + if ("object" != typeof t4.output[n2]) throw TypeError(".onnx.GraphProto.output: object expected"); - e2.output[n2] = l.onnx.ValueInfoProto.fromObject(t3.output[n2]); + e2.output[n2] = l.onnx.ValueInfoProto.fromObject(t4.output[n2]); } } - if (t3.valueInfo) { - if (!Array.isArray(t3.valueInfo)) + if (t4.valueInfo) { + if (!Array.isArray(t4.valueInfo)) throw TypeError(".onnx.GraphProto.valueInfo: array expected"); - for (e2.valueInfo = [], n2 = 0; n2 < t3.valueInfo.length; ++n2) { - if ("object" != typeof t3.valueInfo[n2]) + for (e2.valueInfo = [], n2 = 0; n2 < t4.valueInfo.length; ++n2) { + if ("object" != typeof t4.valueInfo[n2]) throw TypeError(".onnx.GraphProto.valueInfo: object expected"); - e2.valueInfo[n2] = l.onnx.ValueInfoProto.fromObject(t3.valueInfo[n2]); + e2.valueInfo[n2] = l.onnx.ValueInfoProto.fromObject(t4.valueInfo[n2]); } } - if (t3.quantizationAnnotation) { - if (!Array.isArray(t3.quantizationAnnotation)) + if (t4.quantizationAnnotation) { + if (!Array.isArray(t4.quantizationAnnotation)) throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected"); - for (e2.quantizationAnnotation = [], n2 = 0; n2 < t3.quantizationAnnotation.length; ++n2) { - if ("object" != typeof t3.quantizationAnnotation[n2]) + for (e2.quantizationAnnotation = [], n2 = 0; n2 < t4.quantizationAnnotation.length; ++n2) { + if ("object" != typeof t4.quantizationAnnotation[n2]) throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected"); - e2.quantizationAnnotation[n2] = l.onnx.TensorAnnotation.fromObject(t3.quantizationAnnotation[n2]); + e2.quantizationAnnotation[n2] = l.onnx.TensorAnnotation.fromObject(t4.quantizationAnnotation[n2]); } } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - if ((e2.arrays || e2.defaults) && (n2.node = [], n2.initializer = [], n2.input = [], n2.output = [], n2.valueInfo = [], n2.quantizationAnnotation = []), e2.defaults && (n2.name = "", n2.docString = ""), t3.node && t3.node.length) { + if ((e2.arrays || e2.defaults) && (n2.node = [], n2.initializer = [], n2.input = [], n2.output = [], n2.valueInfo = [], n2.quantizationAnnotation = []), e2.defaults && (n2.name = "", n2.docString = ""), t4.node && t4.node.length) { n2.node = []; - for (var r2 = 0; r2 < t3.node.length; ++r2) - n2.node[r2] = l.onnx.NodeProto.toObject(t3.node[r2], e2); + for (var r2 = 0; r2 < t4.node.length; ++r2) + n2.node[r2] = l.onnx.NodeProto.toObject(t4.node[r2], e2); } - if (null != t3.name && t3.hasOwnProperty("name") && (n2.name = t3.name), t3.initializer && t3.initializer.length) - for (n2.initializer = [], r2 = 0; r2 < t3.initializer.length; ++r2) - n2.initializer[r2] = l.onnx.TensorProto.toObject(t3.initializer[r2], e2); - if (null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), t3.input && t3.input.length) - for (n2.input = [], r2 = 0; r2 < t3.input.length; ++r2) - n2.input[r2] = l.onnx.ValueInfoProto.toObject(t3.input[r2], e2); - if (t3.output && t3.output.length) - for (n2.output = [], r2 = 0; r2 < t3.output.length; ++r2) - n2.output[r2] = l.onnx.ValueInfoProto.toObject(t3.output[r2], e2); - if (t3.valueInfo && t3.valueInfo.length) - for (n2.valueInfo = [], r2 = 0; r2 < t3.valueInfo.length; ++r2) - n2.valueInfo[r2] = l.onnx.ValueInfoProto.toObject(t3.valueInfo[r2], e2); - if (t3.quantizationAnnotation && t3.quantizationAnnotation.length) - for (n2.quantizationAnnotation = [], r2 = 0; r2 < t3.quantizationAnnotation.length; ++r2) - n2.quantizationAnnotation[r2] = l.onnx.TensorAnnotation.toObject(t3.quantizationAnnotation[r2], e2); + if (null != t4.name && t4.hasOwnProperty("name") && (n2.name = t4.name), t4.initializer && t4.initializer.length) + for (n2.initializer = [], r2 = 0; r2 < t4.initializer.length; ++r2) + n2.initializer[r2] = l.onnx.TensorProto.toObject(t4.initializer[r2], e2); + if (null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), t4.input && t4.input.length) + for (n2.input = [], r2 = 0; r2 < t4.input.length; ++r2) + n2.input[r2] = l.onnx.ValueInfoProto.toObject(t4.input[r2], e2); + if (t4.output && t4.output.length) + for (n2.output = [], r2 = 0; r2 < t4.output.length; ++r2) + n2.output[r2] = l.onnx.ValueInfoProto.toObject(t4.output[r2], e2); + if (t4.valueInfo && t4.valueInfo.length) + for (n2.valueInfo = [], r2 = 0; r2 < t4.valueInfo.length; ++r2) + n2.valueInfo[r2] = l.onnx.ValueInfoProto.toObject(t4.valueInfo[r2], e2); + if (t4.quantizationAnnotation && t4.quantizationAnnotation.length) + for (n2.quantizationAnnotation = [], r2 = 0; r2 < t4.quantizationAnnotation.length; ++r2) + n2.quantizationAnnotation[r2] = l.onnx.TensorAnnotation.toObject(t4.quantizationAnnotation[r2], e2); return n2; - }, t2.prototype.toJSON = function() { + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; + }, t3; }(), o.TensorProto = function() { - function t2(t3) { - if (this.dims = [], this.floatData = [], this.int32Data = [], this.stringData = [], this.int64Data = [], this.externalData = [], this.doubleData = [], this.uint64Data = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.dims = [], this.floatData = [], this.int32Data = [], this.stringData = [], this.int64Data = [], this.externalData = [], this.doubleData = [], this.uint64Data = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.dims = c.emptyArray, t2.prototype.dataType = 0, t2.prototype.segment = null, t2.prototype.floatData = c.emptyArray, t2.prototype.int32Data = c.emptyArray, t2.prototype.stringData = c.emptyArray, t2.prototype.int64Data = c.emptyArray, t2.prototype.name = "", t2.prototype.docString = "", t2.prototype.rawData = c.newBuffer([]), t2.prototype.externalData = c.emptyArray, t2.prototype.dataLocation = 0, t2.prototype.doubleData = c.emptyArray, t2.prototype.uint64Data = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.dims && t3.dims.length) { + return t3.prototype.dims = c.emptyArray, t3.prototype.dataType = 0, t3.prototype.segment = null, t3.prototype.floatData = c.emptyArray, t3.prototype.int32Data = c.emptyArray, t3.prototype.stringData = c.emptyArray, t3.prototype.int64Data = c.emptyArray, t3.prototype.name = "", t3.prototype.docString = "", t3.prototype.rawData = c.newBuffer([]), t3.prototype.externalData = c.emptyArray, t3.prototype.dataLocation = 0, t3.prototype.doubleData = c.emptyArray, t3.prototype.uint64Data = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.dims && t4.dims.length) { e2.uint32(10).fork(); - for (var n2 = 0; n2 < t3.dims.length; ++n2) - e2.int64(t3.dims[n2]); + for (var n2 = 0; n2 < t4.dims.length; ++n2) + e2.int64(t4.dims[n2]); e2.ldelim(); } - if (null != t3.dataType && t3.hasOwnProperty("dataType") && e2.uint32(16).int32(t3.dataType), null != t3.segment && t3.hasOwnProperty("segment") && l.onnx.TensorProto.Segment.encode(t3.segment, e2.uint32(26).fork()).ldelim(), null != t3.floatData && t3.floatData.length) { - for (e2.uint32(34).fork(), n2 = 0; n2 < t3.floatData.length; ++n2) - e2.float(t3.floatData[n2]); + if (null != t4.dataType && t4.hasOwnProperty("dataType") && e2.uint32(16).int32(t4.dataType), null != t4.segment && t4.hasOwnProperty("segment") && l.onnx.TensorProto.Segment.encode(t4.segment, e2.uint32(26).fork()).ldelim(), null != t4.floatData && t4.floatData.length) { + for (e2.uint32(34).fork(), n2 = 0; n2 < t4.floatData.length; ++n2) + e2.float(t4.floatData[n2]); e2.ldelim(); } - if (null != t3.int32Data && t3.int32Data.length) { - for (e2.uint32(42).fork(), n2 = 0; n2 < t3.int32Data.length; ++n2) - e2.int32(t3.int32Data[n2]); + if (null != t4.int32Data && t4.int32Data.length) { + for (e2.uint32(42).fork(), n2 = 0; n2 < t4.int32Data.length; ++n2) + e2.int32(t4.int32Data[n2]); e2.ldelim(); } - if (null != t3.stringData && t3.stringData.length) - for (n2 = 0; n2 < t3.stringData.length; ++n2) - e2.uint32(50).bytes(t3.stringData[n2]); - if (null != t3.int64Data && t3.int64Data.length) { - for (e2.uint32(58).fork(), n2 = 0; n2 < t3.int64Data.length; ++n2) - e2.int64(t3.int64Data[n2]); + if (null != t4.stringData && t4.stringData.length) + for (n2 = 0; n2 < t4.stringData.length; ++n2) + e2.uint32(50).bytes(t4.stringData[n2]); + if (null != t4.int64Data && t4.int64Data.length) { + for (e2.uint32(58).fork(), n2 = 0; n2 < t4.int64Data.length; ++n2) + e2.int64(t4.int64Data[n2]); e2.ldelim(); } - if (null != t3.name && t3.hasOwnProperty("name") && e2.uint32(66).string(t3.name), null != t3.rawData && t3.hasOwnProperty("rawData") && e2.uint32(74).bytes(t3.rawData), null != t3.doubleData && t3.doubleData.length) { - for (e2.uint32(82).fork(), n2 = 0; n2 < t3.doubleData.length; ++n2) - e2.double(t3.doubleData[n2]); + if (null != t4.name && t4.hasOwnProperty("name") && e2.uint32(66).string(t4.name), null != t4.rawData && t4.hasOwnProperty("rawData") && e2.uint32(74).bytes(t4.rawData), null != t4.doubleData && t4.doubleData.length) { + for (e2.uint32(82).fork(), n2 = 0; n2 < t4.doubleData.length; ++n2) + e2.double(t4.doubleData[n2]); e2.ldelim(); } - if (null != t3.uint64Data && t3.uint64Data.length) { - for (e2.uint32(90).fork(), n2 = 0; n2 < t3.uint64Data.length; ++n2) - e2.uint64(t3.uint64Data[n2]); + if (null != t4.uint64Data && t4.uint64Data.length) { + for (e2.uint32(90).fork(), n2 = 0; n2 < t4.uint64Data.length; ++n2) + e2.uint64(t4.uint64Data[n2]); e2.ldelim(); } - if (null != t3.docString && t3.hasOwnProperty("docString") && e2.uint32(98).string(t3.docString), null != t3.externalData && t3.externalData.length) - for (n2 = 0; n2 < t3.externalData.length; ++n2) - l.onnx.StringStringEntryProto.encode(t3.externalData[n2], e2.uint32(106).fork()).ldelim(); - return null != t3.dataLocation && t3.hasOwnProperty("dataLocation") && e2.uint32(112).int32(t3.dataLocation), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.TensorProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + if (null != t4.docString && t4.hasOwnProperty("docString") && e2.uint32(98).string(t4.docString), null != t4.externalData && t4.externalData.length) + for (n2 = 0; n2 < t4.externalData.length; ++n2) + l.onnx.StringStringEntryProto.encode(t4.externalData[n2], e2.uint32(106).fork()).ldelim(); + return null != t4.dataLocation && t4.hasOwnProperty("dataLocation") && e2.uint32(112).int32(t4.dataLocation), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.TensorProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: if (r2.dims && r2.dims.length || (r2.dims = []), 2 == (7 & i3)) - for (var o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.dims.push(t3.int64()); + for (var o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.dims.push(t4.int64()); else - r2.dims.push(t3.int64()); + r2.dims.push(t4.int64()); break; case 2: - r2.dataType = t3.int32(); + r2.dataType = t4.int32(); break; case 3: - r2.segment = l.onnx.TensorProto.Segment.decode(t3, t3.uint32()); + r2.segment = l.onnx.TensorProto.Segment.decode(t4, t4.uint32()); break; case 4: if (r2.floatData && r2.floatData.length || (r2.floatData = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.floatData.push(t3.float()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.floatData.push(t4.float()); else - r2.floatData.push(t3.float()); + r2.floatData.push(t4.float()); break; case 5: if (r2.int32Data && r2.int32Data.length || (r2.int32Data = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.int32Data.push(t3.int32()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.int32Data.push(t4.int32()); else - r2.int32Data.push(t3.int32()); + r2.int32Data.push(t4.int32()); break; case 6: - r2.stringData && r2.stringData.length || (r2.stringData = []), r2.stringData.push(t3.bytes()); + r2.stringData && r2.stringData.length || (r2.stringData = []), r2.stringData.push(t4.bytes()); break; case 7: if (r2.int64Data && r2.int64Data.length || (r2.int64Data = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.int64Data.push(t3.int64()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.int64Data.push(t4.int64()); else - r2.int64Data.push(t3.int64()); + r2.int64Data.push(t4.int64()); break; case 8: - r2.name = t3.string(); + r2.name = t4.string(); break; case 12: - r2.docString = t3.string(); + r2.docString = t4.string(); break; case 9: - r2.rawData = t3.bytes(); + r2.rawData = t4.bytes(); break; case 13: - r2.externalData && r2.externalData.length || (r2.externalData = []), r2.externalData.push(l.onnx.StringStringEntryProto.decode(t3, t3.uint32())); + r2.externalData && r2.externalData.length || (r2.externalData = []), r2.externalData.push(l.onnx.StringStringEntryProto.decode(t4, t4.uint32())); break; case 14: - r2.dataLocation = t3.int32(); + r2.dataLocation = t4.int32(); break; case 10: if (r2.doubleData && r2.doubleData.length || (r2.doubleData = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.doubleData.push(t3.double()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.doubleData.push(t4.double()); else - r2.doubleData.push(t3.double()); + r2.doubleData.push(t4.double()); break; case 11: if (r2.uint64Data && r2.uint64Data.length || (r2.uint64Data = []), 2 == (7 & i3)) - for (o2 = t3.uint32() + t3.pos; t3.pos < o2; ) - r2.uint64Data.push(t3.uint64()); + for (o2 = t4.uint32() + t4.pos; t4.pos < o2; ) + r2.uint64Data.push(t4.uint64()); else - r2.uint64Data.push(t3.uint64()); + r2.uint64Data.push(t4.uint64()); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.dims && t3.hasOwnProperty("dims")) { - if (!Array.isArray(t3.dims)) + if (null != t4.dims && t4.hasOwnProperty("dims")) { + if (!Array.isArray(t4.dims)) return "dims: array expected"; - for (var e2 = 0; e2 < t3.dims.length; ++e2) - if (!(c.isInteger(t3.dims[e2]) || t3.dims[e2] && c.isInteger(t3.dims[e2].low) && c.isInteger(t3.dims[e2].high))) + for (var e2 = 0; e2 < t4.dims.length; ++e2) + if (!(c.isInteger(t4.dims[e2]) || t4.dims[e2] && c.isInteger(t4.dims[e2].low) && c.isInteger(t4.dims[e2].high))) return "dims: integer|Long[] expected"; } - if (null != t3.dataType && t3.hasOwnProperty("dataType") && !c.isInteger(t3.dataType)) + if (null != t4.dataType && t4.hasOwnProperty("dataType") && !c.isInteger(t4.dataType)) return "dataType: integer expected"; - if (null != t3.segment && t3.hasOwnProperty("segment") && (n2 = l.onnx.TensorProto.Segment.verify(t3.segment))) + if (null != t4.segment && t4.hasOwnProperty("segment") && (n2 = l.onnx.TensorProto.Segment.verify(t4.segment))) return "segment." + n2; - if (null != t3.floatData && t3.hasOwnProperty("floatData")) { - if (!Array.isArray(t3.floatData)) + if (null != t4.floatData && t4.hasOwnProperty("floatData")) { + if (!Array.isArray(t4.floatData)) return "floatData: array expected"; - for (e2 = 0; e2 < t3.floatData.length; ++e2) - if ("number" != typeof t3.floatData[e2]) + for (e2 = 0; e2 < t4.floatData.length; ++e2) + if ("number" != typeof t4.floatData[e2]) return "floatData: number[] expected"; } - if (null != t3.int32Data && t3.hasOwnProperty("int32Data")) { - if (!Array.isArray(t3.int32Data)) + if (null != t4.int32Data && t4.hasOwnProperty("int32Data")) { + if (!Array.isArray(t4.int32Data)) return "int32Data: array expected"; - for (e2 = 0; e2 < t3.int32Data.length; ++e2) - if (!c.isInteger(t3.int32Data[e2])) + for (e2 = 0; e2 < t4.int32Data.length; ++e2) + if (!c.isInteger(t4.int32Data[e2])) return "int32Data: integer[] expected"; } - if (null != t3.stringData && t3.hasOwnProperty("stringData")) { - if (!Array.isArray(t3.stringData)) + if (null != t4.stringData && t4.hasOwnProperty("stringData")) { + if (!Array.isArray(t4.stringData)) return "stringData: array expected"; - for (e2 = 0; e2 < t3.stringData.length; ++e2) - if (!(t3.stringData[e2] && "number" == typeof t3.stringData[e2].length || c.isString(t3.stringData[e2]))) + for (e2 = 0; e2 < t4.stringData.length; ++e2) + if (!(t4.stringData[e2] && "number" == typeof t4.stringData[e2].length || c.isString(t4.stringData[e2]))) return "stringData: buffer[] expected"; } - if (null != t3.int64Data && t3.hasOwnProperty("int64Data")) { - if (!Array.isArray(t3.int64Data)) + if (null != t4.int64Data && t4.hasOwnProperty("int64Data")) { + if (!Array.isArray(t4.int64Data)) return "int64Data: array expected"; - for (e2 = 0; e2 < t3.int64Data.length; ++e2) - if (!(c.isInteger(t3.int64Data[e2]) || t3.int64Data[e2] && c.isInteger(t3.int64Data[e2].low) && c.isInteger(t3.int64Data[e2].high))) + for (e2 = 0; e2 < t4.int64Data.length; ++e2) + if (!(c.isInteger(t4.int64Data[e2]) || t4.int64Data[e2] && c.isInteger(t4.int64Data[e2].low) && c.isInteger(t4.int64Data[e2].high))) return "int64Data: integer|Long[] expected"; } - if (null != t3.name && t3.hasOwnProperty("name") && !c.isString(t3.name)) + if (null != t4.name && t4.hasOwnProperty("name") && !c.isString(t4.name)) return "name: string expected"; - if (null != t3.docString && t3.hasOwnProperty("docString") && !c.isString(t3.docString)) + if (null != t4.docString && t4.hasOwnProperty("docString") && !c.isString(t4.docString)) return "docString: string expected"; - if (null != t3.rawData && t3.hasOwnProperty("rawData") && !(t3.rawData && "number" == typeof t3.rawData.length || c.isString(t3.rawData))) + if (null != t4.rawData && t4.hasOwnProperty("rawData") && !(t4.rawData && "number" == typeof t4.rawData.length || c.isString(t4.rawData))) return "rawData: buffer expected"; - if (null != t3.externalData && t3.hasOwnProperty("externalData")) { - if (!Array.isArray(t3.externalData)) + if (null != t4.externalData && t4.hasOwnProperty("externalData")) { + if (!Array.isArray(t4.externalData)) return "externalData: array expected"; - for (e2 = 0; e2 < t3.externalData.length; ++e2) { + for (e2 = 0; e2 < t4.externalData.length; ++e2) { var n2; - if (n2 = l.onnx.StringStringEntryProto.verify(t3.externalData[e2])) + if (n2 = l.onnx.StringStringEntryProto.verify(t4.externalData[e2])) return "externalData." + n2; } } - if (null != t3.dataLocation && t3.hasOwnProperty("dataLocation")) - switch (t3.dataLocation) { + if (null != t4.dataLocation && t4.hasOwnProperty("dataLocation")) + switch (t4.dataLocation) { default: return "dataLocation: enum value expected"; case 0: case 1: } - if (null != t3.doubleData && t3.hasOwnProperty("doubleData")) { - if (!Array.isArray(t3.doubleData)) + if (null != t4.doubleData && t4.hasOwnProperty("doubleData")) { + if (!Array.isArray(t4.doubleData)) return "doubleData: array expected"; - for (e2 = 0; e2 < t3.doubleData.length; ++e2) - if ("number" != typeof t3.doubleData[e2]) + for (e2 = 0; e2 < t4.doubleData.length; ++e2) + if ("number" != typeof t4.doubleData[e2]) return "doubleData: number[] expected"; } - if (null != t3.uint64Data && t3.hasOwnProperty("uint64Data")) { - if (!Array.isArray(t3.uint64Data)) + if (null != t4.uint64Data && t4.hasOwnProperty("uint64Data")) { + if (!Array.isArray(t4.uint64Data)) return "uint64Data: array expected"; - for (e2 = 0; e2 < t3.uint64Data.length; ++e2) - if (!(c.isInteger(t3.uint64Data[e2]) || t3.uint64Data[e2] && c.isInteger(t3.uint64Data[e2].low) && c.isInteger(t3.uint64Data[e2].high))) + for (e2 = 0; e2 < t4.uint64Data.length; ++e2) + if (!(c.isInteger(t4.uint64Data[e2]) || t4.uint64Data[e2] && c.isInteger(t4.uint64Data[e2].low) && c.isInteger(t4.uint64Data[e2].high))) return "uint64Data: integer|Long[] expected"; } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.TensorProto) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.TensorProto) + return t4; var e2 = new l.onnx.TensorProto(); - if (t3.dims) { - if (!Array.isArray(t3.dims)) + if (t4.dims) { + if (!Array.isArray(t4.dims)) throw TypeError(".onnx.TensorProto.dims: array expected"); e2.dims = []; - for (var n2 = 0; n2 < t3.dims.length; ++n2) - c.Long ? (e2.dims[n2] = c.Long.fromValue(t3.dims[n2])).unsigned = false : "string" == typeof t3.dims[n2] ? e2.dims[n2] = parseInt(t3.dims[n2], 10) : "number" == typeof t3.dims[n2] ? e2.dims[n2] = t3.dims[n2] : "object" == typeof t3.dims[n2] && (e2.dims[n2] = new c.LongBits(t3.dims[n2].low >>> 0, t3.dims[n2].high >>> 0).toNumber()); + for (var n2 = 0; n2 < t4.dims.length; ++n2) + c.Long ? (e2.dims[n2] = c.Long.fromValue(t4.dims[n2])).unsigned = false : "string" == typeof t4.dims[n2] ? e2.dims[n2] = parseInt(t4.dims[n2], 10) : "number" == typeof t4.dims[n2] ? e2.dims[n2] = t4.dims[n2] : "object" == typeof t4.dims[n2] && (e2.dims[n2] = new c.LongBits(t4.dims[n2].low >>> 0, t4.dims[n2].high >>> 0).toNumber()); } - if (null != t3.dataType && (e2.dataType = 0 | t3.dataType), null != t3.segment) { - if ("object" != typeof t3.segment) + if (null != t4.dataType && (e2.dataType = 0 | t4.dataType), null != t4.segment) { + if ("object" != typeof t4.segment) throw TypeError(".onnx.TensorProto.segment: object expected"); - e2.segment = l.onnx.TensorProto.Segment.fromObject(t3.segment); + e2.segment = l.onnx.TensorProto.Segment.fromObject(t4.segment); } - if (t3.floatData) { - if (!Array.isArray(t3.floatData)) + if (t4.floatData) { + if (!Array.isArray(t4.floatData)) throw TypeError(".onnx.TensorProto.floatData: array expected"); - for (e2.floatData = [], n2 = 0; n2 < t3.floatData.length; ++n2) - e2.floatData[n2] = Number(t3.floatData[n2]); + for (e2.floatData = [], n2 = 0; n2 < t4.floatData.length; ++n2) + e2.floatData[n2] = Number(t4.floatData[n2]); } - if (t3.int32Data) { - if (!Array.isArray(t3.int32Data)) + if (t4.int32Data) { + if (!Array.isArray(t4.int32Data)) throw TypeError(".onnx.TensorProto.int32Data: array expected"); - for (e2.int32Data = [], n2 = 0; n2 < t3.int32Data.length; ++n2) - e2.int32Data[n2] = 0 | t3.int32Data[n2]; + for (e2.int32Data = [], n2 = 0; n2 < t4.int32Data.length; ++n2) + e2.int32Data[n2] = 0 | t4.int32Data[n2]; } - if (t3.stringData) { - if (!Array.isArray(t3.stringData)) + if (t4.stringData) { + if (!Array.isArray(t4.stringData)) throw TypeError(".onnx.TensorProto.stringData: array expected"); - for (e2.stringData = [], n2 = 0; n2 < t3.stringData.length; ++n2) - "string" == typeof t3.stringData[n2] ? c.base64.decode(t3.stringData[n2], e2.stringData[n2] = c.newBuffer(c.base64.length(t3.stringData[n2])), 0) : t3.stringData[n2].length && (e2.stringData[n2] = t3.stringData[n2]); + for (e2.stringData = [], n2 = 0; n2 < t4.stringData.length; ++n2) + "string" == typeof t4.stringData[n2] ? c.base64.decode(t4.stringData[n2], e2.stringData[n2] = c.newBuffer(c.base64.length(t4.stringData[n2])), 0) : t4.stringData[n2].length && (e2.stringData[n2] = t4.stringData[n2]); } - if (t3.int64Data) { - if (!Array.isArray(t3.int64Data)) + if (t4.int64Data) { + if (!Array.isArray(t4.int64Data)) throw TypeError(".onnx.TensorProto.int64Data: array expected"); - for (e2.int64Data = [], n2 = 0; n2 < t3.int64Data.length; ++n2) - c.Long ? (e2.int64Data[n2] = c.Long.fromValue(t3.int64Data[n2])).unsigned = false : "string" == typeof t3.int64Data[n2] ? e2.int64Data[n2] = parseInt(t3.int64Data[n2], 10) : "number" == typeof t3.int64Data[n2] ? e2.int64Data[n2] = t3.int64Data[n2] : "object" == typeof t3.int64Data[n2] && (e2.int64Data[n2] = new c.LongBits(t3.int64Data[n2].low >>> 0, t3.int64Data[n2].high >>> 0).toNumber()); + for (e2.int64Data = [], n2 = 0; n2 < t4.int64Data.length; ++n2) + c.Long ? (e2.int64Data[n2] = c.Long.fromValue(t4.int64Data[n2])).unsigned = false : "string" == typeof t4.int64Data[n2] ? e2.int64Data[n2] = parseInt(t4.int64Data[n2], 10) : "number" == typeof t4.int64Data[n2] ? e2.int64Data[n2] = t4.int64Data[n2] : "object" == typeof t4.int64Data[n2] && (e2.int64Data[n2] = new c.LongBits(t4.int64Data[n2].low >>> 0, t4.int64Data[n2].high >>> 0).toNumber()); } - if (null != t3.name && (e2.name = String(t3.name)), null != t3.docString && (e2.docString = String(t3.docString)), null != t3.rawData && ("string" == typeof t3.rawData ? c.base64.decode(t3.rawData, e2.rawData = c.newBuffer(c.base64.length(t3.rawData)), 0) : t3.rawData.length && (e2.rawData = t3.rawData)), t3.externalData) { - if (!Array.isArray(t3.externalData)) + if (null != t4.name && (e2.name = String(t4.name)), null != t4.docString && (e2.docString = String(t4.docString)), null != t4.rawData && ("string" == typeof t4.rawData ? c.base64.decode(t4.rawData, e2.rawData = c.newBuffer(c.base64.length(t4.rawData)), 0) : t4.rawData.length && (e2.rawData = t4.rawData)), t4.externalData) { + if (!Array.isArray(t4.externalData)) throw TypeError(".onnx.TensorProto.externalData: array expected"); - for (e2.externalData = [], n2 = 0; n2 < t3.externalData.length; ++n2) { - if ("object" != typeof t3.externalData[n2]) + for (e2.externalData = [], n2 = 0; n2 < t4.externalData.length; ++n2) { + if ("object" != typeof t4.externalData[n2]) throw TypeError(".onnx.TensorProto.externalData: object expected"); - e2.externalData[n2] = l.onnx.StringStringEntryProto.fromObject(t3.externalData[n2]); + e2.externalData[n2] = l.onnx.StringStringEntryProto.fromObject(t4.externalData[n2]); } } - switch (t3.dataLocation) { + switch (t4.dataLocation) { case "DEFAULT": case 0: e2.dataLocation = 0; @@ -5257,92 +5942,92 @@ var require_ort_web_node = __commonJS({ case 1: e2.dataLocation = 1; } - if (t3.doubleData) { - if (!Array.isArray(t3.doubleData)) + if (t4.doubleData) { + if (!Array.isArray(t4.doubleData)) throw TypeError(".onnx.TensorProto.doubleData: array expected"); - for (e2.doubleData = [], n2 = 0; n2 < t3.doubleData.length; ++n2) - e2.doubleData[n2] = Number(t3.doubleData[n2]); + for (e2.doubleData = [], n2 = 0; n2 < t4.doubleData.length; ++n2) + e2.doubleData[n2] = Number(t4.doubleData[n2]); } - if (t3.uint64Data) { - if (!Array.isArray(t3.uint64Data)) + if (t4.uint64Data) { + if (!Array.isArray(t4.uint64Data)) throw TypeError(".onnx.TensorProto.uint64Data: array expected"); - for (e2.uint64Data = [], n2 = 0; n2 < t3.uint64Data.length; ++n2) - c.Long ? (e2.uint64Data[n2] = c.Long.fromValue(t3.uint64Data[n2])).unsigned = true : "string" == typeof t3.uint64Data[n2] ? e2.uint64Data[n2] = parseInt(t3.uint64Data[n2], 10) : "number" == typeof t3.uint64Data[n2] ? e2.uint64Data[n2] = t3.uint64Data[n2] : "object" == typeof t3.uint64Data[n2] && (e2.uint64Data[n2] = new c.LongBits(t3.uint64Data[n2].low >>> 0, t3.uint64Data[n2].high >>> 0).toNumber(true)); + for (e2.uint64Data = [], n2 = 0; n2 < t4.uint64Data.length; ++n2) + c.Long ? (e2.uint64Data[n2] = c.Long.fromValue(t4.uint64Data[n2])).unsigned = true : "string" == typeof t4.uint64Data[n2] ? e2.uint64Data[n2] = parseInt(t4.uint64Data[n2], 10) : "number" == typeof t4.uint64Data[n2] ? e2.uint64Data[n2] = t4.uint64Data[n2] : "object" == typeof t4.uint64Data[n2] && (e2.uint64Data[n2] = new c.LongBits(t4.uint64Data[n2].low >>> 0, t4.uint64Data[n2].high >>> 0).toNumber(true)); } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - if ((e2.arrays || e2.defaults) && (n2.dims = [], n2.floatData = [], n2.int32Data = [], n2.stringData = [], n2.int64Data = [], n2.doubleData = [], n2.uint64Data = [], n2.externalData = []), e2.defaults && (n2.dataType = 0, n2.segment = null, n2.name = "", e2.bytes === String ? n2.rawData = "" : (n2.rawData = [], e2.bytes !== Array && (n2.rawData = c.newBuffer(n2.rawData))), n2.docString = "", n2.dataLocation = e2.enums === String ? "DEFAULT" : 0), t3.dims && t3.dims.length) { + if ((e2.arrays || e2.defaults) && (n2.dims = [], n2.floatData = [], n2.int32Data = [], n2.stringData = [], n2.int64Data = [], n2.doubleData = [], n2.uint64Data = [], n2.externalData = []), e2.defaults && (n2.dataType = 0, n2.segment = null, n2.name = "", e2.bytes === String ? n2.rawData = "" : (n2.rawData = [], e2.bytes !== Array && (n2.rawData = c.newBuffer(n2.rawData))), n2.docString = "", n2.dataLocation = e2.enums === String ? "DEFAULT" : 0), t4.dims && t4.dims.length) { n2.dims = []; - for (var r2 = 0; r2 < t3.dims.length; ++r2) - "number" == typeof t3.dims[r2] ? n2.dims[r2] = e2.longs === String ? String(t3.dims[r2]) : t3.dims[r2] : n2.dims[r2] = e2.longs === String ? c.Long.prototype.toString.call(t3.dims[r2]) : e2.longs === Number ? new c.LongBits(t3.dims[r2].low >>> 0, t3.dims[r2].high >>> 0).toNumber() : t3.dims[r2]; + for (var r2 = 0; r2 < t4.dims.length; ++r2) + "number" == typeof t4.dims[r2] ? n2.dims[r2] = e2.longs === String ? String(t4.dims[r2]) : t4.dims[r2] : n2.dims[r2] = e2.longs === String ? c.Long.prototype.toString.call(t4.dims[r2]) : e2.longs === Number ? new c.LongBits(t4.dims[r2].low >>> 0, t4.dims[r2].high >>> 0).toNumber() : t4.dims[r2]; } - if (null != t3.dataType && t3.hasOwnProperty("dataType") && (n2.dataType = t3.dataType), null != t3.segment && t3.hasOwnProperty("segment") && (n2.segment = l.onnx.TensorProto.Segment.toObject(t3.segment, e2)), t3.floatData && t3.floatData.length) - for (n2.floatData = [], r2 = 0; r2 < t3.floatData.length; ++r2) - n2.floatData[r2] = e2.json && !isFinite(t3.floatData[r2]) ? String(t3.floatData[r2]) : t3.floatData[r2]; - if (t3.int32Data && t3.int32Data.length) - for (n2.int32Data = [], r2 = 0; r2 < t3.int32Data.length; ++r2) - n2.int32Data[r2] = t3.int32Data[r2]; - if (t3.stringData && t3.stringData.length) - for (n2.stringData = [], r2 = 0; r2 < t3.stringData.length; ++r2) - n2.stringData[r2] = e2.bytes === String ? c.base64.encode(t3.stringData[r2], 0, t3.stringData[r2].length) : e2.bytes === Array ? Array.prototype.slice.call(t3.stringData[r2]) : t3.stringData[r2]; - if (t3.int64Data && t3.int64Data.length) - for (n2.int64Data = [], r2 = 0; r2 < t3.int64Data.length; ++r2) - "number" == typeof t3.int64Data[r2] ? n2.int64Data[r2] = e2.longs === String ? String(t3.int64Data[r2]) : t3.int64Data[r2] : n2.int64Data[r2] = e2.longs === String ? c.Long.prototype.toString.call(t3.int64Data[r2]) : e2.longs === Number ? new c.LongBits(t3.int64Data[r2].low >>> 0, t3.int64Data[r2].high >>> 0).toNumber() : t3.int64Data[r2]; - if (null != t3.name && t3.hasOwnProperty("name") && (n2.name = t3.name), null != t3.rawData && t3.hasOwnProperty("rawData") && (n2.rawData = e2.bytes === String ? c.base64.encode(t3.rawData, 0, t3.rawData.length) : e2.bytes === Array ? Array.prototype.slice.call(t3.rawData) : t3.rawData), t3.doubleData && t3.doubleData.length) - for (n2.doubleData = [], r2 = 0; r2 < t3.doubleData.length; ++r2) - n2.doubleData[r2] = e2.json && !isFinite(t3.doubleData[r2]) ? String(t3.doubleData[r2]) : t3.doubleData[r2]; - if (t3.uint64Data && t3.uint64Data.length) - for (n2.uint64Data = [], r2 = 0; r2 < t3.uint64Data.length; ++r2) - "number" == typeof t3.uint64Data[r2] ? n2.uint64Data[r2] = e2.longs === String ? String(t3.uint64Data[r2]) : t3.uint64Data[r2] : n2.uint64Data[r2] = e2.longs === String ? c.Long.prototype.toString.call(t3.uint64Data[r2]) : e2.longs === Number ? new c.LongBits(t3.uint64Data[r2].low >>> 0, t3.uint64Data[r2].high >>> 0).toNumber(true) : t3.uint64Data[r2]; - if (null != t3.docString && t3.hasOwnProperty("docString") && (n2.docString = t3.docString), t3.externalData && t3.externalData.length) - for (n2.externalData = [], r2 = 0; r2 < t3.externalData.length; ++r2) - n2.externalData[r2] = l.onnx.StringStringEntryProto.toObject(t3.externalData[r2], e2); - return null != t3.dataLocation && t3.hasOwnProperty("dataLocation") && (n2.dataLocation = e2.enums === String ? l.onnx.TensorProto.DataLocation[t3.dataLocation] : t3.dataLocation), n2; - }, t2.prototype.toJSON = function() { + if (null != t4.dataType && t4.hasOwnProperty("dataType") && (n2.dataType = t4.dataType), null != t4.segment && t4.hasOwnProperty("segment") && (n2.segment = l.onnx.TensorProto.Segment.toObject(t4.segment, e2)), t4.floatData && t4.floatData.length) + for (n2.floatData = [], r2 = 0; r2 < t4.floatData.length; ++r2) + n2.floatData[r2] = e2.json && !isFinite(t4.floatData[r2]) ? String(t4.floatData[r2]) : t4.floatData[r2]; + if (t4.int32Data && t4.int32Data.length) + for (n2.int32Data = [], r2 = 0; r2 < t4.int32Data.length; ++r2) + n2.int32Data[r2] = t4.int32Data[r2]; + if (t4.stringData && t4.stringData.length) + for (n2.stringData = [], r2 = 0; r2 < t4.stringData.length; ++r2) + n2.stringData[r2] = e2.bytes === String ? c.base64.encode(t4.stringData[r2], 0, t4.stringData[r2].length) : e2.bytes === Array ? Array.prototype.slice.call(t4.stringData[r2]) : t4.stringData[r2]; + if (t4.int64Data && t4.int64Data.length) + for (n2.int64Data = [], r2 = 0; r2 < t4.int64Data.length; ++r2) + "number" == typeof t4.int64Data[r2] ? n2.int64Data[r2] = e2.longs === String ? String(t4.int64Data[r2]) : t4.int64Data[r2] : n2.int64Data[r2] = e2.longs === String ? c.Long.prototype.toString.call(t4.int64Data[r2]) : e2.longs === Number ? new c.LongBits(t4.int64Data[r2].low >>> 0, t4.int64Data[r2].high >>> 0).toNumber() : t4.int64Data[r2]; + if (null != t4.name && t4.hasOwnProperty("name") && (n2.name = t4.name), null != t4.rawData && t4.hasOwnProperty("rawData") && (n2.rawData = e2.bytes === String ? c.base64.encode(t4.rawData, 0, t4.rawData.length) : e2.bytes === Array ? Array.prototype.slice.call(t4.rawData) : t4.rawData), t4.doubleData && t4.doubleData.length) + for (n2.doubleData = [], r2 = 0; r2 < t4.doubleData.length; ++r2) + n2.doubleData[r2] = e2.json && !isFinite(t4.doubleData[r2]) ? String(t4.doubleData[r2]) : t4.doubleData[r2]; + if (t4.uint64Data && t4.uint64Data.length) + for (n2.uint64Data = [], r2 = 0; r2 < t4.uint64Data.length; ++r2) + "number" == typeof t4.uint64Data[r2] ? n2.uint64Data[r2] = e2.longs === String ? String(t4.uint64Data[r2]) : t4.uint64Data[r2] : n2.uint64Data[r2] = e2.longs === String ? c.Long.prototype.toString.call(t4.uint64Data[r2]) : e2.longs === Number ? new c.LongBits(t4.uint64Data[r2].low >>> 0, t4.uint64Data[r2].high >>> 0).toNumber(true) : t4.uint64Data[r2]; + if (null != t4.docString && t4.hasOwnProperty("docString") && (n2.docString = t4.docString), t4.externalData && t4.externalData.length) + for (n2.externalData = [], r2 = 0; r2 < t4.externalData.length; ++r2) + n2.externalData[r2] = l.onnx.StringStringEntryProto.toObject(t4.externalData[r2], e2); + return null != t4.dataLocation && t4.hasOwnProperty("dataLocation") && (n2.dataLocation = e2.enums === String ? l.onnx.TensorProto.DataLocation[t4.dataLocation] : t4.dataLocation), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2.DataType = function() { - var t3 = {}, e2 = Object.create(t3); - return e2[t3[0] = "UNDEFINED"] = 0, e2[t3[1] = "FLOAT"] = 1, e2[t3[2] = "UINT8"] = 2, e2[t3[3] = "INT8"] = 3, e2[t3[4] = "UINT16"] = 4, e2[t3[5] = "INT16"] = 5, e2[t3[6] = "INT32"] = 6, e2[t3[7] = "INT64"] = 7, e2[t3[8] = "STRING"] = 8, e2[t3[9] = "BOOL"] = 9, e2[t3[10] = "FLOAT16"] = 10, e2[t3[11] = "DOUBLE"] = 11, e2[t3[12] = "UINT32"] = 12, e2[t3[13] = "UINT64"] = 13, e2[t3[14] = "COMPLEX64"] = 14, e2[t3[15] = "COMPLEX128"] = 15, e2[t3[16] = "BFLOAT16"] = 16, e2; - }(), t2.Segment = function() { - function t3(t4) { - if (t4) - for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) - null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); + }, t3.DataType = function() { + var t4 = {}, e2 = Object.create(t4); + return e2[t4[0] = "UNDEFINED"] = 0, e2[t4[1] = "FLOAT"] = 1, e2[t4[2] = "UINT8"] = 2, e2[t4[3] = "INT8"] = 3, e2[t4[4] = "UINT16"] = 4, e2[t4[5] = "INT16"] = 5, e2[t4[6] = "INT32"] = 6, e2[t4[7] = "INT64"] = 7, e2[t4[8] = "STRING"] = 8, e2[t4[9] = "BOOL"] = 9, e2[t4[10] = "FLOAT16"] = 10, e2[t4[11] = "DOUBLE"] = 11, e2[t4[12] = "UINT32"] = 12, e2[t4[13] = "UINT64"] = 13, e2[t4[14] = "COMPLEX64"] = 14, e2[t4[15] = "COMPLEX128"] = 15, e2[t4[16] = "BFLOAT16"] = 16, e2; + }(), t3.Segment = function() { + function t4(t5) { + if (t5) + for (var e2 = Object.keys(t5), n2 = 0; n2 < e2.length; ++n2) + null != t5[e2[n2]] && (this[e2[n2]] = t5[e2[n2]]); } - return t3.prototype.begin = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.prototype.end = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.create = function(e2) { - return new t3(e2); - }, t3.encode = function(t4, e2) { - return e2 || (e2 = u.create()), null != t4.begin && t4.hasOwnProperty("begin") && e2.uint32(8).int64(t4.begin), null != t4.end && t4.hasOwnProperty("end") && e2.uint32(16).int64(t4.end), e2; - }, t3.encodeDelimited = function(t4, e2) { - return this.encode(t4, e2).ldelim(); - }, t3.decode = function(t4, e2) { - t4 instanceof s || (t4 = s.create(t4)); - for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.TensorProto.Segment(); t4.pos < n2; ) { - var i3 = t4.uint32(); + return t4.prototype.begin = c.Long ? c.Long.fromBits(0, 0, false) : 0, t4.prototype.end = c.Long ? c.Long.fromBits(0, 0, false) : 0, t4.create = function(e2) { + return new t4(e2); + }, t4.encode = function(t5, e2) { + return e2 || (e2 = u.create()), null != t5.begin && t5.hasOwnProperty("begin") && e2.uint32(8).int64(t5.begin), null != t5.end && t5.hasOwnProperty("end") && e2.uint32(16).int64(t5.end), e2; + }, t4.encodeDelimited = function(t5, e2) { + return this.encode(t5, e2).ldelim(); + }, t4.decode = function(t5, e2) { + t5 instanceof s || (t5 = s.create(t5)); + for (var n2 = void 0 === e2 ? t5.len : t5.pos + e2, r2 = new l.onnx.TensorProto.Segment(); t5.pos < n2; ) { + var i3 = t5.uint32(); switch (i3 >>> 3) { case 1: - r2.begin = t4.int64(); + r2.begin = t5.int64(); break; case 2: - r2.end = t4.int64(); + r2.end = t5.int64(); break; default: - t4.skipType(7 & i3); + t5.skipType(7 & i3); } } return r2; - }, t3.decodeDelimited = function(t4) { - return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); - }, t3.verify = function(t4) { - return "object" != typeof t4 || null === t4 ? "object expected" : null != t4.begin && t4.hasOwnProperty("begin") && !(c.isInteger(t4.begin) || t4.begin && c.isInteger(t4.begin.low) && c.isInteger(t4.begin.high)) ? "begin: integer|Long expected" : null != t4.end && t4.hasOwnProperty("end") && !(c.isInteger(t4.end) || t4.end && c.isInteger(t4.end.low) && c.isInteger(t4.end.high)) ? "end: integer|Long expected" : null; - }, t3.fromObject = function(t4) { - if (t4 instanceof l.onnx.TensorProto.Segment) - return t4; + }, t4.decodeDelimited = function(t5) { + return t5 instanceof s || (t5 = new s(t5)), this.decode(t5, t5.uint32()); + }, t4.verify = function(t5) { + return "object" != typeof t5 || null === t5 ? "object expected" : null != t5.begin && t5.hasOwnProperty("begin") && !(c.isInteger(t5.begin) || t5.begin && c.isInteger(t5.begin.low) && c.isInteger(t5.begin.high)) ? "begin: integer|Long expected" : null != t5.end && t5.hasOwnProperty("end") && !(c.isInteger(t5.end) || t5.end && c.isInteger(t5.end.low) && c.isInteger(t5.end.high)) ? "end: integer|Long expected" : null; + }, t4.fromObject = function(t5) { + if (t5 instanceof l.onnx.TensorProto.Segment) + return t5; var e2 = new l.onnx.TensorProto.Segment(); - return null != t4.begin && (c.Long ? (e2.begin = c.Long.fromValue(t4.begin)).unsigned = false : "string" == typeof t4.begin ? e2.begin = parseInt(t4.begin, 10) : "number" == typeof t4.begin ? e2.begin = t4.begin : "object" == typeof t4.begin && (e2.begin = new c.LongBits(t4.begin.low >>> 0, t4.begin.high >>> 0).toNumber())), null != t4.end && (c.Long ? (e2.end = c.Long.fromValue(t4.end)).unsigned = false : "string" == typeof t4.end ? e2.end = parseInt(t4.end, 10) : "number" == typeof t4.end ? e2.end = t4.end : "object" == typeof t4.end && (e2.end = new c.LongBits(t4.end.low >>> 0, t4.end.high >>> 0).toNumber())), e2; - }, t3.toObject = function(t4, e2) { + return null != t5.begin && (c.Long ? (e2.begin = c.Long.fromValue(t5.begin)).unsigned = false : "string" == typeof t5.begin ? e2.begin = parseInt(t5.begin, 10) : "number" == typeof t5.begin ? e2.begin = t5.begin : "object" == typeof t5.begin && (e2.begin = new c.LongBits(t5.begin.low >>> 0, t5.begin.high >>> 0).toNumber())), null != t5.end && (c.Long ? (e2.end = c.Long.fromValue(t5.end)).unsigned = false : "string" == typeof t5.end ? e2.end = parseInt(t5.end, 10) : "number" == typeof t5.end ? e2.end = t5.end : "object" == typeof t5.end && (e2.end = new c.LongBits(t5.end.low >>> 0, t5.end.high >>> 0).toNumber())), e2; + }, t4.toObject = function(t5, e2) { e2 || (e2 = {}); var n2 = {}; if (e2.defaults) { @@ -5353,290 +6038,290 @@ var require_ort_web_node = __commonJS({ n2.begin = e2.longs === String ? "0" : 0; c.Long ? (r2 = new c.Long(0, 0, false), n2.end = e2.longs === String ? r2.toString() : e2.longs === Number ? r2.toNumber() : r2) : n2.end = e2.longs === String ? "0" : 0; } - return null != t4.begin && t4.hasOwnProperty("begin") && ("number" == typeof t4.begin ? n2.begin = e2.longs === String ? String(t4.begin) : t4.begin : n2.begin = e2.longs === String ? c.Long.prototype.toString.call(t4.begin) : e2.longs === Number ? new c.LongBits(t4.begin.low >>> 0, t4.begin.high >>> 0).toNumber() : t4.begin), null != t4.end && t4.hasOwnProperty("end") && ("number" == typeof t4.end ? n2.end = e2.longs === String ? String(t4.end) : t4.end : n2.end = e2.longs === String ? c.Long.prototype.toString.call(t4.end) : e2.longs === Number ? new c.LongBits(t4.end.low >>> 0, t4.end.high >>> 0).toNumber() : t4.end), n2; - }, t3.prototype.toJSON = function() { + return null != t5.begin && t5.hasOwnProperty("begin") && ("number" == typeof t5.begin ? n2.begin = e2.longs === String ? String(t5.begin) : t5.begin : n2.begin = e2.longs === String ? c.Long.prototype.toString.call(t5.begin) : e2.longs === Number ? new c.LongBits(t5.begin.low >>> 0, t5.begin.high >>> 0).toNumber() : t5.begin), null != t5.end && t5.hasOwnProperty("end") && ("number" == typeof t5.end ? n2.end = e2.longs === String ? String(t5.end) : t5.end : n2.end = e2.longs === String ? c.Long.prototype.toString.call(t5.end) : e2.longs === Number ? new c.LongBits(t5.end.low >>> 0, t5.end.high >>> 0).toNumber() : t5.end), n2; + }, t4.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t3; - }(), t2.DataLocation = function() { - var t3 = {}, e2 = Object.create(t3); - return e2[t3[0] = "DEFAULT"] = 0, e2[t3[1] = "EXTERNAL"] = 1, e2; - }(), t2; + }, t4; + }(), t3.DataLocation = function() { + var t4 = {}, e2 = Object.create(t4); + return e2[t4[0] = "DEFAULT"] = 0, e2[t4[1] = "EXTERNAL"] = 1, e2; + }(), t3; }(), o.TensorShapeProto = function() { - function t2(t3) { - if (this.dim = [], t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (this.dim = [], t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.dim = c.emptyArray, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - if (e2 || (e2 = u.create()), null != t3.dim && t3.dim.length) - for (var n2 = 0; n2 < t3.dim.length; ++n2) - l.onnx.TensorShapeProto.Dimension.encode(t3.dim[n2], e2.uint32(10).fork()).ldelim(); + return t3.prototype.dim = c.emptyArray, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + if (e2 || (e2 = u.create()), null != t4.dim && t4.dim.length) + for (var n2 = 0; n2 < t4.dim.length; ++n2) + l.onnx.TensorShapeProto.Dimension.encode(t4.dim[n2], e2.uint32(10).fork()).ldelim(); return e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.TensorShapeProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); - i3 >>> 3 == 1 ? (r2.dim && r2.dim.length || (r2.dim = []), r2.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t3, t3.uint32()))) : t3.skipType(7 & i3); + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.TensorShapeProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); + i3 >>> 3 == 1 ? (r2.dim && r2.dim.length || (r2.dim = []), r2.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t4, t4.uint32()))) : t4.skipType(7 & i3); } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.dim && t3.hasOwnProperty("dim")) { - if (!Array.isArray(t3.dim)) + if (null != t4.dim && t4.hasOwnProperty("dim")) { + if (!Array.isArray(t4.dim)) return "dim: array expected"; - for (var e2 = 0; e2 < t3.dim.length; ++e2) { - var n2 = l.onnx.TensorShapeProto.Dimension.verify(t3.dim[e2]); + for (var e2 = 0; e2 < t4.dim.length; ++e2) { + var n2 = l.onnx.TensorShapeProto.Dimension.verify(t4.dim[e2]); if (n2) return "dim." + n2; } } return null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.TensorShapeProto) - return t3; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.TensorShapeProto) + return t4; var e2 = new l.onnx.TensorShapeProto(); - if (t3.dim) { - if (!Array.isArray(t3.dim)) + if (t4.dim) { + if (!Array.isArray(t4.dim)) throw TypeError(".onnx.TensorShapeProto.dim: array expected"); e2.dim = []; - for (var n2 = 0; n2 < t3.dim.length; ++n2) { - if ("object" != typeof t3.dim[n2]) + for (var n2 = 0; n2 < t4.dim.length; ++n2) { + if ("object" != typeof t4.dim[n2]) throw TypeError(".onnx.TensorShapeProto.dim: object expected"); - e2.dim[n2] = l.onnx.TensorShapeProto.Dimension.fromObject(t3.dim[n2]); + e2.dim[n2] = l.onnx.TensorShapeProto.Dimension.fromObject(t4.dim[n2]); } } return e2; - }, t2.toObject = function(t3, e2) { + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; - if ((e2.arrays || e2.defaults) && (n2.dim = []), t3.dim && t3.dim.length) { + if ((e2.arrays || e2.defaults) && (n2.dim = []), t4.dim && t4.dim.length) { n2.dim = []; - for (var r2 = 0; r2 < t3.dim.length; ++r2) - n2.dim[r2] = l.onnx.TensorShapeProto.Dimension.toObject(t3.dim[r2], e2); + for (var r2 = 0; r2 < t4.dim.length; ++r2) + n2.dim[r2] = l.onnx.TensorShapeProto.Dimension.toObject(t4.dim[r2], e2); } return n2; - }, t2.prototype.toJSON = function() { + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2.Dimension = function() { - function t3(t4) { - if (t4) - for (var e3 = Object.keys(t4), n2 = 0; n2 < e3.length; ++n2) - null != t4[e3[n2]] && (this[e3[n2]] = t4[e3[n2]]); + }, t3.Dimension = function() { + function t4(t5) { + if (t5) + for (var e3 = Object.keys(t5), n2 = 0; n2 < e3.length; ++n2) + null != t5[e3[n2]] && (this[e3[n2]] = t5[e3[n2]]); } var e2; - return t3.prototype.dimValue = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.prototype.dimParam = "", t3.prototype.denotation = "", Object.defineProperty(t3.prototype, "value", { get: c.oneOfGetter(e2 = ["dimValue", "dimParam"]), set: c.oneOfSetter(e2) }), t3.create = function(e3) { - return new t3(e3); - }, t3.encode = function(t4, e3) { - return e3 || (e3 = u.create()), null != t4.dimValue && t4.hasOwnProperty("dimValue") && e3.uint32(8).int64(t4.dimValue), null != t4.dimParam && t4.hasOwnProperty("dimParam") && e3.uint32(18).string(t4.dimParam), null != t4.denotation && t4.hasOwnProperty("denotation") && e3.uint32(26).string(t4.denotation), e3; - }, t3.encodeDelimited = function(t4, e3) { - return this.encode(t4, e3).ldelim(); - }, t3.decode = function(t4, e3) { - t4 instanceof s || (t4 = s.create(t4)); - for (var n2 = void 0 === e3 ? t4.len : t4.pos + e3, r2 = new l.onnx.TensorShapeProto.Dimension(); t4.pos < n2; ) { - var i3 = t4.uint32(); + return t4.prototype.dimValue = c.Long ? c.Long.fromBits(0, 0, false) : 0, t4.prototype.dimParam = "", t4.prototype.denotation = "", Object.defineProperty(t4.prototype, "value", { get: c.oneOfGetter(e2 = ["dimValue", "dimParam"]), set: c.oneOfSetter(e2) }), t4.create = function(e3) { + return new t4(e3); + }, t4.encode = function(t5, e3) { + return e3 || (e3 = u.create()), null != t5.dimValue && t5.hasOwnProperty("dimValue") && e3.uint32(8).int64(t5.dimValue), null != t5.dimParam && t5.hasOwnProperty("dimParam") && e3.uint32(18).string(t5.dimParam), null != t5.denotation && t5.hasOwnProperty("denotation") && e3.uint32(26).string(t5.denotation), e3; + }, t4.encodeDelimited = function(t5, e3) { + return this.encode(t5, e3).ldelim(); + }, t4.decode = function(t5, e3) { + t5 instanceof s || (t5 = s.create(t5)); + for (var n2 = void 0 === e3 ? t5.len : t5.pos + e3, r2 = new l.onnx.TensorShapeProto.Dimension(); t5.pos < n2; ) { + var i3 = t5.uint32(); switch (i3 >>> 3) { case 1: - r2.dimValue = t4.int64(); + r2.dimValue = t5.int64(); break; case 2: - r2.dimParam = t4.string(); + r2.dimParam = t5.string(); break; case 3: - r2.denotation = t4.string(); + r2.denotation = t5.string(); break; default: - t4.skipType(7 & i3); + t5.skipType(7 & i3); } } return r2; - }, t3.decodeDelimited = function(t4) { - return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); - }, t3.verify = function(t4) { - if ("object" != typeof t4 || null === t4) + }, t4.decodeDelimited = function(t5) { + return t5 instanceof s || (t5 = new s(t5)), this.decode(t5, t5.uint32()); + }, t4.verify = function(t5) { + if ("object" != typeof t5 || null === t5) return "object expected"; var e3 = {}; - if (null != t4.dimValue && t4.hasOwnProperty("dimValue") && (e3.value = 1, !(c.isInteger(t4.dimValue) || t4.dimValue && c.isInteger(t4.dimValue.low) && c.isInteger(t4.dimValue.high)))) + if (null != t5.dimValue && t5.hasOwnProperty("dimValue") && (e3.value = 1, !(c.isInteger(t5.dimValue) || t5.dimValue && c.isInteger(t5.dimValue.low) && c.isInteger(t5.dimValue.high)))) return "dimValue: integer|Long expected"; - if (null != t4.dimParam && t4.hasOwnProperty("dimParam")) { + if (null != t5.dimParam && t5.hasOwnProperty("dimParam")) { if (1 === e3.value) return "value: multiple values"; - if (e3.value = 1, !c.isString(t4.dimParam)) + if (e3.value = 1, !c.isString(t5.dimParam)) return "dimParam: string expected"; } - return null != t4.denotation && t4.hasOwnProperty("denotation") && !c.isString(t4.denotation) ? "denotation: string expected" : null; - }, t3.fromObject = function(t4) { - if (t4 instanceof l.onnx.TensorShapeProto.Dimension) - return t4; + return null != t5.denotation && t5.hasOwnProperty("denotation") && !c.isString(t5.denotation) ? "denotation: string expected" : null; + }, t4.fromObject = function(t5) { + if (t5 instanceof l.onnx.TensorShapeProto.Dimension) + return t5; var e3 = new l.onnx.TensorShapeProto.Dimension(); - return null != t4.dimValue && (c.Long ? (e3.dimValue = c.Long.fromValue(t4.dimValue)).unsigned = false : "string" == typeof t4.dimValue ? e3.dimValue = parseInt(t4.dimValue, 10) : "number" == typeof t4.dimValue ? e3.dimValue = t4.dimValue : "object" == typeof t4.dimValue && (e3.dimValue = new c.LongBits(t4.dimValue.low >>> 0, t4.dimValue.high >>> 0).toNumber())), null != t4.dimParam && (e3.dimParam = String(t4.dimParam)), null != t4.denotation && (e3.denotation = String(t4.denotation)), e3; - }, t3.toObject = function(t4, e3) { + return null != t5.dimValue && (c.Long ? (e3.dimValue = c.Long.fromValue(t5.dimValue)).unsigned = false : "string" == typeof t5.dimValue ? e3.dimValue = parseInt(t5.dimValue, 10) : "number" == typeof t5.dimValue ? e3.dimValue = t5.dimValue : "object" == typeof t5.dimValue && (e3.dimValue = new c.LongBits(t5.dimValue.low >>> 0, t5.dimValue.high >>> 0).toNumber())), null != t5.dimParam && (e3.dimParam = String(t5.dimParam)), null != t5.denotation && (e3.denotation = String(t5.denotation)), e3; + }, t4.toObject = function(t5, e3) { e3 || (e3 = {}); var n2 = {}; - return e3.defaults && (n2.denotation = ""), null != t4.dimValue && t4.hasOwnProperty("dimValue") && ("number" == typeof t4.dimValue ? n2.dimValue = e3.longs === String ? String(t4.dimValue) : t4.dimValue : n2.dimValue = e3.longs === String ? c.Long.prototype.toString.call(t4.dimValue) : e3.longs === Number ? new c.LongBits(t4.dimValue.low >>> 0, t4.dimValue.high >>> 0).toNumber() : t4.dimValue, e3.oneofs && (n2.value = "dimValue")), null != t4.dimParam && t4.hasOwnProperty("dimParam") && (n2.dimParam = t4.dimParam, e3.oneofs && (n2.value = "dimParam")), null != t4.denotation && t4.hasOwnProperty("denotation") && (n2.denotation = t4.denotation), n2; - }, t3.prototype.toJSON = function() { + return e3.defaults && (n2.denotation = ""), null != t5.dimValue && t5.hasOwnProperty("dimValue") && ("number" == typeof t5.dimValue ? n2.dimValue = e3.longs === String ? String(t5.dimValue) : t5.dimValue : n2.dimValue = e3.longs === String ? c.Long.prototype.toString.call(t5.dimValue) : e3.longs === Number ? new c.LongBits(t5.dimValue.low >>> 0, t5.dimValue.high >>> 0).toNumber() : t5.dimValue, e3.oneofs && (n2.value = "dimValue")), null != t5.dimParam && t5.hasOwnProperty("dimParam") && (n2.dimParam = t5.dimParam, e3.oneofs && (n2.value = "dimParam")), null != t5.denotation && t5.hasOwnProperty("denotation") && (n2.denotation = t5.denotation), n2; + }, t4.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t3; - }(), t2; + }, t4; + }(), t3; }(), o.TypeProto = function() { - function t2(t3) { - if (t3) - for (var e3 = Object.keys(t3), n2 = 0; n2 < e3.length; ++n2) - null != t3[e3[n2]] && (this[e3[n2]] = t3[e3[n2]]); + function t3(t4) { + if (t4) + for (var e3 = Object.keys(t4), n2 = 0; n2 < e3.length; ++n2) + null != t4[e3[n2]] && (this[e3[n2]] = t4[e3[n2]]); } var e2; - return t2.prototype.tensorType = null, t2.prototype.denotation = "", Object.defineProperty(t2.prototype, "value", { get: c.oneOfGetter(e2 = ["tensorType"]), set: c.oneOfSetter(e2) }), t2.create = function(e3) { - return new t2(e3); - }, t2.encode = function(t3, e3) { - return e3 || (e3 = u.create()), null != t3.tensorType && t3.hasOwnProperty("tensorType") && l.onnx.TypeProto.Tensor.encode(t3.tensorType, e3.uint32(10).fork()).ldelim(), null != t3.denotation && t3.hasOwnProperty("denotation") && e3.uint32(50).string(t3.denotation), e3; - }, t2.encodeDelimited = function(t3, e3) { - return this.encode(t3, e3).ldelim(); - }, t2.decode = function(t3, e3) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e3 ? t3.len : t3.pos + e3, r2 = new l.onnx.TypeProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + return t3.prototype.tensorType = null, t3.prototype.denotation = "", Object.defineProperty(t3.prototype, "value", { get: c.oneOfGetter(e2 = ["tensorType"]), set: c.oneOfSetter(e2) }), t3.create = function(e3) { + return new t3(e3); + }, t3.encode = function(t4, e3) { + return e3 || (e3 = u.create()), null != t4.tensorType && t4.hasOwnProperty("tensorType") && l.onnx.TypeProto.Tensor.encode(t4.tensorType, e3.uint32(10).fork()).ldelim(), null != t4.denotation && t4.hasOwnProperty("denotation") && e3.uint32(50).string(t4.denotation), e3; + }, t3.encodeDelimited = function(t4, e3) { + return this.encode(t4, e3).ldelim(); + }, t3.decode = function(t4, e3) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e3 ? t4.len : t4.pos + e3, r2 = new l.onnx.TypeProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.tensorType = l.onnx.TypeProto.Tensor.decode(t3, t3.uint32()); + r2.tensorType = l.onnx.TypeProto.Tensor.decode(t4, t4.uint32()); break; case 6: - r2.denotation = t3.string(); + r2.denotation = t4.string(); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - if ("object" != typeof t3 || null === t3) + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + if ("object" != typeof t4 || null === t4) return "object expected"; - if (null != t3.tensorType && t3.hasOwnProperty("tensorType")) { - var e3 = l.onnx.TypeProto.Tensor.verify(t3.tensorType); + if (null != t4.tensorType && t4.hasOwnProperty("tensorType")) { + var e3 = l.onnx.TypeProto.Tensor.verify(t4.tensorType); if (e3) return "tensorType." + e3; } - return null != t3.denotation && t3.hasOwnProperty("denotation") && !c.isString(t3.denotation) ? "denotation: string expected" : null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.TypeProto) - return t3; + return null != t4.denotation && t4.hasOwnProperty("denotation") && !c.isString(t4.denotation) ? "denotation: string expected" : null; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.TypeProto) + return t4; var e3 = new l.onnx.TypeProto(); - if (null != t3.tensorType) { - if ("object" != typeof t3.tensorType) + if (null != t4.tensorType) { + if ("object" != typeof t4.tensorType) throw TypeError(".onnx.TypeProto.tensorType: object expected"); - e3.tensorType = l.onnx.TypeProto.Tensor.fromObject(t3.tensorType); + e3.tensorType = l.onnx.TypeProto.Tensor.fromObject(t4.tensorType); } - return null != t3.denotation && (e3.denotation = String(t3.denotation)), e3; - }, t2.toObject = function(t3, e3) { + return null != t4.denotation && (e3.denotation = String(t4.denotation)), e3; + }, t3.toObject = function(t4, e3) { e3 || (e3 = {}); var n2 = {}; - return e3.defaults && (n2.denotation = ""), null != t3.tensorType && t3.hasOwnProperty("tensorType") && (n2.tensorType = l.onnx.TypeProto.Tensor.toObject(t3.tensorType, e3), e3.oneofs && (n2.value = "tensorType")), null != t3.denotation && t3.hasOwnProperty("denotation") && (n2.denotation = t3.denotation), n2; - }, t2.prototype.toJSON = function() { + return e3.defaults && (n2.denotation = ""), null != t4.tensorType && t4.hasOwnProperty("tensorType") && (n2.tensorType = l.onnx.TypeProto.Tensor.toObject(t4.tensorType, e3), e3.oneofs && (n2.value = "tensorType")), null != t4.denotation && t4.hasOwnProperty("denotation") && (n2.denotation = t4.denotation), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2.Tensor = function() { - function t3(t4) { - if (t4) - for (var e3 = Object.keys(t4), n2 = 0; n2 < e3.length; ++n2) - null != t4[e3[n2]] && (this[e3[n2]] = t4[e3[n2]]); + }, t3.Tensor = function() { + function t4(t5) { + if (t5) + for (var e3 = Object.keys(t5), n2 = 0; n2 < e3.length; ++n2) + null != t5[e3[n2]] && (this[e3[n2]] = t5[e3[n2]]); } - return t3.prototype.elemType = 0, t3.prototype.shape = null, t3.create = function(e3) { - return new t3(e3); - }, t3.encode = function(t4, e3) { - return e3 || (e3 = u.create()), null != t4.elemType && t4.hasOwnProperty("elemType") && e3.uint32(8).int32(t4.elemType), null != t4.shape && t4.hasOwnProperty("shape") && l.onnx.TensorShapeProto.encode(t4.shape, e3.uint32(18).fork()).ldelim(), e3; - }, t3.encodeDelimited = function(t4, e3) { - return this.encode(t4, e3).ldelim(); - }, t3.decode = function(t4, e3) { - t4 instanceof s || (t4 = s.create(t4)); - for (var n2 = void 0 === e3 ? t4.len : t4.pos + e3, r2 = new l.onnx.TypeProto.Tensor(); t4.pos < n2; ) { - var i3 = t4.uint32(); + return t4.prototype.elemType = 0, t4.prototype.shape = null, t4.create = function(e3) { + return new t4(e3); + }, t4.encode = function(t5, e3) { + return e3 || (e3 = u.create()), null != t5.elemType && t5.hasOwnProperty("elemType") && e3.uint32(8).int32(t5.elemType), null != t5.shape && t5.hasOwnProperty("shape") && l.onnx.TensorShapeProto.encode(t5.shape, e3.uint32(18).fork()).ldelim(), e3; + }, t4.encodeDelimited = function(t5, e3) { + return this.encode(t5, e3).ldelim(); + }, t4.decode = function(t5, e3) { + t5 instanceof s || (t5 = s.create(t5)); + for (var n2 = void 0 === e3 ? t5.len : t5.pos + e3, r2 = new l.onnx.TypeProto.Tensor(); t5.pos < n2; ) { + var i3 = t5.uint32(); switch (i3 >>> 3) { case 1: - r2.elemType = t4.int32(); + r2.elemType = t5.int32(); break; case 2: - r2.shape = l.onnx.TensorShapeProto.decode(t4, t4.uint32()); + r2.shape = l.onnx.TensorShapeProto.decode(t5, t5.uint32()); break; default: - t4.skipType(7 & i3); + t5.skipType(7 & i3); } } return r2; - }, t3.decodeDelimited = function(t4) { - return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); - }, t3.verify = function(t4) { - if ("object" != typeof t4 || null === t4) + }, t4.decodeDelimited = function(t5) { + return t5 instanceof s || (t5 = new s(t5)), this.decode(t5, t5.uint32()); + }, t4.verify = function(t5) { + if ("object" != typeof t5 || null === t5) return "object expected"; - if (null != t4.elemType && t4.hasOwnProperty("elemType") && !c.isInteger(t4.elemType)) + if (null != t5.elemType && t5.hasOwnProperty("elemType") && !c.isInteger(t5.elemType)) return "elemType: integer expected"; - if (null != t4.shape && t4.hasOwnProperty("shape")) { - var e3 = l.onnx.TensorShapeProto.verify(t4.shape); + if (null != t5.shape && t5.hasOwnProperty("shape")) { + var e3 = l.onnx.TensorShapeProto.verify(t5.shape); if (e3) return "shape." + e3; } return null; - }, t3.fromObject = function(t4) { - if (t4 instanceof l.onnx.TypeProto.Tensor) - return t4; + }, t4.fromObject = function(t5) { + if (t5 instanceof l.onnx.TypeProto.Tensor) + return t5; var e3 = new l.onnx.TypeProto.Tensor(); - if (null != t4.elemType && (e3.elemType = 0 | t4.elemType), null != t4.shape) { - if ("object" != typeof t4.shape) + if (null != t5.elemType && (e3.elemType = 0 | t5.elemType), null != t5.shape) { + if ("object" != typeof t5.shape) throw TypeError(".onnx.TypeProto.Tensor.shape: object expected"); - e3.shape = l.onnx.TensorShapeProto.fromObject(t4.shape); + e3.shape = l.onnx.TensorShapeProto.fromObject(t5.shape); } return e3; - }, t3.toObject = function(t4, e3) { + }, t4.toObject = function(t5, e3) { e3 || (e3 = {}); var n2 = {}; - return e3.defaults && (n2.elemType = 0, n2.shape = null), null != t4.elemType && t4.hasOwnProperty("elemType") && (n2.elemType = t4.elemType), null != t4.shape && t4.hasOwnProperty("shape") && (n2.shape = l.onnx.TensorShapeProto.toObject(t4.shape, e3)), n2; - }, t3.prototype.toJSON = function() { + return e3.defaults && (n2.elemType = 0, n2.shape = null), null != t5.elemType && t5.hasOwnProperty("elemType") && (n2.elemType = t5.elemType), null != t5.shape && t5.hasOwnProperty("shape") && (n2.shape = l.onnx.TensorShapeProto.toObject(t5.shape, e3)), n2; + }, t4.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t3; - }(), t2; + }, t4; + }(), t3; }(), o.OperatorSetIdProto = function() { - function t2(t3) { - if (t3) - for (var e2 = Object.keys(t3), n2 = 0; n2 < e2.length; ++n2) - null != t3[e2[n2]] && (this[e2[n2]] = t3[e2[n2]]); + function t3(t4) { + if (t4) + for (var e2 = Object.keys(t4), n2 = 0; n2 < e2.length; ++n2) + null != t4[e2[n2]] && (this[e2[n2]] = t4[e2[n2]]); } - return t2.prototype.domain = "", t2.prototype.version = c.Long ? c.Long.fromBits(0, 0, false) : 0, t2.create = function(e2) { - return new t2(e2); - }, t2.encode = function(t3, e2) { - return e2 || (e2 = u.create()), null != t3.domain && t3.hasOwnProperty("domain") && e2.uint32(10).string(t3.domain), null != t3.version && t3.hasOwnProperty("version") && e2.uint32(16).int64(t3.version), e2; - }, t2.encodeDelimited = function(t3, e2) { - return this.encode(t3, e2).ldelim(); - }, t2.decode = function(t3, e2) { - t3 instanceof s || (t3 = s.create(t3)); - for (var n2 = void 0 === e2 ? t3.len : t3.pos + e2, r2 = new l.onnx.OperatorSetIdProto(); t3.pos < n2; ) { - var i3 = t3.uint32(); + return t3.prototype.domain = "", t3.prototype.version = c.Long ? c.Long.fromBits(0, 0, false) : 0, t3.create = function(e2) { + return new t3(e2); + }, t3.encode = function(t4, e2) { + return e2 || (e2 = u.create()), null != t4.domain && t4.hasOwnProperty("domain") && e2.uint32(10).string(t4.domain), null != t4.version && t4.hasOwnProperty("version") && e2.uint32(16).int64(t4.version), e2; + }, t3.encodeDelimited = function(t4, e2) { + return this.encode(t4, e2).ldelim(); + }, t3.decode = function(t4, e2) { + t4 instanceof s || (t4 = s.create(t4)); + for (var n2 = void 0 === e2 ? t4.len : t4.pos + e2, r2 = new l.onnx.OperatorSetIdProto(); t4.pos < n2; ) { + var i3 = t4.uint32(); switch (i3 >>> 3) { case 1: - r2.domain = t3.string(); + r2.domain = t4.string(); break; case 2: - r2.version = t3.int64(); + r2.version = t4.int64(); break; default: - t3.skipType(7 & i3); + t4.skipType(7 & i3); } } return r2; - }, t2.decodeDelimited = function(t3) { - return t3 instanceof s || (t3 = new s(t3)), this.decode(t3, t3.uint32()); - }, t2.verify = function(t3) { - return "object" != typeof t3 || null === t3 ? "object expected" : null != t3.domain && t3.hasOwnProperty("domain") && !c.isString(t3.domain) ? "domain: string expected" : null != t3.version && t3.hasOwnProperty("version") && !(c.isInteger(t3.version) || t3.version && c.isInteger(t3.version.low) && c.isInteger(t3.version.high)) ? "version: integer|Long expected" : null; - }, t2.fromObject = function(t3) { - if (t3 instanceof l.onnx.OperatorSetIdProto) - return t3; + }, t3.decodeDelimited = function(t4) { + return t4 instanceof s || (t4 = new s(t4)), this.decode(t4, t4.uint32()); + }, t3.verify = function(t4) { + return "object" != typeof t4 || null === t4 ? "object expected" : null != t4.domain && t4.hasOwnProperty("domain") && !c.isString(t4.domain) ? "domain: string expected" : null != t4.version && t4.hasOwnProperty("version") && !(c.isInteger(t4.version) || t4.version && c.isInteger(t4.version.low) && c.isInteger(t4.version.high)) ? "version: integer|Long expected" : null; + }, t3.fromObject = function(t4) { + if (t4 instanceof l.onnx.OperatorSetIdProto) + return t4; var e2 = new l.onnx.OperatorSetIdProto(); - return null != t3.domain && (e2.domain = String(t3.domain)), null != t3.version && (c.Long ? (e2.version = c.Long.fromValue(t3.version)).unsigned = false : "string" == typeof t3.version ? e2.version = parseInt(t3.version, 10) : "number" == typeof t3.version ? e2.version = t3.version : "object" == typeof t3.version && (e2.version = new c.LongBits(t3.version.low >>> 0, t3.version.high >>> 0).toNumber())), e2; - }, t2.toObject = function(t3, e2) { + return null != t4.domain && (e2.domain = String(t4.domain)), null != t4.version && (c.Long ? (e2.version = c.Long.fromValue(t4.version)).unsigned = false : "string" == typeof t4.version ? e2.version = parseInt(t4.version, 10) : "number" == typeof t4.version ? e2.version = t4.version : "object" == typeof t4.version && (e2.version = new c.LongBits(t4.version.low >>> 0, t4.version.high >>> 0).toNumber())), e2; + }, t3.toObject = function(t4, e2) { e2 || (e2 = {}); var n2 = {}; if (e2.defaults) @@ -5645,77 +6330,77 @@ var require_ort_web_node = __commonJS({ n2.version = e2.longs === String ? r2.toString() : e2.longs === Number ? r2.toNumber() : r2; } else n2.version = e2.longs === String ? "0" : 0; - return null != t3.domain && t3.hasOwnProperty("domain") && (n2.domain = t3.domain), null != t3.version && t3.hasOwnProperty("version") && ("number" == typeof t3.version ? n2.version = e2.longs === String ? String(t3.version) : t3.version : n2.version = e2.longs === String ? c.Long.prototype.toString.call(t3.version) : e2.longs === Number ? new c.LongBits(t3.version.low >>> 0, t3.version.high >>> 0).toNumber() : t3.version), n2; - }, t2.prototype.toJSON = function() { + return null != t4.domain && t4.hasOwnProperty("domain") && (n2.domain = t4.domain), null != t4.version && t4.hasOwnProperty("version") && ("number" == typeof t4.version ? n2.version = e2.longs === String ? String(t4.version) : t4.version : n2.version = e2.longs === String ? c.Long.prototype.toString.call(t4.version) : e2.longs === Number ? new c.LongBits(t4.version.low >>> 0, t4.version.high >>> 0).toNumber() : t4.version), n2; + }, t3.prototype.toJSON = function() { return this.constructor.toObject(this, a.util.toJSONOptions); - }, t2; - }(), o), t.exports = l; - }, 2100: (t, e, n) => { + }, t3; + }(), o), t2.exports = l; + }, 2100: (t2, e, n) => { "use strict"; - t.exports = n(9482); - }, 9482: (t, e, n) => { + t2.exports = n(9482); + }, 9482: (t2, e, n) => { "use strict"; var r = e; function i2() { r.util._configure(), r.Writer._configure(r.BufferWriter), r.Reader._configure(r.BufferReader); } r.build = "minimal", r.Writer = n(1173), r.BufferWriter = n(3155), r.Reader = n(1408), r.BufferReader = n(593), r.util = n(9693), r.rpc = n(5994), r.roots = n(5054), r.configure = i2, i2(); - }, 1408: (t, e, n) => { + }, 1408: (t2, e, n) => { "use strict"; - t.exports = u; + t2.exports = u; var r, i2 = n(9693), o = i2.LongBits, a = i2.utf8; - function s(t2, e2) { - return RangeError("index out of range: " + t2.pos + " + " + (e2 || 1) + " > " + t2.len); + function s(t3, e2) { + return RangeError("index out of range: " + t3.pos + " + " + (e2 || 1) + " > " + t3.len); } - function u(t2) { - this.buf = t2, this.pos = 0, this.len = t2.length; + function u(t3) { + this.buf = t3, this.pos = 0, this.len = t3.length; } - var c, l = "undefined" != typeof Uint8Array ? function(t2) { - if (t2 instanceof Uint8Array || Array.isArray(t2)) - return new u(t2); + var c, l = "undefined" != typeof Uint8Array ? function(t3) { + if (t3 instanceof Uint8Array || Array.isArray(t3)) + return new u(t3); throw Error("illegal buffer"); - } : function(t2) { - if (Array.isArray(t2)) - return new u(t2); + } : function(t3) { + if (Array.isArray(t3)) + return new u(t3); throw Error("illegal buffer"); }, p = function() { - return i2.Buffer ? function(t2) { - return (u.create = function(t3) { - return i2.Buffer.isBuffer(t3) ? new r(t3) : l(t3); - })(t2); + return i2.Buffer ? function(t3) { + return (u.create = function(t4) { + return i2.Buffer.isBuffer(t4) ? new r(t4) : l(t4); + })(t3); } : l; }; function f() { - var t2 = new o(0, 0), e2 = 0; + var t3 = new o(0, 0), e2 = 0; if (!(this.len - this.pos > 4)) { for (; e2 < 3; ++e2) { if (this.pos >= this.len) throw s(this); - if (t2.lo = (t2.lo | (127 & this.buf[this.pos]) << 7 * e2) >>> 0, this.buf[this.pos++] < 128) - return t2; + if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 7 * e2) >>> 0, this.buf[this.pos++] < 128) + return t3; } - return t2.lo = (t2.lo | (127 & this.buf[this.pos++]) << 7 * e2) >>> 0, t2; + return t3.lo = (t3.lo | (127 & this.buf[this.pos++]) << 7 * e2) >>> 0, t3; } for (; e2 < 4; ++e2) - if (t2.lo = (t2.lo | (127 & this.buf[this.pos]) << 7 * e2) >>> 0, this.buf[this.pos++] < 128) - return t2; - if (t2.lo = (t2.lo | (127 & this.buf[this.pos]) << 28) >>> 0, t2.hi = (t2.hi | (127 & this.buf[this.pos]) >> 4) >>> 0, this.buf[this.pos++] < 128) - return t2; + if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 7 * e2) >>> 0, this.buf[this.pos++] < 128) + return t3; + if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 28) >>> 0, t3.hi = (t3.hi | (127 & this.buf[this.pos]) >> 4) >>> 0, this.buf[this.pos++] < 128) + return t3; if (e2 = 0, this.len - this.pos > 4) { for (; e2 < 5; ++e2) - if (t2.hi = (t2.hi | (127 & this.buf[this.pos]) << 7 * e2 + 3) >>> 0, this.buf[this.pos++] < 128) - return t2; + if (t3.hi = (t3.hi | (127 & this.buf[this.pos]) << 7 * e2 + 3) >>> 0, this.buf[this.pos++] < 128) + return t3; } else for (; e2 < 5; ++e2) { if (this.pos >= this.len) throw s(this); - if (t2.hi = (t2.hi | (127 & this.buf[this.pos]) << 7 * e2 + 3) >>> 0, this.buf[this.pos++] < 128) - return t2; + if (t3.hi = (t3.hi | (127 & this.buf[this.pos]) << 7 * e2 + 3) >>> 0, this.buf[this.pos++] < 128) + return t3; } throw Error("invalid varint encoding"); } - function d(t2, e2) { - return (t2[e2 - 4] | t2[e2 - 3] << 8 | t2[e2 - 2] << 16 | t2[e2 - 1] << 24) >>> 0; + function d(t3, e2) { + return (t3[e2 - 4] | t3[e2 - 3] << 8 | t3[e2 - 2] << 16 | t3[e2 - 1] << 24) >>> 0; } function h() { if (this.pos + 8 > this.len) @@ -5739,8 +6424,8 @@ var require_ort_web_node = __commonJS({ }), u.prototype.int32 = function() { return 0 | this.uint32(); }, u.prototype.sint32 = function() { - var t2 = this.uint32(); - return t2 >>> 1 ^ -(1 & t2) | 0; + var t3 = this.uint32(); + return t3 >>> 1 ^ -(1 & t3) | 0; }, u.prototype.bool = function() { return 0 !== this.uint32(); }, u.prototype.fixed32 = function() { @@ -5754,34 +6439,34 @@ var require_ort_web_node = __commonJS({ }, u.prototype.float = function() { if (this.pos + 4 > this.len) throw s(this, 4); - var t2 = i2.float.readFloatLE(this.buf, this.pos); - return this.pos += 4, t2; + var t3 = i2.float.readFloatLE(this.buf, this.pos); + return this.pos += 4, t3; }, u.prototype.double = function() { if (this.pos + 8 > this.len) throw s(this, 4); - var t2 = i2.float.readDoubleLE(this.buf, this.pos); - return this.pos += 8, t2; + var t3 = i2.float.readDoubleLE(this.buf, this.pos); + return this.pos += 8, t3; }, u.prototype.bytes = function() { - var t2 = this.uint32(), e2 = this.pos, n2 = this.pos + t2; + var t3 = this.uint32(), e2 = this.pos, n2 = this.pos + t3; if (n2 > this.len) - throw s(this, t2); - return this.pos += t2, Array.isArray(this.buf) ? this.buf.slice(e2, n2) : e2 === n2 ? new this.buf.constructor(0) : this._slice.call(this.buf, e2, n2); + throw s(this, t3); + return this.pos += t3, Array.isArray(this.buf) ? this.buf.slice(e2, n2) : e2 === n2 ? new this.buf.constructor(0) : this._slice.call(this.buf, e2, n2); }, u.prototype.string = function() { - var t2 = this.bytes(); - return a.read(t2, 0, t2.length); - }, u.prototype.skip = function(t2) { - if ("number" == typeof t2) { - if (this.pos + t2 > this.len) - throw s(this, t2); - this.pos += t2; + var t3 = this.bytes(); + return a.read(t3, 0, t3.length); + }, u.prototype.skip = function(t3) { + if ("number" == typeof t3) { + if (this.pos + t3 > this.len) + throw s(this, t3); + this.pos += t3; } else do { if (this.pos >= this.len) throw s(this); } while (128 & this.buf[this.pos++]); return this; - }, u.prototype.skipType = function(t2) { - switch (t2) { + }, u.prototype.skipType = function(t3) { + switch (t3) { case 0: this.skip(); break; @@ -5792,18 +6477,18 @@ var require_ort_web_node = __commonJS({ this.skip(this.uint32()); break; case 3: - for (; 4 != (t2 = 7 & this.uint32()); ) - this.skipType(t2); + for (; 4 != (t3 = 7 & this.uint32()); ) + this.skipType(t3); break; case 5: this.skip(4); break; default: - throw Error("invalid wire type " + t2 + " at offset " + this.pos); + throw Error("invalid wire type " + t3 + " at offset " + this.pos); } return this; - }, u._configure = function(t2) { - r = t2, u.create = p(), r._configure(); + }, u._configure = function(t3) { + r = t3, u.create = p(), r._configure(); var e2 = i2.Long ? "toLong" : "toNumber"; i2.merge(u.prototype, { int64: function() { return f.call(this)[e2](false); @@ -5817,76 +6502,76 @@ var require_ort_web_node = __commonJS({ return h.call(this)[e2](false); } }); }; - }, 593: (t, e, n) => { + }, 593: (t2, e, n) => { "use strict"; - t.exports = o; + t2.exports = o; var r = n(1408); (o.prototype = Object.create(r.prototype)).constructor = o; var i2 = n(9693); - function o(t2) { - r.call(this, t2); + function o(t3) { + r.call(this, t3); } o._configure = function() { i2.Buffer && (o.prototype._slice = i2.Buffer.prototype.slice); }, o.prototype.string = function() { - var t2 = this.uint32(); - return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + t2, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + t2, this.len)); + var t3 = this.uint32(); + return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + t3, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + t3, this.len)); }, o._configure(); - }, 5054: (t) => { + }, 5054: (t2) => { "use strict"; - t.exports = {}; - }, 5994: (t, e, n) => { + t2.exports = {}; + }, 5994: (t2, e, n) => { "use strict"; e.Service = n(7948); - }, 7948: (t, e, n) => { + }, 7948: (t2, e, n) => { "use strict"; - t.exports = i2; + t2.exports = i2; var r = n(9693); - function i2(t2, e2, n2) { - if ("function" != typeof t2) + function i2(t3, e2, n2) { + if ("function" != typeof t3) throw TypeError("rpcImpl must be a function"); - r.EventEmitter.call(this), this.rpcImpl = t2, this.requestDelimited = Boolean(e2), this.responseDelimited = Boolean(n2); + r.EventEmitter.call(this), this.rpcImpl = t3, this.requestDelimited = Boolean(e2), this.responseDelimited = Boolean(n2); } - (i2.prototype = Object.create(r.EventEmitter.prototype)).constructor = i2, i2.prototype.rpcCall = function t2(e2, n2, i3, o, a) { + (i2.prototype = Object.create(r.EventEmitter.prototype)).constructor = i2, i2.prototype.rpcCall = function t3(e2, n2, i3, o, a) { if (!o) throw TypeError("request must be specified"); var s = this; if (!a) - return r.asPromise(t2, s, e2, n2, i3, o); + return r.asPromise(t3, s, e2, n2, i3, o); if (s.rpcImpl) try { - return s.rpcImpl(e2, n2[s.requestDelimited ? "encodeDelimited" : "encode"](o).finish(), function(t3, n3) { - if (t3) - return s.emit("error", t3, e2), a(t3); + return s.rpcImpl(e2, n2[s.requestDelimited ? "encodeDelimited" : "encode"](o).finish(), function(t4, n3) { + if (t4) + return s.emit("error", t4, e2), a(t4); if (null !== n3) { if (!(n3 instanceof i3)) try { n3 = i3[s.responseDelimited ? "decodeDelimited" : "decode"](n3); - } catch (t4) { - return s.emit("error", t4, e2), a(t4); + } catch (t5) { + return s.emit("error", t5, e2), a(t5); } return s.emit("data", n3, e2), a(null, n3); } s.end(true); }); - } catch (t3) { - return s.emit("error", t3, e2), void setTimeout(function() { - a(t3); + } catch (t4) { + return s.emit("error", t4, e2), void setTimeout(function() { + a(t4); }, 0); } else setTimeout(function() { a(Error("already ended")); }, 0); - }, i2.prototype.end = function(t2) { - return this.rpcImpl && (t2 || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this; + }, i2.prototype.end = function(t3) { + return this.rpcImpl && (t3 || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this; }; - }, 1945: (t, e, n) => { + }, 1945: (t2, e, n) => { "use strict"; - t.exports = i2; + t2.exports = i2; var r = n(9693); - function i2(t2, e2) { - this.lo = t2 >>> 0, this.hi = e2 >>> 0; + function i2(t3, e2) { + this.lo = t3 >>> 0, this.hi = e2 >>> 0; } var o = i2.zero = new i2(0, 0); o.toNumber = function() { @@ -5897,125 +6582,125 @@ var require_ort_web_node = __commonJS({ return 1; }; var a = i2.zeroHash = "\0\0\0\0\0\0\0\0"; - i2.fromNumber = function(t2) { - if (0 === t2) + i2.fromNumber = function(t3) { + if (0 === t3) return o; - var e2 = t2 < 0; - e2 && (t2 = -t2); - var n2 = t2 >>> 0, r2 = (t2 - n2) / 4294967296 >>> 0; + var e2 = t3 < 0; + e2 && (t3 = -t3); + var n2 = t3 >>> 0, r2 = (t3 - n2) / 4294967296 >>> 0; return e2 && (r2 = ~r2 >>> 0, n2 = ~n2 >>> 0, ++n2 > 4294967295 && (n2 = 0, ++r2 > 4294967295 && (r2 = 0))), new i2(n2, r2); - }, i2.from = function(t2) { - if ("number" == typeof t2) - return i2.fromNumber(t2); - if (r.isString(t2)) { + }, i2.from = function(t3) { + if ("number" == typeof t3) + return i2.fromNumber(t3); + if (r.isString(t3)) { if (!r.Long) - return i2.fromNumber(parseInt(t2, 10)); - t2 = r.Long.fromString(t2); + return i2.fromNumber(parseInt(t3, 10)); + t3 = r.Long.fromString(t3); } - return t2.low || t2.high ? new i2(t2.low >>> 0, t2.high >>> 0) : o; - }, i2.prototype.toNumber = function(t2) { - if (!t2 && this.hi >>> 31) { + return t3.low || t3.high ? new i2(t3.low >>> 0, t3.high >>> 0) : o; + }, i2.prototype.toNumber = function(t3) { + if (!t3 && this.hi >>> 31) { var e2 = 1 + ~this.lo >>> 0, n2 = ~this.hi >>> 0; return e2 || (n2 = n2 + 1 >>> 0), -(e2 + 4294967296 * n2); } return this.lo + 4294967296 * this.hi; - }, i2.prototype.toLong = function(t2) { - return r.Long ? new r.Long(0 | this.lo, 0 | this.hi, Boolean(t2)) : { low: 0 | this.lo, high: 0 | this.hi, unsigned: Boolean(t2) }; + }, i2.prototype.toLong = function(t3) { + return r.Long ? new r.Long(0 | this.lo, 0 | this.hi, Boolean(t3)) : { low: 0 | this.lo, high: 0 | this.hi, unsigned: Boolean(t3) }; }; var s = String.prototype.charCodeAt; - i2.fromHash = function(t2) { - return t2 === a ? o : new i2((s.call(t2, 0) | s.call(t2, 1) << 8 | s.call(t2, 2) << 16 | s.call(t2, 3) << 24) >>> 0, (s.call(t2, 4) | s.call(t2, 5) << 8 | s.call(t2, 6) << 16 | s.call(t2, 7) << 24) >>> 0); + i2.fromHash = function(t3) { + return t3 === a ? o : new i2((s.call(t3, 0) | s.call(t3, 1) << 8 | s.call(t3, 2) << 16 | s.call(t3, 3) << 24) >>> 0, (s.call(t3, 4) | s.call(t3, 5) << 8 | s.call(t3, 6) << 16 | s.call(t3, 7) << 24) >>> 0); }, i2.prototype.toHash = function() { return String.fromCharCode(255 & this.lo, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, 255 & this.hi, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); }, i2.prototype.zzEncode = function() { - var t2 = this.hi >> 31; - return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ t2) >>> 0, this.lo = (this.lo << 1 ^ t2) >>> 0, this; + var t3 = this.hi >> 31; + return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ t3) >>> 0, this.lo = (this.lo << 1 ^ t3) >>> 0, this; }, i2.prototype.zzDecode = function() { - var t2 = -(1 & this.lo); - return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ t2) >>> 0, this.hi = (this.hi >>> 1 ^ t2) >>> 0, this; + var t3 = -(1 & this.lo); + return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ t3) >>> 0, this.hi = (this.hi >>> 1 ^ t3) >>> 0, this; }, i2.prototype.length = function() { - var t2 = this.lo, e2 = (this.lo >>> 28 | this.hi << 4) >>> 0, n2 = this.hi >>> 24; - return 0 === n2 ? 0 === e2 ? t2 < 16384 ? t2 < 128 ? 1 : 2 : t2 < 2097152 ? 3 : 4 : e2 < 16384 ? e2 < 128 ? 5 : 6 : e2 < 2097152 ? 7 : 8 : n2 < 128 ? 9 : 10; + var t3 = this.lo, e2 = (this.lo >>> 28 | this.hi << 4) >>> 0, n2 = this.hi >>> 24; + return 0 === n2 ? 0 === e2 ? t3 < 16384 ? t3 < 128 ? 1 : 2 : t3 < 2097152 ? 3 : 4 : e2 < 16384 ? e2 < 128 ? 5 : 6 : e2 < 2097152 ? 7 : 8 : n2 < 128 ? 9 : 10; }; - }, 9693: function(t, e, n) { + }, 9693: function(t2, e, n) { "use strict"; var r = e; - function i2(t2, e2, n2) { + function i2(t3, e2, n2) { for (var r2 = Object.keys(e2), i3 = 0; i3 < r2.length; ++i3) - void 0 !== t2[r2[i3]] && n2 || (t2[r2[i3]] = e2[r2[i3]]); - return t2; + void 0 !== t3[r2[i3]] && n2 || (t3[r2[i3]] = e2[r2[i3]]); + return t3; } - function o(t2) { - function e2(t3, n2) { + function o(t3) { + function e2(t4, n2) { if (!(this instanceof e2)) - return new e2(t3, n2); + return new e2(t4, n2); Object.defineProperty(this, "message", { get: function() { - return t3; + return t4; } }), Error.captureStackTrace ? Error.captureStackTrace(this, e2) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), n2 && i2(this, n2); } return (e2.prototype = Object.create(Error.prototype)).constructor = e2, Object.defineProperty(e2.prototype, "name", { get: function() { - return t2; + return t3; } }), e2.prototype.toString = function() { return this.name + ": " + this.message; }, e2; } - r.asPromise = n(4537), r.base64 = n(7419), r.EventEmitter = n(9211), r.float = n(945), r.inquire = n(7199), r.utf8 = n(4997), r.pool = n(6662), r.LongBits = n(1945), r.isNode = Boolean("undefined" != typeof global && global && global.process && global.process.versions && global.process.versions.node), r.global = r.isNode && global || "undefined" != typeof window && window || "undefined" != typeof self && self || this, r.emptyArray = Object.freeze ? Object.freeze([]) : [], r.emptyObject = Object.freeze ? Object.freeze({}) : {}, r.isInteger = Number.isInteger || function(t2) { - return "number" == typeof t2 && isFinite(t2) && Math.floor(t2) === t2; - }, r.isString = function(t2) { - return "string" == typeof t2 || t2 instanceof String; - }, r.isObject = function(t2) { - return t2 && "object" == typeof t2; - }, r.isset = r.isSet = function(t2, e2) { - var n2 = t2[e2]; - return !(null == n2 || !t2.hasOwnProperty(e2)) && ("object" != typeof n2 || (Array.isArray(n2) ? n2.length : Object.keys(n2).length) > 0); + r.asPromise = n(4537), r.base64 = n(7419), r.EventEmitter = n(9211), r.float = n(945), r.inquire = n(7199), r.utf8 = n(4997), r.pool = n(6662), r.LongBits = n(1945), r.isNode = Boolean("undefined" != typeof global && global && global.process && global.process.versions && global.process.versions.node), r.global = r.isNode && global || "undefined" != typeof window && window || "undefined" != typeof self && self || this, r.emptyArray = Object.freeze ? Object.freeze([]) : [], r.emptyObject = Object.freeze ? Object.freeze({}) : {}, r.isInteger = Number.isInteger || function(t3) { + return "number" == typeof t3 && isFinite(t3) && Math.floor(t3) === t3; + }, r.isString = function(t3) { + return "string" == typeof t3 || t3 instanceof String; + }, r.isObject = function(t3) { + return t3 && "object" == typeof t3; + }, r.isset = r.isSet = function(t3, e2) { + var n2 = t3[e2]; + return !(null == n2 || !t3.hasOwnProperty(e2)) && ("object" != typeof n2 || (Array.isArray(n2) ? n2.length : Object.keys(n2).length) > 0); }, r.Buffer = function() { try { - var t2 = r.inquire("buffer").Buffer; - return t2.prototype.utf8Write ? t2 : null; - } catch (t3) { + var t3 = r.inquire("buffer").Buffer; + return t3.prototype.utf8Write ? t3 : null; + } catch (t4) { return null; } - }(), r._Buffer_from = null, r._Buffer_allocUnsafe = null, r.newBuffer = function(t2) { - return "number" == typeof t2 ? r.Buffer ? r._Buffer_allocUnsafe(t2) : new r.Array(t2) : r.Buffer ? r._Buffer_from(t2) : "undefined" == typeof Uint8Array ? t2 : new Uint8Array(t2); - }, r.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, r.Long = r.global.dcodeIO && r.global.dcodeIO.Long || r.global.Long || r.inquire("long"), r.key2Re = /^true|false|0|1$/, r.key32Re = /^-?(?:0|[1-9][0-9]*)$/, r.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, r.longToHash = function(t2) { - return t2 ? r.LongBits.from(t2).toHash() : r.LongBits.zeroHash; - }, r.longFromHash = function(t2, e2) { - var n2 = r.LongBits.fromHash(t2); + }(), r._Buffer_from = null, r._Buffer_allocUnsafe = null, r.newBuffer = function(t3) { + return "number" == typeof t3 ? r.Buffer ? r._Buffer_allocUnsafe(t3) : new r.Array(t3) : r.Buffer ? r._Buffer_from(t3) : "undefined" == typeof Uint8Array ? t3 : new Uint8Array(t3); + }, r.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, r.Long = r.global.dcodeIO && r.global.dcodeIO.Long || r.global.Long || r.inquire("long"), r.key2Re = /^true|false|0|1$/, r.key32Re = /^-?(?:0|[1-9][0-9]*)$/, r.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, r.longToHash = function(t3) { + return t3 ? r.LongBits.from(t3).toHash() : r.LongBits.zeroHash; + }, r.longFromHash = function(t3, e2) { + var n2 = r.LongBits.fromHash(t3); return r.Long ? r.Long.fromBits(n2.lo, n2.hi, e2) : n2.toNumber(Boolean(e2)); - }, r.merge = i2, r.lcFirst = function(t2) { - return t2.charAt(0).toLowerCase() + t2.substring(1); - }, r.newError = o, r.ProtocolError = o("ProtocolError"), r.oneOfGetter = function(t2) { - for (var e2 = {}, n2 = 0; n2 < t2.length; ++n2) - e2[t2[n2]] = 1; + }, r.merge = i2, r.lcFirst = function(t3) { + return t3.charAt(0).toLowerCase() + t3.substring(1); + }, r.newError = o, r.ProtocolError = o("ProtocolError"), r.oneOfGetter = function(t3) { + for (var e2 = {}, n2 = 0; n2 < t3.length; ++n2) + e2[t3[n2]] = 1; return function() { - for (var t3 = Object.keys(this), n3 = t3.length - 1; n3 > -1; --n3) - if (1 === e2[t3[n3]] && void 0 !== this[t3[n3]] && null !== this[t3[n3]]) - return t3[n3]; + for (var t4 = Object.keys(this), n3 = t4.length - 1; n3 > -1; --n3) + if (1 === e2[t4[n3]] && void 0 !== this[t4[n3]] && null !== this[t4[n3]]) + return t4[n3]; }; - }, r.oneOfSetter = function(t2) { + }, r.oneOfSetter = function(t3) { return function(e2) { - for (var n2 = 0; n2 < t2.length; ++n2) - t2[n2] !== e2 && delete this[t2[n2]]; + for (var n2 = 0; n2 < t3.length; ++n2) + t3[n2] !== e2 && delete this[t3[n2]]; }; }, r.toJSONOptions = { longs: String, enums: String, bytes: String, json: true }, r._configure = function() { - var t2 = r.Buffer; - t2 ? (r._Buffer_from = t2.from !== Uint8Array.from && t2.from || function(e2, n2) { - return new t2(e2, n2); - }, r._Buffer_allocUnsafe = t2.allocUnsafe || function(e2) { - return new t2(e2); + var t3 = r.Buffer; + t3 ? (r._Buffer_from = t3.from !== Uint8Array.from && t3.from || function(e2, n2) { + return new t3(e2, n2); + }, r._Buffer_allocUnsafe = t3.allocUnsafe || function(e2) { + return new t3(e2); }) : r._Buffer_from = r._Buffer_allocUnsafe = null; }; - }, 1173: (t, e, n) => { + }, 1173: (t2, e, n) => { "use strict"; - t.exports = p; + t2.exports = p; var r, i2 = n(9693), o = i2.LongBits, a = i2.base64, s = i2.utf8; - function u(t2, e2, n2) { - this.fn = t2, this.len = e2, this.next = void 0, this.val = n2; + function u(t3, e2, n2) { + this.fn = t3, this.len = e2, this.next = void 0, this.val = n2; } function c() { } - function l(t2) { - this.head = t2.head, this.tail = t2.tail, this.len = t2.len, this.next = t2.states; + function l(t3) { + this.head = t3.head, this.tail = t3.tail, this.len = t3.len, this.next = t3.states; } function p() { this.len = 0, this.head = new u(c, 0, 0), this.tail = this.head, this.states = null; @@ -6029,239 +6714,239 @@ var require_ort_web_node = __commonJS({ return new p(); }; }; - function d(t2, e2, n2) { - e2[n2] = 255 & t2; + function d(t3, e2, n2) { + e2[n2] = 255 & t3; } - function h(t2, e2) { - this.len = t2, this.next = void 0, this.val = e2; + function h(t3, e2) { + this.len = t3, this.next = void 0, this.val = e2; } - function g(t2, e2, n2) { - for (; t2.hi; ) - e2[n2++] = 127 & t2.lo | 128, t2.lo = (t2.lo >>> 7 | t2.hi << 25) >>> 0, t2.hi >>>= 7; - for (; t2.lo > 127; ) - e2[n2++] = 127 & t2.lo | 128, t2.lo = t2.lo >>> 7; - e2[n2++] = t2.lo; + function g(t3, e2, n2) { + for (; t3.hi; ) + e2[n2++] = 127 & t3.lo | 128, t3.lo = (t3.lo >>> 7 | t3.hi << 25) >>> 0, t3.hi >>>= 7; + for (; t3.lo > 127; ) + e2[n2++] = 127 & t3.lo | 128, t3.lo = t3.lo >>> 7; + e2[n2++] = t3.lo; } - function b(t2, e2, n2) { - e2[n2] = 255 & t2, e2[n2 + 1] = t2 >>> 8 & 255, e2[n2 + 2] = t2 >>> 16 & 255, e2[n2 + 3] = t2 >>> 24; + function b(t3, e2, n2) { + e2[n2] = 255 & t3, e2[n2 + 1] = t3 >>> 8 & 255, e2[n2 + 2] = t3 >>> 16 & 255, e2[n2 + 3] = t3 >>> 24; } - p.create = f(), p.alloc = function(t2) { - return new i2.Array(t2); - }, i2.Array !== Array && (p.alloc = i2.pool(p.alloc, i2.Array.prototype.subarray)), p.prototype._push = function(t2, e2, n2) { - return this.tail = this.tail.next = new u(t2, e2, n2), this.len += e2, this; - }, h.prototype = Object.create(u.prototype), h.prototype.fn = function(t2, e2, n2) { - for (; t2 > 127; ) - e2[n2++] = 127 & t2 | 128, t2 >>>= 7; - e2[n2] = t2; - }, p.prototype.uint32 = function(t2) { - return this.len += (this.tail = this.tail.next = new h((t2 >>>= 0) < 128 ? 1 : t2 < 16384 ? 2 : t2 < 2097152 ? 3 : t2 < 268435456 ? 4 : 5, t2)).len, this; - }, p.prototype.int32 = function(t2) { - return t2 < 0 ? this._push(g, 10, o.fromNumber(t2)) : this.uint32(t2); - }, p.prototype.sint32 = function(t2) { - return this.uint32((t2 << 1 ^ t2 >> 31) >>> 0); - }, p.prototype.uint64 = function(t2) { - var e2 = o.from(t2); + p.create = f(), p.alloc = function(t3) { + return new i2.Array(t3); + }, i2.Array !== Array && (p.alloc = i2.pool(p.alloc, i2.Array.prototype.subarray)), p.prototype._push = function(t3, e2, n2) { + return this.tail = this.tail.next = new u(t3, e2, n2), this.len += e2, this; + }, h.prototype = Object.create(u.prototype), h.prototype.fn = function(t3, e2, n2) { + for (; t3 > 127; ) + e2[n2++] = 127 & t3 | 128, t3 >>>= 7; + e2[n2] = t3; + }, p.prototype.uint32 = function(t3) { + return this.len += (this.tail = this.tail.next = new h((t3 >>>= 0) < 128 ? 1 : t3 < 16384 ? 2 : t3 < 2097152 ? 3 : t3 < 268435456 ? 4 : 5, t3)).len, this; + }, p.prototype.int32 = function(t3) { + return t3 < 0 ? this._push(g, 10, o.fromNumber(t3)) : this.uint32(t3); + }, p.prototype.sint32 = function(t3) { + return this.uint32((t3 << 1 ^ t3 >> 31) >>> 0); + }, p.prototype.uint64 = function(t3) { + var e2 = o.from(t3); return this._push(g, e2.length(), e2); - }, p.prototype.int64 = p.prototype.uint64, p.prototype.sint64 = function(t2) { - var e2 = o.from(t2).zzEncode(); + }, p.prototype.int64 = p.prototype.uint64, p.prototype.sint64 = function(t3) { + var e2 = o.from(t3).zzEncode(); return this._push(g, e2.length(), e2); - }, p.prototype.bool = function(t2) { - return this._push(d, 1, t2 ? 1 : 0); - }, p.prototype.fixed32 = function(t2) { - return this._push(b, 4, t2 >>> 0); - }, p.prototype.sfixed32 = p.prototype.fixed32, p.prototype.fixed64 = function(t2) { - var e2 = o.from(t2); + }, p.prototype.bool = function(t3) { + return this._push(d, 1, t3 ? 1 : 0); + }, p.prototype.fixed32 = function(t3) { + return this._push(b, 4, t3 >>> 0); + }, p.prototype.sfixed32 = p.prototype.fixed32, p.prototype.fixed64 = function(t3) { + var e2 = o.from(t3); return this._push(b, 4, e2.lo)._push(b, 4, e2.hi); - }, p.prototype.sfixed64 = p.prototype.fixed64, p.prototype.float = function(t2) { - return this._push(i2.float.writeFloatLE, 4, t2); - }, p.prototype.double = function(t2) { - return this._push(i2.float.writeDoubleLE, 8, t2); + }, p.prototype.sfixed64 = p.prototype.fixed64, p.prototype.float = function(t3) { + return this._push(i2.float.writeFloatLE, 4, t3); + }, p.prototype.double = function(t3) { + return this._push(i2.float.writeDoubleLE, 8, t3); }; - var m = i2.Array.prototype.set ? function(t2, e2, n2) { - e2.set(t2, n2); - } : function(t2, e2, n2) { - for (var r2 = 0; r2 < t2.length; ++r2) - e2[n2 + r2] = t2[r2]; + var m = i2.Array.prototype.set ? function(t3, e2, n2) { + e2.set(t3, n2); + } : function(t3, e2, n2) { + for (var r2 = 0; r2 < t3.length; ++r2) + e2[n2 + r2] = t3[r2]; }; - p.prototype.bytes = function(t2) { - var e2 = t2.length >>> 0; + p.prototype.bytes = function(t3) { + var e2 = t3.length >>> 0; if (!e2) return this._push(d, 1, 0); - if (i2.isString(t2)) { - var n2 = p.alloc(e2 = a.length(t2)); - a.decode(t2, n2, 0), t2 = n2; + if (i2.isString(t3)) { + var n2 = p.alloc(e2 = a.length(t3)); + a.decode(t3, n2, 0), t3 = n2; } - return this.uint32(e2)._push(m, e2, t2); - }, p.prototype.string = function(t2) { - var e2 = s.length(t2); - return e2 ? this.uint32(e2)._push(s.write, e2, t2) : this._push(d, 1, 0); + return this.uint32(e2)._push(m, e2, t3); + }, p.prototype.string = function(t3) { + var e2 = s.length(t3); + return e2 ? this.uint32(e2)._push(s.write, e2, t3) : this._push(d, 1, 0); }, p.prototype.fork = function() { return this.states = new l(this), this.head = this.tail = new u(c, 0, 0), this.len = 0, this; }, p.prototype.reset = function() { return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new u(c, 0, 0), this.len = 0), this; }, p.prototype.ldelim = function() { - var t2 = this.head, e2 = this.tail, n2 = this.len; - return this.reset().uint32(n2), n2 && (this.tail.next = t2.next, this.tail = e2, this.len += n2), this; + var t3 = this.head, e2 = this.tail, n2 = this.len; + return this.reset().uint32(n2), n2 && (this.tail.next = t3.next, this.tail = e2, this.len += n2), this; }, p.prototype.finish = function() { - for (var t2 = this.head.next, e2 = this.constructor.alloc(this.len), n2 = 0; t2; ) - t2.fn(t2.val, e2, n2), n2 += t2.len, t2 = t2.next; + for (var t3 = this.head.next, e2 = this.constructor.alloc(this.len), n2 = 0; t3; ) + t3.fn(t3.val, e2, n2), n2 += t3.len, t3 = t3.next; return e2; - }, p._configure = function(t2) { - r = t2, p.create = f(), r._configure(); + }, p._configure = function(t3) { + r = t3, p.create = f(), r._configure(); }; - }, 3155: (t, e, n) => { + }, 3155: (t2, e, n) => { "use strict"; - t.exports = o; + t2.exports = o; var r = n(1173); (o.prototype = Object.create(r.prototype)).constructor = o; var i2 = n(9693); function o() { r.call(this); } - function a(t2, e2, n2) { - t2.length < 40 ? i2.utf8.write(t2, e2, n2) : e2.utf8Write ? e2.utf8Write(t2, n2) : e2.write(t2, n2); + function a(t3, e2, n2) { + t3.length < 40 ? i2.utf8.write(t3, e2, n2) : e2.utf8Write ? e2.utf8Write(t3, n2) : e2.write(t3, n2); } o._configure = function() { - o.alloc = i2._Buffer_allocUnsafe, o.writeBytesBuffer = i2.Buffer && i2.Buffer.prototype instanceof Uint8Array && "set" === i2.Buffer.prototype.set.name ? function(t2, e2, n2) { - e2.set(t2, n2); - } : function(t2, e2, n2) { - if (t2.copy) - t2.copy(e2, n2, 0, t2.length); + o.alloc = i2._Buffer_allocUnsafe, o.writeBytesBuffer = i2.Buffer && i2.Buffer.prototype instanceof Uint8Array && "set" === i2.Buffer.prototype.set.name ? function(t3, e2, n2) { + e2.set(t3, n2); + } : function(t3, e2, n2) { + if (t3.copy) + t3.copy(e2, n2, 0, t3.length); else - for (var r2 = 0; r2 < t2.length; ) - e2[n2++] = t2[r2++]; + for (var r2 = 0; r2 < t3.length; ) + e2[n2++] = t3[r2++]; }; - }, o.prototype.bytes = function(t2) { - i2.isString(t2) && (t2 = i2._Buffer_from(t2, "base64")); - var e2 = t2.length >>> 0; - return this.uint32(e2), e2 && this._push(o.writeBytesBuffer, e2, t2), this; - }, o.prototype.string = function(t2) { - var e2 = i2.Buffer.byteLength(t2); - return this.uint32(e2), e2 && this._push(a, e2, t2), this; + }, o.prototype.bytes = function(t3) { + i2.isString(t3) && (t3 = i2._Buffer_from(t3, "base64")); + var e2 = t3.length >>> 0; + return this.uint32(e2), e2 && this._push(o.writeBytesBuffer, e2, t3), this; + }, o.prototype.string = function(t3) { + var e2 = i2.Buffer.byteLength(t3); + return this.uint32(e2), e2 && this._push(a, e2, t3), this; }, o._configure(); - }, 7714: (t, e, n) => { + }, 7714: (t2, e, n) => { "use strict"; e.R = void 0; const r = n(6919), i2 = n(7448); e.R = new class { async init() { } - async createSessionHandler(t2, e2) { + async createSessionHandler(t3, e2) { const n2 = new r.Session(e2); - return await n2.loadModel(t2), new i2.OnnxjsSessionHandler(n2); + return await n2.loadModel(t3), new i2.OnnxjsSessionHandler(n2); } }(); - }, 4200: (t, e, n) => { + }, 4200: (t2, e, n) => { "use strict"; e.c8 = e.rX = void 0; const r = n(6207), i2 = n(9719), o = n(2157), a = n(2306); e.rX = () => { if (("number" != typeof r.env.wasm.initTimeout || r.env.wasm.initTimeout < 0) && (r.env.wasm.initTimeout = 0), "boolean" != typeof r.env.wasm.simd && (r.env.wasm.simd = true), "boolean" != typeof r.env.wasm.proxy && (r.env.wasm.proxy = false), "number" != typeof r.env.wasm.numThreads || !Number.isInteger(r.env.wasm.numThreads) || r.env.wasm.numThreads <= 0) { - const t2 = "undefined" == typeof navigator ? (0, i2.cpus)().length : navigator.hardwareConcurrency; - r.env.wasm.numThreads = Math.min(4, Math.ceil((t2 || 1) / 2)); + const t3 = "undefined" == typeof navigator ? (0, i2.cpus)().length : navigator.hardwareConcurrency; + r.env.wasm.numThreads = Math.min(4, Math.ceil((t3 || 1) / 2)); } }, e.c8 = new class { async init() { (0, e.rX)(), await (0, o.initWasm)(); } - async createSessionHandler(t2, e2) { + async createSessionHandler(t3, e2) { const n2 = new a.OnnxruntimeWebAssemblySessionHandler(); - return await n2.loadModel(t2, e2), Promise.resolve(n2); + return await n2.loadModel(t3, e2), Promise.resolve(n2); } }(); - }, 6018: function(t, e, n) { + }, 6018: function(t2, e, n) { "use strict"; - var r = this && this.__createBinding || (Object.create ? function(t2, e2, n2, r2) { + var r = this && this.__createBinding || (Object.create ? function(t3, e2, n2, r2) { void 0 === r2 && (r2 = n2); var i3 = Object.getOwnPropertyDescriptor(e2, n2); i3 && !("get" in i3 ? !e2.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return e2[n2]; - } }), Object.defineProperty(t2, r2, i3); - } : function(t2, e2, n2, r2) { - void 0 === r2 && (r2 = n2), t2[r2] = e2[n2]; - }), i2 = this && this.__exportStar || function(t2, e2) { - for (var n2 in t2) - "default" === n2 || Object.prototype.hasOwnProperty.call(e2, n2) || r(e2, t2, n2); + } }), Object.defineProperty(t3, r2, i3); + } : function(t3, e2, n2, r2) { + void 0 === r2 && (r2 = n2), t3[r2] = e2[n2]; + }), i2 = this && this.__exportStar || function(t3, e2) { + for (var n2 in t3) + "default" === n2 || Object.prototype.hasOwnProperty.call(e2, n2) || r(e2, t3, n2); }; Object.defineProperty(e, "__esModule", { value: true }), i2(n(6207), e); const o = n(6207); { - const t2 = n(7714).R; - (0, o.registerBackend)("webgl", t2, -10); + const t3 = n(7714).R; + (0, o.registerBackend)("webgl", t3, -10); } { - const t2 = n(4200).c8; - (0, o.registerBackend)("cpu", t2, 10), (0, o.registerBackend)("wasm", t2, 10), (0, o.registerBackend)("xnnpack", t2, 9); + const t3 = n(4200).c8; + (0, o.registerBackend)("cpu", t3, 10), (0, o.registerBackend)("wasm", t3, 10), (0, o.registerBackend)("xnnpack", t3, 9); } - }, 246: (t, e) => { + }, 246: (t2, e) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createAttributeWithCacheKey = void 0; class n { - constructor(t2) { - Object.assign(this, t2); + constructor(t3) { + Object.assign(this, t3); } get cacheKey() { - return this._cacheKey || (this._cacheKey = Object.getOwnPropertyNames(this).sort().map((t2) => `${this[t2]}`).join(";")), this._cacheKey; + return this._cacheKey || (this._cacheKey = Object.getOwnPropertyNames(this).sort().map((t3) => `${this[t3]}`).join(";")), this._cacheKey; } } - e.createAttributeWithCacheKey = (t2) => new n(t2); - }, 7778: (t, e, n) => { + e.createAttributeWithCacheKey = (t3) => new n(t3); + }, 7778: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.Attribute = void 0; const r = n(1446), i2 = n(9395), o = n(9162), a = n(2517); var s = i2.onnxruntime.experimental.fbs; class u { - constructor(t2) { - if (this._attributes = /* @__PURE__ */ new Map(), null != t2) { - for (const e2 of t2) + constructor(t3) { + if (this._attributes = /* @__PURE__ */ new Map(), null != t3) { + for (const e2 of t3) e2 instanceof r.onnx.AttributeProto ? this._attributes.set(e2.name, [u.getValue(e2), u.getType(e2)]) : e2 instanceof s.Attribute && this._attributes.set(e2.name(), [u.getValue(e2), u.getType(e2)]); - if (this._attributes.size < t2.length) + if (this._attributes.size < t3.length) throw new Error("duplicated attribute names"); } } - set(t2, e2, n2) { - this._attributes.set(t2, [n2, e2]); + set(t3, e2, n2) { + this._attributes.set(t3, [n2, e2]); } - delete(t2) { - this._attributes.delete(t2); + delete(t3) { + this._attributes.delete(t3); } - getFloat(t2, e2) { - return this.get(t2, "float", e2); + getFloat(t3, e2) { + return this.get(t3, "float", e2); } - getInt(t2, e2) { - return this.get(t2, "int", e2); + getInt(t3, e2) { + return this.get(t3, "int", e2); } - getString(t2, e2) { - return this.get(t2, "string", e2); + getString(t3, e2) { + return this.get(t3, "string", e2); } - getTensor(t2, e2) { - return this.get(t2, "tensor", e2); + getTensor(t3, e2) { + return this.get(t3, "tensor", e2); } - getFloats(t2, e2) { - return this.get(t2, "floats", e2); + getFloats(t3, e2) { + return this.get(t3, "floats", e2); } - getInts(t2, e2) { - return this.get(t2, "ints", e2); + getInts(t3, e2) { + return this.get(t3, "ints", e2); } - getStrings(t2, e2) { - return this.get(t2, "strings", e2); + getStrings(t3, e2) { + return this.get(t3, "strings", e2); } - getTensors(t2, e2) { - return this.get(t2, "tensors", e2); + getTensors(t3, e2) { + return this.get(t3, "tensors", e2); } - get(t2, e2, n2) { - const r2 = this._attributes.get(t2); + get(t3, e2, n2) { + const r2 = this._attributes.get(t3); if (void 0 === r2) { if (void 0 !== n2) return n2; - throw new Error(`required attribute not found: ${t2}`); + throw new Error(`required attribute not found: ${t3}`); } if (r2[1] !== e2) throw new Error(`type mismatch: expected ${e2} but got ${r2[1]}`); return r2[0]; } - static getType(t2) { - const e2 = t2 instanceof r.onnx.AttributeProto ? t2.type : t2.type(); + static getType(t3) { + const e2 = t3 instanceof r.onnx.AttributeProto ? t3.type : t3.type(); switch (e2) { case r.onnx.AttributeProto.AttributeType.FLOAT: return "float"; @@ -6283,127 +6968,127 @@ var require_ort_web_node = __commonJS({ throw new Error(`attribute type is not supported yet: ${r.onnx.AttributeProto.AttributeType[e2]}`); } } - static getValue(t2) { - const e2 = t2 instanceof r.onnx.AttributeProto ? t2.type : t2.type(); + static getValue(t3) { + const e2 = t3 instanceof r.onnx.AttributeProto ? t3.type : t3.type(); if (e2 === r.onnx.AttributeProto.AttributeType.GRAPH || e2 === r.onnx.AttributeProto.AttributeType.GRAPHS) throw new Error("graph attribute is not supported yet"); - const n2 = this.getValueNoCheck(t2); + const n2 = this.getValueNoCheck(t3); if (e2 === r.onnx.AttributeProto.AttributeType.INT && a.LongUtil.isLong(n2)) return a.LongUtil.longToNumber(n2); if (e2 === r.onnx.AttributeProto.AttributeType.INTS) { - const t3 = n2, e3 = new Array(t3.length); - for (let n3 = 0; n3 < t3.length; n3++) { - const r2 = t3[n3]; + const t4 = n2, e3 = new Array(t4.length); + for (let n3 = 0; n3 < t4.length; n3++) { + const r2 = t4[n3]; e3[n3] = a.LongUtil.longToNumber(r2); } return e3; } if (e2 === r.onnx.AttributeProto.AttributeType.TENSOR) - return t2 instanceof r.onnx.AttributeProto ? o.Tensor.fromProto(n2) : o.Tensor.fromOrtTensor(n2); + return t3 instanceof r.onnx.AttributeProto ? o.Tensor.fromProto(n2) : o.Tensor.fromOrtTensor(n2); if (e2 === r.onnx.AttributeProto.AttributeType.TENSORS) { - if (t2 instanceof r.onnx.AttributeProto) - return n2.map((t3) => o.Tensor.fromProto(t3)); - if (t2 instanceof s.Attribute) - return n2.map((t3) => o.Tensor.fromOrtTensor(t3)); + if (t3 instanceof r.onnx.AttributeProto) + return n2.map((t4) => o.Tensor.fromProto(t4)); + if (t3 instanceof s.Attribute) + return n2.map((t4) => o.Tensor.fromOrtTensor(t4)); } - if (e2 === r.onnx.AttributeProto.AttributeType.STRING && t2 instanceof r.onnx.AttributeProto) { - const t3 = n2; - return (0, a.decodeUtf8String)(t3); + if (e2 === r.onnx.AttributeProto.AttributeType.STRING && t3 instanceof r.onnx.AttributeProto) { + const t4 = n2; + return (0, a.decodeUtf8String)(t4); } - return e2 === r.onnx.AttributeProto.AttributeType.STRINGS && t2 instanceof r.onnx.AttributeProto ? n2.map(a.decodeUtf8String) : n2; + return e2 === r.onnx.AttributeProto.AttributeType.STRINGS && t3 instanceof r.onnx.AttributeProto ? n2.map(a.decodeUtf8String) : n2; } - static getValueNoCheck(t2) { - return t2 instanceof r.onnx.AttributeProto ? this.getValueNoCheckFromOnnxFormat(t2) : this.getValueNoCheckFromOrtFormat(t2); + static getValueNoCheck(t3) { + return t3 instanceof r.onnx.AttributeProto ? this.getValueNoCheckFromOnnxFormat(t3) : this.getValueNoCheckFromOrtFormat(t3); } - static getValueNoCheckFromOnnxFormat(t2) { - switch (t2.type) { + static getValueNoCheckFromOnnxFormat(t3) { + switch (t3.type) { case r.onnx.AttributeProto.AttributeType.FLOAT: - return t2.f; + return t3.f; case r.onnx.AttributeProto.AttributeType.INT: - return t2.i; + return t3.i; case r.onnx.AttributeProto.AttributeType.STRING: - return t2.s; + return t3.s; case r.onnx.AttributeProto.AttributeType.TENSOR: - return t2.t; + return t3.t; case r.onnx.AttributeProto.AttributeType.GRAPH: - return t2.g; + return t3.g; case r.onnx.AttributeProto.AttributeType.FLOATS: - return t2.floats; + return t3.floats; case r.onnx.AttributeProto.AttributeType.INTS: - return t2.ints; + return t3.ints; case r.onnx.AttributeProto.AttributeType.STRINGS: - return t2.strings; + return t3.strings; case r.onnx.AttributeProto.AttributeType.TENSORS: - return t2.tensors; + return t3.tensors; case r.onnx.AttributeProto.AttributeType.GRAPHS: - return t2.graphs; + return t3.graphs; default: - throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t2.type]}`); + throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[t3.type]}`); } } - static getValueNoCheckFromOrtFormat(t2) { - switch (t2.type()) { + static getValueNoCheckFromOrtFormat(t3) { + switch (t3.type()) { case s.AttributeType.FLOAT: - return t2.f(); + return t3.f(); case s.AttributeType.INT: - return t2.i(); + return t3.i(); case s.AttributeType.STRING: - return t2.s(); + return t3.s(); case s.AttributeType.TENSOR: - return t2.t(); + return t3.t(); case s.AttributeType.GRAPH: - return t2.g(); + return t3.g(); case s.AttributeType.FLOATS: - return t2.floatsArray(); + return t3.floatsArray(); case s.AttributeType.INTS: { const e2 = []; - for (let n2 = 0; n2 < t2.intsLength(); n2++) - e2.push(t2.ints(n2)); + for (let n2 = 0; n2 < t3.intsLength(); n2++) + e2.push(t3.ints(n2)); return e2; } case s.AttributeType.STRINGS: { const e2 = []; - for (let n2 = 0; n2 < t2.stringsLength(); n2++) - e2.push(t2.strings(n2)); + for (let n2 = 0; n2 < t3.stringsLength(); n2++) + e2.push(t3.strings(n2)); return e2; } case s.AttributeType.TENSORS: { const e2 = []; - for (let n2 = 0; n2 < t2.tensorsLength(); n2++) - e2.push(t2.tensors(n2)); + for (let n2 = 0; n2 < t3.tensorsLength(); n2++) + e2.push(t3.tensors(n2)); return e2; } default: - throw new Error(`unsupported attribute type: ${s.AttributeType[t2.type()]}`); + throw new Error(`unsupported attribute type: ${s.AttributeType[t3.type()]}`); } } } e.Attribute = u; - }, 7091: (t, e, n) => { + }, 7091: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.resolveBackend = e.backend = void 0; const r = n(5038), i2 = /* @__PURE__ */ new Map(); - async function o(t2) { + async function o(t3) { const n2 = e.backend; - if (void 0 !== n2[t2] && function(t3) { - const e2 = t3; + if (void 0 !== n2[t3] && function(t4) { + const e2 = t4; return "initialize" in e2 && "function" == typeof e2.initialize && "createSessionHandler" in e2 && "function" == typeof e2.createSessionHandler && "dispose" in e2 && "function" == typeof e2.dispose; - }(n2[t2])) { - const e2 = n2[t2]; + }(n2[t3])) { + const e2 = n2[t3]; let r2 = e2.initialize(); if ("object" == typeof r2 && "then" in r2 && (r2 = await r2), r2) - return i2.set(t2, e2), e2; + return i2.set(t3, e2), e2; } } - e.backend = { webgl: new r.WebGLBackend() }, e.resolveBackend = async function t2(e2) { + e.backend = { webgl: new r.WebGLBackend() }, e.resolveBackend = async function t3(e2) { if (!e2) - return t2(["webgl"]); + return t3(["webgl"]); { - const t3 = "string" == typeof e2 ? [e2] : e2; - for (const e3 of t3) { - const t4 = i2.get(e3); - if (t4) - return t4; + const t4 = "string" == typeof e2 ? [e2] : e2; + for (const e3 of t4) { + const t5 = i2.get(e3); + if (t5) + return t5; const n2 = await o(e3); if (n2) return n2; @@ -6411,7 +7096,7 @@ var require_ort_web_node = __commonJS({ } throw new Error("no available backend to use"); }; - }, 5038: (t, e, n) => { + }, 5038: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.WebGLBackend = void 0; const r = n(6207), i2 = n(3694), o = n(6416), a = n(7305); @@ -6419,54 +7104,54 @@ var require_ort_web_node = __commonJS({ get contextId() { return r.env.webgl.contextId; } - set contextId(t2) { - r.env.webgl.contextId = t2; + set contextId(t3) { + r.env.webgl.contextId = t3; } get matmulMaxBatchSize() { return r.env.webgl.matmulMaxBatchSize; } - set matmulMaxBatchSize(t2) { - r.env.webgl.matmulMaxBatchSize = t2; + set matmulMaxBatchSize(t3) { + r.env.webgl.matmulMaxBatchSize = t3; } get textureCacheMode() { return r.env.webgl.textureCacheMode; } - set textureCacheMode(t2) { - r.env.webgl.textureCacheMode = t2; + set textureCacheMode(t3) { + r.env.webgl.textureCacheMode = t3; } get pack() { return r.env.webgl.pack; } - set pack(t2) { - r.env.webgl.pack = t2; + set pack(t3) { + r.env.webgl.pack = t3; } get async() { return r.env.webgl.async; } - set async(t2) { - r.env.webgl.async = t2; + set async(t3) { + r.env.webgl.async = t3; } initialize() { try { return this.glContext = (0, a.createWebGLContext)(this.contextId), "number" != typeof this.matmulMaxBatchSize && (this.matmulMaxBatchSize = 16), "string" != typeof this.textureCacheMode && (this.textureCacheMode = "full"), "boolean" != typeof this.pack && (this.pack = false), "boolean" != typeof this.async && (this.async = false), i2.Logger.setWithEnv(r.env), i2.Logger.verbose("WebGLBackend", `Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`), true; - } catch (t2) { - return i2.Logger.warning("WebGLBackend", `Unable to initialize WebGLBackend. ${t2}`), false; + } catch (t3) { + return i2.Logger.warning("WebGLBackend", `Unable to initialize WebGLBackend. ${t3}`), false; } } - createSessionHandler(t2) { - return new o.WebGLSessionHandler(this, t2); + createSessionHandler(t3) { + return new o.WebGLSessionHandler(this, t3); } dispose() { this.glContext.dispose(); } }; - }, 5107: (t, e, n) => { + }, 5107: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.CoordsGlslLib = void 0; const r = n(2517), i2 = n(8520), o = n(5060), a = n(7859), s = n(9390); class u extends i2.GlslLib { - constructor(t2) { - super(t2); + constructor(t3) { + super(t3); } getFunctions() { return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.offsetToCoords()), this.coordsToOffset()), this.toVec()), this.valueFrom()), this.getCommonUtilFuncs()), this.getInputsSamplingSnippets()), this.getOutputSamplingSnippet()); @@ -6481,11 +7166,11 @@ var require_ort_web_node = __commonJS({ return { coordsToOffset: new i2.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ") }; } getOutputSamplingSnippet() { - const t2 = this.context.outputTextureLayout; - return t2.isPacked ? this.getPackedOutputSamplingSnippet(t2) : this.getUnpackedOutputSamplingSnippet(t2); + const t3 = this.context.outputTextureLayout; + return t3.isPacked ? this.getPackedOutputSamplingSnippet(t3) : this.getUnpackedOutputSamplingSnippet(t3); } - getPackedOutputSamplingSnippet(t2) { - const e2 = t2.unpackedShape, n2 = [t2.width, t2.height], r2 = {}, a2 = "getOutputCoords"; + getPackedOutputSamplingSnippet(t3) { + const e2 = t3.unpackedShape, n2 = [t3.width, t3.height], r2 = {}, a2 = "getOutputCoords"; switch (e2.length) { case 0: r2[a2] = this.getOutputScalarCoords(); @@ -6509,8 +7194,8 @@ var require_ort_web_node = __commonJS({ `; return r2.floatTextureSetRGBA = new i2.GlslLibRoutine(s2), r2; } - getUnpackedOutputSamplingSnippet(t2) { - const e2 = t2.unpackedShape, n2 = [t2.width, t2.height], r2 = {}, a2 = "getOutputCoords"; + getUnpackedOutputSamplingSnippet(t3) { + const e2 = t3.unpackedShape, n2 = [t3.width, t3.height], r2 = {}, a2 = "getOutputCoords"; switch (e2.length) { case 0: r2[a2] = this.getOutputScalarCoords(); @@ -6546,7 +7231,7 @@ var require_ort_web_node = __commonJS({ getOutputScalarCoords() { return new i2.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n "); } - getOutputPacked1DCoords(t2, e2) { + getOutputPacked1DCoords(t3, e2) { const n2 = e2; let r2 = ""; return 1 === n2[0] ? (r2 = ` @@ -6565,15 +7250,15 @@ var require_ort_web_node = __commonJS({ } `, new i2.GlslLibRoutine(r2)); } - getOutputPacked2DCoords(t2, e2) { + getOutputPacked2DCoords(t3, e2) { let n2 = ""; - if (r.ArrayUtil.arraysEqual(t2, e2)) + if (r.ArrayUtil.arraysEqual(t3, e2)) return n2 = ` ivec2 getOutputCoords() { return 2 * ivec2(TexCoords.xy * vec2(${e2[0]}, ${e2[1]})); } `, new i2.GlslLibRoutine(n2); - const o2 = e2, a2 = Math.ceil(t2[1] / 2); + const o2 = e2, a2 = Math.ceil(t3[1] / 2); return n2 = ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6589,8 +7274,8 @@ var require_ort_web_node = __commonJS({ } `, new i2.GlslLibRoutine(n2); } - getOutputPacked3DCoords(t2, e2) { - const n2 = [e2[0], e2[1]], r2 = Math.ceil(t2[2] / 2), o2 = r2 * Math.ceil(t2[1] / 2), a2 = ` + getOutputPacked3DCoords(t3, e2) { + const n2 = [e2[0], e2[1]], r2 = Math.ceil(t3[2] / 2), o2 = r2 * Math.ceil(t3[1] / 2), a2 = ` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${n2[0]}, ${n2[1]})); @@ -6608,16 +7293,16 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(a2); } - getOutputPackedNDCoords(t2, e2) { - const n2 = [e2[0], e2[1]], r2 = Math.ceil(t2[t2.length - 1] / 2), o2 = r2 * Math.ceil(t2[t2.length - 2] / 2); + getOutputPackedNDCoords(t3, e2) { + const n2 = [e2[0], e2[1]], r2 = Math.ceil(t3[t3.length - 1] / 2), o2 = r2 * Math.ceil(t3[t3.length - 2] / 2); let a2 = o2, s2 = "", u2 = "b, r, c"; - for (let e3 = 2; e3 < t2.length - 1; e3++) - a2 *= t2[t2.length - e3 - 1], s2 = ` + for (let e3 = 2; e3 < t3.length - 1; e3++) + a2 *= t3[t3.length - e3 - 1], s2 = ` int b${e3} = index / ${a2}; index -= b${e3} * ${a2}; ` + s2, u2 = `b${e3}, ` + u2; const c = ` - ivec${t2.length} getOutputCoords() { + ivec${t3.length} getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${n2[0]}, ${n2[1]})); int index = resTexRC.y * ${n2[0]} + resTexRC.x; @@ -6631,12 +7316,12 @@ var require_ort_web_node = __commonJS({ int r = imod(index, ${r2}) * 2; int c = 2 * (index / ${r2}); - return ivec${t2.length}(${u2}); + return ivec${t3.length}(${u2}); } `; return new i2.GlslLibRoutine(c); } - getOutputUnpacked1DCoords(t2, e2) { + getOutputUnpacked1DCoords(t3, e2) { const n2 = ` int getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6646,27 +7331,27 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(n2); } - getOutputUnpacked2DCoords(t2, e2) { + getOutputUnpacked2DCoords(t3, e2) { const n2 = ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${e2[0]}, ${e2[1]})); int index = resTexRC.y * ${e2[0]} + resTexRC.x; - int r = index / ${t2[1]}; - int c = index - r * ${t2[1]}; + int r = index / ${t3[1]}; + int c = index - r * ${t3[1]}; return ivec2(r, c); } `; return new i2.GlslLibRoutine(n2); } - getOutputUnpacked3DCoords(t2, e2) { + getOutputUnpacked3DCoords(t3, e2) { let n2 = ""; - const r2 = t2.length; + const r2 = t3.length; let o2 = null; - r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t2[r2 - 1]; + r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t3[r2 - 1]; for (let e3 = r2 - 3; e3 >= 0; --e3) - o2[e3] = o2[e3 + 1] * t2[e3 + 1]; - const a2 = ["r", "c", "d"], s2 = o2.map((t3, e3) => `int ${a2[e3]} = index / ${t3}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t3}` : `index -= ${a2[e3]} * ${t3}`};`).join(""); + o2[e3] = o2[e3 + 1] * t3[e3 + 1]; + const a2 = ["r", "c", "d"], s2 = o2.map((t4, e3) => `int ${a2[e3]} = index / ${t4}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t4}` : `index -= ${a2[e3]} * ${t4}`};`).join(""); return n2 = ` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6677,14 +7362,14 @@ var require_ort_web_node = __commonJS({ } `, new i2.GlslLibRoutine(n2); } - getOutputUnpacked4DCoords(t2, e2) { + getOutputUnpacked4DCoords(t3, e2) { let n2 = ""; - const r2 = t2.length; + const r2 = t3.length; let o2 = null; - r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t2[r2 - 1]; + r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t3[r2 - 1]; for (let e3 = r2 - 3; e3 >= 0; --e3) - o2[e3] = o2[e3 + 1] * t2[e3 + 1]; - const a2 = ["r", "c", "d", "d2"], s2 = o2.map((t3, e3) => `int ${a2[e3]} = index / ${t3}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t3}` : `index -= ${a2[e3]} * ${t3}`};`).join(""); + o2[e3] = o2[e3 + 1] * t3[e3 + 1]; + const a2 = ["r", "c", "d", "d2"], s2 = o2.map((t4, e3) => `int ${a2[e3]} = index / ${t4}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t4}` : `index -= ${a2[e3]} * ${t4}`};`).join(""); return n2 = ` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6695,14 +7380,14 @@ var require_ort_web_node = __commonJS({ } `, new i2.GlslLibRoutine(n2); } - getOutputUnpacked5DCoords(t2, e2) { + getOutputUnpacked5DCoords(t3, e2) { let n2 = ""; - const r2 = t2.length; + const r2 = t3.length; let o2 = null; - r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t2[r2 - 1]; + r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t3[r2 - 1]; for (let e3 = r2 - 3; e3 >= 0; --e3) - o2[e3] = o2[e3 + 1] * t2[e3 + 1]; - const a2 = ["r", "c", "d", "d2", "d3"], s2 = o2.map((t3, e3) => `int ${a2[e3]} = index / ${t3}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t3}` : `index -= ${a2[e3]} * ${t3}`};`).join(""); + o2[e3] = o2[e3 + 1] * t3[e3 + 1]; + const a2 = ["r", "c", "d", "d2", "d3"], s2 = o2.map((t4, e3) => `int ${a2[e3]} = index / ${t4}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t4}` : `index -= ${a2[e3]} * ${t4}`};`).join(""); return n2 = ` ivec5 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6713,14 +7398,14 @@ var require_ort_web_node = __commonJS({ } `, new i2.GlslLibRoutine(n2); } - getOutputUnpacked6DCoords(t2, e2) { + getOutputUnpacked6DCoords(t3, e2) { let n2 = ""; - const r2 = t2.length; + const r2 = t3.length; let o2 = null; - r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t2[r2 - 1]; + r2 < 2 && (o2 = []), o2 = new Array(r2 - 1), o2[r2 - 2] = t3[r2 - 1]; for (let e3 = r2 - 3; e3 >= 0; --e3) - o2[e3] = o2[e3 + 1] * t2[e3 + 1]; - const a2 = ["r", "c", "d", "d2", "d3", "d4"], s2 = o2.map((t3, e3) => `int ${a2[e3]} = index / ${t3}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t3}` : `index -= ${a2[e3]} * ${t3}`};`).join(""); + o2[e3] = o2[e3 + 1] * t3[e3 + 1]; + const a2 = ["r", "c", "d", "d2", "d3", "d4"], s2 = o2.map((t4, e3) => `int ${a2[e3]} = index / ${t4}; ${e3 === o2.length - 1 ? `int ${a2[e3 + 1]} = index - ${a2[e3]} * ${t4}` : `index -= ${a2[e3]} * ${t4}`};`).join(""); return n2 = ` ivec6 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * @@ -6732,44 +7417,44 @@ var require_ort_web_node = __commonJS({ `, new i2.GlslLibRoutine(n2); } getCommonUtilFuncs() { - const t2 = {}; + const t3 = {}; let e2 = "uvFromFlat"; - t2[e2] = new i2.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "), e2 = "packedUVfrom1D", t2[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "packedUVfrom2D", t2[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "packedUVfrom3D", t2[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "sampleTexture"; + t3[e2] = new i2.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "), e2 = "packedUVfrom1D", t3[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "packedUVfrom2D", t3[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "packedUVfrom3D", t3[e2] = new i2.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "), e2 = "sampleTexture"; const n2 = (0, o.getGlsl)(this.context.glContext.version); - return t2[e2] = new i2.GlslLibRoutine(` + return t3[e2] = new i2.GlslLibRoutine(` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${n2.texture2D}(textureSampler, uv).r; - }`), t2; + }`), t3; } getInputsSamplingSnippets() { - const t2 = {}, e2 = this.context.outputTextureLayout; + const t3 = {}, e2 = this.context.outputTextureLayout; return this.context.programInfo.inputNames.forEach((n2, r2) => { const i3 = this.context.inputTextureLayouts[r2], o2 = (0, s.generateShaderFuncNameFromInputSamplerName)(n2); - i3.isPacked ? t2[o2] = this.getPackedSamplerFromInput(o2, n2, i3) : t2[o2] = this.getUnpackedSamplerFromInput(o2, n2, i3); + i3.isPacked ? t3[o2] = this.getPackedSamplerFromInput(o2, n2, i3) : t3[o2] = this.getUnpackedSamplerFromInput(o2, n2, i3); const a2 = (0, s.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n2); - i3.unpackedShape.length <= e2.unpackedShape.length && (i3.isPacked ? t2[a2] = this.getPackedSamplerAtOutputCoords(a2, i3, e2, n2) : t2[a2] = this.getUnpackedSamplerAtOutputCoords(a2, i3, e2, n2)); - }), t2; + i3.unpackedShape.length <= e2.unpackedShape.length && (i3.isPacked ? t3[a2] = this.getPackedSamplerAtOutputCoords(a2, i3, e2, n2) : t3[a2] = this.getUnpackedSamplerAtOutputCoords(a2, i3, e2, n2)); + }), t3; } - getPackedSamplerAtOutputCoords(t2, e2, n2, o2) { + getPackedSamplerAtOutputCoords(t3, e2, n2, o2) { const a2 = e2.unpackedShape, u2 = n2.unpackedShape, c = o2, l = (0, s.generateShaderFuncNameFromInputSamplerName)(c), p = a2.length, f = u2.length, d = r.BroadcastUtil.getBroadcastDims(a2, u2), h = (0, s.getCoordsDataType)(f), g = f - p; let b; const m = (0, s.getGlChannels)(); - b = 0 === p ? "" : f < 2 && d.length >= 1 ? "coords = 0;" : d.map((t3) => `coords.${m[t3 + g]} = 0;`).join("\n"); + b = 0 === p ? "" : f < 2 && d.length >= 1 ? "coords = 0;" : d.map((t4) => `coords.${m[t4 + g]} = 0;`).join("\n"); let y = ""; - y = f < 2 && p > 0 ? "coords" : a2.map((t3, e3) => `coords.${m[e3 + g]}`).join(", "); + y = f < 2 && p > 0 ? "coords" : a2.map((t4, e3) => `coords.${m[e3 + g]}`).join(", "); let _ = "return outputValue;"; const v = 1 === r.ShapeUtil.size(a2), w = 1 === r.ShapeUtil.size(u2); if (1 !== p || v || w) { if (v && !w) _ = 1 === f ? "\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n " : "\n return vec4(outputValue.x);\n "; else if (d.length) { - const t3 = p - 2, e3 = p - 1; - d.indexOf(t3) > -1 && d.indexOf(e3) > -1 ? _ = "return vec4(outputValue.x);" : d.indexOf(t3) > -1 ? _ = "return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);" : d.indexOf(e3) > -1 && (_ = "return vec4(outputValue.xx, outputValue.zz);"); + const t4 = p - 2, e3 = p - 1; + d.indexOf(t4) > -1 && d.indexOf(e3) > -1 ? _ = "return vec4(outputValue.x);" : d.indexOf(t4) > -1 ? _ = "return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);" : d.indexOf(e3) > -1 && (_ = "return vec4(outputValue.xx, outputValue.zz);"); } } else _ = "\n return vec4(outputValue.xy, outputValue.xy);\n "; const x = ` - vec4 ${t2}() { + vec4 ${t3}() { ${h} coords = getOutputCoords(); int lastDim = coords.${m[f - 1]}; @@ -6783,11 +7468,11 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(x, ["coordinates.getOutputCoords"]); } - getUnpackedSamplerAtOutputCoords(t2, e2, n2, o2) { + getUnpackedSamplerAtOutputCoords(t3, e2, n2, o2) { const a2 = [n2.width, n2.height], u2 = [e2.width, e2.height], c = e2.unpackedShape.length, l = n2.unpackedShape.length, p = e2.unpackedShape, f = n2.unpackedShape, d = (0, s.generateShaderFuncNameFromInputSamplerName)(o2); if (c === l && r.ArrayUtil.arraysEqual(u2, a2)) { const e3 = ` - float ${t2}() { + float ${t3}() { return sampleTexture(${o2}, TexCoords); } `; @@ -6796,11 +7481,11 @@ var require_ort_web_node = __commonJS({ const h = (0, s.getCoordsDataType)(l), g = r.BroadcastUtil.getBroadcastDims(p, f), b = l - c; let m; const y = (0, s.getGlChannels)(); - m = 0 === c ? "" : l < 2 && g.length >= 1 ? "coords = 0;" : g.map((t3) => `coords.${y[t3 + b]} = 0;`).join("\n"); + m = 0 === c ? "" : l < 2 && g.length >= 1 ? "coords = 0;" : g.map((t4) => `coords.${y[t4 + b]} = 0;`).join("\n"); let _ = ""; - _ = l < 2 && c > 0 ? "coords" : e2.unpackedShape.map((t3, e3) => `coords.${y[e3 + b]}`).join(", "); + _ = l < 2 && c > 0 ? "coords" : e2.unpackedShape.map((t4, e3) => `coords.${y[e3 + b]}`).join(", "); const v = ` - float ${t2}() { + float ${t3}() { ${h} coords = getOutputCoords(); ${m} return ${d}(${_}); @@ -6808,95 +7493,95 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(v, ["coordinates.getOutputCoords"]); } - getPackedSamplerFromInput(t2, e2, n2) { + getPackedSamplerFromInput(t3, e2, n2) { switch (n2.unpackedShape.length) { case 0: - return this.getPackedSamplerScalar(t2, e2); + return this.getPackedSamplerScalar(t3, e2); case 1: - return this.getPackedSampler1D(t2, e2, n2); + return this.getPackedSampler1D(t3, e2, n2); case 2: - return this.getPackedSampler2D(t2, e2, n2); + return this.getPackedSampler2D(t3, e2, n2); case 3: - return this.getPackedSampler3D(t2, e2, n2); + return this.getPackedSampler3D(t3, e2, n2); default: - return this.getPackedSamplerND(t2, e2, n2); + return this.getPackedSamplerND(t3, e2, n2); } } - getUnpackedSamplerFromInput(t2, e2, n2) { + getUnpackedSamplerFromInput(t3, e2, n2) { const r2 = n2.unpackedShape; switch (r2.length) { case 0: - return this.getUnpackedSamplerScalar(t2, e2, n2); + return this.getUnpackedSamplerScalar(t3, e2, n2); case 1: - return this.getUnpackedSampler1D(t2, e2, n2); + return this.getUnpackedSampler1D(t3, e2, n2); case 2: - return this.getUnpackedSampler2D(t2, e2, n2); + return this.getUnpackedSampler2D(t3, e2, n2); case 3: - return this.getUnpackedSampler3D(t2, e2, n2); + return this.getUnpackedSampler3D(t3, e2, n2); case 4: - return this.getUnpackedSampler4D(t2, e2, n2); + return this.getUnpackedSampler4D(t3, e2, n2); case 5: - return this.getUnpackedSampler5D(t2, e2, n2); + return this.getUnpackedSampler5D(t3, e2, n2); case 6: - return this.getUnpackedSampler6D(t2, e2, n2); + return this.getUnpackedSampler6D(t3, e2, n2); default: throw new Error(`Unsupported dimension ${r2.length}-D`); } } - getPackedSamplerScalar(t2, e2) { + getPackedSamplerScalar(t3, e2) { const n2 = ` - vec4 ${t2}() { + vec4 ${t3}() { return ${(0, o.getGlsl)(this.context.glContext.version).texture2D}(${e2}, halfCR); } `; return new i2.GlslLibRoutine(n2); } - getPackedSampler1D(t2, e2, n2) { - const r2 = [n2.width, n2.height], a2 = [r2[1], r2[0]], s2 = (0, o.getGlsl)(this.context.glContext.version), u2 = `vec4 ${t2}(int index) { + getPackedSampler1D(t3, e2, n2) { + const r2 = [n2.width, n2.height], a2 = [r2[1], r2[0]], s2 = (0, o.getGlsl)(this.context.glContext.version), u2 = `vec4 ${t3}(int index) { vec2 uv = packedUVfrom1D( ${a2[0]}, ${a2[1]}, index); return ${s2.texture2D}(${e2}, uv); }`; return new i2.GlslLibRoutine(u2, ["coordinates.packedUVfrom1D"]); } - getPackedSampler2D(t2, e2, n2) { + getPackedSampler2D(t3, e2, n2) { const a2 = n2.unpackedShape, s2 = [n2.width, n2.height], u2 = (0, o.getGlsl)(this.context.glContext.version), c = s2[0], l = s2[1]; if (null != s2 && r.ArrayUtil.arraysEqual(a2, s2)) { - const n3 = `vec4 ${t2}(int row, int col) { + const n3 = `vec4 ${t3}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${c}.0); return ${u2.texture2D}(${e2}, uv); }`; return new i2.GlslLibRoutine(n3); } - const p = s2, f = Math.ceil(a2[1] / 2), d = `vec4 ${t2}(int row, int col) { + const p = s2, f = Math.ceil(a2[1] / 2), d = `vec4 ${t3}(int row, int col) { vec2 uv = packedUVfrom2D(${p[1]}, ${p[0]}, ${f}, row, col); return ${u2.texture2D}(${e2}, uv); }`; return new i2.GlslLibRoutine(d, ["coordinates.packedUVfrom2D"]); } - getPackedSampler3D(t2, e2, n2) { + getPackedSampler3D(t3, e2, n2) { const r2 = n2.unpackedShape, a2 = [n2.width, n2.height], u2 = [a2[0], a2[1]], c = (0, o.getGlsl)(this.context.glContext.version); if (1 === r2[0]) { const o2 = r2.slice(1), a3 = [1, 2], u3 = (0, s.squeezeInputShape)(r2, o2), c2 = ["b", "row", "col"], l2 = JSON.parse(JSON.stringify(n2)); l2.unpackedShape = u3; - const p2 = this.getPackedSamplerFromInput(t2, e2, l2), f2 = `${p2.routineBody} - vec4 ${t2}(int b, int row, int col) { - return ${t2}(${(0, s.getSqueezedParams)(c2, a3)}); + const p2 = this.getPackedSamplerFromInput(t3, e2, l2), f2 = `${p2.routineBody} + vec4 ${t3}(int b, int row, int col) { + return ${t3}(${(0, s.getSqueezedParams)(c2, a3)}); } `; return new i2.GlslLibRoutine(f2, p2.dependencies); } - const l = u2[0], p = u2[1], f = Math.ceil(r2[2] / 2), d = `vec4 ${t2}(int b, int row, int col) { + const l = u2[0], p = u2[1], f = Math.ceil(r2[2] / 2), d = `vec4 ${t3}(int b, int row, int col) { vec2 uv = packedUVfrom3D( ${p}, ${l}, ${f * Math.ceil(r2[1] / 2)}, ${f}, b, row, col); return ${c.texture2D}(${e2}, uv);}`; return new i2.GlslLibRoutine(d, ["coordinates.packedUVfrom3D"]); } - getPackedSamplerND(t2, e2, n2) { + getPackedSamplerND(t3, e2, n2) { const r2 = n2.unpackedShape, a2 = r2.length, s2 = [n2.width, n2.height], u2 = (0, o.getGlsl)(this.context.glContext.version), c = [s2[0], s2[1]], l = c[1], p = c[0], f = Math.ceil(r2[a2 - 1] / 2); let d = f * Math.ceil(r2[a2 - 2] / 2), h = "int b, int row, int col", g = `b * ${d} + (row / 2) * ${f} + (col / 2)`; - for (let t3 = 2; t3 < a2 - 1; t3++) - h = `int b${t3}, ` + h, d *= r2[a2 - t3 - 1], g = `b${t3} * ${d} + ` + g; - const b = `vec4 ${t2}(${h}) { + for (let t4 = 2; t4 < a2 - 1; t4++) + h = `int b${t4}, ` + h, d *= r2[a2 - t4 - 1], g = `b${t4} * ${d} + ` + g; + const b = `vec4 ${t3}(${h}) { int index = ${g}; int texR = index / ${p}; int texC = index - texR * ${p}; @@ -6905,18 +7590,18 @@ var require_ort_web_node = __commonJS({ }`; return new i2.GlslLibRoutine(b); } - getUnpackedSamplerScalar(t2, e2, n2) { + getUnpackedSamplerScalar(t3, e2, n2) { const [r2, o2] = [n2.width, n2.height]; if (1 === r2 && 1 === o2) { const n3 = ` - float ${t2}() { + float ${t3}() { return sampleTexture(${e2}, halfCR); } `; return new i2.GlslLibRoutine(n3, ["coordinates.sampleTexture"]); } const a2 = ` - float ${t2}() { + float ${t3}() { int offset_${e2} = coordsToOffset(TexCoords, ${r2}, ${o2}); vec2 uv = uvFromFlat(${r2}, ${o2}, offset_${e2}); return sampleTexture(${e2}, uv); @@ -6924,11 +7609,11 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(a2, ["coordinates.uvFromFlat", "coordinates.sampleTexture", "coordinates.coordsToOffset"]); } - getUnpackedSampler1D(t2, e2, n2) { + getUnpackedSampler1D(t3, e2, n2) { const r2 = n2.width, o2 = n2.height; if (1 === o2 && 1 === r2) { const n3 = ` - float ${t2}(int index) { + float ${t3}(int index) { return sampleTexture(${e2}, halfCR); } `; @@ -6936,7 +7621,7 @@ var require_ort_web_node = __commonJS({ } if (1 === o2) { const n3 = ` - float ${t2}(int index) { + float ${t3}(int index) { vec2 uv = vec2((float(index) + 0.5) / ${r2}.0, 0.5); return sampleTexture(${e2}, uv); } @@ -6945,7 +7630,7 @@ var require_ort_web_node = __commonJS({ } if (1 === r2) { const n3 = ` - float ${t2}(int index) { + float ${t3}(int index) { vec2 uv = vec2(0.5, (float(index) + 0.5) / ${o2}.0); return sampleTexture(${e2}, uv); } @@ -6953,18 +7638,18 @@ var require_ort_web_node = __commonJS({ return new i2.GlslLibRoutine(n3, ["coordinates.sampleTexture"]); } const a2 = ` - float ${t2}(int index) { + float ${t3}(int index) { vec2 uv = uvFromFlat(${r2}, ${o2}, index); return sampleTexture(${e2}, uv); } `; return new i2.GlslLibRoutine(a2, ["coordinates.uvFromFlat", "coordinates.sampleTexture"]); } - getUnpackedSampler2D(t2, e2, n2) { + getUnpackedSampler2D(t3, e2, n2) { const o2 = n2.unpackedShape, u2 = [n2.height, n2.width]; if (null != u2 && r.ArrayUtil.arraysEqual(o2, u2)) { const n3 = ` - float ${t2}(int row, int col) { + float ${t3}(int row, int col) { vec2 uv = (vec2(row, col) + halfCR) / vec2(${u2[1]}.0, ${u2[0]}.0); return sampleTexture(${e2}, uv); } @@ -6976,9 +7661,9 @@ var require_ort_web_node = __commonJS({ const r2 = (0, s.squeezeInputShape)(o2, p), a2 = JSON.parse(JSON.stringify(n2)); a2.unpackedShape = r2; const u3 = ["col", "row"], c2 = ` - ${this.getUnpackedSamplerFromInput(t2, e2, a2).routineBody} - float ${t2}(int row, int col) { - return ${t2}(${(0, s.getSqueezedParams)(u3, l)}); + ${this.getUnpackedSamplerFromInput(t3, e2, a2).routineBody} + float ${t3}(int row, int col) { + return ${t3}(${(0, s.getSqueezedParams)(u3, l)}); } `; return new i2.GlslLibRoutine(c2, ["coordinates.sampleTexture"]); @@ -6986,7 +7671,7 @@ var require_ort_web_node = __commonJS({ const f = u2[1], d = u2[0]; if (1 === d) { const n3 = ` - float ${t2}(int row, int col) { + float ${t3}(int row, int col) { int offset_${e2} = coordsToOffset(TexCoords, ${f}, ${d}); float index = dot(vec3(row, col, offset_${e2}), vec3(${o2[1]}, 1, 1)); vec2 uv = vec2(0.5, (index + 0.5) / ${f}.0); @@ -6997,7 +7682,7 @@ var require_ort_web_node = __commonJS({ } if (1 === f) { const n3 = ` - float ${t2}(int row, int col) { + float ${t3}(int row, int col) { int offset_${e2} = coordsToOffset(TexCoords, ${f}, ${d}); float index = dot(vec3(row, col, offset_${e2}), vec3(${o2[1]}, 1, 1)); vec2 uv = vec2((index + 0.5) / ${d}.0, 0.5); @@ -7007,7 +7692,7 @@ var require_ort_web_node = __commonJS({ return new i2.GlslLibRoutine(n3, ["coordinates.sampleTexture", "coordinates.coordsToOffset"]); } const h = ` - float ${t2}(int row, int col) { + float ${t3}(int row, int col) { int index = col * ${o2[1]} + row; vec2 uv = uvFromFlat(${f}, ${d}, index); return sampleTexture(${e2}, uv); @@ -7015,21 +7700,21 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(h, ["coordinates.uvFromFlat", "coordinates.sampleTexture", "coordinates.coordsToOffset"]); } - getUnpackedSampler3D(t2, e2, n2) { + getUnpackedSampler3D(t3, e2, n2) { const r2 = n2.unpackedShape, o2 = r2[1] * r2[2], u2 = r2[2], { newShape: c, keptDims: l } = (0, a.squeezeShape)(r2), p = c; if (p.length < r2.length) { const o3 = (0, s.squeezeInputShape)(r2, p), a2 = ["batch", "col", "row"], u3 = JSON.parse(JSON.stringify(n2)); u3.unpackedShape = o3; - const c2 = this.getUnpackedSamplerFromInput(t2, e2, u3), f2 = l.reverse(), d = ` + const c2 = this.getUnpackedSamplerFromInput(t3, e2, u3), f2 = l.reverse(), d = ` ${c2.routineBody} - float ${t2}(int batch, int row, int col) { - return ${t2}(${(0, s.getSqueezedParams)(a2, f2)}); + float ${t3}(int batch, int row, int col) { + return ${t3}(${(0, s.getSqueezedParams)(a2, f2)}); } `; return new i2.GlslLibRoutine(d, c2.dependencies); } const f = ` - float ${t2}(int depth, int row, int col) { + float ${t3}(int depth, int row, int col) { // Explicitly use integer operations as dot() only works on floats. int index = depth * ${o2} + col * ${u2} + row; vec2 uv = uvFromFlat(${n2.width}, ${n2.height}, index); @@ -7038,9 +7723,9 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(f, ["coordinates.uvFromFlat", "coordinates.sampleTexture", "coordinates.coordsToOffset"]); } - getUnpackedSampler4D(t2, e2, n2) { + getUnpackedSampler4D(t3, e2, n2) { const r2 = n2.unpackedShape, o2 = r2[3], a2 = r2[2] * o2, s2 = ` - float ${t2}(int row, int col, int depth, int depth2) { + float ${t3}(int row, int col, int depth, int depth2) { int index = row * ${r2[1] * a2} + col * ${a2} + depth2 * ${o2} + depth; vec2 uv = uvFromFlat(${n2.width}, ${n2.height}, index); @@ -7049,21 +7734,21 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(s2, ["coordinates.uvFromFlat", "coordinates.sampleTexture"]); } - getUnpackedSampler5D(t2, e2, n2) { + getUnpackedSampler5D(t3, e2, n2) { const r2 = n2.unpackedShape, o2 = r2[4], u2 = r2[3] * o2, c = r2[2] * u2, l = r2[1] * c, { newShape: p, keptDims: f } = (0, a.squeezeShape)(r2); if (p.length < r2.length) { const o3 = (0, s.squeezeInputShape)(r2, p), a2 = ["row", "col", "depth", "depth2", "depth3"], u3 = JSON.parse(JSON.stringify(n2)); u3.unpackedShape = o3; const c2 = ` - ${this.getUnpackedSamplerFromInput(t2, e2, u3).routineBody} - float ${t2}(int row, int col, int depth, int depth2, int depth3) { - return ${t2}(${(0, s.getSqueezedParams)(a2, f)}); + ${this.getUnpackedSamplerFromInput(t3, e2, u3).routineBody} + float ${t3}(int row, int col, int depth, int depth2, int depth3) { + return ${t3}(${(0, s.getSqueezedParams)(a2, f)}); } `; return new i2.GlslLibRoutine(c2, ["coordinates.sampleTexture", "coordinates.uvFromFlat"]); } const d = ` - float ${t2}(int row, int col, int depth, int depth2, int depth3) { + float ${t3}(int row, int col, int depth, int depth2, int depth3) { int index = row * ${l} + col * ${c} + depth * ${u2} + depth3 * ${o2} + depth2; vec2 uv = uvFromFlat(${n2.width}, ${n2.height}, index); @@ -7072,22 +7757,22 @@ var require_ort_web_node = __commonJS({ `; return new i2.GlslLibRoutine(d, ["coordinates.sampleTexture", "coordinates.uvFromFlat"]); } - getUnpackedSampler6D(t2, e2, n2) { + getUnpackedSampler6D(t3, e2, n2) { const r2 = n2.unpackedShape, o2 = r2[5], u2 = r2[4] * o2, c = r2[3] * u2, l = r2[2] * c, p = r2[1] * l, { newShape: f, keptDims: d } = (0, a.squeezeShape)(r2); if (f.length < r2.length) { const o3 = (0, s.squeezeInputShape)(r2, f), a2 = ["row", "col", "depth", "depth2", "depth3", "depth4"], u3 = JSON.parse(JSON.stringify(n2)); u3.unpackedShape = o3; const c2 = ` - ${this.getUnpackedSamplerFromInput(t2, e2, u3).routineBody} - float ${t2}(int row, int col, int depth, + ${this.getUnpackedSamplerFromInput(t3, e2, u3).routineBody} + float ${t3}(int row, int col, int depth, int depth2, int depth3, int depth4) { - return ${t2}(${(0, s.getSqueezedParams)(a2, d)}); + return ${t3}(${(0, s.getSqueezedParams)(a2, d)}); } `; return new i2.GlslLibRoutine(c2, ["coordinates.sampleTexture", "coordinates.uvFromFlat"]); } const h = ` - float ${t2}(int row, int col, int depth, + float ${t3}(int row, int col, int depth, int depth2, int depth3, int depth4) { int index = row * ${p} + col * ${l} + depth * ${c} + depth2 * ${u2} + depth3 * ${o2} + depth4; @@ -7098,11 +7783,11 @@ var require_ort_web_node = __commonJS({ return new i2.GlslLibRoutine(h, ["coordinates.uvFromFlat", "coordinates.sampleTexture", "coordinates.coordsToOffset"]); } toVec() { - const t2 = this.context.outputTextureLayout, e2 = t2.shape.length, n2 = t2.strides, r2 = t2.width, o2 = t2.height, a2 = []; - for (let t3 = 0; t3 < e2 - 1; ++t3) + const t3 = this.context.outputTextureLayout, e2 = t3.shape.length, n2 = t3.strides, r2 = t3.width, o2 = t3.height, a2 = []; + for (let t4 = 0; t4 < e2 - 1; ++t4) a2.push(` - c[${t3}] = offset / ${n2[t3]};`), a2.push(` - offset -= c[${t3}] * ${n2[t3]};`); + c[${t4}] = offset / ${n2[t4]};`), a2.push(` + offset -= c[${t4}] * ${n2[t4]};`); a2.push(` c[${e2 - 1}] = offset;`); const s2 = ` @@ -7117,91 +7802,91 @@ var require_ort_web_node = __commonJS({ return { toVec: new i2.GlslLibRoutine(s2, ["coordinates.coordsToOffset"]) }; } valueFrom() { - const t2 = {}; + const t3 = {}; return this.context.programInfo.inputNames.forEach((e2, n2) => { const r2 = this.context.inputTextureLayouts[n2], o2 = (r2.unpackedShape.length > 0 ? r2.unpackedShape : r2.shape).length; let a2 = `_${e2}`; - t2[a2] = new i2.GlslLibRoutine(this.getValueFromSingle(e2, o2, r2.width, r2.height, false), [`shapeUtils.indicesToOffset${a2}`, "coordinates.offsetToCoords", "fragcolor.getColorAsFloat"]), a2 += "_T", t2[a2] = new i2.GlslLibRoutine(this.getValueFromSingle(e2, o2, r2.width, r2.height, true), [`shapeUtils.indicesToOffset${a2}`, "coordinates.offsetToCoords", "fragcolor.getColorAsFloat"]); - }), t2; + t3[a2] = new i2.GlslLibRoutine(this.getValueFromSingle(e2, o2, r2.width, r2.height, false), [`shapeUtils.indicesToOffset${a2}`, "coordinates.offsetToCoords", "fragcolor.getColorAsFloat"]), a2 += "_T", t3[a2] = new i2.GlslLibRoutine(this.getValueFromSingle(e2, o2, r2.width, r2.height, true), [`shapeUtils.indicesToOffset${a2}`, "coordinates.offsetToCoords", "fragcolor.getColorAsFloat"]); + }), t3; } - getValueFromSingle(t2, e2, n2, r2, i3) { - let a2 = `_${t2}`; + getValueFromSingle(t3, e2, n2, r2, i3) { + let a2 = `_${t3}`; return i3 && (a2 += "_T"), ` float ${a2}(int m[${e2}]) { int offset = indicesToOffset${a2}(m); vec2 coords = offsetToCoords(offset, ${n2}, ${r2}); - float value = getColorAsFloat(${(0, o.getGlsl)(this.context.glContext.version).texture2D}(${t2}, coords)); + float value = getColorAsFloat(${(0, o.getGlsl)(this.context.glContext.version).texture2D}(${t3}, coords)); return value; } `; } - getPackedValueFrom(t2, e2, n2, r2, i3) { - let a2 = `_${t2}_Pack`; + getPackedValueFrom(t3, e2, n2, r2, i3) { + let a2 = `_${t3}_Pack`; return i3 && (a2 += "_T"), ` vec4 ${a2}(int m[${e2}]) { - int offset = indicesToOffset_${t2}(m); + int offset = indicesToOffset_${t3}(m); vec2 coords = offsetToCoords(offset, ${n2}, ${r2}); - return ${(0, o.getGlsl)(this.context.glContext.version).texture2D}(${t2}, coords); + return ${(0, o.getGlsl)(this.context.glContext.version).texture2D}(${t3}, coords); } `; } } e.CoordsGlslLib = u; - }, 8520: (t, e) => { + }, 8520: (t2, e) => { "use strict"; var n; Object.defineProperty(e, "__esModule", { value: true }), e.TopologicalSortGlslRoutines = e.GlslLibRoutineNode = e.GlslLibRoutine = e.GlslLib = e.GlslContext = e.FunctionType = void 0, (n = e.FunctionType || (e.FunctionType = {}))[n.ValueBased = 0] = "ValueBased", n[n.Positional = 1] = "Positional", e.GlslContext = class { - constructor(t2, e2, n2, r) { - this.glContext = t2, this.programInfo = e2, this.inputTextureLayouts = n2, this.outputTextureLayout = r; + constructor(t3, e2, n2, r) { + this.glContext = t3, this.programInfo = e2, this.inputTextureLayouts = n2, this.outputTextureLayout = r; } }, e.GlslLib = class { - constructor(t2) { - this.context = t2; + constructor(t3) { + this.context = t3; } }, e.GlslLibRoutine = class { - constructor(t2, e2) { - this.routineBody = t2, this.dependencies = e2; + constructor(t3, e2) { + this.routineBody = t3, this.dependencies = e2; } }, e.GlslLibRoutineNode = class { - constructor(t2, e2, n2) { - this.name = t2, this.dependencies = n2 || [], e2 && (this.routineBody = e2); + constructor(t3, e2, n2) { + this.name = t3, this.dependencies = n2 || [], e2 && (this.routineBody = e2); } - addDependency(t2) { - t2 && this.dependencies.push(t2); + addDependency(t3) { + t3 && this.dependencies.push(t3); } }, e.TopologicalSortGlslRoutines = class { - static returnOrderedNodes(t2) { - if (!t2 || 0 === t2.length) + static returnOrderedNodes(t3) { + if (!t3 || 0 === t3.length) return []; - if (1 === t2.length) - return t2; + if (1 === t3.length) + return t3; const e2 = /* @__PURE__ */ new Set(), n2 = /* @__PURE__ */ new Set(), r = new Array(); - return this.createOrderedNodes(t2, e2, n2, r), r; + return this.createOrderedNodes(t3, e2, n2, r), r; } - static createOrderedNodes(t2, e2, n2, r) { - for (let i2 = 0; i2 < t2.length; ++i2) - this.dfsTraverse(t2[i2], e2, n2, r); + static createOrderedNodes(t3, e2, n2, r) { + for (let i2 = 0; i2 < t3.length; ++i2) + this.dfsTraverse(t3[i2], e2, n2, r); } - static dfsTraverse(t2, e2, n2, r) { - if (!t2 || n2.has(t2.name)) + static dfsTraverse(t3, e2, n2, r) { + if (!t3 || n2.has(t3.name)) return; - if (e2.has(t2.name)) + if (e2.has(t3.name)) throw new Error("Cyclic dependency detected. Can't topologically sort routines needed for shader."); - e2.add(t2.name); - const i2 = t2.dependencies; + e2.add(t3.name); + const i2 = t3.dependencies; if (i2 && i2.length > 0) - for (let t3 = 0; t3 < i2.length; ++t3) - this.dfsTraverse(i2[t3], e2, n2, r); - r.push(t2), n2.add(t2.name), e2.delete(t2.name); + for (let t4 = 0; t4 < i2.length; ++t4) + this.dfsTraverse(i2[t4], e2, n2, r); + r.push(t3), n2.add(t3.name), e2.delete(t3.name); } }; - }, 7341: (t, e, n) => { + }, 7341: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.EncodingGlslLib = void 0; const r = n(8520); class i2 extends r.GlslLib { - constructor(t2) { - super(t2); + constructor(t3) { + super(t3); } getFunctions() { return Object.assign(Object.assign({}, this.encodeFloat32()), this.decodeFloat32()); @@ -7216,7 +7901,7 @@ var require_ort_web_node = __commonJS({ return { decode: new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ") }; } encodeUint8() { - const t2 = i2.isLittleEndian() ? "rgba.rgba=rgba.abgr;" : ""; + const t3 = i2.isLittleEndian() ? "rgba.rgba=rgba.abgr;" : ""; return { encode: new r.GlslLibRoutine(` highp vec4 encode(highp float f) { highp float F = abs(f); @@ -7229,18 +7914,18 @@ var require_ort_web_node = __commonJS({ rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); - ${t2} + ${t3} rgba = rgba / 255.0; // values need to be normalized to [0,1] return rgba; } `) }; } decodeUint8() { - const t2 = i2.isLittleEndian() ? "rgba.rgba=rgba.abgr;" : ""; + const t3 = i2.isLittleEndian() ? "rgba.rgba=rgba.abgr;" : ""; return { decode: new r.GlslLibRoutine(` highp float decode(highp vec4 rgba) { rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] - ${t2} + ${t3} highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); @@ -7250,7 +7935,7 @@ var require_ort_web_node = __commonJS({ `) }; } static isLittleEndian() { - const t2 = new ArrayBuffer(4), e2 = new Uint32Array(t2), n2 = new Uint8Array(t2); + const t3 = new ArrayBuffer(4), e2 = new Uint32Array(t3), n2 = new Uint8Array(t3); if (e2[0] = 3735928559, 239 === n2[0]) return true; if (222 === n2[0]) @@ -7259,13 +7944,13 @@ var require_ort_web_node = __commonJS({ } } e.EncodingGlslLib = i2; - }, 9894: (t, e, n) => { + }, 9894: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.FragColorGlslLib = void 0; const r = n(8520), i2 = n(5060); class o extends r.GlslLib { - constructor(t2) { - super(t2); + constructor(t3) { + super(t3); } getFunctions() { return Object.assign(Object.assign({}, this.setFragColor()), this.getColorAsFloat()); @@ -7274,10 +7959,10 @@ var require_ort_web_node = __commonJS({ return {}; } setFragColor() { - const t2 = (0, i2.getGlsl)(this.context.glContext.version); + const t3 = (0, i2.getGlsl)(this.context.glContext.version); return { setFragColor: new r.GlslLibRoutine(` void setFragColor(float value) { - ${t2.output} = encode(value); + ${t3.output} = encode(value); } `, ["encoding.encode"]) }; } @@ -7286,27 +7971,27 @@ var require_ort_web_node = __commonJS({ } } e.FragColorGlslLib = o; - }, 2848: (t, e) => { + }, 2848: (t2, e) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.replaceInlines = void 0; const n = /@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm; - e.replaceInlines = function(t2) { + e.replaceInlines = function(t3) { const e2 = {}; let r; - for (; null !== (r = n.exec(t2)); ) { - const t3 = r[3].split(",").map((t4) => { - const e3 = t4.trim().split(" "); + for (; null !== (r = n.exec(t3)); ) { + const t4 = r[3].split(",").map((t5) => { + const e3 = t5.trim().split(" "); return e3 && 2 === e3.length ? { type: e3[0], name: e3[1] } : null; - }).filter((t4) => null !== t4); - e2[r[2]] = { params: t3, body: r[4] }; + }).filter((t5) => null !== t5); + e2[r[2]] = { params: t4, body: r[4] }; } for (const n2 in e2) { const i2 = "(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__", n2), o = new RegExp(i2, "gm"); - for (; null !== (r = o.exec(t2)); ) { + for (; null !== (r = o.exec(t3)); ) { const i3 = r[1], o2 = r[2], a = r[3].split(","), s = i3 ? `${i3} ${o2};` : ""; let u = e2[n2].body, c = ""; - e2[n2].params.forEach((t3, e3) => { - t3 && (c += `${t3.type} ${t3.name} = ${a[e3]}; + e2[n2].params.forEach((t4, e3) => { + t4 && (c += `${t4.type} ${t4.name} = ${a[e3]}; `); }), u = `${c} ${u}`, u = u.replace("return", `${o2} = `); @@ -7316,91 +8001,91 @@ var require_ort_web_node = __commonJS({ ${u} } `; - t2 = t2.replace(r[0], l); + t3 = t3.replace(r[0], l); } } - return t2.replace(n, ""); + return t3.replace(n, ""); }; - }, 8879: (t, e, n) => { + }, 8879: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.GlslPreprocessor = void 0; const r = n(8520), i2 = n(2848), o = n(5483), a = n(5060); e.GlslPreprocessor = class { - constructor(t2, e2, n2, i3) { - this.libs = {}, this.glslLibRoutineDependencyGraph = {}, this.context = new r.GlslContext(t2, e2, n2, i3), Object.keys(o.glslRegistry).forEach((t3) => { - const e3 = new o.glslRegistry[t3](this.context); - this.libs[t3] = e3; + constructor(t3, e2, n2, i3) { + this.libs = {}, this.glslLibRoutineDependencyGraph = {}, this.context = new r.GlslContext(t3, e2, n2, i3), Object.keys(o.glslRegistry).forEach((t4) => { + const e3 = new o.glslRegistry[t4](this.context); + this.libs[t4] = e3; }); const a2 = this.glslLibRoutineDependencyGraph; - for (const t3 in this.libs) { - const e3 = this.libs[t3].getFunctions(); + for (const t4 in this.libs) { + const e3 = this.libs[t4].getFunctions(); for (const n3 in e3) { - const i4 = t3 + "." + n3; + const i4 = t4 + "." + n3; let o2; a2[i4] ? (o2 = a2[i4], o2.routineBody = e3[n3].routineBody) : (o2 = new r.GlslLibRoutineNode(i4, e3[n3].routineBody), a2[i4] = o2); const s = e3[n3].dependencies; if (s) - for (let t4 = 0; t4 < s.length; ++t4) - if (a2[s[t4]]) - o2.addDependency(a2[s[t4]]); + for (let t5 = 0; t5 < s.length; ++t5) + if (a2[s[t5]]) + o2.addDependency(a2[s[t5]]); else { - const e4 = new r.GlslLibRoutineNode(s[t4]); - a2[s[t4]] = e4, o2.addDependency(e4); + const e4 = new r.GlslLibRoutineNode(s[t5]); + a2[s[t5]] = e4, o2.addDependency(e4); } } } } preprocess() { - const t2 = this.context.programInfo; - let e2 = t2.shaderSource; + const t3 = this.context.programInfo; + let e2 = t3.shaderSource; return this.context.programInfo.hasMain || (e2 = `${e2} ${(0, a.getDefaultFragShaderMain)(this.context.glContext.version, this.context.outputTextureLayout.shape.length)}`), e2 = (0, i2.replaceInlines)(e2), `${(0, a.getFragShaderPreamble)(this.context.glContext.version)} - ${this.getUniforms(t2.inputNames, t2.variables)} + ${this.getUniforms(t3.inputNames, t3.variables)} ${this.getImports(e2)} ${e2}`; } - getImports(t2) { - const e2 = this.selectGlslLibRoutinesToBeIncluded(t2); + getImports(t3) { + const e2 = this.selectGlslLibRoutinesToBeIncluded(t3); if (0 === e2.length) return ""; let n2 = ""; - for (let t3 = 0; t3 < e2.length; ++t3) { - if (!e2[t3].routineBody) - throw new Error(`Missing body for the Glsl Library routine: ${e2[t3].name}`); - n2 += e2[t3].routineBody + "\n"; + for (let t4 = 0; t4 < e2.length; ++t4) { + if (!e2[t4].routineBody) + throw new Error(`Missing body for the Glsl Library routine: ${e2[t4].name}`); + n2 += e2[t4].routineBody + "\n"; } return n2; } - selectGlslLibRoutinesToBeIncluded(t2) { + selectGlslLibRoutinesToBeIncluded(t3) { const e2 = []; return Object.keys(this.glslLibRoutineDependencyGraph).forEach((n2) => { const r2 = n2.split(".")[1]; - -1 !== t2.indexOf(r2) && e2.push(this.glslLibRoutineDependencyGraph[n2]); + -1 !== t3.indexOf(r2) && e2.push(this.glslLibRoutineDependencyGraph[n2]); }), r.TopologicalSortGlslRoutines.returnOrderedNodes(e2); } - getUniforms(t2, e2) { + getUniforms(t3, e2) { const n2 = []; - if (t2) - for (const e3 of t2) + if (t3) + for (const e3 of t3) n2.push(`uniform sampler2D ${e3};`); if (e2) - for (const t3 of e2) - n2.push(`uniform ${t3.type} ${t3.name}${t3.arrayLength ? `[${t3.arrayLength}]` : ""};`); + for (const t4 of e2) + n2.push(`uniform ${t4.type} ${t4.name}${t4.arrayLength ? `[${t4.arrayLength}]` : ""};`); return n2.join("\n"); } }; - }, 5483: (t, e, n) => { + }, 5483: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.glslRegistry = void 0; const r = n(5107), i2 = n(7341), o = n(9894), a = n(2655), s = n(3891); e.glslRegistry = { encoding: i2.EncodingGlslLib, fragcolor: o.FragColorGlslLib, vec: s.VecGlslLib, shapeUtils: a.ShapeUtilsGlslLib, coordinates: r.CoordsGlslLib }; - }, 2655: (t, e, n) => { + }, 2655: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.ShapeUtilsGlslLib = void 0; const r = n(8520); class i2 extends r.GlslLib { - constructor(t2) { - super(t2); + constructor(t3) { + super(t3); } getFunctions() { return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.bcastIndex()), this.bcastMatmulIndex()), this.offsetToIndices()), this.indicesToOffset()), this.incrementIndices()); @@ -7409,18 +8094,18 @@ var require_ort_web_node = __commonJS({ return {}; } bcastIndex() { - const t2 = this.context.outputTextureLayout.shape.length, e2 = {}; + const t3 = this.context.outputTextureLayout.shape.length, e2 = {}; return this.context.programInfo.inputNames.forEach((n2, i3) => { const o = this.context.inputTextureLayouts[i3].unpackedShape; - if (o.length <= t2) { - const i4 = o.length, a = t2 - i4, s = `bcastIndices_${n2}`; + if (o.length <= t3) { + const i4 = o.length, a = t3 - i4, s = `bcastIndices_${n2}`; let u = ""; - for (let t3 = 0; t3 < i4; ++t3) + for (let t4 = 0; t4 < i4; ++t4) u += ` - realIndices[${t3}] = int( mod(float(bcastedIndices[${a + t3}]), ${o[t3]}.0) ); + realIndices[${t4}] = int( mod(float(bcastedIndices[${a + t4}]), ${o[t4]}.0) ); `; const c = ` - void ${s} (int bcastedIndices[${t2}], out int realIndices[${i4}]) { + void ${s} (int bcastedIndices[${t3}], out int realIndices[${i4}]) { ${u} } `; @@ -7429,21 +8114,21 @@ var require_ort_web_node = __commonJS({ }), e2; } bcastMatmulIndex() { - const t2 = this.context.outputTextureLayout.shape.length, e2 = {}; + const t3 = this.context.outputTextureLayout.shape.length, e2 = {}; return this.context.programInfo.inputNames.forEach((n2, i3) => { const o = this.context.inputTextureLayouts[i3].shape; - if (!(o.length < 2 || o.length > t2)) { - const i4 = o.length, a = t2 - i4, s = `bcastMatmulIndices_${n2}`; + if (!(o.length < 2 || o.length > t3)) { + const i4 = o.length, a = t3 - i4, s = `bcastMatmulIndices_${n2}`; let u = ""; - for (let t3 = 0; t3 < i4 - 2; ++t3) + for (let t4 = 0; t4 < i4 - 2; ++t4) u += ` - realIndices[${t3}] = int( mod(float(bcastedIndices[${a + t3}]), ${o[t3]}.0) ); + realIndices[${t4}] = int( mod(float(bcastedIndices[${a + t4}]), ${o[t4]}.0) ); `; const c = ` - void ${s}(int bcastedIndices[${t2}], out int realIndices[${i4}]) { + void ${s}(int bcastedIndices[${t3}], out int realIndices[${i4}]) { ${u} - realIndices[${i4 - 1}] = bcastedIndices[${t2 - 1}]; - realIndices[${i4 - 2}] = bcastedIndices[${t2 - 2}]; + realIndices[${i4 - 1}] = bcastedIndices[${t3 - 1}]; + realIndices[${i4 - 2}] = bcastedIndices[${t3 - 2}]; } `; e2[s] = new r.GlslLibRoutine(c); @@ -7451,21 +8136,21 @@ var require_ort_web_node = __commonJS({ }), e2; } indicesToOffset() { - const t2 = {}; + const t3 = {}; return this.context.programInfo.inputNames.forEach((e2, n2) => { const o = this.context.inputTextureLayouts[n2].shape, a = this.context.inputTextureLayouts[n2].strides, s = o.length; let u = `indicesToOffset_${e2}`; - t2[u] = new r.GlslLibRoutine(i2.indexToOffsetSingle(u, s, a)), u = `indicesToOffset_${e2}_T`, t2[u] = new r.GlslLibRoutine(i2.indexToOffsetSingle(u, s, a.slice().reverse())); - }), t2; + t3[u] = new r.GlslLibRoutine(i2.indexToOffsetSingle(u, s, a)), u = `indicesToOffset_${e2}_T`, t3[u] = new r.GlslLibRoutine(i2.indexToOffsetSingle(u, s, a.slice().reverse())); + }), t3; } - static indexToOffsetSingle(t2, e2, n2) { + static indexToOffsetSingle(t3, e2, n2) { let r2 = ""; - for (let t3 = e2 - 1; t3 >= 0; --t3) + for (let t4 = e2 - 1; t4 >= 0; --t4) r2 += ` - offset += indices[${t3}] * ${n2[t3]}; + offset += indices[${t4}] * ${n2[t4]}; `; return ` - int ${t2}(int indices[${e2}]) { + int ${t3}(int indices[${e2}]) { int offset = 0; ${r2} return offset; @@ -7473,34 +8158,34 @@ var require_ort_web_node = __commonJS({ `; } offsetToIndices() { - const t2 = {}; + const t3 = {}; return this.context.programInfo.inputNames.forEach((e2, n2) => { const o = this.context.inputTextureLayouts[n2].shape, a = this.context.inputTextureLayouts[n2].strides, s = o.length; let u = `offsetToIndices_${e2}`; - t2[u] = new r.GlslLibRoutine(i2.offsetToIndicesSingle(u, s, a)), u = `offsetToIndices_${e2}_T`, t2[u] = new r.GlslLibRoutine(i2.offsetToIndicesSingle(u, s, a.slice().reverse())); - }), t2; + t3[u] = new r.GlslLibRoutine(i2.offsetToIndicesSingle(u, s, a)), u = `offsetToIndices_${e2}_T`, t3[u] = new r.GlslLibRoutine(i2.offsetToIndicesSingle(u, s, a.slice().reverse())); + }), t3; } - static offsetToIndicesSingle(t2, e2, n2) { + static offsetToIndicesSingle(t3, e2, n2) { const r2 = []; - for (let t3 = 0; t3 < e2 - 1; ++t3) + for (let t4 = 0; t4 < e2 - 1; ++t4) r2.push(` - indices[${t3}] = offset / ${n2[t3]};`), r2.push(` - offset -= indices[${t3}] * ${n2[t3]};`); + indices[${t4}] = offset / ${n2[t4]};`), r2.push(` + offset -= indices[${t4}] * ${n2[t4]};`); return r2.push(` indices[${e2 - 1}] = offset;`), ` - void ${t2}(int offset, out int indices[${e2}]) { + void ${t3}(int offset, out int indices[${e2}]) { ${r2.join("")} } `; } incrementIndices() { - const t2 = {}; + const t3 = {}; return this.context.programInfo.inputNames.forEach((e2, n2) => { const i3 = this.context.inputTextureLayouts[n2].shape, o = i3.length, a = `incrementIndices_${e2}`; let s = ""; - for (let t3 = 0; t3 < o; ++t3) + for (let t4 = 0; t4 < o; ++t4) s += ` - shape[${t3}] = ${i3[t3]};`; + shape[${t4}] = ${i3[t4]};`; const u = ` void ${a}(int axis, out int indices[${o}]) { int shape[${o}]; @@ -7515,20 +8200,20 @@ var require_ort_web_node = __commonJS({ } } `; - t2[a] = new r.GlslLibRoutine(u); - }), t2; + t3[a] = new r.GlslLibRoutine(u); + }), t3; } } e.ShapeUtilsGlslLib = i2; - }, 5060: (t, e) => { + }, 5060: (t2, e) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.getDefaultFragShaderMain = e.getFragShaderPreamble = e.getVertexShaderSource = e.getGlsl = void 0; const n = { version: "", attribute: "attribute", varyingVertex: "varying", varyingFrag: "varying", texture2D: "texture2D", output: "gl_FragColor", outputDeclaration: "" }, r = { version: "#version 300 es", attribute: "in", varyingVertex: "out", varyingFrag: "in", texture2D: "texture", output: "outputColor", outputDeclaration: "out vec4 outputColor;" }; - function i2(t2) { - return 1 === t2 ? n : r; + function i2(t3) { + return 1 === t3 ? n : r; } - e.getGlsl = i2, e.getVertexShaderSource = function(t2) { - const e2 = i2(t2); + e.getGlsl = i2, e.getVertexShaderSource = function(t3) { + const e2 = i2(t3); return `${e2.version} precision highp float; ${e2.attribute} vec3 position; @@ -7541,8 +8226,8 @@ var require_ort_web_node = __commonJS({ gl_Position = vec4(position, 1.0); TexCoords = textureCoord; }`; - }, e.getFragShaderPreamble = function(t2) { - const e2 = i2(t2); + }, e.getFragShaderPreamble = function(t3) { + const e2 = i2(t3); return `${e2.version} precision highp float; precision highp int; @@ -7576,23 +8261,23 @@ var require_ort_web_node = __commonJS({ } `; - }, e.getDefaultFragShaderMain = function(t2, e2) { + }, e.getDefaultFragShaderMain = function(t3, e2) { return ` void main() { int indices[${e2}]; toVec(TexCoords, indices); vec4 result = vec4(process(indices)); - ${i2(t2).output} = result; + ${i2(t3).output} = result; } `; }; - }, 3891: (t, e, n) => { + }, 3891: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.VecGlslLib = void 0; const r = n(8520); class i2 extends r.GlslLib { - constructor(t2) { - super(t2); + constructor(t3) { + super(t3); } getCustomTypes() { return {}; @@ -7601,16 +8286,16 @@ var require_ort_web_node = __commonJS({ return Object.assign(Object.assign(Object.assign(Object.assign({}, this.binaryVecFunctions()), this.copyVec()), this.setVecItem()), this.getVecItem()); } binaryVecFunctions() { - const t2 = this.context.outputTextureLayout.shape.length, e2 = { add: "+=", sub: "-=", mul: "*=", div: "/=" }, n2 = {}; + const t3 = this.context.outputTextureLayout.shape.length, e2 = { add: "+=", sub: "-=", mul: "*=", div: "/=" }, n2 = {}; for (const i3 in e2) { const o = `${i3}Vec`; let a = ""; - for (let n3 = 0; n3 < t2; ++n3) + for (let n3 = 0; n3 < t3; ++n3) a += ` dest[${n3}] ${e2[i3]} src[${n3}]; `; const s = ` - void ${o}(int src[${t2}], out int dest[${t2}]) { + void ${o}(int src[${t3}], out int dest[${t3}]) { ${a} } `; @@ -7619,62 +8304,62 @@ var require_ort_web_node = __commonJS({ return n2; } copyVec() { - const t2 = this.context.outputTextureLayout.shape.length; + const t3 = this.context.outputTextureLayout.shape.length; let e2 = ""; - for (let n3 = 0; n3 < t2; ++n3) + for (let n3 = 0; n3 < t3; ++n3) e2 += ` dest[${n3}] = src[${n3}]; `; const n2 = ` - void copyVec(int src[${t2}], out int dest[${t2}]) { + void copyVec(int src[${t3}], out int dest[${t3}]) { ${e2} } `; return { copyVec: new r.GlslLibRoutine(n2) }; } setVecItem() { - const t2 = this.context.outputTextureLayout.shape.length; + const t3 = this.context.outputTextureLayout.shape.length; let e2 = ` if(index < 0) - index =${t2} + index; + index =${t3} + index; if (index == 0) m[0] = value; `; - for (let n3 = 1; n3 < t2 - 1; ++n3) + for (let n3 = 1; n3 < t3 - 1; ++n3) e2 += ` else if (index == ${n3}) m[${n3}] = value; `; e2 += ` else - m[${t2 - 1}] = value; + m[${t3 - 1}] = value; `; const n2 = ` - void setVecItem(out int m[${t2}], int index, int value) { + void setVecItem(out int m[${t3}], int index, int value) { ${e2} } `; return { setVecItem: new r.GlslLibRoutine(n2) }; } getVecItem() { - const t2 = this.context.outputTextureLayout.shape.length; + const t3 = this.context.outputTextureLayout.shape.length; let e2 = ` if(index < 0) - index = ${t2} + index; + index = ${t3} + index; if (index == 0) return m[0]; `; - for (let n3 = 1; n3 < t2 - 1; ++n3) + for (let n3 = 1; n3 < t3 - 1; ++n3) e2 += ` else if (index == ${n3}) return m[${n3}]; `; e2 += ` else - return m[${t2 - 1}]; + return m[${t3 - 1}]; `; const n2 = ` - int getVecItem(int m[${t2}], int index) { + int getVecItem(int m[${t3}], int index) { ${e2} } `; @@ -7682,165 +8367,165 @@ var require_ort_web_node = __commonJS({ } } e.VecGlslLib = i2; - }, 8316: (t, e, n) => { + }, 8316: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.WebGLInferenceHandler = void 0; const r = n(3694), i2 = n(9162), o = n(2517), a = n(2403), s = n(7019), u = n(8710), c = n(5611), l = n(4057), p = n(2039); e.WebGLInferenceHandler = class { - constructor(t2) { - this.session = t2, this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); + constructor(t3) { + this.session = t3, this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); } - calculateTextureWidthAndHeight(t2, e2) { - return (0, l.calculateTextureWidthAndHeight)(this.session.layoutStrategy, t2, e2); + calculateTextureWidthAndHeight(t3, e2) { + return (0, l.calculateTextureWidthAndHeight)(this.session.layoutStrategy, t3, e2); } - executeProgram(t2, e2) { - if (e2.length < t2.inputNames.length) - throw new Error(`Input size mustn't be less than ${t2.inputNames.length}.`); - if (t2.inputNames.length !== t2.inputTypes.length) + executeProgram(t3, e2) { + if (e2.length < t3.inputNames.length) + throw new Error(`Input size mustn't be less than ${t3.inputNames.length}.`); + if (t3.inputNames.length !== t3.inputTypes.length) throw new Error("input names size does not match input types"); const n2 = []; - for (let r3 = 0; r3 < t2.inputNames.length; ++r3) - n2[r3] = this.getOrCreateTextureData(e2[r3], t2.inputTypes[r3]); - const r2 = ((t3, e3) => { - const n3 = e3.map((t4) => `${t4.unpackedShape.join(",")};${t4.width}x${t4.height}`).join("_"); - let r3 = t3.name; - return t3.cacheHint && (r3 += "[" + t3.cacheHint + "]"), r3 += ":" + n3, r3; - })(t2, n2); + for (let r3 = 0; r3 < t3.inputNames.length; ++r3) + n2[r3] = this.getOrCreateTextureData(e2[r3], t3.inputTypes[r3]); + const r2 = ((t4, e3) => { + const n3 = e3.map((t5) => `${t5.unpackedShape.join(",")};${t5.width}x${t5.height}`).join("_"); + let r3 = t4.name; + return t4.cacheHint && (r3 += "[" + t4.cacheHint + "]"), r3 += ":" + n3, r3; + })(t3, n2); let i3 = this.session.programManager.getArtifact(r2); - const o2 = i3 ? i3.programInfo : "function" == typeof t2.get ? t2.get() : t2, a2 = (0, l.createTextureLayoutFromTextureType)(this.session.layoutStrategy, o2.output.dims, o2.output.textureType), s2 = this.createTextureData(a2, o2.output.type); + const o2 = i3 ? i3.programInfo : "function" == typeof t3.get ? t3.get() : t3, a2 = (0, l.createTextureLayoutFromTextureType)(this.session.layoutStrategy, o2.output.dims, o2.output.textureType), s2 = this.createTextureData(a2, o2.output.type); return i3 || (i3 = this.session.programManager.build(o2, n2, s2), this.session.programManager.setArtifact(r2, i3)), this.runProgram(i3, n2, s2), s2; } - run(t2, e2) { - return this.executeProgram(t2, e2).tensor; + run(t3, e2) { + return this.executeProgram(t3, e2).tensor; } - runProgram(t2, e2, n2) { + runProgram(t3, e2, n2) { for (let n3 = 0; n3 < e2.length; ++n3) - if (!!e2[n3].isPacked != (t2.programInfo.inputTypes[n3] === p.TextureType.packed)) + if (!!e2[n3].isPacked != (t3.programInfo.inputTypes[n3] === p.TextureType.packed)) throw new Error(`input[${n3}] property packed inconsistent`); - if (!!n2.isPacked != (t2.programInfo.output.textureType === p.TextureType.packed)) + if (!!n2.isPacked != (t3.programInfo.output.textureType === p.TextureType.packed)) throw new Error("output property packed inconsistent"); - this.session.programManager.run(t2, e2, n2); + this.session.programManager.run(t3, e2, n2); } - getOrCreateTextureData(t2, e2) { - let n2 = this.getTextureData(t2.dataId, e2 === p.TextureType.packed); - if (!n2 && (n2 = this.getTextureData(t2.dataId, e2 !== p.TextureType.packed), n2)) + getOrCreateTextureData(t3, e2) { + let n2 = this.getTextureData(t3.dataId, e2 === p.TextureType.packed); + if (!n2 && (n2 = this.getTextureData(t3.dataId, e2 !== p.TextureType.packed), n2)) return e2 === p.TextureType.packed ? this.pack(n2) : this.unpack(n2); if (!n2) { - const r2 = (0, l.createTextureLayoutFromTextureType)(this.session.layoutStrategy, t2.dims, e2); + const r2 = (0, l.createTextureLayoutFromTextureType)(this.session.layoutStrategy, t3.dims, e2); if (e2 === p.TextureType.packedLastDimension) { - const n3 = 1, r3 = 4, i3 = t2.dims; + const n3 = 1, r3 = 4, i3 = t3.dims; if (4 === i3.length) { const o2 = [i3[0], Math.ceil(i3[1] * i3[2] * i3[3] / r3)], a2 = (0, l.createTextureLayoutFromTextureType)(this.session.layoutStrategy, o2, e2); - let s2 = t2.numberData; + let s2 = t3.numberData; if (i3[1] * i3[2] * i3[3] % r3 != 0) { const e3 = i3[0], o3 = i3[1] * i3[2] * i3[3], a3 = Math.ceil(o3 * n3 / r3) * r3; s2 = new Float32Array(e3 * a3); for (let r4 = 0; r4 < e3; ++r4) { const e4 = r4 * o3, i4 = r4 * a3 + r4 % n3 * o3; - s2.set(t2.numberData.subarray(e4, e4 + o3), i4); + s2.set(t3.numberData.subarray(e4, e4 + o3), i4); } } - return this.createTextureData(a2, t2.type, s2, t2, 1); + return this.createTextureData(a2, t3.type, s2, t3, 1); } } if (e2 === p.TextureType.packed) { - const e3 = (0, l.createTextureLayoutFromShape)(this.session.layoutStrategy, t2.dims, 1, [], { reverseWH: true }), r3 = this.createTextureData(e3, t2.type, t2.numberData, t2, 1); + const e3 = (0, l.createTextureLayoutFromShape)(this.session.layoutStrategy, t3.dims, 1, [], { reverseWH: true }), r3 = this.createTextureData(e3, t3.type, t3.numberData, t3, 1); n2 = this.pack(r3); } else - n2 = this.createTextureData(r2, t2.type, t2.numberData, t2, 1); + n2 = this.createTextureData(r2, t3.type, t3.numberData, t3, 1); } return n2; } - createTextureDataFromLayoutBindTensor(t2, e2, n2, r2) { - return this.createTextureData(t2, e2, n2, r2, 1); + createTextureDataFromLayoutBindTensor(t3, e2, n2, r2) { + return this.createTextureData(t3, e2, n2, r2, 1); } - createTextureData(t2, e2, n2, i3, o2) { - r.Logger.verbose("InferenceHandler", `Creating TextureData: layout:[${JSON.stringify(t2)}]`); - const a2 = this.session.textureManager.createTextureFromLayout(e2, t2, n2, o2); - return this.createTextureDataFromTexture(t2, e2, a2, i3); + createTextureData(t3, e2, n2, i3, o2) { + r.Logger.verbose("InferenceHandler", `Creating TextureData: layout:[${JSON.stringify(t3)}]`); + const a2 = this.session.textureManager.createTextureFromLayout(e2, t3, n2, o2); + return this.createTextureDataFromTexture(t3, e2, a2, i3); } - reshapeUnpacked(t2, e2) { - const n2 = this.getOrCreateTextureData(t2, p.TextureType.unpacked), r2 = { channels: n2.channels, height: n2.height, width: n2.width, shape: 0 !== e2.length ? e2 : [1], strides: o.ShapeUtil.computeStrides(e2), unpackedShape: e2 }; - return this.createTextureDataFromTexture(r2, t2.type, n2.texture).tensor; + reshapeUnpacked(t3, e2) { + const n2 = this.getOrCreateTextureData(t3, p.TextureType.unpacked), r2 = { channels: n2.channels, height: n2.height, width: n2.width, shape: 0 !== e2.length ? e2 : [1], strides: o.ShapeUtil.computeStrides(e2), unpackedShape: e2 }; + return this.createTextureDataFromTexture(r2, t3.type, n2.texture).tensor; } - reshapePacked(t2, e2) { - const n2 = this.getOrCreateTextureData(t2, p.TextureType.packed); - if ((0, s.isReshapeCheap)(t2.dims, e2)) { + reshapePacked(t3, e2) { + const n2 = this.getOrCreateTextureData(t3, p.TextureType.packed); + if ((0, s.isReshapeCheap)(t3.dims, e2)) { const r3 = { channels: n2.channels, height: n2.height, width: n2.width, shape: 0 !== e2.length ? e2 : [1], strides: o.ShapeUtil.computeStrides(e2), unpackedShape: e2, isPacked: true }; - return this.createTextureDataFromTexture(r3, t2.type, n2.texture).tensor; + return this.createTextureDataFromTexture(r3, t3.type, n2.texture).tensor; } - const r2 = (0, s.processDims3D)(t2.dims), i3 = (0, s.processDims3D)(e2), a2 = this.reshapePacked(t2, r2), u2 = this.run((0, s.createPackedReshape3DProgramInfoLoader)(this, a2, i3), [a2]); + const r2 = (0, s.processDims3D)(t3.dims), i3 = (0, s.processDims3D)(e2), a2 = this.reshapePacked(t3, r2), u2 = this.run((0, s.createPackedReshape3DProgramInfoLoader)(this, a2, i3), [a2]); return this.reshapePacked(u2, e2); } - cast(t2, e2) { - const n2 = this.getOrCreateTextureData(t2, p.TextureType.unpacked); + cast(t3, e2) { + const n2 = this.getOrCreateTextureData(t3, p.TextureType.unpacked); return this.createTextureDataFromTexture(n2, e2, n2.texture).tensor; } - createTextureDataFromTexture(t2, e2, n2, r2, o2) { - const a2 = Object.assign(Object.assign({}, t2), { tensor: r2 || new i2.Tensor(t2.unpackedShape, e2, (t3) => this.readTexture(a2), async (t3) => this.readTextureAsync(a2), void 0, o2), texture: n2 }); - return this.setTextureData(a2.tensor.dataId, a2, t2.isPacked), a2; + createTextureDataFromTexture(t3, e2, n2, r2, o2) { + const a2 = Object.assign(Object.assign({}, t3), { tensor: r2 || new i2.Tensor(t3.unpackedShape, e2, (t4) => this.readTexture(a2), async (t4) => this.readTextureAsync(a2), void 0, o2), texture: n2 }); + return this.setTextureData(a2.tensor.dataId, a2, t3.isPacked), a2; } - getTextureData(t2, e2 = false) { - return this.session.isInitializer(t2) ? this.session.getTextureData(t2, e2) : e2 ? this.packedTextureDataCache.get(t2) : this.unpackedTextureDataCache.get(t2); + getTextureData(t3, e2 = false) { + return this.session.isInitializer(t3) ? this.session.getTextureData(t3, e2) : e2 ? this.packedTextureDataCache.get(t3) : this.unpackedTextureDataCache.get(t3); } - setTextureData(t2, e2, n2 = false) { - this.session.isInitializer(t2) ? this.session.setTextureData(t2, e2, n2) : (n2 ? this.packedTextureDataCache : this.unpackedTextureDataCache).set(t2, e2); + setTextureData(t3, e2, n2 = false) { + this.session.isInitializer(t3) ? this.session.setTextureData(t3, e2, n2) : (n2 ? this.packedTextureDataCache : this.unpackedTextureDataCache).set(t3, e2); } - isTextureLayoutCached(t2, e2 = false) { - return !!this.getTextureData(t2.dataId, e2); + isTextureLayoutCached(t3, e2 = false) { + return !!this.getTextureData(t3.dataId, e2); } dispose() { - this.session.textureManager.clearActiveTextures(), this.packedTextureDataCache.forEach((t2) => this.session.textureManager.releaseTexture(t2)), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache.forEach((t2) => this.session.textureManager.releaseTexture(t2)), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); + this.session.textureManager.clearActiveTextures(), this.packedTextureDataCache.forEach((t3) => this.session.textureManager.releaseTexture(t3)), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache.forEach((t3) => this.session.textureManager.releaseTexture(t3)), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); } - readTexture(t2) { - return t2.isPacked ? this.readTexture(this.unpack(t2)) : this.session.backend.glContext.isFloat32DownloadSupported ? this.session.textureManager.readTexture(t2, t2.tensor.type, t2.channels) : this.session.textureManager.readUint8TextureAsFloat((0, u.encodeAsUint8)(this, t2)); + readTexture(t3) { + return t3.isPacked ? this.readTexture(this.unpack(t3)) : this.session.backend.glContext.isFloat32DownloadSupported ? this.session.textureManager.readTexture(t3, t3.tensor.type, t3.channels) : this.session.textureManager.readUint8TextureAsFloat((0, u.encodeAsUint8)(this, t3)); } - async readTextureAsync(t2) { - return t2.isPacked ? this.readTextureAsync(this.unpack(t2)) : this.session.backend.glContext.isFloat32DownloadSupported ? this.session.textureManager.readTextureAsync(t2, t2.tensor.type, t2.channels) : this.session.textureManager.readUint8TextureAsFloat((0, u.encodeAsUint8)(this, t2)); + async readTextureAsync(t3) { + return t3.isPacked ? this.readTextureAsync(this.unpack(t3)) : this.session.backend.glContext.isFloat32DownloadSupported ? this.session.textureManager.readTextureAsync(t3, t3.tensor.type, t3.channels) : this.session.textureManager.readUint8TextureAsFloat((0, u.encodeAsUint8)(this, t3)); } - pack(t2) { - return this.executeProgram((0, a.createPackProgramInfoLoader)(this, t2.tensor), [t2.tensor]); + pack(t3) { + return this.executeProgram((0, a.createPackProgramInfoLoader)(this, t3.tensor), [t3.tensor]); } - unpack(t2) { - return this.executeProgram((0, c.createUnpackProgramInfoLoader)(this, t2.tensor), [t2.tensor]); + unpack(t3) { + return this.executeProgram((0, c.createUnpackProgramInfoLoader)(this, t3.tensor), [t3.tensor]); } }; - }, 1640: function(t, e, n) { + }, 1640: function(t2, e, n) { "use strict"; - var r = this && this.__createBinding || (Object.create ? function(t2, e2, n2, r2) { + var r = this && this.__createBinding || (Object.create ? function(t3, e2, n2, r2) { void 0 === r2 && (r2 = n2); var i3 = Object.getOwnPropertyDescriptor(e2, n2); i3 && !("get" in i3 ? !e2.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return e2[n2]; - } }), Object.defineProperty(t2, r2, i3); - } : function(t2, e2, n2, r2) { - void 0 === r2 && (r2 = n2), t2[r2] = e2[n2]; - }), i2 = this && this.__setModuleDefault || (Object.create ? function(t2, e2) { - Object.defineProperty(t2, "default", { enumerable: true, value: e2 }); - } : function(t2, e2) { - t2.default = e2; - }), o = this && this.__importStar || function(t2) { - if (t2 && t2.__esModule) - return t2; + } }), Object.defineProperty(t3, r2, i3); + } : function(t3, e2, n2, r2) { + void 0 === r2 && (r2 = n2), t3[r2] = e2[n2]; + }), i2 = this && this.__setModuleDefault || (Object.create ? function(t3, e2) { + Object.defineProperty(t3, "default", { enumerable: true, value: e2 }); + } : function(t3, e2) { + t3.default = e2; + }), o = this && this.__importStar || function(t3) { + if (t3 && t3.__esModule) + return t3; var e2 = {}; - if (null != t2) - for (var n2 in t2) - "default" !== n2 && Object.prototype.hasOwnProperty.call(t2, n2) && r(e2, t2, n2); - return i2(e2, t2), e2; + if (null != t3) + for (var n2 in t3) + "default" !== n2 && Object.prototype.hasOwnProperty.call(t3, n2) && r(e2, t3, n2); + return i2(e2, t3), e2; }; Object.defineProperty(e, "__esModule", { value: true }), e.WEBGL_OP_RESOLVE_RULES = void 0; const a = n(2898), s = o(n(7839)), u = n(4196), c = n(2069), l = n(8138), p = n(9663), f = n(5193), d = n(7992), h = n(1253), g = n(4776), b = n(6572), m = n(3346), y = n(5623), _ = n(2870), v = n(2143), w = n(4939), x = n(718), T = n(2268), S = n(8117), O = n(2278), A = n(5524), E = n(5975), I = n(3933), P = n(6558), D = n(5723), $ = n(3738), k = o(n(4909)), C = n(8428), F = n(9793); e.WEBGL_OP_RESOLVE_RULES = [["Abs", "", "6+", k.abs], ["Acos", "", "7+", k.acos], ["Add", "", "7+", s.add], ["And", "", "7+", s.and], ["Asin", "", "7+", k.asin], ["Atan", "", "7+", k.atan], ["AveragePool", "", "7+", v.averagePool, v.parseAveragePoolAttributes], ["BatchNormalization", "", "7+", a.batchNormalization, a.parseBatchNormalizationAttributes], ["Cast", "", "6+", u.cast, u.parseCastAttributes], ["Ceil", "", "6+", k.ceil], ["Clip", "", "6-10", k.clip, k.parseClipAttributes], ["Clip", "", "11+", k.clipV11], ["Concat", "", "4+", c.concat, c.parseConcatAttributes], ["Conv", "", "1+", l.conv, l.parseConvAttributes], ["ConvTranspose", "", "1+", p.convTranspose, p.parseConvTransposeAttributes], ["Cos", "", "7+", k.cos], ["Div", "", "7+", s.div], ["Dropout", "", "7+", k.identity], ["DepthToSpace", "", "1+", f.depthToSpace, f.parseDepthToSpaceAttributes], ["Equal", "", "7+", s.equal], ["Elu", "", "6+", k.elu, k.parseEluAttributes], ["Exp", "", "6+", k.exp], ["Flatten", "", "1+", d.flatten, d.parseFlattenAttributes], ["Floor", "", "6+", k.floor], ["FusedConv", "com.microsoft", "1+", l.conv, l.parseConvAttributes], ["Gather", "", "1+", h.gather, h.parseGatherAttributes], ["Gemm", "", "7-10", g.gemm, g.parseGemmAttributesV7], ["Gemm", "", "11+", g.gemm, g.parseGemmAttributesV11], ["GlobalAveragePool", "", "1+", v.globalAveragePool, v.parseGlobalAveragePoolAttributes], ["GlobalMaxPool", "", "1+", v.globalMaxPool], ["Greater", "", "7+", s.greater], ["Identity", "", "1+", k.identity], ["ImageScaler", "", "1+", b.imageScaler, b.parseImageScalerAttributes], ["InstanceNormalization", "", "6+", m.instanceNormalization, m.parseInstanceNormalizationAttributes], ["LeakyRelu", "", "6+", k.leakyRelu, k.parseLeakyReluAttributes], ["Less", "", "7+", s.less], ["Log", "", "6+", k.log], ["MatMul", "", "1+", y.matMul, y.parseMatMulAttributes], ["MaxPool", "", "1+", v.maxPool, v.parseMaxPoolAttributes], ["Mul", "", "7+", s.mul], ["Neg", "", "6+", k.neg], ["Not", "", "1+", k.not], ["Or", "", "7+", s.or], ["Pad", "", "2-10", _.padV2, _.parsePadAttributesV2], ["Pad", "", "11+", _.padV11, _.parsePadAttributesV11], ["Pow", "", "7+", s.pow], ["PRelu", "", "7+", s.pRelu], ["ReduceLogSum", "", "1+", w.reduceLogSum, w.parseReduceAttributes], ["ReduceMax", "", "1+", w.reduceMax, w.parseReduceAttributes], ["ReduceMean", "", "1+", w.reduceMean, w.parseReduceAttributes], ["ReduceMin", "", "1+", w.reduceMin, w.parseReduceAttributes], ["ReduceProd", "", "1+", w.reduceProd, w.parseReduceAttributes], ["ReduceSum", "", "1-12", w.reduceSum, w.parseReduceAttributes], ["ReduceSumSquare", "", "1+", w.reduceLogSumSquare, w.parseReduceAttributes], ["Relu", "", "6+", k.relu], ["Reshape", "", "5+", x.reshape], ["Resize", "", "10", T.resize, T.parseResizeAttributesV10], ["Resize", "", "11+", T.resize, T.parseResizeAttributesV11], ["Shape", "", "1+", S.shape], ["Sigmoid", "", "6+", k.sigmoid], ["Sin", "", "7+", k.sin], ["Slice", "", "10+", O.sliceV10], ["Slice", "", "1-9", O.slice, O.parseSliceAttributes], ["Softmax", "", "1-12", A.softmax, A.parseSoftmaxAttributes], ["Softmax", "", "13+", A.softmaxV13, A.parseSoftmaxAttributesV13], ["Split", "", "2-12", E.split, E.parseSplitAttributes], ["Sqrt", "", "6+", k.sqrt], ["Squeeze", "", "1-12", I.squeeze, I.parseSqueezeAttributes], ["Squeeze", "", "13+", I.squeezeV13], ["Sub", "", "7+", s.sub], ["Sum", "", "6+", P.sum], ["Tan", "", "7+", k.tan], ["Tanh", "", "6+", k.tanh], ["Tile", "", "6+", D.tile], ["Transpose", "", "1+", $.transpose, $.parseTransposeAttributes], ["Upsample", "", "7-8", F.upsample, F.parseUpsampleAttributesV7], ["Upsample", "", "9", F.upsample, F.parseUpsampleAttributesV9], ["Unsqueeze", "", "1-12", C.unsqueeze, C.parseUnsqueezeAttributes], ["Unsqueeze", "", "13+", C.unsqueezeV13], ["Xor", "", "7+", s.xor]]; - }, 2898: (t, e, n) => { + }, 2898: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseBatchNormalizationAttributes = e.batchNormalization = void 0; const r = n(246), i2 = n(5060), o = n(2039), a = { name: "BatchNormalization", inputNames: ["A", "Scale", "B", "Mean", "Variance"], inputTypes: [o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked] }; - e.batchNormalization = (t2, e2, n2) => (u(e2), [t2.run(Object.assign(Object.assign({}, a), { cacheHint: n2.cacheKey, get: () => s(t2, e2, n2) }), e2)]), e.parseBatchNormalizationAttributes = (t2) => { - const e2 = t2.attributes.getFloat("epsilon", 1e-5), n2 = t2.attributes.getFloat("momentum", 0.9), i3 = t2.attributes.getInt("spatial", 1); + e.batchNormalization = (t3, e2, n2) => (u(e2), [t3.run(Object.assign(Object.assign({}, a), { cacheHint: n2.cacheKey, get: () => s(t3, e2, n2) }), e2)]), e.parseBatchNormalizationAttributes = (t3) => { + const e2 = t3.attributes.getFloat("epsilon", 1e-5), n2 = t3.attributes.getFloat("momentum", 0.9), i3 = t3.attributes.getInt("spatial", 1); return (0, r.createAttributeWithCacheKey)({ epsilon: e2, momentum: n2, spatial: i3 }); }; - const s = (t2, e2, n2) => { - const r2 = (0, i2.getGlsl)(t2.session.backend.glContext.version), s2 = e2[0].dims.length, [u2, c] = t2.calculateTextureWidthAndHeight(e2[1].dims, o.TextureType.unpacked), l = ` + const s = (t3, e2, n2) => { + const r2 = (0, i2.getGlsl)(t3.session.backend.glContext.version), s2 = e2[0].dims.length, [u2, c] = t3.calculateTextureWidthAndHeight(e2[1].dims, o.TextureType.unpacked), l = ` float process(int[${s2}] indices) { vec2 position = offsetToCoords(indices[1], ${u2}, ${c}); float scale = getColorAsFloat(${r2.texture2D}(Scale, position)); @@ -7851,10 +8536,10 @@ var require_ort_web_node = __commonJS({ return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n2.epsilon})) ) + b; }`; return Object.assign(Object.assign({}, a), { output: { dims: e2[0].dims, type: e2[0].type, textureType: o.TextureType.unpacked }, shaderSource: l }); - }, u = (t2) => { - if (!t2 || 5 !== t2.length) + }, u = (t3) => { + if (!t3 || 5 !== t3.length) throw new Error("BatchNormalization requires 5 inputs."); - const e2 = t2[0], n2 = t2[1], r2 = t2[2], i3 = t2[3], o2 = t2[4]; + const e2 = t3[0], n2 = t3[1], r2 = t3[2], i3 = t3[3], o2 = t3[4]; if (e2.dims.length < 3 || 1 !== n2.dims.length || 1 !== r2.dims.length || 1 !== i3.dims.length || 1 !== o2.dims.length) throw new Error("invalid input shape."); if (n2.dims[0] !== e2.dims[1] || r2.dims[0] !== e2.dims[1] || i3.dims[0] !== e2.dims[1] || o2.dims[0] !== e2.dims[1]) @@ -7862,100 +8547,100 @@ var require_ort_web_node = __commonJS({ if ("float32" !== e2.type && "float64" !== e2.type || "float32" !== n2.type && "float64" !== n2.type || "float32" !== r2.type && "float64" !== r2.type || "float32" !== i3.type && "float64" !== i3.type || "float32" !== o2.type && "float64" !== o2.type) throw new Error("invalid input tensor types."); }; - }, 7839: (t, e, n) => { + }, 7839: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.xor = e.sub = e.pRelu = e.pow = e.or = e.mul = e.less = e.greater = e.equal = e.div = e.and = e.add = e.glslPRelu = e.glslPow = e.glslXor = e.glslOr = e.glslAnd = e.glslLess = e.glslGreater = e.glslEqual = e.glslSub = e.glslMul = e.glslDiv = e.glslAdd = void 0; const r = n(2517), i2 = n(8520), o = n(5060), a = n(2039); function s() { - const t2 = "add_"; + const t3 = "add_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return a + b; } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return v1 + v2; } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function u() { - const t2 = "div_"; + const t3 = "div_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return a / b; } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return v1 / v2; } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function c() { - const t2 = "mul_"; + const t3 = "mul_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return a * b; } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return v1 * v2; } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function l() { - const t2 = "sub_"; + const t3 = "sub_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return a - b; } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return v1 - v2; } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function p() { - const t2 = "equal_"; + const t3 = "equal_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float(a == b); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return vec4(equal(v1, v2)); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function f() { - const t2 = "greater_"; + const t3 = "greater_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float(a > b); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return vec4( v1.r > v2.r , v1.g > v2.g, v1.b > v2.b, v1.a > v2.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function d() { - const t2 = "less_"; + const t3 = "less_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float(a < b); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return vec4( v1.r < v2.r , v1.g < v2.g, v1.b < v2.b, v1.a < v2.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function h() { - const t2 = "and_"; + const t3 = "and_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float( bool(a) && bool(b) ); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r && b2.r , @@ -7963,15 +8648,15 @@ var require_ort_web_node = __commonJS({ b1.b && b2.b, b1.a && b2.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function g() { - const t2 = "or_"; + const t3 = "or_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float( bool(a) || bool(b) ); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r || b2.r , @@ -7979,15 +8664,15 @@ var require_ort_web_node = __commonJS({ b1.b || b2.b, b1.a || b2.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function b() { - const t2 = "xor_"; + const t3 = "xor_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return float( bool(a) ^^ bool(b) ); } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r ^^ b2.r , @@ -7995,28 +8680,28 @@ var require_ort_web_node = __commonJS({ b1.b ^^ b2.b, b1.a ^^ b2.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } function m() { - return function(t2) { - const e2 = `${t2}_`; + return function(t3) { + const e2 = `${t3}_`; return { body: ` float ${e2}(float a, float b) { - return ${t2}(a, b); + return ${t3}(a, b); } vec4 ${e2}(vec4 v1, vec4 v2) { - return ${t2}(v1, v2); + return ${t3}(v1, v2); } `, name: e2, type: i2.FunctionType.ValueBased }; }("pow"); } function y() { - const t2 = "prelu_"; + const t3 = "prelu_"; return { body: ` - float ${t2}(float a, float b) { + float ${t3}(float a, float b) { return a < 0.0 ? a * b: a; } - vec4 ${t2}(vec4 v1, vec4 v2) { + vec4 ${t3}(vec4 v1, vec4 v2) { return vec4( v1.r < 0.0 ? v1.r * v2.r: v1.r, v1.g < 0.0 ? v1.g * v2.g: v1.g, @@ -8024,22 +8709,22 @@ var require_ort_web_node = __commonJS({ v1.a < 0.0 ? v1.a * v2.a: v1.a ); } - `, name: t2, type: i2.FunctionType.ValueBased }; + `, name: t3, type: i2.FunctionType.ValueBased }; } e.glslAdd = s, e.glslDiv = u, e.glslMul = c, e.glslSub = l, e.glslEqual = p, e.glslGreater = f, e.glslLess = d, e.glslAnd = h, e.glslOr = g, e.glslXor = b, e.glslPow = m, e.glslPRelu = y; - const _ = (t2, e2, n2, r2 = e2[0].type, i3) => { - const o2 = t2.session.pack ? a.TextureType.packed : a.TextureType.unpacked; - return { name: n2.name, inputNames: ["A", "B"], inputTypes: [o2, o2], cacheHint: i3, get: () => v(t2, e2, n2, r2) }; - }, v = (t2, e2, n2, i3 = e2[0].type) => { - const s2 = t2.session.pack ? a.TextureType.packed : a.TextureType.unpacked, u2 = !r.ShapeUtil.areEqual(e2[0].dims, e2[1].dims); + const _ = (t3, e2, n2, r2 = e2[0].type, i3) => { + const o2 = t3.session.pack ? a.TextureType.packed : a.TextureType.unpacked; + return { name: n2.name, inputNames: ["A", "B"], inputTypes: [o2, o2], cacheHint: i3, get: () => v(t3, e2, n2, r2) }; + }, v = (t3, e2, n2, i3 = e2[0].type) => { + const s2 = t3.session.pack ? a.TextureType.packed : a.TextureType.unpacked, u2 = !r.ShapeUtil.areEqual(e2[0].dims, e2[1].dims); let c2 = e2[0].dims; - const l2 = t2.session.pack; + const l2 = t3.session.pack; if (u2) { const a2 = r.BroadcastUtil.calcShape(e2[0].dims, e2[1].dims, false); if (!a2) throw new Error("Can't perform binary op on the given tensors"); c2 = a2; - const u3 = c2.length, p3 = 0 !== e2[0].dims.length ? e2[0].dims.length : 1, f3 = 0 !== e2[1].dims.length ? e2[1].dims.length : 1, d2 = 0 !== e2[0].dims.length ? "bcastIndices_A(indices, aindices);" : "aindices[0] = 0;", h2 = 0 !== e2[1].dims.length ? "bcastIndices_B(indices, bindices);" : "bindices[0] = 0;", g2 = (0, o.getGlsl)(t2.session.backend.glContext.version), b2 = l2 ? ` + const u3 = c2.length, p3 = 0 !== e2[0].dims.length ? e2[0].dims.length : 1, f3 = 0 !== e2[1].dims.length ? e2[1].dims.length : 1, d2 = 0 !== e2[0].dims.length ? "bcastIndices_A(indices, aindices);" : "aindices[0] = 0;", h2 = 0 !== e2[1].dims.length ? "bcastIndices_B(indices, bindices);" : "bindices[0] = 0;", g2 = (0, o.getGlsl)(t3.session.backend.glContext.version), b2 = l2 ? ` ${n2.body} void main() { vec4 a = getAAtOutCoords(); @@ -8057,7 +8742,7 @@ var require_ort_web_node = __commonJS({ }`; return { name: n2.name, inputNames: ["A", "B"], inputTypes: [s2, s2], output: { dims: c2, type: i3, textureType: s2 }, shaderSource: b2, hasMain: l2 }; } - const p2 = (0, o.getGlsl)(t2.session.backend.glContext.version), f2 = ` + const p2 = (0, o.getGlsl)(t3.session.backend.glContext.version), f2 = ` ${n2.body} void main() { vec4 v1 = ${p2.texture2D}(A, TexCoords); @@ -8068,54 +8753,54 @@ var require_ort_web_node = __commonJS({ `; return { name: n2.name, inputNames: ["A", "B"], inputTypes: [s2, s2], output: { dims: e2[0].dims, type: i3, textureType: s2 }, shaderSource: f2, hasMain: true }; }; - e.add = (t2, e2) => [t2.run(_(t2, e2, s()), e2)], e.and = (t2, e2) => [t2.run(_(t2, e2, h(), "bool"), e2)], e.div = (t2, e2) => [t2.run(_(t2, e2, u()), e2)], e.equal = (t2, e2) => [t2.run(_(t2, e2, p(), "bool"), e2)], e.greater = (t2, e2) => [t2.run(_(t2, e2, f(), "bool"), e2)], e.less = (t2, e2) => [t2.run(_(t2, e2, d(), "bool"), e2)], e.mul = (t2, e2) => [t2.run(_(t2, e2, c()), e2)], e.or = (t2, e2) => [t2.run(_(t2, e2, g(), "bool"), e2)], e.pow = (t2, e2) => [t2.run(_(t2, e2, m()), e2)], e.pRelu = (t2, e2) => [t2.run(_(t2, e2, y()), e2)], e.sub = (t2, e2) => [t2.run(_(t2, e2, l()), e2)], e.xor = (t2, e2) => [t2.run(_(t2, e2, b(), "bool"), e2)]; - }, 4196: (t, e, n) => { + e.add = (t3, e2) => [t3.run(_(t3, e2, s()), e2)], e.and = (t3, e2) => [t3.run(_(t3, e2, h(), "bool"), e2)], e.div = (t3, e2) => [t3.run(_(t3, e2, u()), e2)], e.equal = (t3, e2) => [t3.run(_(t3, e2, p(), "bool"), e2)], e.greater = (t3, e2) => [t3.run(_(t3, e2, f(), "bool"), e2)], e.less = (t3, e2) => [t3.run(_(t3, e2, d(), "bool"), e2)], e.mul = (t3, e2) => [t3.run(_(t3, e2, c()), e2)], e.or = (t3, e2) => [t3.run(_(t3, e2, g(), "bool"), e2)], e.pow = (t3, e2) => [t3.run(_(t3, e2, m()), e2)], e.pRelu = (t3, e2) => [t3.run(_(t3, e2, y()), e2)], e.sub = (t3, e2) => [t3.run(_(t3, e2, l()), e2)], e.xor = (t3, e2) => [t3.run(_(t3, e2, b(), "bool"), e2)]; + }, 4196: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseCastAttributes = e.cast = void 0; const r = n(2517); - e.cast = (t2, e2, n2) => (i2(e2), [t2.cast(e2[0], n2)]), e.parseCastAttributes = (t2) => r.ProtoUtil.tensorDataTypeFromProto(t2.attributes.getInt("to")); - const i2 = (t2) => { - if (!t2 || 1 !== t2.length) + e.cast = (t3, e2, n2) => (i2(e2), [t3.cast(e2[0], n2)]), e.parseCastAttributes = (t3) => r.ProtoUtil.tensorDataTypeFromProto(t3.attributes.getInt("to")); + const i2 = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Cast requires 1 input."); - if ("string" === t2[0].type) + if ("string" === t3[0].type) throw new Error("Invalid input type."); }; - }, 1163: (t, e, n) => { + }, 1163: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createPackedConcatProgramInfoLoader = void 0; const r = n(5060), i2 = n(2039), o = n(9390), a = n(2827); - e.createPackedConcatProgramInfoLoader = (t2, e2, n2) => { - const u = (c = e2.length, l = n2.cacheKey, { name: "Concat (packed)", inputNames: Array.from({ length: c }, (t3, e3) => `X${e3}`), inputTypes: Array(c).fill(i2.TextureType.packed), cacheHint: l }); + e.createPackedConcatProgramInfoLoader = (t3, e2, n2) => { + const u = (c = e2.length, l = n2.cacheKey, { name: "Concat (packed)", inputNames: Array.from({ length: c }, (t4, e3) => `X${e3}`), inputTypes: Array(c).fill(i2.TextureType.packed), cacheHint: l }); var c, l; - return Object.assign(Object.assign({}, u), { get: () => ((t3, e3, n3, u2) => { + return Object.assign(Object.assign({}, u), { get: () => ((t4, e3, n3, u2) => { const c2 = n3[0].dims.slice(); if (u2 >= c2.length || u2 < -1 * c2.length) throw new Error("axis specified for concat doesn't match input dimensionality"); u2 < 0 && (u2 = c2.length + u2); const l2 = c2.slice(0); - for (let t4 = 1; t4 < n3.length; t4++) { - const e4 = n3[t4].dims.slice(); - for (let t5 = 0; t5 < c2.length; t5++) - if (t5 === u2) - l2[u2] += e4[t5]; - else if (c2[t5] !== e4[t5]) + for (let t5 = 1; t5 < n3.length; t5++) { + const e4 = n3[t5].dims.slice(); + for (let t6 = 0; t6 < c2.length; t6++) + if (t6 === u2) + l2[u2] += e4[t6]; + else if (c2[t6] !== e4[t6]) throw new Error("non concat dimensions must match"); } - const p = l2.length, f = (0, a.getChannels)("coords", p), d = (0, o.getCoordsDataType)(p), h = (0, a.unpackFromChannel)(), g = n3.map((t4) => t4.dims), b = (0, o.getGlChannels)(p), m = new Array(g.length - 1); + const p = l2.length, f = (0, a.getChannels)("coords", p), d = (0, o.getCoordsDataType)(p), h = (0, a.unpackFromChannel)(), g = n3.map((t5) => t5.dims), b = (0, o.getGlChannels)(p), m = new Array(g.length - 1); m[0] = g[0][u2]; - for (let t4 = 1; t4 < m.length; t4++) - m[t4] = m[t4 - 1] + g[t4][u2]; + for (let t5 = 1; t5 < m.length; t5++) + m[t5] = m[t5 - 1] + g[t5][u2]; const y = b[u2], _ = b.slice(-2), v = b.join(); let w = `if (${y} < ${m[0]}) { return getChannel( getX0(${v}), vec2(${_.join()})); }`; - for (let t4 = 1; t4 < m.length; t4++) { - const e4 = m[t4 - 1]; + for (let t5 = 1; t5 < m.length; t5++) { + const e4 = m[t5 - 1]; w += ` - if (${y} < ${m[t4]} && ${y} >= ${m[t4 - 1]}) { + if (${y} < ${m[t5]} && ${y} >= ${m[t5 - 1]}) { return getChannel( - getX${t4}(${s(b, y, e4)}), + getX${t5}(${s(b, y, e4)}), vec2(${s(_, y, e4)})); }`; } @@ -8124,9 +8809,9 @@ var require_ort_web_node = __commonJS({ return getChannel( getX${x}(${s(b, y, T)}), vec2(${s(_, y, T)}));`; - const S = (0, r.getGlsl)(t3.session.backend.glContext.version), O = ` + const S = (0, r.getGlsl)(t4.session.backend.glContext.version), O = ` ${h} - float getValue(${b.map((t4) => "int " + t4)}) { + float getValue(${b.map((t5) => "int " + t5)}) { ${w} } @@ -8157,38 +8842,38 @@ var require_ort_web_node = __commonJS({ } `; return Object.assign(Object.assign({}, e3), { output: { dims: l2, type: n3[0].type, textureType: i2.TextureType.packed }, shaderSource: O, hasMain: true }); - })(t2, u, e2, n2.axis) }); + })(t3, u, e2, n2.axis) }); }; - const s = (t2, e2, n2) => { - const r2 = t2.indexOf(e2); - return t2.map((t3, e3) => e3 === r2 ? `${t3} - ${n2}` : t3).join(); + const s = (t3, e2, n2) => { + const r2 = t3.indexOf(e2); + return t3.map((t4, e3) => e3 === r2 ? `${t4} - ${n2}` : t4).join(); }; - }, 2069: (t, e, n) => { + }, 2069: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseConcatAttributes = e.concat = void 0; const r = n(246), i2 = n(2039), o = n(1163); - e.concat = (t2, e2, n2) => (p(e2), t2.session.pack && e2[0].dims.length > 1 ? [t2.run((0, o.createPackedConcatProgramInfoLoader)(t2, e2, n2), e2)] : [t2.run(a(t2, e2, n2), e2)]); - const a = (t2, e2, n2) => { - const r2 = (o2 = e2.length, a2 = n2.cacheKey, { name: "Concat", inputNames: Array.from({ length: o2 }, (t3, e3) => `X${e3}`), inputTypes: Array(o2).fill(i2.TextureType.unpacked), cacheHint: a2 }); + e.concat = (t3, e2, n2) => (p(e2), t3.session.pack && e2[0].dims.length > 1 ? [t3.run((0, o.createPackedConcatProgramInfoLoader)(t3, e2, n2), e2)] : [t3.run(a(t3, e2, n2), e2)]); + const a = (t3, e2, n2) => { + const r2 = (o2 = e2.length, a2 = n2.cacheKey, { name: "Concat", inputNames: Array.from({ length: o2 }, (t4, e3) => `X${e3}`), inputTypes: Array(o2).fill(i2.TextureType.unpacked), cacheHint: a2 }); var o2, a2; - return Object.assign(Object.assign({}, r2), { get: () => ((t3, e3, n3, r3) => { + return Object.assign(Object.assign({}, r2), { get: () => ((t4, e3, n3, r3) => { const o3 = n3[0].dims.slice(); if (r3 >= o3.length || r3 < -1 * o3.length) throw new Error("axis specified for concat doesn't match input dimensionality"); r3 < 0 && (r3 = o3.length + r3); const a3 = o3.slice(0); - for (let t4 = 1; t4 < n3.length; t4++) { - const e4 = n3[t4].dims.slice(); - for (let t5 = 0; t5 < o3.length; t5++) - if (t5 === r3) - a3[r3] += e4[t5]; - else if (o3[t5] !== e4[t5]) + for (let t5 = 1; t5 < n3.length; t5++) { + const e4 = n3[t5].dims.slice(); + for (let t6 = 0; t6 < o3.length; t6++) + if (t6 === r3) + a3[r3] += e4[t6]; + else if (o3[t6] !== e4[t6]) throw new Error("non concat dimensions must match"); } const p2 = a3.length, f = new Array(n3.length); let d = 0; - for (let t4 = 0; t4 < f.length; ++t4) - d += n3[t4].dims[r3], f[t4] = d; + for (let t5 = 0; t5 < f.length; ++t5) + d += n3[t5].dims[r3], f[t5] = d; let h = ""; h = n3.length < 5 ? s(f) : u(f); const g = ` @@ -8206,48 +8891,48 @@ var require_ort_web_node = __commonJS({ }`; return Object.assign(Object.assign({}, e3), { output: { dims: a3, type: n3[0].type, textureType: i2.TextureType.unpacked }, shaderSource: g }); })(0, r2, e2, n2.axis) }); - }, s = (t2) => { - const e2 = t2.map((t3, e3) => `if(index<${t3}) {return ${e3};} + }, s = (t3) => { + const e2 = t3.map((t4, e3) => `if(index<${t4}) {return ${e3};} `); return `int getTextureWhereDataResides(int index) { ${e2.join("")} }`; - }, u = (t2) => s(t2), c = (t2, e2) => { + }, u = (t3) => s(t3), c = (t3, e2) => { const n2 = [`float fetchDataFromCorrectTexture(int textureIndex, int indices[${e2}]) {`]; - for (let e3 = 0; e3 < t2; ++e3) - 0 === e3 ? n2.push(` if (textureIndex == ${e3}) { return _X${e3}(indices); }`) : e3 === t2 - 1 ? n2.push(` else { return _X${e3}(indices); }`) : n2.push(` else if (textureIndex == ${e3}) { return _X${e3}(indices); }`); + for (let e3 = 0; e3 < t3; ++e3) + 0 === e3 ? n2.push(` if (textureIndex == ${e3}) { return _X${e3}(indices); }`) : e3 === t3 - 1 ? n2.push(` else { return _X${e3}(indices); }`) : n2.push(` else if (textureIndex == ${e3}) { return _X${e3}(indices); }`); return n2.push(" }"), n2.join("\n"); - }, l = (t2) => { + }, l = (t3) => { const e2 = ["int getSizeInConcatAxisValueFromIndex(int index) {"]; - for (let n2 = 0; n2 < t2.length; ++n2) - 0 === n2 ? e2.push(` if (index == ${n2}) { return ${t2[n2]}; }`) : n2 === t2.length - 1 ? e2.push(` else { return ${t2[n2]}; }`) : e2.push(` else if (index == ${n2}) { return ${t2[n2]}; }`); + for (let n2 = 0; n2 < t3.length; ++n2) + 0 === n2 ? e2.push(` if (index == ${n2}) { return ${t3[n2]}; }`) : n2 === t3.length - 1 ? e2.push(` else { return ${t3[n2]}; }`) : e2.push(` else if (index == ${n2}) { return ${t3[n2]}; }`); return e2.push(" }"), e2.join("\n"); }; - e.parseConcatAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ axis: t2.attributes.getInt("axis") }); - const p = (t2) => { - if (!t2 || t2.length < 1) + e.parseConcatAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ axis: t3.attributes.getInt("axis") }); + const p = (t3) => { + if (!t3 || t3.length < 1) throw new Error("too few inputs"); - const e2 = t2[0].type, n2 = t2[0].dims.length; + const e2 = t3[0].type, n2 = t3[0].dims.length; if ("string" === e2) throw new Error("string tensor is not supported yet"); - for (const r2 of t2) { + for (const r2 of t3) { if (r2.type !== e2) throw new Error("input tensors should be one type"); if (r2.dims.length !== n2) throw new Error("input tensors should have the same shape"); } }; - }, 4770: (t, e, n) => { + }, 4770: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createUnpackedGroupedConvProgramInfoLoader = void 0; const r = n(3694), i2 = n(5060), o = n(2039), a = n(8138), s = n(2823); - e.createUnpackedGroupedConvProgramInfoLoader = (t2, e2, n2) => { + e.createUnpackedGroupedConvProgramInfoLoader = (t3, e2, n2) => { const u = (c = e2.length > 2, l = n2.cacheKey, { name: "GroupedConv", inputNames: c ? ["X", "W", "Bias"] : ["X", "W"], inputTypes: c ? [o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.unpacked], cacheHint: l }); var c, l; - return Object.assign(Object.assign({}, u), { get: () => ((t3, e3, n3, u2) => { + return Object.assign(Object.assign({}, u), { get: () => ((t4, e3, n3, u2) => { const c2 = e3.length > 2 ? "value += getBias(output_channel);" : "", l2 = e3[0].dims.slice(), p = e3[1].dims.slice(), f = p[0] / u2.group; r.Logger.verbose("GroupedConv", `autpPad:${u2.autoPad}, dilations:${u2.dilations}, group:${u2.group}, kernelShape:${u2.kernelShape}, pads:${u2.pads}, strides:${u2.strides}`); - const d = (0, a.calculateOutputShape)(l2, p, u2.dilations, u2.pads, u2.strides), h = (0, i2.getGlsl)(t3.session.backend.glContext.version), { activationFunction: g, applyActivation: b } = (0, s.getActivationSnippet)(u2), m = ` + const d = (0, a.calculateOutputShape)(l2, p, u2.dilations, u2.pads, u2.strides), h = (0, i2.getGlsl)(t4.session.backend.glContext.version), { activationFunction: g, applyActivation: b } = (0, s.getActivationSnippet)(u2), m = ` const ivec2 strides = ivec2(${u2.strides[0]}, ${u2.strides[1]}); const ivec2 pads = ivec2(${u2.pads[0]}, ${u2.pads[1]}); ${g} @@ -8286,35 +8971,35 @@ var require_ort_web_node = __commonJS({ } `; return Object.assign(Object.assign({}, n3), { output: { dims: d, type: e3[0].type, textureType: o.TextureType.unpacked }, shaderSource: m, hasMain: true }); - })(t2, e2, u, n2) }); + })(t3, e2, u, n2) }); }; - }, 1386: (t, e, n) => { + }, 1386: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.conv2DPacked = e.conv2DPackedPointwise = void 0; const r = n(8138), i2 = n(8555), o = n(708); - e.conv2DPackedPointwise = (t2, e2, n2) => { - const i3 = e2[0].dims, a = e2[1].dims, s = (0, r.calculateOutputShape)(i3, a, n2.dilations, n2.pads, n2.strides), u = t2.reshapePacked(e2[0], [i3[1], i3[2] * i3[3]]), c = t2.reshapePacked(e2[1], [a[0], a[1]]), l = e2.length > 2 ? [c, u, e2[2]] : [c, u], p = t2.run((0, o.createPackedMatmulProgramInfoLoader)(t2, l, n2), l); - return t2.reshapePacked(p, s); - }, e.conv2DPacked = (t2, e2, n2) => { - const a = e2[0].dims, s = e2[1].dims, u = (0, r.calculateOutputShape)(a, s, n2.dilations, n2.pads, n2.strides), c = t2.run((0, i2.createPackedIm2ColProgramInfoLoader)(t2, e2[0], e2[1], u, n2), [e2[0]]), l = t2.reshapePacked(e2[1], [s[0], s[1] * s[2] * s[3]]), p = 3 === e2.length ? [l, c, e2[2]] : [l, c], f = t2.run((0, o.createPackedMatmulProgramInfoLoader)(t2, p, n2), p); - return t2.reshapePacked(f, u); + e.conv2DPackedPointwise = (t3, e2, n2) => { + const i3 = e2[0].dims, a = e2[1].dims, s = (0, r.calculateOutputShape)(i3, a, n2.dilations, n2.pads, n2.strides), u = t3.reshapePacked(e2[0], [i3[1], i3[2] * i3[3]]), c = t3.reshapePacked(e2[1], [a[0], a[1]]), l = e2.length > 2 ? [c, u, e2[2]] : [c, u], p = t3.run((0, o.createPackedMatmulProgramInfoLoader)(t3, l, n2), l); + return t3.reshapePacked(p, s); + }, e.conv2DPacked = (t3, e2, n2) => { + const a = e2[0].dims, s = e2[1].dims, u = (0, r.calculateOutputShape)(a, s, n2.dilations, n2.pads, n2.strides), c = t3.run((0, i2.createPackedIm2ColProgramInfoLoader)(t3, e2[0], e2[1], u, n2), [e2[0]]), l = t3.reshapePacked(e2[1], [s[0], s[1] * s[2] * s[3]]), p = 3 === e2.length ? [l, c, e2[2]] : [l, c], f = t3.run((0, o.createPackedMatmulProgramInfoLoader)(t3, p, n2), p); + return t3.reshapePacked(f, u); }; - }, 9663: (t, e, n) => { + }, 9663: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseConvTransposeAttributes = e.convTranspose = void 0; - const r = n(246), i2 = n(5060), o = n(2039), a = n(2823), s = (t2, e2, n2, r2, i3, o2) => (t2 - 1) * e2 + n2 + (r2 - 1) * i3 + 1 - o2, u = (t2, e2, n2, r2, i3) => { - const o2 = Math.floor(t2 / 2); - "SAME_UPPER" === e2 ? (n2[r2] = o2, n2[i3] = t2 - o2) : "SAME_LOWER" === e2 && (n2[r2] = t2 - o2, n2[i3] = o2); + const r = n(246), i2 = n(5060), o = n(2039), a = n(2823), s = (t3, e2, n2, r2, i3, o2) => (t3 - 1) * e2 + n2 + (r2 - 1) * i3 + 1 - o2, u = (t3, e2, n2, r2, i3) => { + const o2 = Math.floor(t3 / 2); + "SAME_UPPER" === e2 ? (n2[r2] = o2, n2[i3] = t3 - o2) : "SAME_LOWER" === e2 && (n2[r2] = t3 - o2, n2[i3] = o2); }; - e.convTranspose = (t2, e2, n2) => (f(e2, n2), c(t2, e2, n2)); - const c = (t2, e2, n2) => { + e.convTranspose = (t3, e2, n2) => (f(e2, n2), c(t3, e2, n2)); + const c = (t3, e2, n2) => { const r2 = p(n2, e2); - return [l(t2, e2, r2)]; - }, l = (t2, e2, n2) => t2.run(((t3, e3, n3) => { + return [l(t3, e2, r2)]; + }, l = (t3, e2, n2) => t3.run(((t4, e3, n3) => { const r2 = (s2 = e3.length > 2, u2 = n3.cacheKey, { name: "ConvTranspose", inputNames: s2 ? ["X", "W", "B"] : ["X", "W"], inputTypes: s2 ? [o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.unpacked], cacheHint: u2 }); var s2, u2; - return Object.assign(Object.assign({}, r2), { get: () => ((t4, e4, n4, r3) => { - const s3 = e4.length > 2 ? "getB(output_channel)" : "0.0", u3 = e4[0].dims, c2 = e4[1].dims, l2 = c2[1], p2 = c2[0] / r3.group, f2 = [e4[0].dims[0], e4[1].dims[1] * r3.group, ...r3.outputShape], d = (0, i2.getGlsl)(t4.session.backend.glContext.version), { activationFunction: h, applyActivation: g } = (0, a.getActivationSnippet)(r3), b = ` + return Object.assign(Object.assign({}, r2), { get: () => ((t5, e4, n4, r3) => { + const s3 = e4.length > 2 ? "getB(output_channel)" : "0.0", u3 = e4[0].dims, c2 = e4[1].dims, l2 = c2[1], p2 = c2[0] / r3.group, f2 = [e4[0].dims[0], e4[1].dims[1] * r3.group, ...r3.outputShape], d = (0, i2.getGlsl)(t5.session.backend.glContext.version), { activationFunction: h, applyActivation: g } = (0, a.getActivationSnippet)(r3), b = ` const ivec2 strides = ivec2(${r3.strides[0]}, ${r3.strides[1]}); const ivec2 pads = ivec2(${r3.pads[0]}, ${r3.pads[1]}); ${h} @@ -8353,38 +9038,38 @@ var require_ort_web_node = __commonJS({ } `; return Object.assign(Object.assign({}, n4), { output: { dims: f2, type: e4[0].type, textureType: o.TextureType.unpacked }, shaderSource: b, hasMain: true }); - })(t3, e3, r2, n3) }); - })(t2, e2, n2), e2), p = (t2, e2) => { - const n2 = t2.kernelShape.slice(); - if (0 === t2.kernelShape.length) - for (let t3 = 2; t3 < e2[1].dims.length; ++t3) - n2.push(e2[1].dims[t3]); - const r2 = t2.pads.slice(), i3 = t2.outputShape.slice(); - ((t3, e3, n3, r3, i4, o3, a2, c2) => { - const l2 = t3.length - 2, p2 = 0 === c2.length; + })(t4, e3, r2, n3) }); + })(t3, e2, n2), e2), p = (t3, e2) => { + const n2 = t3.kernelShape.slice(); + if (0 === t3.kernelShape.length) + for (let t4 = 2; t4 < e2[1].dims.length; ++t4) + n2.push(e2[1].dims[t4]); + const r2 = t3.pads.slice(), i3 = t3.outputShape.slice(); + ((t4, e3, n3, r3, i4, o3, a2, c2) => { + const l2 = t4.length - 2, p2 = 0 === c2.length; for (let f2 = 0; f2 < l2; ++f2) { - const d = p2 ? t3[f2 + 2] * o3[f2] : c2[f2], h = s(t3[f2 + 2], o3[f2], i4[f2], e3[f2], n3[f2], d); - u(h, r3, i4, f2, f2 + l2), p2 && c2.push(o3[f2] * (t3[f2 + 2] - 1) + a2[f2] + (e3[f2] - 1) * n3[f2] + 1 - i4[f2] - i4[f2 + l2]); + const d = p2 ? t4[f2 + 2] * o3[f2] : c2[f2], h = s(t4[f2 + 2], o3[f2], i4[f2], e3[f2], n3[f2], d); + u(h, r3, i4, f2, f2 + l2), p2 && c2.push(o3[f2] * (t4[f2 + 2] - 1) + a2[f2] + (e3[f2] - 1) * n3[f2] + 1 - i4[f2] - i4[f2 + l2]); } - })(e2[0].dims, n2, t2.dilations, t2.autoPad, r2, t2.strides, t2.outputPadding, i3); - const o2 = Object.assign({}, t2); - return Object.assign(o2, { kernelShape: n2, pads: r2, outputShape: i3, cacheKey: t2.cacheKey }), o2; + })(e2[0].dims, n2, t3.dilations, t3.autoPad, r2, t3.strides, t3.outputPadding, i3); + const o2 = Object.assign({}, t3); + return Object.assign(o2, { kernelShape: n2, pads: r2, outputShape: i3, cacheKey: t3.cacheKey }), o2; }; - e.parseConvTransposeAttributes = (t2) => { - const e2 = t2.attributes, n2 = (0, a.parseInternalActivationAttributes)(e2), i3 = e2.getString("auto_pad", "NOTSET"), o2 = e2.getInts("dilations", [1, 1]), s2 = e2.getInt("group", 1), u2 = e2.getInts("kernel_shape", []), c2 = e2.getInts("output_padding", [0, 0]), l2 = e2.getInts("output_shape", []), p2 = e2.getInts("pads", [0, 0, 0, 0]), f2 = e2.getInts("strides", [1, 1]); + e.parseConvTransposeAttributes = (t3) => { + const e2 = t3.attributes, n2 = (0, a.parseInternalActivationAttributes)(e2), i3 = e2.getString("auto_pad", "NOTSET"), o2 = e2.getInts("dilations", [1, 1]), s2 = e2.getInt("group", 1), u2 = e2.getInts("kernel_shape", []), c2 = e2.getInts("output_padding", [0, 0]), l2 = e2.getInts("output_shape", []), p2 = e2.getInts("pads", [0, 0, 0, 0]), f2 = e2.getInts("strides", [1, 1]); return (0, r.createAttributeWithCacheKey)(Object.assign({ autoPad: i3, dilations: o2, group: s2, kernelShape: u2, outputPadding: c2, outputShape: l2, pads: p2, strides: f2 }, n2)); }; - const f = (t2, e2) => { - if (!t2 || 2 !== t2.length && 3 !== t2.length) + const f = (t3, e2) => { + if (!t3 || 2 !== t3.length && 3 !== t3.length) throw new Error("Conv requires 2 or 3 inputs"); - if (4 !== t2[0].dims.length || 4 !== t2[1].dims.length) + if (4 !== t3[0].dims.length || 4 !== t3[1].dims.length) throw new Error("currently only support 2-dimensional conv"); - if (t2[0].dims[1] !== t2[1].dims[0]) + if (t3[0].dims[1] !== t3[1].dims[0]) throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL"); - const n2 = t2[1].dims[1] * e2.group; - if (3 === t2.length && (1 !== t2[2].dims.length || t2[2].dims[0] !== n2)) + const n2 = t3[1].dims[1] * e2.group; + if (3 === t3.length && (1 !== t3[2].dims.length || t3[2].dims[0] !== n2)) throw new Error("invalid bias"); - const r2 = t2[0].dims.length - 2; + const r2 = t3[0].dims.length - 2; if (e2.dilations.length !== r2) throw new Error(`dilations should be ${r2}D`); if (e2.strides.length !== r2) @@ -8393,100 +9078,100 @@ var require_ort_web_node = __commonJS({ throw new Error(`pads should be ${2 * r2}D`); if (e2.outputPadding.length !== r2) throw new Error(`output_padding should be ${r2}D`); - if (0 !== e2.kernelShape.length && e2.kernelShape.length !== t2[1].dims.length - 2) + if (0 !== e2.kernelShape.length && e2.kernelShape.length !== t3[1].dims.length - 2) throw new Error("invalid kernel shape"); - if (0 !== e2.outputShape.length && e2.outputShape.length !== t2[0].dims.length - 2) + if (0 !== e2.outputShape.length && e2.outputShape.length !== t3[0].dims.length - 2) throw new Error("invalid output shape"); - if ("float32" !== t2[0].type || "float32" !== t2[1].type) + if ("float32" !== t3[0].type || "float32" !== t3[1].type) throw new Error("ConvTranspose input(X,W) should be float tensor"); - if (3 === t2.length && "float32" !== t2[2].type) + if (3 === t3.length && "float32" !== t3[2].type) throw new Error("ConvTranspose input(bias) should be float tensor"); }; - }, 8138: (t, e, n) => { + }, 8138: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseConvAttributes = e.conv = e.calculateOutputShape = void 0; const r = n(246), i2 = n(2517), o = n(4770), a = n(1386), s = n(9828), u = n(2823), c = n(3248), l = n(5623); - e.calculateOutputShape = (t2, e2, n2, r2, i3) => { - const o2 = t2[0], a2 = t2.slice(2), s2 = a2.length, u2 = e2[0], c2 = e2.slice(2).map((t3, e3) => t3 + (t3 - 1) * (n2[e3] - 1)), l2 = a2.map((t3, e3) => t3 + r2[e3] + r2[e3 + s2]), p2 = l2.map((t3, e3) => Math.floor((t3 - c2[e3] + i3[e3]) / i3[e3])); + e.calculateOutputShape = (t3, e2, n2, r2, i3) => { + const o2 = t3[0], a2 = t3.slice(2), s2 = a2.length, u2 = e2[0], c2 = e2.slice(2).map((t4, e3) => t4 + (t4 - 1) * (n2[e3] - 1)), l2 = a2.map((t4, e3) => t4 + r2[e3] + r2[e3 + s2]), p2 = l2.map((t4, e3) => Math.floor((t4 - c2[e3] + i3[e3]) / i3[e3])); return [o2, u2].concat(...p2); - }, e.conv = (t2, e2, n2) => (g(e2, n2), p(t2, e2, n2)); - const p = (t2, e2, n2) => { - const r2 = h(n2, e2), i3 = t2.session.pack, s2 = 1 === r2.kernelShape[0] && 1 === r2.kernelShape[1]; - return r2.group > 1 ? [t2.run((0, o.createUnpackedGroupedConvProgramInfoLoader)(t2, e2, r2), e2)] : s2 && i3 ? [f(t2, e2, r2)] : i3 && 4 === e2[0].dims.length && 1 === e2[0].dims[0] && !s2 ? [(0, a.conv2DPacked)(t2, e2, r2)] : [d(t2, e2, r2)]; - }, f = (t2, n2, r2) => { - const i3 = n2[0].dims, o2 = n2[1].dims, a2 = (0, e.calculateOutputShape)(i3, o2, r2.dilations, r2.pads, r2.strides), s2 = t2.reshapeUnpacked(n2[0], [i3[1], i3[2] * i3[3]]), u2 = t2.reshapeUnpacked(n2[1], [o2[0], o2[1]]), c2 = n2.length > 2 ? [u2, s2, n2[2]] : [u2, s2], p2 = t2.run((0, l.createMatmulProgramInfoLoader)(c2, r2), c2); - return t2.reshapeUnpacked(p2, a2); - }, d = (t2, n2, r2) => { - const i3 = n2[0].dims, o2 = n2[1].dims, a2 = (0, e.calculateOutputShape)(i3, o2, r2.dilations, r2.pads, r2.strides), u2 = t2.run((0, c.createIm2ColProgramInfoLoader)(t2, n2[0], n2[1], a2, r2), [n2[0]]), l2 = 3 === n2.length ? [u2, n2[1], n2[2]] : [u2, n2[1]]; - return t2.run((0, s.createDotProductProgramInfoLoader)(t2, n2, a2, r2), l2); - }, h = (t2, e2) => { - const n2 = t2.kernelShape.slice(); - if (0 === t2.kernelShape.length) - for (let t3 = 2; t3 < e2[1].dims.length; ++t3) - n2.push(e2[1].dims[t3]); - const r2 = t2.pads.slice(); - i2.PoolConvUtil.adjustPadsBasedOnAutoPad(e2[0].dims, t2.strides, t2.dilations, n2, r2, t2.autoPad); - const o2 = Object.assign({}, t2); - return Object.assign(o2, { kernelShape: n2, pads: r2, cacheKey: t2.cacheKey }), o2; + }, e.conv = (t3, e2, n2) => (g(e2, n2), p(t3, e2, n2)); + const p = (t3, e2, n2) => { + const r2 = h(n2, e2), i3 = t3.session.pack, s2 = 1 === r2.kernelShape[0] && 1 === r2.kernelShape[1]; + return r2.group > 1 ? [t3.run((0, o.createUnpackedGroupedConvProgramInfoLoader)(t3, e2, r2), e2)] : s2 && i3 ? [f(t3, e2, r2)] : i3 && 4 === e2[0].dims.length && 1 === e2[0].dims[0] && !s2 ? [(0, a.conv2DPacked)(t3, e2, r2)] : [d(t3, e2, r2)]; + }, f = (t3, n2, r2) => { + const i3 = n2[0].dims, o2 = n2[1].dims, a2 = (0, e.calculateOutputShape)(i3, o2, r2.dilations, r2.pads, r2.strides), s2 = t3.reshapeUnpacked(n2[0], [i3[1], i3[2] * i3[3]]), u2 = t3.reshapeUnpacked(n2[1], [o2[0], o2[1]]), c2 = n2.length > 2 ? [u2, s2, n2[2]] : [u2, s2], p2 = t3.run((0, l.createMatmulProgramInfoLoader)(c2, r2), c2); + return t3.reshapeUnpacked(p2, a2); + }, d = (t3, n2, r2) => { + const i3 = n2[0].dims, o2 = n2[1].dims, a2 = (0, e.calculateOutputShape)(i3, o2, r2.dilations, r2.pads, r2.strides), u2 = t3.run((0, c.createIm2ColProgramInfoLoader)(t3, n2[0], n2[1], a2, r2), [n2[0]]), l2 = 3 === n2.length ? [u2, n2[1], n2[2]] : [u2, n2[1]]; + return t3.run((0, s.createDotProductProgramInfoLoader)(t3, n2, a2, r2), l2); + }, h = (t3, e2) => { + const n2 = t3.kernelShape.slice(); + if (0 === t3.kernelShape.length) + for (let t4 = 2; t4 < e2[1].dims.length; ++t4) + n2.push(e2[1].dims[t4]); + const r2 = t3.pads.slice(); + i2.PoolConvUtil.adjustPadsBasedOnAutoPad(e2[0].dims, t3.strides, t3.dilations, n2, r2, t3.autoPad); + const o2 = Object.assign({}, t3); + return Object.assign(o2, { kernelShape: n2, pads: r2, cacheKey: t3.cacheKey }), o2; }; - e.parseConvAttributes = (t2) => { - const e2 = t2.attributes, n2 = (0, u.parseInternalActivationAttributes)(e2), i3 = e2.getString("auto_pad", "NOTSET"), o2 = e2.getInts("dilations", [1, 1]), a2 = e2.getInt("group", 1), s2 = e2.getInts("kernel_shape", []), c2 = e2.getInts("pads", [0, 0, 0, 0]), l2 = e2.getInts("strides", [1, 1]); + e.parseConvAttributes = (t3) => { + const e2 = t3.attributes, n2 = (0, u.parseInternalActivationAttributes)(e2), i3 = e2.getString("auto_pad", "NOTSET"), o2 = e2.getInts("dilations", [1, 1]), a2 = e2.getInt("group", 1), s2 = e2.getInts("kernel_shape", []), c2 = e2.getInts("pads", [0, 0, 0, 0]), l2 = e2.getInts("strides", [1, 1]); return (0, r.createAttributeWithCacheKey)(Object.assign({ autoPad: i3, dilations: o2, group: a2, kernelShape: s2, pads: c2, strides: l2 }, n2)); }; - const g = (t2, e2) => { - if (!t2 || 2 !== t2.length && 3 !== t2.length) + const g = (t3, e2) => { + if (!t3 || 2 !== t3.length && 3 !== t3.length) throw new Error("Conv requires 2 or 3 inputs"); - if (4 !== t2[0].dims.length || 4 !== t2[1].dims.length) + if (4 !== t3[0].dims.length || 4 !== t3[1].dims.length) throw new Error("currently only support 2-dimensional conv"); - if (t2[0].dims[1] !== t2[1].dims[1] * e2.group) + if (t3[0].dims[1] !== t3[1].dims[1] * e2.group) throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL"); - if (3 === t2.length && (1 !== t2[2].dims.length || t2[1].dims[0] !== t2[2].dims[0])) + if (3 === t3.length && (1 !== t3[2].dims.length || t3[1].dims[0] !== t3[2].dims[0])) throw new Error("invalid bias"); - const n2 = t2[0].dims.length - 2; + const n2 = t3[0].dims.length - 2; if (e2.dilations.length !== n2) throw new Error(`dilations should be ${n2}D`); if (e2.strides.length !== n2) throw new Error(`strides should be ${n2}D`); if (e2.pads.length !== 2 * n2) throw new Error(`pads should be ${2 * n2}D`); - if (0 !== e2.kernelShape.length && e2.kernelShape.length !== t2[1].dims.length - 2) + if (0 !== e2.kernelShape.length && e2.kernelShape.length !== t3[1].dims.length - 2) throw new Error("invalid kernel shape"); - if ("float32" !== t2[0].type || "float32" !== t2[1].type) + if ("float32" !== t3[0].type || "float32" !== t3[1].type) throw new Error("Conv input(X,W) should be float tensor"); - if (3 === t2.length && "float32" !== t2[2].type) + if (3 === t3.length && "float32" !== t3[2].type) throw new Error("Conv input(bias) should be float tensor"); }; - }, 5193: (t, e, n) => { + }, 5193: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseDepthToSpaceAttributes = e.depthToSpace = void 0; const r = n(3738); - e.depthToSpace = (t2, e2, n2) => { + e.depthToSpace = (t3, e2, n2) => { i2(e2); - const o = n2.blocksize, a = o * o, s = "DCR" === n2.mode ? [0, 3, 4, 1, 5, 2] : [0, 1, 4, 2, 5, 3], u = "DCR" === n2.mode ? [e2[0].dims[0], o, o, e2[0].dims[1] / a, e2[0].dims[2], e2[0].dims[3]] : [e2[0].dims[0], e2[0].dims[1] / a, o, o, e2[0].dims[2], e2[0].dims[3]], c = t2.reshapeUnpacked(e2[0], u), l = { perm: s, cacheKey: `${s}` }, [p] = (0, r.transpose)(t2, [c], l), f = [e2[0].dims[0], e2[0].dims[1] / a, e2[0].dims[2] * o, e2[0].dims[3] * o]; - return [t2.reshapeUnpacked(p, f)]; - }, e.parseDepthToSpaceAttributes = (t2) => { - const e2 = t2.attributes.getInt("blocksize"); + const o = n2.blocksize, a = o * o, s = "DCR" === n2.mode ? [0, 3, 4, 1, 5, 2] : [0, 1, 4, 2, 5, 3], u = "DCR" === n2.mode ? [e2[0].dims[0], o, o, e2[0].dims[1] / a, e2[0].dims[2], e2[0].dims[3]] : [e2[0].dims[0], e2[0].dims[1] / a, o, o, e2[0].dims[2], e2[0].dims[3]], c = t3.reshapeUnpacked(e2[0], u), l = { perm: s, cacheKey: `${s}` }, [p] = (0, r.transpose)(t3, [c], l), f = [e2[0].dims[0], e2[0].dims[1] / a, e2[0].dims[2] * o, e2[0].dims[3] * o]; + return [t3.reshapeUnpacked(p, f)]; + }, e.parseDepthToSpaceAttributes = (t3) => { + const e2 = t3.attributes.getInt("blocksize"); if (e2 < 1) throw new Error(`blocksize must be >= 1, but got : ${e2} for DepthToSpace`); - const n2 = t2.attributes.getString("mode", "DCR"); + const n2 = t3.attributes.getString("mode", "DCR"); if ("DCR" !== n2 && "CRD" !== n2) throw new Error(`unrecognized mode: ${n2} for DepthToSpace`); return { mode: n2, blocksize: e2 }; }; - const i2 = (t2) => { - if (1 !== t2.length) - throw new Error(`DepthToSpace expect 1 inputs, but got ${t2.length}`); - if ("string" === t2[0].type || 4 !== t2[0].dims.length) + const i2 = (t3) => { + if (1 !== t3.length) + throw new Error(`DepthToSpace expect 1 inputs, but got ${t3.length}`); + if ("string" === t3[0].type || 4 !== t3[0].dims.length) throw new TypeError("DepthToSpace input should be a 4-D numeric tensor"); }; - }, 9828: (t, e, n) => { + }, 9828: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createDotProductProgramInfoLoader = void 0; const r = n(2517), i2 = n(5060), o = n(2039), a = n(2823), s = n(3248); - e.createDotProductProgramInfoLoader = (t2, e2, n2, u) => { - const c = ((t3, e3) => ({ name: "ConvDotProduct", inputNames: t3 ? ["Im2Col", "K", "B"] : ["Im2Col", "K"], inputTypes: t3 ? [o.TextureType.unpacked, o.TextureType.packedLastDimension, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.packedLastDimension], cacheKey: e3.activationCacheKey }))(e2.length > 2, u); - return Object.assign(Object.assign({}, c), { get: () => ((t3, e3, n3, u2, c2) => { - const l = n3[0].dims, p = n3[1].dims, f = [p[0], Math.ceil(l[1] * p[2] * p[3] / 4)], d = (0, s.calculateIm2ColDims)(l, p, u2), [h, g] = t3.calculateTextureWidthAndHeight(f, o.TextureType.packedLastDimension), b = r.ShapeUtil.computeStrides(d), [m, y] = t3.calculateTextureWidthAndHeight(d, o.TextureType.packedLastDimension), _ = u2.length, v = n3.length < 3 ? "0.0" : "_B(b)", w = Math.ceil(l[1] * p[2] * p[3] / 4), { activationFunction: x, applyActivation: T } = (0, a.getActivationSnippet)(c2), S = (0, i2.getGlsl)(t3.session.backend.glContext.version), O = ` + e.createDotProductProgramInfoLoader = (t3, e2, n2, u) => { + const c = ((t4, e3) => ({ name: "ConvDotProduct", inputNames: t4 ? ["Im2Col", "K", "B"] : ["Im2Col", "K"], inputTypes: t4 ? [o.TextureType.unpacked, o.TextureType.packedLastDimension, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.packedLastDimension], cacheKey: e3.activationCacheKey }))(e2.length > 2, u); + return Object.assign(Object.assign({}, c), { get: () => ((t4, e3, n3, u2, c2) => { + const l = n3[0].dims, p = n3[1].dims, f = [p[0], Math.ceil(l[1] * p[2] * p[3] / 4)], d = (0, s.calculateIm2ColDims)(l, p, u2), [h, g] = t4.calculateTextureWidthAndHeight(f, o.TextureType.packedLastDimension), b = r.ShapeUtil.computeStrides(d), [m, y] = t4.calculateTextureWidthAndHeight(d, o.TextureType.packedLastDimension), _ = u2.length, v = n3.length < 3 ? "0.0" : "_B(b)", w = Math.ceil(l[1] * p[2] * p[3] / 4), { activationFunction: x, applyActivation: T } = (0, a.getActivationSnippet)(c2), S = (0, i2.getGlsl)(t4.session.backend.glContext.version), O = ` ${x} float process(int indices[${_}]) { int b[1]; @@ -8509,35 +9194,35 @@ float process(int indices[${_}]) { return value; }`; return Object.assign(Object.assign({}, e3), { output: { dims: u2, type: n3[0].type, textureType: o.TextureType.unpacked }, shaderSource: O }); - })(t2, c, e2, n2, u) }); + })(t3, c, e2, n2, u) }); }; - }, 7992: (t, e, n) => { + }, 7992: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseFlattenAttributes = e.flatten = void 0; const r = n(2517); - e.flatten = (t2, e2, n2) => { + e.flatten = (t3, e2, n2) => { i2(e2, n2); const o = r.ShapeUtil.flattenShape(e2[0].dims, n2); - return [t2.reshapeUnpacked(e2[0], o)]; - }, e.parseFlattenAttributes = (t2) => t2.attributes.getInt("axis", 1); - const i2 = (t2, e2) => { - if (!t2 || 1 !== t2.length) + return [t3.reshapeUnpacked(e2[0], o)]; + }, e.parseFlattenAttributes = (t3) => t3.attributes.getInt("axis", 1); + const i2 = (t3, e2) => { + if (!t3 || 1 !== t3.length) throw new Error("Flatten requires 1 input."); - const n2 = t2[0].dims.length; + const n2 = t3[0].dims.length; if (0 === n2) throw new Error("scalar tensor is not supported."); if (e2 < -n2 || e2 > n2) throw new Error("Invalid axis"); - if ("string" === t2[0].type) + if ("string" === t3[0].type) throw new Error("string tensor is not supported."); }; - }, 2823: (t, e, n) => { + }, 2823: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseInternalActivationAttributes = e.getActivationSnippet = void 0; const r = n(2517), i2 = n(4909); - e.getActivationSnippet = function(t2) { + e.getActivationSnippet = function(t3) { let e2; - switch (t2.activation) { + switch (t3.activation) { case "Relu": e2 = (0, i2.glslRelu)(); break; @@ -8545,34 +9230,34 @@ float process(int indices[${_}]) { e2 = (0, i2.glslSigmoid)(); break; case "Clip": - e2 = (0, i2.glslClip)(t2.clipMin, t2.clipMax); + e2 = (0, i2.glslClip)(t3.clipMin, t3.clipMax); break; default: return { activationFunction: "", applyActivation: "" }; } const n2 = e2.name; return { activationFunction: e2.body, applyActivation: `value = ${n2}_(value);` }; - }, e.parseInternalActivationAttributes = (t2) => { - const e2 = t2.getString("activation", ""); + }, e.parseInternalActivationAttributes = (t3) => { + const e2 = t3.getString("activation", ""); if ("Clip" === e2) { - const [n2, i3] = t2.getFloats("activation_params", [r.MIN_CLIP, r.MAX_CLIP]); + const [n2, i3] = t3.getFloats("activation_params", [r.MIN_CLIP, r.MAX_CLIP]); return { activation: e2, clipMax: i3, clipMin: n2, activationCacheKey: `${e2}:${n2},${i3}` }; } return { activation: e2, activationCacheKey: e2 }; }; - }, 1253: (t, e, n) => { + }, 1253: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseGatherAttributes = e.gather = void 0; const r = n(246), i2 = n(782), o = n(2517), a = n(2039); - e.gather = (t2, e2, n2) => (c(e2, n2.axis), [t2.run(u(t2, e2, n2), e2)]), e.parseGatherAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ axis: t2.attributes.getInt("axis", 0) }); - const s = { name: "Gather", inputNames: ["A", "B"], inputTypes: [a.TextureType.unpacked, a.TextureType.unpacked] }, u = (t2, e2, n2) => { + e.gather = (t3, e2, n2) => (c(e2, n2.axis), [t3.run(u(t3, e2, n2), e2)]), e.parseGatherAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ axis: t3.attributes.getInt("axis", 0) }); + const s = { name: "Gather", inputNames: ["A", "B"], inputTypes: [a.TextureType.unpacked, a.TextureType.unpacked] }, u = (t3, e2, n2) => { const r2 = Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey }); - return Object.assign(Object.assign({}, r2), { get: () => ((t3, e3, n3, r3) => { + return Object.assign(Object.assign({}, r2), { get: () => ((t4, e3, n3, r3) => { const i3 = n3[0].dims.slice(), s2 = n3[1].dims.slice(), u2 = new Array(i3.length + s2.length - 1); r3 = o.ShapeUtil.normalizeAxis(r3, i3.length); const c2 = []; - for (let t4 = 0; t4 < u2.length; t4++) - t4 < r3 ? (u2[t4] = i3[t4], c2.push(`inputIdx[${t4}] = outputIdx[${t4}];`)) : t4 < r3 + s2.length ? (u2[t4] = s2[t4 - r3], c2.push(`indexDataIdx[${t4 - r3}] = outputIdx[${t4}];`)) : (u2[t4] = i3[t4 - s2.length + 1], c2.push(`inputIdx[${t4 - s2.length + 1}] = outputIdx[${t4}];`)); + for (let t5 = 0; t5 < u2.length; t5++) + t5 < r3 ? (u2[t5] = i3[t5], c2.push(`inputIdx[${t5}] = outputIdx[${t5}];`)) : t5 < r3 + s2.length ? (u2[t5] = s2[t5 - r3], c2.push(`indexDataIdx[${t5 - r3}] = outputIdx[${t5}];`)) : (u2[t5] = i3[t5 - s2.length + 1], c2.push(`inputIdx[${t5 - s2.length + 1}] = outputIdx[${t5}];`)); const l = ` float process(int outputIdx[${u2.length || 1}]) { int inputIdx[${i3.length}]; @@ -8585,33 +9270,33 @@ float process(int indices[${_}]) { }`; return Object.assign(Object.assign({}, e3), { output: { dims: u2, type: n3[0].type, textureType: a.TextureType.unpacked }, shaderSource: l }); })(0, r2, e2, n2.axis) }); - }, c = (t2, e2) => { - if (!t2 || 2 !== t2.length) + }, c = (t3, e2) => { + if (!t3 || 2 !== t3.length) throw new Error("Gather requires 2 inputs."); - const n2 = t2[0].dims.length; + const n2 = t3[0].dims.length; if (n2 < 1) throw new Error("Invalid input shape."); if (e2 < -n2 || e2 > n2 - 1) throw new Error("Invalid axis."); - if (-1 === i2.NUMBER_TYPES.indexOf(t2[0].type)) + if (-1 === i2.NUMBER_TYPES.indexOf(t3[0].type)) throw new Error("Invaid input type."); - if ("int32" !== t2[1].type && "int16" !== t2[1].type) + if ("int32" !== t3[1].type && "int16" !== t3[1].type) throw new Error("Invaid input type."); }; - }, 4776: (t, e, n) => { + }, 4776: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseGemmAttributesV11 = e.parseGemmAttributesV7 = e.gemm = void 0; const r = n(246), i2 = n(2517), o = n(2039); - e.gemm = (t2, e2, n2) => (c(e2, n2), [t2.run(s(e2, n2), e2)]); - const a = (t2, e2) => { - const n2 = 0 !== t2.attributes.getInt("transA", 0), i3 = 0 !== t2.attributes.getInt("transB", 0), o2 = t2.attributes.getFloat("alpha", 1), a2 = t2.attributes.getFloat("beta", 1); + e.gemm = (t3, e2, n2) => (c(e2, n2), [t3.run(s(e2, n2), e2)]); + const a = (t3, e2) => { + const n2 = 0 !== t3.attributes.getInt("transA", 0), i3 = 0 !== t3.attributes.getInt("transB", 0), o2 = t3.attributes.getFloat("alpha", 1), a2 = t3.attributes.getFloat("beta", 1); return (0, r.createAttributeWithCacheKey)({ transA: n2, transB: i3, alpha: o2, beta: a2, isOptionalC: e2 }); }; - e.parseGemmAttributesV7 = (t2) => a(t2, false), e.parseGemmAttributesV11 = (t2) => a(t2, true); - const s = (t2, e2) => { - const n2 = { name: "Gemm", inputNames: 3 === t2.length ? ["A", "B", "C"] : ["A", "B"], inputTypes: 3 === t2.length ? [o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.unpacked], key: e2.cacheKey }; - return Object.assign(Object.assign({}, n2), { get: () => u(n2, t2, e2) }); - }, u = (t2, e2, n2) => { + e.parseGemmAttributesV7 = (t3) => a(t3, false), e.parseGemmAttributesV11 = (t3) => a(t3, true); + const s = (t3, e2) => { + const n2 = { name: "Gemm", inputNames: 3 === t3.length ? ["A", "B", "C"] : ["A", "B"], inputTypes: 3 === t3.length ? [o.TextureType.unpacked, o.TextureType.unpacked, o.TextureType.unpacked] : [o.TextureType.unpacked, o.TextureType.unpacked], key: e2.cacheKey }; + return Object.assign(Object.assign({}, n2), { get: () => u(n2, t3, e2) }); + }, u = (t3, e2, n2) => { const r2 = e2[0].dims.slice(), a2 = e2[1].dims.slice(), [s2, u2] = i2.GemmUtil.getShapeOfGemmResult(r2, n2.transA, a2, n2.transB, 3 === e2.length ? e2[2].dims : void 0), c2 = [s2, u2]; if (!c2) throw new Error("Can't use gemm on the given tensors"); @@ -8638,36 +9323,36 @@ float process(int indices[${_}]) { ${3 === e2.length ? "value += beta * _C(c);" : ""} return value; }`; - return Object.assign(Object.assign({}, t2), { output: { dims: c2, type: e2[0].type, textureType: o.TextureType.unpacked }, variables: [{ name: "alpha", type: "float", data: n2.alpha }, { name: "beta", type: "float", data: n2.beta }], shaderSource: d }); - }, c = (t2, e2) => { - if (!t2) + return Object.assign(Object.assign({}, t3), { output: { dims: c2, type: e2[0].type, textureType: o.TextureType.unpacked }, variables: [{ name: "alpha", type: "float", data: n2.alpha }, { name: "beta", type: "float", data: n2.beta }], shaderSource: d }); + }, c = (t3, e2) => { + if (!t3) throw new Error("Input is missing"); - if (e2.isOptionalC && (t2.length < 2 || t2.length > 3)) + if (e2.isOptionalC && (t3.length < 2 || t3.length > 3)) throw new Error("Invaid input shape."); - if (!e2.isOptionalC && 3 !== t2.length) + if (!e2.isOptionalC && 3 !== t3.length) throw new Error("Gemm requires 3 inputs"); - if (3 === t2.length && 1 !== t2[2].dims.length && 2 !== t2[2].dims.length) + if (3 === t3.length && 1 !== t3[2].dims.length && 2 !== t3[2].dims.length) throw new Error("Invalid input shape of C"); - if ("float32" !== t2[0].type && "float64" !== t2[0].type || "float32" !== t2[1].type && "float64" !== t2[1].type || 3 === t2.length && "float32" !== t2[2].type && "float64" !== t2[2].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type || "float32" !== t3[1].type && "float64" !== t3[1].type || 3 === t3.length && "float32" !== t3[2].type && "float64" !== t3[2].type) throw new Error("Invalid input type."); - if (t2[0].type !== t2[1].type || 3 === t2.length && t2[0].type !== t2[2].type) + if (t3[0].type !== t3[1].type || 3 === t3.length && t3[0].type !== t3[2].type) throw new Error("Input types are mismatched"); }; - }, 8555: (t, e, n) => { + }, 8555: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createPackedIm2ColProgramInfoLoader = void 0; const r = n(5060), i2 = n(2039), o = n(2827); - e.createPackedIm2ColProgramInfoLoader = (t2, e2, n2, a, s) => { + e.createPackedIm2ColProgramInfoLoader = (t3, e2, n2, a, s) => { const u = (c = s.cacheKey, { name: "Im2Col (packed)", inputNames: ["A"], inputTypes: [i2.TextureType.packed], cacheHint: c }); var c; - return Object.assign(Object.assign({}, u), { get: () => ((t3, e3, n3, a2, s2, u2) => { - const c2 = n3.dims, l = a2.dims, p = s2.length, f = [l[1] * l[2] * l[3], s2[2] * s2[3]], d = l[2] * l[3], h = (0, o.unpackFromChannel)(), g = (0, r.getGlsl)(t3.session.backend.glContext.version); + return Object.assign(Object.assign({}, u), { get: () => ((t4, e3, n3, a2, s2, u2) => { + const c2 = n3.dims, l = a2.dims, p = s2.length, f = [l[1] * l[2] * l[3], s2[2] * s2[3]], d = l[2] * l[3], h = (0, o.unpackFromChannel)(), g = (0, r.getGlsl)(t4.session.backend.glContext.version); let b = ""; - for (let t4 = 0; t4 <= 1; t4++) + for (let t5 = 0; t5 <= 1; t5++) for (let e4 = 0; e4 <= 1; e4++) b += ` blockIndex = rc.x + ${e4}; - pos = rc.y + ${t4}; + pos = rc.y + ${t5}; if(blockIndex < ${f[1]} && pos < ${f[0]}) { offsetY = int(blockIndex / (${s2[p - 1]})) * ${u2.strides[0]} - @@ -8683,7 +9368,7 @@ float process(int indices[${_}]) { ch = int(float(pos)/ ${d}.); innerDims = vec2(d0, d1); - result[${2 * t4 + e4}] = getChannel( + result[${2 * t5 + e4}] = getChannel( getA(0, ch, int(innerDims.x), int(innerDims.y)), innerDims); } @@ -8704,16 +9389,16 @@ float process(int indices[${_}]) { } `; return Object.assign(Object.assign({}, e3), { output: { dims: f, type: n3.type, textureType: i2.TextureType.packed }, shaderSource: m, hasMain: true }); - })(t2, u, e2, n2, a, s) }); + })(t3, u, e2, n2, a, s) }); }; - }, 3248: (t, e, n) => { + }, 3248: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.calculateIm2ColDims = e.createIm2ColProgramInfoLoader = void 0; const r = n(2039); - e.createIm2ColProgramInfoLoader = (t2, n2, i2, o, a) => { + e.createIm2ColProgramInfoLoader = (t3, n2, i2, o, a) => { const s = (u = a.cacheKey, { name: "Im2Col", inputNames: ["X"], inputTypes: [r.TextureType.unpacked], cacheHint: u }); var u; - return Object.assign(Object.assign({}, s), { get: () => ((t3, n3, i3, o2, a2, s2) => { + return Object.assign(Object.assign({}, s), { get: () => ((t4, n3, i3, o2, a2, s2) => { const u2 = i3.dims, c = o2.dims, l = a2.length, p = (0, e.calculateIm2ColDims)(u2, c, a2, 4), f = ` const int XC = ${u2[1]}; const int XH = ${u2[2]}; @@ -8761,18 +9446,18 @@ float process(int indices[${_}]) { `; return Object.assign(Object.assign({}, n3), { output: { dims: p, type: i3.type, textureType: r.TextureType.packedLastDimension }, shaderSource: f }); })(0, s, n2, i2, o, a) }); - }, e.calculateIm2ColDims = (t2, e2, n2, r2 = 4) => [n2[0], n2[2], n2[3], Math.ceil(t2[1] * e2[2] * e2[3] / r2)]; - }, 6572: (t, e, n) => { + }, e.calculateIm2ColDims = (t3, e2, n2, r2 = 4) => [n2[0], n2[2], n2[3], Math.ceil(t3[1] * e2[2] * e2[3] / r2)]; + }, 6572: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseImageScalerAttributes = e.imageScaler = void 0; const r = n(246), i2 = n(2039); - e.imageScaler = (t2, e2, n2) => (u(e2), [t2.run(a(t2, e2, n2), e2)]), e.parseImageScalerAttributes = (t2) => { - const e2 = t2.attributes.getFloat("scale"), n2 = t2.attributes.getFloats("bias"); + e.imageScaler = (t3, e2, n2) => (u(e2), [t3.run(a(t3, e2, n2), e2)]), e.parseImageScalerAttributes = (t3) => { + const e2 = t3.attributes.getFloat("scale"), n2 = t3.attributes.getFloats("bias"); return (0, r.createAttributeWithCacheKey)({ scale: e2, bias: n2 }); }; - const o = { name: "ImageScaler", inputNames: ["X"], inputTypes: [i2.TextureType.unpacked] }, a = (t2, e2, n2) => { + const o = { name: "ImageScaler", inputNames: ["X"], inputTypes: [i2.TextureType.unpacked] }, a = (t3, e2, n2) => { const r2 = Object.assign(Object.assign({}, o), { cacheHint: n2.cacheKey }); - return Object.assign(Object.assign({}, r2), { get: () => ((t3, e3, n3, r3) => { + return Object.assign(Object.assign({}, r2), { get: () => ((t4, e3, n3, r3) => { const o2 = n3[0].dims.slice(), a2 = o2.length, u2 = ` ${s(r3.bias.length)} float process(int indices[${a2}]) { @@ -8780,29 +9465,29 @@ float process(int indices[${_}]) { }`; return Object.assign(Object.assign({}, e3), { output: { dims: o2, type: n3[0].type, textureType: i2.TextureType.unpacked }, variables: [{ name: "bias", type: "float", arrayLength: r3.bias.length, data: r3.bias }, { name: "scale", type: "float", data: r3.scale }], shaderSource: u2 }); })(0, r2, e2, n2) }); - }, s = (t2) => { - const e2 = [`float getBias(float bias[${t2}], int channel) {`]; - for (let n2 = 0; n2 < t2; ++n2) - 0 === n2 ? e2.push(` if (channel == ${n2}) { return bias[${n2}]; }`) : n2 === t2 - 1 ? e2.push(` else { return bias[${n2}]; }`) : e2.push(` else if (channel == ${n2}) { return bias[${n2}]; }`); + }, s = (t3) => { + const e2 = [`float getBias(float bias[${t3}], int channel) {`]; + for (let n2 = 0; n2 < t3; ++n2) + 0 === n2 ? e2.push(` if (channel == ${n2}) { return bias[${n2}]; }`) : n2 === t3 - 1 ? e2.push(` else { return bias[${n2}]; }`) : e2.push(` else if (channel == ${n2}) { return bias[${n2}]; }`); return e2.push(" }"), e2.join("\n"); - }, u = (t2) => { - if (!t2 || 1 !== t2.length) + }, u = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("ImageScaler requires 1 input."); - if (4 !== t2[0].dims.length) + if (4 !== t3[0].dims.length) throw new Error("Invalid input shape."); - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("Invalid input type."); }; - }, 3346: (t, e, n) => { + }, 3346: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseInstanceNormalizationAttributes = e.instanceNormalization = void 0; const r = n(5060), i2 = n(2039); - e.instanceNormalization = (t2, e2, n2) => { + e.instanceNormalization = (t3, e2, n2) => { c(e2); - const r2 = t2.run(a(e2[0]), e2); - return [t2.run(u(t2, e2[0], n2, r2.dims), [e2[0], r2, e2[1], e2[2]])]; - }, e.parseInstanceNormalizationAttributes = (t2) => t2.attributes.getFloat("epsilon", 1e-5); - const o = { name: "InstanceNormalization_MeanAndVariance", inputNames: ["X"], inputTypes: [i2.TextureType.unpacked] }, a = (t2) => Object.assign(Object.assign({}, o), { get: () => ((t3, e2) => { + const r2 = t3.run(a(e2[0]), e2); + return [t3.run(u(t3, e2[0], n2, r2.dims), [e2[0], r2, e2[1], e2[2]])]; + }, e.parseInstanceNormalizationAttributes = (t3) => t3.attributes.getFloat("epsilon", 1e-5); + const o = { name: "InstanceNormalization_MeanAndVariance", inputNames: ["X"], inputTypes: [i2.TextureType.unpacked] }, a = (t3) => Object.assign(Object.assign({}, o), { get: () => ((t4, e2) => { const n2 = e2.dims.slice(), r2 = n2[1], o2 = n2[2] * n2[3], a2 = [n2[0], r2], s2 = ` vec4 process(int[2] indices) { vec4 v = vec4(0.0); @@ -8833,11 +9518,11 @@ float process(int indices[${_}]) { return v; }`; - return Object.assign(Object.assign({}, t3), { output: { dims: a2, type: e2.type, textureType: i2.TextureType.packedLastDimension }, shaderSource: s2 }); - })(o, t2) }), s = { name: "InstanceNormalization_ComputeOutput", inputNames: ["X", "MeanAndVariance", "Scale", "B"], inputTypes: [i2.TextureType.unpacked, i2.TextureType.packedLastDimension, i2.TextureType.unpacked, i2.TextureType.unpacked] }, u = (t2, e2, n2, o2) => { + return Object.assign(Object.assign({}, t4), { output: { dims: a2, type: e2.type, textureType: i2.TextureType.packedLastDimension }, shaderSource: s2 }); + })(o, t3) }), s = { name: "InstanceNormalization_ComputeOutput", inputNames: ["X", "MeanAndVariance", "Scale", "B"], inputTypes: [i2.TextureType.unpacked, i2.TextureType.packedLastDimension, i2.TextureType.unpacked, i2.TextureType.unpacked] }, u = (t3, e2, n2, o2) => { const a2 = Object.assign(Object.assign({}, s), { cacheHint: `${n2}` }); - return Object.assign(Object.assign({}, a2), { get: () => ((t3, e3, n3, o3, a3) => { - const s2 = (0, r.getGlsl)(t3.session.backend.glContext.version), [u2, c2] = t3.calculateTextureWidthAndHeight(a3, i2.TextureType.packedLastDimension), [l, p] = [u2 / 4, c2], f = ` + return Object.assign(Object.assign({}, a2), { get: () => ((t4, e3, n3, o3, a3) => { + const s2 = (0, r.getGlsl)(t4.session.backend.glContext.version), [u2, c2] = t4.calculateTextureWidthAndHeight(a3, i2.TextureType.packedLastDimension), [l, p] = [u2 / 4, c2], f = ` vec4 get_MeanAndVariance(int[2] mv) { int offset = indicesToOffset_MeanAndVariance(mv); vec2 coords = offsetToCoords(offset, ${l}, ${p}); @@ -8860,41 +9545,41 @@ float process(int indices[${_}]) { return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; }`; return Object.assign(Object.assign({}, e3), { output: { dims: n3.dims, type: n3.type, textureType: i2.TextureType.unpacked }, variables: [{ name: "epsilon", type: "float", data: o3 }], shaderSource: f }); - })(t2, a2, e2, n2, o2) }); - }, c = (t2) => { - if (!t2 || 3 !== t2.length) + })(t3, a2, e2, n2, o2) }); + }, c = (t3) => { + if (!t3 || 3 !== t3.length) throw new Error("InstanceNormalization requires 3 inputs."); - const e2 = t2[0], n2 = t2[1], r2 = t2[2]; + const e2 = t3[0], n2 = t3[1], r2 = t3[2]; if (e2.dims.length < 3 || 1 !== n2.dims.length || 1 !== r2.dims.length) throw new Error("Invalid input shape."); if (n2.dims[0] !== e2.dims[1] || r2.dims[0] !== e2.dims[1]) throw new Error("Input shapes are mismatched."); if ("float32" !== e2.type && "float64" !== e2.type || "float32" !== n2.type && "float64" !== n2.type || "float32" !== r2.type && "float64" !== r2.type) throw new Error("Invalid input type."); - if (4 !== t2[0].dims.length) + if (4 !== t3[0].dims.length) throw new Error("Only support 4-D input shape."); }; - }, 708: (t, e, n) => { + }, 708: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createPackedMatmulProgramInfoLoader = void 0; const r = n(2517), i2 = n(5060), o = n(2039), a = n(9390), s = n(2823), u = n(5623); - e.createPackedMatmulProgramInfoLoader = (t2, e2, n2) => { + e.createPackedMatmulProgramInfoLoader = (t3, e2, n2) => { const c = (l = e2.length > 2, p = n2.activationCacheKey, { name: "MatMul (packed)", inputNames: l ? ["A", "B", "Bias"] : ["A", "B"], inputTypes: l ? [o.TextureType.packed, o.TextureType.packed, o.TextureType.packed] : [o.TextureType.packed, o.TextureType.packed], cacheHint: p }); var l, p; - return Object.assign(Object.assign({}, c), { get: () => ((t3, e3, n3, c2) => { + return Object.assign(Object.assign({}, c), { get: () => ((t4, e3, n3, c2) => { const l2 = n3.length > 2, p2 = l2 ? "value += getBiasForMatmul();" : "", f = n3[0].dims, d = n3[1].dims, h = r.BroadcastUtil.calcShape(f, d, true), g = !r.ShapeUtil.areEqual(n3[0].dims, n3[1].dims); if (!h) throw new Error("Can't use matmul on the given tensors"); - const b = f[f.length - 1], m = Math.ceil(b / 2), y = f.length, _ = d.length, v = (0, i2.getGlsl)(t3.session.backend.glContext.version), w = (0, a.getCoordsDataType)(h.length), x = h.length, T = (0, a.getGlChannels)(), { activationFunction: S, applyActivation: O } = (0, s.getActivationSnippet)(c2), A = l2 ? `${(0, u.getBiasForMatmul)(w, T, n3[2].dims, h, true)}` : "", E = g ? `${function(t4, e4, n4, i3) { + const b = f[f.length - 1], m = Math.ceil(b / 2), y = f.length, _ = d.length, v = (0, i2.getGlsl)(t4.session.backend.glContext.version), w = (0, a.getCoordsDataType)(h.length), x = h.length, T = (0, a.getGlChannels)(), { activationFunction: S, applyActivation: O } = (0, s.getActivationSnippet)(c2), A = l2 ? `${(0, u.getBiasForMatmul)(w, T, n3[2].dims, h, true)}` : "", E = g ? `${function(t5, e4, n4, i3) { let o2 = [], a2 = []; const s2 = n4[0].dims, u2 = n4[1].dims, c3 = s2.length, l3 = u2.length, p3 = i3.length, f2 = p3 - c3, d2 = p3 - l3; - o2 = s2.map((t5, n5) => `coords.${e4[n5 + f2]}`), o2[c3 - 1] = "i*2", o2.join(", "), a2 = u2.map((t5, n5) => `coords.${e4[n5 + d2]}`), a2[l3 - 2] = "i*2", a2.join(", "); - const h2 = r.BroadcastUtil.getBroadcastDims(s2, i3), g2 = r.BroadcastUtil.getBroadcastDims(u2, i3), b2 = h2.map((t5) => `coords.${e4[t5 + f2]} = 0;`).join("\n"), m2 = g2.map((t5) => `coords.${e4[t5 + d2]} = 0;`).join("\n"), y2 = `int lastDim = coords.${e4[p3 - 1]}; + o2 = s2.map((t6, n5) => `coords.${e4[n5 + f2]}`), o2[c3 - 1] = "i*2", o2.join(", "), a2 = u2.map((t6, n5) => `coords.${e4[n5 + d2]}`), a2[l3 - 2] = "i*2", a2.join(", "); + const h2 = r.BroadcastUtil.getBroadcastDims(s2, i3), g2 = r.BroadcastUtil.getBroadcastDims(u2, i3), b2 = h2.map((t6) => `coords.${e4[t6 + f2]} = 0;`).join("\n"), m2 = g2.map((t6) => `coords.${e4[t6 + d2]} = 0;`).join("\n"), y2 = `int lastDim = coords.${e4[p3 - 1]}; coords.${e4[p3 - 1]} = coords.${e4[p3 - 2]}; coords.${e4[p3 - 2]} = lastDim;`; return ` vec4 getAAtOutCoordsMatmul(int i) { - ${t4} coords = getOutputCoords(); + ${t5} coords = getOutputCoords(); ${y2} ${b2} vec4 outputValue = getA(${o2}); @@ -8902,22 +9587,22 @@ vec4 getAAtOutCoordsMatmul(int i) { } vec4 getBAtOutCoordsMatmul(int i) { - ${t4} coords = getOutputCoords(); + ${t5} coords = getOutputCoords(); ${y2} ${m2} vec4 outputValue = getB(${a2}); return outputValue; }`; - }(w, T, n3, h)}` : "", I = g ? "getAAtOutCoordsMatmul(i)" : `getA(${function(t4, e4) { + }(w, T, n3, h)}` : "", I = g ? "getAAtOutCoordsMatmul(i)" : `getA(${function(t5, e4) { let n4 = ""; for (let r2 = 0; r2 < e4 - 2; r2++) - n4 += `rc.${t4[r2]}, `; - return n4 += `rc.${t4[e4 - 2]}, i*2`, n4; - }(T, y)})`, P = g ? "getBAtOutCoordsMatmul(i)" : `getB(${function(t4, e4) { + n4 += `rc.${t5[r2]}, `; + return n4 += `rc.${t5[e4 - 2]}, i*2`, n4; + }(T, y)})`, P = g ? "getBAtOutCoordsMatmul(i)" : `getB(${function(t5, e4) { let n4 = ""; for (let r2 = 0; r2 < e4 - 2; r2++) - n4 += `rc.${t4[r2]}, `; - return n4 += `i*2, rc.${t4[e4 - 1]}`, n4; + n4 += `rc.${t5[r2]}, `; + return n4 += `i*2, rc.${t5[e4 - 1]}`, n4; }(T, _)})`, D = ` ${E} ${A} @@ -8941,16 +9626,16 @@ vec4 getBAtOutCoordsMatmul(int i) { ${v.output} = value; }`; return Object.assign(Object.assign({}, e3), { output: { dims: h, type: n3[0].type, textureType: o.TextureType.packed }, shaderSource: D, hasMain: true }); - })(t2, c, e2, n2) }); + })(t3, c, e2, n2) }); }; - }, 5623: (t, e, n) => { + }, 5623: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.getBiasForMatmul = e.createMatmulProgramInfoLoader = e.parseMatMulAttributes = e.matMul = void 0; const r = n(2517), i2 = n(2039), o = n(9390), a = n(2823), s = n(708); - function u(t2, e2) { - const n2 = (s2 = t2.length > 2, u2 = e2.activationCacheKey, { name: "MatMul", inputNames: s2 ? ["A", "B", "Bias"] : ["A", "B"], inputTypes: s2 ? [i2.TextureType.unpacked, i2.TextureType.unpacked, i2.TextureType.unpacked] : [i2.TextureType.unpacked, i2.TextureType.unpacked], cacheHint: u2 }); + function u(t3, e2) { + const n2 = (s2 = t3.length > 2, u2 = e2.activationCacheKey, { name: "MatMul", inputNames: s2 ? ["A", "B", "Bias"] : ["A", "B"], inputTypes: s2 ? [i2.TextureType.unpacked, i2.TextureType.unpacked, i2.TextureType.unpacked] : [i2.TextureType.unpacked, i2.TextureType.unpacked], cacheHint: u2 }); var s2, u2; - return Object.assign(Object.assign({}, n2), { get: () => function(t3, e3, n3) { + return Object.assign(Object.assign({}, n2), { get: () => function(t4, e3, n3) { const s3 = e3[0].dims, u3 = e3[1].dims, c2 = r.BroadcastUtil.calcShape(s3, u3, true); if (!c2) throw new Error("Can't use matmul on the given tensors"); @@ -8973,46 +9658,46 @@ vec4 getBAtOutCoordsMatmul(int i) { ${h} return value; }`; - return Object.assign(Object.assign({}, t3), { output: { dims: c2, type: e3[0].type, textureType: i2.TextureType.unpacked }, shaderSource: w }); - }(n2, t2, e2) }); + return Object.assign(Object.assign({}, t4), { output: { dims: c2, type: e3[0].type, textureType: i2.TextureType.unpacked }, shaderSource: w }); + }(n2, t3, e2) }); } - e.matMul = (t2, e2, n2) => (c(e2), t2.session.pack ? [t2.run((0, s.createPackedMatmulProgramInfoLoader)(t2, e2, n2), e2)] : [t2.run(u(e2, n2), e2)]), e.parseMatMulAttributes = (t2) => (0, a.parseInternalActivationAttributes)(t2.attributes), e.createMatmulProgramInfoLoader = u; - const c = (t2) => { - if (!t2 || 2 !== t2.length) + e.matMul = (t3, e2, n2) => (c(e2), t3.session.pack ? [t3.run((0, s.createPackedMatmulProgramInfoLoader)(t3, e2, n2), e2)] : [t3.run(u(e2, n2), e2)]), e.parseMatMulAttributes = (t3) => (0, a.parseInternalActivationAttributes)(t3.attributes), e.createMatmulProgramInfoLoader = u; + const c = (t3) => { + if (!t3 || 2 !== t3.length) throw new Error("MatMul requires 2 inputs."); - if (t2[0].dims[t2[0].dims.length - 1] !== t2[1].dims[t2[1].dims.length - 2]) + if (t3[0].dims[t3[0].dims.length - 1] !== t3[1].dims[t3[1].dims.length - 2]) throw new Error("shared dimension does not match."); - if ("float32" !== t2[0].type && "float64" !== t2[0].type || "float32" !== t2[1].type && "float64" !== t2[1].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type || "float32" !== t3[1].type && "float64" !== t3[1].type) throw new Error("inputs should be float type"); - if (t2[0].type !== t2[1].type) + if (t3[0].type !== t3[1].type) throw new Error("inputs types should match"); }; - function l(t2, e2, n2, i3, o2) { + function l(t3, e2, n2, i3, o2) { let a2 = ""; const s2 = n2.length, u2 = i3.length, c2 = u2 - s2; - a2 = u2 < 2 && s2 > 0 ? "coords" : n2.map((t3, n3) => `coords.${e2[n3 + c2]}`).join(", "); - const l2 = r.BroadcastUtil.getBroadcastDims(n2, i3).map((t3) => `coords.${e2[t3 + c2]} = 0;`).join("\n"); + a2 = u2 < 2 && s2 > 0 ? "coords" : n2.map((t4, n3) => `coords.${e2[n3 + c2]}`).join(", "); + const l2 = r.BroadcastUtil.getBroadcastDims(n2, i3).map((t4) => `coords.${e2[t4 + c2]} = 0;`).join("\n"); let p = "vec4(outputValue.xx, outputValue.yy)"; return 1 === r.ShapeUtil.size(n2) && (p = "vec4(outputValue.x)"), o2 ? ` vec4 getBiasForMatmul() { - ${t2} coords = getOutputCoords(); + ${t3} coords = getOutputCoords(); ${l2} vec4 outputValue = getBias(${a2}); return ${p}; }` : ` float getBiasForMatmul() { - ${t2} coords = getOutputCoords(); + ${t3} coords = getOutputCoords(); ${l2} return getBias(coords.x); }`; } e.getBiasForMatmul = l; - }, 2403: (t, e, n) => { + }, 2403: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createPackProgramInfoLoader = void 0; const r = n(5060), i2 = n(2039), o = n(9390), a = n(2827), s = { name: "pack", inputNames: ["A"], inputTypes: [i2.TextureType.unpackedReversed] }; - e.createPackProgramInfoLoader = (t2, e2) => Object.assign(Object.assign({}, s), { get: () => ((t3, e3) => { - const n2 = (0, r.getGlsl)(t3.session.backend.glContext.version), u = e3.dims, c = u.length, l = e3.dims.length, p = (0, o.getCoordsDataType)(l), f = (0, a.getChannels)("rc", l), d = (h = l, g = f, b = u[u.length - 2], m = u[u.length - 1], 0 === h || 1 === h ? "" : ` + e.createPackProgramInfoLoader = (t3, e2) => Object.assign(Object.assign({}, s), { get: () => ((t4, e3) => { + const n2 = (0, r.getGlsl)(t4.session.backend.glContext.version), u = e3.dims, c = u.length, l = e3.dims.length, p = (0, o.getCoordsDataType)(l), f = (0, a.getChannels)("rc", l), d = (h = l, g = f, b = u[u.length - 2], m = u[u.length - 1], 0 === h || 1 === h ? "" : ` int r = ${g[h - 2]}; int c = ${g[h - 1]}; int rp1 = ${g[h - 2]} + 1; @@ -9023,27 +9708,27 @@ float getBiasForMatmul() { var h, g, b, m; let y; y = 0 === c ? [1, 1] : 1 === c ? [u[0], 1] : [u[l - 1], u[l - 2]]; - const _ = function(t4, e4, n3) { - if (0 === t4) + const _ = function(t5, e4, n3) { + if (0 === t5) return "false"; - if (1 === t4) + if (1 === t5) return `rc > ${e4[0]}`; let r2 = ""; - for (let i3 = t4 - 2; i3 < t4; i3++) - r2 += `${n3[i3]} >= ${e4[i3 - t4 + 2]}`, i3 < t4 - 1 && (r2 += "||"); + for (let i3 = t5 - 2; i3 < t5; i3++) + r2 += `${n3[i3]} >= ${e4[i3 - t5 + 2]}`, i3 < t5 - 1 && (r2 += "||"); return r2; - }(l, y, f), v = function(t4, e4) { - const n3 = t4.length; + }(l, y, f), v = function(t5, e4) { + const n3 = t5.length; if (0 === n3) return "getA(), 0, 0, 0"; if (1 === n3) return `getA(rc), - rc + 1 >= ${t4[0]} ? 0. : getA(rc + 1), + rc + 1 >= ${t5[0]} ? 0. : getA(rc + 1), 0, 0`; let r2 = ""; if (n3 > 2) - for (let t5 = 0; t5 < n3 - 2; ++t5) - r2 += `${e4[t5]},`; + for (let t6 = 0; t6 < n3 - 2; ++t6) + r2 += `${e4[t6]},`; return `getA(${r2}r, c), rEdge ? 0. : getA(${r2}rp1, c), cEdge ? 0. : getA(${r2}r, cp1), @@ -9062,57 +9747,57 @@ float getBiasForMatmul() { } `; return Object.assign(Object.assign({}, s), { hasMain: true, output: { dims: e3.dims, type: e3.type, textureType: i2.TextureType.packed }, shaderSource: w }); - })(t2, e2) }); - }, 2827: (t, e, n) => { + })(t3, e2) }); + }, 2827: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.unpackFromChannel = e.getChannels = e.getVecChannels = void 0; const r = n(9390); - function i2(t2, e2) { - return (0, r.getGlChannels)(e2).map((e3) => `${t2}.${e3}`); + function i2(t3, e2) { + return (0, r.getGlChannels)(e2).map((e3) => `${t3}.${e3}`); } - e.getVecChannels = i2, e.getChannels = function(t2, e2) { - return 1 === e2 ? [t2] : i2(t2, e2); + e.getVecChannels = i2, e.getChannels = function(t3, e2) { + return 1 === e2 ? [t3] : i2(t3, e2); }, e.unpackFromChannel = function() { return "\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "; }; - }, 2870: (t, e, n) => { + }, 2870: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parsePadAttributesV11 = e.padV11 = e.parsePadAttributesV2 = e.padV2 = void 0; const r = n(246), i2 = n(2517), o = n(5060), a = n(2039), s = { name: "Pad", inputNames: ["A"], inputTypes: [a.TextureType.unpacked] }; - e.padV2 = (t2, e2, n2) => (l(e2), [t2.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => c(t2, e2[0], n2) }), e2)]), e.parsePadAttributesV2 = (t2) => { - const e2 = t2.attributes.getString("mode", "constant"), n2 = t2.attributes.getFloat("value", 0), i3 = t2.attributes.getInts("pads"); + e.padV2 = (t3, e2, n2) => (l(e2), [t3.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => c(t3, e2[0], n2) }), e2)]), e.parsePadAttributesV2 = (t3) => { + const e2 = t3.attributes.getString("mode", "constant"), n2 = t3.attributes.getFloat("value", 0), i3 = t3.attributes.getInts("pads"); return (0, r.createAttributeWithCacheKey)({ mode: e2, value: n2, pads: i3 }); - }, e.padV11 = (t2, n2, r2) => { + }, e.padV11 = (t3, n2, r2) => { p(n2); - const i3 = u(t2, n2, r2); - return (0, e.padV2)(t2, [n2[0]], i3); - }, e.parsePadAttributesV11 = (t2) => t2.attributes.getString("mode", "constant"); - const u = (t2, e2, n2) => { - if (!t2.session.isInitializer(e2[1].dataId) || e2.length >= 3 && !t2.session.isInitializer(e2[2].dataId)) + const i3 = u(t3, n2, r2); + return (0, e.padV2)(t3, [n2[0]], i3); + }, e.parsePadAttributesV11 = (t3) => t3.attributes.getString("mode", "constant"); + const u = (t3, e2, n2) => { + if (!t3.session.isInitializer(e2[1].dataId) || e2.length >= 3 && !t3.session.isInitializer(e2[2].dataId)) throw new Error("dynamic pad attributes are not allowed"); const i3 = Array.from(e2[1].integerData), o2 = e2.length >= 3 ? e2[2].floatData[0] : 0; return (0, r.createAttributeWithCacheKey)({ mode: n2, pads: i3, value: o2 }); - }, c = (t2, e2, n2) => { + }, c = (t3, e2, n2) => { const r2 = i2.ShapeUtil.padShape(e2.dims.slice(), n2.pads), o2 = r2.length, s2 = ` - ${f(t2, e2, n2)} + ${f(t3, e2, n2)} float process(int[${o2}] indices) { return padA(indices); }`; return { name: "Pad", inputNames: ["A"], inputTypes: [a.TextureType.unpacked], output: { dims: r2, type: e2.type, textureType: a.TextureType.unpacked }, shaderSource: s2 }; - }, l = (t2) => { - if (!t2 || 1 !== t2.length) + }, l = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Pad requires 1 input"); - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("Invalid input type."); - }, p = (t2) => { - if (!t2 || 2 !== t2.length && 3 !== t2.length) + }, p = (t3) => { + if (!t3 || 2 !== t3.length && 3 !== t3.length) throw new Error("Pad requires 2 or 3 inputs"); - if ("int32" !== t2[1].type) + if ("int32" !== t3[1].type) throw new Error("Invalid input type."); - if (t2.length >= 3 && "string" === t2[2].type) + if (t3.length >= 3 && "string" === t3[2].type) throw new Error("Invalid input type."); - }, f = (t2, e2, n2) => { - const r2 = (0, o.getGlsl)(t2.session.backend.glContext.version), [s2, u2] = t2.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), c2 = i2.ShapeUtil.computeStrides(e2.dims); + }, f = (t3, e2, n2) => { + const r2 = (0, o.getGlsl)(t3.session.backend.glContext.version), [s2, u2] = t3.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), c2 = i2.ShapeUtil.computeStrides(e2.dims); switch (n2.mode) { case "constant": return d(r2, e2.dims, c2, s2, u2, n2.pads, n2.value); @@ -9123,15 +9808,15 @@ float getBiasForMatmul() { default: throw new Error("Invalid mode"); } - }, d = (t2, e2, n2, r2, i3, o2, a2) => { + }, d = (t3, e2, n2, r2, i3, o2, a2) => { const s2 = e2.length; let u2 = ""; - for (let t3 = s2 - 1; t3 >= 0; --t3) + for (let t4 = s2 - 1; t4 >= 0; --t4) u2 += ` - k = m[${t3}] - ${o2[t3]}; + k = m[${t4}] - ${o2[t4]}; if (k < 0) return constant; - if (k >= ${e2[t3]}) return constant; - offset += k * ${n2[t3]}; + if (k >= ${e2[t4]}) return constant; + offset += k * ${n2[t4]}; `; return ` float padA(int m[${s2}]) { @@ -9140,23 +9825,23 @@ float getBiasForMatmul() { int k = 0; ${u2} vec2 coords = offsetToCoords(offset, ${r2}, ${i3}); - float value = getColorAsFloat(${t2.texture2D}(A, coords)); + float value = getColorAsFloat(${t3.texture2D}(A, coords)); return value; } `; - }, h = (t2, e2, n2, r2, i3, o2) => { + }, h = (t3, e2, n2, r2, i3, o2) => { const a2 = e2.length; let s2 = ""; - for (let t3 = a2 - 1; t3 >= 0; --t3) + for (let t4 = a2 - 1; t4 >= 0; --t4) s2 += ` - k = m[${t3}] - ${o2[t3]}; + k = m[${t4}] - ${o2[t4]}; if (k < 0) { k = -k; } { - const int _2n_1 = ${2 * (e2[t3] - 1)}; + const int _2n_1 = ${2 * (e2[t4] - 1)}; k = int( mod( float(k), float(_2n_1) ) ) ; - if(k >= ${e2[t3]}) { k = _2n_1 - k; } + if(k >= ${e2[t4]}) { k = _2n_1 - k; } } - offset += k * ${n2[t3]}; + offset += k * ${n2[t4]}; `; return ` float padA(int m[${a2}]) { @@ -9164,19 +9849,19 @@ float getBiasForMatmul() { int k = 0; ${s2} vec2 coords = offsetToCoords(offset, ${r2}, ${i3}); - float value = getColorAsFloat(${t2.texture2D}(A, coords)); + float value = getColorAsFloat(${t3.texture2D}(A, coords)); return value; } `; - }, g = (t2, e2, n2, r2, i3, o2) => { + }, g = (t3, e2, n2, r2, i3, o2) => { const a2 = e2.length; let s2 = ""; - for (let t3 = a2 - 1; t3 >= 0; --t3) + for (let t4 = a2 - 1; t4 >= 0; --t4) s2 += ` - k = m[${t3}] - ${o2[t3]}; + k = m[${t4}] - ${o2[t4]}; if (k < 0) k = 0; - if (k >= ${e2[t3]}) k = ${e2[t3] - 1}; - offset += k * ${n2[t3]}; + if (k >= ${e2[t4]}) k = ${e2[t4] - 1}; + offset += k * ${n2[t4]}; `; return ` float padA(int m[${a2}]) { @@ -9184,74 +9869,74 @@ float getBiasForMatmul() { int k = 0; ${s2} vec2 coords = offsetToCoords(offset, ${r2}, ${i3}); - float value = getColorAsFloat(${t2.texture2D}(A, coords)); + float value = getColorAsFloat(${t3.texture2D}(A, coords)); return value; } `; }; - }, 2143: (t, e, n) => { + }, 2143: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.globalMaxPool = e.parseMaxPoolAttributes = e.maxPool = e.parseGlobalAveragePoolAttributes = e.globalAveragePool = e.parseAveragePoolAttributes = e.averagePool = void 0; const r = n(246), i2 = n(2517), o = n(2039); - e.averagePool = (t2, e2, n2) => { + e.averagePool = (t3, e2, n2) => { p(e2); const r2 = { name: "AveragePool", inputNames: ["X"], inputTypes: [o.TextureType.unpacked], cacheHint: n2.cacheKey }; - return [t2.run(Object.assign(Object.assign({}, r2), { get: () => a(e2, r2, false, n2) }), e2)]; - }, e.parseAveragePoolAttributes = (t2) => { - const e2 = t2.attributes.getString("auto_pad", "NOTSET"), n2 = t2.attributes.getInt("ceil_mode", 0), i3 = 0 !== t2.attributes.getInt("count_include_pad", 0), o2 = t2.attributes.getInts("kernel_shape"), a2 = t2.attributes.getInts("strides", []), s2 = t2.attributes.getInts("pads", []); + return [t3.run(Object.assign(Object.assign({}, r2), { get: () => a(e2, r2, false, n2) }), e2)]; + }, e.parseAveragePoolAttributes = (t3) => { + const e2 = t3.attributes.getString("auto_pad", "NOTSET"), n2 = t3.attributes.getInt("ceil_mode", 0), i3 = 0 !== t3.attributes.getInt("count_include_pad", 0), o2 = t3.attributes.getInts("kernel_shape"), a2 = t3.attributes.getInts("strides", []), s2 = t3.attributes.getInts("pads", []); if (0 !== n2) throw new Error("using ceil() in shape computation is not yet supported for AveragePool"); return (0, r.createAttributeWithCacheKey)({ autoPad: e2, ceilMode: n2, countIncludePad: i3, kernelShape: o2, strides: a2, pads: s2 }); }; - const a = (t2, e2, n2, r2) => { - const [a2, s2] = u(t2, r2, n2), c2 = i2.ShapeUtil.size(a2.kernelShape); + const a = (t3, e2, n2, r2) => { + const [a2, s2] = u(t3, r2, n2), c2 = i2.ShapeUtil.size(a2.kernelShape); let l2 = ""; a2.countIncludePad ? l2 += `value /= float(${c2});` : l2 += `value /= float(${c2} - pad);`; const p2 = ` - ${f(t2[0].dims, a2, "value += _X(x);", l2, "0.0")} + ${f(t3[0].dims, a2, "value += _X(x);", l2, "0.0")} `; - return Object.assign(Object.assign({}, e2), { output: { dims: s2, type: t2[0].type, textureType: o.TextureType.unpacked }, shaderSource: p2 }); + return Object.assign(Object.assign({}, e2), { output: { dims: s2, type: t3[0].type, textureType: o.TextureType.unpacked }, shaderSource: p2 }); }; - e.globalAveragePool = (t2, e2, n2) => { + e.globalAveragePool = (t3, e2, n2) => { p(e2); const r2 = { name: "GlobalAveragePool", inputNames: ["X"], inputTypes: [o.TextureType.unpacked], cacheHint: `${n2.countIncludePad}` }; - return [t2.run(Object.assign(Object.assign({}, r2), { get: () => a(e2, r2, true, n2) }), e2)]; - }, e.parseGlobalAveragePoolAttributes = (t2) => { - const e2 = 0 !== t2.attributes.getInt("count_include_pad", 0); + return [t3.run(Object.assign(Object.assign({}, r2), { get: () => a(e2, r2, true, n2) }), e2)]; + }, e.parseGlobalAveragePoolAttributes = (t3) => { + const e2 = 0 !== t3.attributes.getInt("count_include_pad", 0); return (0, r.createAttributeWithCacheKey)({ autoPad: "", ceilMode: 0, countIncludePad: e2, kernelShape: [], strides: [], pads: [] }); - }, e.maxPool = (t2, e2, n2) => { + }, e.maxPool = (t3, e2, n2) => { p(e2); const r2 = { name: "MaxPool", inputNames: ["X"], inputTypes: [o.TextureType.unpacked], cacheHint: n2.cacheKey }; - return [t2.run(Object.assign(Object.assign({}, r2), { get: () => s(e2, r2, false, n2) }), e2)]; - }, e.parseMaxPoolAttributes = (t2) => { - const e2 = t2.attributes.getString("auto_pad", "NOTSET"), n2 = t2.attributes.getInt("ceil_mode", 0), i3 = t2.attributes.getInts("kernel_shape"), o2 = t2.attributes.getInts("strides", []), a2 = t2.attributes.getInts("pads", []), s2 = t2.attributes.getInt("storage_order", 0), u2 = t2.attributes.getInts("dilations", []); + return [t3.run(Object.assign(Object.assign({}, r2), { get: () => s(e2, r2, false, n2) }), e2)]; + }, e.parseMaxPoolAttributes = (t3) => { + const e2 = t3.attributes.getString("auto_pad", "NOTSET"), n2 = t3.attributes.getInt("ceil_mode", 0), i3 = t3.attributes.getInts("kernel_shape"), o2 = t3.attributes.getInts("strides", []), a2 = t3.attributes.getInts("pads", []), s2 = t3.attributes.getInt("storage_order", 0), u2 = t3.attributes.getInts("dilations", []); if (0 !== s2) throw new Error("column major storage order is not yet supported for MaxPool"); if (0 !== n2) throw new Error("using ceil() in shape computation is not yet supported for MaxPool"); return (0, r.createAttributeWithCacheKey)({ autoPad: e2, ceilMode: n2, countIncludePad: false, kernelShape: i3, strides: o2, pads: a2, storageOrder: s2, dilations: u2 }); }; - const s = (t2, e2, n2, r2) => { - const [i3, a2] = u(t2, r2, n2), s2 = ` - ${f(t2[0].dims, i3, "\n value = max(_X(x), value);\n ", "", "-1e5")} + const s = (t3, e2, n2, r2) => { + const [i3, a2] = u(t3, r2, n2), s2 = ` + ${f(t3[0].dims, i3, "\n value = max(_X(x), value);\n ", "", "-1e5")} `; - return Object.assign(Object.assign({}, e2), { output: { dims: a2, type: t2[0].type, textureType: o.TextureType.unpacked }, shaderSource: s2 }); - }, u = (t2, e2, n2) => { - const r2 = t2[0].dims.slice(), o2 = Object.hasOwnProperty.call(e2, "dilations"), a2 = e2.kernelShape.slice(), s2 = e2.strides.slice(), u2 = o2 ? e2.dilations.slice() : [], c2 = e2.pads.slice(); + return Object.assign(Object.assign({}, e2), { output: { dims: a2, type: t3[0].type, textureType: o.TextureType.unpacked }, shaderSource: s2 }); + }, u = (t3, e2, n2) => { + const r2 = t3[0].dims.slice(), o2 = Object.hasOwnProperty.call(e2, "dilations"), a2 = e2.kernelShape.slice(), s2 = e2.strides.slice(), u2 = o2 ? e2.dilations.slice() : [], c2 = e2.pads.slice(); i2.PoolConvUtil.adjustPoolAttributes(n2, r2, a2, s2, u2, c2); const l2 = i2.PoolConvUtil.computePoolOutputShape(n2, r2, s2, u2, a2, c2, e2.autoPad), p2 = Object.assign({}, e2); return o2 ? Object.assign(p2, { kernelShape: a2, strides: s2, pads: c2, dilations: u2, cacheKey: e2.cacheKey }) : Object.assign(p2, { kernelShape: a2, strides: s2, pads: c2, cacheKey: e2.cacheKey }), [p2, l2]; }, c = { autoPad: "", ceilMode: 0, countIncludePad: false, kernelShape: [], strides: [], pads: [], storageOrder: 0, dilations: [], cacheKey: "" }, l = { name: "GlobalMaxPool", inputNames: ["X"], inputTypes: [o.TextureType.unpacked] }; - e.globalMaxPool = (t2, e2) => (p(e2), [t2.run(Object.assign(Object.assign({}, l), { get: () => s(e2, l, true, c) }), e2)]); - const p = (t2) => { - if (!t2 || 1 !== t2.length) + e.globalMaxPool = (t3, e2) => (p(e2), [t3.run(Object.assign(Object.assign({}, l), { get: () => s(e2, l, true, c) }), e2)]); + const p = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Pool ops requires 1 input."); - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("Invalid input type."); - }, f = (t2, e2, n2, r2, o2) => { - const a2 = t2.length; + }, f = (t3, e2, n2, r2, o2) => { + const a2 = t3.length; if (e2.kernelShape.length <= 2) { - const i3 = e2.kernelShape[e2.kernelShape.length - 1], s2 = e2.strides[e2.strides.length - 1], u2 = e2.pads[e2.pads.length / 2 - 1], c2 = e2.pads[e2.pads.length - 1], l2 = t2[a2 - 1]; + const i3 = e2.kernelShape[e2.kernelShape.length - 1], s2 = e2.strides[e2.strides.length - 1], u2 = e2.pads[e2.pads.length / 2 - 1], c2 = e2.pads[e2.pads.length - 1], l2 = t3[a2 - 1]; let p2 = "", f2 = "", d2 = ""; if (p2 = u2 + c2 !== 0 ? ` for (int i = 0; i < ${i3}; i++) { @@ -9266,7 +9951,7 @@ float getBiasForMatmul() { x[${a2} - 1] = indices[${a2} - 1] * ${s2} - ${u2} + i; ${n2} }`, 2 === e2.kernelShape.length) { - const n3 = e2.kernelShape[e2.kernelShape.length - 2], r3 = e2.strides[e2.strides.length - 2], o3 = e2.pads[e2.pads.length / 2 - 2], s3 = e2.pads[e2.pads.length - 2], u3 = t2[a2 - 2]; + const n3 = e2.kernelShape[e2.kernelShape.length - 2], r3 = e2.strides[e2.strides.length - 2], o3 = e2.pads[e2.pads.length / 2 - 2], s3 = e2.pads[e2.pads.length - 2], u3 = t3[a2 - 2]; f2 = o3 + s3 !== 0 ? ` for (int j = 0; j < ${n3}; j++) { x[${a2} - 2] = indices[${a2} - 2] * ${r3} - ${o3} + j; @@ -9295,9 +9980,9 @@ float getBiasForMatmul() { `; } { - const s2 = i2.ShapeUtil.size(e2.kernelShape), u2 = i2.ShapeUtil.computeStrides(e2.kernelShape), c2 = u2.length, l2 = e2.pads.length, p2 = h(c2), f2 = d(t2, "inputDims"), g = d(e2.pads, "pads"), b = d(u2, "kernelStrides"), m = d(e2.strides, "strides"); + const s2 = i2.ShapeUtil.size(e2.kernelShape), u2 = i2.ShapeUtil.computeStrides(e2.kernelShape), c2 = u2.length, l2 = e2.pads.length, p2 = h(c2), f2 = d(t3, "inputDims"), g = d(e2.pads, "pads"), b = d(u2, "kernelStrides"), m = d(e2.strides, "strides"); let y = ""; - return y = e2.pads.reduce((t3, e3) => t3 + e3) ? ` + return y = e2.pads.reduce((t4, e3) => t4 + e3) ? ` if (x[j] >= inputDims[j] || x[j] < 0) { pad++; isPad = true; @@ -9341,45 +10026,45 @@ float getBiasForMatmul() { } `; } - }, d = (t2, e2) => { + }, d = (t3, e2) => { let n2 = ""; - for (let r2 = 0; r2 < t2.length; r2++) + for (let r2 = 0; r2 < t3.length; r2++) n2 += ` - ${e2}[${r2}] = ${t2[r2]}; + ${e2}[${r2}] = ${t3[r2]}; `; return n2; - }, h = (t2) => ` - void offsetToIndices(int offset, int[${t2}] strides, out int[${t2}] indices) { - if (${t2} == 0) { + }, h = (t3) => ` + void offsetToIndices(int offset, int[${t3}] strides, out int[${t3}] indices) { + if (${t3} == 0) { return; } - for (int i = 0; i < ${t2} - 1; ++i) { + for (int i = 0; i < ${t3} - 1; ++i) { indices[i] = offset / strides[i]; offset -= indices[i] * strides[i]; } - indices[${t2} - 1] = offset; + indices[${t3} - 1] = offset; }`; - }, 4939: (t, e, n) => { + }, 4939: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.reduceLogSumSquare = e.reduceLogSum = e.reduceProd = e.reduceMin = e.reduceMax = e.reduceMean = e.reduceSum = e.parseReduceAttributes = void 0; - const r = n(246), i2 = n(782), o = n(2517), a = n(2039), s = (t2, e2, n2, r2, i3) => { + const r = n(246), i2 = n(782), o = n(2517), a = n(2039), s = (t3, e2, n2, r2, i3) => { c(e2); const o2 = { name: r2, inputNames: ["A"], inputTypes: [a.TextureType.unpacked] }; - return [t2.run(Object.assign(Object.assign({}, o2), { cacheHint: n2.cacheKey, get: () => u(t2, e2, n2, r2, i3, o2) }), e2)]; + return [t3.run(Object.assign(Object.assign({}, o2), { cacheHint: n2.cacheKey, get: () => u(t3, e2, n2, r2, i3, o2) }), e2)]; }; - e.parseReduceAttributes = (t2) => { - const e2 = t2.attributes.getInts("axes", []), n2 = 1 === t2.attributes.getInt("keepdims", 1); + e.parseReduceAttributes = (t3) => { + const e2 = t3.attributes.getInts("axes", []), n2 = 1 === t3.attributes.getInt("keepdims", 1); return (0, r.createAttributeWithCacheKey)({ axes: e2, keepDims: n2 }); }; - const u = (t2, e2, n2, r2, i3, s2) => { + const u = (t3, e2, n2, r2, i3, s2) => { const u2 = [], c2 = e2[0].dims.length || 1, l = [], p = o.ShapeUtil.normalizeAxes(n2.axes, e2[0].dims.length), f = i3(e2, p); let d = f[1]; - for (let t3 = 0; t3 < e2[0].dims.length; t3++) - p.indexOf(t3) >= 0 || 0 === p.length ? (n2.keepDims && u2.push(1), d = ` - for(int j${t3} = 0; j${t3} < ${e2[0].dims[t3]}; j${t3}++) { - inputIdx[${t3}] = j${t3}; + for (let t4 = 0; t4 < e2[0].dims.length; t4++) + p.indexOf(t4) >= 0 || 0 === p.length ? (n2.keepDims && u2.push(1), d = ` + for(int j${t4} = 0; j${t4} < ${e2[0].dims[t4]}; j${t4}++) { + inputIdx[${t4}] = j${t4}; ${d} - }`) : (l.push(`inputIdx[${t3}] = outputIdx[${u2.length}];`), u2.push(e2[0].dims[t3])); + }`) : (l.push(`inputIdx[${t4}] = outputIdx[${u2.length}];`), u2.push(e2[0].dims[t4])); const h = ` float process(int outputIdx[${u2.length || 1}]) { float value; // final result @@ -9391,42 +10076,42 @@ float getBiasForMatmul() { return value; }`; return Object.assign(Object.assign({}, s2), { output: { dims: u2, type: e2[0].type, textureType: a.TextureType.unpacked }, shaderSource: h }); - }, c = (t2) => { - if (!t2 || 1 !== t2.length) + }, c = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Reduce op requires 1 input."); - if (-1 === i2.NUMBER_TYPES.indexOf(t2[0].type)) + if (-1 === i2.NUMBER_TYPES.indexOf(t3[0].type)) throw new Error("Invalid input type."); }; - e.reduceSum = (t2, e2, n2) => s(t2, e2, n2, "ReduceSum", () => ["value = 0.0;", "value += _A(inputIdx);", ""]), e.reduceMean = (t2, e2, n2) => s(t2, e2, n2, "ReduceMean", (t3, e3) => { + e.reduceSum = (t3, e2, n2) => s(t3, e2, n2, "ReduceSum", () => ["value = 0.0;", "value += _A(inputIdx);", ""]), e.reduceMean = (t3, e2, n2) => s(t3, e2, n2, "ReduceMean", (t4, e3) => { let n3 = 1; - for (let r2 = 0; r2 < t3[0].dims.length; r2++) - (e3.indexOf(r2) >= 0 || 0 === e3.length) && (n3 *= t3[0].dims[r2]); + for (let r2 = 0; r2 < t4[0].dims.length; r2++) + (e3.indexOf(r2) >= 0 || 0 === e3.length) && (n3 *= t4[0].dims[r2]); return ["value = 0.0;", "value += _A(inputIdx);", `value /= ${n3}.;`]; - }), e.reduceMax = (t2, e2, n2) => s(t2, e2, n2, "ReduceMax", (t3, e3) => { + }), e.reduceMax = (t3, e2, n2) => s(t3, e2, n2, "ReduceMax", (t4, e3) => { const n3 = []; - for (let r2 = 0; r2 < t3[0].dims.length; r2++) + for (let r2 = 0; r2 < t4[0].dims.length; r2++) (e3.indexOf(r2) >= 0 || 0 === e3.length) && n3.push(`inputIdx[${r2}] = 0;`); return [`${n3.join("\n")} value = _A(inputIdx);`, "value = max(value, _A(inputIdx));", ""]; - }), e.reduceMin = (t2, e2, n2) => s(t2, e2, n2, "ReduceMin", (t3, e3) => { + }), e.reduceMin = (t3, e2, n2) => s(t3, e2, n2, "ReduceMin", (t4, e3) => { const n3 = []; - for (let r2 = 0; r2 < t3[0].dims.length; r2++) + for (let r2 = 0; r2 < t4[0].dims.length; r2++) (e3.indexOf(r2) >= 0 || 0 === e3.length) && n3.push(`inputIdx[${r2}] = 0;`); return [`${n3.join("\n")} value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; - }), e.reduceProd = (t2, e2, n2) => s(t2, e2, n2, "ReduceProd", () => ["value = 1.0;", "value *= _A(inputIdx);", ""]), e.reduceLogSum = (t2, e2, n2) => s(t2, e2, n2, "ReduceLogSum", () => ["value = 0.0;", "value += _A(inputIdx);", "value = log(value);"]), e.reduceLogSumSquare = (t2, e2, n2) => s(t2, e2, n2, "ReduceLogSumSquare", () => ["float t; value = 0.0;", "t = _A(inputIdx); value += t * t;", ""]); - }, 7019: (t, e, n) => { + }), e.reduceProd = (t3, e2, n2) => s(t3, e2, n2, "ReduceProd", () => ["value = 1.0;", "value *= _A(inputIdx);", ""]), e.reduceLogSum = (t3, e2, n2) => s(t3, e2, n2, "ReduceLogSum", () => ["value = 0.0;", "value += _A(inputIdx);", "value = log(value);"]), e.reduceLogSumSquare = (t3, e2, n2) => s(t3, e2, n2, "ReduceLogSumSquare", () => ["float t; value = 0.0;", "t = _A(inputIdx); value += t * t;", ""]); + }, 7019: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.isReshapeCheap = e.processDims3D = e.createPackedReshape3DProgramInfoLoader = void 0; const r = n(2517), i2 = n(5060), o = n(2039), a = n(2827); - e.createPackedReshape3DProgramInfoLoader = (t2, e2, n2) => { - const s = ((t3) => ({ name: "Reshape (packed)", inputTypes: [o.TextureType.packed], inputNames: ["A"], cacheHint: `${t3}` }))(n2); - return Object.assign(Object.assign({}, s), { get: () => ((t3, e3, n3, s2) => { + e.createPackedReshape3DProgramInfoLoader = (t3, e2, n2) => { + const s = ((t4) => ({ name: "Reshape (packed)", inputTypes: [o.TextureType.packed], inputNames: ["A"], cacheHint: `${t4}` }))(n2); + return Object.assign(Object.assign({}, s), { get: () => ((t4, e3, n3, s2) => { const u = e3.dims, c = s2; let l = ""; - for (let t4 = 0; t4 < 4; t4++) { + for (let t5 = 0; t5 < 4; t5++) { let e4 = ""; - switch (t4) { + switch (t5) { case 0: e4 = "outputCoords = rc;"; break; @@ -9444,20 +10129,20 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } l += ` ${e4} - ${t4 > 0 ? "if(outputCoords.y < rows && outputCoords.z < cols){" : ""} + ${t5 > 0 ? "if(outputCoords.y < rows && outputCoords.z < cols){" : ""} int flattenedIndex = getFlattenedIndex(outputCoords); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); - result[${t4}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); + result[${t5}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); - ${t4 > 0 ? "}" : ""} + ${t5 > 0 ? "}" : ""} `; } - const p = (0, i2.getGlsl)(t3.session.backend.glContext.version), f = ` - ${function(t4) { - const e4 = r.ShapeUtil.computeStrides(t4), n4 = ["b", "r", "c"], i3 = "index", o2 = e4.map((t5, r2) => `int ${n4[r2]} = ${i3} / ${t5}; ${r2 === e4.length - 1 ? `int ${n4[r2 + 1]} = ${i3} - ${n4[r2]} * ${t5}` : `index -= ${n4[r2]} * ${t5}`};`).join(""); + const p = (0, i2.getGlsl)(t4.session.backend.glContext.version), f = ` + ${function(t5) { + const e4 = r.ShapeUtil.computeStrides(t5), n4 = ["b", "r", "c"], i3 = "index", o2 = e4.map((t6, r2) => `int ${n4[r2]} = ${i3} / ${t6}; ${r2 === e4.length - 1 ? `int ${n4[r2 + 1]} = ${i3} - ${n4[r2]} * ${t6}` : `index -= ${n4[r2]} * ${t6}`};`).join(""); return ` ivec3 inputCoordsFromReshapedOutCoords(int index) { ${o2} @@ -9465,8 +10150,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } `; }(u)} - ${function(t4) { - const e4 = r.ShapeUtil.computeStrides(t4); + ${function(t5) { + const e4 = r.ShapeUtil.computeStrides(t5); return ` int getFlattenedIndex(ivec3 coords) { // reverse y, z order @@ -9490,34 +10175,34 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } `; return Object.assign(Object.assign({}, n3), { output: { dims: c, type: e3.type, textureType: o.TextureType.packed }, shaderSource: f, hasMain: true }); - })(t2, e2, s, n2) }); - }, e.processDims3D = function(t2) { - if (0 === t2.length) + })(t3, e2, s, n2) }); + }, e.processDims3D = function(t3) { + if (0 === t3.length) return [1, 1, 1]; let e2 = 1; - for (let n2 = 0; n2 < t2.length - 2; ++n2) - e2 *= t2[n2]; - return [e2, t2.length > 1 ? t2[t2.length - 2] : 1, t2[t2.length - 1]]; - }, e.isReshapeCheap = function(t2, e2) { + for (let n2 = 0; n2 < t3.length - 2; ++n2) + e2 *= t3[n2]; + return [e2, t3.length > 1 ? t3[t3.length - 2] : 1, t3[t3.length - 1]]; + }, e.isReshapeCheap = function(t3, e2) { let n2 = false; - return n2 = 0 === t2.length || 0 === e2.length || (t2.length < 2 || e2.length < 2 ? t2[t2.length - 1] === e2[e2.length - 1] : t2[t2.length - 1] === e2[e2.length - 1] && t2[t2.length - 2] === e2[e2.length - 2]), n2; + return n2 = 0 === t3.length || 0 === e2.length || (t3.length < 2 || e2.length < 2 ? t3[t3.length - 1] === e2[e2.length - 1] : t3[t3.length - 1] === e2[e2.length - 1] && t3[t3.length - 2] === e2[e2.length - 2]), n2; }; - }, 718: (t, e, n) => { + }, 718: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.reshape = void 0; const r = n(2517); - e.reshape = (t2, e2) => { + e.reshape = (t3, e2) => { const n2 = r.ShapeUtil.calculateReshapedDims(e2[0].dims, e2[1].integerData); - return t2.session.pack ? [t2.reshapePacked(e2[0], n2)] : [t2.reshapeUnpacked(e2[0], n2)]; + return t3.session.pack ? [t3.reshapePacked(e2[0], n2)] : [t3.reshapeUnpacked(e2[0], n2)]; }; - }, 2268: (t, e, n) => { + }, 2268: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseResizeAttributesV11 = e.parseResizeAttributesV10 = e.resize = void 0; const r = n(5060), i2 = n(2039), o = n(9390), a = n(2827), s = n(9793), u = { name: "Resize", inputNames: ["A"], inputTypes: [i2.TextureType.packed] }; - e.resize = (t2, e2, n2) => ((0, s.validateInputs)(e2, n2), [t2.run(Object.assign(Object.assign({}, u), { cacheHint: n2.cacheKey, get: () => c(t2, e2, n2) }), e2)]), e.parseResizeAttributesV10 = (t2) => (0, s.parseUpsampleAttributes)(t2, 10), e.parseResizeAttributesV11 = (t2) => (0, s.parseUpsampleAttributes)(t2, 11); - const c = (t2, e2, n2) => { - const s2 = (0, r.getGlsl)(t2.session.backend.glContext.version), [c2, p2] = l(e2, n2); - if (c2.every((t3) => 1 === t3) && "tf_crop_and_resize" !== n2.coordinateTransformMode) + e.resize = (t3, e2, n2) => ((0, s.validateInputs)(e2, n2), [t3.run(Object.assign(Object.assign({}, u), { cacheHint: n2.cacheKey, get: () => c(t3, e2, n2) }), e2)]), e.parseResizeAttributesV10 = (t3) => (0, s.parseUpsampleAttributes)(t3, 10), e.parseResizeAttributesV11 = (t3) => (0, s.parseUpsampleAttributes)(t3, 11); + const c = (t3, e2, n2) => { + const s2 = (0, r.getGlsl)(t3.session.backend.glContext.version), [c2, p2] = l(e2, n2); + if (c2.every((t4) => 1 === t4) && "tf_crop_and_resize" !== n2.coordinateTransformMode) return Object.assign(Object.assign({}, u), { output: { dims: p2, type: e2[0].type, textureType: i2.TextureType.packed }, hasMain: true, shaderSource: `void main() { vec4 v = ${s2.texture2D}(X, TexCoords); ${s2.output} = v; @@ -9636,124 +10321,124 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } `; return Object.assign(Object.assign({}, u), { output: { dims: p2, type: e2[0].type, textureType: i2.TextureType.packed }, hasMain: true, shaderSource: x }); - }, l = (t2, e2) => { - const n2 = t2[0].dims; + }, l = (t3, e2) => { + const n2 = t3[0].dims; let r2, i3 = e2.scales; if (0 === i3.length) { - const o3 = t2[e2.scalesInputIdx]; + const o3 = t3[e2.scalesInputIdx]; if (o3 && 0 !== o3.size) { - if (t2[e2.sizesInputIdx]) + if (t3[e2.sizesInputIdx]) throw new Error("Only one of scales or sizes must be provided as input."); i3 = p(o3, e2.mode, e2.isResize); } else { - const o4 = t2[e2.sizesInputIdx]; + const o4 = t3[e2.sizesInputIdx]; if (!o4 || 0 === o4.size) throw new Error("Either scales or sizes MUST be provided as input."); r2 = Array.from(o4.integerData), i3 = f(r2, n2, e2.mode, e2.isResize); } - } else if (t2[e2.sizesInputIdx]) + } else if (t3[e2.sizesInputIdx]) throw new Error("Only one of scales or sizes must be provided as input."); - const o2 = r2 || n2.map((t3, e3) => Math.floor(t3 * i3[e3])); + const o2 = r2 || n2.map((t4, e3) => Math.floor(t4 * i3[e3])); return [i3, o2]; - }, p = (t2, e2, n2) => { - const r2 = Array.from(t2.floatData); + }, p = (t3, e2, n2) => { + const r2 = Array.from(t3.floatData); return (0, s.scalesValidation)(r2, e2, n2), r2; - }, f = (t2, e2, n2, r2) => { + }, f = (t3, e2, n2, r2) => { const i3 = e2.length, o2 = new Array(i3); for (let n3 = 0, r3 = i3; n3 < r3; n3++) if (0 === e2[n3]) { - if (0 !== t2[n3]) + if (0 !== t3[n3]) throw new Error("Input dim is zero but required output dim is non-zero."); o2[n3] = 1; } else - o2[n3] = t2[n3] / e2[n3]; + o2[n3] = t3[n3] / e2[n3]; return (0, s.scalesValidation)(o2, n2, r2), o2; }; - }, 8117: (t, e, n) => { + }, 8117: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.shape = void 0; const r = n(9162); - e.shape = (t2, e2) => (i2(e2), [new r.Tensor([e2[0].dims.length], "int32", void 0, void 0, new Int32Array(e2[0].dims))]); - const i2 = (t2) => { - if (!t2 || 1 !== t2.length) + e.shape = (t3, e2) => (i2(e2), [new r.Tensor([e2[0].dims.length], "int32", void 0, void 0, new Int32Array(e2[0].dims))]); + const i2 = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Shape requires 1 input."); }; - }, 2278: (t, e, n) => { + }, 2278: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.sliceV10 = e.parseSliceAttributes = e.slice = void 0; const r = n(246), i2 = n(782), o = n(2517), a = n(2039), s = { name: "Slice", inputNames: ["A"], inputTypes: [a.TextureType.unpacked] }; - e.slice = (t2, e2, n2) => (c(e2), [t2.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => u(t2, e2[0], n2) }), e2)]), e.parseSliceAttributes = (t2) => { - const e2 = t2.attributes.getInts("starts"), n2 = t2.attributes.getInts("ends"), i3 = t2.attributes.getInts("axes", []); + e.slice = (t3, e2, n2) => (c(e2), [t3.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => u(t3, e2[0], n2) }), e2)]), e.parseSliceAttributes = (t3) => { + const e2 = t3.attributes.getInts("starts"), n2 = t3.attributes.getInts("ends"), i3 = t3.attributes.getInts("axes", []); return (0, r.createAttributeWithCacheKey)({ starts: e2, ends: n2, axes: i3 }); }; - const u = (t2, e2, n2) => { - const r2 = 0 === n2.axes.length ? e2.dims.slice(0).map((t3, e3) => e3) : n2.axes, i3 = o.ShapeUtil.normalizeAxes(r2, e2.dims.length), u2 = n2.starts.map((t3, n3) => t3 > e2.dims[i3[n3]] - 1 ? e2.dims[i3[n3]] : o.ShapeUtil.normalizeAxis(t3, e2.dims[i3[n3]])), c2 = n2.ends.map((t3, n3) => t3 > e2.dims[i3[n3]] - 1 ? e2.dims[i3[n3]] : o.ShapeUtil.normalizeAxis(t3, e2.dims[i3[n3]])), l2 = e2.dims.slice(), p2 = []; - for (let t3 = 0; t3 < i3.length; t3++) - l2[i3[t3]] = c2[t3] - u2[t3], u2[t3] > 0 && p2.push(`outputIdx[${i3[t3]}] += ${u2[t3]};`); + const u = (t3, e2, n2) => { + const r2 = 0 === n2.axes.length ? e2.dims.slice(0).map((t4, e3) => e3) : n2.axes, i3 = o.ShapeUtil.normalizeAxes(r2, e2.dims.length), u2 = n2.starts.map((t4, n3) => t4 > e2.dims[i3[n3]] - 1 ? e2.dims[i3[n3]] : o.ShapeUtil.normalizeAxis(t4, e2.dims[i3[n3]])), c2 = n2.ends.map((t4, n3) => t4 > e2.dims[i3[n3]] - 1 ? e2.dims[i3[n3]] : o.ShapeUtil.normalizeAxis(t4, e2.dims[i3[n3]])), l2 = e2.dims.slice(), p2 = []; + for (let t4 = 0; t4 < i3.length; t4++) + l2[i3[t4]] = c2[t4] - u2[t4], u2[t4] > 0 && p2.push(`outputIdx[${i3[t4]}] += ${u2[t4]};`); const f = ` float process(int outputIdx[${l2.length}]) { ${p2.join("\n ")} return _A(outputIdx); }`; return Object.assign(Object.assign({}, s), { output: { dims: l2, type: e2.type, textureType: a.TextureType.unpacked }, shaderSource: f }); - }, c = (t2) => { - if (!t2 || 1 !== t2.length) + }, c = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Slice requires 1 input."); - if (-1 === i2.NUMBER_TYPES.indexOf(t2[0].type)) + if (-1 === i2.NUMBER_TYPES.indexOf(t3[0].type)) throw new Error("Invalid input type."); }; - e.sliceV10 = (t2, e2) => { + e.sliceV10 = (t3, e2) => { p(e2); - const n2 = l(t2, e2); - return [t2.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => u(t2, e2[0], n2) }), [e2[0]])]; + const n2 = l(t3, e2); + return [t3.run(Object.assign(Object.assign({}, s), { cacheHint: n2.cacheKey, get: () => u(t3, e2[0], n2) }), [e2[0]])]; }; - const l = (t2, e2) => { - if (!t2.session.isInitializer(e2[1].dataId) || !t2.session.isInitializer(e2[2].dataId) || e2.length >= 4 && !t2.session.isInitializer(e2[3].dataId) || e2.length >= 5 && !t2.session.isInitializer(e2[4].dataId)) + const l = (t3, e2) => { + if (!t3.session.isInitializer(e2[1].dataId) || !t3.session.isInitializer(e2[2].dataId) || e2.length >= 4 && !t3.session.isInitializer(e2[3].dataId) || e2.length >= 5 && !t3.session.isInitializer(e2[4].dataId)) throw new Error("dynamic slice attributes are not allowed"); - if (e2.length >= 5 && e2[4].integerData.some((t3) => 1 !== t3)) + if (e2.length >= 5 && e2[4].integerData.some((t4) => 1 !== t4)) throw new Error("currently non-1 steps is not supported for Slice"); const n2 = Array.from(e2[1].integerData), r2 = Array.from(e2[2].integerData), i3 = e2.length >= 4 ? Array.from(e2[3].integerData) : []; return { starts: n2, ends: r2, axes: i3, cacheKey: `${i3};${n2};${r2}` }; - }, p = (t2) => { - if (!t2 || t2.length < 3 || t2.length > 5) + }, p = (t3) => { + if (!t3 || t3.length < 3 || t3.length > 5) throw new Error("Invalid input number."); - if ("int32" !== t2[1].type || 1 !== t2[1].dims.length) + if ("int32" !== t3[1].type || 1 !== t3[1].dims.length) throw new Error("Invalid input type."); - if ("int32" !== t2[2].type || 1 !== t2[2].dims.length) + if ("int32" !== t3[2].type || 1 !== t3[2].dims.length) throw new Error("Invalid input type."); - if (t2.length >= 4 && ("int32" !== t2[3].type || 1 !== t2[3].dims.length)) + if (t3.length >= 4 && ("int32" !== t3[3].type || 1 !== t3[3].dims.length)) throw new Error("Invalid input type."); - if (t2.length >= 5 && ("int32" !== t2[4].type || 1 !== t2[4].dims.length)) + if (t3.length >= 5 && ("int32" !== t3[4].type || 1 !== t3[4].dims.length)) throw new Error("Invalid input type."); }; - }, 5524: (t, e, n) => { + }, 5524: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.softmaxV13 = e.parseSoftmaxAttributesV13 = e.parseSoftmaxAttributes = e.softmax = void 0; const r = n(246), i2 = n(2517), o = n(5060), a = n(2039), s = n(3738), u = { name: "SoftmaxComputeMax", inputNames: ["A"], inputTypes: [a.TextureType.unpacked] }, c = { name: "SoftmaxComputeScale", inputNames: ["A", "Max"], inputTypes: [a.TextureType.unpacked, a.TextureType.unpacked] }, l = { name: "SoftMax", inputNames: ["A", "Max", "Norm"], inputTypes: [a.TextureType.unpacked, a.TextureType.unpacked, a.TextureType.unpacked] }; - e.softmax = (t2, e2, n2) => { + e.softmax = (t3, e2, n2) => { g(e2); const r2 = e2[0].dims.slice(), o2 = i2.ShapeUtil.normalizeAxis(n2.axis, r2.length), a2 = i2.ShapeUtil.sizeToDimension(r2, o2), s2 = i2.ShapeUtil.sizeFromDimension(r2, o2); - return p(t2, e2, n2, a2, s2); - }, e.parseSoftmaxAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ axis: t2.attributes.getInt("axis", 1) }), e.parseSoftmaxAttributesV13 = (t2) => (0, r.createAttributeWithCacheKey)({ axis: t2.attributes.getInt("axis", -1) }), e.softmaxV13 = (t2, e2, n2) => { + return p(t3, e2, n2, a2, s2); + }, e.parseSoftmaxAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ axis: t3.attributes.getInt("axis", 1) }), e.parseSoftmaxAttributesV13 = (t3) => (0, r.createAttributeWithCacheKey)({ axis: t3.attributes.getInt("axis", -1) }), e.softmaxV13 = (t3, e2, n2) => { g(e2); const o2 = e2[0].dims.slice(), a2 = i2.ShapeUtil.normalizeAxis(n2.axis, o2.length), u2 = o2.length, c2 = a2 !== u2 - 1, l2 = []; let f2, d2 = [], h2 = []; - c2 && (d2 = Array.from({ length: u2 }).map((t3, e3) => e3), d2[a2] = u2 - 1, d2[u2 - 1] = a2, d2.map((t3) => l2.push(o2[t3])), f2 = (0, r.createAttributeWithCacheKey)({ perm: d2 }), h2 = (0, s.transpose)(t2, e2, f2)); - const b = c2 ? i2.ShapeUtil.sizeToDimension(l2, u2 - 1) : i2.ShapeUtil.sizeToDimension(o2, u2 - 1), m = c2 ? i2.ShapeUtil.sizeFromDimension(l2, u2 - 1) : i2.ShapeUtil.sizeFromDimension(o2, u2 - 1), y = p(t2, c2 ? h2 : e2, n2, b, m); - return c2 ? (0, s.transpose)(t2, y, f2) : y; + c2 && (d2 = Array.from({ length: u2 }).map((t4, e3) => e3), d2[a2] = u2 - 1, d2[u2 - 1] = a2, d2.map((t4) => l2.push(o2[t4])), f2 = (0, r.createAttributeWithCacheKey)({ perm: d2 }), h2 = (0, s.transpose)(t3, e2, f2)); + const b = c2 ? i2.ShapeUtil.sizeToDimension(l2, u2 - 1) : i2.ShapeUtil.sizeToDimension(o2, u2 - 1), m = c2 ? i2.ShapeUtil.sizeFromDimension(l2, u2 - 1) : i2.ShapeUtil.sizeFromDimension(o2, u2 - 1), y = p(t3, c2 ? h2 : e2, n2, b, m); + return c2 ? (0, s.transpose)(t3, y, f2) : y; }; - const p = (t2, e2, n2, r2, i3) => { - const o2 = f(t2, e2[0], r2, i3, [r2]), a2 = t2.run(Object.assign(Object.assign({}, u), { cacheHint: n2.cacheKey, get: () => o2 }), e2), s2 = d(t2, e2[0], r2, i3, o2.output.dims, [r2]), p2 = t2.run(Object.assign(Object.assign({}, c), { cacheHint: n2.cacheKey, get: () => s2 }), [e2[0], a2]), g2 = h(t2, e2[0], r2, i3, o2.output.dims, s2.output.dims); - return [t2.run(Object.assign(Object.assign({}, l), { cacheHint: n2.cacheKey, get: () => g2 }), [e2[0], a2, p2])]; - }, f = (t2, e2, n2, r2, i3) => { - const [s2, c2] = t2.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), l2 = i3.length; + const p = (t3, e2, n2, r2, i3) => { + const o2 = f(t3, e2[0], r2, i3, [r2]), a2 = t3.run(Object.assign(Object.assign({}, u), { cacheHint: n2.cacheKey, get: () => o2 }), e2), s2 = d(t3, e2[0], r2, i3, o2.output.dims, [r2]), p2 = t3.run(Object.assign(Object.assign({}, c), { cacheHint: n2.cacheKey, get: () => s2 }), [e2[0], a2]), g2 = h(t3, e2[0], r2, i3, o2.output.dims, s2.output.dims); + return [t3.run(Object.assign(Object.assign({}, l), { cacheHint: n2.cacheKey, get: () => g2 }), [e2[0], a2, p2])]; + }, f = (t3, e2, n2, r2, i3) => { + const [s2, c2] = t3.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), l2 = i3.length; if (n2 < 1 || r2 < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1"); if (1 !== i3.length) throw new Error("Dimensionality of the output should be 1"); if (i3[0] !== n2) throw new Error("Shape of the output should be equal to logical row count"); - const p2 = (0, o.getGlsl)(t2.session.backend.glContext.version), f2 = ` + const p2 = (0, o.getGlsl)(t3.session.backend.glContext.version), f2 = ` float process(int[${l2}] indices) { int logical_row_start_offset = indices[0] * ${r2}; @@ -9770,8 +10455,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; return max; }`; return Object.assign(Object.assign({}, u), { output: { dims: i3, type: e2.type, textureType: a.TextureType.unpacked }, shaderSource: f2 }); - }, d = (t2, e2, n2, r2, i3, s2) => { - const [u2, l2] = t2.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), p2 = s2.length; + }, d = (t3, e2, n2, r2, i3, s2) => { + const [u2, l2] = t3.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), p2 = s2.length; if (n2 < 1 || r2 < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1"); if (1 !== s2.length) @@ -9790,15 +10475,15 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; float max = _Max(indices); for(int i=0; i<${r2}; ++i) { - norm_factor += exp(getColorAsFloat(${(0, o.getGlsl)(t2.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, + norm_factor += exp(getColorAsFloat(${(0, o.getGlsl)(t3.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, ${u2}, ${l2}))) - max); } return norm_factor; }`; return Object.assign(Object.assign({}, c), { output: { dims: s2, type: e2.type, textureType: a.TextureType.unpacked }, shaderSource: f2 }); - }, h = (t2, e2, n2, r2, i3, o2) => { - const [s2, u2] = t2.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), c2 = e2.dims.length; + }, h = (t3, e2, n2, r2, i3, o2) => { + const [s2, u2] = t3.calculateTextureWidthAndHeight(e2.dims, a.TextureType.unpacked), c2 = e2.dims.length; if (n2 < 1 || r2 < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1"); if (1 !== i3.length || 1 !== o2.length) @@ -9826,30 +10511,30 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; }`; return Object.assign(Object.assign({}, l), { output: { dims: e2.dims, type: e2.type, textureType: a.TextureType.unpacked }, shaderSource: p2 }); - }, g = (t2) => { - if (!t2 || 1 !== t2.length) + }, g = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Softmax requires 1 input."); - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("Invalid input type"); }; - }, 5975: (t, e, n) => { + }, 5975: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseSplitAttributes = e.split = void 0; const r = n(246), i2 = n(2517), o = n(2039), a = { name: "Split", inputNames: ["A"], inputTypes: [o.TextureType.unpacked] }; - e.split = (t2, e2, n2) => { + e.split = (t3, e2, n2) => { c(e2); - const r2 = i2.ShapeUtil.normalizeAxis(n2.axis, e2[0].dims.length), o2 = s(t2, e2, r2, n2), l = []; + const r2 = i2.ShapeUtil.normalizeAxis(n2.axis, e2[0].dims.length), o2 = s(t3, e2, r2, n2), l = []; for (let i3 = 0; i3 < o2; ++i3) - l.push(t2.run(Object.assign(Object.assign({}, a), { cacheHint: `${n2.cacheKey};${i3}`, get: () => u(t2, e2[0], n2, r2, i3) }), e2)); + l.push(t3.run(Object.assign(Object.assign({}, a), { cacheHint: `${n2.cacheKey};${i3}`, get: () => u(t3, e2[0], n2, r2, i3) }), e2)); return l; - }, e.parseSplitAttributes = (t2) => { - const e2 = t2.attributes.getInt("axis", 0), n2 = t2.attributes.getInts("split", []), i3 = t2.outputs.length; + }, e.parseSplitAttributes = (t3) => { + const e2 = t3.attributes.getInt("axis", 0), n2 = t3.attributes.getInts("split", []), i3 = t3.outputs.length; return (0, r.createAttributeWithCacheKey)({ axis: e2, split: n2, numOutputs: i3 }); }; - const s = (t2, e2, n2, r2) => { + const s = (t3, e2, n2, r2) => { const [, o2] = i2.SplitUtil.splitShape(e2[0].dims, n2, r2.split, r2.numOutputs); return o2.length; - }, u = (t2, e2, n2, r2, s2) => { + }, u = (t3, e2, n2, r2, s2) => { const [u2, c2] = i2.SplitUtil.splitShape(e2.dims, r2, n2.split, n2.numOutputs), l = c2[s2], p = u2[s2], f = ` float process(int indices[${p.length}]) { indices[${r2}] += ${l}; @@ -9857,79 +10542,79 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } `; return Object.assign(Object.assign({}, a), { cacheHint: `${n2.cacheKey}:${s2}`, output: { dims: p, type: e2.type, textureType: o.TextureType.unpacked }, shaderSource: f }); - }, c = (t2) => { - if (!t2 || 1 !== t2.length) + }, c = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Split requires one input."); - if ("int8" !== t2[0].type && "uint8" !== t2[0].type && "int16" !== t2[0].type && "uint16" !== t2[0].type && "int32" !== t2[0].type && "uint32" !== t2[0].type && "float32" !== t2[0].type && "float64" !== t2[0].type && "bool" !== t2[0].type) + if ("int8" !== t3[0].type && "uint8" !== t3[0].type && "int16" !== t3[0].type && "uint16" !== t3[0].type && "int32" !== t3[0].type && "uint32" !== t3[0].type && "float32" !== t3[0].type && "float64" !== t3[0].type && "bool" !== t3[0].type) throw new Error("Invalid input type."); }; - }, 3933: (t, e, n) => { + }, 3933: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseSqueezeAttributes = e.squeezeV13 = e.squeeze = void 0; const r = n(2517); - e.squeeze = (t2, e2, n2) => { + e.squeeze = (t3, e2, n2) => { i2(e2); const o2 = r.ShapeUtil.squeezeShape(e2[0].dims, n2); - return [t2.reshapeUnpacked(e2[0], o2)]; - }, e.squeezeV13 = (t2, n2) => (o(n2), (0, e.squeeze)(t2, [n2[0]], Array.from(n2[1].integerData))), e.parseSqueezeAttributes = (t2) => t2.attributes.getInts("axes"); - const i2 = (t2) => { - if (!t2 || 1 !== t2.length) + return [t3.reshapeUnpacked(e2[0], o2)]; + }, e.squeezeV13 = (t3, n2) => (o(n2), (0, e.squeeze)(t3, [n2[0]], Array.from(n2[1].integerData))), e.parseSqueezeAttributes = (t3) => t3.attributes.getInts("axes"); + const i2 = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Squeeze requires 1 input."); - if ("string" === t2[0].type) + if ("string" === t3[0].type) throw new Error("invalid input tensor types."); - }, o = (t2) => { - if (!t2 || 2 !== t2.length) + }, o = (t3) => { + if (!t3 || 2 !== t3.length) throw new Error("Squeeze requires 2 inputs."); - if ("int32" !== t2[1].type) + if ("int32" !== t3[1].type) throw new Error("Invalid input type."); }; - }, 6558: (t, e, n) => { + }, 6558: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.sum = void 0; const r = n(5060), i2 = n(2039); - e.sum = (t2, e2) => { + e.sum = (t3, e2) => { a(e2); - const n2 = { name: "Sum", inputNames: e2.map((t3, e3) => `X${e3}`), inputTypes: new Array(e2.length).fill(i2.TextureType.unpacked) }; - return [t2.run(Object.assign(Object.assign({}, n2), { get: () => o(t2, e2, n2) }), e2)]; + const n2 = { name: "Sum", inputNames: e2.map((t4, e3) => `X${e3}`), inputTypes: new Array(e2.length).fill(i2.TextureType.unpacked) }; + return [t3.run(Object.assign(Object.assign({}, n2), { get: () => o(t3, e2, n2) }), e2)]; }; - const o = (t2, e2, n2) => { - const o2 = (0, r.getGlsl)(t2.session.backend.glContext.version), a2 = e2[0].dims.slice(), s = e2.map((t3, e3) => `${o2.texture2D}(X${e3},TexCoords)`).join(" + "), u = ` + const o = (t3, e2, n2) => { + const o2 = (0, r.getGlsl)(t3.session.backend.glContext.version), a2 = e2[0].dims.slice(), s = e2.map((t4, e3) => `${o2.texture2D}(X${e3},TexCoords)`).join(" + "), u = ` void main() { vec4 result = ${s}; ${o2.output} = result; } `; return Object.assign(Object.assign({}, n2), { output: { dims: a2, type: e2[0].type, textureType: i2.TextureType.unpacked }, hasMain: true, shaderSource: u }); - }, a = (t2) => { - if (!t2 || 0 === t2.length) + }, a = (t3) => { + if (!t3 || 0 === t3.length) throw new Error("Sum requires inputs."); - const e2 = t2[0].dims.length; - for (let n2 = 1; n2 < t2.length; n2++) { - if (e2 !== t2[n2].dims.length) + const e2 = t3[0].dims.length; + for (let n2 = 1; n2 < t3.length; n2++) { + if (e2 !== t3[n2].dims.length) throw new Error("Input shapes are mismatched."); for (let r2 = 0; r2 < e2; r2++) - if (t2[0].dims[r2] !== t2[n2].dims[r2]) + if (t3[0].dims[r2] !== t3[n2].dims[r2]) throw new Error("Input shapes are not matched."); } - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("Invalid input type."); - for (let e3 = 1; e3 < t2.length; e3++) - if (t2[0].type !== t2[e3].type) + for (let e3 = 1; e3 < t3.length; e3++) + if (t3[0].type !== t3[e3].type) throw new Error("Input types are not matched."); }; - }, 5723: (t, e, n) => { + }, 5723: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.tile = void 0; const r = n(782), i2 = n(2039); - e.tile = (t2, e2) => { + e.tile = (t3, e2) => { a(e2); const n2 = { name: "Tile", inputNames: ["A"], inputTypes: [i2.TextureType.unpacked] }; - return [t2.run(Object.assign(Object.assign({}, n2), { get: () => o(t2, e2, n2) }), e2)]; + return [t3.run(Object.assign(Object.assign({}, n2), { get: () => o(t3, e2, n2) }), e2)]; }; - const o = (t2, e2, n2) => { + const o = (t3, e2, n2) => { const r2 = e2[0].dims.slice(), o2 = new Array(r2.length), a2 = []; - for (let t3 = 0; t3 < r2.length; t3++) - o2[t3] = r2[t3] * e2[1].numberData[t3], a2.push(`inputIdx[${t3}] = int(mod(float(outputIdx[${t3}]), ${r2[t3]}.));`); + for (let t4 = 0; t4 < r2.length; t4++) + o2[t4] = r2[t4] * e2[1].numberData[t4], a2.push(`inputIdx[${t4}] = int(mod(float(outputIdx[${t4}]), ${r2[t4]}.));`); const s = o2.length, u = ` float process(int outputIdx[${s}]) { int inputIdx[${s}]; @@ -9938,24 +10623,24 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; } `; return Object.assign(Object.assign({}, n2), { output: { dims: o2, type: e2[0].type, textureType: i2.TextureType.unpacked }, shaderSource: u }); - }, a = (t2) => { - if (!t2 || 2 !== t2.length) + }, a = (t3) => { + if (!t3 || 2 !== t3.length) throw new Error("Tile requires 2 input."); - if (1 !== t2[1].dims.length) + if (1 !== t3[1].dims.length) throw new Error("The second input shape must 1 dimension."); - if (t2[1].dims[0] !== t2[0].dims.length) + if (t3[1].dims[0] !== t3[0].dims.length) throw new Error("Invalid input shape."); - if (-1 === r.NUMBER_TYPES.indexOf(t2[0].type)) + if (-1 === r.NUMBER_TYPES.indexOf(t3[0].type)) throw new Error("Invalid input type."); - if ("int32" !== t2[1].type && "int16" !== t2[1].type) + if ("int32" !== t3[1].type && "int16" !== t3[1].type) throw new Error("Invalid repeat type."); }; - }, 3738: (t, e, n) => { + }, 3738: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseTransposeAttributes = e.transpose = void 0; const r = n(246), i2 = n(2517), o = n(2039), a = { name: "Transpose", inputNames: ["A"], inputTypes: [o.TextureType.unpacked] }; - e.transpose = (t2, e2, n2) => (p(e2), [t2.run(Object.assign(Object.assign({}, a), { cacheHint: n2.cacheKey, get: () => s(t2, e2[0], n2.perm) }), e2)]), e.parseTransposeAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ perm: t2.attributes.getInts("perm", []) }); - const s = (t2, e2, n2) => { + e.transpose = (t3, e2, n2) => (p(e2), [t3.run(Object.assign(Object.assign({}, a), { cacheHint: n2.cacheKey, get: () => s(t3, e2[0], n2.perm) }), e2)]), e.parseTransposeAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ perm: t3.attributes.getInts("perm", []) }); + const s = (t3, e2, n2) => { const r2 = e2.dims; n2 = u(r2, n2); const i3 = c(r2, n2), s2 = r2.length, p2 = ` @@ -9966,24 +10651,24 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; return _A(a); }`; return Object.assign(Object.assign({}, a), { output: { dims: i3, type: e2.type, textureType: o.TextureType.unpacked }, shaderSource: p2 }); - }, u = (t2, e2) => (e2 && e2.length !== t2.length && (e2 = [...t2.keys()].reverse()), e2), c = (t2, e2) => (e2 = u(t2, e2), i2.ShapeUtil.sortBasedOnPerm(t2, e2)), l = (t2, e2, n2) => { + }, u = (t3, e2) => (e2 && e2.length !== t3.length && (e2 = [...t3.keys()].reverse()), e2), c = (t3, e2) => (e2 = u(t3, e2), i2.ShapeUtil.sortBasedOnPerm(t3, e2)), l = (t3, e2, n2) => { const r2 = []; - r2.push(`void ${t2}(out int a[${n2}], int src[${n2}]) {`); - for (let t3 = 0; t3 < n2; ++t3) - r2.push(` a[${e2[t3]}]=src[${t3}];`); + r2.push(`void ${t3}(out int a[${n2}], int src[${n2}]) {`); + for (let t4 = 0; t4 < n2; ++t4) + r2.push(` a[${e2[t4]}]=src[${t4}];`); return r2.push(" }"), r2.join("\n"); - }, p = (t2) => { - if (!t2 || 1 !== t2.length) + }, p = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Transpose requires 1 input."); - if ("float32" !== t2[0].type && "float64" !== t2[0].type) + if ("float32" !== t3[0].type && "float64" !== t3[0].type) throw new Error("input should be float tensor"); }; - }, 8710: (t, e, n) => { + }, 8710: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.encodeAsUint8 = void 0; const r = n(5060), i2 = n(2039); - e.encodeAsUint8 = (t2, e2) => { - const n2 = e2.shape, o = (0, r.getGlsl)(t2.session.backend.glContext.version), a = ` + e.encodeAsUint8 = (t3, e2) => { + const n2 = e2.shape, o = (0, r.getGlsl)(t3.session.backend.glContext.version), a = ` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -10031,9 +10716,9 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; float value = ${o.texture2D}(X,TexCoords).r; ${o.output} = encodeAsUint8(value); }`, s = { name: "Uint8Encode", inputTypes: [i2.TextureType.unpacked], inputNames: ["X"], output: { dims: n2, type: e2.tensor.type, textureType: i2.TextureType.downloadUint8AsFloat }, shaderSource: a, hasMain: true }; - return t2.executeProgram(s, [e2.tensor]); + return t3.executeProgram(s, [e2.tensor]); }; - }, 4909: (t, e, n) => { + }, 4909: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.tanh = e.tan = e.sqrt = e.sin = e.sigmoid = e.relu = e.not = e.neg = e.log = e.parseLeakyReluAttributes = e.leakyRelu = e.identity = e.floor = e.exp = e.parseEluAttributes = e.elu = e.cos = e.ceil = e.clipV11 = e.parseClipAttributes = e.clip = e.atan = e.asin = e.acos = e.abs = e.glslTanh = e.glslTan = e.glslSqrt = e.glslSigmoid = e.glslRelu = e.glslSin = e.glslNot = e.glslNeg = e.glslLog = e.glslLeakyRelu = e.glslIdentity = e.glslClip = e.glslFloor = e.glslExp = e.glslElu = e.glslCos = e.glslCeil = e.glslAtan = e.glslAsin = e.glslAcos = e.glslAbs = void 0; const r = n(246), i2 = n(2517), o = n(8520), a = n(5060), s = n(2039); @@ -10055,10 +10740,10 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; function d() { return P("cos"); } - function h(t2) { + function h(t3) { const e2 = "elu"; return { body: ` - const float alpha = float(${t2}); + const float alpha = float(${t3}); float ${e2}_(float a) { return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; @@ -10074,10 +10759,10 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; function b() { return P("floor"); } - function m(t2, e2) { + function m(t3, e2) { const n2 = "clip"; return { body: ` - const float min = float(${t2}); + const float min = float(${t3}); const float max = float(${e2}); float ${n2}_(float a) { @@ -10089,20 +10774,20 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; `, name: n2, type: o.FunctionType.ValueBased }; } function y() { - const t2 = "indentity"; + const t3 = "indentity"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { return a; } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { return v; } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } - function _(t2) { + function _(t3) { const e2 = "leakyRelu"; return { body: ` - const float alpha = float(${t2}); + const float alpha = float(${t3}); float ${e2}_(float a) { return a < 0.0 ? a * alpha : a; @@ -10116,57 +10801,57 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; return P("log"); } function w() { - const t2 = "neg"; + const t3 = "neg"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { return -a; } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { return -v; } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } function x() { - const t2 = "not"; + const t3 = "not"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { return float( ! bool(a) ); } - bool ${t2}_(bool a) { + bool ${t3}_(bool a) { return !a; } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); } - bvec4 ${t2}_(bvec4 v) { + bvec4 ${t3}_(bvec4 v) { return bvec4(!v.x, !v.y, !v.z, !v.w); } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } function T() { return P("sin"); } function S() { - const t2 = "relu"; + const t3 = "relu"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { return max( a, 0.0 ); } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { return max( v, 0.0 ); } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } function O() { - const t2 = "sigmoid"; + const t3 = "sigmoid"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { return 1.0 / (1.0 + exp(-a)); } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { return 1.0 / (1.0 + exp(-v)); } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } function A() { return P("sqrt"); @@ -10175,35 +10860,35 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; return P("tan"); } function I() { - const t2 = "tanh"; + const t3 = "tanh"; return { body: ` - float ${t2}_(float a) { + float ${t3}_(float a) { a = clamp(a, -10., 10.); a = exp(2.*a); return (a - 1.) / (a + 1.); } - vec4 ${t2}_(vec4 v) { + vec4 ${t3}_(vec4 v) { v = clamp(v, -10., 10.); v = exp(2.*v); return (v - 1.) / (v + 1.); } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } - function P(t2) { + function P(t3) { return { body: ` - float ${t2}_(float a) { - return ${t2}(a); + float ${t3}_(float a) { + return ${t3}(a); } - vec4 ${t2}_(vec4 v) { - return ${t2}(v); + vec4 ${t3}_(vec4 v) { + return ${t3}(v); } - `, name: t2, type: o.FunctionType.ValueBased }; + `, name: t3, type: o.FunctionType.ValueBased }; } e.glslAbs = u, e.glslAcos = c, e.glslAsin = l, e.glslAtan = p, e.glslCeil = f, e.glslCos = d, e.glslElu = h, e.glslExp = g, e.glslFloor = b, e.glslClip = m, e.glslIdentity = y, e.glslLeakyRelu = _, e.glslLog = v, e.glslNeg = w, e.glslNot = x, e.glslSin = T, e.glslRelu = S, e.glslSigmoid = O, e.glslSqrt = A, e.glslTan = E, e.glslTanh = I; - const D = (t2, e2, n2, r2) => { - const i3 = t2.session.pack ? s.TextureType.packed : s.TextureType.unpacked, o2 = { name: n2.name, inputTypes: [i3], inputNames: ["A"], cacheHint: r2 }; - return Object.assign(Object.assign({}, o2), { get: () => ((t3, e3, n3, r3) => { - const i4 = t3.session.pack ? s.TextureType.packed : s.TextureType.unpacked, o3 = (0, a.getGlsl)(t3.session.backend.glContext.version); + const D = (t3, e2, n2, r2) => { + const i3 = t3.session.pack ? s.TextureType.packed : s.TextureType.unpacked, o2 = { name: n2.name, inputTypes: [i3], inputNames: ["A"], cacheHint: r2 }; + return Object.assign(Object.assign({}, o2), { get: () => ((t4, e3, n3, r3) => { + const i4 = t4.session.pack ? s.TextureType.packed : s.TextureType.unpacked, o3 = (0, a.getGlsl)(t4.session.backend.glContext.version); return Object.assign(Object.assign({}, e3), { output: { dims: n3.dims, type: n3.type, textureType: i4 }, shaderSource: ` ${r3.body} void main() { @@ -10212,30 +10897,30 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; ${o3.output} = v; } `, hasMain: true }); - })(t2, o2, e2, n2) }); + })(t3, o2, e2, n2) }); }; - e.abs = (t2, e2) => [t2.run(D(t2, e2[0], u()), e2)], e.acos = (t2, e2) => [t2.run(D(t2, e2[0], c()), e2)], e.asin = (t2, e2) => [t2.run(D(t2, e2[0], l()), e2)], e.atan = (t2, e2) => [t2.run(D(t2, e2[0], p()), e2)], e.clip = (t2, e2, n2) => [t2.run(D(t2, e2[0], m(n2.min, n2.max), n2.cacheKey), e2)], e.parseClipAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ min: t2.attributes.getFloat("min", i2.MIN_CLIP), max: t2.attributes.getFloat("max", i2.MAX_CLIP) }), e.clipV11 = (t2, n2) => { - const r2 = $(t2, n2); - return (0, e.clip)(t2, [n2[0]], r2); + e.abs = (t3, e2) => [t3.run(D(t3, e2[0], u()), e2)], e.acos = (t3, e2) => [t3.run(D(t3, e2[0], c()), e2)], e.asin = (t3, e2) => [t3.run(D(t3, e2[0], l()), e2)], e.atan = (t3, e2) => [t3.run(D(t3, e2[0], p()), e2)], e.clip = (t3, e2, n2) => [t3.run(D(t3, e2[0], m(n2.min, n2.max), n2.cacheKey), e2)], e.parseClipAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ min: t3.attributes.getFloat("min", i2.MIN_CLIP), max: t3.attributes.getFloat("max", i2.MAX_CLIP) }), e.clipV11 = (t3, n2) => { + const r2 = $(t3, n2); + return (0, e.clip)(t3, [n2[0]], r2); }; - const $ = (t2, e2) => { - if (e2.length >= 3 && (!t2.session.isInitializer(e2[1].dataId) || !t2.session.isInitializer(e2[2].dataId))) + const $ = (t3, e2) => { + if (e2.length >= 3 && (!t3.session.isInitializer(e2[1].dataId) || !t3.session.isInitializer(e2[2].dataId))) throw new Error("dynamic clip attributes are not allowed"); const n2 = e2.length >= 3 ? e2[1].numberData[0] : i2.MIN_CLIP, o2 = e2.length >= 3 ? e2[2].numberData[0] : i2.MAX_CLIP; return (0, r.createAttributeWithCacheKey)({ min: n2, max: o2 }); }; - e.ceil = (t2, e2) => [t2.run(D(t2, e2[0], f()), e2)], e.cos = (t2, e2) => [t2.run(D(t2, e2[0], d()), e2)], e.elu = (t2, e2, n2) => [t2.run(D(t2, e2[0], h(n2.alpha), n2.cacheKey), e2)], e.parseEluAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ alpha: t2.attributes.getFloat("alpha", 1) }), e.exp = (t2, e2) => [t2.run(D(t2, e2[0], g()), e2)], e.floor = (t2, e2) => [t2.run(D(t2, e2[0], b()), e2)], e.identity = (t2, e2) => [t2.run(D(t2, e2[0], y()), e2)], e.leakyRelu = (t2, e2, n2) => [t2.run(D(t2, e2[0], _(n2.alpha), n2.cacheKey), e2)], e.parseLeakyReluAttributes = (t2) => (0, r.createAttributeWithCacheKey)({ alpha: t2.attributes.getFloat("alpha", 0.01) }), e.log = (t2, e2) => [t2.run(D(t2, e2[0], v()), e2)], e.neg = (t2, e2) => [t2.run(D(t2, e2[0], w()), e2)], e.not = (t2, e2) => [t2.run(D(t2, e2[0], x()), e2)], e.relu = (t2, e2) => [t2.run(D(t2, e2[0], S()), e2)], e.sigmoid = (t2, e2) => [t2.run(D(t2, e2[0], O()), e2)], e.sin = (t2, e2) => [t2.run(D(t2, e2[0], T()), e2)], e.sqrt = (t2, e2) => [t2.run(D(t2, e2[0], A()), e2)], e.tan = (t2, e2) => [t2.run(D(t2, e2[0], E()), e2)], e.tanh = (t2, e2) => [t2.run(D(t2, e2[0], I()), e2)]; - }, 5611: (t, e, n) => { + e.ceil = (t3, e2) => [t3.run(D(t3, e2[0], f()), e2)], e.cos = (t3, e2) => [t3.run(D(t3, e2[0], d()), e2)], e.elu = (t3, e2, n2) => [t3.run(D(t3, e2[0], h(n2.alpha), n2.cacheKey), e2)], e.parseEluAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ alpha: t3.attributes.getFloat("alpha", 1) }), e.exp = (t3, e2) => [t3.run(D(t3, e2[0], g()), e2)], e.floor = (t3, e2) => [t3.run(D(t3, e2[0], b()), e2)], e.identity = (t3, e2) => [t3.run(D(t3, e2[0], y()), e2)], e.leakyRelu = (t3, e2, n2) => [t3.run(D(t3, e2[0], _(n2.alpha), n2.cacheKey), e2)], e.parseLeakyReluAttributes = (t3) => (0, r.createAttributeWithCacheKey)({ alpha: t3.attributes.getFloat("alpha", 0.01) }), e.log = (t3, e2) => [t3.run(D(t3, e2[0], v()), e2)], e.neg = (t3, e2) => [t3.run(D(t3, e2[0], w()), e2)], e.not = (t3, e2) => [t3.run(D(t3, e2[0], x()), e2)], e.relu = (t3, e2) => [t3.run(D(t3, e2[0], S()), e2)], e.sigmoid = (t3, e2) => [t3.run(D(t3, e2[0], O()), e2)], e.sin = (t3, e2) => [t3.run(D(t3, e2[0], T()), e2)], e.sqrt = (t3, e2) => [t3.run(D(t3, e2[0], A()), e2)], e.tan = (t3, e2) => [t3.run(D(t3, e2[0], E()), e2)], e.tanh = (t3, e2) => [t3.run(D(t3, e2[0], I()), e2)]; + }, 5611: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createUnpackProgramInfoLoader = e.createUnpackProgramInfo = void 0; const r = n(5060), i2 = n(2039), o = n(9390), a = n(2827), s = { name: "unpack", inputNames: ["A"], inputTypes: [i2.TextureType.packed] }; - e.createUnpackProgramInfo = (t2, e2) => { - const n2 = e2.dims.length, u = (0, a.getChannels)("rc", n2), c = u.slice(-2), l = (0, o.getCoordsDataType)(n2), p = (0, a.unpackFromChannel)(), f = 0 === e2.dims.length ? "" : function(t3, e3) { - if (1 === t3) + e.createUnpackProgramInfo = (t3, e2) => { + const n2 = e2.dims.length, u = (0, a.getChannels)("rc", n2), c = u.slice(-2), l = (0, o.getCoordsDataType)(n2), p = (0, a.unpackFromChannel)(), f = 0 === e2.dims.length ? "" : function(t4, e3) { + if (1 === t4) return "rc"; let n3 = ""; - for (let r2 = 0; r2 < t3; r2++) - n3 += e3[r2], r2 < t3 - 1 && (n3 += ","); + for (let r2 = 0; r2 < t4; r2++) + n3 += e3[r2], r2 < t4 - 1 && (n3 += ","); return n3; }(n2, u), d = n2 <= 1 ? "rc" : `vec2(${c.join(",")})`, h = ` ${p} @@ -10245,64 +10930,64 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; // Sample the texture with the coords to get the rgba channel value. vec4 packedInput = getA(${f}); - ${(0, r.getGlsl)(t2.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${d}), 0, 0, 0); + ${(0, r.getGlsl)(t3.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${d}), 0, 0, 0); } `; return Object.assign(Object.assign({}, s), { hasMain: true, output: { dims: e2.dims, type: e2.type, textureType: i2.TextureType.unpacked }, shaderSource: h }); - }, e.createUnpackProgramInfoLoader = (t2, n2) => Object.assign(Object.assign({}, s), { get: () => (0, e.createUnpackProgramInfo)(t2, n2) }); - }, 8428: (t, e, n) => { + }, e.createUnpackProgramInfoLoader = (t3, n2) => Object.assign(Object.assign({}, s), { get: () => (0, e.createUnpackProgramInfo)(t3, n2) }); + }, 8428: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.parseUnsqueezeAttributes = e.unsqueezeV13 = e.unsqueeze = void 0; const r = n(2517); - e.unsqueeze = (t2, e2, n2) => { + e.unsqueeze = (t3, e2, n2) => { i2(e2); const o2 = r.ShapeUtil.unsqueezeShape(e2[0].dims, n2); - return [t2.reshapeUnpacked(e2[0], o2)]; - }, e.unsqueezeV13 = (t2, n2) => (o(n2), (0, e.unsqueeze)(t2, [n2[0]], Array.from(n2[1].integerData))), e.parseUnsqueezeAttributes = (t2) => t2.attributes.getInts("axes"); - const i2 = (t2) => { - if (!t2 || 1 !== t2.length) + return [t3.reshapeUnpacked(e2[0], o2)]; + }, e.unsqueezeV13 = (t3, n2) => (o(n2), (0, e.unsqueeze)(t3, [n2[0]], Array.from(n2[1].integerData))), e.parseUnsqueezeAttributes = (t3) => t3.attributes.getInts("axes"); + const i2 = (t3) => { + if (!t3 || 1 !== t3.length) throw new Error("Unsqueeze requires 1 input."); - if ("string" === t2[0].type) + if ("string" === t3[0].type) throw new Error("invalid input tensor types."); - }, o = (t2) => { - if (!t2 || 2 !== t2.length) + }, o = (t3) => { + if (!t3 || 2 !== t3.length) throw new Error("Unsqueeze requires 2 inputs."); - if ("int32" !== t2[1].type) + if ("int32" !== t3[1].type) throw new Error("Invalid input type."); }; - }, 9793: (t, e, n) => { + }, 9793: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.scalesValidation = e.validateInputs = e.parseUpsampleAttributes = e.parseUpsampleAttributesV9 = e.parseUpsampleAttributesV7 = e.upsample = void 0; const r = n(246), i2 = n(5060), o = n(2039), a = { name: "Upsample", inputNames: ["X"], inputTypes: [o.TextureType.unpacked] }; - e.upsample = (t2, n2, r2) => ((0, e.validateInputs)(n2, r2), [t2.run(Object.assign(Object.assign({}, a), { cacheHint: r2.cacheKey, get: () => s(t2, n2, r2) }), n2)]), e.parseUpsampleAttributesV7 = (t2) => (0, e.parseUpsampleAttributes)(t2, 7), e.parseUpsampleAttributesV9 = (t2) => (0, e.parseUpsampleAttributes)(t2, 9), e.parseUpsampleAttributes = (t2, n2) => { - const i3 = n2 >= 10, o2 = t2.attributes.getString("mode", "nearest"); + e.upsample = (t3, n2, r2) => ((0, e.validateInputs)(n2, r2), [t3.run(Object.assign(Object.assign({}, a), { cacheHint: r2.cacheKey, get: () => s(t3, n2, r2) }), n2)]), e.parseUpsampleAttributesV7 = (t3) => (0, e.parseUpsampleAttributes)(t3, 7), e.parseUpsampleAttributesV9 = (t3) => (0, e.parseUpsampleAttributes)(t3, 9), e.parseUpsampleAttributes = (t3, n2) => { + const i3 = n2 >= 10, o2 = t3.attributes.getString("mode", "nearest"); if ("nearest" !== o2 && "linear" !== o2 && (n2 < 11 || "cubic" !== o2)) throw new Error(`unrecognized mode: ${o2}`); let a2 = []; - n2 < 9 && (a2 = t2.attributes.getFloats("scales"), (0, e.scalesValidation)(a2, o2, i3)); - const s2 = t2.attributes.getFloat("extrapolation_value", 0), u = n2 > 10 ? t2.attributes.getString("coordinate_transformation_mode", "half_pixel") : "asymmetric"; + n2 < 9 && (a2 = t3.attributes.getFloats("scales"), (0, e.scalesValidation)(a2, o2, i3)); + const s2 = t3.attributes.getFloat("extrapolation_value", 0), u = n2 > 10 ? t3.attributes.getString("coordinate_transformation_mode", "half_pixel") : "asymmetric"; if (-1 === ["asymmetric", "pytorch_half_pixel", "tf_half_pixel_for_nn", "align_corners", "tf_crop_and_resize", "half_pixel"].indexOf(u)) throw new Error(`coordinate_transform_mode '${u}' is not supported`); - const c = "tf_crop_and_resize" === u, l = c, p = "nearest" === o2 && n2 >= 11 ? t2.attributes.getString("nearest_mode", "round_prefer_floor") : ""; + const c = "tf_crop_and_resize" === u, l = c, p = "nearest" === o2 && n2 >= 11 ? t3.attributes.getString("nearest_mode", "round_prefer_floor") : ""; if (-1 === ["round_prefer_floor", "round_prefer_ceil", "floor", "ceil", ""].indexOf(p)) throw new Error(`nearest_mode '${p}' is not supported`); - const f = t2.attributes.getFloat("cubic_coeff_a", -0.75), d = 0 !== t2.attributes.getInt("exclude_outside", 0); + const f = t3.attributes.getFloat("cubic_coeff_a", -0.75), d = 0 !== t3.attributes.getInt("exclude_outside", 0); if (d && "cubic" !== o2) throw new Error("exclude_outside can be set to 1 only when mode is CUBIC."); const h = n2 < 11 || "nearest" === o2 && "asymmetric" === u && "floor" === p; let g = 0, b = 0, m = 0; - return n2 > 10 ? t2.inputs.length > 2 ? (g = 1, b = 2, m = 3) : (b = 1, m = 2) : 9 === n2 && (b = 1), (0, r.createAttributeWithCacheKey)({ opset: n2, isResize: i3, mode: o2, scales: a2, extrapolationValue: s2, coordinateTransformMode: u, useExtrapolation: l, needRoiInput: c, nearestMode: p, cubicCoefficientA: f, excludeOutside: d, useNearest2xOptimization: h, roiInputIdx: g, scalesInputIdx: b, sizesInputIdx: m }); + return n2 > 10 ? t3.inputs.length > 2 ? (g = 1, b = 2, m = 3) : (b = 1, m = 2) : 9 === n2 && (b = 1), (0, r.createAttributeWithCacheKey)({ opset: n2, isResize: i3, mode: o2, scales: a2, extrapolationValue: s2, coordinateTransformMode: u, useExtrapolation: l, needRoiInput: c, nearestMode: p, cubicCoefficientA: f, excludeOutside: d, useNearest2xOptimization: h, roiInputIdx: g, scalesInputIdx: b, sizesInputIdx: m }); }; - const s = (t2, e2, n2) => { - const r2 = (0, i2.getGlsl)(t2.session.backend.glContext.version), [s2, u] = t2.calculateTextureWidthAndHeight(e2[0].dims, o.TextureType.unpacked), c = e2[0].dims.map((t3, e3) => Math.floor(t3 * n2.scales[e3])), [l, p] = t2.calculateTextureWidthAndHeight(c, o.TextureType.unpacked), f = c.length, d = new Array(f), h = new Array(f); + const s = (t3, e2, n2) => { + const r2 = (0, i2.getGlsl)(t3.session.backend.glContext.version), [s2, u] = t3.calculateTextureWidthAndHeight(e2[0].dims, o.TextureType.unpacked), c = e2[0].dims.map((t4, e3) => Math.floor(t4 * n2.scales[e3])), [l, p] = t3.calculateTextureWidthAndHeight(c, o.TextureType.unpacked), f = c.length, d = new Array(f), h = new Array(f); let g = ` int output_pitches[${f}]; int input_pitches[${f}]; `; - for (let t3 = f - 1; t3 >= 0; t3--) - d[t3] = t3 === f - 1 ? 1 : d[t3 + 1] * c[t3 + 1], h[t3] = t3 === f - 1 ? 1 : h[t3 + 1] * e2[0].dims[t3 + 1], g += ` - output_pitches[${t3}] = ${d[t3]}; - input_pitches[${t3}] = ${h[t3]}; + for (let t4 = f - 1; t4 >= 0; t4--) + d[t4] = t4 === f - 1 ? 1 : d[t4 + 1] * c[t4 + 1], h[t4] = t4 === f - 1 ? 1 : h[t4 + 1] * e2[0].dims[t4 + 1], g += ` + output_pitches[${t4}] = ${d[t4]}; + input_pitches[${t4}] = ${h[t4]}; `; const b = ` float getInputFloat(int index) { @@ -10435,51 +11120,51 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); }`; - return Object.assign(Object.assign({}, a), { output: { dims: c, type: e2[0].type, textureType: o.TextureType.unpacked }, shaderSource: m, variables: [{ name: "scales", type: "int", arrayLength: n2.scales.length, data: n2.scales.map((t3) => Math.ceil(t3)) }] }); + return Object.assign(Object.assign({}, a), { output: { dims: c, type: e2[0].type, textureType: o.TextureType.unpacked }, shaderSource: m, variables: [{ name: "scales", type: "int", arrayLength: n2.scales.length, data: n2.scales.map((t4) => Math.ceil(t4)) }] }); }; - e.validateInputs = (t2, e2) => { - if (!t2 || e2.opset < 9 && 1 !== t2.length || e2.opset >= 9 && e2.opset < 11 && 2 !== t2.length || e2.opset >= 11 && t2.length < 2) + e.validateInputs = (t3, e2) => { + if (!t3 || e2.opset < 9 && 1 !== t3.length || e2.opset >= 9 && e2.opset < 11 && 2 !== t3.length || e2.opset >= 11 && t3.length < 2) throw new Error("invalid inputs."); - if (e2.scales.length > 0 && t2[0].dims.length !== e2.scales.length) + if (e2.scales.length > 0 && t3[0].dims.length !== e2.scales.length) throw new Error("Invalid input shape."); - if ("string" === t2[0].type) + if ("string" === t3[0].type) throw new Error("Invalid input tensor types."); - }, e.scalesValidation = (t2, e2, n2) => { + }, e.scalesValidation = (t3, e2, n2) => { if (n2) { - for (const e3 of t2) + for (const e3 of t3) if (e3 <= 0) throw new Error("Scale value should be greater than 0."); } else - for (const e3 of t2) + for (const e3 of t3) if (e3 < 1) throw new Error("Scale value should be greater than or equal to 1."); - if (!("linear" !== e2 && "cubic" !== e2 || 2 === t2.length || 4 === t2.length && 1 === t2[0] && 1 === t2[1])) + if (!("linear" !== e2 && "cubic" !== e2 || 2 === t3.length || 4 === t3.length && 1 === t3[0] && 1 === t3[1])) throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n2 ? "Resize" : "Upsample"} opeartor.`); }; - }, 1958: (t, e, n) => { + }, 1958: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.ProgramManager = void 0; const r = n(6207), i2 = n(3694), o = n(8879), a = n(5060); e.ProgramManager = class { - constructor(t2, e2, n2) { - this.profiler = t2, this.glContext = e2, this.textureLayoutStrategy = n2, this.repo = /* @__PURE__ */ new Map(), this.attributesBound = false; + constructor(t3, e2, n2) { + this.profiler = t3, this.glContext = e2, this.textureLayoutStrategy = n2, this.repo = /* @__PURE__ */ new Map(), this.attributesBound = false; } - getArtifact(t2) { - return this.repo.get(t2); + getArtifact(t3) { + return this.repo.get(t3); } - setArtifact(t2, e2) { - this.repo.set(t2, e2); + setArtifact(t3, e2) { + this.repo.set(t3, e2); } - run(t2, e2, n2) { + run(t3, e2, n2) { var r2; - this.profiler.event("op", `ProgramManager.run ${null !== (r2 = t2.programInfo.name) && void 0 !== r2 ? r2 : "unknown kernel"}`, () => { + this.profiler.event("op", `ProgramManager.run ${null !== (r2 = t3.programInfo.name) && void 0 !== r2 ? r2 : "unknown kernel"}`, () => { var r3; - const o2 = this.glContext.gl, a2 = t2.program; + const o2 = this.glContext.gl, a2 = t3.program; o2.useProgram(a2); try { - this.bindOutput(n2), this.attributesBound || this.bindAttributes(t2.attribLocations), this.bindUniforms(t2.uniformLocations, null !== (r3 = t2.programInfo.variables) && void 0 !== r3 ? r3 : [], e2); + this.bindOutput(n2), this.attributesBound || this.bindAttributes(t3.attribLocations), this.bindUniforms(t3.uniformLocations, null !== (r3 = t3.programInfo.variables) && void 0 !== r3 ? r3 : [], e2); } catch (e3) { - throw i2.Logger.error("ProgramManager", t2.programInfo.shaderSource), e3; + throw i2.Logger.error("ProgramManager", t3.programInfo.shaderSource), e3; } this.profiler.event("backend", "GlContext.draw()", () => { this.glContext.draw(); @@ -10487,284 +11172,284 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""]; }, this.glContext); } dispose() { - this.vertexShader && this.glContext.deleteShader(this.vertexShader), this.repo.forEach((t2) => this.glContext.deleteProgram(t2.program)); + this.vertexShader && this.glContext.deleteShader(this.vertexShader), this.repo.forEach((t3) => this.glContext.deleteProgram(t3.program)); } - build(t2, e2, n2) { + build(t3, e2, n2) { return this.profiler.event("backend", "ProgramManager.build", () => { - const r2 = new o.GlslPreprocessor(this.glContext, t2, e2, n2), i3 = r2.preprocess(), a2 = this.compile(i3); - return { programInfo: t2, program: a2, uniformLocations: this.getUniformLocations(a2, r2.context.programInfo.inputNames, r2.context.programInfo.variables), attribLocations: this.getAttribLocations(a2) }; + const r2 = new o.GlslPreprocessor(this.glContext, t3, e2, n2), i3 = r2.preprocess(), a2 = this.compile(i3); + return { programInfo: t3, program: a2, uniformLocations: this.getUniformLocations(a2, r2.context.programInfo.inputNames, r2.context.programInfo.variables), attribLocations: this.getAttribLocations(a2) }; }); } - compile(t2) { + compile(t3) { if (!this.vertexShader) { i2.Logger.verbose("ProrgramManager", "Compiling and caching Vertex shader for the first time"); - const t3 = (0, a.getVertexShaderSource)(this.glContext.version); - this.vertexShader = this.glContext.compileShader(t3, this.glContext.gl.VERTEX_SHADER); + const t4 = (0, a.getVertexShaderSource)(this.glContext.version); + this.vertexShader = this.glContext.compileShader(t4, this.glContext.gl.VERTEX_SHADER); } r.env.debug && i2.Logger.verbose("ProrgramManager", `FragShader: -${t2} +${t3} `); - const e2 = this.glContext.compileShader(t2, this.glContext.gl.FRAGMENT_SHADER), n2 = this.glContext.createProgram(this.vertexShader, e2); + const e2 = this.glContext.compileShader(t3, this.glContext.gl.FRAGMENT_SHADER), n2 = this.glContext.createProgram(this.vertexShader, e2); return this.glContext.deleteShader(e2), n2; } - bindOutput(t2) { - const e2 = t2.width, n2 = t2.height; - i2.Logger.verbose("ProrgramManager", `Binding output texture to Framebuffer: w/h=${e2}/${n2}, shape=${t2.shape}, type=${t2.tensor.type}`), this.glContext.attachFramebuffer(t2.texture, e2, n2); + bindOutput(t3) { + const e2 = t3.width, n2 = t3.height; + i2.Logger.verbose("ProrgramManager", `Binding output texture to Framebuffer: w/h=${e2}/${n2}, shape=${t3.shape}, type=${t3.tensor.type}`), this.glContext.attachFramebuffer(t3.texture, e2, n2); } - bindAttributes(t2) { - const e2 = t2.position, n2 = t2.textureCoord; + bindAttributes(t3) { + const e2 = t3.position, n2 = t3.textureCoord; this.glContext.setVertexAttributes(e2, n2), this.attributesBound = true; } - bindUniforms(t2, e2, n2) { + bindUniforms(t3, e2, n2) { var r2; const i3 = this.glContext.gl; let o2 = 0; - for (const { name: a2, type: s, location: u, arrayLength: c } of t2) { - const t3 = null === (r2 = e2.find((t4) => t4.name === a2)) || void 0 === r2 ? void 0 : r2.data; - if ("sampler2D" !== s && !t3) + for (const { name: a2, type: s, location: u, arrayLength: c } of t3) { + const t4 = null === (r2 = e2.find((t5) => t5.name === a2)) || void 0 === r2 ? void 0 : r2.data; + if ("sampler2D" !== s && !t4) throw new Error(`variable '${a2}' does not have data defined in program info`); switch (s) { case "sampler2D": this.bindTexture(n2[o2], u, o2), o2++; break; case "float": - c ? i3.uniform1fv(u, t3) : i3.uniform1f(u, t3); + c ? i3.uniform1fv(u, t4) : i3.uniform1f(u, t4); break; case "int": - c ? i3.uniform1iv(u, t3) : i3.uniform1i(u, t3); + c ? i3.uniform1iv(u, t4) : i3.uniform1i(u, t4); break; default: throw new Error(`Uniform not implemented: ${s}`); } } } - bindTexture(t2, e2, n2) { - this.glContext.bindTextureToUniform(t2.texture, n2, e2); + bindTexture(t3, e2, n2) { + this.glContext.bindTextureToUniform(t3.texture, n2, e2); } - getAttribLocations(t2) { - return { position: this.getAttribLocation(t2, "position"), textureCoord: this.getAttribLocation(t2, "textureCoord") }; + getAttribLocations(t3) { + return { position: this.getAttribLocation(t3, "position"), textureCoord: this.getAttribLocation(t3, "textureCoord") }; } - getUniformLocations(t2, e2, n2) { + getUniformLocations(t3, e2, n2) { const r2 = []; if (e2) for (const n3 of e2) - r2.push({ name: n3, type: "sampler2D", location: this.getUniformLocation(t2, n3) }); + r2.push({ name: n3, type: "sampler2D", location: this.getUniformLocation(t3, n3) }); if (n2) for (const e3 of n2) - r2.push(Object.assign(Object.assign({}, e3), { location: this.getUniformLocation(t2, e3.name) })); + r2.push(Object.assign(Object.assign({}, e3), { location: this.getUniformLocation(t3, e3.name) })); return r2; } - getUniformLocation(t2, e2) { - const n2 = this.glContext.gl.getUniformLocation(t2, e2); + getUniformLocation(t3, e2) { + const n2 = this.glContext.gl.getUniformLocation(t3, e2); if (null === n2) throw new Error(`Uniform ${e2} not found.`); return n2; } - getAttribLocation(t2, e2) { - return this.glContext.gl.getAttribLocation(t2, e2); + getAttribLocation(t3, e2) { + return this.glContext.gl.getAttribLocation(t3, e2); } }; - }, 6416: (t, e, n) => { + }, 6416: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.WebGLSessionHandler = void 0; const r = n(3694), i2 = n(1047), o = n(8316), a = n(1640), s = n(1958), u = n(7859), c = n(5702); e.WebGLSessionHandler = class { - constructor(t2, e2) { - this.backend = t2, this.context = e2, this.layoutStrategy = new u.PreferLogicalStrategy(t2.glContext.maxTextureSize), this.programManager = new s.ProgramManager(this.context.profiler, t2.glContext, this.layoutStrategy), this.textureManager = new c.TextureManager(t2.glContext, this.layoutStrategy, this.context.profiler, { reuseTextures: "full" === t2.textureCacheMode }), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(), this.pack = t2.pack, this.pack2unpackMap = /* @__PURE__ */ new Map(), this.unpack2packMap = /* @__PURE__ */ new Map(); + constructor(t3, e2) { + this.backend = t3, this.context = e2, this.layoutStrategy = new u.PreferLogicalStrategy(t3.glContext.maxTextureSize), this.programManager = new s.ProgramManager(this.context.profiler, t3.glContext, this.layoutStrategy), this.textureManager = new c.TextureManager(t3.glContext, this.layoutStrategy, this.context.profiler, { reuseTextures: "full" === t3.textureCacheMode }), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(), this.pack = t3.pack, this.pack2unpackMap = /* @__PURE__ */ new Map(), this.unpack2packMap = /* @__PURE__ */ new Map(); } createInferenceHandler() { return new o.WebGLInferenceHandler(this); } - onGraphInitialized(t2) { - const e2 = t2.getValues().filter((t3) => -1 === t3.from && t3.tensor).map((t3) => t3.tensor.dataId); + onGraphInitialized(t3) { + const e2 = t3.getValues().filter((t4) => -1 === t4.from && t4.tensor).map((t4) => t4.tensor.dataId); this.initializers = new Set(e2); } - isInitializer(t2) { - return !!this.initializers && this.initializers.has(t2); + isInitializer(t3) { + return !!this.initializers && this.initializers.has(t3); } - addInitializer(t2) { - this.initializers.add(t2); + addInitializer(t3) { + this.initializers.add(t3); } - getTextureData(t2, e2) { - return e2 ? this.packedTextureDataCache.get(t2) : this.unpackedTextureDataCache.get(t2); + getTextureData(t3, e2) { + return e2 ? this.packedTextureDataCache.get(t3) : this.unpackedTextureDataCache.get(t3); } - setTextureData(t2, e2, n2 = false) { - r.Logger.verbose("WebGLSessionHandler", "Storing Texture data in cache"), n2 ? this.packedTextureDataCache.set(t2, e2) : this.unpackedTextureDataCache.set(t2, e2); + setTextureData(t3, e2, n2 = false) { + r.Logger.verbose("WebGLSessionHandler", "Storing Texture data in cache"), n2 ? this.packedTextureDataCache.set(t3, e2) : this.unpackedTextureDataCache.set(t3, e2); } dispose() { - this.programManager.dispose(), this.textureManager.clearActiveTextures(), this.packedTextureDataCache.forEach((t2) => this.textureManager.releaseTexture(t2, true)), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache.forEach((t2) => this.textureManager.releaseTexture(t2, true)), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); + this.programManager.dispose(), this.textureManager.clearActiveTextures(), this.packedTextureDataCache.forEach((t3) => this.textureManager.releaseTexture(t3, true)), this.packedTextureDataCache = /* @__PURE__ */ new Map(), this.unpackedTextureDataCache.forEach((t3) => this.textureManager.releaseTexture(t3, true)), this.unpackedTextureDataCache = /* @__PURE__ */ new Map(); } - resolve(t2, e2, n2) { - const r2 = (0, i2.resolveOperator)(t2, e2, a.WEBGL_OP_RESOLVE_RULES); - return { impl: r2.opImpl, context: r2.opInit ? r2.opInit(t2, n2) : t2 }; + resolve(t3, e2, n2) { + const r2 = (0, i2.resolveOperator)(t3, e2, a.WEBGL_OP_RESOLVE_RULES); + return { impl: r2.opImpl, context: r2.opInit ? r2.opInit(t3, n2) : t3 }; } }; - }, 7769: (t, e, n) => { + }, 7769: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.Uint8DataEncoder = e.RGBAFloatDataEncoder = e.RedFloat32DataEncoder = void 0; const r = n(3694); e.RedFloat32DataEncoder = class { - constructor(t2, e2 = 1) { + constructor(t3, e2 = 1) { if (1 === e2) - this.internalFormat = t2.R32F, this.format = t2.RED, this.textureType = t2.FLOAT, this.channelSize = e2; + this.internalFormat = t3.R32F, this.format = t3.RED, this.textureType = t3.FLOAT, this.channelSize = e2; else { if (4 !== e2) throw new Error(`Invalid number of channels: ${e2}`); - this.internalFormat = t2.RGBA32F, this.format = t2.RGBA, this.textureType = t2.FLOAT, this.channelSize = e2; + this.internalFormat = t3.RGBA32F, this.format = t3.RGBA, this.textureType = t3.FLOAT, this.channelSize = e2; } } - encode(t2, e2) { + encode(t3, e2) { let n2, i2; - return t2.constructor !== Float32Array && (r.Logger.warning("Encoder", "data was not of type Float32; creating new Float32Array"), i2 = new Float32Array(t2)), e2 * this.channelSize > t2.length ? (r.Logger.warning("Encoder", "Source data too small. Allocating larger array"), i2 = t2, n2 = this.allocate(e2 * this.channelSize), i2.forEach((t3, e3) => n2[e3] = t3)) : (i2 = t2, n2 = i2), n2; + return t3.constructor !== Float32Array && (r.Logger.warning("Encoder", "data was not of type Float32; creating new Float32Array"), i2 = new Float32Array(t3)), e2 * this.channelSize > t3.length ? (r.Logger.warning("Encoder", "Source data too small. Allocating larger array"), i2 = t3, n2 = this.allocate(e2 * this.channelSize), i2.forEach((t4, e3) => n2[e3] = t4)) : (i2 = t3, n2 = i2), n2; } - allocate(t2) { - return new Float32Array(4 * t2); + allocate(t3) { + return new Float32Array(4 * t3); } - decode(t2, e2) { - return 1 === this.channelSize ? t2.filter((t3, e3) => e3 % 4 == 0).subarray(0, e2) : t2.subarray(0, e2); + decode(t3, e2) { + return 1 === this.channelSize ? t3.filter((t4, e3) => e3 % 4 == 0).subarray(0, e2) : t3.subarray(0, e2); } }, e.RGBAFloatDataEncoder = class { - constructor(t2, e2 = 1, n2) { + constructor(t3, e2 = 1, n2) { if (1 !== e2 && 4 !== e2) throw new Error(`Invalid number of channels: ${e2}`); - this.internalFormat = t2.RGBA, this.format = t2.RGBA, this.channelSize = e2, this.textureType = n2 || t2.FLOAT; + this.internalFormat = t3.RGBA, this.format = t3.RGBA, this.channelSize = e2, this.textureType = n2 || t3.FLOAT; } - encode(t2, e2) { - let n2 = t2; - return 1 === this.channelSize && (r.Logger.verbose("Encoder", "Exploding into a larger array"), n2 = this.allocate(e2), t2.forEach((t3, e3) => n2[4 * e3] = t3)), n2; + encode(t3, e2) { + let n2 = t3; + return 1 === this.channelSize && (r.Logger.verbose("Encoder", "Exploding into a larger array"), n2 = this.allocate(e2), t3.forEach((t4, e3) => n2[4 * e3] = t4)), n2; } - allocate(t2) { - return new Float32Array(4 * t2); + allocate(t3) { + return new Float32Array(4 * t3); } - decode(t2, e2) { - return 1 === this.channelSize ? t2.filter((t3, e3) => e3 % 4 == 0).subarray(0, e2) : t2.subarray(0, e2); + decode(t3, e2) { + return 1 === this.channelSize ? t3.filter((t4, e3) => e3 % 4 == 0).subarray(0, e2) : t3.subarray(0, e2); } }, e.Uint8DataEncoder = class { - constructor(t2, e2 = 1) { + constructor(t3, e2 = 1) { if (this.channelSize = 4, 1 === e2) - this.internalFormat = t2.ALPHA, this.format = t2.ALPHA, this.textureType = t2.UNSIGNED_BYTE, this.channelSize = e2; + this.internalFormat = t3.ALPHA, this.format = t3.ALPHA, this.textureType = t3.UNSIGNED_BYTE, this.channelSize = e2; else { if (4 !== e2) throw new Error(`Invalid number of channels: ${e2}`); - this.internalFormat = t2.RGBA, this.format = t2.RGBA, this.textureType = t2.UNSIGNED_BYTE, this.channelSize = e2; + this.internalFormat = t3.RGBA, this.format = t3.RGBA, this.textureType = t3.UNSIGNED_BYTE, this.channelSize = e2; } } - encode(t2, e2) { - return new Uint8Array(t2.buffer, t2.byteOffset, t2.byteLength); + encode(t3, e2) { + return new Uint8Array(t3.buffer, t3.byteOffset, t3.byteLength); } - allocate(t2) { - return new Uint8Array(t2 * this.channelSize); + allocate(t3) { + return new Uint8Array(t3 * this.channelSize); } - decode(t2, e2) { - if (t2 instanceof Uint8Array) - return t2.subarray(0, e2); - throw new Error(`Invalid array type: ${t2.constructor}`); + decode(t3, e2) { + if (t3 instanceof Uint8Array) + return t3.subarray(0, e2); + throw new Error(`Invalid array type: ${t3.constructor}`); } }; - }, 7859: (t, e, n) => { + }, 7859: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.getBatchDim = e.sizeToSquarishShape = e.getRowsCols = e.sizeFromShape = e.isInt = e.parseAxisParam = e.squeezeShape = e.PreferLogicalStrategy = e.AlwaysKeepOriginalSizeStrategy = void 0; const r = n(3694), i2 = n(2517); - function o(t2, e2) { - const n2 = [], r2 = [], i3 = null != e2 && Array.isArray(e2) && 0 === e2.length, o2 = null == e2 || i3 ? null : a(e2, t2).sort(); + function o(t3, e2) { + const n2 = [], r2 = [], i3 = null != e2 && Array.isArray(e2) && 0 === e2.length, o2 = null == e2 || i3 ? null : a(e2, t3).sort(); let s2 = 0; - for (let e3 = 0; e3 < t2.length; ++e3) { + for (let e3 = 0; e3 < t3.length; ++e3) { if (null != o2) { - if (o2[s2] === e3 && 1 !== t2[e3]) - throw new Error(`Can't squeeze axis ${e3} since its dim '${t2[e3]}' is not 1`); - (null == o2[s2] || o2[s2] > e3) && 1 === t2[e3] && (n2.push(t2[e3]), r2.push(e3)), o2[s2] <= e3 && s2++; + if (o2[s2] === e3 && 1 !== t3[e3]) + throw new Error(`Can't squeeze axis ${e3} since its dim '${t3[e3]}' is not 1`); + (null == o2[s2] || o2[s2] > e3) && 1 === t3[e3] && (n2.push(t3[e3]), r2.push(e3)), o2[s2] <= e3 && s2++; } - 1 !== t2[e3] && (n2.push(t2[e3]), r2.push(e3)); + 1 !== t3[e3] && (n2.push(t3[e3]), r2.push(e3)); } return { newShape: n2, keptDims: r2 }; } - function a(t2, e2) { + function a(t3, e2) { const n2 = e2.length; - return t2 = null == t2 ? e2.map((t3, e3) => e3) : [].concat(t2), (0, i2.assert)(t2.every((t3) => t3 >= -n2 && t3 < n2), () => `All values in axis param must be in range [-${n2}, ${n2}) but got axis ${t2}`), (0, i2.assert)(t2.every(s), () => `All values in axis param must be integers but got axis ${t2}`), t2.map((t3) => t3 < 0 ? n2 + t3 : t3); + return t3 = null == t3 ? e2.map((t4, e3) => e3) : [].concat(t3), (0, i2.assert)(t3.every((t4) => t4 >= -n2 && t4 < n2), () => `All values in axis param must be in range [-${n2}, ${n2}) but got axis ${t3}`), (0, i2.assert)(t3.every(s), () => `All values in axis param must be integers but got axis ${t3}`), t3.map((t4) => t4 < 0 ? n2 + t4 : t4); } - function s(t2) { - return t2 % 1 == 0; + function s(t3) { + return t3 % 1 == 0; } - function u(t2) { - if (0 === t2.length) + function u(t3) { + if (0 === t3.length) return 1; - let e2 = t2[0]; - for (let n2 = 1; n2 < t2.length; n2++) - e2 *= t2[n2]; + let e2 = t3[0]; + for (let n2 = 1; n2 < t3.length; n2++) + e2 *= t3[n2]; return e2; } - function c(t2) { - const e2 = Math.ceil(Math.sqrt(t2)); - return [e2, Math.ceil(t2 / e2)]; + function c(t3) { + const e2 = Math.ceil(Math.sqrt(t3)); + return [e2, Math.ceil(t3 / e2)]; } e.AlwaysKeepOriginalSizeStrategy = class { - constructor(t2) { - this.maxTextureSize = t2; + constructor(t3) { + this.maxTextureSize = t3; } - computeTextureWH(t2, e2) { - if (0 === t2.length) + computeTextureWH(t3, e2) { + if (0 === t3.length) return [1, 1]; const n2 = this.maxTextureSize; if (e2 && void 0 !== e2.breakAxis) { - const i4 = e2.breakAxis >= t2.length ? 1 : t2.slice(e2.breakAxis).reduce((t3, e3) => t3 * e3), o3 = e2.breakAxis <= 0 ? 1 : t2.slice(0, e2.breakAxis).reduce((t3, e3) => t3 * e3); + const i4 = e2.breakAxis >= t3.length ? 1 : t3.slice(e2.breakAxis).reduce((t4, e3) => t4 * e3), o3 = e2.breakAxis <= 0 ? 1 : t3.slice(0, e2.breakAxis).reduce((t4, e3) => t4 * e3); if (!(i4 > n2 || o3 > n2)) return [i4, o3]; - r.Logger.verbose("TextureLayout", `Given width/height preferences were unattainable: shape:${t2}, breakAxis:${e2.breakAxis}`); + r.Logger.verbose("TextureLayout", `Given width/height preferences were unattainable: shape:${t3}, breakAxis:${e2.breakAxis}`); } - const i3 = t2.reduce((t3, e3) => t3 * e3); + const i3 = t3.reduce((t4, e3) => t4 * e3); let o2 = Math.floor(Math.sqrt(i3)); for (; o2 < n2 && o2 < i3 && i3 % o2 != 0; o2++) ; if (o2 >= n2 || i3 % o2 != 0) - throw new Error(`The given dimensions are outside this GPU's boundaries: ${t2}`); + throw new Error(`The given dimensions are outside this GPU's boundaries: ${t3}`); return [o2, i3 / o2]; } }, e.PreferLogicalStrategy = class { - constructor(t2) { - this.maxTextureSize = t2; + constructor(t3) { + this.maxTextureSize = t3; } - computeTextureWH(t2, e2) { - const n2 = this.computeTexture(t2, e2); + computeTextureWH(t3, e2) { + const n2 = this.computeTexture(t3, e2); return e2 && e2.isPacked && (n2[0] /= 2, n2[1] /= 2), e2 && e2.reverseWH ? [n2[1], n2[0]] : n2; } - computeTexture(t2, e2) { + computeTexture(t3, e2) { const n2 = e2 && e2.isPacked; - if (0 === t2.length) + if (0 === t3.length) return n2 ? [2, 2] : [1, 1]; let i3 = this.maxTextureSize; if (e2 && void 0 !== e2.breakAxis) { - const n3 = e2.breakAxis >= t2.length ? 1 : t2.slice(e2.breakAxis).reduce((t3, e3) => t3 * e3), o2 = e2.breakAxis <= 0 ? 1 : t2.slice(0, e2.breakAxis).reduce((t3, e3) => t3 * e3); + const n3 = e2.breakAxis >= t3.length ? 1 : t3.slice(e2.breakAxis).reduce((t4, e3) => t4 * e3), o2 = e2.breakAxis <= 0 ? 1 : t3.slice(0, e2.breakAxis).reduce((t4, e3) => t4 * e3); if (!(n3 > i3 || o2 > i3)) return [n3, o2]; - r.Logger.verbose("TextureLayout", `Given width/height preferences were unattainable: shape:${t2}, breakAxis:${e2.breakAxis}`); + r.Logger.verbose("TextureLayout", `Given width/height preferences were unattainable: shape:${t3}, breakAxis:${e2.breakAxis}`); } - let a2 = t2.slice(0); - if (n2 && (i3 *= 2, a2 = a2.map((t3, e3) => e3 >= a2.length - 2 ? a2[e3] % 2 == 0 ? a2[e3] : a2[e3] + 1 : a2[e3]), 1 === a2.length && (a2 = [2, a2[0]])), 2 !== a2.length) { - const t3 = o(a2); - a2 = t3.newShape; + let a2 = t3.slice(0); + if (n2 && (i3 *= 2, a2 = a2.map((t4, e3) => e3 >= a2.length - 2 ? a2[e3] % 2 == 0 ? a2[e3] : a2[e3] + 1 : a2[e3]), 1 === a2.length && (a2 = [2, a2[0]])), 2 !== a2.length) { + const t4 = o(a2); + a2 = t4.newShape; } const s2 = u(a2); - return a2.length <= 1 && s2 <= i3 ? [1, s2] : 2 === a2.length && a2[0] <= i3 && a2[1] <= i3 ? a2 : 3 === a2.length && a2[0] * a2[1] <= i3 && a2[2] <= i3 ? [a2[0] * a2[1], a2[2]] : 3 === a2.length && a2[0] <= i3 && a2[1] * a2[2] <= i3 ? [a2[0], a2[1] * a2[2]] : 4 === a2.length && a2[0] * a2[1] * a2[2] <= i3 && a2[3] <= i3 ? [a2[0] * a2[1] * a2[2], a2[3]] : 4 === a2.length && a2[0] <= i3 && a2[1] * a2[2] * a2[3] <= i3 ? [a2[0], a2[1] * a2[2] * a2[3]] : n2 ? c(s2 / 4).map((t3) => 2 * t3) : c(s2); + return a2.length <= 1 && s2 <= i3 ? [1, s2] : 2 === a2.length && a2[0] <= i3 && a2[1] <= i3 ? a2 : 3 === a2.length && a2[0] * a2[1] <= i3 && a2[2] <= i3 ? [a2[0] * a2[1], a2[2]] : 3 === a2.length && a2[0] <= i3 && a2[1] * a2[2] <= i3 ? [a2[0], a2[1] * a2[2]] : 4 === a2.length && a2[0] * a2[1] * a2[2] <= i3 && a2[3] <= i3 ? [a2[0] * a2[1] * a2[2], a2[3]] : 4 === a2.length && a2[0] <= i3 && a2[1] * a2[2] * a2[3] <= i3 ? [a2[0], a2[1] * a2[2] * a2[3]] : n2 ? c(s2 / 4).map((t4) => 2 * t4) : c(s2); } - }, e.squeezeShape = o, e.parseAxisParam = a, e.isInt = s, e.sizeFromShape = u, e.getRowsCols = function(t2) { - if (0 === t2.length) + }, e.squeezeShape = o, e.parseAxisParam = a, e.isInt = s, e.sizeFromShape = u, e.getRowsCols = function(t3) { + if (0 === t3.length) throw Error("Cannot get rows and columns of an empty shape array."); - return [t2.length > 1 ? t2[t2.length - 2] : 1, t2[t2.length - 1]]; - }, e.sizeToSquarishShape = c, e.getBatchDim = function(t2, e2 = 2) { - return u(t2.slice(0, t2.length - e2)); + return [t3.length > 1 ? t3[t3.length - 2] : 1, t3[t3.length - 1]]; + }, e.sizeToSquarishShape = c, e.getBatchDim = function(t3, e2 = 2) { + return u(t3.slice(0, t3.length - e2)); }; - }, 4057: (t, e, n) => { + }, 4057: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createTextureLayoutFromShape = e.calculateTextureWidthAndHeight = e.createTextureLayoutFromTextureType = void 0; const r = n(2517), i2 = n(2039); - e.createTextureLayoutFromTextureType = (t2, n2, r2) => { - const o = r2 === i2.TextureType.unpacked || r2 === i2.TextureType.unpackedReversed ? 1 : 4, a = r2 === i2.TextureType.packed, s = r2 === i2.TextureType.unpackedReversed || r2 === i2.TextureType.packed, u = r2 === i2.TextureType.packedLastDimension ? n2.length - 1 : void 0, c = r2 === i2.TextureType.packedLastDimension ? n2.map((t3, e2) => e2 === n2.length - 1 ? 4 * t3 : t3) : void 0; - return (0, e.createTextureLayoutFromShape)(t2, n2, o, c, { isPacked: a, reverseWH: s, breakAxis: u }); - }, e.calculateTextureWidthAndHeight = (t2, n2, r2) => { - const i3 = (0, e.createTextureLayoutFromTextureType)(t2, n2, r2); + e.createTextureLayoutFromTextureType = (t3, n2, r2) => { + const o = r2 === i2.TextureType.unpacked || r2 === i2.TextureType.unpackedReversed ? 1 : 4, a = r2 === i2.TextureType.packed, s = r2 === i2.TextureType.unpackedReversed || r2 === i2.TextureType.packed, u = r2 === i2.TextureType.packedLastDimension ? n2.length - 1 : void 0, c = r2 === i2.TextureType.packedLastDimension ? n2.map((t4, e2) => e2 === n2.length - 1 ? 4 * t4 : t4) : void 0; + return (0, e.createTextureLayoutFromShape)(t3, n2, o, c, { isPacked: a, reverseWH: s, breakAxis: u }); + }, e.calculateTextureWidthAndHeight = (t3, n2, r2) => { + const i3 = (0, e.createTextureLayoutFromTextureType)(t3, n2, r2); return [i3.width, i3.height]; - }, e.createTextureLayoutFromShape = (t2, e2, n2 = 1, i3, o) => { - const a = !(!o || !o.isPacked), [s, u] = t2.computeTextureWH(a && i3 || e2, o), c = e2.length; + }, e.createTextureLayoutFromShape = (t3, e2, n2 = 1, i3, o) => { + const a = !(!o || !o.isPacked), [s, u] = t3.computeTextureWH(a && i3 || e2, o), c = e2.length; let l = e2.slice(0); if (0 === c && (l = [1]), 1 === n2) i3 = e2; @@ -10776,16 +11461,16 @@ ${t2} throw new Error("Unpacked shape is needed when using channels > 1"); return { width: s, height: u, channels: n2, isPacked: a, shape: l, strides: r.ShapeUtil.computeStrides(l), unpackedShape: i3, reversedWH: o && o.reverseWH }; }; - }, 5702: (t, e, n) => { + }, 5702: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.TextureManager = void 0; const r = n(3694); e.TextureManager = class { - constructor(t2, e2, n2, r2) { - this.glContext = t2, this.layoutStrategy = e2, this.profiler = n2, this.config = r2, this.pendingRead = /* @__PURE__ */ new Map(), r2.reuseTextures && (this.inUseTextures = /* @__PURE__ */ new Map(), this.idleTextures = /* @__PURE__ */ new Map(), this.textureLookup = /* @__PURE__ */ new Map()); + constructor(t3, e2, n2, r2) { + this.glContext = t3, this.layoutStrategy = e2, this.profiler = n2, this.config = r2, this.pendingRead = /* @__PURE__ */ new Map(), r2.reuseTextures && (this.inUseTextures = /* @__PURE__ */ new Map(), this.idleTextures = /* @__PURE__ */ new Map(), this.textureLookup = /* @__PURE__ */ new Map()); } - createTextureFromLayout(t2, e2, n2, i2) { - const o = this.toEncoderType(t2), a = this.glContext.getEncoder(o, e2.channels || 1, i2); + createTextureFromLayout(t3, e2, n2, i2) { + const o = this.toEncoderType(t3), a = this.glContext.getEncoder(o, e2.channels || 1, i2); if (e2.isPacked && 1 === i2) throw new Error("not implemented"); const s = e2.width, u = e2.height; @@ -10795,57 +11480,57 @@ ${t2} const e3 = this.idleTextures.get(c); if (e3 && e3.length > 0) { const r2 = e3.pop(); - return l.push(r2), 1 === i2 && this.glContext.updateTexture(r2, s, u, a, this.toTextureData(t2, n2)), r2; + return l.push(r2), 1 === i2 && this.glContext.updateTexture(r2, s, u, a, this.toTextureData(t3, n2)), r2; } } r.Logger.verbose("TextureManager", `Creating new texture of size ${e2.width}x${e2.height}`); - const p = this.glContext.allocateTexture(s, u, a, this.toTextureData(t2, n2)); + const p = this.glContext.allocateTexture(s, u, a, this.toTextureData(t3, n2)); return this.config.reuseTextures && (l.push(p), this.textureLookup.set(p, c)), p; } - readTexture(t2, e2, n2) { + readTexture(t3, e2, n2) { return n2 || (n2 = 1), this.profiler.event("backend", "TextureManager.readTexture", () => { - const r2 = t2.shape.reduce((t3, e3) => t3 * e3) * n2, i2 = this.glContext.readTexture(t2.texture, t2.width, t2.height, r2, this.toEncoderType(e2), n2); + const r2 = t3.shape.reduce((t4, e3) => t4 * e3) * n2, i2 = this.glContext.readTexture(t3.texture, t3.width, t3.height, r2, this.toEncoderType(e2), n2); return this.toTensorData(e2, i2); }); } - async readTextureAsync(t2, e2, n2) { - const r2 = t2.tensor.dataId; + async readTextureAsync(t3, e2, n2) { + const r2 = t3.tensor.dataId; if (n2 || (n2 = 1), this.pendingRead.has(r2)) { - const t3 = this.pendingRead.get(r2); - return new Promise((e3) => null == t3 ? void 0 : t3.push(e3)); + const t4 = this.pendingRead.get(r2); + return new Promise((e3) => null == t4 ? void 0 : t4.push(e3)); } return this.profiler.event("backend", "TextureManager.readTextureAsync", async () => { this.pendingRead.set(r2, []); - const i2 = t2.shape.reduce((t3, e3) => t3 * e3) * n2; + const i2 = t3.shape.reduce((t4, e3) => t4 * e3) * n2; await this.glContext.createAndWaitForFence(); - const o = this.glContext.readTexture(t2.texture, t2.width, t2.height, i2, this.toEncoderType(e2), n2), a = this.toTensorData(e2, o), s = this.pendingRead.get(r2); - return this.pendingRead.delete(r2), null == s || s.forEach((t3) => t3(a)), a; + const o = this.glContext.readTexture(t3.texture, t3.width, t3.height, i2, this.toEncoderType(e2), n2), a = this.toTensorData(e2, o), s = this.pendingRead.get(r2); + return this.pendingRead.delete(r2), null == s || s.forEach((t4) => t4(a)), a; }); } - readUint8TextureAsFloat(t2) { + readUint8TextureAsFloat(t3) { return this.profiler.event("backend", "TextureManager.readUint8TextureAsFloat", () => { - const e2 = t2.shape.reduce((t3, e3) => t3 * e3), n2 = this.glContext.readTexture(t2.texture, t2.width, t2.height, 4 * e2, "byte", 4); + const e2 = t3.shape.reduce((t4, e3) => t4 * e3), n2 = this.glContext.readTexture(t3.texture, t3.width, t3.height, 4 * e2, "byte", 4); return new Float32Array(n2.buffer, n2.byteOffset, e2); }); } - releaseTexture(t2, e2) { + releaseTexture(t3, e2) { let n2; - if (this.config.reuseTextures && (n2 = this.textureLookup.get(t2.texture), n2)) { + if (this.config.reuseTextures && (n2 = this.textureLookup.get(t3.texture), n2)) { e2 && this.textureLookup.delete(n2); const r2 = this.inUseTextures.get(n2); if (r2) { - const e3 = r2.indexOf(t2.texture); + const e3 = r2.indexOf(t3.texture); if (-1 !== e3) { r2.splice(e3, 1); let i2 = this.idleTextures.get(n2); - i2 || (i2 = [], this.idleTextures.set(n2, i2)), i2.push(t2.texture); + i2 || (i2 = [], this.idleTextures.set(n2, i2)), i2.push(t3.texture); } } } - n2 && !e2 || (r.Logger.verbose("TextureManager", `Deleting texture of size ${t2.width}x${t2.height}`), this.glContext.deleteTexture(t2.texture)); + n2 && !e2 || (r.Logger.verbose("TextureManager", `Deleting texture of size ${t3.width}x${t3.height}`), this.glContext.deleteTexture(t3.texture)); } - toTensorData(t2, e2) { - switch (t2) { + toTensorData(t3, e2) { + switch (t3) { case "int16": return e2 instanceof Int16Array ? e2 : Int16Array.from(e2); case "int32": @@ -10864,36 +11549,36 @@ ${t2} case "float64": return e2 instanceof Float64Array ? e2 : Float64Array.from(e2); default: - throw new Error(`TensorData type ${t2} is not supported`); + throw new Error(`TensorData type ${t3} is not supported`); } } - toTextureData(t2, e2) { + toTextureData(t3, e2) { if (e2) return e2 instanceof Float32Array ? e2 : new Float32Array(e2); } - toEncoderType(t2) { + toEncoderType(t3) { return "float"; } clearActiveTextures() { this.glContext.clearActiveTextures(); } }; - }, 2039: (t, e) => { + }, 2039: (t2, e) => { "use strict"; var n; Object.defineProperty(e, "__esModule", { value: true }), e.TextureType = void 0, (n = e.TextureType || (e.TextureType = {}))[n.unpacked = 0] = "unpacked", n[n.unpackedReversed = 1] = "unpackedReversed", n[n.packed = 2] = "packed", n[n.downloadUint8AsFloat = 3] = "downloadUint8AsFloat", n[n.packedLastDimension = 4] = "packedLastDimension"; - }, 9390: (t, e, n) => { + }, 9390: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.getGlChannels = e.getCoordsDataType = e.getSqueezedParams = e.squeezeInputShape = e.generateShaderFuncNameFromInputSamplerNameAtOutCoords = e.generateShaderFuncNameFromInputSamplerName = e.repeatedTry = e.getPackedShape = void 0; const r = n(2517); - e.getPackedShape = function(t2) { - const e2 = t2.length; - return t2.slice(0, e2 - 1).concat(t2[e2 - 1] / 4); - }, e.repeatedTry = async function(t2, e2 = (t3) => 0, n2) { + e.getPackedShape = function(t3) { + const e2 = t3.length; + return t3.slice(0, e2 - 1).concat(t3[e2 - 1] / 4); + }, e.repeatedTry = async function(t3, e2 = (t4) => 0, n2) { return new Promise((r2, i2) => { let o = 0; const a = () => { - if (t2()) + if (t3()) return void r2(); o++; const s = e2(o); @@ -10901,131 +11586,131 @@ ${t2} }; a(); }); - }, e.generateShaderFuncNameFromInputSamplerName = function(t2) { - return (0, r.assert)(void 0 !== t2 && 0 !== t2.length, () => "empty string found for sampler name"), "get" + t2.charAt(0).toUpperCase() + t2.slice(1); - }, e.generateShaderFuncNameFromInputSamplerNameAtOutCoords = function(t2) { - return (0, r.assert)(void 0 !== t2 && 0 !== t2.length, () => "empty string found for sampler name"), "get" + t2.charAt(0).toUpperCase() + t2.slice(1) + "AtOutCoords"; - }, e.squeezeInputShape = function(t2, e2) { - let n2 = JSON.parse(JSON.stringify(t2)); + }, e.generateShaderFuncNameFromInputSamplerName = function(t3) { + return (0, r.assert)(void 0 !== t3 && 0 !== t3.length, () => "empty string found for sampler name"), "get" + t3.charAt(0).toUpperCase() + t3.slice(1); + }, e.generateShaderFuncNameFromInputSamplerNameAtOutCoords = function(t3) { + return (0, r.assert)(void 0 !== t3 && 0 !== t3.length, () => "empty string found for sampler name"), "get" + t3.charAt(0).toUpperCase() + t3.slice(1) + "AtOutCoords"; + }, e.squeezeInputShape = function(t3, e2) { + let n2 = JSON.parse(JSON.stringify(t3)); return n2 = e2, n2; - }, e.getSqueezedParams = function(t2, e2) { - return e2.map((e3) => t2[e3]).join(", "); - }, e.getCoordsDataType = function(t2) { - if (t2 <= 1) + }, e.getSqueezedParams = function(t3, e2) { + return e2.map((e3) => t3[e3]).join(", "); + }, e.getCoordsDataType = function(t3) { + if (t3 <= 1) return "int"; - if (2 === t2) + if (2 === t3) return "ivec2"; - if (3 === t2) + if (3 === t3) return "ivec3"; - if (4 === t2) + if (4 === t3) return "ivec4"; - if (5 === t2) + if (5 === t3) return "ivec5"; - if (6 === t2) + if (6 === t3) return "ivec6"; - throw Error(`GPU for rank ${t2} is not yet supported`); - }, e.getGlChannels = function(t2 = 6) { - return ["x", "y", "z", "w", "u", "v"].slice(0, t2); + throw Error(`GPU for rank ${t3} is not yet supported`); + }, e.getGlChannels = function(t3 = 6) { + return ["x", "y", "z", "w", "u", "v"].slice(0, t3); }; - }, 7305: (t, e, n) => { + }, 7305: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.createNewWebGLContext = e.createWebGLContext = void 0; const r = n(3694), i2 = n(1713), o = {}; - function a(t2) { + function a(t3) { const e2 = function() { if ("undefined" == typeof document) { if ("undefined" == typeof OffscreenCanvas) throw new TypeError("failed to create canvas: OffscreenCanvas is not supported"); return new OffscreenCanvas(1, 1); } - const t3 = document.createElement("canvas"); - return t3.width = 1, t3.height = 1, t3; + const t4 = document.createElement("canvas"); + return t4.width = 1, t4.height = 1, t4; }(); let n2; const o2 = { alpha: false, depth: false, antialias: false, stencil: false, preserveDrawingBuffer: false, premultipliedAlpha: false, failIfMajorPerformanceCaveat: false }; - if ((!t2 || "webgl2" === t2) && (n2 = e2.getContext("webgl2", o2), n2)) + if ((!t3 || "webgl2" === t3) && (n2 = e2.getContext("webgl2", o2), n2)) try { return new i2.WebGLContext(n2, 2); - } catch (t3) { - r.Logger.warning("GlContextFactory", `failed to create WebGLContext using contextId 'webgl2'. Error: ${t3}`); + } catch (t4) { + r.Logger.warning("GlContextFactory", `failed to create WebGLContext using contextId 'webgl2'. Error: ${t4}`); } - if ((!t2 || "webgl" === t2) && (n2 = e2.getContext("webgl", o2) || e2.getContext("experimental-webgl", o2), n2)) + if ((!t3 || "webgl" === t3) && (n2 = e2.getContext("webgl", o2) || e2.getContext("experimental-webgl", o2), n2)) try { return new i2.WebGLContext(n2, 1); - } catch (t3) { - r.Logger.warning("GlContextFactory", `failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t3}`); + } catch (t4) { + r.Logger.warning("GlContextFactory", `failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t4}`); } throw new Error("WebGL is not supported"); } - e.createWebGLContext = function t2(e2) { + e.createWebGLContext = function t3(e2) { let n2; e2 && "webgl2" !== e2 || !("webgl2" in o) ? e2 && "webgl" !== e2 || !("webgl" in o) || (n2 = o.webgl) : n2 = o.webgl2, n2 = n2 || a(e2), e2 = e2 || 1 === n2.version ? "webgl" : "webgl2"; const r2 = n2.gl; - return o[e2] = n2, r2.isContextLost() ? (delete o[e2], t2(e2)) : (r2.disable(r2.DEPTH_TEST), r2.disable(r2.STENCIL_TEST), r2.disable(r2.BLEND), r2.disable(r2.DITHER), r2.disable(r2.POLYGON_OFFSET_FILL), r2.disable(r2.SAMPLE_COVERAGE), r2.enable(r2.SCISSOR_TEST), r2.enable(r2.CULL_FACE), r2.cullFace(r2.BACK), n2); + return o[e2] = n2, r2.isContextLost() ? (delete o[e2], t3(e2)) : (r2.disable(r2.DEPTH_TEST), r2.disable(r2.STENCIL_TEST), r2.disable(r2.BLEND), r2.disable(r2.DITHER), r2.disable(r2.POLYGON_OFFSET_FILL), r2.disable(r2.SAMPLE_COVERAGE), r2.enable(r2.SCISSOR_TEST), r2.enable(r2.CULL_FACE), r2.cullFace(r2.BACK), n2); }, e.createNewWebGLContext = a; - }, 1713: function(t, e, n) { + }, 1713: function(t2, e, n) { "use strict"; - var r = this && this.__createBinding || (Object.create ? function(t2, e2, n2, r2) { + var r = this && this.__createBinding || (Object.create ? function(t3, e2, n2, r2) { void 0 === r2 && (r2 = n2); var i3 = Object.getOwnPropertyDescriptor(e2, n2); i3 && !("get" in i3 ? !e2.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return e2[n2]; - } }), Object.defineProperty(t2, r2, i3); - } : function(t2, e2, n2, r2) { - void 0 === r2 && (r2 = n2), t2[r2] = e2[n2]; - }), i2 = this && this.__setModuleDefault || (Object.create ? function(t2, e2) { - Object.defineProperty(t2, "default", { enumerable: true, value: e2 }); - } : function(t2, e2) { - t2.default = e2; - }), o = this && this.__importStar || function(t2) { - if (t2 && t2.__esModule) - return t2; + } }), Object.defineProperty(t3, r2, i3); + } : function(t3, e2, n2, r2) { + void 0 === r2 && (r2 = n2), t3[r2] = e2[n2]; + }), i2 = this && this.__setModuleDefault || (Object.create ? function(t3, e2) { + Object.defineProperty(t3, "default", { enumerable: true, value: e2 }); + } : function(t3, e2) { + t3.default = e2; + }), o = this && this.__importStar || function(t3) { + if (t3 && t3.__esModule) + return t3; var e2 = {}; - if (null != t2) - for (var n2 in t2) - "default" !== n2 && Object.prototype.hasOwnProperty.call(t2, n2) && r(e2, t2, n2); - return i2(e2, t2), e2; + if (null != t3) + for (var n2 in t3) + "default" !== n2 && Object.prototype.hasOwnProperty.call(t3, n2) && r(e2, t3, n2); + return i2(e2, t3), e2; }; Object.defineProperty(e, "__esModule", { value: true }), e.WebGLContext = e.linearSearchLastTrue = void 0; const a = n(6207), s = o(n(7769)), u = n(9390); - function c(t2) { + function c(t3) { let e2 = 0; - for (; e2 < t2.length && t2[e2](); ++e2) + for (; e2 < t3.length && t3[e2](); ++e2) ; return e2 - 1; } e.linearSearchLastTrue = c, e.WebGLContext = class { - constructor(t2, e2) { - this.frameBufferBound = false, this.itemsToPoll = [], this.gl = t2, this.version = e2, this.getExtensions(), this.vertexbuffer = this.createVertexbuffer(), this.framebuffer = this.createFramebuffer(), this.queryVitalParameters(); + constructor(t3, e2) { + this.frameBufferBound = false, this.itemsToPoll = [], this.gl = t3, this.version = e2, this.getExtensions(), this.vertexbuffer = this.createVertexbuffer(), this.framebuffer = this.createFramebuffer(), this.queryVitalParameters(); } - allocateTexture(t2, e2, n2, r2) { + allocateTexture(t3, e2, n2, r2) { const i3 = this.gl, o2 = i3.createTexture(); i3.bindTexture(i3.TEXTURE_2D, o2), i3.texParameteri(i3.TEXTURE_2D, i3.TEXTURE_MIN_FILTER, i3.NEAREST), i3.texParameteri(i3.TEXTURE_2D, i3.TEXTURE_MAG_FILTER, i3.NEAREST), i3.texParameteri(i3.TEXTURE_2D, i3.TEXTURE_WRAP_S, i3.CLAMP_TO_EDGE), i3.texParameteri(i3.TEXTURE_2D, i3.TEXTURE_WRAP_T, i3.CLAMP_TO_EDGE); - const a2 = r2 ? n2.encode(r2, t2 * e2) : null; - return i3.texImage2D(i3.TEXTURE_2D, 0, n2.internalFormat, t2, e2, 0, n2.format, n2.textureType, a2), this.checkError(), o2; + const a2 = r2 ? n2.encode(r2, t3 * e2) : null; + return i3.texImage2D(i3.TEXTURE_2D, 0, n2.internalFormat, t3, e2, 0, n2.format, n2.textureType, a2), this.checkError(), o2; } - updateTexture(t2, e2, n2, r2, i3) { + updateTexture(t3, e2, n2, r2, i3) { const o2 = this.gl; - o2.bindTexture(o2.TEXTURE_2D, t2); + o2.bindTexture(o2.TEXTURE_2D, t3); const a2 = r2.encode(i3, e2 * n2); o2.texSubImage2D(o2.TEXTURE_2D, 0, 0, 0, e2, n2, r2.format, r2.textureType, a2), this.checkError(); } - attachFramebuffer(t2, e2, n2) { + attachFramebuffer(t3, e2, n2) { const r2 = this.gl; - r2.bindTexture(r2.TEXTURE_2D, t2), r2.bindFramebuffer(r2.FRAMEBUFFER, this.framebuffer), r2.framebufferTexture2D(r2.FRAMEBUFFER, r2.COLOR_ATTACHMENT0, r2.TEXTURE_2D, t2, 0), this.checkError(), r2.viewport(0, 0, e2, n2), r2.scissor(0, 0, e2, n2); + r2.bindTexture(r2.TEXTURE_2D, t3), r2.bindFramebuffer(r2.FRAMEBUFFER, this.framebuffer), r2.framebufferTexture2D(r2.FRAMEBUFFER, r2.COLOR_ATTACHMENT0, r2.TEXTURE_2D, t3, 0), this.checkError(), r2.viewport(0, 0, e2, n2), r2.scissor(0, 0, e2, n2); } - readTexture(t2, e2, n2, r2, i3, o2) { + readTexture(t3, e2, n2, r2, i3, o2) { const a2 = this.gl; - o2 || (o2 = 1), this.frameBufferBound || this.attachFramebuffer(t2, e2, n2); + o2 || (o2 = 1), this.frameBufferBound || this.attachFramebuffer(t3, e2, n2); const s2 = this.getEncoder(i3, o2), u2 = s2.allocate(e2 * n2); - return a2.bindTexture(a2.TEXTURE_2D, t2), a2.framebufferTexture2D(a2.FRAMEBUFFER, a2.COLOR_ATTACHMENT0, a2.TEXTURE_2D, t2, 0), a2.readPixels(0, 0, e2, n2, a2.RGBA, s2.textureType, u2), this.checkError(), s2.decode(u2, r2); + return a2.bindTexture(a2.TEXTURE_2D, t3), a2.framebufferTexture2D(a2.FRAMEBUFFER, a2.COLOR_ATTACHMENT0, a2.TEXTURE_2D, t3, 0), a2.readPixels(0, 0, e2, n2, a2.RGBA, s2.textureType, u2), this.checkError(), s2.decode(u2, r2); } isFramebufferReady() { return true; } getActiveTexture() { - const t2 = this.gl; - return "TEXTURE" + (t2.getParameter(this.gl.ACTIVE_TEXTURE) - t2.TEXTURE0); + const t3 = this.gl; + return "TEXTURE" + (t3.getParameter(this.gl.ACTIVE_TEXTURE) - t3.TEXTURE0); } getTextureBinding() { return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D); @@ -11033,57 +11718,57 @@ ${t2} getFramebufferBinding() { return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING); } - setVertexAttributes(t2, e2) { + setVertexAttributes(t3, e2) { const n2 = this.gl; - n2.vertexAttribPointer(t2, 3, n2.FLOAT, false, 20, 0), n2.enableVertexAttribArray(t2), -1 !== e2 && (n2.vertexAttribPointer(e2, 2, n2.FLOAT, false, 20, 12), n2.enableVertexAttribArray(e2)), this.checkError(); + n2.vertexAttribPointer(t3, 3, n2.FLOAT, false, 20, 0), n2.enableVertexAttribArray(t3), -1 !== e2 && (n2.vertexAttribPointer(e2, 2, n2.FLOAT, false, 20, 12), n2.enableVertexAttribArray(e2)), this.checkError(); } - createProgram(t2, e2) { + createProgram(t3, e2) { const n2 = this.gl, r2 = n2.createProgram(); - return n2.attachShader(r2, t2), n2.attachShader(r2, e2), n2.linkProgram(r2), r2; + return n2.attachShader(r2, t3), n2.attachShader(r2, e2), n2.linkProgram(r2), r2; } - compileShader(t2, e2) { + compileShader(t3, e2) { const n2 = this.gl, r2 = n2.createShader(e2); if (!r2) throw new Error(`createShader() returned null with type ${e2}`); - if (n2.shaderSource(r2, t2), n2.compileShader(r2), false === n2.getShaderParameter(r2, n2.COMPILE_STATUS)) + if (n2.shaderSource(r2, t3), n2.compileShader(r2), false === n2.getShaderParameter(r2, n2.COMPILE_STATUS)) throw new Error(`Failed to compile shader: ${n2.getShaderInfoLog(r2)} Shader source: -${t2}`); +${t3}`); return r2; } - deleteShader(t2) { - this.gl.deleteShader(t2); + deleteShader(t3) { + this.gl.deleteShader(t3); } - bindTextureToUniform(t2, e2, n2) { + bindTextureToUniform(t3, e2, n2) { const r2 = this.gl; - r2.activeTexture(r2.TEXTURE0 + e2), this.checkError(), r2.bindTexture(r2.TEXTURE_2D, t2), this.checkError(), r2.uniform1i(n2, e2), this.checkError(); + r2.activeTexture(r2.TEXTURE0 + e2), this.checkError(), r2.bindTexture(r2.TEXTURE_2D, t3), this.checkError(), r2.uniform1i(n2, e2), this.checkError(); } draw() { this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4), this.checkError(); } checkError() { if (a.env.debug) { - const t2 = this.gl, e2 = t2.getError(); + const t3 = this.gl, e2 = t3.getError(); let n2 = ""; switch (e2) { - case t2.NO_ERROR: + case t3.NO_ERROR: return; - case t2.INVALID_ENUM: + case t3.INVALID_ENUM: n2 = "INVALID_ENUM"; break; - case t2.INVALID_VALUE: + case t3.INVALID_VALUE: n2 = "INVALID_VALUE"; break; - case t2.INVALID_OPERATION: + case t3.INVALID_OPERATION: n2 = "INVALID_OPERATION"; break; - case t2.INVALID_FRAMEBUFFER_OPERATION: + case t3.INVALID_FRAMEBUFFER_OPERATION: n2 = "INVALID_FRAMEBUFFER_OPERATION"; break; - case t2.OUT_OF_MEMORY: + case t3.OUT_OF_MEMORY: n2 = "OUT_OF_MEMORY"; break; - case t2.CONTEXT_LOST_WEBGL: + case t3.CONTEXT_LOST_WEBGL: n2 = "CONTEXT_LOST_WEBGL"; break; default: @@ -11092,16 +11777,16 @@ ${t2}`); throw new Error(n2); } } - deleteTexture(t2) { - this.gl.deleteTexture(t2); + deleteTexture(t3) { + this.gl.deleteTexture(t3); } - deleteProgram(t2) { - this.gl.deleteProgram(t2); + deleteProgram(t3) { + this.gl.deleteProgram(t3); } - getEncoder(t2, e2, n2 = 0) { + getEncoder(t3, e2, n2 = 0) { if (2 === this.version) return new s.RedFloat32DataEncoder(this.gl, e2); - switch (t2) { + switch (t3) { case "float": return 1 === n2 || this.isRenderFloat32Supported ? new s.RGBAFloatDataEncoder(this.gl, e2) : new s.RGBAFloatDataEncoder(this.gl, e2, this.textureHalfFloatExtension.HALF_FLOAT_OES); case "int": @@ -11109,54 +11794,54 @@ ${t2}`); case "byte": return new s.Uint8DataEncoder(this.gl, e2); default: - throw new Error(`Invalid dataType: ${t2}`); + throw new Error(`Invalid dataType: ${t3}`); } } clearActiveTextures() { - const t2 = this.gl; + const t3 = this.gl; for (let e2 = 0; e2 < this.maxTextureImageUnits; ++e2) - t2.activeTexture(t2.TEXTURE0 + e2), t2.bindTexture(t2.TEXTURE_2D, null); + t3.activeTexture(t3.TEXTURE0 + e2), t3.bindTexture(t3.TEXTURE_2D, null); } dispose() { if (this.disposed) return; - const t2 = this.gl; - t2.bindFramebuffer(t2.FRAMEBUFFER, null), t2.deleteFramebuffer(this.framebuffer), t2.bindBuffer(t2.ARRAY_BUFFER, null), t2.deleteBuffer(this.vertexbuffer), t2.bindBuffer(t2.ELEMENT_ARRAY_BUFFER, null), t2.finish(), this.disposed = true; + const t3 = this.gl; + t3.bindFramebuffer(t3.FRAMEBUFFER, null), t3.deleteFramebuffer(this.framebuffer), t3.bindBuffer(t3.ARRAY_BUFFER, null), t3.deleteBuffer(this.vertexbuffer), t3.bindBuffer(t3.ELEMENT_ARRAY_BUFFER, null), t3.finish(), this.disposed = true; } createDefaultGeometry() { return new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); } createVertexbuffer() { - const t2 = this.gl, e2 = t2.createBuffer(); + const t3 = this.gl, e2 = t3.createBuffer(); if (!e2) throw new Error("createBuffer() returned null"); const n2 = this.createDefaultGeometry(); - return t2.bindBuffer(t2.ARRAY_BUFFER, e2), t2.bufferData(t2.ARRAY_BUFFER, n2, t2.STATIC_DRAW), this.checkError(), e2; + return t3.bindBuffer(t3.ARRAY_BUFFER, e2), t3.bufferData(t3.ARRAY_BUFFER, n2, t3.STATIC_DRAW), this.checkError(), e2; } createFramebuffer() { - const t2 = this.gl.createFramebuffer(); - if (!t2) + const t3 = this.gl.createFramebuffer(); + if (!t3) throw new Error("createFramebuffer returned null"); - return t2; + return t3; } queryVitalParameters() { - const t2 = this.gl; + const t3 = this.gl; if (this.isFloatTextureAttachableToFrameBuffer = this.checkFloatTextureAttachableToFrameBuffer(), this.isRenderFloat32Supported = this.checkRenderFloat32(), this.isFloat32DownloadSupported = this.checkFloat32Download(), 1 === this.version && !this.textureHalfFloatExtension && !this.isRenderFloat32Supported) throw new Error("both float32 and float16 TextureType are not supported"); - this.isBlendSupported = !this.isRenderFloat32Supported || this.checkFloat32Blend(), this.maxTextureSize = t2.getParameter(t2.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = t2.getParameter(t2.MAX_TEXTURE_IMAGE_UNITS), this.version; + this.isBlendSupported = !this.isRenderFloat32Supported || this.checkFloat32Blend(), this.maxTextureSize = t3.getParameter(t3.MAX_TEXTURE_SIZE), this.maxTextureImageUnits = t3.getParameter(t3.MAX_TEXTURE_IMAGE_UNITS), this.version; } getExtensions() { 2 === this.version ? (this.colorBufferFloatExtension = this.gl.getExtension("EXT_color_buffer_float"), this.disjointTimerQueryWebgl2Extension = this.gl.getExtension("EXT_disjoint_timer_query_webgl2")) : (this.textureFloatExtension = this.gl.getExtension("OES_texture_float"), this.textureHalfFloatExtension = this.gl.getExtension("OES_texture_half_float")); } checkFloatTextureAttachableToFrameBuffer() { - const t2 = this.gl, e2 = t2.createTexture(); - t2.bindTexture(t2.TEXTURE_2D, e2); - const n2 = 2 === this.version ? t2.RGBA32F : t2.RGBA; - t2.texImage2D(t2.TEXTURE_2D, 0, n2, 1, 1, 0, t2.RGBA, t2.FLOAT, null); - const r2 = t2.createFramebuffer(); - t2.bindFramebuffer(t2.FRAMEBUFFER, r2), t2.framebufferTexture2D(t2.FRAMEBUFFER, t2.COLOR_ATTACHMENT0, t2.TEXTURE_2D, e2, 0); - const i3 = t2.checkFramebufferStatus(t2.FRAMEBUFFER) === t2.FRAMEBUFFER_COMPLETE; - return t2.bindTexture(t2.TEXTURE_2D, null), t2.bindFramebuffer(t2.FRAMEBUFFER, null), t2.deleteTexture(e2), t2.deleteFramebuffer(r2), i3; + const t3 = this.gl, e2 = t3.createTexture(); + t3.bindTexture(t3.TEXTURE_2D, e2); + const n2 = 2 === this.version ? t3.RGBA32F : t3.RGBA; + t3.texImage2D(t3.TEXTURE_2D, 0, n2, 1, 1, 0, t3.RGBA, t3.FLOAT, null); + const r2 = t3.createFramebuffer(); + t3.bindFramebuffer(t3.FRAMEBUFFER, r2), t3.framebufferTexture2D(t3.FRAMEBUFFER, t3.COLOR_ATTACHMENT0, t3.TEXTURE_2D, e2, 0); + const i3 = t3.checkFramebufferStatus(t3.FRAMEBUFFER) === t3.FRAMEBUFFER_COMPLETE; + return t3.bindTexture(t3.TEXTURE_2D, null), t3.bindFramebuffer(t3.FRAMEBUFFER, null), t3.deleteTexture(e2), t3.deleteFramebuffer(r2), i3; } checkRenderFloat32() { if (2 === this.version) { @@ -11179,20 +11864,20 @@ ${t2}`); return this.isFloatTextureAttachableToFrameBuffer; } checkFloat32Blend() { - const t2 = this.gl; + const t3 = this.gl; let e2, n2, r2, i3, o2; try { - e2 = t2.createTexture(), n2 = t2.createFramebuffer(), t2.bindTexture(t2.TEXTURE_2D, e2); - const a2 = 2 === this.version ? t2.RGBA32F : t2.RGBA; - return t2.texImage2D(t2.TEXTURE_2D, 0, a2, 1, 1, 0, t2.RGBA, t2.FLOAT, null), t2.bindFramebuffer(t2.FRAMEBUFFER, n2), t2.framebufferTexture2D(t2.FRAMEBUFFER, t2.COLOR_ATTACHMENT0, t2.TEXTURE_2D, e2, 0), t2.enable(t2.BLEND), r2 = t2.createShader(t2.VERTEX_SHADER), !!r2 && (t2.shaderSource(r2, "void main(){}"), t2.compileShader(r2), i3 = t2.createShader(t2.FRAGMENT_SHADER), !!i3 && (t2.shaderSource(i3, "precision highp float;void main(){gl_FragColor=vec4(0.5);}"), t2.compileShader(i3), o2 = t2.createProgram(), !!o2 && (t2.attachShader(o2, r2), t2.attachShader(o2, i3), t2.linkProgram(o2), t2.useProgram(o2), t2.drawArrays(t2.POINTS, 0, 1), t2.getError() === t2.NO_ERROR))); + e2 = t3.createTexture(), n2 = t3.createFramebuffer(), t3.bindTexture(t3.TEXTURE_2D, e2); + const a2 = 2 === this.version ? t3.RGBA32F : t3.RGBA; + return t3.texImage2D(t3.TEXTURE_2D, 0, a2, 1, 1, 0, t3.RGBA, t3.FLOAT, null), t3.bindFramebuffer(t3.FRAMEBUFFER, n2), t3.framebufferTexture2D(t3.FRAMEBUFFER, t3.COLOR_ATTACHMENT0, t3.TEXTURE_2D, e2, 0), t3.enable(t3.BLEND), r2 = t3.createShader(t3.VERTEX_SHADER), !!r2 && (t3.shaderSource(r2, "void main(){}"), t3.compileShader(r2), i3 = t3.createShader(t3.FRAGMENT_SHADER), !!i3 && (t3.shaderSource(i3, "precision highp float;void main(){gl_FragColor=vec4(0.5);}"), t3.compileShader(i3), o2 = t3.createProgram(), !!o2 && (t3.attachShader(o2, r2), t3.attachShader(o2, i3), t3.linkProgram(o2), t3.useProgram(o2), t3.drawArrays(t3.POINTS, 0, 1), t3.getError() === t3.NO_ERROR))); } finally { - t2.disable(t2.BLEND), o2 && t2.deleteProgram(o2), r2 && t2.deleteShader(r2), i3 && t2.deleteShader(i3), n2 && (t2.bindFramebuffer(t2.FRAMEBUFFER, null), t2.deleteFramebuffer(n2)), e2 && (t2.bindTexture(t2.TEXTURE_2D, null), t2.deleteTexture(e2)); + t3.disable(t3.BLEND), o2 && t3.deleteProgram(o2), r2 && t3.deleteShader(r2), i3 && t3.deleteShader(i3), n2 && (t3.bindFramebuffer(t3.FRAMEBUFFER, null), t3.deleteFramebuffer(n2)), e2 && (t3.bindTexture(t3.TEXTURE_2D, null), t3.deleteTexture(e2)); } } beginTimer() { if (2 === this.version && this.disjointTimerQueryWebgl2Extension) { - const t2 = this.gl, e2 = this.disjointTimerQueryWebgl2Extension, n2 = t2.createQuery(); - return t2.beginQuery(e2.TIME_ELAPSED_EXT, n2), n2; + const t3 = this.gl, e2 = this.disjointTimerQueryWebgl2Extension, n2 = t3.createQuery(); + return t3.beginQuery(e2.TIME_ELAPSED_EXT, n2), n2; } throw new Error("WebGL1 profiling currently not supported."); } @@ -11200,83 +11885,83 @@ ${t2}`); if (2 !== this.version || !this.disjointTimerQueryWebgl2Extension) throw new Error("WebGL1 profiling currently not supported"); { - const t2 = this.gl, e2 = this.disjointTimerQueryWebgl2Extension; - t2.endQuery(e2.TIME_ELAPSED_EXT); + const t3 = this.gl, e2 = this.disjointTimerQueryWebgl2Extension; + t3.endQuery(e2.TIME_ELAPSED_EXT); } } - isTimerResultAvailable(t2) { + isTimerResultAvailable(t3) { let e2 = false, n2 = false; if (2 !== this.version || !this.disjointTimerQueryWebgl2Extension) throw new Error("WebGL1 profiling currently not supported"); { const r2 = this.gl, i3 = this.disjointTimerQueryWebgl2Extension; - e2 = r2.getQueryParameter(t2, r2.QUERY_RESULT_AVAILABLE), n2 = r2.getParameter(i3.GPU_DISJOINT_EXT); + e2 = r2.getQueryParameter(t3, r2.QUERY_RESULT_AVAILABLE), n2 = r2.getParameter(i3.GPU_DISJOINT_EXT); } return e2 && !n2; } - getTimerResult(t2) { + getTimerResult(t3) { let e2 = 0; if (2 !== this.version) throw new Error("WebGL1 profiling currently not supported"); { const n2 = this.gl; - e2 = n2.getQueryParameter(t2, n2.QUERY_RESULT), n2.deleteQuery(t2); + e2 = n2.getQueryParameter(t3, n2.QUERY_RESULT), n2.deleteQuery(t3); } return e2 / 1e6; } - async waitForQueryAndGetTime(t2) { - return await (0, u.repeatedTry)(() => this.isTimerResultAvailable(t2)), this.getTimerResult(t2); + async waitForQueryAndGetTime(t3) { + return await (0, u.repeatedTry)(() => this.isTimerResultAvailable(t3)), this.getTimerResult(t3); } async createAndWaitForFence() { - const t2 = this.createFence(this.gl); - return this.pollFence(t2); + const t3 = this.createFence(this.gl); + return this.pollFence(t3); } - createFence(t2) { + createFence(t3) { let e2; - const n2 = t2, r2 = n2.fenceSync(n2.SYNC_GPU_COMMANDS_COMPLETE, 0); - return t2.flush(), e2 = null === r2 ? () => true : () => { - const t3 = n2.clientWaitSync(r2, 0, 0); - return t3 === n2.ALREADY_SIGNALED || t3 === n2.CONDITION_SATISFIED; + const n2 = t3, r2 = n2.fenceSync(n2.SYNC_GPU_COMMANDS_COMPLETE, 0); + return t3.flush(), e2 = null === r2 ? () => true : () => { + const t4 = n2.clientWaitSync(r2, 0, 0); + return t4 === n2.ALREADY_SIGNALED || t4 === n2.CONDITION_SATISFIED; }, { query: r2, isFencePassed: e2 }; } - async pollFence(t2) { + async pollFence(t3) { return new Promise((e2) => { - this.addItemToPoll(() => t2.isFencePassed(), () => e2()); + this.addItemToPoll(() => t3.isFencePassed(), () => e2()); }); } pollItems() { - const t2 = c(this.itemsToPoll.map((t3) => t3.isDoneFn)); - for (let e2 = 0; e2 <= t2; ++e2) { - const { resolveFn: t3 } = this.itemsToPoll[e2]; - t3(); + const t3 = c(this.itemsToPoll.map((t4) => t4.isDoneFn)); + for (let e2 = 0; e2 <= t3; ++e2) { + const { resolveFn: t4 } = this.itemsToPoll[e2]; + t4(); } - this.itemsToPoll = this.itemsToPoll.slice(t2 + 1); + this.itemsToPoll = this.itemsToPoll.slice(t3 + 1); } - async addItemToPoll(t2, e2) { - this.itemsToPoll.push({ isDoneFn: t2, resolveFn: e2 }), this.itemsToPoll.length > 1 || await (0, u.repeatedTry)(() => (this.pollItems(), 0 === this.itemsToPoll.length)); + async addItemToPoll(t3, e2) { + this.itemsToPoll.push({ isDoneFn: t3, resolveFn: e2 }), this.itemsToPoll.length > 1 || await (0, u.repeatedTry)(() => (this.pollItems(), 0 === this.itemsToPoll.length)); } }; - }, 1036: (t, e, n) => { + }, 1036: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.ExecutionPlan = void 0; const r = n(3694); class i2 { - constructor(t2, e2) { - this.op = t2, this.node = e2; + constructor(t3, e2) { + this.op = t3, this.node = e2; } } e.ExecutionPlan = class { - constructor(t2, e2, n2) { - this.graph = t2, this.profiler = n2, this.initialize(e2); + constructor(t3, e2, n2) { + this.graph = t3, this.profiler = n2, this.initialize(e2); } - initialize(t2) { + initialize(t3) { this.profiler.event("session", "ExecutionPlan.initialize", () => { const e2 = this.graph.getNodes(); - if (e2.length !== t2.length) + if (e2.length !== t3.length) throw new Error("The size of nodes and OPs do not match."); - this._ops = t2.map((t3, n2) => new i2(t3, e2[n2])), this.reset(), this._starter = [], this._ops.forEach((t3, e3) => { + this._ops = t3.map((t4, n2) => new i2(t4, e2[n2])), this.reset(), this._starter = [], this._ops.forEach((t4, e3) => { let n2 = true; - for (const e4 of t3.node.inputs) + for (const e4 of t4.node.inputs) if (!this._values[e4] && -1 === this.graph.getInputIndices().indexOf(e4)) { n2 = false; break; @@ -11286,53 +11971,53 @@ ${t2}`); }); } reset() { - this._values = this.graph.getValues().map((t2) => t2.tensor); + this._values = this.graph.getValues().map((t3) => t3.tensor); } - async execute(t2, e2) { + async execute(t3, e2) { return this.profiler.event("session", "ExecutionPlan.execute", async () => { this.reset(); - const n2 = t2.createInferenceHandler(), i3 = this.graph.getInputIndices(); + const n2 = t3.createInferenceHandler(), i3 = this.graph.getInputIndices(); if (e2.length !== i3.length) throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${e2.length} expected: ${i3.length}`); - e2.forEach((t3, e3) => { + e2.forEach((t4, e3) => { const n3 = i3[e3]; - this._values[n3] = t3; + this._values[n3] = t4; }); const o = this._starter.slice(0), a = this.graph.getValues(), s = this.graph.getNodes(); let u = 0; for (; u < o.length; ) { - const t3 = o[u++], e3 = this._ops[t3], i4 = e3.node.inputs.map((t4) => this._values[t4]); + const t4 = o[u++], e3 = this._ops[t4], i4 = e3.node.inputs.map((t5) => this._values[t5]); if (-1 !== i4.indexOf(void 0)) throw new Error(`unresolved input detected: op: ${e3.node}`); const c2 = i4; - r.Logger.verbose("ExecPlan", `Runing op:${e3.node.name} (${c2.map((t4, n3) => `'${e3.node.inputs[n3]}': ${t4.type}[${t4.dims.join(",")}]`).join(", ")})`); + r.Logger.verbose("ExecPlan", `Runing op:${e3.node.name} (${c2.map((t5, n3) => `'${e3.node.inputs[n3]}': ${t5.type}[${t5.dims.join(",")}]`).join(", ")})`); const l = await this.profiler.event("node", e3.node.name, async () => e3.op.impl(n2, c2, e3.op.context)); if (l.length !== e3.node.outputs.length) throw new Error("the size of output does not match model definition."); - l.forEach((t4, n3) => { + l.forEach((t5, n3) => { const r2 = e3.node.outputs[n3]; if (this._values[r2]) throw new Error(`output [${r2}] already has value: op:${e3.node.name}`); - this._values[r2] = t4; + this._values[r2] = t5; }); const p = /* @__PURE__ */ new Set(); - l.forEach((t4, n3) => { + l.forEach((t5, n3) => { const r2 = e3.node.outputs[n3]; - for (const t5 of a[r2].to) { - const e4 = s[t5]; + for (const t6 of a[r2].to) { + const e4 = s[t6]; let n4 = true; - for (const t6 of e4.inputs) - if (!this._values[t6]) { + for (const t7 of e4.inputs) + if (!this._values[t7]) { n4 = false; break; } - n4 && p.add(t5); + n4 && p.add(t6); } }), o.push(...p); } const c = []; - for (let t3 = 0; t3 < this.graph.getOutputIndices().length; t3++) { - const e3 = this.graph.getOutputIndices()[t3], n3 = this._values[e3]; + for (let t4 = 0; t4 < this.graph.getOutputIndices().length; t4++) { + const e3 = this.graph.getOutputIndices()[t4], n3 = this._values[e3]; if (void 0 === n3) throw new Error(`required output [${e3}] does not have value`); 0 === e3 ? await n3.getData() : n3.data, c.push(n3); @@ -11341,15 +12026,15 @@ ${t2}`); }); } }; - }, 7070: (t, e, n) => { + }, 7070: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.Graph = void 0; const r = n(1446), i2 = n(7778), o = n(9395), a = n(9162), s = n(2517); var u = o.onnxruntime.experimental.fbs; - e.Graph = { from: (t2, e2) => new p(t2, e2) }; + e.Graph = { from: (t3, e2) => new p(t3, e2) }; class c { - constructor(t2) { - this._from = void 0, this._to = [], this.tensor = void 0, this.type = void 0, t2 && (this.type = s.ProtoUtil.tensorValueTypeFromProto(t2.type.tensorType)); + constructor(t3) { + this._from = void 0, this._to = [], this.tensor = void 0, this.type = void 0, t3 && (this.type = s.ProtoUtil.tensorValueTypeFromProto(t3.type.tensorType)); } get from() { return this._from; @@ -11359,15 +12044,15 @@ ${t2}`); } } class l { - constructor(t2, e2) { - t2 instanceof r.onnx.NodeProto ? (this.name = t2.name, this.opType = t2.opType, this.attributes = new i2.Attribute(t2.attribute)) : t2 instanceof u.Node && (this.name = null != e2 ? e2 : t2.name(), this.opType = t2.opType(), this.attributes = new i2.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t2))), this.inputs = [], this.outputs = [], this.executeNode = true; + constructor(t3, e2) { + t3 instanceof r.onnx.NodeProto ? (this.name = t3.name, this.opType = t3.opType, this.attributes = new i2.Attribute(t3.attribute)) : t3 instanceof u.Node && (this.name = null != e2 ? e2 : t3.name(), this.opType = t3.opType(), this.attributes = new i2.Attribute(s.ProtoUtil.tensorAttributesFromORTFormat(t3))), this.inputs = [], this.outputs = [], this.executeNode = true; } } class p { - constructor(t2, e2) { - if (!t2) + constructor(t3, e2) { + if (!t3) throw new TypeError("graph is empty"); - this.buildGraph(t2), this.transformGraph(e2), this.checkIsAcyclic(); + this.buildGraph(t3), this.transformGraph(e2), this.checkIsAcyclic(); } getInputIndices() { return this._allInputIndices; @@ -11387,54 +12072,54 @@ ${t2}`); getNodes() { return this._nodes; } - buildGraph(t2) { - if (t2 instanceof r.onnx.GraphProto) - this.buildGraphFromOnnxFormat(t2); + buildGraph(t3) { + if (t3 instanceof r.onnx.GraphProto) + this.buildGraphFromOnnxFormat(t3); else { - if (!(t2 instanceof u.Graph)) + if (!(t3 instanceof u.Graph)) throw new TypeError("Graph type is not supported."); - this.buildGraphFromOrtFormat(t2); + this.buildGraphFromOrtFormat(t3); } } - buildGraphFromOnnxFormat(t2) { + buildGraphFromOnnxFormat(t3) { const e2 = /* @__PURE__ */ new Map(); this._allData = [], this._allInputIndices = [], this._allInputNames = [], this._allOutputIndices = [], this._allOutputNames = [], this._nodes = []; const n2 = /* @__PURE__ */ new Map(); - if (!t2.input) + if (!t3.input) throw new Error("missing information in graph: input"); const r2 = []; - for (const n3 of t2.input) { + for (const n3 of t3.input) { if (e2.has(n3.name)) throw new Error(`duplicated input name: ${n3.name}`); - const t3 = this._allData.push(new c(n3)) - 1; - e2.set(n3.name, t3), r2.push(n3.name); + const t4 = this._allData.push(new c(n3)) - 1; + e2.set(n3.name, t4), r2.push(n3.name); } - if (!t2.initializer) + if (!t3.initializer) throw new Error("missing information in graph: initializer"); - for (const n3 of t2.initializer) { - let t3 = e2.get(n3.name); - if (void 0 === t3) { + for (const n3 of t3.initializer) { + let t4 = e2.get(n3.name); + if (void 0 === t4) { const r3 = new c(); - r3.type = { shape: { dims: s.ProtoUtil.tensorDimsFromProto(n3.dims) }, tensorType: s.ProtoUtil.tensorDataTypeFromProto(n3.dataType) }, t3 = this._allData.push(r3) - 1, e2.set(n3.name, t3); + r3.type = { shape: { dims: s.ProtoUtil.tensorDimsFromProto(n3.dims) }, tensorType: s.ProtoUtil.tensorDataTypeFromProto(n3.dataType) }, t4 = this._allData.push(r3) - 1, e2.set(n3.name, t4); } - this._allData[t3]._from = -1, this._allData[t3].tensor = a.Tensor.fromProto(n3); + this._allData[t4]._from = -1, this._allData[t4].tensor = a.Tensor.fromProto(n3); } - for (let t3 = 0; t3 < this._allData.length; t3++) - this._allData[t3].tensor || (this._allInputIndices.push(t3), this._allInputNames.push(r2[t3])); - if (!t2.output) + for (let t4 = 0; t4 < this._allData.length; t4++) + this._allData[t4].tensor || (this._allInputIndices.push(t4), this._allInputNames.push(r2[t4])); + if (!t3.output) throw new Error("missing information in graph: output"); - for (const n3 of t2.output) { + for (const n3 of t3.output) { if (e2.has(n3.name)) throw new Error(`duplicated output name: ${n3.name}`); - const t3 = this._allData.push(new c(n3)) - 1; - e2.set(n3.name, t3), this._allOutputIndices.push(t3), this._allOutputNames.push(n3.name); + const t4 = this._allData.push(new c(n3)) - 1; + e2.set(n3.name, t4), this._allOutputIndices.push(t4), this._allOutputNames.push(n3.name); } - if (!t2.node) + if (!t3.node) throw new Error("missing information in graph: node"); - for (const e3 of t2.node) { + for (const e3 of t3.node) { if (!e3.name) - for (let t4 = 0; ; t4++) { - const r3 = `unnamed_${e3.opType}_${t4}`; + for (let t5 = 0; ; t5++) { + const r3 = `unnamed_${e3.opType}_${t5}`; if (!n2.has(r3)) { e3.name = r3; break; @@ -11442,16 +12127,16 @@ ${t2}`); } if (n2.has(e3.name)) throw new Error(`duplicated node name: ${e3.name}`); - const t3 = this._nodes.push(new l(e3)) - 1; - n2.set(e3.name, t3); + const t4 = this._nodes.push(new l(e3)) - 1; + n2.set(e3.name, t4); } for (let n3 = 0; n3 < this._nodes.length; n3++) { - const r3 = this._nodes[n3], i3 = t2.node[n3]; + const r3 = this._nodes[n3], i3 = t3.node[n3]; if (!i3.output) throw new Error(`missing output for node: ${i3.name}`); - for (const t3 of i3.output) { - let o2 = e2.get(t3); - if (void 0 === o2 && (o2 = this._allData.push(new c()) - 1, e2.set(t3, o2)), r3.outputs.push(o2), void 0 !== this._allData[o2]._from) + for (const t4 of i3.output) { + let o2 = e2.get(t4); + if (void 0 === o2 && (o2 = this._allData.push(new c()) - 1, e2.set(t4, o2)), r3.outputs.push(o2), void 0 !== this._allData[o2]._from) throw new Error(`multiple nodes output to one data value: ${o2}`); if (this._allData[o2]._from = n3, "Constant" === i3.opType) { if (!i3.attribute || 1 !== i3.attribute.length || !i3.attribute[0].t) @@ -11463,68 +12148,68 @@ ${t2}`); } } for (let n3 = 0; n3 < this._nodes.length; n3++) { - const r3 = this._nodes[n3], i3 = t2.node[n3]; + const r3 = this._nodes[n3], i3 = t3.node[n3]; if (!i3.input) throw new Error(`missing input for node: ${i3.name}`); - for (const t3 of i3.input) { - const o2 = e2.get(t3); + for (const t4 of i3.input) { + const o2 = e2.get(t4); if (void 0 === o2) { - if ("" === t3 && 3 === i3.input.length && "Resize" === i3.opType) + if ("" === t4 && 3 === i3.input.length && "Resize" === i3.opType) continue; - throw new Error(`unrecognized input '${t3}' for node: ${i3.name}`); + throw new Error(`unrecognized input '${t4}' for node: ${i3.name}`); } r3.inputs.push(o2), this._allData[o2]._to.push(n3); } } return true; } - buildGraphFromOrtFormat(t2) { + buildGraphFromOrtFormat(t3) { var e2, n2, r2; const i3 = /* @__PURE__ */ new Map(); this._allData = [], this._allInputIndices = [], this._allInputNames = [], this._allOutputIndices = [], this._allOutputNames = [], this._nodes = []; const o2 = /* @__PURE__ */ new Map(), p2 = []; - for (let o3 = 0; o3 < t2.inputsLength(); o3++) { - const a2 = t2.inputs(o3); + for (let o3 = 0; o3 < t3.inputsLength(); o3++) { + const a2 = t3.inputs(o3); if (i3.has(a2)) throw new Error(`duplicated input name: ${a2}`); - for (let o4 = 0; o4 < t2.nodeArgsLength(); o4++) - if ((null === (e2 = t2.nodeArgs(o4)) || void 0 === e2 ? void 0 : e2.name()) === a2) { + for (let o4 = 0; o4 < t3.nodeArgsLength(); o4++) + if ((null === (e2 = t3.nodeArgs(o4)) || void 0 === e2 ? void 0 : e2.name()) === a2) { const e3 = new c(); - if ((null === (r2 = null === (n2 = t2.nodeArgs(o4)) || void 0 === n2 ? void 0 : n2.type()) || void 0 === r2 ? void 0 : r2.valueType()) !== u.TypeInfoValue.tensor_type) + if ((null === (r2 = null === (n2 = t3.nodeArgs(o4)) || void 0 === n2 ? void 0 : n2.type()) || void 0 === r2 ? void 0 : r2.valueType()) !== u.TypeInfoValue.tensor_type) throw new Error("Unexpected value type for the nodeArg."); - const l2 = t2.nodeArgs(o4).type().value(new u.TensorTypeAndShape()), f = s.ProtoUtil.tensorDataTypeFromProto(l2.elemType()), d = l2.shape(), h = []; - for (let t3 = 0; t3 < d.dimLength(); t3++) - h.push(s.LongUtil.longToNumber(d.dim(t3).value().dimValue())); + const l2 = t3.nodeArgs(o4).type().value(new u.TensorTypeAndShape()), f = s.ProtoUtil.tensorDataTypeFromProto(l2.elemType()), d = l2.shape(), h = []; + for (let t4 = 0; t4 < d.dimLength(); t4++) + h.push(s.LongUtil.longToNumber(d.dim(t4).value().dimValue())); e3.type = { shape: { dims: h }, tensorType: f }; const g = this._allData.push(e3) - 1; i3.set(a2, g), p2.push(a2); } } - for (let e3 = 0; e3 < t2.initializersLength(); e3++) { - const n3 = t2.initializers(e3); + for (let e3 = 0; e3 < t3.initializersLength(); e3++) { + const n3 = t3.initializers(e3); let r3 = i3.get(n3.name()); if (void 0 === r3) { - const t3 = new c(), e4 = s.ProtoUtil.tensorDimsFromORTFormat(n3), o3 = s.ProtoUtil.tensorDataTypeFromProto(n3.dataType()); - t3.type = { shape: { dims: e4 }, tensorType: o3 }, r3 = this._allData.push(t3) - 1, i3.set(n3.name(), r3); + const t4 = new c(), e4 = s.ProtoUtil.tensorDimsFromORTFormat(n3), o3 = s.ProtoUtil.tensorDataTypeFromProto(n3.dataType()); + t4.type = { shape: { dims: e4 }, tensorType: o3 }, r3 = this._allData.push(t4) - 1, i3.set(n3.name(), r3); } this._allData[r3]._from = -1, this._allData[r3].tensor = a.Tensor.fromOrtTensor(n3); } - for (let t3 = 0; t3 < this._allData.length; t3++) - this._allData[t3].tensor || (this._allInputIndices.push(t3), this._allInputNames.push(p2[t3])); - for (let e3 = 0; e3 < t2.outputsLength(); e3++) { - const n3 = t2.outputs(e3); + for (let t4 = 0; t4 < this._allData.length; t4++) + this._allData[t4].tensor || (this._allInputIndices.push(t4), this._allInputNames.push(p2[t4])); + for (let e3 = 0; e3 < t3.outputsLength(); e3++) { + const n3 = t3.outputs(e3); if (i3.has(n3)) throw new Error(`duplicated output name: ${n3}`); const r3 = this._allData.push(new c()) - 1; i3.set(n3, r3), this._allOutputIndices.push(r3), this._allOutputNames.push(n3); } - if (!t2.nodes) + if (!t3.nodes) throw new Error("missing information in graph: node"); - for (let e3 = 0; e3 < t2.nodesLength(); e3++) { - const n3 = t2.nodes(e3); + for (let e3 = 0; e3 < t3.nodesLength(); e3++) { + const n3 = t3.nodes(e3); let r3 = n3.name(); if (!r3) - for (let t3 = 0; r3 = `unnamed_${n3.opType()}_${t3}`, o2.has(r3); t3++) + for (let t4 = 0; r3 = `unnamed_${n3.opType()}_${t4}`, o2.has(r3); t4++) ; if (o2.has(r3)) throw new Error(`duplicated node name: ${r3}`); @@ -11532,13 +12217,13 @@ ${t2}`); o2.set(r3, i4); } for (let e3 = 0; e3 < this._nodes.length; e3++) { - const n3 = this._nodes[e3], r3 = t2.nodes(e3); + const n3 = this._nodes[e3], r3 = t3.nodes(e3); if (null == r3) throw new Error(`No node exists at index ${e3}`); if (0 === (null == r3 ? void 0 : r3.outputsLength())) throw new Error(`missing output for node: ${r3.name}`); - for (let t3 = 0; t3 < (null == r3 ? void 0 : r3.outputsLength()); t3++) { - const o3 = null == r3 ? void 0 : r3.outputs(t3); + for (let t4 = 0; t4 < (null == r3 ? void 0 : r3.outputsLength()); t4++) { + const o3 = null == r3 ? void 0 : r3.outputs(t4); let s2 = i3.get(o3); if (void 0 === s2 && (s2 = this._allData.push(new c()) - 1, i3.set(o3, s2)), n3.outputs.push(s2), void 0 !== this._allData[s2]._from) throw new Error(`multiple nodes output to one data value: ${s2}`); @@ -11552,11 +12237,11 @@ ${t2}`); } } for (let e3 = 0; e3 < this._nodes.length; e3++) { - const n3 = this._nodes[e3], r3 = t2.nodes(e3); + const n3 = this._nodes[e3], r3 = t3.nodes(e3); if (0 === r3.inputsLength()) throw new Error(`missing input for node: ${r3.name}`); - for (let t3 = 0; t3 < r3.inputsLength(); t3++) { - const o3 = r3.inputs(t3), a2 = i3.get(o3); + for (let t4 = 0; t4 < r3.inputsLength(); t4++) { + const o3 = r3.inputs(t4), a2 = i3.get(o3); if (void 0 === a2) throw new Error(`unrecognized input '${o3}' for node: ${r3.name()}`); n3.inputs.push(a2), this._allData[a2]._to.push(e3); @@ -11564,78 +12249,78 @@ ${t2}`); } } checkIsAcyclic() { - const t2 = /* @__PURE__ */ new Set(); + const t3 = /* @__PURE__ */ new Set(); this._allInputIndices.forEach((e3) => { this._allData[e3]._to.forEach((e4) => { - t2.add(e4); + t3.add(e4); }); }); - const e2 = Array.from(t2), n2 = new Array(this._nodes.length).fill("white"); + const e2 = Array.from(t3), n2 = new Array(this._nodes.length).fill("white"); for (; e2.length > 0; ) { - const t3 = e2.pop(); - "gray" === n2[t3] ? n2[t3] = "black" : (e2.push(t3), n2[t3] = "gray", this._nodes[t3].outputs.forEach((r2) => { + const t4 = e2.pop(); + "gray" === n2[t4] ? n2[t4] = "black" : (e2.push(t4), n2[t4] = "gray", this._nodes[t4].outputs.forEach((r2) => { const i3 = this._allData[r2]; if (void 0 !== i3.tensor) throw new Error("node outputs should not be initialized"); - if (i3._from !== t3) + if (i3._from !== t4) throw new Error("from property of the Value object doesn't match index of Node being processed"); - i3._to.forEach((t4) => { - if ("gray" === n2[t4]) + i3._to.forEach((t5) => { + if ("gray" === n2[t5]) throw new Error("model graph is cyclic"); - "white" === n2[t4] && e2.push(t4); + "white" === n2[t5] && e2.push(t5); }); })); } } - transformGraph(t2) { - this.removeAllIdentityNodes(), this.removeAllDropoutNodes(), this.fuseConvActivationNodes(), t2 && t2.transformGraph(this), this.finalizeGraph(); + transformGraph(t3) { + this.removeAllIdentityNodes(), this.removeAllDropoutNodes(), this.fuseConvActivationNodes(), t3 && t3.transformGraph(this), this.finalizeGraph(); } finalizeGraph() { - let t2 = 0; + let t3 = 0; for (let e2 = 0; e2 < this._nodes.length; e2++) - this._nodes[e2].executeNode ? t2 > 0 && (this._nodes[e2].inputs.forEach((n2) => { - const r2 = this._allData[n2]._to.indexOf(e2 + t2); + this._nodes[e2].executeNode ? t3 > 0 && (this._nodes[e2].inputs.forEach((n2) => { + const r2 = this._allData[n2]._to.indexOf(e2 + t3); -1 !== r2 && (this._allData[n2]._to[r2] = e2); }), this._nodes[e2].outputs.forEach((n2) => { - this._allData[n2]._from && this._allData[n2]._from === e2 + t2 && (this._allData[n2]._from = e2); - })) : (t2++, this._nodes[e2].outputs.forEach((t3) => { - this._allData[t3]._from = -2; + this._allData[n2]._from && this._allData[n2]._from === e2 + t3 && (this._allData[n2]._from = e2); + })) : (t3++, this._nodes[e2].outputs.forEach((t4) => { + this._allData[t4]._from = -2; }), this._nodes.splice(e2, 1), e2--); - t2 = 0; + t3 = 0; for (let e2 = 0; e2 < this._allData.length; e2++) - if (-2 !== this._allData[e2].from || -1 !== this._allOutputIndices.indexOf(e2 + t2)) { - if (t2 > 0) { + if (-2 !== this._allData[e2].from || -1 !== this._allOutputIndices.indexOf(e2 + t3)) { + if (t3 > 0) { let n2 = -1; - void 0 !== this._allData[e2].from && -1 !== this._allData[e2].from ? (n2 = this._nodes[this._allData[e2].from].outputs.indexOf(e2 + t2), -1 !== n2 && (this._nodes[this._allData[e2].from].outputs[n2] = e2)) : (n2 = this._allInputIndices.indexOf(e2 + t2), -1 !== n2 && (this._allInputIndices[n2] = e2)), this._allData[e2].to.forEach((r2) => { - n2 = this._nodes[r2].inputs.indexOf(e2 + t2), -1 !== n2 && (this._nodes[r2].inputs[n2] = e2); - }), 0 === this._allData[e2].to.length && (n2 = this._allOutputIndices.indexOf(e2 + t2), -1 !== n2 && (this._allOutputIndices[n2] = e2)); + void 0 !== this._allData[e2].from && -1 !== this._allData[e2].from ? (n2 = this._nodes[this._allData[e2].from].outputs.indexOf(e2 + t3), -1 !== n2 && (this._nodes[this._allData[e2].from].outputs[n2] = e2)) : (n2 = this._allInputIndices.indexOf(e2 + t3), -1 !== n2 && (this._allInputIndices[n2] = e2)), this._allData[e2].to.forEach((r2) => { + n2 = this._nodes[r2].inputs.indexOf(e2 + t3), -1 !== n2 && (this._nodes[r2].inputs[n2] = e2); + }), 0 === this._allData[e2].to.length && (n2 = this._allOutputIndices.indexOf(e2 + t3), -1 !== n2 && (this._allOutputIndices[n2] = e2)); } } else - t2++, this._allData.splice(e2, 1), e2--; + t3++, this._allData.splice(e2, 1), e2--; } - deleteNode(t2) { - const e2 = this._nodes[t2]; + deleteNode(t3) { + const e2 = this._nodes[t3]; if (e2.outputs.length > 1) { - for (let t3 = 1; t3 < e2.outputs.length; t3++) - if (this._allData[e2.outputs[t3]].to.length > 0) + for (let t4 = 1; t4 < e2.outputs.length; t4++) + if (this._allData[e2.outputs[t4]].to.length > 0) throw new Error("Node deletion with more than one output connected to other nodes is not supported. "); } e2.executeNode = false; - const n2 = e2.inputs[0], r2 = e2.outputs[0], i3 = this._allData[r2].to, o2 = this._allData[n2].to.indexOf(t2); + const n2 = e2.inputs[0], r2 = e2.outputs[0], i3 = this._allData[r2].to, o2 = this._allData[n2].to.indexOf(t3); if (-1 === o2) throw new Error("The Value object doesn't have the current Node in it's 'to' property "); this._allData[n2].to.splice(o2, 1), this._allData[r2]._to = []; const a2 = this._allOutputIndices.indexOf(r2); if (-1 !== a2 && (this._allOutputIndices[a2] = n2), i3 && i3.length > 0) - for (const t3 of i3) { - const e3 = this._nodes[t3].inputs.indexOf(r2); + for (const t4 of i3) { + const e3 = this._nodes[t4].inputs.indexOf(r2); if (-1 === e3) throw new Error("The Node object doesn't have the output Value in it's 'inputs' property "); - this._nodes[t3].inputs[e3] = n2, this._allData[n2].to.push(t3); + this._nodes[t4].inputs[e3] = n2, this._allData[n2].to.push(t4); } } removeAllDropoutNodes() { - let t2 = 0; + let t3 = 0; for (const e2 of this._nodes) { if ("Dropout" === e2.opType) { if (1 !== e2.inputs.length) @@ -11644,18 +12329,18 @@ ${t2}`); throw new Error("Dropout nodes should contain either 1 or 2 output(s)"); if (2 === e2.outputs.length && 0 !== this._allData[e2.outputs[1]]._to.length) throw new Error("Dropout nodes's second output should not be referenced by other nodes"); - this.deleteNode(t2); + this.deleteNode(t3); } - t2++; + t3++; } } removeAllIdentityNodes() { - let t2 = 0; + let t3 = 0; for (const e2 of this._nodes) - "Identity" === e2.opType && this.deleteNode(t2), t2++; + "Identity" === e2.opType && this.deleteNode(t3), t3++; } - isActivation(t2) { - switch (t2.opType) { + isActivation(t3) { + switch (t3.opType) { case "Relu": case "Sigmoid": case "Clip": @@ -11665,40 +12350,40 @@ ${t2}`); } } fuseConvActivationNodes() { - for (const t2 of this._nodes) - if ("Conv" === t2.opType) { - const e2 = this._allData[t2.outputs[0]]._to; + for (const t3 of this._nodes) + if ("Conv" === t3.opType) { + const e2 = this._allData[t3.outputs[0]]._to; if (1 === e2.length && this.isActivation(this._nodes[e2[0]])) { const n2 = this._nodes[e2[0]]; if ("Clip" === n2.opType) if (1 === n2.inputs.length) try { - t2.attributes.set("activation_params", "floats", [n2.attributes.getFloat("min"), n2.attributes.getFloat("max")]); + t3.attributes.set("activation_params", "floats", [n2.attributes.getFloat("min"), n2.attributes.getFloat("max")]); } catch (e3) { - t2.attributes.set("activation_params", "floats", [s.MIN_CLIP, s.MAX_CLIP]); + t3.attributes.set("activation_params", "floats", [s.MIN_CLIP, s.MAX_CLIP]); } else { if (!(n2.inputs.length >= 3 && void 0 !== this._allData[n2.inputs[1]].tensor && void 0 !== this._allData[n2.inputs[2]].tensor)) continue; - t2.attributes.set("activation_params", "floats", [this._allData[n2.inputs[1]].tensor.floatData[0], this._allData[n2.inputs[2]].tensor.floatData[0]]); + t3.attributes.set("activation_params", "floats", [this._allData[n2.inputs[1]].tensor.floatData[0], this._allData[n2.inputs[2]].tensor.floatData[0]]); } - t2.attributes.set("activation", "string", n2.opType), this.deleteNode(e2[0]); + t3.attributes.set("activation", "string", n2.opType), this.deleteNode(e2[0]); } } } } - }, 3694: (t, e) => { + }, 3694: (t2, e) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.now = e.Profiler = e.Logger = void 0; const n = { verbose: 1e3, info: 2e3, warning: 4e3, error: 5e3, fatal: 6e3 }, r = { none: new class { - log(t2, e2, n2) { + log(t3, e2, n2) { } }(), console: new class { - log(t2, e2, n2) { - console.log(`${this.color(t2)} ${n2 ? "\x1B[35m" + n2 + "\x1B[0m " : ""}${e2}`); + log(t3, e2, n2) { + console.log(`${this.color(t3)} ${n2 ? "\x1B[35m" + n2 + "\x1B[0m " : ""}${e2}`); } - color(t2) { - switch (t2) { + color(t3) { + switch (t3) { case "verbose": return "\x1B[34;40mv\x1B[0m"; case "info": @@ -11710,61 +12395,61 @@ ${t2}`); case "fatal": return "\x1B[101mf\x1B[0m"; default: - throw new Error(`unsupported severity: ${t2}`); + throw new Error(`unsupported severity: ${t3}`); } } }() }, i2 = { provider: "console", minimalSeverity: "warning", logDateTime: true, logSourceLocation: false }; let o = { "": i2 }; - function a(t2, e2, n2, r2) { + function a(t3, e2, n2, r2) { if (void 0 === e2) - return i3 = t2, { verbose: a.verbose.bind(null, i3), info: a.info.bind(null, i3), warning: a.warning.bind(null, i3), error: a.error.bind(null, i3), fatal: a.fatal.bind(null, i3) }; + return i3 = t3, { verbose: a.verbose.bind(null, i3), info: a.info.bind(null, i3), warning: a.warning.bind(null, i3), error: a.error.bind(null, i3), fatal: a.fatal.bind(null, i3) }; if (void 0 === n2) - s(t2, e2); + s(t3, e2); else if ("number" == typeof n2 && void 0 === r2) - s(t2, e2); + s(t3, e2); else if ("string" == typeof n2 && void 0 === r2) - s(t2, n2, 0, e2); + s(t3, n2, 0, e2); else { if ("string" != typeof n2 || "number" != typeof r2) throw new TypeError("input is valid"); - s(t2, n2, 0, e2); + s(t3, n2, 0, e2); } var i3; } - function s(t2, e2, i3, a2) { + function s(t3, e2, i3, a2) { const s2 = o[a2 || ""] || o[""]; - n[t2] < n[s2.minimalSeverity] || (s2.logDateTime && (e2 = `${(/* @__PURE__ */ new Date()).toISOString()}|${e2}`), s2.logSourceLocation, r[s2.provider].log(t2, e2, a2)); + n[t3] < n[s2.minimalSeverity] || (s2.logDateTime && (e2 = `${(/* @__PURE__ */ new Date()).toISOString()}|${e2}`), s2.logSourceLocation, r[s2.provider].log(t3, e2, a2)); } - !function(t2) { - function e2(t3) { - o = {}, n2("", t3 || {}); + !function(t3) { + function e2(t4) { + o = {}, n2("", t4 || {}); } - function n2(t3, n3) { - if ("*" === t3) + function n2(t4, n3) { + if ("*" === t4) e2(n3); else { - const e3 = o[t3] || i2; - o[t3] = { provider: n3.provider || e3.provider, minimalSeverity: n3.minimalSeverity || e3.minimalSeverity, logDateTime: void 0 === n3.logDateTime ? e3.logDateTime : n3.logDateTime, logSourceLocation: void 0 === n3.logSourceLocation ? e3.logSourceLocation : n3.logSourceLocation }; + const e3 = o[t4] || i2; + o[t4] = { provider: n3.provider || e3.provider, minimalSeverity: n3.minimalSeverity || e3.minimalSeverity, logDateTime: void 0 === n3.logDateTime ? e3.logDateTime : n3.logDateTime, logSourceLocation: void 0 === n3.logSourceLocation ? e3.logSourceLocation : n3.logSourceLocation }; } } - t2.verbose = function(e3, n3) { - t2("verbose", e3, n3); - }, t2.info = function(e3, n3) { - t2("info", e3, n3); - }, t2.warning = function(e3, n3) { - t2("warning", e3, n3); - }, t2.error = function(e3, n3) { - t2("error", e3, n3); - }, t2.fatal = function(e3, n3) { - t2("fatal", e3, n3); - }, t2.reset = e2, t2.set = n2, t2.setWithEnv = function(t3) { + t3.verbose = function(e3, n3) { + t3("verbose", e3, n3); + }, t3.info = function(e3, n3) { + t3("info", e3, n3); + }, t3.warning = function(e3, n3) { + t3("warning", e3, n3); + }, t3.error = function(e3, n3) { + t3("error", e3, n3); + }, t3.fatal = function(e3, n3) { + t3("fatal", e3, n3); + }, t3.reset = e2, t3.set = n2, t3.setWithEnv = function(t4) { const e3 = {}; - t3.logLevel && (e3.minimalSeverity = t3.logLevel), n2("", e3); + t4.logLevel && (e3.minimalSeverity = t4.logLevel), n2("", e3); }; }(a || (a = {})), e.Logger = a; class u { - constructor(t2, e2, n2, r2, i3, o2) { - this.category = t2, this.name = e2, this.startTime = n2, this.endCallback = r2, this.timer = i3, this.ctx = o2; + constructor(t3, e2, n2, r2, i3, o2) { + this.category = t3, this.name = e2, this.startTime = n2, this.endCallback = r2, this.timer = i3, this.ctx = o2; } end() { return this.endCallback(this); @@ -11776,16 +12461,16 @@ ${t2}`); } } class c { - constructor(t2, e2, n2, r2) { - this.category = t2, this.name = e2, this.startTime = n2, this.endTime = r2; + constructor(t3, e2, n2, r2) { + this.category = t3, this.name = e2, this.startTime = n2, this.endTime = r2; } } e.Profiler = class { - static create(t2) { - return void 0 === t2 ? new this() : new this(t2.maxNumberEvents, t2.flushBatchSize, t2.flushIntervalInMilliseconds); + static create(t3) { + return void 0 === t3 ? new this() : new this(t3.maxNumberEvents, t3.flushBatchSize, t3.flushIntervalInMilliseconds); } - constructor(t2, e2, n2) { - this._started = false, this._flushPointer = 0, this._started = false, this._maxNumberEvents = void 0 === t2 ? 1e4 : t2, this._flushBatchSize = void 0 === e2 ? 10 : e2, this._flushIntervalInMilliseconds = void 0 === n2 ? 5e3 : n2; + constructor(t3, e2, n2) { + this._started = false, this._flushPointer = 0, this._started = false, this._maxNumberEvents = void 0 === t3 ? 1e4 : t3, this._flushBatchSize = void 0 === e2 ? 10 : e2, this._flushIntervalInMilliseconds = void 0 === n2 ? 5e3 : n2; } start() { this._started = true, this._timingEvents = [], this._flushTime = (0, e.now)(), this._flushPointer = 0; @@ -11794,57 +12479,57 @@ ${t2}`); for (this._started = false; this._flushPointer < this._timingEvents.length; this._flushPointer++) this.logOneEvent(this._timingEvents[this._flushPointer]); } - event(t2, e2, n2, r2) { - const i3 = this._started ? this.begin(t2, e2, r2) : void 0; + event(t3, e2, n2, r2) { + const i3 = this._started ? this.begin(t3, e2, r2) : void 0; let o2 = false; const a2 = n2(); if (a2 && "function" == typeof a2.then) - return o2 = true, new Promise((t3, e3) => { + return o2 = true, new Promise((t4, e3) => { a2.then(async (e4) => { - i3 && await i3.end(), t3(e4); - }, async (t4) => { - i3 && await i3.end(), e3(t4); + i3 && await i3.end(), t4(e4); + }, async (t5) => { + i3 && await i3.end(), e3(t5); }); }); if (!o2 && i3) { - const t3 = i3.end(); - if (t3 && "function" == typeof t3.then) + const t4 = i3.end(); + if (t4 && "function" == typeof t4.then) return new Promise((e3, n3) => { - t3.then(() => { + t4.then(() => { e3(a2); - }, (t4) => { - n3(t4); + }, (t5) => { + n3(t5); }); }); } return a2; } - begin(t2, n2, r2) { + begin(t3, n2, r2) { if (!this._started) throw new Error("profiler is not started yet"); if (void 0 === r2) { const r3 = (0, e.now)(); - return this.flush(r3), new u(t2, n2, r3, (t3) => this.endSync(t3)); + return this.flush(r3), new u(t3, n2, r3, (t4) => this.endSync(t4)); } { const e2 = r2.beginTimer(); - return new u(t2, n2, 0, async (t3) => this.end(t3), e2, r2); + return new u(t3, n2, 0, async (t4) => this.end(t4), e2, r2); } } - async end(t2) { - const e2 = await t2.checkTimer(); - this._timingEvents.length < this._maxNumberEvents && (this._timingEvents.push(new c(t2.category, t2.name, t2.startTime, e2)), this.flush(e2)); + async end(t3) { + const e2 = await t3.checkTimer(); + this._timingEvents.length < this._maxNumberEvents && (this._timingEvents.push(new c(t3.category, t3.name, t3.startTime, e2)), this.flush(e2)); } - endSync(t2) { + endSync(t3) { const n2 = (0, e.now)(); - this._timingEvents.length < this._maxNumberEvents && (this._timingEvents.push(new c(t2.category, t2.name, t2.startTime, n2)), this.flush(n2)); + this._timingEvents.length < this._maxNumberEvents && (this._timingEvents.push(new c(t3.category, t3.name, t3.startTime, n2)), this.flush(n2)); } - logOneEvent(t2) { - e.Logger.verbose(`Profiler.${t2.category}`, `${(t2.endTime - t2.startTime).toFixed(2)}ms on event '${t2.name}' at ${t2.endTime.toFixed(2)}`); + logOneEvent(t3) { + e.Logger.verbose(`Profiler.${t3.category}`, `${(t3.endTime - t3.startTime).toFixed(2)}ms on event '${t3.name}' at ${t3.endTime.toFixed(2)}`); } - flush(t2) { - if (this._timingEvents.length - this._flushPointer >= this._flushBatchSize || t2 - this._flushTime >= this._flushIntervalInMilliseconds) { - for (const t3 = this._flushPointer; this._flushPointer < t3 + this._flushBatchSize && this._flushPointer < this._timingEvents.length; this._flushPointer++) + flush(t3) { + if (this._timingEvents.length - this._flushPointer >= this._flushBatchSize || t3 - this._flushTime >= this._flushIntervalInMilliseconds) { + for (const t4 = this._flushPointer; this._flushPointer < t4 + this._flushBatchSize && this._flushPointer < this._timingEvents.length; this._flushPointer++) this.logOneEvent(this._timingEvents[this._flushPointer]); this._flushTime = (0, e.now)(); } @@ -11853,7 +12538,7 @@ ${t2}`); return this._started; } }, e.now = "undefined" != typeof performance && performance.now ? () => performance.now() : Date.now; - }, 2644: (t, e, n) => { + }, 2644: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.Model = void 0; const r = n(5686), i2 = n(1446), o = n(7070), a = n(9395), s = n(2517); @@ -11861,29 +12546,29 @@ ${t2}`); e.Model = class { constructor() { } - load(t2, e2, n2) { + load(t3, e2, n2) { if (!n2) try { - return void this.loadFromOnnxFormat(t2, e2); - } catch (t3) { + return void this.loadFromOnnxFormat(t3, e2); + } catch (t4) { if (void 0 !== n2) - throw t3; + throw t4; } - this.loadFromOrtFormat(t2, e2); + this.loadFromOrtFormat(t3, e2); } - loadFromOnnxFormat(t2, e2) { - const n2 = i2.onnx.ModelProto.decode(t2); + loadFromOnnxFormat(t3, e2) { + const n2 = i2.onnx.ModelProto.decode(t3); if (s.LongUtil.longToNumber(n2.irVersion) < 3) throw new Error("only support ONNX model with IR_VERSION>=3"); - this._opsets = n2.opsetImport.map((t3) => ({ domain: t3.domain, version: s.LongUtil.longToNumber(t3.version) })), this._graph = o.Graph.from(n2.graph, e2); + this._opsets = n2.opsetImport.map((t4) => ({ domain: t4.domain, version: s.LongUtil.longToNumber(t4.version) })), this._graph = o.Graph.from(n2.graph, e2); } - loadFromOrtFormat(t2, e2) { - const n2 = new r.flatbuffers.ByteBuffer(t2), i3 = u.InferenceSession.getRootAsInferenceSession(n2).model(); + loadFromOrtFormat(t3, e2) { + const n2 = new r.flatbuffers.ByteBuffer(t3), i3 = u.InferenceSession.getRootAsInferenceSession(n2).model(); if (s.LongUtil.longToNumber(i3.irVersion()) < 3) throw new Error("only support ONNX model with IR_VERSION>=3"); this._opsets = []; - for (let t3 = 0; t3 < i3.opsetImportLength(); t3++) { - const e3 = i3.opsetImport(t3); + for (let t4 = 0; t4 < i3.opsetImportLength(); t4++) { + const e3 = i3.opsetImport(t4); this._opsets.push({ domain: null == e3 ? void 0 : e3.domain(), version: s.LongUtil.longToNumber(e3.version()) }); } this._graph = o.Graph.from(i3.graph(), e2); @@ -11895,351 +12580,351 @@ ${t2}`); return this._opsets; } }; - }, 782: (t, e) => { + }, 782: (t2, e) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.FLOAT_TYPES = e.INT_TYPES = e.NUMBER_TYPES = void 0, e.NUMBER_TYPES = ["float32", "float64", "int32", "int16", "int8", "uint16", "uint32", "uint8"], e.INT_TYPES = ["int32", "int16", "int8", "uint16", "uint32", "uint8"], e.FLOAT_TYPES = ["float32", "float64"]; - }, 1047: (t, e) => { + }, 1047: (t2, e) => { "use strict"; - function n(t2, e2) { + function n(t3, e2) { if (e2.endsWith("+")) { const n2 = Number.parseInt(e2.substring(0, e2.length - 1), 10); - return !isNaN(n2) && n2 <= t2; + return !isNaN(n2) && n2 <= t3; } if (2 === e2.split("-").length) { const n2 = e2.split("-"), r = Number.parseInt(n2[0], 10), i2 = Number.parseInt(n2[1], 10); - return !isNaN(r) && !isNaN(i2) && r <= t2 && t2 <= i2; + return !isNaN(r) && !isNaN(i2) && r <= t3 && t3 <= i2; } - return Number.parseInt(e2, 10) === t2; + return Number.parseInt(e2, 10) === t3; } - Object.defineProperty(e, "__esModule", { value: true }), e.resolveOperator = void 0, e.resolveOperator = function(t2, e2, r) { + Object.defineProperty(e, "__esModule", { value: true }), e.resolveOperator = void 0, e.resolveOperator = function(t3, e2, r) { for (const i2 of r) { const r2 = i2[0], o = i2[1], a = i2[2], s = i2[3], u = i2[4]; - if (t2.opType === r2) { - for (const t3 of e2) - if ((t3.domain === o || "ai.onnx" === t3.domain && "" === o) && n(t3.version, a)) + if (t3.opType === r2) { + for (const t4 of e2) + if ((t4.domain === o || "ai.onnx" === t4.domain && "" === o) && n(t4.version, a)) return { opImpl: s, opInit: u }; } } - throw new TypeError(`cannot resolve operator '${t2.opType}' with opsets: ${e2.map((t3) => `${t3.domain || "ai.onnx"} v${t3.version}`).join(", ")}`); + throw new TypeError(`cannot resolve operator '${t3.opType}' with opsets: ${e2.map((t4) => `${t4.domain || "ai.onnx"} v${t4.version}`).join(", ")}`); }; - }, 9395: (t, e, n) => { + }, 9395: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.onnxruntime = void 0; const r = n(5686); var i2, o; - i2 = e.onnxruntime || (e.onnxruntime = {}), function(t2) { + i2 = e.onnxruntime || (e.onnxruntime = {}), function(t3) { let e2; - !function(t3) { - t3[t3.UNDEFINED = 0] = "UNDEFINED", t3[t3.FLOAT = 1] = "FLOAT", t3[t3.INT = 2] = "INT", t3[t3.STRING = 3] = "STRING", t3[t3.TENSOR = 4] = "TENSOR", t3[t3.GRAPH = 5] = "GRAPH", t3[t3.FLOATS = 6] = "FLOATS", t3[t3.INTS = 7] = "INTS", t3[t3.STRINGS = 8] = "STRINGS", t3[t3.TENSORS = 9] = "TENSORS", t3[t3.GRAPHS = 10] = "GRAPHS", t3[t3.SPARSE_TENSOR = 11] = "SPARSE_TENSOR", t3[t3.SPARSE_TENSORS = 12] = "SPARSE_TENSORS"; - }(e2 = t2.AttributeType || (t2.AttributeType = {})); - }((o = i2.experimental || (i2.experimental = {})).fbs || (o.fbs = {})), function(t2) { - !function(t3) { - !function(t4) { + !function(t4) { + t4[t4.UNDEFINED = 0] = "UNDEFINED", t4[t4.FLOAT = 1] = "FLOAT", t4[t4.INT = 2] = "INT", t4[t4.STRING = 3] = "STRING", t4[t4.TENSOR = 4] = "TENSOR", t4[t4.GRAPH = 5] = "GRAPH", t4[t4.FLOATS = 6] = "FLOATS", t4[t4.INTS = 7] = "INTS", t4[t4.STRINGS = 8] = "STRINGS", t4[t4.TENSORS = 9] = "TENSORS", t4[t4.GRAPHS = 10] = "GRAPHS", t4[t4.SPARSE_TENSOR = 11] = "SPARSE_TENSOR", t4[t4.SPARSE_TENSORS = 12] = "SPARSE_TENSORS"; + }(e2 = t3.AttributeType || (t3.AttributeType = {})); + }((o = i2.experimental || (i2.experimental = {})).fbs || (o.fbs = {})), function(t3) { + !function(t4) { + !function(t5) { let e2; - !function(t5) { - t5[t5.UNKNOWN = 0] = "UNKNOWN", t5[t5.VALUE = 1] = "VALUE", t5[t5.PARAM = 2] = "PARAM"; - }(e2 = t4.DimensionValueType || (t4.DimensionValueType = {})); - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - !function(t4) { + !function(t6) { + t6[t6.UNKNOWN = 0] = "UNKNOWN", t6[t6.VALUE = 1] = "VALUE", t6[t6.PARAM = 2] = "PARAM"; + }(e2 = t5.DimensionValueType || (t5.DimensionValueType = {})); + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + !function(t5) { let e2; - !function(t5) { - t5[t5.UNDEFINED = 0] = "UNDEFINED", t5[t5.FLOAT = 1] = "FLOAT", t5[t5.UINT8 = 2] = "UINT8", t5[t5.INT8 = 3] = "INT8", t5[t5.UINT16 = 4] = "UINT16", t5[t5.INT16 = 5] = "INT16", t5[t5.INT32 = 6] = "INT32", t5[t5.INT64 = 7] = "INT64", t5[t5.STRING = 8] = "STRING", t5[t5.BOOL = 9] = "BOOL", t5[t5.FLOAT16 = 10] = "FLOAT16", t5[t5.DOUBLE = 11] = "DOUBLE", t5[t5.UINT32 = 12] = "UINT32", t5[t5.UINT64 = 13] = "UINT64", t5[t5.COMPLEX64 = 14] = "COMPLEX64", t5[t5.COMPLEX128 = 15] = "COMPLEX128", t5[t5.BFLOAT16 = 16] = "BFLOAT16"; - }(e2 = t4.TensorDataType || (t4.TensorDataType = {})); - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - !function(t4) { + !function(t6) { + t6[t6.UNDEFINED = 0] = "UNDEFINED", t6[t6.FLOAT = 1] = "FLOAT", t6[t6.UINT8 = 2] = "UINT8", t6[t6.INT8 = 3] = "INT8", t6[t6.UINT16 = 4] = "UINT16", t6[t6.INT16 = 5] = "INT16", t6[t6.INT32 = 6] = "INT32", t6[t6.INT64 = 7] = "INT64", t6[t6.STRING = 8] = "STRING", t6[t6.BOOL = 9] = "BOOL", t6[t6.FLOAT16 = 10] = "FLOAT16", t6[t6.DOUBLE = 11] = "DOUBLE", t6[t6.UINT32 = 12] = "UINT32", t6[t6.UINT64 = 13] = "UINT64", t6[t6.COMPLEX64 = 14] = "COMPLEX64", t6[t6.COMPLEX128 = 15] = "COMPLEX128", t6[t6.BFLOAT16 = 16] = "BFLOAT16"; + }(e2 = t5.TensorDataType || (t5.TensorDataType = {})); + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + !function(t5) { let e2; - !function(t5) { - t5[t5.Primitive = 0] = "Primitive", t5[t5.Fused = 1] = "Fused"; - }(e2 = t4.NodeType || (t4.NodeType = {})); - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - !function(t4) { + !function(t6) { + t6[t6.Primitive = 0] = "Primitive", t6[t6.Fused = 1] = "Fused"; + }(e2 = t5.NodeType || (t5.NodeType = {})); + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + !function(t5) { let e2; - !function(t5) { - t5[t5.NONE = 0] = "NONE", t5[t5.tensor_type = 1] = "tensor_type", t5[t5.sequence_type = 2] = "sequence_type", t5[t5.map_type = 3] = "map_type"; - }(e2 = t4.TypeInfoValue || (t4.TypeInfoValue = {})); - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + !function(t6) { + t6[t6.NONE = 0] = "NONE", t6[t6.tensor_type = 1] = "tensor_type", t6[t6.sequence_type = 2] = "sequence_type", t6[t6.map_type = 3] = "map_type"; + }(e2 = t5.TypeInfoValue || (t5.TypeInfoValue = {})); + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsShape(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsShape(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsShape(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsShape(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } dim(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 4); - return r2 ? (n3 || new t2.experimental.fbs.Dimension()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Dimension()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } dimLength() { - let t3 = this.bb.__offset(this.bb_pos, 4); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 4); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startShape(t3) { - t3.startObject(1); + static startShape(t4) { + t4.startObject(1); } - static addDim(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addDim(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static createDimVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createDimVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startDimVector(t3, e4) { - t3.startVector(4, e4, 4); + static startDimVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endShape(t3) { - return t3.endObject(); + static endShape(t4) { + return t4.endObject(); } - static createShape(t3, e4) { - return n2.startShape(t3), n2.addDim(t3, e4), n2.endShape(t3); + static createShape(t4, e4) { + return n2.startShape(t4), n2.addDim(t4, e4), n2.endShape(t4); } } e3.Shape = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsDimension(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsDimension(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsDimension(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsDimension(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } value(e4) { let n3 = this.bb.__offset(this.bb_pos, 4); - return n3 ? (e4 || new t2.experimental.fbs.DimensionValue()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.DimensionValue()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - denotation(t3) { + denotation(t4) { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - static startDimension(t3) { - t3.startObject(2); + static startDimension(t4) { + t4.startObject(2); } - static addValue(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addValue(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addDenotation(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addDenotation(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static endDimension(t3) { - return t3.endObject(); + static endDimension(t4) { + return t4.endObject(); } - static createDimension(t3, e4, r2) { - return n2.startDimension(t3), n2.addValue(t3, e4), n2.addDenotation(t3, r2), n2.endDimension(t3); + static createDimension(t4, e4, r2) { + return n2.startDimension(t4), n2.addValue(t4, e4), n2.addDenotation(t4, r2), n2.endDimension(t4); } } e3.Dimension = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsDimensionValue(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsDimensionValue(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsDimensionValue(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsDimensionValue(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } dimType() { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.readInt8(this.bb_pos + e4) : t2.experimental.fbs.DimensionValueType.UNKNOWN; + return e4 ? this.bb.readInt8(this.bb_pos + e4) : t3.experimental.fbs.DimensionValueType.UNKNOWN; } dimValue() { - let t3 = this.bb.__offset(this.bb_pos, 6); - return t3 ? this.bb.readInt64(this.bb_pos + t3) : this.bb.createLong(0, 0); + let t4 = this.bb.__offset(this.bb_pos, 6); + return t4 ? this.bb.readInt64(this.bb_pos + t4) : this.bb.createLong(0, 0); } - dimParam(t3) { + dimParam(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - static startDimensionValue(t3) { - t3.startObject(3); + static startDimensionValue(t4) { + t4.startObject(3); } static addDimType(e4, n3) { - e4.addFieldInt8(0, n3, t2.experimental.fbs.DimensionValueType.UNKNOWN); + e4.addFieldInt8(0, n3, t3.experimental.fbs.DimensionValueType.UNKNOWN); } - static addDimValue(t3, e4) { - t3.addFieldInt64(1, e4, t3.createLong(0, 0)); + static addDimValue(t4, e4) { + t4.addFieldInt64(1, e4, t4.createLong(0, 0)); } - static addDimParam(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addDimParam(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static endDimensionValue(t3) { - return t3.endObject(); + static endDimensionValue(t4) { + return t4.endObject(); } - static createDimensionValue(t3, e4, r2, i3) { - return n2.startDimensionValue(t3), n2.addDimType(t3, e4), n2.addDimValue(t3, r2), n2.addDimParam(t3, i3), n2.endDimensionValue(t3); + static createDimensionValue(t4, e4, r2, i3) { + return n2.startDimensionValue(t4), n2.addDimType(t4, e4), n2.addDimValue(t4, r2), n2.addDimParam(t4, i3), n2.endDimensionValue(t4); } } e3.DimensionValue = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsTensorTypeAndShape(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsTensorTypeAndShape(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsTensorTypeAndShape(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsTensorTypeAndShape(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } elemType() { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.readInt32(this.bb_pos + e4) : t2.experimental.fbs.TensorDataType.UNDEFINED; + return e4 ? this.bb.readInt32(this.bb_pos + e4) : t3.experimental.fbs.TensorDataType.UNDEFINED; } shape(e4) { let n3 = this.bb.__offset(this.bb_pos, 6); - return n3 ? (e4 || new t2.experimental.fbs.Shape()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Shape()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startTensorTypeAndShape(t3) { - t3.startObject(2); + static startTensorTypeAndShape(t4) { + t4.startObject(2); } static addElemType(e4, n3) { - e4.addFieldInt32(0, n3, t2.experimental.fbs.TensorDataType.UNDEFINED); + e4.addFieldInt32(0, n3, t3.experimental.fbs.TensorDataType.UNDEFINED); } - static addShape(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addShape(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static endTensorTypeAndShape(t3) { - return t3.endObject(); + static endTensorTypeAndShape(t4) { + return t4.endObject(); } - static createTensorTypeAndShape(t3, e4, r2) { - return n2.startTensorTypeAndShape(t3), n2.addElemType(t3, e4), n2.addShape(t3, r2), n2.endTensorTypeAndShape(t3); + static createTensorTypeAndShape(t4, e4, r2) { + return n2.startTensorTypeAndShape(t4), n2.addElemType(t4, e4), n2.addShape(t4, r2), n2.endTensorTypeAndShape(t4); } } e3.TensorTypeAndShape = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsMapType(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsMapType(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsMapType(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsMapType(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } keyType() { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.readInt32(this.bb_pos + e4) : t2.experimental.fbs.TensorDataType.UNDEFINED; + return e4 ? this.bb.readInt32(this.bb_pos + e4) : t3.experimental.fbs.TensorDataType.UNDEFINED; } valueType(e4) { let n3 = this.bb.__offset(this.bb_pos, 6); - return n3 ? (e4 || new t2.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startMapType(t3) { - t3.startObject(2); + static startMapType(t4) { + t4.startObject(2); } static addKeyType(e4, n3) { - e4.addFieldInt32(0, n3, t2.experimental.fbs.TensorDataType.UNDEFINED); + e4.addFieldInt32(0, n3, t3.experimental.fbs.TensorDataType.UNDEFINED); } - static addValueType(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addValueType(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static endMapType(t3) { - return t3.endObject(); + static endMapType(t4) { + return t4.endObject(); } - static createMapType(t3, e4, r2) { - return n2.startMapType(t3), n2.addKeyType(t3, e4), n2.addValueType(t3, r2), n2.endMapType(t3); + static createMapType(t4, e4, r2) { + return n2.startMapType(t4), n2.addKeyType(t4, e4), n2.addValueType(t4, r2), n2.endMapType(t4); } } e3.MapType = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsSequenceType(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsSequenceType(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsSequenceType(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsSequenceType(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } elemType(e4) { let n3 = this.bb.__offset(this.bb_pos, 4); - return n3 ? (e4 || new t2.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startSequenceType(t3) { - t3.startObject(1); + static startSequenceType(t4) { + t4.startObject(1); } - static addElemType(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addElemType(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static endSequenceType(t3) { - return t3.endObject(); + static endSequenceType(t4) { + return t4.endObject(); } - static createSequenceType(t3, e4) { - return n2.startSequenceType(t3), n2.addElemType(t3, e4), n2.endSequenceType(t3); + static createSequenceType(t4, e4) { + return n2.startSequenceType(t4), n2.addElemType(t4, e4), n2.endSequenceType(t4); } } e3.SequenceType = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - (t3.fbs || (t3.fbs = {})).EdgeEnd = class { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + (t4.fbs || (t4.fbs = {})).EdgeEnd = class { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t4, e2) { - return this.bb_pos = t4, this.bb = e2, this; + __init(t5, e2) { + return this.bb_pos = t5, this.bb = e2, this; } nodeIndex() { return this.bb.readUint32(this.bb_pos); @@ -12250,1307 +12935,1307 @@ ${t2}`); dstArgIndex() { return this.bb.readInt32(this.bb_pos + 8); } - static createEdgeEnd(t4, e2, n2, r2) { - return t4.prep(4, 12), t4.writeInt32(r2), t4.writeInt32(n2), t4.writeInt32(e2), t4.offset(); + static createEdgeEnd(t5, e2, n2, r2) { + return t5.prep(4, 12), t5.writeInt32(r2), t5.writeInt32(n2), t5.writeInt32(e2), t5.offset(); } }; - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsNodeEdge(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsNodeEdge(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsNodeEdge(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsNodeEdge(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } nodeIndex() { - let t3 = this.bb.__offset(this.bb_pos, 4); - return t3 ? this.bb.readUint32(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 4); + return t4 ? this.bb.readUint32(this.bb_pos + t4) : 0; } inputEdges(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 6); - return r2 ? (n3 || new t2.experimental.fbs.EdgeEnd()).__init(this.bb.__vector(this.bb_pos + r2) + 12 * e4, this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.EdgeEnd()).__init(this.bb.__vector(this.bb_pos + r2) + 12 * e4, this.bb) : null; } inputEdgesLength() { - let t3 = this.bb.__offset(this.bb_pos, 6); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 6); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } outputEdges(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 8); - return r2 ? (n3 || new t2.experimental.fbs.EdgeEnd()).__init(this.bb.__vector(this.bb_pos + r2) + 12 * e4, this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.EdgeEnd()).__init(this.bb.__vector(this.bb_pos + r2) + 12 * e4, this.bb) : null; } outputEdgesLength() { - let t3 = this.bb.__offset(this.bb_pos, 8); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 8); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startNodeEdge(t3) { - t3.startObject(3); + static startNodeEdge(t4) { + t4.startObject(3); } - static addNodeIndex(t3, e4) { - t3.addFieldInt32(0, e4, 0); + static addNodeIndex(t4, e4) { + t4.addFieldInt32(0, e4, 0); } - static addInputEdges(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addInputEdges(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static startInputEdgesVector(t3, e4) { - t3.startVector(12, e4, 4); + static startInputEdgesVector(t4, e4) { + t4.startVector(12, e4, 4); } - static addOutputEdges(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addOutputEdges(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static startOutputEdgesVector(t3, e4) { - t3.startVector(12, e4, 4); + static startOutputEdgesVector(t4, e4) { + t4.startVector(12, e4, 4); } - static endNodeEdge(t3) { - return t3.endObject(); + static endNodeEdge(t4) { + return t4.endObject(); } - static createNodeEdge(t3, e4, r2, i3) { - return n2.startNodeEdge(t3), n2.addNodeIndex(t3, e4), n2.addInputEdges(t3, r2), n2.addOutputEdges(t3, i3), n2.endNodeEdge(t3); + static createNodeEdge(t4, e4, r2, i3) { + return n2.startNodeEdge(t4), n2.addNodeIndex(t4, e4), n2.addInputEdges(t4, r2), n2.addOutputEdges(t4, i3), n2.endNodeEdge(t4); } } e3.NodeEdge = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsNode(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsNode(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsNode(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsNode(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - name(t3) { + name(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - docString(t3) { + docString(t4) { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - domain(t3) { + domain(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } sinceVersion() { - let t3 = this.bb.__offset(this.bb_pos, 10); - return t3 ? this.bb.readInt32(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 10); + return t4 ? this.bb.readInt32(this.bb_pos + t4) : 0; } index() { - let t3 = this.bb.__offset(this.bb_pos, 12); - return t3 ? this.bb.readUint32(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 12); + return t4 ? this.bb.readUint32(this.bb_pos + t4) : 0; } - opType(t3) { + opType(t4) { let e4 = this.bb.__offset(this.bb_pos, 14); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } type() { let e4 = this.bb.__offset(this.bb_pos, 16); - return e4 ? this.bb.readInt32(this.bb_pos + e4) : t2.experimental.fbs.NodeType.Primitive; + return e4 ? this.bb.readInt32(this.bb_pos + e4) : t3.experimental.fbs.NodeType.Primitive; } - executionProviderType(t3) { + executionProviderType(t4) { let e4 = this.bb.__offset(this.bb_pos, 18); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - inputs(t3, e4) { + inputs(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 20); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } inputsLength() { - let t3 = this.bb.__offset(this.bb_pos, 20); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 20); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - outputs(t3, e4) { + outputs(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 22); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } outputsLength() { - let t3 = this.bb.__offset(this.bb_pos, 22); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 22); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } attributes(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 24); - return r2 ? (n3 || new t2.experimental.fbs.Attribute()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Attribute()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } attributesLength() { - let t3 = this.bb.__offset(this.bb_pos, 24); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 24); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - inputArgCounts(t3) { + inputArgCounts(t4) { let e4 = this.bb.__offset(this.bb_pos, 26); - return e4 ? this.bb.readInt32(this.bb.__vector(this.bb_pos + e4) + 4 * t3) : 0; + return e4 ? this.bb.readInt32(this.bb.__vector(this.bb_pos + e4) + 4 * t4) : 0; } inputArgCountsLength() { - let t3 = this.bb.__offset(this.bb_pos, 26); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 26); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } inputArgCountsArray() { - let t3 = this.bb.__offset(this.bb_pos, 26); - return t3 ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t3), this.bb.__vector_len(this.bb_pos + t3)) : null; + let t4 = this.bb.__offset(this.bb_pos, 26); + return t4 ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t4), this.bb.__vector_len(this.bb_pos + t4)) : null; } - implicitInputs(t3, e4) { + implicitInputs(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 28); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } implicitInputsLength() { - let t3 = this.bb.__offset(this.bb_pos, 28); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 28); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startNode(t3) { - t3.startObject(13); + static startNode(t4) { + t4.startObject(13); } - static addName(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addName(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addDocString(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addDocString(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static addDomain(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addDomain(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static addSinceVersion(t3, e4) { - t3.addFieldInt32(3, e4, 0); + static addSinceVersion(t4, e4) { + t4.addFieldInt32(3, e4, 0); } - static addIndex(t3, e4) { - t3.addFieldInt32(4, e4, 0); + static addIndex(t4, e4) { + t4.addFieldInt32(4, e4, 0); } - static addOpType(t3, e4) { - t3.addFieldOffset(5, e4, 0); + static addOpType(t4, e4) { + t4.addFieldOffset(5, e4, 0); } static addType(e4, n3) { - e4.addFieldInt32(6, n3, t2.experimental.fbs.NodeType.Primitive); + e4.addFieldInt32(6, n3, t3.experimental.fbs.NodeType.Primitive); } - static addExecutionProviderType(t3, e4) { - t3.addFieldOffset(7, e4, 0); + static addExecutionProviderType(t4, e4) { + t4.addFieldOffset(7, e4, 0); } - static addInputs(t3, e4) { - t3.addFieldOffset(8, e4, 0); + static addInputs(t4, e4) { + t4.addFieldOffset(8, e4, 0); } - static createInputsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createInputsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startInputsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startInputsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addOutputs(t3, e4) { - t3.addFieldOffset(9, e4, 0); + static addOutputs(t4, e4) { + t4.addFieldOffset(9, e4, 0); } - static createOutputsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createOutputsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startOutputsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startOutputsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addAttributes(t3, e4) { - t3.addFieldOffset(10, e4, 0); + static addAttributes(t4, e4) { + t4.addFieldOffset(10, e4, 0); } - static createAttributesVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createAttributesVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startAttributesVector(t3, e4) { - t3.startVector(4, e4, 4); + static startAttributesVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addInputArgCounts(t3, e4) { - t3.addFieldOffset(11, e4, 0); + static addInputArgCounts(t4, e4) { + t4.addFieldOffset(11, e4, 0); } - static createInputArgCountsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createInputArgCountsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addInt32(e4[n3]); - return t3.endVector(); + t4.addInt32(e4[n3]); + return t4.endVector(); } - static startInputArgCountsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startInputArgCountsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addImplicitInputs(t3, e4) { - t3.addFieldOffset(12, e4, 0); + static addImplicitInputs(t4, e4) { + t4.addFieldOffset(12, e4, 0); } - static createImplicitInputsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createImplicitInputsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startImplicitInputsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startImplicitInputsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endNode(t3) { - return t3.endObject(); + static endNode(t4) { + return t4.endObject(); } - static createNode(t3, e4, r2, i3, o2, a, s, u, c, l, p, f, d, h) { - return n2.startNode(t3), n2.addName(t3, e4), n2.addDocString(t3, r2), n2.addDomain(t3, i3), n2.addSinceVersion(t3, o2), n2.addIndex(t3, a), n2.addOpType(t3, s), n2.addType(t3, u), n2.addExecutionProviderType(t3, c), n2.addInputs(t3, l), n2.addOutputs(t3, p), n2.addAttributes(t3, f), n2.addInputArgCounts(t3, d), n2.addImplicitInputs(t3, h), n2.endNode(t3); + static createNode(t4, e4, r2, i3, o2, a, s, u, c, l, p, f, d, h) { + return n2.startNode(t4), n2.addName(t4, e4), n2.addDocString(t4, r2), n2.addDomain(t4, i3), n2.addSinceVersion(t4, o2), n2.addIndex(t4, a), n2.addOpType(t4, s), n2.addType(t4, u), n2.addExecutionProviderType(t4, c), n2.addInputs(t4, l), n2.addOutputs(t4, p), n2.addAttributes(t4, f), n2.addInputArgCounts(t4, d), n2.addImplicitInputs(t4, h), n2.endNode(t4); } } e3.Node = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsValueInfo(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsValueInfo(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsValueInfo(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsValueInfo(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - name(t3) { + name(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - docString(t3) { + docString(t4) { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } type(e4) { let n3 = this.bb.__offset(this.bb_pos, 8); - return n3 ? (e4 || new t2.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.TypeInfo()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startValueInfo(t3) { - t3.startObject(3); + static startValueInfo(t4) { + t4.startObject(3); } - static addName(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addName(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addDocString(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addDocString(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static addType(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addType(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static endValueInfo(t3) { - return t3.endObject(); + static endValueInfo(t4) { + return t4.endObject(); } - static createValueInfo(t3, e4, r2, i3) { - return n2.startValueInfo(t3), n2.addName(t3, e4), n2.addDocString(t3, r2), n2.addType(t3, i3), n2.endValueInfo(t3); + static createValueInfo(t4, e4, r2, i3) { + return n2.startValueInfo(t4), n2.addName(t4, e4), n2.addDocString(t4, r2), n2.addType(t4, i3), n2.endValueInfo(t4); } } e3.ValueInfo = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsTypeInfo(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsTypeInfo(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsTypeInfo(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsTypeInfo(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - denotation(t3) { + denotation(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } valueType() { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.readUint8(this.bb_pos + e4) : t2.experimental.fbs.TypeInfoValue.NONE; + return e4 ? this.bb.readUint8(this.bb_pos + e4) : t3.experimental.fbs.TypeInfoValue.NONE; } - value(t3) { + value(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.__union(t3, this.bb_pos + e4) : null; + return e4 ? this.bb.__union(t4, this.bb_pos + e4) : null; } - static startTypeInfo(t3) { - t3.startObject(3); + static startTypeInfo(t4) { + t4.startObject(3); } - static addDenotation(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addDenotation(t4, e4) { + t4.addFieldOffset(0, e4, 0); } static addValueType(e4, n3) { - e4.addFieldInt8(1, n3, t2.experimental.fbs.TypeInfoValue.NONE); + e4.addFieldInt8(1, n3, t3.experimental.fbs.TypeInfoValue.NONE); } - static addValue(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addValue(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static endTypeInfo(t3) { - return t3.endObject(); + static endTypeInfo(t4) { + return t4.endObject(); } - static createTypeInfo(t3, e4, r2, i3) { - return n2.startTypeInfo(t3), n2.addDenotation(t3, e4), n2.addValueType(t3, r2), n2.addValue(t3, i3), n2.endTypeInfo(t3); + static createTypeInfo(t4, e4, r2, i3) { + return n2.startTypeInfo(t4), n2.addDenotation(t4, e4), n2.addValueType(t4, r2), n2.addValue(t4, i3), n2.endTypeInfo(t4); } } e3.TypeInfo = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - !function(t4) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + !function(t5) { class e2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t5, e3) { - return this.bb_pos = t5, this.bb = e3, this; + __init(t6, e3) { + return this.bb_pos = t6, this.bb = e3, this; } - static getRootAsOperatorSetId(t5, n2) { - return (n2 || new e2()).__init(t5.readInt32(t5.position()) + t5.position(), t5); + static getRootAsOperatorSetId(t6, n2) { + return (n2 || new e2()).__init(t6.readInt32(t6.position()) + t6.position(), t6); } - static getSizePrefixedRootAsOperatorSetId(t5, n2) { - return t5.setPosition(t5.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (n2 || new e2()).__init(t5.readInt32(t5.position()) + t5.position(), t5); + static getSizePrefixedRootAsOperatorSetId(t6, n2) { + return t6.setPosition(t6.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (n2 || new e2()).__init(t6.readInt32(t6.position()) + t6.position(), t6); } - domain(t5) { + domain(t6) { let e3 = this.bb.__offset(this.bb_pos, 4); - return e3 ? this.bb.__string(this.bb_pos + e3, t5) : null; + return e3 ? this.bb.__string(this.bb_pos + e3, t6) : null; } version() { - let t5 = this.bb.__offset(this.bb_pos, 6); - return t5 ? this.bb.readInt64(this.bb_pos + t5) : this.bb.createLong(0, 0); + let t6 = this.bb.__offset(this.bb_pos, 6); + return t6 ? this.bb.readInt64(this.bb_pos + t6) : this.bb.createLong(0, 0); } - static startOperatorSetId(t5) { - t5.startObject(2); + static startOperatorSetId(t6) { + t6.startObject(2); } - static addDomain(t5, e3) { - t5.addFieldOffset(0, e3, 0); + static addDomain(t6, e3) { + t6.addFieldOffset(0, e3, 0); } - static addVersion(t5, e3) { - t5.addFieldInt64(1, e3, t5.createLong(0, 0)); + static addVersion(t6, e3) { + t6.addFieldInt64(1, e3, t6.createLong(0, 0)); } - static endOperatorSetId(t5) { - return t5.endObject(); + static endOperatorSetId(t6) { + return t6.endObject(); } - static createOperatorSetId(t5, n2, r2) { - return e2.startOperatorSetId(t5), e2.addDomain(t5, n2), e2.addVersion(t5, r2), e2.endOperatorSetId(t5); + static createOperatorSetId(t6, n2, r2) { + return e2.startOperatorSetId(t6), e2.addDomain(t6, n2), e2.addVersion(t6, r2), e2.endOperatorSetId(t6); } } - t4.OperatorSetId = e2; - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + t5.OperatorSetId = e2; + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsTensor(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsTensor(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsTensor(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsTensor(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - name(t3) { + name(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - docString(t3) { + docString(t4) { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - dims(t3) { + dims(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t3) : this.bb.createLong(0, 0); + return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t4) : this.bb.createLong(0, 0); } dimsLength() { - let t3 = this.bb.__offset(this.bb_pos, 8); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 8); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } dataType() { let e4 = this.bb.__offset(this.bb_pos, 10); - return e4 ? this.bb.readInt32(this.bb_pos + e4) : t2.experimental.fbs.TensorDataType.UNDEFINED; + return e4 ? this.bb.readInt32(this.bb_pos + e4) : t3.experimental.fbs.TensorDataType.UNDEFINED; } - rawData(t3) { + rawData(t4) { let e4 = this.bb.__offset(this.bb_pos, 12); - return e4 ? this.bb.readUint8(this.bb.__vector(this.bb_pos + e4) + t3) : 0; + return e4 ? this.bb.readUint8(this.bb.__vector(this.bb_pos + e4) + t4) : 0; } rawDataLength() { - let t3 = this.bb.__offset(this.bb_pos, 12); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 12); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } rawDataArray() { - let t3 = this.bb.__offset(this.bb_pos, 12); - return t3 ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t3), this.bb.__vector_len(this.bb_pos + t3)) : null; + let t4 = this.bb.__offset(this.bb_pos, 12); + return t4 ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t4), this.bb.__vector_len(this.bb_pos + t4)) : null; } - stringData(t3, e4) { + stringData(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 14); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } stringDataLength() { - let t3 = this.bb.__offset(this.bb_pos, 14); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 14); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startTensor(t3) { - t3.startObject(6); + static startTensor(t4) { + t4.startObject(6); } - static addName(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addName(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addDocString(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addDocString(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static addDims(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addDims(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static createDimsVector(t3, e4) { - t3.startVector(8, e4.length, 8); + static createDimsVector(t4, e4) { + t4.startVector(8, e4.length, 8); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addInt64(e4[n3]); - return t3.endVector(); + t4.addInt64(e4[n3]); + return t4.endVector(); } - static startDimsVector(t3, e4) { - t3.startVector(8, e4, 8); + static startDimsVector(t4, e4) { + t4.startVector(8, e4, 8); } static addDataType(e4, n3) { - e4.addFieldInt32(3, n3, t2.experimental.fbs.TensorDataType.UNDEFINED); + e4.addFieldInt32(3, n3, t3.experimental.fbs.TensorDataType.UNDEFINED); } - static addRawData(t3, e4) { - t3.addFieldOffset(4, e4, 0); + static addRawData(t4, e4) { + t4.addFieldOffset(4, e4, 0); } - static createRawDataVector(t3, e4) { - t3.startVector(1, e4.length, 1); + static createRawDataVector(t4, e4) { + t4.startVector(1, e4.length, 1); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addInt8(e4[n3]); - return t3.endVector(); + t4.addInt8(e4[n3]); + return t4.endVector(); } - static startRawDataVector(t3, e4) { - t3.startVector(1, e4, 1); + static startRawDataVector(t4, e4) { + t4.startVector(1, e4, 1); } - static addStringData(t3, e4) { - t3.addFieldOffset(5, e4, 0); + static addStringData(t4, e4) { + t4.addFieldOffset(5, e4, 0); } - static createStringDataVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createStringDataVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startStringDataVector(t3, e4) { - t3.startVector(4, e4, 4); + static startStringDataVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endTensor(t3) { - return t3.endObject(); + static endTensor(t4) { + return t4.endObject(); } - static createTensor(t3, e4, r2, i3, o2, a, s) { - return n2.startTensor(t3), n2.addName(t3, e4), n2.addDocString(t3, r2), n2.addDims(t3, i3), n2.addDataType(t3, o2), n2.addRawData(t3, a), n2.addStringData(t3, s), n2.endTensor(t3); + static createTensor(t4, e4, r2, i3, o2, a, s) { + return n2.startTensor(t4), n2.addName(t4, e4), n2.addDocString(t4, r2), n2.addDims(t4, i3), n2.addDataType(t4, o2), n2.addRawData(t4, a), n2.addStringData(t4, s), n2.endTensor(t4); } } e3.Tensor = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsSparseTensor(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsSparseTensor(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsSparseTensor(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsSparseTensor(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } values(e4) { let n3 = this.bb.__offset(this.bb_pos, 4); - return n3 ? (e4 || new t2.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } indices(e4) { let n3 = this.bb.__offset(this.bb_pos, 6); - return n3 ? (e4 || new t2.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - dims(t3) { + dims(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t3) : this.bb.createLong(0, 0); + return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t4) : this.bb.createLong(0, 0); } dimsLength() { - let t3 = this.bb.__offset(this.bb_pos, 8); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 8); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startSparseTensor(t3) { - t3.startObject(3); + static startSparseTensor(t4) { + t4.startObject(3); } - static addValues(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addValues(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addIndices(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addIndices(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static addDims(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addDims(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static createDimsVector(t3, e4) { - t3.startVector(8, e4.length, 8); + static createDimsVector(t4, e4) { + t4.startVector(8, e4.length, 8); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addInt64(e4[n3]); - return t3.endVector(); + t4.addInt64(e4[n3]); + return t4.endVector(); } - static startDimsVector(t3, e4) { - t3.startVector(8, e4, 8); + static startDimsVector(t4, e4) { + t4.startVector(8, e4, 8); } - static endSparseTensor(t3) { - return t3.endObject(); + static endSparseTensor(t4) { + return t4.endObject(); } - static createSparseTensor(t3, e4, r2, i3) { - return n2.startSparseTensor(t3), n2.addValues(t3, e4), n2.addIndices(t3, r2), n2.addDims(t3, i3), n2.endSparseTensor(t3); + static createSparseTensor(t4, e4, r2, i3) { + return n2.startSparseTensor(t4), n2.addValues(t4, e4), n2.addIndices(t4, r2), n2.addDims(t4, i3), n2.endSparseTensor(t4); } } e3.SparseTensor = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsAttribute(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsAttribute(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsAttribute(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsAttribute(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - name(t3) { + name(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - docString(t3) { + docString(t4) { let e4 = this.bb.__offset(this.bb_pos, 6); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } type() { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.readInt32(this.bb_pos + e4) : t2.experimental.fbs.AttributeType.UNDEFINED; + return e4 ? this.bb.readInt32(this.bb_pos + e4) : t3.experimental.fbs.AttributeType.UNDEFINED; } f() { - let t3 = this.bb.__offset(this.bb_pos, 10); - return t3 ? this.bb.readFloat32(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 10); + return t4 ? this.bb.readFloat32(this.bb_pos + t4) : 0; } i() { - let t3 = this.bb.__offset(this.bb_pos, 12); - return t3 ? this.bb.readInt64(this.bb_pos + t3) : this.bb.createLong(0, 0); + let t4 = this.bb.__offset(this.bb_pos, 12); + return t4 ? this.bb.readInt64(this.bb_pos + t4) : this.bb.createLong(0, 0); } - s(t3) { + s(t4) { let e4 = this.bb.__offset(this.bb_pos, 14); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } t(e4) { let n3 = this.bb.__offset(this.bb_pos, 16); - return n3 ? (e4 || new t2.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } g(e4) { let n3 = this.bb.__offset(this.bb_pos, 18); - return n3 ? (e4 || new t2.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - floats(t3) { + floats(t4) { let e4 = this.bb.__offset(this.bb_pos, 20); - return e4 ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + e4) + 4 * t3) : 0; + return e4 ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + e4) + 4 * t4) : 0; } floatsLength() { - let t3 = this.bb.__offset(this.bb_pos, 20); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 20); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } floatsArray() { - let t3 = this.bb.__offset(this.bb_pos, 20); - return t3 ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t3), this.bb.__vector_len(this.bb_pos + t3)) : null; + let t4 = this.bb.__offset(this.bb_pos, 20); + return t4 ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t4), this.bb.__vector_len(this.bb_pos + t4)) : null; } - ints(t3) { + ints(t4) { let e4 = this.bb.__offset(this.bb_pos, 22); - return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t3) : this.bb.createLong(0, 0); + return e4 ? this.bb.readInt64(this.bb.__vector(this.bb_pos + e4) + 8 * t4) : this.bb.createLong(0, 0); } intsLength() { - let t3 = this.bb.__offset(this.bb_pos, 22); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 22); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - strings(t3, e4) { + strings(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 24); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } stringsLength() { - let t3 = this.bb.__offset(this.bb_pos, 24); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 24); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } tensors(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 26); - return r2 ? (n3 || new t2.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } tensorsLength() { - let t3 = this.bb.__offset(this.bb_pos, 26); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 26); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } graphs(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 28); - return r2 ? (n3 || new t2.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } graphsLength() { - let t3 = this.bb.__offset(this.bb_pos, 28); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 28); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startAttribute(t3) { - t3.startObject(13); + static startAttribute(t4) { + t4.startObject(13); } - static addName(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addName(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addDocString(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addDocString(t4, e4) { + t4.addFieldOffset(1, e4, 0); } static addType(e4, n3) { - e4.addFieldInt32(2, n3, t2.experimental.fbs.AttributeType.UNDEFINED); + e4.addFieldInt32(2, n3, t3.experimental.fbs.AttributeType.UNDEFINED); } - static addF(t3, e4) { - t3.addFieldFloat32(3, e4, 0); + static addF(t4, e4) { + t4.addFieldFloat32(3, e4, 0); } - static addI(t3, e4) { - t3.addFieldInt64(4, e4, t3.createLong(0, 0)); + static addI(t4, e4) { + t4.addFieldInt64(4, e4, t4.createLong(0, 0)); } - static addS(t3, e4) { - t3.addFieldOffset(5, e4, 0); + static addS(t4, e4) { + t4.addFieldOffset(5, e4, 0); } - static addT(t3, e4) { - t3.addFieldOffset(6, e4, 0); + static addT(t4, e4) { + t4.addFieldOffset(6, e4, 0); } - static addG(t3, e4) { - t3.addFieldOffset(7, e4, 0); + static addG(t4, e4) { + t4.addFieldOffset(7, e4, 0); } - static addFloats(t3, e4) { - t3.addFieldOffset(8, e4, 0); + static addFloats(t4, e4) { + t4.addFieldOffset(8, e4, 0); } - static createFloatsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createFloatsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addFloat32(e4[n3]); - return t3.endVector(); + t4.addFloat32(e4[n3]); + return t4.endVector(); } - static startFloatsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startFloatsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addInts(t3, e4) { - t3.addFieldOffset(9, e4, 0); + static addInts(t4, e4) { + t4.addFieldOffset(9, e4, 0); } - static createIntsVector(t3, e4) { - t3.startVector(8, e4.length, 8); + static createIntsVector(t4, e4) { + t4.startVector(8, e4.length, 8); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addInt64(e4[n3]); - return t3.endVector(); + t4.addInt64(e4[n3]); + return t4.endVector(); } - static startIntsVector(t3, e4) { - t3.startVector(8, e4, 8); + static startIntsVector(t4, e4) { + t4.startVector(8, e4, 8); } - static addStrings(t3, e4) { - t3.addFieldOffset(10, e4, 0); + static addStrings(t4, e4) { + t4.addFieldOffset(10, e4, 0); } - static createStringsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createStringsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startStringsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startStringsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addTensors(t3, e4) { - t3.addFieldOffset(11, e4, 0); + static addTensors(t4, e4) { + t4.addFieldOffset(11, e4, 0); } - static createTensorsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createTensorsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startTensorsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startTensorsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addGraphs(t3, e4) { - t3.addFieldOffset(12, e4, 0); + static addGraphs(t4, e4) { + t4.addFieldOffset(12, e4, 0); } - static createGraphsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createGraphsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startGraphsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startGraphsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endAttribute(t3) { - return t3.endObject(); + static endAttribute(t4) { + return t4.endObject(); } - static createAttribute(t3, e4, r2, i3, o2, a, s, u, c, l, p, f, d, h) { - return n2.startAttribute(t3), n2.addName(t3, e4), n2.addDocString(t3, r2), n2.addType(t3, i3), n2.addF(t3, o2), n2.addI(t3, a), n2.addS(t3, s), n2.addT(t3, u), n2.addG(t3, c), n2.addFloats(t3, l), n2.addInts(t3, p), n2.addStrings(t3, f), n2.addTensors(t3, d), n2.addGraphs(t3, h), n2.endAttribute(t3); + static createAttribute(t4, e4, r2, i3, o2, a, s, u, c, l, p, f, d, h) { + return n2.startAttribute(t4), n2.addName(t4, e4), n2.addDocString(t4, r2), n2.addType(t4, i3), n2.addF(t4, o2), n2.addI(t4, a), n2.addS(t4, s), n2.addT(t4, u), n2.addG(t4, c), n2.addFloats(t4, l), n2.addInts(t4, p), n2.addStrings(t4, f), n2.addTensors(t4, d), n2.addGraphs(t4, h), n2.endAttribute(t4); } } e3.Attribute = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsGraph(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsGraph(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsGraph(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsGraph(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } initializers(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 4); - return r2 ? (n3 || new t2.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Tensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } initializersLength() { - let t3 = this.bb.__offset(this.bb_pos, 4); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 4); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } nodeArgs(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 6); - return r2 ? (n3 || new t2.experimental.fbs.ValueInfo()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.ValueInfo()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } nodeArgsLength() { - let t3 = this.bb.__offset(this.bb_pos, 6); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 6); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } nodes(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 8); - return r2 ? (n3 || new t2.experimental.fbs.Node()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.Node()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } nodesLength() { - let t3 = this.bb.__offset(this.bb_pos, 8); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 8); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } maxNodeIndex() { - let t3 = this.bb.__offset(this.bb_pos, 10); - return t3 ? this.bb.readUint32(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 10); + return t4 ? this.bb.readUint32(this.bb_pos + t4) : 0; } nodeEdges(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 12); - return r2 ? (n3 || new t2.experimental.fbs.NodeEdge()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.NodeEdge()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } nodeEdgesLength() { - let t3 = this.bb.__offset(this.bb_pos, 12); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 12); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - inputs(t3, e4) { + inputs(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 14); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } inputsLength() { - let t3 = this.bb.__offset(this.bb_pos, 14); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 14); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - outputs(t3, e4) { + outputs(t4, e4) { let n3 = this.bb.__offset(this.bb_pos, 16); - return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t3, e4) : null; + return n3 ? this.bb.__string(this.bb.__vector(this.bb_pos + n3) + 4 * t4, e4) : null; } outputsLength() { - let t3 = this.bb.__offset(this.bb_pos, 16); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 16); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } sparseInitializers(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 18); - return r2 ? (n3 || new t2.experimental.fbs.SparseTensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.SparseTensor()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } sparseInitializersLength() { - let t3 = this.bb.__offset(this.bb_pos, 18); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 18); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startGraph(t3) { - t3.startObject(8); + static startGraph(t4) { + t4.startObject(8); } - static addInitializers(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addInitializers(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static createInitializersVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createInitializersVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startInitializersVector(t3, e4) { - t3.startVector(4, e4, 4); + static startInitializersVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addNodeArgs(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addNodeArgs(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static createNodeArgsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createNodeArgsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startNodeArgsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startNodeArgsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addNodes(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addNodes(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static createNodesVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createNodesVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startNodesVector(t3, e4) { - t3.startVector(4, e4, 4); + static startNodesVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addMaxNodeIndex(t3, e4) { - t3.addFieldInt32(3, e4, 0); + static addMaxNodeIndex(t4, e4) { + t4.addFieldInt32(3, e4, 0); } - static addNodeEdges(t3, e4) { - t3.addFieldOffset(4, e4, 0); + static addNodeEdges(t4, e4) { + t4.addFieldOffset(4, e4, 0); } - static createNodeEdgesVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createNodeEdgesVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startNodeEdgesVector(t3, e4) { - t3.startVector(4, e4, 4); + static startNodeEdgesVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addInputs(t3, e4) { - t3.addFieldOffset(5, e4, 0); + static addInputs(t4, e4) { + t4.addFieldOffset(5, e4, 0); } - static createInputsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createInputsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startInputsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startInputsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addOutputs(t3, e4) { - t3.addFieldOffset(6, e4, 0); + static addOutputs(t4, e4) { + t4.addFieldOffset(6, e4, 0); } - static createOutputsVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createOutputsVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startOutputsVector(t3, e4) { - t3.startVector(4, e4, 4); + static startOutputsVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addSparseInitializers(t3, e4) { - t3.addFieldOffset(7, e4, 0); + static addSparseInitializers(t4, e4) { + t4.addFieldOffset(7, e4, 0); } - static createSparseInitializersVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createSparseInitializersVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startSparseInitializersVector(t3, e4) { - t3.startVector(4, e4, 4); + static startSparseInitializersVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endGraph(t3) { - return t3.endObject(); + static endGraph(t4) { + return t4.endObject(); } - static createGraph(t3, e4, r2, i3, o2, a, s, u, c) { - return n2.startGraph(t3), n2.addInitializers(t3, e4), n2.addNodeArgs(t3, r2), n2.addNodes(t3, i3), n2.addMaxNodeIndex(t3, o2), n2.addNodeEdges(t3, a), n2.addInputs(t3, s), n2.addOutputs(t3, u), n2.addSparseInitializers(t3, c), n2.endGraph(t3); + static createGraph(t4, e4, r2, i3, o2, a, s, u, c) { + return n2.startGraph(t4), n2.addInitializers(t4, e4), n2.addNodeArgs(t4, r2), n2.addNodes(t4, i3), n2.addMaxNodeIndex(t4, o2), n2.addNodeEdges(t4, a), n2.addInputs(t4, s), n2.addOutputs(t4, u), n2.addSparseInitializers(t4, c), n2.endGraph(t4); } } e3.Graph = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsModel(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsModel(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsModel(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsModel(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } irVersion() { - let t3 = this.bb.__offset(this.bb_pos, 4); - return t3 ? this.bb.readInt64(this.bb_pos + t3) : this.bb.createLong(0, 0); + let t4 = this.bb.__offset(this.bb_pos, 4); + return t4 ? this.bb.readInt64(this.bb_pos + t4) : this.bb.createLong(0, 0); } opsetImport(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 6); - return r2 ? (n3 || new t2.experimental.fbs.OperatorSetId()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.OperatorSetId()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } opsetImportLength() { - let t3 = this.bb.__offset(this.bb_pos, 6); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 6); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - producerName(t3) { + producerName(t4) { let e4 = this.bb.__offset(this.bb_pos, 8); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - producerVersion(t3) { + producerVersion(t4) { let e4 = this.bb.__offset(this.bb_pos, 10); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - domain(t3) { + domain(t4) { let e4 = this.bb.__offset(this.bb_pos, 12); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } modelVersion() { - let t3 = this.bb.__offset(this.bb_pos, 14); - return t3 ? this.bb.readInt64(this.bb_pos + t3) : this.bb.createLong(0, 0); + let t4 = this.bb.__offset(this.bb_pos, 14); + return t4 ? this.bb.readInt64(this.bb_pos + t4) : this.bb.createLong(0, 0); } - docString(t3) { + docString(t4) { let e4 = this.bb.__offset(this.bb_pos, 16); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } graph(e4) { let n3 = this.bb.__offset(this.bb_pos, 18); - return n3 ? (e4 || new t2.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Graph()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - graphDocString(t3) { + graphDocString(t4) { let e4 = this.bb.__offset(this.bb_pos, 20); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } - static startModel(t3) { - t3.startObject(9); + static startModel(t4) { + t4.startObject(9); } - static addIrVersion(t3, e4) { - t3.addFieldInt64(0, e4, t3.createLong(0, 0)); + static addIrVersion(t4, e4) { + t4.addFieldInt64(0, e4, t4.createLong(0, 0)); } - static addOpsetImport(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addOpsetImport(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static createOpsetImportVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createOpsetImportVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startOpsetImportVector(t3, e4) { - t3.startVector(4, e4, 4); + static startOpsetImportVector(t4, e4) { + t4.startVector(4, e4, 4); } - static addProducerName(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addProducerName(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static addProducerVersion(t3, e4) { - t3.addFieldOffset(3, e4, 0); + static addProducerVersion(t4, e4) { + t4.addFieldOffset(3, e4, 0); } - static addDomain(t3, e4) { - t3.addFieldOffset(4, e4, 0); + static addDomain(t4, e4) { + t4.addFieldOffset(4, e4, 0); } - static addModelVersion(t3, e4) { - t3.addFieldInt64(5, e4, t3.createLong(0, 0)); + static addModelVersion(t4, e4) { + t4.addFieldInt64(5, e4, t4.createLong(0, 0)); } - static addDocString(t3, e4) { - t3.addFieldOffset(6, e4, 0); + static addDocString(t4, e4) { + t4.addFieldOffset(6, e4, 0); } - static addGraph(t3, e4) { - t3.addFieldOffset(7, e4, 0); + static addGraph(t4, e4) { + t4.addFieldOffset(7, e4, 0); } - static addGraphDocString(t3, e4) { - t3.addFieldOffset(8, e4, 0); + static addGraphDocString(t4, e4) { + t4.addFieldOffset(8, e4, 0); } - static endModel(t3) { - return t3.endObject(); + static endModel(t4) { + return t4.endObject(); } - static createModel(t3, e4, r2, i3, o2, a, s, u, c, l) { - return n2.startModel(t3), n2.addIrVersion(t3, e4), n2.addOpsetImport(t3, r2), n2.addProducerName(t3, i3), n2.addProducerVersion(t3, o2), n2.addDomain(t3, a), n2.addModelVersion(t3, s), n2.addDocString(t3, u), n2.addGraph(t3, c), n2.addGraphDocString(t3, l), n2.endModel(t3); + static createModel(t4, e4, r2, i3, o2, a, s, u, c, l) { + return n2.startModel(t4), n2.addIrVersion(t4, e4), n2.addOpsetImport(t4, r2), n2.addProducerName(t4, i3), n2.addProducerVersion(t4, o2), n2.addDomain(t4, a), n2.addModelVersion(t4, s), n2.addDocString(t4, u), n2.addGraph(t4, c), n2.addGraphDocString(t4, l), n2.endModel(t4); } } e3.Model = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { - !function(t3) { - !function(t4) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { + !function(t4) { + !function(t5) { class e2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t5, e3) { - return this.bb_pos = t5, this.bb = e3, this; + __init(t6, e3) { + return this.bb_pos = t6, this.bb = e3, this; } - static getRootAsKernelCreateInfos(t5, n2) { - return (n2 || new e2()).__init(t5.readInt32(t5.position()) + t5.position(), t5); + static getRootAsKernelCreateInfos(t6, n2) { + return (n2 || new e2()).__init(t6.readInt32(t6.position()) + t6.position(), t6); } - static getSizePrefixedRootAsKernelCreateInfos(t5, n2) { - return t5.setPosition(t5.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (n2 || new e2()).__init(t5.readInt32(t5.position()) + t5.position(), t5); + static getSizePrefixedRootAsKernelCreateInfos(t6, n2) { + return t6.setPosition(t6.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (n2 || new e2()).__init(t6.readInt32(t6.position()) + t6.position(), t6); } - nodeIndices(t5) { + nodeIndices(t6) { let e3 = this.bb.__offset(this.bb_pos, 4); - return e3 ? this.bb.readUint32(this.bb.__vector(this.bb_pos + e3) + 4 * t5) : 0; + return e3 ? this.bb.readUint32(this.bb.__vector(this.bb_pos + e3) + 4 * t6) : 0; } nodeIndicesLength() { - let t5 = this.bb.__offset(this.bb_pos, 4); - return t5 ? this.bb.__vector_len(this.bb_pos + t5) : 0; + let t6 = this.bb.__offset(this.bb_pos, 4); + return t6 ? this.bb.__vector_len(this.bb_pos + t6) : 0; } nodeIndicesArray() { - let t5 = this.bb.__offset(this.bb_pos, 4); - return t5 ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t5), this.bb.__vector_len(this.bb_pos + t5)) : null; + let t6 = this.bb.__offset(this.bb_pos, 4); + return t6 ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t6), this.bb.__vector_len(this.bb_pos + t6)) : null; } - kernelDefHashes(t5) { + kernelDefHashes(t6) { let e3 = this.bb.__offset(this.bb_pos, 6); - return e3 ? this.bb.readUint64(this.bb.__vector(this.bb_pos + e3) + 8 * t5) : this.bb.createLong(0, 0); + return e3 ? this.bb.readUint64(this.bb.__vector(this.bb_pos + e3) + 8 * t6) : this.bb.createLong(0, 0); } kernelDefHashesLength() { - let t5 = this.bb.__offset(this.bb_pos, 6); - return t5 ? this.bb.__vector_len(this.bb_pos + t5) : 0; + let t6 = this.bb.__offset(this.bb_pos, 6); + return t6 ? this.bb.__vector_len(this.bb_pos + t6) : 0; } - static startKernelCreateInfos(t5) { - t5.startObject(2); + static startKernelCreateInfos(t6) { + t6.startObject(2); } - static addNodeIndices(t5, e3) { - t5.addFieldOffset(0, e3, 0); + static addNodeIndices(t6, e3) { + t6.addFieldOffset(0, e3, 0); } - static createNodeIndicesVector(t5, e3) { - t5.startVector(4, e3.length, 4); + static createNodeIndicesVector(t6, e3) { + t6.startVector(4, e3.length, 4); for (let n2 = e3.length - 1; n2 >= 0; n2--) - t5.addInt32(e3[n2]); - return t5.endVector(); + t6.addInt32(e3[n2]); + return t6.endVector(); } - static startNodeIndicesVector(t5, e3) { - t5.startVector(4, e3, 4); + static startNodeIndicesVector(t6, e3) { + t6.startVector(4, e3, 4); } - static addKernelDefHashes(t5, e3) { - t5.addFieldOffset(1, e3, 0); + static addKernelDefHashes(t6, e3) { + t6.addFieldOffset(1, e3, 0); } - static createKernelDefHashesVector(t5, e3) { - t5.startVector(8, e3.length, 8); + static createKernelDefHashesVector(t6, e3) { + t6.startVector(8, e3.length, 8); for (let n2 = e3.length - 1; n2 >= 0; n2--) - t5.addInt64(e3[n2]); - return t5.endVector(); + t6.addInt64(e3[n2]); + return t6.endVector(); } - static startKernelDefHashesVector(t5, e3) { - t5.startVector(8, e3, 8); + static startKernelDefHashesVector(t6, e3) { + t6.startVector(8, e3, 8); } - static endKernelCreateInfos(t5) { - return t5.endObject(); + static endKernelCreateInfos(t6) { + return t6.endObject(); } - static createKernelCreateInfos(t5, n2, r2) { - return e2.startKernelCreateInfos(t5), e2.addNodeIndices(t5, n2), e2.addKernelDefHashes(t5, r2), e2.endKernelCreateInfos(t5); + static createKernelCreateInfos(t6, n2, r2) { + return e2.startKernelCreateInfos(t6), e2.addNodeIndices(t6, n2), e2.addKernelDefHashes(t6, r2), e2.endKernelCreateInfos(t6); } } - t4.KernelCreateInfos = e2; - }(t3.fbs || (t3.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + t5.KernelCreateInfos = e2; + }(t4.fbs || (t4.fbs = {})); + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsSubGraphSessionState(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsSubGraphSessionState(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsSubGraphSessionState(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsSubGraphSessionState(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - graphId(t3) { + graphId(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } sessionState(e4) { let n3 = this.bb.__offset(this.bb_pos, 6); - return n3 ? (e4 || new t2.experimental.fbs.SessionState()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.SessionState()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startSubGraphSessionState(t3) { - t3.startObject(2); + static startSubGraphSessionState(t4) { + t4.startObject(2); } - static addGraphId(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addGraphId(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addSessionState(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addSessionState(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static endSubGraphSessionState(t3) { - let e4 = t3.endObject(); - return t3.requiredField(e4, 4), e4; + static endSubGraphSessionState(t4) { + let e4 = t4.endObject(); + return t4.requiredField(e4, 4), e4; } - static createSubGraphSessionState(t3, e4, r2) { - return n2.startSubGraphSessionState(t3), n2.addGraphId(t3, e4), n2.addSessionState(t3, r2), n2.endSubGraphSessionState(t3); + static createSubGraphSessionState(t4, e4, r2) { + return n2.startSubGraphSessionState(t4), n2.addGraphId(t4, e4), n2.addSessionState(t4, r2), n2.endSubGraphSessionState(t4); } } e3.SubGraphSessionState = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsSessionState(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsSessionState(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsSessionState(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsSessionState(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } kernels(e4) { let n3 = this.bb.__offset(this.bb_pos, 4); - return n3 ? (e4 || new t2.experimental.fbs.KernelCreateInfos()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.KernelCreateInfos()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } subGraphSessionStates(e4, n3) { let r2 = this.bb.__offset(this.bb_pos, 6); - return r2 ? (n3 || new t2.experimental.fbs.SubGraphSessionState()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; + return r2 ? (n3 || new t3.experimental.fbs.SubGraphSessionState()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + r2) + 4 * e4), this.bb) : null; } subGraphSessionStatesLength() { - let t3 = this.bb.__offset(this.bb_pos, 6); - return t3 ? this.bb.__vector_len(this.bb_pos + t3) : 0; + let t4 = this.bb.__offset(this.bb_pos, 6); + return t4 ? this.bb.__vector_len(this.bb_pos + t4) : 0; } - static startSessionState(t3) { - t3.startObject(2); + static startSessionState(t4) { + t4.startObject(2); } - static addKernels(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addKernels(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addSubGraphSessionStates(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addSubGraphSessionStates(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static createSubGraphSessionStatesVector(t3, e4) { - t3.startVector(4, e4.length, 4); + static createSubGraphSessionStatesVector(t4, e4) { + t4.startVector(4, e4.length, 4); for (let n3 = e4.length - 1; n3 >= 0; n3--) - t3.addOffset(e4[n3]); - return t3.endVector(); + t4.addOffset(e4[n3]); + return t4.endVector(); } - static startSubGraphSessionStatesVector(t3, e4) { - t3.startVector(4, e4, 4); + static startSubGraphSessionStatesVector(t4, e4) { + t4.startVector(4, e4, 4); } - static endSessionState(t3) { - return t3.endObject(); + static endSessionState(t4) { + return t4.endObject(); } - static createSessionState(t3, e4, r2) { - return n2.startSessionState(t3), n2.addKernels(t3, e4), n2.addSubGraphSessionStates(t3, r2), n2.endSessionState(t3); + static createSessionState(t4, e4, r2) { + return n2.startSessionState(t4), n2.addKernels(t4, e4), n2.addSubGraphSessionStates(t4, r2), n2.endSessionState(t4); } } e3.SessionState = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); - }(e.onnxruntime || (e.onnxruntime = {})), function(t2) { + }(t3.experimental || (t3.experimental = {})); + }(e.onnxruntime || (e.onnxruntime = {})), function(t3) { !function(e2) { !function(e3) { class n2 { constructor() { this.bb = null, this.bb_pos = 0; } - __init(t3, e4) { - return this.bb_pos = t3, this.bb = e4, this; + __init(t4, e4) { + return this.bb_pos = t4, this.bb = e4, this; } - static getRootAsInferenceSession(t3, e4) { - return (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getRootAsInferenceSession(t4, e4) { + return (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static getSizePrefixedRootAsInferenceSession(t3, e4) { - return t3.setPosition(t3.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t3.readInt32(t3.position()) + t3.position(), t3); + static getSizePrefixedRootAsInferenceSession(t4, e4) { + return t4.setPosition(t4.position() + r.flatbuffers.SIZE_PREFIX_LENGTH), (e4 || new n2()).__init(t4.readInt32(t4.position()) + t4.position(), t4); } - static bufferHasIdentifier(t3) { - return t3.__has_identifier("ORTM"); + static bufferHasIdentifier(t4) { + return t4.__has_identifier("ORTM"); } - ortVersion(t3) { + ortVersion(t4) { let e4 = this.bb.__offset(this.bb_pos, 4); - return e4 ? this.bb.__string(this.bb_pos + e4, t3) : null; + return e4 ? this.bb.__string(this.bb_pos + e4, t4) : null; } model(e4) { let n3 = this.bb.__offset(this.bb_pos, 6); - return n3 ? (e4 || new t2.experimental.fbs.Model()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.Model()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } sessionState(e4) { let n3 = this.bb.__offset(this.bb_pos, 8); - return n3 ? (e4 || new t2.experimental.fbs.SessionState()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; + return n3 ? (e4 || new t3.experimental.fbs.SessionState()).__init(this.bb.__indirect(this.bb_pos + n3), this.bb) : null; } - static startInferenceSession(t3) { - t3.startObject(3); + static startInferenceSession(t4) { + t4.startObject(3); } - static addOrtVersion(t3, e4) { - t3.addFieldOffset(0, e4, 0); + static addOrtVersion(t4, e4) { + t4.addFieldOffset(0, e4, 0); } - static addModel(t3, e4) { - t3.addFieldOffset(1, e4, 0); + static addModel(t4, e4) { + t4.addFieldOffset(1, e4, 0); } - static addSessionState(t3, e4) { - t3.addFieldOffset(2, e4, 0); + static addSessionState(t4, e4) { + t4.addFieldOffset(2, e4, 0); } - static endInferenceSession(t3) { - return t3.endObject(); + static endInferenceSession(t4) { + return t4.endObject(); } - static finishInferenceSessionBuffer(t3, e4) { - t3.finish(e4, "ORTM"); + static finishInferenceSessionBuffer(t4, e4) { + t4.finish(e4, "ORTM"); } - static finishSizePrefixedInferenceSessionBuffer(t3, e4) { - t3.finish(e4, "ORTM", true); + static finishSizePrefixedInferenceSessionBuffer(t4, e4) { + t4.finish(e4, "ORTM", true); } - static createInferenceSession(t3, e4, r2, i3) { - return n2.startInferenceSession(t3), n2.addOrtVersion(t3, e4), n2.addModel(t3, r2), n2.addSessionState(t3, i3), n2.endInferenceSession(t3); + static createInferenceSession(t4, e4, r2, i3) { + return n2.startInferenceSession(t4), n2.addOrtVersion(t4, e4), n2.addModel(t4, r2), n2.addSessionState(t4, i3), n2.endInferenceSession(t4); } } e3.InferenceSession = n2; }(e2.fbs || (e2.fbs = {})); - }(t2.experimental || (t2.experimental = {})); + }(t3.experimental || (t3.experimental = {})); }(e.onnxruntime || (e.onnxruntime = {})); - }, 7448: (t, e, n) => { + }, 7448: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.OnnxjsSessionHandler = void 0; const r = n(6207), i2 = n(9162); e.OnnxjsSessionHandler = class { - constructor(t2) { - this.session = t2, this.inputNames = this.session.inputNames, this.outputNames = this.session.outputNames; + constructor(t3) { + this.session = t3, this.inputNames = this.session.inputNames, this.outputNames = this.session.outputNames; } async dispose() { } - async run(t2, e2, n2) { + async run(t3, e2, n2) { const o = /* @__PURE__ */ new Map(); - for (const e3 in t2) - if (Object.hasOwnProperty.call(t2, e3)) { - const n3 = t2[e3]; + for (const e3 in t3) + if (Object.hasOwnProperty.call(t3, e3)) { + const n3 = t3[e3]; o.set(e3, new i2.Tensor(n3.dims, n3.type, void 0, void 0, n3.data)); } const a = await this.session.run(o), s = {}; - return a.forEach((t3, e3) => { - s[e3] = new r.Tensor(t3.type, t3.data, t3.dims); + return a.forEach((t4, e3) => { + s[e3] = new r.Tensor(t4.type, t4.data, t4.dims); }), s; } startProfiling() { @@ -13560,13 +14245,13 @@ ${t2}`); this.session.endProfiling(); } }; - }, 6919: (t, e, n) => { + }, 6919: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.Session = void 0; const r = n(6231), i2 = n(6464), o = n(7091), a = n(1036), s = n(3694), u = n(2644); e.Session = class { - constructor(t2 = {}) { - this._initialized = false, this.backendHint = t2.backendHint, this.profiler = s.Profiler.create(t2.profiler), this.context = { profiler: this.profiler, graphInputTypes: [], graphInputDims: [] }; + constructor(t3 = {}) { + this._initialized = false, this.backendHint = t3.backendHint, this.profiler = s.Profiler.create(t3.profiler), this.context = { profiler: this.profiler, graphInputTypes: [], graphInputDims: [] }; } get inputNames() { return this._model.graph.getInputNames(); @@ -13580,114 +14265,114 @@ ${t2}`); endProfiling() { this.profiler.stop(); } - async loadModel(t2, e2, n2) { + async loadModel(t3, e2, n2) { await this.profiler.event("session", "Session.loadModel", async () => { const a2 = await (0, o.resolveBackend)(this.backendHint); - if (this.sessionHandler = a2.createSessionHandler(this.context), this._model = new u.Model(), "string" == typeof t2) { - const e3 = t2.endsWith(".ort"); + if (this.sessionHandler = a2.createSessionHandler(this.context), this._model = new u.Model(), "string" == typeof t3) { + const e3 = t3.endsWith(".ort"); if ("undefined" == typeof fetch) { - const n3 = await (0, i2.promisify)(r.readFile)(t2); + const n3 = await (0, i2.promisify)(r.readFile)(t3); this.initialize(n3, e3); } else { - const n3 = await fetch(t2), r2 = await n3.arrayBuffer(); + const n3 = await fetch(t3), r2 = await n3.arrayBuffer(); this.initialize(new Uint8Array(r2), e3); } - } else if (ArrayBuffer.isView(t2)) - this.initialize(t2); + } else if (ArrayBuffer.isView(t3)) + this.initialize(t3); else { - const r2 = new Uint8Array(t2, e2 || 0, n2 || t2.byteLength); + const r2 = new Uint8Array(t3, e2 || 0, n2 || t3.byteLength); this.initialize(r2); } }); } - initialize(t2, e2) { + initialize(t3, e2) { if (this._initialized) throw new Error("already initialized"); this.profiler.event("session", "Session.initialize", () => { const n2 = this.sessionHandler.transformGraph ? this.sessionHandler : void 0; - this._model.load(t2, n2, e2), this.sessionHandler.onGraphInitialized && this.sessionHandler.onGraphInitialized(this._model.graph), this.initializeOps(this._model.graph), this._executionPlan = new a.ExecutionPlan(this._model.graph, this._ops, this.profiler); + this._model.load(t3, n2, e2), this.sessionHandler.onGraphInitialized && this.sessionHandler.onGraphInitialized(this._model.graph), this.initializeOps(this._model.graph), this._executionPlan = new a.ExecutionPlan(this._model.graph, this._ops, this.profiler); }), this._initialized = true; } - async run(t2) { + async run(t3) { if (!this._initialized) throw new Error("session not initialized yet"); return this.profiler.event("session", "Session.run", async () => { - const e2 = this.normalizeAndValidateInputs(t2), n2 = await this._executionPlan.execute(this.sessionHandler, e2); + const e2 = this.normalizeAndValidateInputs(t3), n2 = await this._executionPlan.execute(this.sessionHandler, e2); return this.createOutput(n2); }); } - normalizeAndValidateInputs(t2) { + normalizeAndValidateInputs(t3) { const e2 = this._model.graph.getInputNames(); - if (Array.isArray(t2)) { - if (t2.length !== e2.length) - throw new Error(`incorrect input array length: expected ${e2.length} but got ${t2.length}`); + if (Array.isArray(t3)) { + if (t3.length !== e2.length) + throw new Error(`incorrect input array length: expected ${e2.length} but got ${t3.length}`); } else { - if (t2.size !== e2.length) - throw new Error(`incorrect input map size: expected ${e2.length} but got ${t2.size}`); - const n2 = new Array(t2.size); + if (t3.size !== e2.length) + throw new Error(`incorrect input map size: expected ${e2.length} but got ${t3.size}`); + const n2 = new Array(t3.size); let r2 = 0; for (let i3 = 0; i3 < e2.length; ++i3) { - const o2 = t2.get(e2[i3]); + const o2 = t3.get(e2[i3]); if (!o2) throw new Error(`missing input tensor for: '${name}'`); n2[r2++] = o2; } - t2 = n2; + t3 = n2; } if (this.context.graphInputTypes && 0 !== this.context.graphInputTypes.length && this.context.graphInputDims && 0 !== this.context.graphInputDims.length) - this.validateInputTensorDims(this.context.graphInputDims, t2, false); + this.validateInputTensorDims(this.context.graphInputDims, t3, false); else { const e3 = this._model.graph.getInputIndices(), n2 = this._model.graph.getValues(), r2 = new Array(e3.length); for (let i3 = 0; i3 < e3.length; ++i3) { const o2 = n2[e3[i3]]; - r2[i3] = o2.type.shape.dims, this.context.graphInputTypes.push(o2.type.tensorType), this.context.graphInputDims.push(t2[i3].dims); + r2[i3] = o2.type.shape.dims, this.context.graphInputTypes.push(o2.type.tensorType), this.context.graphInputDims.push(t3[i3].dims); } - this.validateInputTensorDims(r2, t2, true); + this.validateInputTensorDims(r2, t3, true); } - return this.validateInputTensorTypes(this.context.graphInputTypes, t2), t2; + return this.validateInputTensorTypes(this.context.graphInputTypes, t3), t3; } - validateInputTensorTypes(t2, e2) { + validateInputTensorTypes(t3, e2) { for (let n2 = 0; n2 < e2.length; n2++) { - const r2 = t2[n2], i3 = e2[n2].type; + const r2 = t3[n2], i3 = e2[n2].type; if (r2 !== i3) throw new Error(`input tensor[${n2}] check failed: expected type '${r2}' but got ${i3}`); } } - validateInputTensorDims(t2, e2, n2) { + validateInputTensorDims(t3, e2, n2) { for (let r2 = 0; r2 < e2.length; r2++) { - const i3 = t2[r2], o2 = e2[r2].dims; + const i3 = t3[r2], o2 = e2[r2].dims; if (!this.compareTensorDims(i3, o2, n2)) throw new Error(`input tensor[${r2}] check failed: expected shape '[${i3.join(",")}]' but got [${o2.join(",")}]`); } } - compareTensorDims(t2, e2, n2) { - if (t2.length !== e2.length) + compareTensorDims(t3, e2, n2) { + if (t3.length !== e2.length) return false; - for (let r2 = 0; r2 < t2.length; ++r2) - if (t2[r2] !== e2[r2] && (!n2 || 0 !== t2[r2])) + for (let r2 = 0; r2 < t3.length; ++r2) + if (t3[r2] !== e2[r2] && (!n2 || 0 !== t3[r2])) return false; return true; } - createOutput(t2) { + createOutput(t3) { const e2 = this._model.graph.getOutputNames(); - if (t2.length !== e2.length) + if (t3.length !== e2.length) throw new Error("expected number of outputs do not match number of generated outputs"); const n2 = /* @__PURE__ */ new Map(); for (let r2 = 0; r2 < e2.length; ++r2) - n2.set(e2[r2], t2[r2]); + n2.set(e2[r2], t3[r2]); return n2; } - initializeOps(t2) { - const e2 = t2.getNodes(); + initializeOps(t3) { + const e2 = t3.getNodes(); this._ops = new Array(e2.length); for (let n2 = 0; n2 < e2.length; n2++) - this._ops[n2] = this.sessionHandler.resolve(e2[n2], this._model.opsets, t2); + this._ops[n2] = this.sessionHandler.resolve(e2[n2], this._model.opsets, t3); } }; - }, 9162: function(t, e, n) { + }, 9162: function(t2, e, n) { "use strict"; - var r = this && this.__importDefault || function(t2) { - return t2 && t2.__esModule ? t2 : { default: t2 }; + var r = this && this.__importDefault || function(t3) { + return t3 && t3.__esModule ? t3 : { default: t3 }; }; Object.defineProperty(e, "__esModule", { value: true }), e.Tensor = void 0; const i2 = n(3442), o = r(n(3720)), a = n(1446), s = n(9395), u = n(2517); @@ -13695,10 +14380,10 @@ ${t2}`); class l { get data() { if (void 0 === this.cache) { - const t2 = this.dataProvider(this.dataId); - if (t2.length !== this.size) + const t3 = this.dataProvider(this.dataId); + if (t3.length !== this.size) throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor."); - this.cache = t2; + this.cache = t3; } return this.cache; } @@ -13735,11 +14420,11 @@ ${t2}`); return this.data; throw new TypeError("type cannot be non-number (string)"); } - get(t2) { - return this.data[u.ShapeUtil.indicesToOffset(t2, this.strides)]; + get(t3) { + return this.data[u.ShapeUtil.indicesToOffset(t3, this.strides)]; } - set(t2, e2) { - this.data[u.ShapeUtil.indicesToOffset(t2, this.strides)] = e2; + set(t3, e2) { + this.data[u.ShapeUtil.indicesToOffset(t3, this.strides)] = e2; } async getData() { return void 0 === this.cache && (this.cache = await this.asyncDataProvider(this.dataId)), this.cache; @@ -13747,24 +14432,24 @@ ${t2}`); get strides() { return this._strides || (this._strides = u.ShapeUtil.computeStrides(this.dims)), this._strides; } - constructor(t2, e2, n2, r2, o2, a2 = i2.Guid.create()) { - this.dims = t2, this.type = e2, this.dataProvider = n2, this.asyncDataProvider = r2, this.cache = o2, this.dataId = a2, this.size = u.ShapeUtil.validateDimsAndCalcSize(t2); + constructor(t3, e2, n2, r2, o2, a2 = i2.Guid.create()) { + this.dims = t3, this.type = e2, this.dataProvider = n2, this.asyncDataProvider = r2, this.cache = o2, this.dataId = a2, this.size = u.ShapeUtil.validateDimsAndCalcSize(t3); const s2 = this.size, c2 = void 0 === n2 && void 0 === r2 && void 0 === o2; if (void 0 !== o2 && o2.length !== s2) throw new RangeError("Input dims doesn't match data length."); if ("string" === e2) { - if (!(void 0 === o2 || Array.isArray(o2) && o2.every((t3) => "string" == typeof t3))) + if (!(void 0 === o2 || Array.isArray(o2) && o2.every((t4) => "string" == typeof t4))) throw new TypeError("cache should be a string array"); c2 && (this.cache = new Array(s2)); } else { if (void 0 !== o2) { - const t3 = f(e2); - if (!(o2 instanceof t3)) - throw new TypeError(`cache should be type ${t3.name}`); + const t4 = f(e2); + if (!(o2 instanceof t4)) + throw new TypeError(`cache should be type ${t4.name}`); } if (c2) { - const t3 = new ArrayBuffer(s2 * function(t4) { - switch (t4) { + const t4 = new ArrayBuffer(s2 * function(t5) { + switch (t5) { case "bool": case "int8": case "uint8": @@ -13779,38 +14464,38 @@ ${t2}`); case "float64": return 8; default: - throw new Error(`cannot calculate sizeof() on type ${t4}`); + throw new Error(`cannot calculate sizeof() on type ${t5}`); } }(e2)); - this.cache = function(t4, e3) { - return new (f(e3))(t4); - }(t3, e2); + this.cache = function(t5, e3) { + return new (f(e3))(t5); + }(t4, e2); } } } - static fromProto(t2) { - if (!t2) + static fromProto(t3) { + if (!t3) throw new Error("cannot construct Value from an empty tensor"); - const e2 = u.ProtoUtil.tensorDataTypeFromProto(t2.dataType), n2 = u.ProtoUtil.tensorDimsFromProto(t2.dims), r2 = new l(n2, e2); + const e2 = u.ProtoUtil.tensorDataTypeFromProto(t3.dataType), n2 = u.ProtoUtil.tensorDimsFromProto(t3.dims), r2 = new l(n2, e2); if ("string" === e2) - t2.stringData.forEach((t3, e3) => { - r2.data[e3] = (0, u.decodeUtf8String)(t3); + t3.stringData.forEach((t4, e3) => { + r2.data[e3] = (0, u.decodeUtf8String)(t4); }); - else if (t2.rawData && "number" == typeof t2.rawData.byteLength && t2.rawData.byteLength > 0) { - const e3 = r2.data, n3 = new DataView(t2.rawData.buffer, t2.rawData.byteOffset, t2.rawData.byteLength), i3 = p(t2.dataType), o2 = t2.rawData.byteLength / i3; - if (t2.rawData.byteLength % i3 != 0) + else if (t3.rawData && "number" == typeof t3.rawData.byteLength && t3.rawData.byteLength > 0) { + const e3 = r2.data, n3 = new DataView(t3.rawData.buffer, t3.rawData.byteOffset, t3.rawData.byteLength), i3 = p(t3.dataType), o2 = t3.rawData.byteLength / i3; + if (t3.rawData.byteLength % i3 != 0) throw new Error("invalid buffer length"); if (e3.length !== o2) throw new Error("buffer length mismatch"); for (let r3 = 0; r3 < o2; r3++) { - const o3 = h(n3, t2.dataType, r3 * i3); + const o3 = h(n3, t3.dataType, r3 * i3); e3[r3] = o3; } } else { let e3; - switch (t2.dataType) { + switch (t3.dataType) { case a.onnx.TensorProto.DataType.FLOAT: - e3 = t2.floatData; + e3 = t3.floatData; break; case a.onnx.TensorProto.DataType.INT32: case a.onnx.TensorProto.DataType.INT16: @@ -13818,17 +14503,17 @@ ${t2}`); case a.onnx.TensorProto.DataType.INT8: case a.onnx.TensorProto.DataType.UINT8: case a.onnx.TensorProto.DataType.BOOL: - e3 = t2.int32Data; + e3 = t3.int32Data; break; case a.onnx.TensorProto.DataType.INT64: - e3 = t2.int64Data; + e3 = t3.int64Data; break; case a.onnx.TensorProto.DataType.DOUBLE: - e3 = t2.doubleData; + e3 = t3.doubleData; break; case a.onnx.TensorProto.DataType.UINT32: case a.onnx.TensorProto.DataType.UINT64: - e3 = t2.uint64Data; + e3 = t3.uint64Data; break; default: throw new Error("unspecific error"); @@ -13840,37 +14525,37 @@ ${t2}`); throw new Error("array length mismatch"); for (let r3 = 0; r3 < e3.length; r3++) { const i3 = e3[r3]; - o.default.isLong(i3) ? n3[r3] = d(i3, t2.dataType) : n3[r3] = i3; + o.default.isLong(i3) ? n3[r3] = d(i3, t3.dataType) : n3[r3] = i3; } } return r2; } - static fromData(t2, e2, n2) { - return new l(e2, n2, void 0, void 0, t2); + static fromData(t3, e2, n2) { + return new l(e2, n2, void 0, void 0, t3); } - static fromOrtTensor(t2) { - if (!t2) + static fromOrtTensor(t3) { + if (!t3) throw new Error("cannot construct Value from an empty tensor"); - const e2 = u.ProtoUtil.tensorDimsFromORTFormat(t2), n2 = u.ProtoUtil.tensorDataTypeFromProto(t2.dataType()), r2 = new l(e2, n2); + const e2 = u.ProtoUtil.tensorDimsFromORTFormat(t3), n2 = u.ProtoUtil.tensorDataTypeFromProto(t3.dataType()), r2 = new l(e2, n2); if ("string" === n2) - for (let e3 = 0; e3 < t2.stringDataLength(); e3++) - r2.data[e3] = t2.stringData(e3); - else if (t2.rawDataArray() && "number" == typeof t2.rawDataLength() && t2.rawDataLength() > 0) { - const e3 = r2.data, n3 = new DataView(t2.rawDataArray().buffer, t2.rawDataArray().byteOffset, t2.rawDataLength()), i3 = p(t2.dataType()), o2 = t2.rawDataLength() / i3; - if (t2.rawDataLength() % i3 != 0) + for (let e3 = 0; e3 < t3.stringDataLength(); e3++) + r2.data[e3] = t3.stringData(e3); + else if (t3.rawDataArray() && "number" == typeof t3.rawDataLength() && t3.rawDataLength() > 0) { + const e3 = r2.data, n3 = new DataView(t3.rawDataArray().buffer, t3.rawDataArray().byteOffset, t3.rawDataLength()), i3 = p(t3.dataType()), o2 = t3.rawDataLength() / i3; + if (t3.rawDataLength() % i3 != 0) throw new Error("invalid buffer length"); if (e3.length !== o2) throw new Error("buffer length mismatch"); for (let r3 = 0; r3 < o2; r3++) { - const o3 = h(n3, t2.dataType(), r3 * i3); + const o3 = h(n3, t3.dataType(), r3 * i3); e3[r3] = o3; } } return r2; } } - function p(t2) { - switch (t2) { + function p(t3) { + switch (t3) { case a.onnx.TensorProto.DataType.UINT8: case a.onnx.TensorProto.DataType.INT8: case a.onnx.TensorProto.DataType.BOOL: @@ -13887,11 +14572,11 @@ ${t2}`); case a.onnx.TensorProto.DataType.UINT64: return 8; default: - throw new Error(`cannot calculate sizeof() on type ${a.onnx.TensorProto.DataType[t2]}`); + throw new Error(`cannot calculate sizeof() on type ${a.onnx.TensorProto.DataType[t3]}`); } } - function f(t2) { - switch (t2) { + function f(t3) { + switch (t3) { case "bool": case "uint8": return Uint8Array; @@ -13913,175 +14598,175 @@ ${t2}`); throw new Error("unspecified error"); } } - function d(t2, e2) { + function d(t3, e2) { if (e2 === a.onnx.TensorProto.DataType.INT64 || e2 === c.TensorDataType.INT64) { - if (t2.greaterThanOrEqual(2147483648) || t2.lessThan(-2147483648)) + if (t3.greaterThanOrEqual(2147483648) || t3.lessThan(-2147483648)) throw new TypeError("int64 is not supported"); } else { if (e2 !== a.onnx.TensorProto.DataType.UINT32 && e2 !== c.TensorDataType.UINT32 && e2 !== a.onnx.TensorProto.DataType.UINT64 && e2 !== c.TensorDataType.UINT64) throw new TypeError(`not a LONG type: ${a.onnx.TensorProto.DataType[e2]}`); - if (t2.greaterThanOrEqual(4294967296) || t2.lessThan(0)) + if (t3.greaterThanOrEqual(4294967296) || t3.lessThan(0)) throw new TypeError("uint64 is not supported"); } - return t2.toNumber(); + return t3.toNumber(); } - function h(t2, e2, n2) { + function h(t3, e2, n2) { switch (e2) { case a.onnx.TensorProto.DataType.BOOL: case a.onnx.TensorProto.DataType.UINT8: - return t2.getUint8(n2); + return t3.getUint8(n2); case a.onnx.TensorProto.DataType.INT8: - return t2.getInt8(n2); + return t3.getInt8(n2); case a.onnx.TensorProto.DataType.UINT16: - return t2.getUint16(n2, true); + return t3.getUint16(n2, true); case a.onnx.TensorProto.DataType.INT16: - return t2.getInt16(n2, true); + return t3.getInt16(n2, true); case a.onnx.TensorProto.DataType.FLOAT: - return t2.getFloat32(n2, true); + return t3.getFloat32(n2, true); case a.onnx.TensorProto.DataType.INT32: - return t2.getInt32(n2, true); + return t3.getInt32(n2, true); case a.onnx.TensorProto.DataType.UINT32: - return t2.getUint32(n2, true); + return t3.getUint32(n2, true); case a.onnx.TensorProto.DataType.INT64: - return d(o.default.fromBits(t2.getUint32(n2, true), t2.getUint32(n2 + 4, true), false), e2); + return d(o.default.fromBits(t3.getUint32(n2, true), t3.getUint32(n2 + 4, true), false), e2); case a.onnx.TensorProto.DataType.DOUBLE: - return t2.getFloat64(n2, true); + return t3.getFloat64(n2, true); case a.onnx.TensorProto.DataType.UINT64: - return d(o.default.fromBits(t2.getUint32(n2, true), t2.getUint32(n2 + 4, true), true), e2); + return d(o.default.fromBits(t3.getUint32(n2, true), t3.getUint32(n2 + 4, true), true), e2); default: throw new Error(`cannot read from DataView for type ${a.onnx.TensorProto.DataType[e2]}`); } } e.Tensor = l; - }, 2517: function(t, e, n) { + }, 2517: function(t2, e, n) { "use strict"; - var r = this && this.__importDefault || function(t2) { - return t2 && t2.__esModule ? t2 : { default: t2 }; + var r = this && this.__importDefault || function(t3) { + return t3 && t3.__esModule ? t3 : { default: t3 }; }; Object.defineProperty(e, "__esModule", { value: true }), e.decodeUtf8String = e.MAX_CLIP = e.MIN_CLIP = e.PoolConvUtil = e.ReduceUtil = e.SplitUtil = e.MathUtil = e.ShapeUtil = e.LongUtil = e.ProtoUtil = e.GemmUtil = e.arrayCopyHelper = e.BroadcastUtil = e.MatMulUtil = e.ArrayUtil = e.assert = e.checkInputsShape = void 0; const i2 = n(5686), o = r(n(3720)), a = n(1446), s = n(9162); - e.checkInputsShape = function(t2, ...e2) { - if (!t2 || t2.length !== e2.length) + e.checkInputsShape = function(t3, ...e2) { + if (!t3 || t3.length !== e2.length) return false; - for (let n2 = 0; n2 < t2.length; n2++) - if (!t2[n2].dims || t2[n2].dims.length !== e2[n2]) + for (let n2 = 0; n2 < t3.length; n2++) + if (!t3[n2].dims || t3[n2].dims.length !== e2[n2]) return false; return true; - }, e.assert = function(t2, e2) { - if (!t2) + }, e.assert = function(t3, e2) { + if (!t3) throw new Error("string" == typeof e2 ? e2 : e2()); }, e.ArrayUtil = class { - static arraysEqual(t2, e2) { - if (t2.length !== e2.length) + static arraysEqual(t3, e2) { + if (t3.length !== e2.length) return false; - for (let n2 = 0; n2 < t2.length; n2++) - if (t2[n2] !== e2[n2]) + for (let n2 = 0; n2 < t3.length; n2++) + if (t3[n2] !== e2[n2]) return false; return true; } }; class u { - static preprocessInputShapes(t2, e2) { - return [1 === t2.length ? [1, t2[0]] : t2, 1 === e2.length ? [e2[0], 1] : e2]; + static preprocessInputShapes(t3, e2) { + return [1 === t3.length ? [1, t3[0]] : t3, 1 === e2.length ? [e2[0], 1] : e2]; } - static postprocessOutputShape(t2, e2, n2) { - 1 === e2 && t2.splice(t2.length - 2, 1), 1 === n2 && t2.pop(); + static postprocessOutputShape(t3, e2, n2) { + 1 === e2 && t3.splice(t3.length - 2, 1), 1 === n2 && t3.pop(); } - static calcMatMulShape(t2, e2) { - return t2[1] !== e2[0] ? void 0 : [t2[0], e2[1]]; + static calcMatMulShape(t3, e2) { + return t3[1] !== e2[0] ? void 0 : [t3[0], e2[1]]; } } e.MatMulUtil = u; class c { - static calcShape(t2, e2, n2 = false) { - const r2 = t2.length, i3 = e2.length; + static calcShape(t3, e2, n2 = false) { + const r2 = t3.length, i3 = e2.length; if (0 === r2) return e2; if (0 === i3) - return t2; - const o2 = Math.max(t2.length, e2.length), a2 = new Array(o2); + return t3; + const o2 = Math.max(t3.length, e2.length), a2 = new Array(o2); if (n2) { if (r2 < 2 || i3 < 2) return; - const n3 = u.calcMatMulShape([t2[r2 - 2], t2[r2 - 1]], [e2[i3 - 2], e2[i3 - 1]]); + const n3 = u.calcMatMulShape([t3[r2 - 2], t3[r2 - 1]], [e2[i3 - 2], e2[i3 - 1]]); if (void 0 === n3) return; [a2[o2 - 2], a2[o2 - 1]] = n3; } for (let s2 = n2 ? 3 : 1; s2 <= o2; s2++) { - const n3 = r2 - s2 < 0 ? 1 : t2[r2 - s2], u2 = i3 - s2 < 0 ? 1 : e2[i3 - s2]; + const n3 = r2 - s2 < 0 ? 1 : t3[r2 - s2], u2 = i3 - s2 < 0 ? 1 : e2[i3 - s2]; if (n3 !== u2 && n3 > 1 && u2 > 1) return; a2[o2 - s2] = Math.max(n3, u2); } return a2; } - static index(t2, e2) { + static index(t3, e2) { const n2 = new Array(e2.length); - return c.fillIndex(t2, e2, n2), n2; + return c.fillIndex(t3, e2, n2), n2; } - static fillIndex(t2, e2, n2) { - const r2 = t2.length - e2.length; + static fillIndex(t3, e2, n2) { + const r2 = t3.length - e2.length; for (let i3 = 0; i3 < e2.length; i3++) - n2[i3] = t2[r2 + i3] % e2[i3]; + n2[i3] = t3[r2 + i3] % e2[i3]; } - static calc(t2, e2, n2, r2, i3) { - const o2 = c.calcShape(t2.dims, e2.dims); + static calc(t3, e2, n2, r2, i3) { + const o2 = c.calcShape(t3.dims, e2.dims); if (o2) { - if (r2 && !f.areEqual(o2, t2.dims)) + if (r2 && !f.areEqual(o2, t3.dims)) return; - const a2 = f.size(o2), u2 = r2 ? t2 : new s.Tensor(o2, i3 || t2.type); + const a2 = f.size(o2), u2 = r2 ? t3 : new s.Tensor(o2, i3 || t3.type); if (0 === o2.length) - u2.set([], n2(t2.get([]), e2.get([]))); + u2.set([], n2(t3.get([]), e2.get([]))); else { - const r3 = new Array(o2.length), i4 = new Array(t2.dims.length), s2 = new Array(e2.dims.length); + const r3 = new Array(o2.length), i4 = new Array(t3.dims.length), s2 = new Array(e2.dims.length); let l2, p2 = 0, f2 = 0, d2 = false, h2 = false; - 0 === t2.dims.length && (p2 = t2.get([]), d2 = true), 0 === e2.dims.length && (f2 = e2.get([]), h2 = true); + 0 === t3.dims.length && (p2 = t3.get([]), d2 = true), 0 === e2.dims.length && (f2 = e2.get([]), h2 = true); for (let g2 = 0; g2 < a2; g2++) { l2 = g2; - for (let t3 = o2.length - 1; t3 >= 0; t3--) - r3[t3] = l2 % o2[t3], l2 = Math.floor(l2 / o2[t3]); - d2 || (c.fillIndex(r3, t2.dims, i4), p2 = t2.get(i4)), h2 || (c.fillIndex(r3, e2.dims, s2), f2 = e2.get(s2)), u2.set(r3, n2(p2, f2)); + for (let t4 = o2.length - 1; t4 >= 0; t4--) + r3[t4] = l2 % o2[t4], l2 = Math.floor(l2 / o2[t4]); + d2 || (c.fillIndex(r3, t3.dims, i4), p2 = t3.get(i4)), h2 || (c.fillIndex(r3, e2.dims, s2), f2 = e2.get(s2)), u2.set(r3, n2(p2, f2)); } } return u2; } } - static isValidBroadcast(t2, e2) { - const n2 = t2.length, r2 = e2.length; + static isValidBroadcast(t3, e2) { + const n2 = t3.length, r2 = e2.length; if (n2 > r2) return false; for (let i3 = 1; i3 <= n2; i3++) - if (1 !== t2[n2 - i3] && t2[n2 - i3] !== e2[r2 - i3]) + if (1 !== t3[n2 - i3] && t3[n2 - i3] !== e2[r2 - i3]) return false; return true; } - static getBroadcastDims(t2, e2) { - const n2 = t2.length, r2 = []; + static getBroadcastDims(t3, e2) { + const n2 = t3.length, r2 = []; for (let i3 = 0; i3 < n2; i3++) { - const o2 = n2 - 1 - i3, a2 = t2[o2] || 1; + const o2 = n2 - 1 - i3, a2 = t3[o2] || 1; (e2[e2.length - 1 - i3] || 1) > 1 && 1 === a2 && r2.unshift(o2); } return r2; } } - e.BroadcastUtil = c, e.arrayCopyHelper = function(t2, e2, n2, r2, i3) { + e.BroadcastUtil = c, e.arrayCopyHelper = function(t3, e2, n2, r2, i3) { if (r2 < 0 || r2 >= e2.length) throw new Error("sourceIndex out of bounds"); - if (n2 < 0 || n2 >= t2.length) + if (n2 < 0 || n2 >= t3.length) throw new Error("targetIndex out of bounds"); if (r2 + i3 > e2.length) throw new Error("source indices to be copied are outside bounds"); - if (n2 + i3 > t2.length) + if (n2 + i3 > t3.length) throw new Error("target array is too small to hold result"); for (let o2 = 0; o2 < i3; o2++) - t2[n2 + o2] = e2[r2 + o2]; + t3[n2 + o2] = e2[r2 + o2]; }, e.GemmUtil = class { - static getShapeOfGemmResult(t2, e2, n2, r2, i3) { - if (2 !== t2.length || 2 !== n2.length) + static getShapeOfGemmResult(t3, e2, n2, r2, i3) { + if (2 !== t3.length || 2 !== n2.length) throw new Error("shape need to be of size 2"); let o2, a2, s2; - e2 ? (o2 = t2[1], a2 = t2[0]) : (o2 = t2[0], a2 = t2[1]); + e2 ? (o2 = t3[1], a2 = t3[0]) : (o2 = t3[0], a2 = t3[1]); let u2 = -1; if (r2 ? (s2 = n2[0], u2 = 1) : (s2 = n2[1], u2 = 0), n2[u2] !== a2) throw new Error("dimension mismatch"); @@ -14093,8 +14778,8 @@ ${t2}`); } }; class l { - static tensorDataTypeFromProto(t2) { - switch (t2) { + static tensorDataTypeFromProto(t3) { + switch (t3) { case a.onnx.TensorProto.DataType.INT8: return "int8"; case a.onnx.TensorProto.DataType.UINT8: @@ -14120,11 +14805,11 @@ ${t2}`); case a.onnx.TensorProto.DataType.UINT64: return "uint32"; default: - throw new Error(`unsupported data type: ${a.onnx.TensorProto.DataType[t2]}`); + throw new Error(`unsupported data type: ${a.onnx.TensorProto.DataType[t3]}`); } } - static tensorDataTypeStringToEnum(t2) { - switch (t2) { + static tensorDataTypeStringToEnum(t3) { + switch (t3) { case "int8": return a.onnx.TensorProto.DataType.INT8; case "uint8": @@ -14150,115 +14835,115 @@ ${t2}`); case "uint64": return a.onnx.TensorProto.DataType.UINT64; default: - throw new Error(`unsupported data type: ${t2}`); + throw new Error(`unsupported data type: ${t3}`); } } - static tensorDimsFromProto(t2) { - return t2.map((t3) => o.default.isLong(t3) ? t3.toNumber() : t3); + static tensorDimsFromProto(t3) { + return t3.map((t4) => o.default.isLong(t4) ? t4.toNumber() : t4); } - static tensorValueTypeFromProto(t2) { - return { tensorType: l.tensorDataTypeFromProto(t2.elemType), shape: { dims: l.tensorDimsFromProto(t2.shape.dim.map((t3) => t3.dimValue)) } }; + static tensorValueTypeFromProto(t3) { + return { tensorType: l.tensorDataTypeFromProto(t3.elemType), shape: { dims: l.tensorDimsFromProto(t3.shape.dim.map((t4) => t4.dimValue)) } }; } - static tensorDimsFromORTFormat(t2) { + static tensorDimsFromORTFormat(t3) { const e2 = []; - for (let n2 = 0; n2 < t2.dimsLength(); n2++) - e2.push(p.longToNumber(t2.dims(n2))); + for (let n2 = 0; n2 < t3.dimsLength(); n2++) + e2.push(p.longToNumber(t3.dims(n2))); return e2; } - static tensorAttributesFromORTFormat(t2) { + static tensorAttributesFromORTFormat(t3) { const e2 = []; - for (let n2 = 0; n2 < t2.attributesLength(); n2++) - e2.push(t2.attributes(n2)); + for (let n2 = 0; n2 < t3.attributesLength(); n2++) + e2.push(t3.attributes(n2)); return e2; } } e.ProtoUtil = l; class p { - static longToNumber(t2, e2) { - return o.default.isLong(t2) ? t2.toNumber() : t2 instanceof i2.flatbuffers.Long ? o.default.fromValue({ low: t2.low, high: t2.high, unsigned: null != e2 && e2 }).toNumber() : t2; + static longToNumber(t3, e2) { + return o.default.isLong(t3) ? t3.toNumber() : t3 instanceof i2.flatbuffers.Long ? o.default.fromValue({ low: t3.low, high: t3.high, unsigned: null != e2 && e2 }).toNumber() : t3; } - static isLong(t2) { - return o.default.isLong(t2) || t2 instanceof i2.flatbuffers.Long; + static isLong(t3) { + return o.default.isLong(t3) || t3 instanceof i2.flatbuffers.Long; } } e.LongUtil = p; class f { - static size(t2) { - return f.getSizeFromDimensionRange(t2, 0, t2.length); + static size(t3) { + return f.getSizeFromDimensionRange(t3, 0, t3.length); } - static sizeFromDimension(t2, e2) { - if (e2 < 0 || e2 > t2.length) - throw new Error(`invalid dimension of ${e2} for sizeFromDimension as Tensor has ${t2.length} dimensions.`); - return f.getSizeFromDimensionRange(t2, e2, t2.length); + static sizeFromDimension(t3, e2) { + if (e2 < 0 || e2 > t3.length) + throw new Error(`invalid dimension of ${e2} for sizeFromDimension as Tensor has ${t3.length} dimensions.`); + return f.getSizeFromDimensionRange(t3, e2, t3.length); } - static sizeToDimension(t2, e2) { - if (e2 < 0 || e2 > t2.length) - throw new Error(`invalid dimension of ${e2} for sizeToDimension as Tensor has ${t2.length} dimensions.`); - return f.getSizeFromDimensionRange(t2, 0, e2); + static sizeToDimension(t3, e2) { + if (e2 < 0 || e2 > t3.length) + throw new Error(`invalid dimension of ${e2} for sizeToDimension as Tensor has ${t3.length} dimensions.`); + return f.getSizeFromDimensionRange(t3, 0, e2); } - static getSizeFromDimensionRange(t2, e2, n2) { + static getSizeFromDimensionRange(t3, e2, n2) { let r2 = 1; for (let i3 = e2; i3 < n2; i3++) { - if (t2[i3] <= 0) + if (t3[i3] <= 0) throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them."); - r2 *= t2[i3]; + r2 *= t3[i3]; } return r2; } - static computeStrides(t2) { - const e2 = t2.length; + static computeStrides(t3) { + const e2 = t3.length; if (0 === e2) return []; if (1 === e2) return [1]; const n2 = new Array(e2); - n2[e2 - 1] = 1, n2[e2 - 2] = t2[e2 - 1]; + n2[e2 - 1] = 1, n2[e2 - 2] = t3[e2 - 1]; for (let r2 = e2 - 3; r2 >= 0; --r2) - n2[r2] = n2[r2 + 1] * t2[r2 + 1]; + n2[r2] = n2[r2 + 1] * t3[r2 + 1]; return n2; } - static transpose(t2) { - return t2.slice().reverse(); + static transpose(t3) { + return t3.slice().reverse(); } - static indicesToOffset(t2, e2, n2) { - void 0 === n2 && (n2 = t2.length); + static indicesToOffset(t3, e2, n2) { + void 0 === n2 && (n2 = t3.length); let r2 = 0; for (let i3 = 0; i3 < n2; ++i3) - r2 += e2[i3] * t2[i3]; + r2 += e2[i3] * t3[i3]; return r2; } - static offsetToIndices(t2, e2) { + static offsetToIndices(t3, e2) { const n2 = e2.length; if (0 === n2) return []; if (1 === n2) - return [t2 * e2[0]]; + return [t3 * e2[0]]; const r2 = new Array(e2.length); for (let n3 = 0; n3 < r2.length - 1; ++n3) - r2[n3] = Math.floor(t2 / e2[n3]), t2 -= r2[n3] * e2[n3]; - return r2[r2.length - 1] = t2, r2; + r2[n3] = Math.floor(t3 / e2[n3]), t3 -= r2[n3] * e2[n3]; + return r2[r2.length - 1] = t3, r2; } - static normalizeAxis(t2, e2) { - if (t2 < -e2 && t2 >= e2) + static normalizeAxis(t3, e2) { + if (t3 < -e2 && t3 >= e2) throw new Error("unsupported axis for this operation."); - return t2 < 0 ? t2 + e2 : t2; + return t3 < 0 ? t3 + e2 : t3; } - static normalizeAxes(t2, e2) { - return t2.map((t3) => this.normalizeAxis(t3, e2)); + static normalizeAxes(t3, e2) { + return t3.map((t4) => this.normalizeAxis(t4, e2)); } - static incrementIndex(t2, e2, n2) { - if (0 === e2.length || 0 === t2.length) + static incrementIndex(t3, e2, n2) { + if (0 === e2.length || 0 === t3.length) throw new Error("Index incrementing unsupported for scalar Tensor"); if (void 0 === n2) n2 = e2.length; else if (n2 <= 0 || n2 > e2.length) throw new Error("Incorrect axis to increment on"); - for (let r2 = n2 - 1; r2 >= 0 && (t2[r2]++, !(t2[r2] < e2[r2])); --r2) - t2[r2] = 0; + for (let r2 = n2 - 1; r2 >= 0 && (t3[r2]++, !(t3[r2] < e2[r2])); --r2) + t3[r2] = 0; } - static calculateReshapedDims(t2, e2) { + static calculateReshapedDims(t3, e2) { if (0 === e2.length) { - if (0 === t2.length || 1 === f.size(t2)) + if (0 === t3.length || 1 === f.size(t3)) return []; throw new Error("cannot reshape to a scalar Tensor"); } @@ -14273,38 +14958,38 @@ ${t2}`); i3 = a3; } else { if (0 === e2[a3]) { - if (a3 >= t2.length) + if (a3 >= t3.length) throw new Error("the dimension with value zero exceeds the dimension size of the input tensor"); - r2[a3] = t2[a3]; + r2[a3] = t3[a3]; } else r2[a3] = e2[a3]; o2 *= r2[a3]; } } - const a2 = f.size(t2); + const a2 = f.size(t3); if (-1 !== i3) { if (a2 % o2 != 0) - throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t2}] Output shape: [${e2}]`); + throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${t3}] Output shape: [${e2}]`); r2[i3] = a2 / o2; } else if (o2 !== a2) throw new Error("reshapedDims and originalDims don't have matching sizes"); return r2; } - static sortBasedOnPerm(t2, e2) { - return e2 ? e2.map((e3) => t2[e3]) : t2.slice().reverse(); + static sortBasedOnPerm(t3, e2) { + return e2 ? e2.map((e3) => t3[e3]) : t3.slice().reverse(); } - static padShape(t2, e2) { - const n2 = t2.length; - return t2.map((t3, r2) => t3 + e2[r2] + e2[r2 + n2]); + static padShape(t3, e2) { + const n2 = t3.length; + return t3.map((t4, r2) => t4 + e2[r2] + e2[r2 + n2]); } - static areEqual(t2, e2) { - return t2.length === e2.length && t2.every((t3, n2) => t3 === e2[n2]); + static areEqual(t3, e2) { + return t3.length === e2.length && t3.every((t4, n2) => t4 === e2[n2]); } - static validateDimsAndCalcSize(t2) { - if (t2.length > 6) + static validateDimsAndCalcSize(t3) { + if (t3.length > 6) throw new TypeError("Only rank 0 to 6 is supported for tensor shape."); let e2 = 1; - for (const n2 of t2) { + for (const n2 of t3) { if (!Number.isInteger(n2)) throw new TypeError(`Invalid shape: ${n2} is not an integer`); if (n2 < 0 || n2 > 2147483647) @@ -14313,27 +14998,27 @@ ${t2}`); } return e2; } - static flattenShape(t2, e2) { - e2 < 0 && (e2 += t2.length); - const n2 = t2.reduce((t3, e3) => t3 * e3, 1), r2 = t2.slice(e2).reduce((t3, e3) => t3 * e3, 1); + static flattenShape(t3, e2) { + e2 < 0 && (e2 += t3.length); + const n2 = t3.reduce((t4, e3) => t4 * e3, 1), r2 = t3.slice(e2).reduce((t4, e3) => t4 * e3, 1); return [n2 / r2, r2]; } - static squeezeShape(t2, e2) { + static squeezeShape(t3, e2) { const n2 = new Array(); - e2 = f.normalizeAxes(e2, t2.length); - for (let r2 = 0; r2 < t2.length; r2++) { + e2 = f.normalizeAxes(e2, t3.length); + for (let r2 = 0; r2 < t3.length; r2++) { const i3 = e2.indexOf(r2) >= 0; - if (i3 && 1 !== t2[r2]) + if (i3 && 1 !== t3[r2]) throw new Error("squeeze an axis of size different than 1"); - (0 === e2.length && t2[r2] > 1 || e2.length > 0 && !i3) && n2.push(t2[r2]); + (0 === e2.length && t3[r2] > 1 || e2.length > 0 && !i3) && n2.push(t3[r2]); } return n2; } - static unsqueezeShape(t2, e2) { - const n2 = new Array(t2.length + e2.length); + static unsqueezeShape(t3, e2) { + const n2 = new Array(t3.length + e2.length); n2.fill(0); - for (let t3 = 0; t3 < e2.length; t3++) { - const r3 = f.normalizeAxis(e2[t3], n2.length); + for (let t4 = 0; t4 < e2.length; t4++) { + const r3 = f.normalizeAxis(e2[t4], n2.length); if (r3 >= n2.length) throw new Error("'axes' has an out of range axis"); if (0 !== n2[r3]) @@ -14342,210 +15027,210 @@ ${t2}`); } let r2 = 0; for (let e3 = 0; e3 < n2.length; e3++) - 0 === n2[e3] && (n2[e3] = t2[r2++]); - if (r2 !== t2.length) + 0 === n2[e3] && (n2[e3] = t3[r2++]); + if (r2 !== t3.length) throw new Error("the unsqueezed dimension could not be established"); return n2; } } e.ShapeUtil = f, e.MathUtil = class { - static sqr(t2, e2, n2, r2, i3) { + static sqr(t3, e2, n2, r2, i3) { if (r2 < 0 || r2 >= e2.length) throw new Error("sourceIndex out of bounds"); - if (n2 < 0 || n2 >= t2.length) + if (n2 < 0 || n2 >= t3.length) throw new Error("targetIndex out of bounds"); if (r2 + i3 > e2.length) throw new Error("source indices to be copied are outside bounds"); - if (n2 + i3 > t2.length) + if (n2 + i3 > t3.length) throw new Error("target array is too small to hold result"); for (let o2 = 0; o2 < i3; o2++) - t2[n2 + o2] += Math.pow(e2[r2 + o2], 2); + t3[n2 + o2] += Math.pow(e2[r2 + o2], 2); } - static axpy(t2, e2, n2, r2, i3, o2) { + static axpy(t3, e2, n2, r2, i3, o2) { if (r2 < 0 || r2 >= e2.length) throw new Error("sourceIndex out of bounds"); - if (n2 < 0 || n2 >= t2.length) + if (n2 < 0 || n2 >= t3.length) throw new Error("targetIndex out of bounds"); if (r2 + i3 > e2.length) throw new Error("source indices to be copied are outside bounds"); - if (n2 + i3 > t2.length) + if (n2 + i3 > t3.length) throw new Error("target array is too small to hold result"); for (let a2 = 0; a2 < i3; a2++) - t2[n2 + a2] += o2 * e2[r2 + a2]; + t3[n2 + a2] += o2 * e2[r2 + a2]; } - static powx(t2, e2, n2, r2, i3, o2) { + static powx(t3, e2, n2, r2, i3, o2) { if (r2 < 0 || r2 >= e2.length) throw new Error("sourceIndex out of bounds"); - if (n2 < 0 || n2 >= t2.length) + if (n2 < 0 || n2 >= t3.length) throw new Error("targetIndex out of bounds"); if (r2 + i3 > e2.length) throw new Error("source indices to be copied are outside bounds"); - if (n2 + i3 > t2.length) + if (n2 + i3 > t3.length) throw new Error("target array is too small to hold result"); for (let a2 = 0; a2 < i3; a2++) - t2[n2 + a2] = Math.pow(e2[r2 + a2], o2); + t3[n2 + a2] = Math.pow(e2[r2 + a2], o2); } - static mul(t2, e2, n2, r2, i3) { + static mul(t3, e2, n2, r2, i3) { if (r2 < 0 || r2 >= e2.length) throw new Error("sourceIndex out of bounds"); - if (n2 < 0 || n2 >= t2.length) + if (n2 < 0 || n2 >= t3.length) throw new Error("targetIndex out of bounds"); if (r2 + i3 > e2.length) throw new Error("source indices to be copied are outside bounds"); - if (n2 + i3 > t2.length) + if (n2 + i3 > t3.length) throw new Error("target array is too small to hold result"); for (let o2 = 0; o2 < i3; o2++) - t2[n2 + o2] = e2[r2 + o2] * t2[n2 + o2]; + t3[n2 + o2] = e2[r2 + o2] * t3[n2 + o2]; } }; class d { - static splitShape(t2, e2, n2, r2) { + static splitShape(t3, e2, n2, r2) { if (0 === n2.length) { if (!r2) throw new Error("need to know number of outputs when the 'split' attribute is not specified"); - d.determineSplit(t2[e2], r2, n2); + d.determineSplit(t3[e2], r2, n2); } const i3 = [], o2 = [0]; for (let r3 = 0; r3 < n2.length; ++r3) { 0 !== r3 && o2.push(o2[r3 - 1] + n2[r3 - 1]); - const a2 = t2.slice(); + const a2 = t3.slice(); a2[e2] = n2[r3], i3.push(a2); } return [i3, o2]; } - static determineSplit(t2, e2, n2) { - if (t2 % e2 != 0) + static determineSplit(t3, e2, n2) { + if (t3 % e2 != 0) throw new Error("cannot split tensor to equal sized parts"); for (let r2 = 0; r2 < e2; ++r2) - n2.push(t2 / e2); + n2.push(t3 / e2); } } e.SplitUtil = d; class h { - static calcReduce(t2, e2, n2, r2, i3) { - const o2 = t2.dims.slice(0); - 0 === e2.length && o2.forEach((t3, n3) => e2.push(n3)); - const a2 = h.calcReduceShape(o2, e2, true), u2 = f.size(a2), l2 = new s.Tensor(a2, t2.type), p2 = f.computeStrides(a2), d2 = f.computeStrides(o2), g2 = new Array(o2.length); + static calcReduce(t3, e2, n2, r2, i3) { + const o2 = t3.dims.slice(0); + 0 === e2.length && o2.forEach((t4, n3) => e2.push(n3)); + const a2 = h.calcReduceShape(o2, e2, true), u2 = f.size(a2), l2 = new s.Tensor(a2, t3.type), p2 = f.computeStrides(a2), d2 = f.computeStrides(o2), g2 = new Array(o2.length); for (let n3 = 0; n3 < u2; n3++) { const a3 = f.offsetToIndices(n3, p2); - c.fillIndex(a3, o2, g2), l2.set(a3, h.calcReduceByAxis(t2.numberData, e2, o2, 0, f.indicesToOffset(g2, d2), r2, i3)); + c.fillIndex(a3, o2, g2), l2.set(a3, h.calcReduceByAxis(t3.numberData, e2, o2, 0, f.indicesToOffset(g2, d2), r2, i3)); } return n2 ? l2 : new s.Tensor(h.calcReduceShape(o2, e2, n2), l2.type, void 0, void 0, l2.data, l2.dataId); } - static calcReduceByAxis(t2, e2, n2, r2, i3, o2, a2) { + static calcReduceByAxis(t3, e2, n2, r2, i3, o2, a2) { let s2 = 0; if (r2 >= e2.length) - return o2(t2[i3]); + return o2(t3[i3]); const u2 = e2[r2], c2 = u2 >= n2.length ? 1 : f.size(n2.slice(u2 + 1)); for (let l2 = 0; l2 < n2[u2]; l2++) - s2 = 0 === l2 ? h.calcReduceByAxis(t2, e2, n2, r2 + 1, i3, o2, a2) : a2(s2, h.calcReduceByAxis(t2, e2, n2, r2 + 1, i3, o2, a2)), i3 += c2; + s2 = 0 === l2 ? h.calcReduceByAxis(t3, e2, n2, r2 + 1, i3, o2, a2) : a2(s2, h.calcReduceByAxis(t3, e2, n2, r2 + 1, i3, o2, a2)), i3 += c2; return s2; } - static calcReduceShape(t2, e2, n2) { - const r2 = t2.slice(); - for (let t3 = 0; t3 < e2.length; t3++) - r2[e2[t3]] = n2 ? 1 : 0; - return r2.filter((t3) => 0 !== t3); + static calcReduceShape(t3, e2, n2) { + const r2 = t3.slice(); + for (let t4 = 0; t4 < e2.length; t4++) + r2[e2[t4]] = n2 ? 1 : 0; + return r2.filter((t4) => 0 !== t4); } } e.ReduceUtil = h; class g { - static adjustPoolAttributes(t2, e2, n2, r2, i3, o2) { - if (!t2 && n2.length !== e2.length - 2) + static adjustPoolAttributes(t3, e2, n2, r2, i3, o2) { + if (!t3 && n2.length !== e2.length - 2) throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions"); - if (t2) - for (let t3 = 0; t3 < e2.length - 2; t3++) - t3 >= n2.length ? n2.push(e2[t3 + 2]) : n2[t3] = e2[t3 + 2]; - for (let t3 = 0; t3 < n2.length; t3++) - if (t3 < r2.length) { - if (r2[t3] < 0) + if (t3) + for (let t4 = 0; t4 < e2.length - 2; t4++) + t4 >= n2.length ? n2.push(e2[t4 + 2]) : n2[t4] = e2[t4 + 2]; + for (let t4 = 0; t4 < n2.length; t4++) + if (t4 < r2.length) { + if (r2[t4] < 0) throw new Error("strides should be greater than or equal to 1"); } else r2.push(1); - for (let t3 = 0; t3 < n2.length; t3++) - if (t3 < i3.length) { - if (i3[t3] < 0) + for (let t4 = 0; t4 < n2.length; t4++) + if (t4 < i3.length) { + if (i3[t4] < 0) throw new Error("dilations should be greater than or equal to 1"); } else i3.push(1); - for (let t3 = 0; t3 < 2 * n2.length; t3++) - if (t3 < o2.length) { - if (o2[t3] < 0) + for (let t4 = 0; t4 < 2 * n2.length; t4++) + if (t4 < o2.length) { + if (o2[t4] < 0) throw new Error("pad should be greater than or equal to 1"); } else o2.push(0); - for (let t3 = 0; t3 < n2.length; t3++) { - if (n2[t3] <= 0) + for (let t4 = 0; t4 < n2.length; t4++) { + if (n2[t4] <= 0) throw new Error("kernel shapes need to be greater than 0"); - if (o2[t3] >= n2[t3] || o2[t3 + n2.length] >= n2[t3]) + if (o2[t4] >= n2[t4] || o2[t4 + n2.length] >= n2[t4]) throw new Error("pads should be smaller than kernel"); } } - static adjustPadsBasedOnAutoPad(t2, e2, n2, r2, i3, o2) { + static adjustPadsBasedOnAutoPad(t3, e2, n2, r2, i3, o2) { if (o2) { - if (i3.length !== 2 * (t2.length - 2)) + if (i3.length !== 2 * (t3.length - 2)) throw new Error("length of pads should be twice the length of data dimensions"); - if (e2.length !== t2.length - 2) + if (e2.length !== t3.length - 2) throw new Error("length of strides should be the length of data dimensions"); - if (r2.length !== t2.length - 2) + if (r2.length !== t3.length - 2) throw new Error("length of kernel shapes should be the length of data dimensions"); - for (let a2 = 0; a2 < t2.length - 2; a2++) - g.adjustPadAndReturnShape(t2[a2 + 2], e2[a2], n2[a2], r2[a2], i3, a2, a2 + t2.length - 2, o2); + for (let a2 = 0; a2 < t3.length - 2; a2++) + g.adjustPadAndReturnShape(t3[a2 + 2], e2[a2], n2[a2], r2[a2], i3, a2, a2 + t3.length - 2, o2); } } - static computePoolOutputShape(t2, e2, n2, r2, i3, o2, a2) { + static computePoolOutputShape(t3, e2, n2, r2, i3, o2, a2) { if (e2.length <= 0) throw new Error("input shape must be of size greater than 0"); const s2 = [e2[0], e2[1]]; - return g.computeShapeHelper(t2, e2, s2, n2, r2, i3, o2, a2), s2; + return g.computeShapeHelper(t3, e2, s2, n2, r2, i3, o2, a2), s2; } - static computeConvOutputShape(t2, e2, n2, r2, i3, o2, a2) { - if (t2.length <= 0 || e2.length <= 0) + static computeConvOutputShape(t3, e2, n2, r2, i3, o2, a2) { + if (t3.length <= 0 || e2.length <= 0) throw new Error("invalid input tensor dims or invalid filter tensor dims"); - const s2 = [t2[0], e2[0]]; - return g.computeShapeHelper(false, t2, s2, n2, r2, i3, o2, a2), s2; + const s2 = [t3[0], e2[0]]; + return g.computeShapeHelper(false, t3, s2, n2, r2, i3, o2, a2), s2; } - static computeShapeHelper(t2, e2, n2, r2, i3, o2, a2, s2) { - if (t2) - for (let t3 = 0; t3 < e2.length - 2; t3++) + static computeShapeHelper(t3, e2, n2, r2, i3, o2, a2, s2) { + if (t3) + for (let t4 = 0; t4 < e2.length - 2; t4++) n2.push(1); else - for (let t3 = 0; t3 < e2.length - 2; t3++) - n2.push(g.adjustPadAndReturnShape(e2[t3 + 2], r2[t3], i3[t3], o2[t3], a2, t3, t3 + e2.length - 2, s2)); + for (let t4 = 0; t4 < e2.length - 2; t4++) + n2.push(g.adjustPadAndReturnShape(e2[t4 + 2], r2[t4], i3[t4], o2[t4], a2, t4, t4 + e2.length - 2, s2)); } - static adjustPadAndReturnShape(t2, e2, n2, r2, i3, o2, a2, s2) { + static adjustPadAndReturnShape(t3, e2, n2, r2, i3, o2, a2, s2) { const u2 = n2 * (r2 - 1) + 1; if (!s2 || "NOTSET" === s2) - return Math.floor((t2 + i3[o2] + i3[a2] - u2) / e2 + 1); + return Math.floor((t3 + i3[o2] + i3[a2] - u2) / e2 + 1); switch (s2) { case "VALID": - return i3[o2] = 0, i3[a2] = 0, Math.floor((t2 - u2) / e2 + 1); + return i3[o2] = 0, i3[a2] = 0, Math.floor((t3 - u2) / e2 + 1); case "SAME_LOWER": case "SAME_UPPER": if (1 !== n2) throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER"); { - const n3 = ((t2 + e2 - 1) / e2 - 1) * e2 + r2 - t2; - return i3[o2] = "SAME_LOWER" === s2 ? Math.floor((n3 + 1) / 2) : Math.floor(n3 / 2), i3[a2] = n3 - i3[o2], Math.floor((t2 + n3 - r2) / e2 + 1); + const n3 = ((t3 + e2 - 1) / e2 - 1) * e2 + r2 - t3; + return i3[o2] = "SAME_LOWER" === s2 ? Math.floor((n3 + 1) / 2) : Math.floor(n3 / 2), i3[a2] = n3 - i3[o2], Math.floor((t3 + n3 - r2) / e2 + 1); } default: throw new Error("Unsupported AutoPad type"); } } } - e.PoolConvUtil = g, e.MIN_CLIP = -34028234663852886e22, e.MAX_CLIP = 34028234663852886e22, e.decodeUtf8String = function(t2) { - return new TextDecoder().decode(t2); + e.PoolConvUtil = g, e.MIN_CLIP = -34028234663852886e22, e.MAX_CLIP = 34028234663852886e22, e.decodeUtf8String = function(t3) { + return new TextDecoder().decode(t3); }; - }, 7967: (t, e) => { + }, 7967: (t2, e) => { "use strict"; - Object.defineProperty(e, "__esModule", { value: true }), e.iterateExtraOptions = void 0, e.iterateExtraOptions = (t2, n, r, i2) => { - if ("object" == typeof t2 && null !== t2) { - if (r.has(t2)) + Object.defineProperty(e, "__esModule", { value: true }), e.iterateExtraOptions = void 0, e.iterateExtraOptions = (t3, n, r, i2) => { + if ("object" == typeof t3 && null !== t3) { + if (r.has(t3)) throw new Error("Circular reference in options"); - r.add(t2); + r.add(t3); } - Object.entries(t2).forEach(([t3, o]) => { - const a = n ? n + t3 : t3; + Object.entries(t3).forEach(([t4, o]) => { + const a = n ? n + t4 : t4; if ("object" == typeof o) (0, e.iterateExtraOptions)(o, a + ".", r, i2); else if ("string" == typeof o || "number" == typeof o) @@ -14557,28 +15242,28 @@ ${t2}`); } }); }; - }, 2157: function(t, e, n) { + }, 2157: function(t2, e, n) { "use strict"; - var r, i2 = this && this.__createBinding || (Object.create ? function(t2, e2, n2, r2) { + var r, i2 = this && this.__createBinding || (Object.create ? function(t3, e2, n2, r2) { void 0 === r2 && (r2 = n2); var i3 = Object.getOwnPropertyDescriptor(e2, n2); i3 && !("get" in i3 ? !e2.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return e2[n2]; - } }), Object.defineProperty(t2, r2, i3); - } : function(t2, e2, n2, r2) { - void 0 === r2 && (r2 = n2), t2[r2] = e2[n2]; - }), o = this && this.__setModuleDefault || (Object.create ? function(t2, e2) { - Object.defineProperty(t2, "default", { enumerable: true, value: e2 }); - } : function(t2, e2) { - t2.default = e2; - }), a = this && this.__importStar || function(t2) { - if (t2 && t2.__esModule) - return t2; + } }), Object.defineProperty(t3, r2, i3); + } : function(t3, e2, n2, r2) { + void 0 === r2 && (r2 = n2), t3[r2] = e2[n2]; + }), o = this && this.__setModuleDefault || (Object.create ? function(t3, e2) { + Object.defineProperty(t3, "default", { enumerable: true, value: e2 }); + } : function(t3, e2) { + t3.default = e2; + }), a = this && this.__importStar || function(t3) { + if (t3 && t3.__esModule) + return t3; var e2 = {}; - if (null != t2) - for (var n2 in t2) - "default" !== n2 && Object.prototype.hasOwnProperty.call(t2, n2) && i2(e2, t2, n2); - return o(e2, t2), e2; + if (null != t3) + for (var n2 in t3) + "default" !== n2 && Object.prototype.hasOwnProperty.call(t3, n2) && i2(e2, t3, n2); + return o(e2, t3), e2; }; Object.defineProperty(e, "__esModule", { value: true }), e.endProfiling = e.run = e.releaseSession = e.createSession = e.createSessionFinalize = e.createSessionAllocate = e.initOrt = e.initWasm = void 0; const s = n(6207), u = a(n(349)), c = n(6361), l = () => !!s.env.wasm.proxy && "undefined" != typeof document; @@ -14586,31 +15271,31 @@ ${t2}`); const m = [], y = [], _ = [], v = [], w = [], x = [], T = () => { if (h || !g || b || !p) throw new Error("worker not ready"); - }, S = (t2) => { - switch (t2.data.type) { + }, S = (t3) => { + switch (t3.data.type) { case "init-wasm": - h = false, t2.data.err ? (b = true, f[1](t2.data.err)) : (g = true, f[0]()); + h = false, t3.data.err ? (b = true, f[1](t3.data.err)) : (g = true, f[0]()); break; case "init-ort": - t2.data.err ? d[1](t2.data.err) : d[0](); + t3.data.err ? d[1](t3.data.err) : d[0](); break; case "create_allocate": - t2.data.err ? m.shift()[1](t2.data.err) : m.shift()[0](t2.data.out); + t3.data.err ? m.shift()[1](t3.data.err) : m.shift()[0](t3.data.out); break; case "create_finalize": - t2.data.err ? y.shift()[1](t2.data.err) : y.shift()[0](t2.data.out); + t3.data.err ? y.shift()[1](t3.data.err) : y.shift()[0](t3.data.out); break; case "create": - t2.data.err ? _.shift()[1](t2.data.err) : _.shift()[0](t2.data.out); + t3.data.err ? _.shift()[1](t3.data.err) : _.shift()[0](t3.data.out); break; case "release": - t2.data.err ? v.shift()[1](t2.data.err) : v.shift()[0](); + t3.data.err ? v.shift()[1](t3.data.err) : v.shift()[0](); break; case "run": - t2.data.err ? w.shift()[1](t2.data.err) : w.shift()[0](t2.data.out); + t3.data.err ? w.shift()[1](t3.data.err) : w.shift()[0](t3.data.out); break; case "end-profiling": - t2.data.err ? x.shift()[1](t2.data.err) : x.shift()[0](); + t3.data.err ? x.shift()[1](t3.data.err) : x.shift()[0](); } }, O = "undefined" != typeof document ? null === (r = null === document || void 0 === document ? void 0 : document.currentScript) || void 0 === r ? void 0 : r.src : void 0; e.initWasm = async () => { @@ -14621,97 +15306,97 @@ ${t2}`); throw new Error("multiple calls to 'initWasm()' detected."); if (b) throw new Error("previous call to 'initWasm()' failed."); - return h = true, void 0 === s.env.wasm.wasmPaths && O && 0 !== O.indexOf("blob:") && (s.env.wasm.wasmPaths = O.substr(0, +O.lastIndexOf("/") + 1)), new Promise((t2, e2) => { - null == p || p.terminate(), p = n(9710).Z(), p.onmessage = S, f = [t2, e2]; + return h = true, void 0 === s.env.wasm.wasmPaths && O && 0 !== O.indexOf("blob:") && (s.env.wasm.wasmPaths = O.substr(0, +O.lastIndexOf("/") + 1)), new Promise((t3, e2) => { + null == p || p.terminate(), p = n(9710).Z(), p.onmessage = S, f = [t3, e2]; const r2 = { type: "init-wasm", in: s.env.wasm }; p.postMessage(r2); }); } return (0, c.initializeWebAssembly)(s.env.wasm); - }, e.initOrt = async (t2, e2) => { + }, e.initOrt = async (t3, e2) => { if (l()) return T(), new Promise((n2, r2) => { d = [n2, r2]; - const i3 = { type: "init-ort", in: { numThreads: t2, loggingLevel: e2 } }; + const i3 = { type: "init-ort", in: { numThreads: t3, loggingLevel: e2 } }; p.postMessage(i3); }); - u.initOrt(t2, e2); - }, e.createSessionAllocate = async (t2) => l() ? (T(), new Promise((e2, n2) => { + u.initOrt(t3, e2); + }, e.createSessionAllocate = async (t3) => l() ? (T(), new Promise((e2, n2) => { m.push([e2, n2]); - const r2 = { type: "create_allocate", in: { model: t2 } }; - p.postMessage(r2, [t2.buffer]); - })) : u.createSessionAllocate(t2), e.createSessionFinalize = async (t2, e2) => l() ? (T(), new Promise((n2, r2) => { + const r2 = { type: "create_allocate", in: { model: t3 } }; + p.postMessage(r2, [t3.buffer]); + })) : u.createSessionAllocate(t3), e.createSessionFinalize = async (t3, e2) => l() ? (T(), new Promise((n2, r2) => { y.push([n2, r2]); - const i3 = { type: "create_finalize", in: { modeldata: t2, options: e2 } }; + const i3 = { type: "create_finalize", in: { modeldata: t3, options: e2 } }; p.postMessage(i3); - })) : u.createSessionFinalize(t2, e2), e.createSession = async (t2, e2) => l() ? (T(), new Promise((n2, r2) => { + })) : u.createSessionFinalize(t3, e2), e.createSession = async (t3, e2) => l() ? (T(), new Promise((n2, r2) => { _.push([n2, r2]); - const i3 = { type: "create", in: { model: t2, options: e2 } }; - p.postMessage(i3, [t2.buffer]); - })) : u.createSession(t2, e2), e.releaseSession = async (t2) => { + const i3 = { type: "create", in: { model: t3, options: e2 } }; + p.postMessage(i3, [t3.buffer]); + })) : u.createSession(t3, e2), e.releaseSession = async (t3) => { if (l()) return T(), new Promise((e2, n2) => { v.push([e2, n2]); - const r2 = { type: "release", in: t2 }; + const r2 = { type: "release", in: t3 }; p.postMessage(r2); }); - u.releaseSession(t2); - }, e.run = async (t2, e2, n2, r2, i3) => l() ? (T(), new Promise((o2, a2) => { + u.releaseSession(t3); + }, e.run = async (t3, e2, n2, r2, i3) => l() ? (T(), new Promise((o2, a2) => { w.push([o2, a2]); - const s2 = { type: "run", in: { sessionId: t2, inputIndices: e2, inputs: n2, outputIndices: r2, options: i3 } }; + const s2 = { type: "run", in: { sessionId: t3, inputIndices: e2, inputs: n2, outputIndices: r2, options: i3 } }; p.postMessage(s2, u.extractTransferableBuffers(n2)); - })) : u.run(t2, e2, n2, r2, i3), e.endProfiling = async (t2) => { + })) : u.run(t3, e2, n2, r2, i3), e.endProfiling = async (t3) => { if (l()) return T(), new Promise((e2, n2) => { x.push([e2, n2]); - const r2 = { type: "end-profiling", in: t2 }; + const r2 = { type: "end-profiling", in: t3 }; p.postMessage(r2); }); - u.endProfiling(t2); + u.endProfiling(t3); }; - }, 586: (t, e, n) => { + }, 586: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.setRunOptions = void 0; const r = n(7967), i2 = n(4983), o = n(6361); - e.setRunOptions = (t2) => { + e.setRunOptions = (t3) => { const e2 = (0, o.getInstance)(); let n2 = 0; - const a = [], s = t2 || {}; + const a = [], s = t3 || {}; try { - if (void 0 === (null == t2 ? void 0 : t2.logSeverityLevel)) + if (void 0 === (null == t3 ? void 0 : t3.logSeverityLevel)) s.logSeverityLevel = 2; - else if ("number" != typeof t2.logSeverityLevel || !Number.isInteger(t2.logSeverityLevel) || t2.logSeverityLevel < 0 || t2.logSeverityLevel > 4) - throw new Error(`log serverity level is not valid: ${t2.logSeverityLevel}`); - if (void 0 === (null == t2 ? void 0 : t2.logVerbosityLevel)) + else if ("number" != typeof t3.logSeverityLevel || !Number.isInteger(t3.logSeverityLevel) || t3.logSeverityLevel < 0 || t3.logSeverityLevel > 4) + throw new Error(`log serverity level is not valid: ${t3.logSeverityLevel}`); + if (void 0 === (null == t3 ? void 0 : t3.logVerbosityLevel)) s.logVerbosityLevel = 0; - else if ("number" != typeof t2.logVerbosityLevel || !Number.isInteger(t2.logVerbosityLevel)) - throw new Error(`log verbosity level is not valid: ${t2.logVerbosityLevel}`); - void 0 === (null == t2 ? void 0 : t2.terminate) && (s.terminate = false); + else if ("number" != typeof t3.logVerbosityLevel || !Number.isInteger(t3.logVerbosityLevel)) + throw new Error(`log verbosity level is not valid: ${t3.logVerbosityLevel}`); + void 0 === (null == t3 ? void 0 : t3.terminate) && (s.terminate = false); let o2 = 0; - if (void 0 !== (null == t2 ? void 0 : t2.tag) && (o2 = (0, i2.allocWasmString)(t2.tag, a)), n2 = e2._OrtCreateRunOptions(s.logSeverityLevel, s.logVerbosityLevel, !!s.terminate, o2), 0 === n2) + if (void 0 !== (null == t3 ? void 0 : t3.tag) && (o2 = (0, i2.allocWasmString)(t3.tag, a)), n2 = e2._OrtCreateRunOptions(s.logSeverityLevel, s.logVerbosityLevel, !!s.terminate, o2), 0 === n2) throw new Error("Can't create run options"); - return void 0 !== (null == t2 ? void 0 : t2.extra) && (0, r.iterateExtraOptions)(t2.extra, "", /* @__PURE__ */ new WeakSet(), (t3, r2) => { - const o3 = (0, i2.allocWasmString)(t3, a), s2 = (0, i2.allocWasmString)(r2, a); + return void 0 !== (null == t3 ? void 0 : t3.extra) && (0, r.iterateExtraOptions)(t3.extra, "", /* @__PURE__ */ new WeakSet(), (t4, r2) => { + const o3 = (0, i2.allocWasmString)(t4, a), s2 = (0, i2.allocWasmString)(r2, a); if (0 !== e2._OrtAddRunConfigEntry(n2, o3, s2)) - throw new Error(`Can't set a run config entry: ${t3} - ${r2}`); + throw new Error(`Can't set a run config entry: ${t4} - ${r2}`); }), [n2, a]; - } catch (t3) { - throw 0 !== n2 && e2._OrtReleaseRunOptions(n2), a.forEach(e2._free), t3; + } catch (t4) { + throw 0 !== n2 && e2._OrtReleaseRunOptions(n2), a.forEach(e2._free), t4; } }; - }, 2306: (t, e, n) => { + }, 2306: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.OnnxruntimeWebAssemblySessionHandler = void 0; const r = n(6231), i2 = n(6207), o = n(6464), a = n(2157); let s; e.OnnxruntimeWebAssemblySessionHandler = class { - async createSessionAllocate(t2) { - const e2 = await fetch(t2), n2 = await e2.arrayBuffer(); + async createSessionAllocate(t3) { + const e2 = await fetch(t3), n2 = await e2.arrayBuffer(); return (0, a.createSessionAllocate)(new Uint8Array(n2)); } - async loadModel(t2, e2) { - if (s || (await (0, a.initOrt)(i2.env.wasm.numThreads, ((t3) => { - switch (t3) { + async loadModel(t3, e2) { + if (s || (await (0, a.initOrt)(i2.env.wasm.numThreads, ((t4) => { + switch (t4) { case "verbose": return 0; case "info": @@ -14723,40 +15408,40 @@ ${t2}`); case "fatal": return 4; default: - throw new Error(`unsupported logging level: ${t3}`); + throw new Error(`unsupported logging level: ${t4}`); } - })(i2.env.logLevel)), s = true), "string" == typeof t2) + })(i2.env.logLevel)), s = true), "string" == typeof t3) if ("undefined" == typeof fetch) { - const n2 = await (0, o.promisify)(r.readFile)(t2); + const n2 = await (0, o.promisify)(r.readFile)(t3); [this.sessionId, this.inputNames, this.outputNames] = await (0, a.createSession)(n2, e2); } else { - const n2 = await this.createSessionAllocate(t2); + const n2 = await this.createSessionAllocate(t3); [this.sessionId, this.inputNames, this.outputNames] = await (0, a.createSessionFinalize)(n2, e2); } else - [this.sessionId, this.inputNames, this.outputNames] = await (0, a.createSession)(t2, e2); + [this.sessionId, this.inputNames, this.outputNames] = await (0, a.createSession)(t3, e2); } async dispose() { return (0, a.releaseSession)(this.sessionId); } - async run(t2, e2, n2) { + async run(t3, e2, n2) { const r2 = [], o2 = []; - Object.entries(t2).forEach((t3) => { - const e3 = t3[0], n3 = t3[1], i3 = this.inputNames.indexOf(e3); + Object.entries(t3).forEach((t4) => { + const e3 = t4[0], n3 = t4[1], i3 = this.inputNames.indexOf(e3); if (-1 === i3) throw new Error(`invalid input '${e3}'`); r2.push(n3), o2.push(i3); }); const s2 = []; - Object.entries(e2).forEach((t3) => { - const e3 = t3[0], n3 = this.outputNames.indexOf(e3); + Object.entries(e2).forEach((t4) => { + const e3 = t4[0], n3 = this.outputNames.indexOf(e3); if (-1 === n3) throw new Error(`invalid output '${e3}'`); s2.push(n3); }); - const u = await (0, a.run)(this.sessionId, o2, r2.map((t3) => [t3.type, t3.dims, t3.data]), s2, n2), c = {}; - for (let t3 = 0; t3 < u.length; t3++) - c[this.outputNames[s2[t3]]] = new i2.Tensor(u[t3][0], u[t3][2], u[t3][1]); + const u = await (0, a.run)(this.sessionId, o2, r2.map((t4) => [t4.type, t4.dims, t4.data]), s2, n2), c = {}; + for (let t4 = 0; t4 < u.length; t4++) + c[this.outputNames[s2[t4]]] = new i2.Tensor(u[t4][0], u[t4][2], u[t4][1]); return c; } startProfiling() { @@ -14765,23 +15450,23 @@ ${t2}`); (0, a.endProfiling)(this.sessionId); } }; - }, 4919: (t, e, n) => { + }, 4919: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.setSessionOptions = void 0; const r = n(7967), i2 = n(4983), o = n(6361); - e.setSessionOptions = (t2) => { + e.setSessionOptions = (t3) => { const e2 = (0, o.getInstance)(); let n2 = 0; - const a = [], s = t2 || {}; - ((t3) => { - t3.extra || (t3.extra = {}), t3.extra.session || (t3.extra.session = {}); - const e3 = t3.extra.session; + const a = [], s = t3 || {}; + ((t4) => { + t4.extra || (t4.extra = {}), t4.extra.session || (t4.extra.session = {}); + const e3 = t4.extra.session; e3.use_ort_model_bytes_directly || (e3.use_ort_model_bytes_directly = "1"); })(s); try { - void 0 === (null == t2 ? void 0 : t2.graphOptimizationLevel) && (s.graphOptimizationLevel = "all"); - const u = ((t3) => { - switch (t3) { + void 0 === (null == t3 ? void 0 : t3.graphOptimizationLevel) && (s.graphOptimizationLevel = "all"); + const u = ((t4) => { + switch (t4) { case "disabled": return 0; case "basic": @@ -14791,32 +15476,32 @@ ${t2}`); case "all": return 99; default: - throw new Error(`unsupported graph optimization level: ${t3}`); + throw new Error(`unsupported graph optimization level: ${t4}`); } })(s.graphOptimizationLevel); - void 0 === (null == t2 ? void 0 : t2.enableCpuMemArena) && (s.enableCpuMemArena = true), void 0 === (null == t2 ? void 0 : t2.enableMemPattern) && (s.enableMemPattern = true), void 0 === (null == t2 ? void 0 : t2.executionMode) && (s.executionMode = "sequential"); - const c = ((t3) => { - switch (t3) { + void 0 === (null == t3 ? void 0 : t3.enableCpuMemArena) && (s.enableCpuMemArena = true), void 0 === (null == t3 ? void 0 : t3.enableMemPattern) && (s.enableMemPattern = true), void 0 === (null == t3 ? void 0 : t3.executionMode) && (s.executionMode = "sequential"); + const c = ((t4) => { + switch (t4) { case "sequential": return 0; case "parallel": return 1; default: - throw new Error(`unsupported execution mode: ${t3}`); + throw new Error(`unsupported execution mode: ${t4}`); } })(s.executionMode); let l = 0; - if (void 0 !== (null == t2 ? void 0 : t2.logId) && (l = (0, i2.allocWasmString)(t2.logId, a)), void 0 === (null == t2 ? void 0 : t2.logSeverityLevel)) + if (void 0 !== (null == t3 ? void 0 : t3.logId) && (l = (0, i2.allocWasmString)(t3.logId, a)), void 0 === (null == t3 ? void 0 : t3.logSeverityLevel)) s.logSeverityLevel = 2; - else if ("number" != typeof t2.logSeverityLevel || !Number.isInteger(t2.logSeverityLevel) || t2.logSeverityLevel < 0 || t2.logSeverityLevel > 4) - throw new Error(`log serverity level is not valid: ${t2.logSeverityLevel}`); - if (void 0 === (null == t2 ? void 0 : t2.logVerbosityLevel)) + else if ("number" != typeof t3.logSeverityLevel || !Number.isInteger(t3.logSeverityLevel) || t3.logSeverityLevel < 0 || t3.logSeverityLevel > 4) + throw new Error(`log serverity level is not valid: ${t3.logSeverityLevel}`); + if (void 0 === (null == t3 ? void 0 : t3.logVerbosityLevel)) s.logVerbosityLevel = 0; - else if ("number" != typeof t2.logVerbosityLevel || !Number.isInteger(t2.logVerbosityLevel)) - throw new Error(`log verbosity level is not valid: ${t2.logVerbosityLevel}`); - if (void 0 === (null == t2 ? void 0 : t2.enableProfiling) && (s.enableProfiling = false), n2 = e2._OrtCreateSessionOptions(u, !!s.enableCpuMemArena, !!s.enableMemPattern, c, !!s.enableProfiling, 0, l, s.logSeverityLevel, s.logVerbosityLevel), 0 === n2) + else if ("number" != typeof t3.logVerbosityLevel || !Number.isInteger(t3.logVerbosityLevel)) + throw new Error(`log verbosity level is not valid: ${t3.logVerbosityLevel}`); + if (void 0 === (null == t3 ? void 0 : t3.enableProfiling) && (s.enableProfiling = false), n2 = e2._OrtCreateSessionOptions(u, !!s.enableCpuMemArena, !!s.enableMemPattern, c, !!s.enableProfiling, 0, l, s.logSeverityLevel, s.logVerbosityLevel), 0 === n2) throw new Error("Can't create session options"); - return (null == t2 ? void 0 : t2.executionProviders) && ((t3, e3, n3) => { + return (null == t3 ? void 0 : t3.executionProviders) && ((t4, e3, n3) => { for (const r2 of e3) { let e4 = "string" == typeof r2 ? r2 : r2.name; switch (e4) { @@ -14830,74 +15515,74 @@ ${t2}`); throw new Error(`not supported EP: ${e4}`); } const a2 = (0, i2.allocWasmString)(e4, n3); - if (0 !== (0, o.getInstance)()._OrtAppendExecutionProvider(t3, a2)) + if (0 !== (0, o.getInstance)()._OrtAppendExecutionProvider(t4, a2)) throw new Error(`Can't append execution provider: ${e4}`); } - })(n2, t2.executionProviders, a), void 0 !== (null == t2 ? void 0 : t2.extra) && (0, r.iterateExtraOptions)(t2.extra, "", /* @__PURE__ */ new WeakSet(), (t3, r2) => { - const o2 = (0, i2.allocWasmString)(t3, a), s2 = (0, i2.allocWasmString)(r2, a); + })(n2, t3.executionProviders, a), void 0 !== (null == t3 ? void 0 : t3.extra) && (0, r.iterateExtraOptions)(t3.extra, "", /* @__PURE__ */ new WeakSet(), (t4, r2) => { + const o2 = (0, i2.allocWasmString)(t4, a), s2 = (0, i2.allocWasmString)(r2, a); if (0 !== e2._OrtAddSessionConfigEntry(n2, o2, s2)) - throw new Error(`Can't set a session config entry: ${t3} - ${r2}`); + throw new Error(`Can't set a session config entry: ${t4} - ${r2}`); }), [n2, a]; - } catch (t3) { - throw 0 !== n2 && e2._OrtReleaseSessionOptions(n2), a.forEach(e2._free), t3; + } catch (t4) { + throw 0 !== n2 && e2._OrtReleaseSessionOptions(n2), a.forEach(e2._free), t4; } }; - }, 4983: (t, e, n) => { + }, 4983: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.allocWasmString = void 0; const r = n(6361); - e.allocWasmString = (t2, e2) => { - const n2 = (0, r.getInstance)(), i2 = n2.lengthBytesUTF8(t2) + 1, o = n2._malloc(i2); - return n2.stringToUTF8(t2, o, i2), e2.push(o), o; + e.allocWasmString = (t3, e2) => { + const n2 = (0, r.getInstance)(), i2 = n2.lengthBytesUTF8(t3) + 1, o = n2._malloc(i2); + return n2.stringToUTF8(t3, o, i2), e2.push(o), o; }; - }, 349: (t, e, n) => { + }, 349: (t2, e, n) => { "use strict"; Object.defineProperty(e, "__esModule", { value: true }), e.extractTransferableBuffers = e.endProfiling = e.run = e.releaseSession = e.createSession = e.createSessionFinalize = e.createSessionAllocate = e.initOrt = void 0; const r = n(586), i2 = n(4919), o = n(4983), a = n(6361); - e.initOrt = (t2, e2) => { - const n2 = (0, a.getInstance)()._OrtInit(t2, e2); + e.initOrt = (t3, e2) => { + const n2 = (0, a.getInstance)()._OrtInit(t3, e2); if (0 !== n2) throw new Error(`Can't initialize onnxruntime. error code = ${n2}`); }; const s = /* @__PURE__ */ new Map(); - e.createSessionAllocate = (t2) => { - const e2 = (0, a.getInstance)(), n2 = e2._malloc(t2.byteLength); - return e2.HEAPU8.set(t2, n2), [n2, t2.byteLength]; - }, e.createSessionFinalize = (t2, e2) => { + e.createSessionAllocate = (t3) => { + const e2 = (0, a.getInstance)(), n2 = e2._malloc(t3.byteLength); + return e2.HEAPU8.set(t3, n2), [n2, t3.byteLength]; + }, e.createSessionFinalize = (t3, e2) => { const n2 = (0, a.getInstance)(); let r2 = 0, o2 = 0, u2 = []; try { - if ([o2, u2] = (0, i2.setSessionOptions)(e2), r2 = n2._OrtCreateSession(t2[0], t2[1], o2), 0 === r2) + if ([o2, u2] = (0, i2.setSessionOptions)(e2), r2 = n2._OrtCreateSession(t3[0], t3[1], o2), 0 === r2) throw new Error("Can't create a session"); } finally { - n2._free(t2[0]), n2._OrtReleaseSessionOptions(o2), u2.forEach(n2._free); + n2._free(t3[0]), n2._OrtReleaseSessionOptions(o2), u2.forEach(n2._free); } const c2 = n2._OrtGetInputCount(r2), l2 = n2._OrtGetOutputCount(r2), p = [], f = [], d = [], h = []; - for (let t3 = 0; t3 < c2; t3++) { - const e3 = n2._OrtGetInputName(r2, t3); + for (let t4 = 0; t4 < c2; t4++) { + const e3 = n2._OrtGetInputName(r2, t4); if (0 === e3) throw new Error("Can't get an input name"); f.push(e3), p.push(n2.UTF8ToString(e3)); } - for (let t3 = 0; t3 < l2; t3++) { - const e3 = n2._OrtGetOutputName(r2, t3); + for (let t4 = 0; t4 < l2; t4++) { + const e3 = n2._OrtGetOutputName(r2, t4); if (0 === e3) throw new Error("Can't get an output name"); h.push(e3), d.push(n2.UTF8ToString(e3)); } return s.set(r2, [r2, f, h]), [r2, p, d]; - }, e.createSession = (t2, n2) => { - const r2 = (0, e.createSessionAllocate)(t2); + }, e.createSession = (t3, n2) => { + const r2 = (0, e.createSessionAllocate)(t3); return (0, e.createSessionFinalize)(r2, n2); - }, e.releaseSession = (t2) => { - const e2 = (0, a.getInstance)(), n2 = s.get(t2); + }, e.releaseSession = (t3) => { + const e2 = (0, a.getInstance)(), n2 = s.get(t3); if (!n2) throw new Error("invalid session id"); const r2 = n2[0], i3 = n2[1], o2 = n2[2]; - i3.forEach(e2._OrtFree), o2.forEach(e2._OrtFree), e2._OrtReleaseSession(r2), s.delete(t2); + i3.forEach(e2._OrtFree), o2.forEach(e2._OrtFree), e2._OrtReleaseSession(r2), s.delete(t3); }; - const u = (t2) => { - switch (t2) { + const u = (t3) => { + switch (t3) { case "int8": return 3; case "uint8": @@ -14923,10 +15608,10 @@ ${t2}`); case "uint64": return 13; default: - throw new Error(`unsupported data type: ${t2}`); + throw new Error(`unsupported data type: ${t3}`); } - }, c = (t2) => { - switch (t2) { + }, c = (t3) => { + switch (t3) { case 3: return "int8"; case 2: @@ -14952,10 +15637,10 @@ ${t2}`); case 13: return "uint64"; default: - throw new Error(`unsupported data type: ${t2}`); + throw new Error(`unsupported data type: ${t3}`); } - }, l = (t2) => { - switch (t2) { + }, l = (t3) => { + switch (t3) { case "float32": return Float32Array; case "uint8": @@ -14978,11 +15663,11 @@ ${t2}`); case "uint64": return BigUint64Array; default: - throw new Error(`unsupported type: ${t2}`); + throw new Error(`unsupported type: ${t3}`); } }; - e.run = (t2, e2, n2, i3, p) => { - const f = (0, a.getInstance)(), d = s.get(t2); + e.run = (t3, e2, n2, i3, p) => { + const f = (0, a.getInstance)(), d = s.get(t3); if (!d) throw new Error("invalid session id"); const h = d[0], g = d[1], b = d[2], m = e2.length, y = i3.length; @@ -14990,23 +15675,23 @@ ${t2}`); const w = [], x = []; try { [_, v] = (0, r.setRunOptions)(p); - for (let t4 = 0; t4 < m; t4++) { - const e3 = n2[t4][0], r2 = n2[t4][1], i4 = n2[t4][2]; + for (let t5 = 0; t5 < m; t5++) { + const e3 = n2[t5][0], r2 = n2[t5][1], i4 = n2[t5][2]; let a3, s3; if (Array.isArray(i4)) { s3 = 4 * i4.length, a3 = f._malloc(s3), x.push(a3); - let t5 = a3 / 4; + let t6 = a3 / 4; for (let e4 = 0; e4 < i4.length; e4++) { if ("string" != typeof i4[e4]) throw new TypeError(`tensor data at index ${e4} is not a string`); - f.HEAPU32[t5++] = (0, o.allocWasmString)(i4[e4], x); + f.HEAPU32[t6++] = (0, o.allocWasmString)(i4[e4], x); } } else s3 = i4.byteLength, a3 = f._malloc(s3), x.push(a3), f.HEAPU8.set(new Uint8Array(i4.buffer, i4.byteOffset, s3), a3); const c2 = f.stackSave(), l2 = f.stackAlloc(4 * r2.length); try { - let t5 = l2 / 4; - r2.forEach((e4) => f.HEAP32[t5++] = e4); + let t6 = l2 / 4; + r2.forEach((e4) => f.HEAP32[t6++] = e4); const n3 = f._OrtCreateTensor(u(e3), a3, s3, l2, r2.length); if (0 === n3) throw new Error("Can't create a tensor"); @@ -15015,41 +15700,41 @@ ${t2}`); f.stackRestore(c2); } } - const t3 = f.stackSave(), a2 = f.stackAlloc(4 * m), s2 = f.stackAlloc(4 * m), d2 = f.stackAlloc(4 * y), T = f.stackAlloc(4 * y); + const t4 = f.stackSave(), a2 = f.stackAlloc(4 * m), s2 = f.stackAlloc(4 * m), d2 = f.stackAlloc(4 * y), T = f.stackAlloc(4 * y); try { let n3 = a2 / 4, r2 = s2 / 4, o2 = d2 / 4, u2 = T / 4; - for (let t4 = 0; t4 < m; t4++) - f.HEAPU32[n3++] = w[t4], f.HEAPU32[r2++] = g[e2[t4]]; - for (let t4 = 0; t4 < y; t4++) - f.HEAPU32[o2++] = 0, f.HEAPU32[u2++] = b[i3[t4]]; + for (let t5 = 0; t5 < m; t5++) + f.HEAPU32[n3++] = w[t5], f.HEAPU32[r2++] = g[e2[t5]]; + for (let t5 = 0; t5 < y; t5++) + f.HEAPU32[o2++] = 0, f.HEAPU32[u2++] = b[i3[t5]]; let p2 = f._OrtRun(h, s2, a2, m, T, y, d2, _); const v2 = []; if (0 === p2) - for (let t4 = 0; t4 < y; t4++) { - const e3 = f.HEAPU32[d2 / 4 + t4], n4 = f.stackSave(), r3 = f.stackAlloc(16); + for (let t5 = 0; t5 < y; t5++) { + const e3 = f.HEAPU32[d2 / 4 + t5], n4 = f.stackSave(), r3 = f.stackAlloc(16); let i4, o3 = 0; try { if (p2 = f._OrtGetTensorData(e3, r3, r3 + 4, r3 + 8, r3 + 12), 0 !== p2) throw new Error(`Can't access output tensor data. error code = ${p2}`); - let t5 = r3 / 4; - const a3 = f.HEAPU32[t5++]; - o3 = f.HEAPU32[t5++]; - const s3 = f.HEAPU32[t5++], u3 = f.HEAPU32[t5++], d3 = []; - for (let t6 = 0; t6 < u3; t6++) - d3.push(f.HEAPU32[s3 / 4 + t6]); + let t6 = r3 / 4; + const a3 = f.HEAPU32[t6++]; + o3 = f.HEAPU32[t6++]; + const s3 = f.HEAPU32[t6++], u3 = f.HEAPU32[t6++], d3 = []; + for (let t7 = 0; t7 < u3; t7++) + d3.push(f.HEAPU32[s3 / 4 + t7]); f._OrtFree(s3); - const h2 = 0 === d3.length ? 1 : d3.reduce((t6, e4) => t6 * e4); + const h2 = 0 === d3.length ? 1 : d3.reduce((t7, e4) => t7 * e4); if (i4 = c(a3), "string" === i4) { - const t6 = []; + const t7 = []; let e4 = o3 / 4; for (let n5 = 0; n5 < h2; n5++) { const r4 = f.HEAPU32[e4++], i5 = n5 === h2 - 1 ? void 0 : f.HEAPU32[e4] - r4; - t6.push(f.UTF8ToString(r4, i5)); + t7.push(f.UTF8ToString(r4, i5)); } - v2.push([i4, d3, t6]); + v2.push([i4, d3, t7]); } else { - const t6 = new (l(i4))(h2); - new Uint8Array(t6.buffer, t6.byteOffset, t6.byteLength).set(f.HEAPU8.subarray(o3, o3 + t6.byteLength)), v2.push([i4, d3, t6]); + const t7 = new (l(i4))(h2); + new Uint8Array(t7.buffer, t7.byteOffset, t7.byteLength).set(f.HEAPU8.subarray(o3, o3 + t7.byteLength)), v2.push([i4, d3, t7]); } } finally { f.stackRestore(n4), "string" === i4 && o3 && f._free(o3), f._OrtReleaseTensor(e3); @@ -15059,57 +15744,57 @@ ${t2}`); return v2; throw new Error(`failed to call OrtRun(). error code = ${p2}.`); } finally { - f.stackRestore(t3); + f.stackRestore(t4); } } finally { w.forEach(f._OrtReleaseTensor), x.forEach(f._free), f._OrtReleaseRunOptions(_), v.forEach(f._free); } - }, e.endProfiling = (t2) => { - const e2 = (0, a.getInstance)(), n2 = s.get(t2); + }, e.endProfiling = (t3) => { + const e2 = (0, a.getInstance)(), n2 = s.get(t3); if (!n2) throw new Error("invalid session id"); const r2 = n2[0], i3 = e2._OrtEndProfiling(r2); if (0 === i3) throw new Error("Can't get an profile file name"); e2._OrtFree(i3); - }, e.extractTransferableBuffers = (t2) => { + }, e.extractTransferableBuffers = (t3) => { const e2 = []; - for (const n2 of t2) { - const t3 = n2[2]; - !Array.isArray(t3) && t3.buffer && e2.push(t3.buffer); + for (const n2 of t3) { + const t4 = n2[2]; + !Array.isArray(t4) && t4.buffer && e2.push(t4.buffer); } return e2; }; - }, 6361: function(t, e, n) { + }, 6361: function(t2, e, n) { "use strict"; - var r = this && this.__createBinding || (Object.create ? function(t2, e2, n2, r2) { + var r = this && this.__createBinding || (Object.create ? function(t3, e2, n2, r2) { void 0 === r2 && (r2 = n2); var i3 = Object.getOwnPropertyDescriptor(e2, n2); i3 && !("get" in i3 ? !e2.__esModule : i3.writable || i3.configurable) || (i3 = { enumerable: true, get: function() { return e2[n2]; - } }), Object.defineProperty(t2, r2, i3); - } : function(t2, e2, n2, r2) { - void 0 === r2 && (r2 = n2), t2[r2] = e2[n2]; - }), i2 = this && this.__setModuleDefault || (Object.create ? function(t2, e2) { - Object.defineProperty(t2, "default", { enumerable: true, value: e2 }); - } : function(t2, e2) { - t2.default = e2; - }), o = this && this.__importStar || function(t2) { - if (t2 && t2.__esModule) - return t2; + } }), Object.defineProperty(t3, r2, i3); + } : function(t3, e2, n2, r2) { + void 0 === r2 && (r2 = n2), t3[r2] = e2[n2]; + }), i2 = this && this.__setModuleDefault || (Object.create ? function(t3, e2) { + Object.defineProperty(t3, "default", { enumerable: true, value: e2 }); + } : function(t3, e2) { + t3.default = e2; + }), o = this && this.__importStar || function(t3) { + if (t3 && t3.__esModule) + return t3; var e2 = {}; - if (null != t2) - for (var n2 in t2) - "default" !== n2 && Object.prototype.hasOwnProperty.call(t2, n2) && r(e2, t2, n2); - return i2(e2, t2), e2; - }, a = this && this.__importDefault || function(t2) { - return t2 && t2.__esModule ? t2 : { default: t2 }; + if (null != t3) + for (var n2 in t3) + "default" !== n2 && Object.prototype.hasOwnProperty.call(t3, n2) && r(e2, t3, n2); + return i2(e2, t3), e2; + }, a = this && this.__importDefault || function(t3) { + return t3 && t3.__esModule ? t3 : { default: t3 }; }; Object.defineProperty(e, "__esModule", { value: true }), e.dispose = e.getInstance = e.initializeWebAssembly = void 0; const s = o(n(1423)), u = a(n(932)), c = n(3474); let l, p = false, f = false, d = false; - const h = (t2, e2) => e2 ? t2 ? "ort-wasm-simd-threaded.wasm" : "ort-wasm-threaded.wasm" : t2 ? "ort-wasm-simd.wasm" : "ort-wasm.wasm"; - e.initializeWebAssembly = async (t2) => { + const h = (t3, e2) => e2 ? t3 ? "ort-wasm-simd-threaded.wasm" : "ort-wasm-threaded.wasm" : t3 ? "ort-wasm-simd.wasm" : "ort-wasm.wasm"; + e.initializeWebAssembly = async (t3) => { if (p) return Promise.resolve(); if (f) @@ -15117,38 +15802,38 @@ ${t2}`); if (d) throw new Error("previous call to 'initializeWebAssembly()' failed."); f = true; - const e2 = t2.initTimeout, r2 = t2.numThreads, i3 = t2.simd, o2 = r2 > 1 && (() => { + const e2 = t3.initTimeout, r2 = t3.numThreads, i3 = t3.simd, o2 = r2 > 1 && (() => { try { return "undefined" != typeof SharedArrayBuffer && ("undefined" != typeof MessageChannel && new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)), WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]))); - } catch (t3) { + } catch (t4) { return false; } })(), a2 = i3 && (() => { try { return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 30, 1, 28, 0, 65, 0, 253, 15, 253, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 186, 1, 26, 11])); - } catch (t3) { + } catch (t4) { return false; } - })(), g = "string" == typeof t2.wasmPaths ? t2.wasmPaths : void 0, b = h(false, o2), m = h(a2, o2), y = "object" == typeof t2.wasmPaths ? t2.wasmPaths[m] : void 0; + })(), g = "string" == typeof t3.wasmPaths ? t3.wasmPaths : void 0, b = h(false, o2), m = h(a2, o2), y = "object" == typeof t3.wasmPaths ? t3.wasmPaths[m] : void 0; let _ = false; const v = []; - if (e2 > 0 && v.push(new Promise((t3) => { + if (e2 > 0 && v.push(new Promise((t4) => { setTimeout(() => { - _ = true, t3(); + _ = true, t4(); }, e2); - })), v.push(new Promise((t3, e3) => { - const r3 = o2 ? c : u.default, i4 = { locateFile: (t4, e4) => o2 && t4.endsWith(".worker.js") && "undefined" != typeof Blob ? URL.createObjectURL(new Blob([n(4154)], { type: "text/javascript" })) : t4 === b ? null != y ? y : (null != g ? g : e4) + m : e4 + t4 }; + })), v.push(new Promise((t4, e3) => { + const r3 = o2 ? c : u.default, i4 = { locateFile: (t5, e4) => o2 && t5.endsWith(".worker.js") && "undefined" != typeof Blob ? URL.createObjectURL(new Blob([n(4154)], { type: "text/javascript" })) : t5 === b ? null != y ? y : (null != g ? g : e4) + m : e4 + t5 }; if (o2) if ("undefined" == typeof Blob) i4.mainScriptUrlOrBlob = s.join(__dirname, "ort-wasm-threaded.js"); else { - const t4 = `var ortWasmThreaded=(function(){var _scriptDir;return ${r3.toString()}})();`; - i4.mainScriptUrlOrBlob = new Blob([t4], { type: "text/javascript" }); + const t5 = `var ortWasmThreaded=(function(){var _scriptDir;return ${r3.toString()}})();`; + i4.mainScriptUrlOrBlob = new Blob([t5], { type: "text/javascript" }); } r3(i4).then((e4) => { - f = false, p = true, l = e4, t3(); - }, (t4) => { - f = false, d = true, e3(t4); + f = false, p = true, l = e4, t4(); + }, (t5) => { + f = false, d = true, e3(t5); }); })), await Promise.race(v), _) throw new Error(`WebAssembly backend initializing failed due to timeout: ${e2}ms`); @@ -15157,174 +15842,174 @@ ${t2}`); return l; throw new Error("WebAssembly is not initialized yet."); }, e.dispose = () => { - var t2; - !p || f || d || (f = true, null === (t2 = l.PThread) || void 0 === t2 || t2.terminateAllThreads(), l = void 0, f = false, p = false, d = true); + var t3; + !p || f || d || (f = true, null === (t3 = l.PThread) || void 0 === t3 || t3.terminateAllThreads(), l = void 0, f = false, p = false, d = true); }; - }, 9710: (t, e, n) => { + }, 9710: (t2, e, n) => { "use strict"; n.d(e, { Z: () => o }); var r = n(477), i2 = n.n(r); function o() { return i2()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){function e(){return k.buffer!=D&&N(k.buffer),P}function r(){return k.buffer!=D&&N(k.buffer),U}function a(){return k.buffer!=D&&N(k.buffer),F}function i(){return k.buffer!=D&&N(k.buffer),I}function o(){return k.buffer!=D&&N(k.buffer),W}var u,s,c;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){s=t,c=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,_="function"==typeof importScripts,w="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(w){let e;A=_?n(17).dirname(A)+"/":__dirname+"/",y=()=>{d||(h=n(147),d=n(17))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof st||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(267)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}global.Worker=e.Worker}else(v||_)&&(_?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&"undefined"==typeof performance&&(global.performance=n(74).performance);var T=console.log.bind(console),E=console.warn.bind(console);w&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var k,j,D,P,U,F,I,W,H=!1,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?L(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)k=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)k=u.wasmMemory;else if(!((k=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),w&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");k&&(D=k.buffer),V=D.byteLength,N(D);var q,$=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();$.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),c(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function st(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function ct(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return qt(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new st(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Lt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?ct(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},w&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:k,wasmModule:j})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,_t,wt=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?qt(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?qt(4,1,t,e,n):0}function xt(t,e){if(O)return qt(5,1,t,e)}function Rt(t,e){if(O)return qt(6,1,t,e)}function kt(t,e,n){if(O)return qt(7,1,t,e,n)}function jt(t,e,n){return O?qt(8,1,t,e,n):0}function Dt(t,e){if(O)return qt(9,1,t,e)}function Pt(t,e,n){if(O)return qt(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return qt(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return qt(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return qt(13,1,t,e,n,r)}function Wt(t){if(O)return qt(14,1,t)}function Ht(t,e){if(O)return qt(15,1,t,e)}function zt(t,e,n){if(O)return qt(16,1,t,e,n)}function Lt(t){Atomics.store(a(),t>>2,1),he()&&we(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?qt(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return qt(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return qt(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),s=new Date(o,6,1);o=u.getTimezoneOffset();var c=s.getTimezoneOffset(),l=Math.max(o,c);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=c),t=r(u),e=r(s),t=Nt(t),e=Nt(e),c>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=s}return _e(t,n,a,e)}))}u.executeNotifiedProxyingQueue=Lt,_t=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var $t,Xt=[],Jt={};function Zt(){if(!$t){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);$t=n}return $t}function Qt(t,n){if(O)return qt(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return qt(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?qt(22,1,t):52}function ee(t,e,n,r){return O?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?qt(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(L(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return qt(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],c=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=c}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var se=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=s(e,t)?0>=s(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,kt,jt,Dt,Pt,Ut,Ft,It,Wt,Ht,zt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;aLt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),s=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&s==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!w&&!_){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,w&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:_t,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(37).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{k.grow(i-D.byteLength+65535>>>16),N(k.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(113);return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var s=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,s,c,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,s,c,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var s=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return je(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return ze(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return ke(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var s=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,s){var c=Ee();try{gt(t)(e,n,r,a,i,o,u,s)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,s,c,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,s,c,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,s,c,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,s,c,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var s=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,s,c,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,s,c,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:k||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),q=u.asm.ub,X.unshift(u.asm.Va),j=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||_)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||w||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(c)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,_e=u._emscripten_run_in_main_runtime_thread_js=function(){return(_e=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},we=u.__emscripten_proxy_execute_task_queue=function(){return(we=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},ke=u.dynCall_j=function(){return(ke=u.dynCall_j=u.asm.Ib).apply(null,arguments)},je=u.dynCall_iiiiij=function(){return(je=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},ze=u.dynCall_iiij=function(){return(ze=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function Le(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),s(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,s,c,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(17).dirname(m)+"/":__dirname+"/",l=()=>{c||(s=n(147),c=n(17))},i=function(t,e){return l(),t=c.normalize(t),s.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=c.normalize(t),s.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(w||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),_=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var w=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function k(t,e){return(t>>>=0)?R(T,t,e):""}function j(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],z=0;function L(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),_(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function q(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!q()){var $=Y;Y=e.locateFile?e.locateFile($,m):m+$}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&j(t,S,n,e),n}var ot={};function ut(){if(!st){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);st=n}return st}var st,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?v:_)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:c?k(c):""},n=k(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return s(t).toString().substring(2)},"%G":function(t){return s(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(t){var e=Array(D(t)+1);return j(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw _("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){w||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var s=0;s>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(113);return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var s=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,s,c,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,s,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var s=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var s=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,s){var c=At();try{at(t)(e,n,r,a,i,o,u,s)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,s,c,l){var f=At();try{at(t)(e,n,r,a,i,o,u,s,c,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,s,c,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,s,c,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var s=At();try{kt(t,e,n,r,a,i,o,u)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,s,c,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,s,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{jt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return _("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||q()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return _("wasm streaming compile failed: "+t),_("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},_t=e._fflush=function(){return(_t=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},kt=e.dynCall_viiiiij=function(){return(kt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},jt=e.dynCall_vjji=function(){return(jt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const s=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const c=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(s,!!u.enableCpuMemArena,!!u.enableMemPattern,c,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,s=[];try{if([i,s]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),s.forEach(n._free)}const c=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const s=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},c=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,_=[];const w=[],O=[];try{[v,_]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(s(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");w.push(n)}finally{p.stackRestore(c)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,s=A/4;for(let t=0;tt*e));if(a=c(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(17)),s=o(n(932)),c=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const _=[];if(e>0&&_.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),_.push(new Promise(((t,e)=>{const r=i?c:s.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join(__dirname,"ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(_),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},113:t=>{"use strict";t.exports=require("crypto")},147:t=>{"use strict";t.exports=require("fs")},37:t=>{"use strict";t.exports=require("os")},17:t=>{"use strict";t.exports=require("path")},74:t=>{"use strict";t.exports=require("perf_hooks")},267:t=>{"use strict";t.exports=require("worker_threads")}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n', "Worker", void 0, void 0); } - }, 477: (t) => { + }, 477: (t2) => { "use strict"; - t.exports = function(t2, e, n, r) { + t2.exports = function(t3, e, n, r) { var i2 = self || window; try { try { var o; try { - o = new i2.Blob([t2]); + o = new i2.Blob([t3]); } catch (e2) { - (o = new (i2.BlobBuilder || i2.WebKitBlobBuilder || i2.MozBlobBuilder || i2.MSBlobBuilder)()).append(t2), o = o.getBlob(); + (o = new (i2.BlobBuilder || i2.WebKitBlobBuilder || i2.MozBlobBuilder || i2.MSBlobBuilder)()).append(t3), o = o.getBlob(); } var a = i2.URL || i2.webkitURL, s = a.createObjectURL(o), u = new i2[e](s, n); return a.revokeObjectURL(s), u; } catch (r2) { - return new i2[e]("data:application/javascript,".concat(encodeURIComponent(t2)), n); + return new i2[e]("data:application/javascript,".concat(encodeURIComponent(t3)), n); } - } catch (t3) { + } catch (t4) { if (!r) throw Error("Inline worker is not supported"); return new i2[e](r, n); } }; - }, 4154: (t) => { + }, 4154: (t2) => { "use strict"; - t.exports = '"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'; - }, 6231: (t) => { + t2.exports = '"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'; + }, 6231: (t2) => { "use strict"; - t.exports = require("fs"); - }, 9719: (t) => { + t2.exports = require("fs"); + }, 9719: (t2) => { "use strict"; - t.exports = require("os"); - }, 1423: (t) => { + t2.exports = require("os"); + }, 1423: (t2) => { "use strict"; - t.exports = require("path"); - }, 498: (t) => { + t2.exports = require("path"); + }, 498: (t2) => { "use strict"; - t.exports = require("perf_hooks"); - }, 6464: (t) => { + t2.exports = require("perf_hooks"); + }, 6464: (t2) => { "use strict"; - t.exports = require("util"); - }, 4564: (t) => { + t2.exports = require("util"); + }, 4564: (t2) => { "use strict"; - t.exports = require("worker_threads"); - }, 6207: (t) => { + t2.exports = require("worker_threads"); + }, 6207: (t2) => { "use strict"; - t.exports = require_ort_common_node(); - }, 6113: (t) => { + t2.exports = require_ort_common_node(); + }, 6113: (t2) => { "use strict"; - t.exports = require("crypto"); - }, 5686: (t, e, n) => { + t2.exports = require("crypto"); + }, 5686: (t2, e, n) => { "use strict"; n.r(e), n.d(e, { flatbuffers: () => r }); var r = {}; - r.Offset, r.Table, r.SIZEOF_SHORT = 2, r.SIZEOF_INT = 4, r.FILE_IDENTIFIER_LENGTH = 4, r.SIZE_PREFIX_LENGTH = 4, r.Encoding = { UTF8_BYTES: 1, UTF16_STRING: 2 }, r.int32 = new Int32Array(2), r.float32 = new Float32Array(r.int32.buffer), r.float64 = new Float64Array(r.int32.buffer), r.isLittleEndian = 1 === new Uint16Array(new Uint8Array([1, 0]).buffer)[0], r.Long = function(t2, e2) { - this.low = 0 | t2, this.high = 0 | e2; - }, r.Long.create = function(t2, e2) { - return 0 == t2 && 0 == e2 ? r.Long.ZERO : new r.Long(t2, e2); + r.Offset, r.Table, r.SIZEOF_SHORT = 2, r.SIZEOF_INT = 4, r.FILE_IDENTIFIER_LENGTH = 4, r.SIZE_PREFIX_LENGTH = 4, r.Encoding = { UTF8_BYTES: 1, UTF16_STRING: 2 }, r.int32 = new Int32Array(2), r.float32 = new Float32Array(r.int32.buffer), r.float64 = new Float64Array(r.int32.buffer), r.isLittleEndian = 1 === new Uint16Array(new Uint8Array([1, 0]).buffer)[0], r.Long = function(t3, e2) { + this.low = 0 | t3, this.high = 0 | e2; + }, r.Long.create = function(t3, e2) { + return 0 == t3 && 0 == e2 ? r.Long.ZERO : new r.Long(t3, e2); }, r.Long.prototype.toFloat64 = function() { return (this.low >>> 0) + 4294967296 * this.high; - }, r.Long.prototype.equals = function(t2) { - return this.low == t2.low && this.high == t2.high; - }, r.Long.ZERO = new r.Long(0, 0), r.Builder = function(t2) { - if (t2) - e2 = t2; + }, r.Long.prototype.equals = function(t3) { + return this.low == t3.low && this.high == t3.high; + }, r.Long.ZERO = new r.Long(0, 0), r.Builder = function(t3) { + if (t3) + e2 = t3; else var e2 = 1024; this.bb = r.ByteBuffer.allocate(e2), this.space = e2, this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = false, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = false; }, r.Builder.prototype.clear = function() { this.bb.clear(), this.space = this.bb.capacity(), this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = false, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = false; - }, r.Builder.prototype.forceDefaults = function(t2) { - this.force_defaults = t2; + }, r.Builder.prototype.forceDefaults = function(t3) { + this.force_defaults = t3; }, r.Builder.prototype.dataBuffer = function() { return this.bb; }, r.Builder.prototype.asUint8Array = function() { return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset()); - }, r.Builder.prototype.prep = function(t2, e2) { - t2 > this.minalign && (this.minalign = t2); - for (var n2 = 1 + ~(this.bb.capacity() - this.space + e2) & t2 - 1; this.space < n2 + t2 + e2; ) { + }, r.Builder.prototype.prep = function(t3, e2) { + t3 > this.minalign && (this.minalign = t3); + for (var n2 = 1 + ~(this.bb.capacity() - this.space + e2) & t3 - 1; this.space < n2 + t3 + e2; ) { var i2 = this.bb.capacity(); this.bb = r.Builder.growByteBuffer(this.bb), this.space += this.bb.capacity() - i2; } this.pad(n2); - }, r.Builder.prototype.pad = function(t2) { - for (var e2 = 0; e2 < t2; e2++) + }, r.Builder.prototype.pad = function(t3) { + for (var e2 = 0; e2 < t3; e2++) this.bb.writeInt8(--this.space, 0); - }, r.Builder.prototype.writeInt8 = function(t2) { - this.bb.writeInt8(this.space -= 1, t2); - }, r.Builder.prototype.writeInt16 = function(t2) { - this.bb.writeInt16(this.space -= 2, t2); - }, r.Builder.prototype.writeInt32 = function(t2) { - this.bb.writeInt32(this.space -= 4, t2); - }, r.Builder.prototype.writeInt64 = function(t2) { - this.bb.writeInt64(this.space -= 8, t2); - }, r.Builder.prototype.writeFloat32 = function(t2) { - this.bb.writeFloat32(this.space -= 4, t2); - }, r.Builder.prototype.writeFloat64 = function(t2) { - this.bb.writeFloat64(this.space -= 8, t2); - }, r.Builder.prototype.addInt8 = function(t2) { - this.prep(1, 0), this.writeInt8(t2); - }, r.Builder.prototype.addInt16 = function(t2) { - this.prep(2, 0), this.writeInt16(t2); - }, r.Builder.prototype.addInt32 = function(t2) { - this.prep(4, 0), this.writeInt32(t2); - }, r.Builder.prototype.addInt64 = function(t2) { - this.prep(8, 0), this.writeInt64(t2); - }, r.Builder.prototype.addFloat32 = function(t2) { - this.prep(4, 0), this.writeFloat32(t2); - }, r.Builder.prototype.addFloat64 = function(t2) { - this.prep(8, 0), this.writeFloat64(t2); - }, r.Builder.prototype.addFieldInt8 = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addInt8(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldInt16 = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addInt16(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldInt32 = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addInt32(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldInt64 = function(t2, e2, n2) { - !this.force_defaults && e2.equals(n2) || (this.addInt64(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldFloat32 = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addFloat32(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldFloat64 = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addFloat64(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldOffset = function(t2, e2, n2) { - (this.force_defaults || e2 != n2) && (this.addOffset(e2), this.slot(t2)); - }, r.Builder.prototype.addFieldStruct = function(t2, e2, n2) { - e2 != n2 && (this.nested(e2), this.slot(t2)); - }, r.Builder.prototype.nested = function(t2) { - if (t2 != this.offset()) + }, r.Builder.prototype.writeInt8 = function(t3) { + this.bb.writeInt8(this.space -= 1, t3); + }, r.Builder.prototype.writeInt16 = function(t3) { + this.bb.writeInt16(this.space -= 2, t3); + }, r.Builder.prototype.writeInt32 = function(t3) { + this.bb.writeInt32(this.space -= 4, t3); + }, r.Builder.prototype.writeInt64 = function(t3) { + this.bb.writeInt64(this.space -= 8, t3); + }, r.Builder.prototype.writeFloat32 = function(t3) { + this.bb.writeFloat32(this.space -= 4, t3); + }, r.Builder.prototype.writeFloat64 = function(t3) { + this.bb.writeFloat64(this.space -= 8, t3); + }, r.Builder.prototype.addInt8 = function(t3) { + this.prep(1, 0), this.writeInt8(t3); + }, r.Builder.prototype.addInt16 = function(t3) { + this.prep(2, 0), this.writeInt16(t3); + }, r.Builder.prototype.addInt32 = function(t3) { + this.prep(4, 0), this.writeInt32(t3); + }, r.Builder.prototype.addInt64 = function(t3) { + this.prep(8, 0), this.writeInt64(t3); + }, r.Builder.prototype.addFloat32 = function(t3) { + this.prep(4, 0), this.writeFloat32(t3); + }, r.Builder.prototype.addFloat64 = function(t3) { + this.prep(8, 0), this.writeFloat64(t3); + }, r.Builder.prototype.addFieldInt8 = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addInt8(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldInt16 = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addInt16(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldInt32 = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addInt32(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldInt64 = function(t3, e2, n2) { + !this.force_defaults && e2.equals(n2) || (this.addInt64(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldFloat32 = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addFloat32(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldFloat64 = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addFloat64(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldOffset = function(t3, e2, n2) { + (this.force_defaults || e2 != n2) && (this.addOffset(e2), this.slot(t3)); + }, r.Builder.prototype.addFieldStruct = function(t3, e2, n2) { + e2 != n2 && (this.nested(e2), this.slot(t3)); + }, r.Builder.prototype.nested = function(t3) { + if (t3 != this.offset()) throw new Error("FlatBuffers: struct must be serialized inline."); }, r.Builder.prototype.notNested = function() { if (this.isNested) throw new Error("FlatBuffers: object serialization must not be nested."); - }, r.Builder.prototype.slot = function(t2) { - this.vtable[t2] = this.offset(); + }, r.Builder.prototype.slot = function(t3) { + this.vtable[t3] = this.offset(); }, r.Builder.prototype.offset = function() { return this.bb.capacity() - this.space; - }, r.Builder.growByteBuffer = function(t2) { - var e2 = t2.capacity(); + }, r.Builder.growByteBuffer = function(t3) { + var e2 = t3.capacity(); if (3221225472 & e2) throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes."); var n2 = e2 << 1, i2 = r.ByteBuffer.allocate(n2); - return i2.setPosition(n2 - e2), i2.bytes().set(t2.bytes(), n2 - e2), i2; - }, r.Builder.prototype.addOffset = function(t2) { - this.prep(r.SIZEOF_INT, 0), this.writeInt32(this.offset() - t2 + r.SIZEOF_INT); - }, r.Builder.prototype.startObject = function(t2) { - this.notNested(), null == this.vtable && (this.vtable = []), this.vtable_in_use = t2; - for (var e2 = 0; e2 < t2; e2++) + return i2.setPosition(n2 - e2), i2.bytes().set(t3.bytes(), n2 - e2), i2; + }, r.Builder.prototype.addOffset = function(t3) { + this.prep(r.SIZEOF_INT, 0), this.writeInt32(this.offset() - t3 + r.SIZEOF_INT); + }, r.Builder.prototype.startObject = function(t3) { + this.notNested(), null == this.vtable && (this.vtable = []), this.vtable_in_use = t3; + for (var e2 = 0; e2 < t3; e2++) this.vtable[e2] = 0; this.isNested = true, this.object_start = this.offset(); }, r.Builder.prototype.endObject = function() { if (null == this.vtable || !this.isNested) throw new Error("FlatBuffers: endObject called without startObject"); this.addInt32(0); - for (var t2 = this.offset(), e2 = this.vtable_in_use - 1; e2 >= 0 && 0 == this.vtable[e2]; e2--) + for (var t3 = this.offset(), e2 = this.vtable_in_use - 1; e2 >= 0 && 0 == this.vtable[e2]; e2--) ; for (var n2 = e2 + 1; e2 >= 0; e2--) - this.addInt16(0 != this.vtable[e2] ? t2 - this.vtable[e2] : 0); - this.addInt16(t2 - this.object_start); + this.addInt16(0 != this.vtable[e2] ? t3 - this.vtable[e2] : 0); + this.addInt16(t3 - this.object_start); var i2 = (n2 + 2) * r.SIZEOF_SHORT; this.addInt16(i2); var o = 0, a = this.space; @@ -15339,8 +16024,8 @@ ${t2}`); break; } } - return o ? (this.space = this.bb.capacity() - t2, this.bb.writeInt32(this.space, o - t2)) : (this.vtables.push(this.offset()), this.bb.writeInt32(this.bb.capacity() - t2, this.offset() - t2)), this.isNested = false, t2; - }, r.Builder.prototype.finish = function(t2, e2, n2) { + return o ? (this.space = this.bb.capacity() - t3, this.bb.writeInt32(this.space, o - t3)) : (this.vtables.push(this.offset()), this.bb.writeInt32(this.bb.capacity() - t3, this.offset() - t3)), this.isNested = false, t3; + }, r.Builder.prototype.finish = function(t3, e2, n2) { var i2 = n2 ? r.SIZE_PREFIX_LENGTH : 0; if (e2) { var o = e2; @@ -15349,151 +16034,151 @@ ${t2}`); for (var a = r.FILE_IDENTIFIER_LENGTH - 1; a >= 0; a--) this.writeInt8(o.charCodeAt(a)); } - this.prep(this.minalign, r.SIZEOF_INT + i2), this.addOffset(t2), i2 && this.addInt32(this.bb.capacity() - this.space), this.bb.setPosition(this.space); - }, r.Builder.prototype.finishSizePrefixed = function(t2, e2) { - this.finish(t2, e2, true); - }, r.Builder.prototype.requiredField = function(t2, e2) { - var n2 = this.bb.capacity() - t2, r2 = n2 - this.bb.readInt32(n2); + this.prep(this.minalign, r.SIZEOF_INT + i2), this.addOffset(t3), i2 && this.addInt32(this.bb.capacity() - this.space), this.bb.setPosition(this.space); + }, r.Builder.prototype.finishSizePrefixed = function(t3, e2) { + this.finish(t3, e2, true); + }, r.Builder.prototype.requiredField = function(t3, e2) { + var n2 = this.bb.capacity() - t3, r2 = n2 - this.bb.readInt32(n2); if (0 == this.bb.readInt16(r2 + e2)) throw new Error("FlatBuffers: field " + e2 + " must be set"); - }, r.Builder.prototype.startVector = function(t2, e2, n2) { - this.notNested(), this.vector_num_elems = e2, this.prep(r.SIZEOF_INT, t2 * e2), this.prep(n2, t2 * e2); + }, r.Builder.prototype.startVector = function(t3, e2, n2) { + this.notNested(), this.vector_num_elems = e2, this.prep(r.SIZEOF_INT, t3 * e2), this.prep(n2, t3 * e2); }, r.Builder.prototype.endVector = function() { return this.writeInt32(this.vector_num_elems), this.offset(); - }, r.Builder.prototype.createString = function(t2) { - if (t2 instanceof Uint8Array) - var e2 = t2; + }, r.Builder.prototype.createString = function(t3) { + if (t3 instanceof Uint8Array) + var e2 = t3; else { e2 = []; - for (var n2 = 0; n2 < t2.length; ) { - var r2, i2 = t2.charCodeAt(n2++); - (r2 = i2 < 55296 || i2 >= 56320 ? i2 : (i2 << 10) + t2.charCodeAt(n2++) + -56613888) < 128 ? e2.push(r2) : (r2 < 2048 ? e2.push(r2 >> 6 & 31 | 192) : (r2 < 65536 ? e2.push(r2 >> 12 & 15 | 224) : e2.push(r2 >> 18 & 7 | 240, r2 >> 12 & 63 | 128), e2.push(r2 >> 6 & 63 | 128)), e2.push(63 & r2 | 128)); + for (var n2 = 0; n2 < t3.length; ) { + var r2, i2 = t3.charCodeAt(n2++); + (r2 = i2 < 55296 || i2 >= 56320 ? i2 : (i2 << 10) + t3.charCodeAt(n2++) + -56613888) < 128 ? e2.push(r2) : (r2 < 2048 ? e2.push(r2 >> 6 & 31 | 192) : (r2 < 65536 ? e2.push(r2 >> 12 & 15 | 224) : e2.push(r2 >> 18 & 7 | 240, r2 >> 12 & 63 | 128), e2.push(r2 >> 6 & 63 | 128)), e2.push(63 & r2 | 128)); } } this.addInt8(0), this.startVector(1, e2.length, 1), this.bb.setPosition(this.space -= e2.length), n2 = 0; for (var o = this.space, a = this.bb.bytes(); n2 < e2.length; n2++) a[o++] = e2[n2]; return this.endVector(); - }, r.Builder.prototype.createLong = function(t2, e2) { - return r.Long.create(t2, e2); - }, r.ByteBuffer = function(t2) { - this.bytes_ = t2, this.position_ = 0; - }, r.ByteBuffer.allocate = function(t2) { - return new r.ByteBuffer(new Uint8Array(t2)); + }, r.Builder.prototype.createLong = function(t3, e2) { + return r.Long.create(t3, e2); + }, r.ByteBuffer = function(t3) { + this.bytes_ = t3, this.position_ = 0; + }, r.ByteBuffer.allocate = function(t3) { + return new r.ByteBuffer(new Uint8Array(t3)); }, r.ByteBuffer.prototype.clear = function() { this.position_ = 0; }, r.ByteBuffer.prototype.bytes = function() { return this.bytes_; }, r.ByteBuffer.prototype.position = function() { return this.position_; - }, r.ByteBuffer.prototype.setPosition = function(t2) { - this.position_ = t2; + }, r.ByteBuffer.prototype.setPosition = function(t3) { + this.position_ = t3; }, r.ByteBuffer.prototype.capacity = function() { return this.bytes_.length; - }, r.ByteBuffer.prototype.readInt8 = function(t2) { - return this.readUint8(t2) << 24 >> 24; - }, r.ByteBuffer.prototype.readUint8 = function(t2) { - return this.bytes_[t2]; - }, r.ByteBuffer.prototype.readInt16 = function(t2) { - return this.readUint16(t2) << 16 >> 16; - }, r.ByteBuffer.prototype.readUint16 = function(t2) { - return this.bytes_[t2] | this.bytes_[t2 + 1] << 8; - }, r.ByteBuffer.prototype.readInt32 = function(t2) { - return this.bytes_[t2] | this.bytes_[t2 + 1] << 8 | this.bytes_[t2 + 2] << 16 | this.bytes_[t2 + 3] << 24; - }, r.ByteBuffer.prototype.readUint32 = function(t2) { - return this.readInt32(t2) >>> 0; - }, r.ByteBuffer.prototype.readInt64 = function(t2) { - return new r.Long(this.readInt32(t2), this.readInt32(t2 + 4)); - }, r.ByteBuffer.prototype.readUint64 = function(t2) { - return new r.Long(this.readUint32(t2), this.readUint32(t2 + 4)); - }, r.ByteBuffer.prototype.readFloat32 = function(t2) { - return r.int32[0] = this.readInt32(t2), r.float32[0]; - }, r.ByteBuffer.prototype.readFloat64 = function(t2) { - return r.int32[r.isLittleEndian ? 0 : 1] = this.readInt32(t2), r.int32[r.isLittleEndian ? 1 : 0] = this.readInt32(t2 + 4), r.float64[0]; - }, r.ByteBuffer.prototype.writeInt8 = function(t2, e2) { - this.bytes_[t2] = e2; - }, r.ByteBuffer.prototype.writeUint8 = function(t2, e2) { - this.bytes_[t2] = e2; - }, r.ByteBuffer.prototype.writeInt16 = function(t2, e2) { - this.bytes_[t2] = e2, this.bytes_[t2 + 1] = e2 >> 8; - }, r.ByteBuffer.prototype.writeUint16 = function(t2, e2) { - this.bytes_[t2] = e2, this.bytes_[t2 + 1] = e2 >> 8; - }, r.ByteBuffer.prototype.writeInt32 = function(t2, e2) { - this.bytes_[t2] = e2, this.bytes_[t2 + 1] = e2 >> 8, this.bytes_[t2 + 2] = e2 >> 16, this.bytes_[t2 + 3] = e2 >> 24; - }, r.ByteBuffer.prototype.writeUint32 = function(t2, e2) { - this.bytes_[t2] = e2, this.bytes_[t2 + 1] = e2 >> 8, this.bytes_[t2 + 2] = e2 >> 16, this.bytes_[t2 + 3] = e2 >> 24; - }, r.ByteBuffer.prototype.writeInt64 = function(t2, e2) { - this.writeInt32(t2, e2.low), this.writeInt32(t2 + 4, e2.high); - }, r.ByteBuffer.prototype.writeUint64 = function(t2, e2) { - this.writeUint32(t2, e2.low), this.writeUint32(t2 + 4, e2.high); - }, r.ByteBuffer.prototype.writeFloat32 = function(t2, e2) { - r.float32[0] = e2, this.writeInt32(t2, r.int32[0]); - }, r.ByteBuffer.prototype.writeFloat64 = function(t2, e2) { - r.float64[0] = e2, this.writeInt32(t2, r.int32[r.isLittleEndian ? 0 : 1]), this.writeInt32(t2 + 4, r.int32[r.isLittleEndian ? 1 : 0]); + }, r.ByteBuffer.prototype.readInt8 = function(t3) { + return this.readUint8(t3) << 24 >> 24; + }, r.ByteBuffer.prototype.readUint8 = function(t3) { + return this.bytes_[t3]; + }, r.ByteBuffer.prototype.readInt16 = function(t3) { + return this.readUint16(t3) << 16 >> 16; + }, r.ByteBuffer.prototype.readUint16 = function(t3) { + return this.bytes_[t3] | this.bytes_[t3 + 1] << 8; + }, r.ByteBuffer.prototype.readInt32 = function(t3) { + return this.bytes_[t3] | this.bytes_[t3 + 1] << 8 | this.bytes_[t3 + 2] << 16 | this.bytes_[t3 + 3] << 24; + }, r.ByteBuffer.prototype.readUint32 = function(t3) { + return this.readInt32(t3) >>> 0; + }, r.ByteBuffer.prototype.readInt64 = function(t3) { + return new r.Long(this.readInt32(t3), this.readInt32(t3 + 4)); + }, r.ByteBuffer.prototype.readUint64 = function(t3) { + return new r.Long(this.readUint32(t3), this.readUint32(t3 + 4)); + }, r.ByteBuffer.prototype.readFloat32 = function(t3) { + return r.int32[0] = this.readInt32(t3), r.float32[0]; + }, r.ByteBuffer.prototype.readFloat64 = function(t3) { + return r.int32[r.isLittleEndian ? 0 : 1] = this.readInt32(t3), r.int32[r.isLittleEndian ? 1 : 0] = this.readInt32(t3 + 4), r.float64[0]; + }, r.ByteBuffer.prototype.writeInt8 = function(t3, e2) { + this.bytes_[t3] = e2; + }, r.ByteBuffer.prototype.writeUint8 = function(t3, e2) { + this.bytes_[t3] = e2; + }, r.ByteBuffer.prototype.writeInt16 = function(t3, e2) { + this.bytes_[t3] = e2, this.bytes_[t3 + 1] = e2 >> 8; + }, r.ByteBuffer.prototype.writeUint16 = function(t3, e2) { + this.bytes_[t3] = e2, this.bytes_[t3 + 1] = e2 >> 8; + }, r.ByteBuffer.prototype.writeInt32 = function(t3, e2) { + this.bytes_[t3] = e2, this.bytes_[t3 + 1] = e2 >> 8, this.bytes_[t3 + 2] = e2 >> 16, this.bytes_[t3 + 3] = e2 >> 24; + }, r.ByteBuffer.prototype.writeUint32 = function(t3, e2) { + this.bytes_[t3] = e2, this.bytes_[t3 + 1] = e2 >> 8, this.bytes_[t3 + 2] = e2 >> 16, this.bytes_[t3 + 3] = e2 >> 24; + }, r.ByteBuffer.prototype.writeInt64 = function(t3, e2) { + this.writeInt32(t3, e2.low), this.writeInt32(t3 + 4, e2.high); + }, r.ByteBuffer.prototype.writeUint64 = function(t3, e2) { + this.writeUint32(t3, e2.low), this.writeUint32(t3 + 4, e2.high); + }, r.ByteBuffer.prototype.writeFloat32 = function(t3, e2) { + r.float32[0] = e2, this.writeInt32(t3, r.int32[0]); + }, r.ByteBuffer.prototype.writeFloat64 = function(t3, e2) { + r.float64[0] = e2, this.writeInt32(t3, r.int32[r.isLittleEndian ? 0 : 1]), this.writeInt32(t3 + 4, r.int32[r.isLittleEndian ? 1 : 0]); }, r.ByteBuffer.prototype.getBufferIdentifier = function() { if (this.bytes_.length < this.position_ + r.SIZEOF_INT + r.FILE_IDENTIFIER_LENGTH) throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier."); - for (var t2 = "", e2 = 0; e2 < r.FILE_IDENTIFIER_LENGTH; e2++) - t2 += String.fromCharCode(this.readInt8(this.position_ + r.SIZEOF_INT + e2)); - return t2; - }, r.ByteBuffer.prototype.__offset = function(t2, e2) { - var n2 = t2 - this.readInt32(t2); + for (var t3 = "", e2 = 0; e2 < r.FILE_IDENTIFIER_LENGTH; e2++) + t3 += String.fromCharCode(this.readInt8(this.position_ + r.SIZEOF_INT + e2)); + return t3; + }, r.ByteBuffer.prototype.__offset = function(t3, e2) { + var n2 = t3 - this.readInt32(t3); return e2 < this.readInt16(n2) ? this.readInt16(n2 + e2) : 0; - }, r.ByteBuffer.prototype.__union = function(t2, e2) { - return t2.bb_pos = e2 + this.readInt32(e2), t2.bb = this, t2; - }, r.ByteBuffer.prototype.__string = function(t2, e2) { - t2 += this.readInt32(t2); - var n2 = this.readInt32(t2), i2 = "", o = 0; - if (t2 += r.SIZEOF_INT, e2 === r.Encoding.UTF8_BYTES) - return this.bytes_.subarray(t2, t2 + n2); + }, r.ByteBuffer.prototype.__union = function(t3, e2) { + return t3.bb_pos = e2 + this.readInt32(e2), t3.bb = this, t3; + }, r.ByteBuffer.prototype.__string = function(t3, e2) { + t3 += this.readInt32(t3); + var n2 = this.readInt32(t3), i2 = "", o = 0; + if (t3 += r.SIZEOF_INT, e2 === r.Encoding.UTF8_BYTES) + return this.bytes_.subarray(t3, t3 + n2); for (; o < n2; ) { - var a, s = this.readUint8(t2 + o++); + var a, s = this.readUint8(t3 + o++); if (s < 192) a = s; else { - var u = this.readUint8(t2 + o++); + var u = this.readUint8(t3 + o++); if (s < 224) a = (31 & s) << 6 | 63 & u; else { - var c = this.readUint8(t2 + o++); - a = s < 240 ? (15 & s) << 12 | (63 & u) << 6 | 63 & c : (7 & s) << 18 | (63 & u) << 12 | (63 & c) << 6 | 63 & this.readUint8(t2 + o++); + var c = this.readUint8(t3 + o++); + a = s < 240 ? (15 & s) << 12 | (63 & u) << 6 | 63 & c : (7 & s) << 18 | (63 & u) << 12 | (63 & c) << 6 | 63 & this.readUint8(t3 + o++); } } a < 65536 ? i2 += String.fromCharCode(a) : (a -= 65536, i2 += String.fromCharCode(55296 + (a >> 10), 56320 + (1023 & a))); } return i2; - }, r.ByteBuffer.prototype.__indirect = function(t2) { - return t2 + this.readInt32(t2); - }, r.ByteBuffer.prototype.__vector = function(t2) { - return t2 + this.readInt32(t2) + r.SIZEOF_INT; - }, r.ByteBuffer.prototype.__vector_len = function(t2) { - return this.readInt32(t2 + this.readInt32(t2)); - }, r.ByteBuffer.prototype.__has_identifier = function(t2) { - if (t2.length != r.FILE_IDENTIFIER_LENGTH) + }, r.ByteBuffer.prototype.__indirect = function(t3) { + return t3 + this.readInt32(t3); + }, r.ByteBuffer.prototype.__vector = function(t3) { + return t3 + this.readInt32(t3) + r.SIZEOF_INT; + }, r.ByteBuffer.prototype.__vector_len = function(t3) { + return this.readInt32(t3 + this.readInt32(t3)); + }, r.ByteBuffer.prototype.__has_identifier = function(t3) { + if (t3.length != r.FILE_IDENTIFIER_LENGTH) throw new Error("FlatBuffers: file identifier must be length " + r.FILE_IDENTIFIER_LENGTH); for (var e2 = 0; e2 < r.FILE_IDENTIFIER_LENGTH; e2++) - if (t2.charCodeAt(e2) != this.readInt8(this.position_ + r.SIZEOF_INT + e2)) + if (t3.charCodeAt(e2) != this.readInt8(this.position_ + r.SIZEOF_INT + e2)) return false; return true; - }, r.ByteBuffer.prototype.createLong = function(t2, e2) { - return r.Long.create(t2, e2); + }, r.ByteBuffer.prototype.createLong = function(t3, e2) { + return r.Long.create(t3, e2); }; } }, __webpack_module_cache__ = {}; - function __webpack_require__(t) { - var e = __webpack_module_cache__[t]; + function __webpack_require__(t2) { + var e = __webpack_module_cache__[t2]; if (void 0 !== e) return e.exports; - var n = __webpack_module_cache__[t] = { exports: {} }; - return __webpack_modules__[t].call(n.exports, n, n.exports, __webpack_require__), n.exports; + var n = __webpack_module_cache__[t2] = { exports: {} }; + return __webpack_modules__[t2].call(n.exports, n, n.exports, __webpack_require__), n.exports; } - __webpack_require__.n = (t) => { - var e = t && t.__esModule ? () => t.default : () => t; + __webpack_require__.n = (t2) => { + var e = t2 && t2.__esModule ? () => t2.default : () => t2; return __webpack_require__.d(e, { a: e }), e; - }, __webpack_require__.d = (t, e) => { + }, __webpack_require__.d = (t2, e) => { for (var n in e) - __webpack_require__.o(e, n) && !__webpack_require__.o(t, n) && Object.defineProperty(t, n, { enumerable: true, get: e[n] }); - }, __webpack_require__.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), __webpack_require__.r = (t) => { - "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: true }); + __webpack_require__.o(e, n) && !__webpack_require__.o(t2, n) && Object.defineProperty(t2, n, { enumerable: true, get: e[n] }); + }, __webpack_require__.o = (t2, e) => Object.prototype.hasOwnProperty.call(t2, e), __webpack_require__.r = (t2) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); }; var __webpack_exports__ = __webpack_require__(6018), __webpack_export_target__ = exports; for (var i in __webpack_exports__) @@ -16015,11 +16700,11 @@ function interpolate_data(input, [in_channels, in_height, in_width], [out_height x1 = Math.max(x1, 0); y1 = Math.max(y1, 0); const s = x - x1; - const t = y - y1; - const w1 = (1 - s) * (1 - t); - const w2 = s * (1 - t); - const w3 = (1 - s) * t; - const w4 = s * t; + const t2 = y - y1; + const w1 = (1 - s) * (1 - t2); + const w2 = s * (1 - t2); + const w3 = (1 - s) * t2; + const w4 = s * t2; const yStride = y1 * in_width; const xStride = y2 * in_width; const idx1 = yStride + x1; @@ -16177,7 +16862,7 @@ var init_maths = __esm({ this.table[i2 + 1] = -Math.sin(angle); } let power = 0; - for (let t = 1; this.size > t; t <<= 1) + for (let t2 = 1; this.size > t2; t2 <<= 1) ++power; this._width = power % 2 === 0 ? power - 1 : power; this._bitrev = new Int32Array(1 << this._width); @@ -16300,16 +16985,16 @@ var init_maths = __esm({ let step = 1 << width; let len = size / step << 1; let outOff; - let t; + let t2; const bitrev = this._bitrev; if (len === 4) { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; + for (outOff = 0, t2 = 0; outOff < size; outOff += len, ++t2) { + const off = bitrev[t2]; this._singleTransform2(data, out, outOff, off, step); } } else { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; + for (outOff = 0, t2 = 0; outOff < size; outOff += len, ++t2) { + const off = bitrev[t2]; this._singleTransform4(data, out, outOff, off, step, inv); } } @@ -16436,16 +17121,16 @@ var init_maths = __esm({ let step = 1 << width; let len = size / step << 1; let outOff; - let t; + let t2; const bitrev = this._bitrev; if (len === 4) { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; + for (outOff = 0, t2 = 0; outOff < size; outOff += len, ++t2) { + const off = bitrev[t2]; this._singleRealTransform2(data, out, outOff, off >>> 1, step >>> 1); } } else { - for (outOff = 0, t = 0; outOff < size; outOff += len, ++t) { - const off = bitrev[t]; + for (outOff = 0, t2 = 0; outOff < size; outOff += len, ++t2) { + const off = bitrev[t2]; this._singleRealTransform4(data, out, outOff, off >>> 1, step >>> 1, inv); } } @@ -16797,14 +17482,14 @@ function cat(tensors, dim = 0) { const resultType = tensors[0].type; if (dim === 0) { let offset = 0; - for (let t of tensors) { - result.set(t.data, offset); - offset += t.data.length; + for (let t2 of tensors) { + result.set(t2.data, offset); + offset += t2.data.length; } } else { let currentDim = 0; - for (let t = 0; t < tensors.length; ++t) { - let tensor = tensors[t]; + for (let t2 = 0; t2 < tensors.length; ++t2) { + let tensor = tensors[t2]; for (let i2 = 0; i2 < tensor.data.length; ++i2) { let resultIndex = 0; for (let j = tensor.dims.length - 1, num = i2, resultMultiplier = 1; j >= 0; --j) { @@ -16825,7 +17510,7 @@ function cat(tensors, dim = 0) { return new Tensor(resultType, result, resultDims); } function stack(tensors, dim = 0) { - return cat(tensors.map((t) => t.unsqueeze(dim)), dim); + return cat(tensors.map((t2) => t2.unsqueeze(dim)), dim); } function std_mean(input, dim = null, correction = 1, keepdim = false) { if (dim === null) { @@ -16920,19 +17605,19 @@ function dynamicTimeWarping(matrix) { const c0 = cost[i3 - 1][j2 - 1].item(); const c1 = cost[i3 - 1][j2].item(); const c2 = cost[i3][j2 - 1].item(); - let c, t; + let c, t2; if (c0 < c1 && c0 < c2) { c = c0; - t = 0; + t2 = 0; } else if (c1 < c0 && c1 < c2) { c = c1; - t = 1; + t2 = 1; } else { c = c2; - t = 2; + t2 = 2; } cost[i3].data[j2] = matrix[i3 - 1][j2 - 1].item() + c; - trace[i3].data[j2] = t; + trace[i3].data[j2] = t2; } } let i2 = output_length; @@ -16946,8 +17631,8 @@ function dynamicTimeWarping(matrix) { while (i2 > 0 || j > 0) { text_indices.push(i2 - 1); time_indices.push(j - 1); - const t = trace[i2][j].item(); - switch (t) { + const t2 = trace[i2][j].item(); + switch (t2) { case 0: --i2; --j; @@ -19704,7 +20389,7 @@ var init_tokenizers = __esm({ * @returns {number[]} The converted token IDs. */ convert_tokens_to_ids(tokens) { - return tokens.map((t) => this.tokens_to_ids.get(t) ?? this.unk_token_id); + return tokens.map((t2) => this.tokens_to_ids.get(t2) ?? this.unk_token_id); } /** * Converts a list of token IDs into a list of tokens. @@ -20031,13 +20716,13 @@ var init_tokenizers = __esm({ continue; } const bpe_token_list = this.bpe(token); - for (const t of bpe_token_list) { - if (this.tokens_to_ids.has(t)) { - outputTokens.push(t); + for (const t2 of bpe_token_list) { + if (this.tokens_to_ids.has(t2)) { + outputTokens.push(t2); } else { if (this.byte_fallback) { outputTokens.push( - ...Array.from(this.text_encoder.encode(t)).map((x) => `<0x${x.toString(16).toUpperCase().padStart(2, "0")}>`) + ...Array.from(this.text_encoder.encode(t2)).map((x) => `<0x${x.toString(16).toUpperCase().padStart(2, "0")}>`) ); } else { outputTokens.push(this.unk_token); @@ -20254,8 +20939,8 @@ var init_tokenizers = __esm({ * @returns {string} The normalized text. */ normalize(text) { - return this.normalizers.reduce((t, normalizer) => { - return normalizer.normalize(t); + return this.normalizers.reduce((t2, normalizer) => { + return normalizer.normalize(t2); }, text); } }; @@ -21390,7 +22075,7 @@ var init_tokenizers = __esm({ throw Error("text and text_pair must have the same length"); } encodedTokens = text.map( - (t, i2) => this._encode_plus(t, text_pair[i2], { add_special_tokens, return_token_type_ids }) + (t2, i2) => this._encode_plus(t2, text_pair[i2], { add_special_tokens, return_token_type_ids }) ); } else { encodedTokens = text.map((x) => this._encode_plus(x, null, { add_special_tokens, return_token_type_ids })); @@ -21486,7 +22171,7 @@ var init_tokenizers = __esm({ return null; const sections = this.added_tokens_regex ? text.split(this.added_tokens_regex).filter((x) => x) : [text]; const tokens = sections.map((x, section_index) => { - const addedToken = this.added_tokens.find((t) => t.content === x); + const addedToken = this.added_tokens.find((t2) => t2.content === x); if (addedToken !== void 0) { return x; } else { @@ -31770,11 +32455,13 @@ __export(main_exports, { default: () => PseudObsPlugin }); module.exports = __toCommonJS(main_exports); -var import_obsidian11 = require("obsidian"); +var import_obsidian12 = require("obsidian"); +init_i18n(); init_settings(); // src/ui/RuleModal.ts var import_obsidian3 = require("obsidian"); +init_i18n(); // src/mappings/MappingStore.ts function generateId() { @@ -31913,9 +32600,9 @@ var RuleModal = class extends import_obsidian3.Modal { } onOpen() { const { contentEl } = this; - contentEl.createEl("h2", { text: "Cr\xE9er une r\xE8gle de remplacement" }); - new import_obsidian3.Setting(contentEl).setName("Source").setDesc("Terme original \xE0 remplacer").addText( - (t) => t.setValue(this.source).onChange((v) => { + contentEl.createEl("h2", { text: t("ruleModal.title") }); + new import_obsidian3.Setting(contentEl).setName(t("ruleModal.source")).setDesc(t("ruleModal.sourceDesc")).addText( + (tx) => tx.setValue(this.source).onChange((v) => { this.source = v; }) ); @@ -31923,7 +32610,7 @@ var RuleModal = class extends import_obsidian3.Modal { if (this.coulomontSuggestions.length > 0) { const box = contentEl.createDiv(); box.addClass("pseudobs-suggestions-box"); - box.createEl("small", { text: "Suggestions de pr\xE9noms \xE9quivalents \u2014 choisissez :" }).addClass("pseudobs-suggestions-label"); + box.createEl("small", { text: t("ruleModal.coulomontLabel") }).addClass("pseudobs-suggestions-label"); const tags = box.createDiv(); tags.addClass("pseudobs-suggestions-tags"); const btnEls = []; @@ -31950,10 +32637,10 @@ var RuleModal = class extends import_obsidian3.Modal { box.addClass("pseudobs-suggestions-box"); const label = box.createEl("small"); label.addClass("pseudobs-suggestions-label"); - label.setText(`Dictionnaire : "${this.source}" \u2192 classe ${this.dictEntryClass}`); + label.setText(t("ruleModal.dictLabel", this.source, this.dictEntryClass)); const row = box.createDiv(); row.addClass("pseudobs-suggestions-tags"); - const classBtn = row.createEl("button", { text: `Utiliser "${preview}" (port\xE9e : ${scope})` }); + const classBtn = row.createEl("button", { text: t("ruleModal.dictUseClass", preview, scope) }); classBtn.addClass("pseudobs-suggestion-btn"); classBtn.addEventListener("click", () => { this.useClass = true; @@ -31968,34 +32655,23 @@ var RuleModal = class extends import_obsidian3.Modal { classBtn.addClass("pseudobs-suggestion-btn-selected"); } } - new import_obsidian3.Setting(contentEl).setName("Remplacement").setDesc( - this.dictEntryClass ? "L'index exact sera calcul\xE9 \xE0 la cr\xE9ation selon les r\xE8gles existantes dans la port\xE9e." : "Pseudonyme ou cat\xE9gorie analytique" - ).addText((t) => { + new import_obsidian3.Setting(contentEl).setName(t("ruleModal.replacement")).setDesc(this.dictEntryClass ? t("ruleModal.replacementDescClass") : t("ruleModal.replacementDesc")).addText((tx) => { const preview = this.dictEntryClass ? (this.plugin.dictionaryLoader?.getById(this.dictId ?? "")?.config?.replacementPattern ?? "{class}_{index}").replace("{class}", this.dictEntryClass).replace("{index}", "N") : this.replacement; - t.setValue(preview).onChange((v) => { + tx.setValue(preview).onChange((v) => { this.replacement = v; this.useClass = false; }); - replacementInput = t.inputEl; + replacementInput = tx.inputEl; }); - new import_obsidian3.Setting(contentEl).setName("Cat\xE9gorie").addDropdown((d) => { - const options = { - first_name: "Pr\xE9nom", - last_name: "Nom de famille", - full_name: "Nom complet", - place: "Lieu", - institution: "Institution", - date: "Date", - age: "\xC2ge", - profession: "Profession", - custom: "Autre" - }; - for (const [value, label] of Object.entries(options)) { - d.addOption(value, label); + new import_obsidian3.Setting(contentEl).setName(t("ruleModal.category")).addDropdown((d) => { + const cats = ["first_name", "last_name", "full_name", "place", "institution", "date", "age", "profession", "custom"]; + for (const cat2 of cats) { + d.addOption(cat2, t(`category.${cat2}`)); } d.setValue(this.category); d.onChange((v) => { this.category = v; + updateBroadScopeWarning(); }); if (this.coulomontSuggestions.length > 0) { const settingItem = d.selectEl.closest(".setting-item"); @@ -32003,32 +32679,56 @@ var RuleModal = class extends import_obsidian3.Modal { settingItem.hide(); } }); - new import_obsidian3.Setting(contentEl).setName("Port\xE9e").addDropdown((d) => { - d.addOption("file", "Ce fichier uniquement"); - d.addOption("folder", "Ce dossier"); - d.addOption("vault", "Tout le vault"); + new import_obsidian3.Setting(contentEl).setName(t("ruleModal.scope")).addDropdown((d) => { + d.addOption("file", t("ruleModal.scopeFile")); + d.addOption("folder", t("ruleModal.scopeFolder")); + d.addOption("vault", t("ruleModal.scopeVault")); d.setValue("file"); d.onChange((v) => { this.scopeType = v; + updateBroadScopeWarning(); }); }); - new import_obsidian3.Setting(contentEl).setName("Priorit\xE9").setDesc("Entier libre, comme un z-index CSS \u2014 d\xE9faut 0, plus grand = appliqu\xE9 en premier").addText( - (t) => t.setValue("0").onChange((v) => { + const calloutEl = contentEl.createDiv(); + calloutEl.hide(); + const isNameCategory = () => ["first_name", "last_name", "full_name"].includes(this.category); + const isBroadScope = () => this.scopeType !== "file"; + const updateBroadScopeWarning = () => { + if (!isNameCategory()) { + calloutEl.hide(); + return; + } + calloutEl.empty(); + calloutEl.show(); + if (isBroadScope()) { + calloutEl.setAttribute("data-callout", "warning"); + calloutEl.className = "callout pseudobs-rule-callout"; + calloutEl.createDiv("callout-title").createSpan({ text: t("ruleModal.scopeWarnTitle") }); + calloutEl.createDiv("callout-content").createEl("p", { text: t("panel.mappings.warnBroadName") }); + } else { + calloutEl.setAttribute("data-callout", "success"); + calloutEl.className = "callout pseudobs-rule-callout"; + calloutEl.createDiv("callout-title").createSpan({ text: t("ruleModal.scopeOkTitle") }); + calloutEl.createDiv("callout-content").createEl("p", { text: t("ruleModal.scopeOk") }); + } + }; + new import_obsidian3.Setting(contentEl).setName(t("ruleModal.priority")).setDesc(t("ruleModal.priorityDesc")).addText( + (tx) => tx.setValue("0").onChange((v) => { this.priority = parseInt(v, 10) || 0; }) ); new import_obsidian3.Setting(contentEl).addButton( - (btn) => btn.setButtonText("Cr\xE9er la r\xE8gle").setCta().onClick(() => void this.createRule()) + (btn) => btn.setButtonText(t("ruleModal.submit")).setCta().onClick(() => void this.createRule()) ); } async createRule() { if (!this.source.trim()) { - new import_obsidian3.Notice("La source est obligatoire."); + new import_obsidian3.Notice(t("ruleModal.errorMissing")); return; } const activeFile = this.app.workspace.getActiveFile(); if (!activeFile) { - new import_obsidian3.Notice("Aucun fichier actif."); + new import_obsidian3.Notice(t("ruleModal.errorNoFile")); return; } if (this.useClass && this.dictEntryClass && this.dictId) { @@ -32044,7 +32744,7 @@ var RuleModal = class extends import_obsidian3.Modal { } } if (!this.replacement.trim()) { - new import_obsidian3.Notice("Le remplacement est obligatoire."); + new import_obsidian3.Notice(t("ruleModal.errorMissing")); return; } const mappingPath = `${this.plugin.settings.mappingFolder}/${activeFile.basename}.mapping.json`; @@ -32074,7 +32774,7 @@ var RuleModal = class extends import_obsidian3.Modal { } else { await this.app.vault.create(mappingPath, json); } - new import_obsidian3.Notice(`\u2713 R\xE8gle cr\xE9\xE9e : "${this.source.trim()}" \u2192 "${this.replacement.trim()}"`); + new import_obsidian3.Notice(t("notice.ruleCreated", this.source.trim(), this.replacement.trim())); void this.plugin.refreshHighlightData(); this.close(); } @@ -32117,6 +32817,7 @@ var RuleModal = class extends import_obsidian3.Modal { // src/ui/QuickPseudonymizeModal.ts var import_obsidian4 = require("obsidian"); +init_i18n(); var QuickPseudonymizeModal = class extends import_obsidian4.Modal { constructor(app, plugin, editor, prefillReplacement = "", suggestions = []) { super(app); @@ -32135,22 +32836,19 @@ var QuickPseudonymizeModal = class extends import_obsidian4.Modal { } onOpen() { const { contentEl } = this; - contentEl.createEl("h2", { text: "Pseudonymiser" }); - new import_obsidian4.Setting(contentEl).setName("Expression s\xE9lectionn\xE9e").setDesc("Terme \xE0 remplacer \u2014 non modifiable").addText((t) => { - t.setValue(this.source).setDisabled(true); - t.inputEl.addClass("pseudobs-disabled-input"); + contentEl.createEl("h2", { text: t("quickModal.title") }); + new import_obsidian4.Setting(contentEl).setName(t("quickModal.source")).setDesc(t("quickModal.sourceDesc")).addText((tx) => { + tx.setValue(this.source).setDisabled(true); + tx.inputEl.addClass("pseudobs-disabled-input"); }); let replacementInput; if (this.suggestions.length > 0) { - const suggBox = contentEl.createDiv(); - suggBox.addClass("pseudobs-suggestions-box"); - suggBox.createEl("small", { text: "Suggestions de pr\xE9noms \xE9quivalents (m/f non diff\xE9renci\xE9s) :" }).addClass("pseudobs-suggestions-label"); - const tags = suggBox.createDiv(); - tags.addClass("pseudobs-suggestions-tags"); + const suggBox = contentEl.createDiv("pseudobs-suggestions-box"); + suggBox.createEl("small", { text: t("ruleModal.coulomontLabel") }).addClass("pseudobs-suggestions-label"); + const tags = suggBox.createDiv("pseudobs-suggestions-tags"); const btnEls = []; for (const name2 of this.suggestions) { - const btn = tags.createEl("button", { text: name2 }); - btn.addClass("pseudobs-suggestion-btn"); + const btn = tags.createEl("button", { text: name2, cls: "pseudobs-suggestion-btn" }); btn.addEventListener("click", () => { this.replacement = name2; if (replacementInput) { @@ -32163,50 +32861,39 @@ var QuickPseudonymizeModal = class extends import_obsidian4.Modal { btnEls.push(btn); } } - new import_obsidian4.Setting(contentEl).setName("Remplacer par").addText((t) => { - t.setPlaceholder("Pseudonyme ou cat\xE9gorie analytique"); - t.setValue(this.replacement); - t.onChange((v) => this.replacement = v); - replacementInput = t.inputEl; + new import_obsidian4.Setting(contentEl).setName(t("quickModal.replaceBy")).addText((tx) => { + tx.setPlaceholder(t("quickModal.replacementPlaceholder")); + tx.setValue(this.replacement); + tx.onChange((v) => this.replacement = v); + replacementInput = tx.inputEl; }); - new import_obsidian4.Setting(contentEl).setName("Cat\xE9gorie").addDropdown((d) => { - const options = { - first_name: "Pr\xE9nom", - last_name: "Nom de famille", - full_name: "Nom complet", - place: "Lieu", - institution: "Institution", - date: "Date", - age: "\xC2ge", - profession: "Profession", - custom: "Autre" - }; - for (const [value, label] of Object.entries(options)) { - d.addOption(value, label); - } + new import_obsidian4.Setting(contentEl).setName(t("ruleModal.category")).addDropdown((d) => { + const cats = ["first_name", "last_name", "full_name", "place", "institution", "date", "age", "profession", "custom"]; + for (const cat2 of cats) + d.addOption(cat2, t(`category.${cat2}`)); d.setValue("custom"); d.onChange((v) => this.category = v); }); - new import_obsidian4.Setting(contentEl).setName("Port\xE9e du remplacement").addDropdown((d) => { - d.addOption("file", "Toutes les occurrences dans ce fichier"); - d.addOption("occurrence", "Cette occurrence uniquement"); + new import_obsidian4.Setting(contentEl).setName(t("quickModal.scope")).addDropdown((d) => { + d.addOption("file", t("quickModal.scopeFile")); + d.addOption("occurrence", t("quickModal.scopeOccurrence")); d.setValue("file"); d.onChange((v) => this.applyScope = v); }); new import_obsidian4.Setting(contentEl).addButton( - (btn) => btn.setButtonText("Pseudonymiser").setCta().onClick(() => this.apply()) + (btn) => btn.setButtonText(t("quickModal.submit")).setCta().onClick(() => void this.apply()) ); window.setTimeout(() => replacementInput?.focus(), 50); } async apply() { const replacement = this.replacement.trim(); if (!replacement) { - new import_obsidian4.Notice("Le remplacement est obligatoire."); + new import_obsidian4.Notice(t("ruleModal.errorMissing")); return; } const activeFile = this.app.workspace.getActiveFile(); if (!activeFile) { - new import_obsidian4.Notice("Aucun fichier actif."); + new import_obsidian4.Notice(t("notice.noActiveFile")); return; } await this.saveRule(activeFile, replacement); @@ -32214,10 +32901,10 @@ var QuickPseudonymizeModal = class extends import_obsidian4.Modal { const marked = s.useMarkerInExport ? `${s.markerOpen}${replacement}${s.markerClose}` : replacement; if (this.applyScope === "occurrence") { this.editor.replaceRange(marked, this.from, this.to); - new import_obsidian4.Notice(`\u2713 "${this.source}" \u2192 "${marked}" (cette occurrence)`); + new import_obsidian4.Notice(t("notice.appliedOccurrence", this.source, marked)); } else { const count = await this.plugin.applyRuleToFile(activeFile, this.source, marked); - new import_obsidian4.Notice(`\u2713 "${this.source}" \u2192 "${marked}" (${count} occurrence${count > 1 ? "s" : ""})`); + new import_obsidian4.Notice(t("notice.appliedFile", this.source, marked, String(count), count > 1 ? "s" : "")); } void this.plugin.refreshHighlightData(); this.close(); @@ -32267,7 +32954,7 @@ function createPseudonymHighlighter(getData) { } update(update) { const dataChanged = update.transactions.some( - (t) => t.effects.some((e) => e.is(highlightDataChanged)) + (t2) => t2.effects.some((e) => e.is(highlightDataChanged)) ); if (update.docChanged || update.viewportChanged || dataChanged) { this.decorations = this.build(update.view); @@ -32327,6 +33014,7 @@ function createPseudonymHighlighter(getData) { // src/ui/EditRuleModal.ts var import_obsidian5 = require("obsidian"); +init_i18n(); var EditRuleModal = class extends import_obsidian5.Modal { constructor(app, plugin, location) { super(app); @@ -32341,50 +33029,74 @@ var EditRuleModal = class extends import_obsidian5.Modal { onOpen() { const { contentEl } = this; const { rule } = this.location; - contentEl.createEl("h2", { text: "Modifier la r\xE8gle" }); - new import_obsidian5.Setting(contentEl).setName("Source").setDesc("Non modifiable \u2014 cr\xE9ez une nouvelle r\xE8gle pour changer la source").addText((t) => { - t.setValue(rule.source).setDisabled(true); - t.inputEl.addClass("pseudobs-disabled-input"); + contentEl.createEl("h2", { text: t("ruleModal.title") }); + new import_obsidian5.Setting(contentEl).setName(t("ruleModal.source")).setDesc("Non modifiable \u2014 cr\xE9ez une nouvelle r\xE8gle pour changer la source").addText((tx) => { + tx.setValue(rule.source).setDisabled(true); + tx.inputEl.addClass("pseudobs-disabled-input"); }); - new import_obsidian5.Setting(contentEl).setName("Remplacement").addText( - (t) => t.setValue(this.replacement).onChange((v) => this.replacement = v) + new import_obsidian5.Setting(contentEl).setName(t("ruleModal.replacement")).addText( + (tx) => tx.setValue(this.replacement).onChange((v) => this.replacement = v) ); - new import_obsidian5.Setting(contentEl).setName("Cat\xE9gorie").addDropdown((d) => { - const options = { - first_name: "Pr\xE9nom", - last_name: "Nom de famille", - full_name: "Nom complet", - place: "Lieu", - institution: "Institution", - date: "Date", - age: "\xC2ge", - profession: "Profession", - custom: "Autre" - }; - for (const [value, label] of Object.entries(options)) - d.addOption(value, label); + new import_obsidian5.Setting(contentEl).setName(t("ruleModal.category")).addDropdown((d) => { + const cats = ["first_name", "last_name", "full_name", "place", "institution", "date", "age", "profession", "custom"]; + for (const cat2 of cats) + d.addOption(cat2, t(`category.${cat2}`)); d.setValue(this.category); - d.onChange((v) => this.category = v); + d.onChange((v) => { + this.category = v; + updateWarn(); + }); }); - new import_obsidian5.Setting(contentEl).setName("Port\xE9e").addDropdown((d) => { - d.addOption("file", "Ce fichier uniquement"); - d.addOption("folder", "Ce dossier"); - d.addOption("vault", "Tout le vault"); + new import_obsidian5.Setting(contentEl).setName(t("ruleModal.scope")).addDropdown((d) => { + d.addOption("file", t("ruleModal.scopeFile")); + d.addOption("folder", t("ruleModal.scopeFolder")); + d.addOption("vault", t("ruleModal.scopeVault")); d.setValue(this.scopeType); - d.onChange((v) => this.scopeType = v); + d.onChange((v) => { + this.scopeType = v; + updateWarn(); + }); }); - new import_obsidian5.Setting(contentEl).setName("Priorit\xE9").setDesc("Entier libre, comme un z-index CSS \u2014 d\xE9faut 0").addText( - (t) => t.setValue(String(this.priority)).onChange((v) => this.priority = parseInt(v, 10) || 0) + const calloutEl = contentEl.createDiv(); + const isNameCat = () => ["first_name", "last_name", "full_name"].includes(this.category); + const isBroad = () => this.scopeType !== "file"; + const updateWarn = () => { + if (!isNameCat()) { + calloutEl.hide(); + return; + } + calloutEl.empty(); + calloutEl.show(); + if (isBroad()) { + calloutEl.setAttribute("data-callout", "warning"); + calloutEl.className = "callout pseudobs-rule-callout"; + calloutEl.createDiv("callout-title").createSpan({ text: t("ruleModal.scopeWarnTitle") }); + calloutEl.createDiv("callout-content").createEl("p", { text: t("panel.mappings.warnBroadName") }); + } else { + calloutEl.setAttribute("data-callout", "success"); + calloutEl.className = "callout pseudobs-rule-callout"; + calloutEl.createDiv("callout-title").createSpan({ text: t("ruleModal.scopeOkTitle") }); + calloutEl.createDiv("callout-content").createEl("p", { text: t("ruleModal.scopeOk") }); + } + }; + if (isNameCat()) { + calloutEl.show(); + updateWarn(); + } else { + calloutEl.hide(); + } + new import_obsidian5.Setting(contentEl).setName(t("ruleModal.priority")).setDesc(t("ruleModal.priorityDesc")).addText( + (tx) => tx.setValue(String(this.priority)).onChange((v) => this.priority = parseInt(v, 10) || 0) ); new import_obsidian5.Setting(contentEl).addButton( - (btn) => btn.setButtonText("Enregistrer").setCta().onClick(() => this.save()) + (btn) => btn.setButtonText(t("panel.ner.save")).setCta().onClick(() => void this.save()) ).addButton( - (btn) => btn.setButtonText("Supprimer la r\xE8gle").setWarning().onClick(() => this.delete()) + (btn) => btn.setButtonText(t("ruleModal.delete")).setWarning().onClick(() => void this.delete()) ); } async save() { if (!this.replacement.trim()) { - new import_obsidian5.Notice("Le remplacement est obligatoire."); + new import_obsidian5.Notice(t("ruleModal.errorMissing")); return; } const { store, filePath, rule } = this.location; @@ -32395,7 +33107,7 @@ var EditRuleModal = class extends import_obsidian5.Modal { priority: this.priority }); await this.plugin.scopeResolver.saveStore(store, filePath); - new import_obsidian5.Notice(`\u2713 R\xE8gle mise \xE0 jour : "${rule.source}" \u2192 "${this.replacement.trim()}"`); + new import_obsidian5.Notice(t("notice.ruleCreated", rule.source, this.replacement.trim())); void this.plugin.refreshHighlightData(); this.close(); } @@ -32403,7 +33115,7 @@ var EditRuleModal = class extends import_obsidian5.Modal { const { store, filePath, rule } = this.location; store.remove(rule.id); await this.plugin.scopeResolver.saveStore(store, filePath); - new import_obsidian5.Notice(`\u2713 R\xE8gle supprim\xE9e : "${rule.source}"`); + new import_obsidian5.Notice(`\u2713 "${rule.source}"`); void this.plugin.refreshHighlightData(); this.close(); } @@ -32414,6 +33126,7 @@ var EditRuleModal = class extends import_obsidian5.Modal { // src/ui/PseudonymizationView.ts var import_obsidian7 = require("obsidian"); +init_i18n(); // src/pseudonymizer/ReplacementPlanner.ts var DEFAULT_PLANNER_SETTINGS = { @@ -32513,6 +33226,7 @@ function scanOccurrences(content, filePath, rules, settings = DEFAULT_PLANNER_SE // src/ui/MappingScanReviewModal.ts var import_obsidian6 = require("obsidian"); +init_i18n(); // src/pseudonymizer/SpanProtector.ts function resolveSpans(candidates) { @@ -32558,20 +33272,18 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { this.modalEl.addClass("pseudobs-modal-review-outer"); const { contentEl } = this; contentEl.addClass("pseudobs-dict-review-modal"); - contentEl.createEl("h2", { text: "R\xE9vision du scan \u2014 mappings" }); + contentEl.createEl("h2", { text: t("mappingScanModal.title") }); + const nr = this.ruleResults.length; contentEl.createEl("p", { - text: `${this.ruleResults.length} r\xE8gle${this.ruleResults.length > 1 ? "s" : ""} active${this.ruleResults.length > 1 ? "s" : ""} avec des occurrences dans "${this.file.name}"`, + text: t("mappingScanModal.summary", String(nr), nr > 1 ? t("mappingScanModal.summary.rules") : t("mappingScanModal.summary.rule"), this.file.name), cls: "pseudobs-scan-summary" }); - contentEl.createEl("p", { - text: "D\xE9cochez les r\xE8gles \xE0 ne pas appliquer. Les remplacements seront \xE9crits dans le fichier source.", - cls: "pseudobs-view-hint" - }); + contentEl.createEl("p", { text: t("mappingScanModal.hint"), cls: "pseudobs-view-hint" }); const scroll = contentEl.createDiv("pseudobs-dict-review-scroll"); const table = scroll.createEl("table", { cls: "pseudobs-dict-review-table" }); const thead = table.createEl("thead"); const hr = thead.createEl("tr"); - ["", "Source", "", "Remplacement", "Occ."].forEach( + ["", "Source", "", t("mappingScanModal.col.replacement"), t("mappingScanModal.col.occurrences")].forEach( (h) => hr.createEl("th", { text: h }) ); const tbody = table.createEl("tbody"); @@ -32595,7 +33307,7 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { tr.createEl("td", { text: String(matchCount), cls: "pseudobs-dict-review-count" }); }); const footer = contentEl.createDiv("pseudobs-dict-review-footer"); - footer.createEl("button", { text: "Annuler" }).addEventListener("click", () => this.close()); + footer.createEl("button", { text: t("mappingScanModal.cancel") }).addEventListener("click", () => this.close()); this.applyBtn = footer.createEl("button", { cls: "mod-cta" }); this.applyBtn.addEventListener("click", () => void this.apply()); this.updateApplyLabel(); @@ -32603,7 +33315,13 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { updateApplyLabel() { const n = this.checked.filter(Boolean).length; const total = this.ruleResults.filter((_, i2) => this.checked[i2]).reduce((sum, r) => sum + r.matchCount, 0); - this.applyBtn.textContent = n === 0 ? "Aucune r\xE8gle \xE0 appliquer" : `Pseudonymiser (${n} r\xE8gle${n > 1 ? "s" : ""}, ${total} occurrence${total > 1 ? "s" : ""})`; + this.applyBtn.textContent = n === 0 ? t("mappingScanModal.noRules") : t( + "mappingScanModal.apply", + String(n), + n > 1 ? t("mappingScanModal.apply.rules") : t("mappingScanModal.apply.rule"), + String(total), + total > 1 ? t("mappingScanModal.apply.occurrences") : t("mappingScanModal.apply.occurrence") + ); this.applyBtn.toggleClass("pseudobs-dict-review-btn-empty", n === 0); } async apply() { @@ -32625,7 +33343,7 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { ); const resolved = resolveSpans(allSpans); if (resolved.length === 0) { - new import_obsidian6.Notice("Aucune occurrence \xE0 remplacer."); + new import_obsidian6.Notice(t("notice.noOccurrences")); this.close(); return; } @@ -32633,7 +33351,12 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { await this.app.vault.modify(this.file, modified); void this.plugin.refreshHighlightData(); const total = resolved.length; - new import_obsidian6.Notice(`\u2713 ${total} occurrence${total > 1 ? "s" : ""} pseudonymis\xE9e${total > 1 ? "s" : ""} dans "${this.file.name}"`); + new import_obsidian6.Notice(t( + "notice.occurrencesPseudonymized", + String(total), + total > 1 ? t("notice.occurrencesPseudonymized.occurrences") : t("notice.occurrencesPseudonymized.occurrence"), + this.file.name + )); this.close(); } onClose() { @@ -32643,31 +33366,15 @@ var MappingScanReviewModal = class extends import_obsidian6.Modal { // src/ui/PseudonymizationView.ts var VIEW_TYPE_PSEUDOBS = "pseudonymization-view"; -var CATEGORY_LABELS = { - first_name: "Pr\xE9nom", - last_name: "Nom", - full_name: "Nom complet", - place: "Lieu", - institution: "Institution", - date: "Date", - age: "\xC2ge", - profession: "Profession", - custom: "Autre" -}; -var SCOPE_LABELS = { - file: "Fichier", - folder: "Dossier", - vault: "Vault" -}; -var STATUS_LABELS = { - validated: "\u2713", - ignored: "\u2717", - partial: "\u25D1", - suggested: "?", - conflict: "\u26A0", - disabled: "\u2013", - needs_review: "\u{1F441}" -}; +function categoryLabel(cat2) { + return t(`category.${cat2}`) || cat2; +} +function scopeLabel(s) { + return t(`scope.${s}`) || s; +} +function statusLabel(s) { + return t(`status.${s}`) || s; +} var PseudonymizationView = class extends import_obsidian7.ItemView { constructor(leaf, plugin) { super(leaf); @@ -32676,6 +33383,8 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { this.lastFile = null; // IDs des dictionnaires cochés pour le scan groupé (tous cochés par défaut) this.checkedDicts = /* @__PURE__ */ new Set(); + // Onglet Mappings : filtrer sur le fichier actif (coché par défaut) + this.mappingsFilterActive = true; // Garde contre la réentrance de onFileChange (le panneau lui-même peut devenir feuille active) this._renderingTab = false; this.plugin = plugin; @@ -32696,12 +33405,12 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { const tabBar = root.createDiv("pseudobs-view-tabs"); const content = root.createDiv("pseudobs-view-content"); const tabs = [ - ["mappings", "Mappings"], - ["dictionaries", "Dictionnaires"], - ["exports", "Exports"] + ["mappings", t("panel.tab.mappings")], + ["dictionaries", t("panel.tab.dictionaries")], + ["exports", t("panel.tab.exports")] ]; if (this.plugin.settings.nerBackend !== "none") { - tabs.push(["ner", "NER"]); + tabs.push(["ner", t("panel.tab.ner")]); } this.panes = {}; this.tabBtns = {}; @@ -32766,11 +33475,11 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { const toolbar = el.createDiv("pseudobs-view-toolbar"); const addRuleBtn = toolbar.createEl("button", { cls: "pseudobs-view-action-btn" }); (0, import_obsidian7.setIcon)(addRuleBtn, "list-plus"); - addRuleBtn.createSpan({ text: "Ajouter une r\xE8gle" }); + addRuleBtn.createSpan({ text: t("panel.mappings.addRule") }); addRuleBtn.addEventListener("click", () => new RuleModal(this.app, this.plugin).open()); const scanBtn = toolbar.createEl("button", { cls: "pseudobs-view-action-btn" }); (0, import_obsidian7.setIcon)(scanBtn, "scan-search"); - scanBtn.createSpan({ text: "Scanner le fichier" }); + scanBtn.createSpan({ text: t("panel.mappings.scanFile") }); if (!file) scanBtn.setAttr("disabled", "true"); scanBtn.addEventListener("click", () => { @@ -32778,12 +33487,12 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { if (!file) return; scanBtn.setAttr("disabled", "true"); - scanBtn.setText("Scan en cours\u2026"); + scanBtn.querySelector("span")?.setText(t("panel.mappings.scanning")); try { const content = await this.app.vault.read(file); const rules = await this.plugin.scopeResolver.getRulesFor(file.path); if (rules.length === 0) { - new import_obsidian7.Notice("Aucune r\xE8gle active pour ce fichier. Cr\xE9ez des r\xE8gles via le menu contextuel."); + new import_obsidian7.Notice(t("panel.mappings.noRulesHint")); return; } const occs = scanOccurrences(content, file.path, rules, { @@ -32797,44 +33506,74 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { } const ruleResults = rules.filter((r) => countByRule.has(r.id)).map((r) => ({ rule: r, matchCount: countByRule.get(r.id) })); if (ruleResults.length === 0) { - new import_obsidian7.Notice("Aucune occurrence trouv\xE9e pour les r\xE8gles actives."); + new import_obsidian7.Notice(t("notice.noOccurrences")); return; } new MappingScanReviewModal(this.app, this.plugin, file, content, ruleResults).open(); } finally { scanBtn.removeAttribute("disabled"); - scanBtn.setText("Scanner le fichier"); + scanBtn.querySelector("span")?.setText(t("panel.mappings.scanFile")); } })(); }); - if (!file) { - el.createEl("p", { text: "Aucun fichier actif.", cls: "pseudobs-view-hint" }); + const filterRow = el.createDiv("pseudobs-mappings-filter-row"); + const cb = filterRow.createEl("input"); + cb.type = "checkbox"; + cb.checked = this.mappingsFilterActive; + cb.addClass("pseudobs-dict-review-cb"); + filterRow.createEl("label", { text: t("panel.mappings.filterActive") }); + cb.addEventListener("change", () => { + this.mappingsFilterActive = cb.checked; + void this.renderTab("mappings"); + }); + if (!file && this.mappingsFilterActive) { + el.createEl("p", { text: t("panel.mappings.noFile"), cls: "pseudobs-view-hint" }); return; } - const locations = await this.plugin.scopeResolver.getRulesWithLocation(file.path); + const locations = this.mappingsFilterActive && file ? await this.plugin.scopeResolver.getRulesWithLocation(file.path) : await this.plugin.scopeResolver.getAllRulesWithLocation(); if (locations.length === 0) { - el.createEl("p", { text: `Aucune r\xE8gle pour ${file.name}.`, cls: "pseudobs-view-hint" }); + el.createEl("p", { + text: this.mappingsFilterActive && file ? t("panel.mappings.noRules", file.name) : t("panel.mappings.noRules", "\u2014"), + cls: "pseudobs-view-hint" + }); return; } - const table = el.createEl("table", { cls: "pseudobs-mappings-table" }); - const headerRow = table.createEl("thead").createEl("tr"); - for (const col of ["Source", "Remplacement", "Cat\xE9gorie", "Port\xE9e", "P.", "Statut", ""]) { - headerRow.createEl("th", { text: col }); - } - const tbody = table.createEl("tbody"); + const byScope = { file: [], folder: [], vault: [] }; for (const loc of locations) { - const { rule } = loc; - const row = tbody.createEl("tr"); - row.createEl("td", { text: rule.source, cls: "pseudobs-mappings-source" }); - row.createEl("td", { text: rule.replacement, cls: "pseudobs-mappings-replacement" }); - row.createEl("td", { text: CATEGORY_LABELS[rule.category] ?? rule.category }); - row.createEl("td", { text: SCOPE_LABELS[rule.scope.type] ?? rule.scope.type }); - row.createEl("td", { text: String(rule.priority) }); - row.createEl("td", { text: STATUS_LABELS[rule.status] ?? rule.status }); - const editBtn = row.createEl("td").createEl("button", { cls: "pseudobs-mappings-edit-btn" }); - (0, import_obsidian7.setIcon)(editBtn, "pencil"); - editBtn.title = "Modifier"; - editBtn.addEventListener("click", () => new EditRuleModal(this.app, this.plugin, loc).open()); + const s = loc.rule.scope.type; + (byScope[s] ?? (byScope[s] = [])).push(loc); + } + const scopeOrder = ["file", "folder", "vault"]; + const cols = [ + t("panel.mappings.col.source"), + t("panel.mappings.col.replacement"), + t("panel.mappings.col.category"), + t("panel.mappings.col.priority"), + t("panel.mappings.col.status"), + "" + ]; + for (const scopeType of scopeOrder) { + const locs = byScope[scopeType]; + if (!locs || locs.length === 0) + continue; + el.createEl("h3", { text: scopeLabel(scopeType), cls: "pseudobs-mappings-scope-heading" }); + const table = el.createEl("table", { cls: "pseudobs-mappings-table" }); + const headerRow = table.createEl("thead").createEl("tr"); + for (const col of cols) + headerRow.createEl("th", { text: col }); + const tbody = table.createEl("tbody"); + for (const loc of locs) { + const { rule } = loc; + const row = tbody.createEl("tr"); + row.createEl("td", { text: rule.source, cls: "pseudobs-mappings-source" }); + row.createEl("td", { text: rule.replacement, cls: "pseudobs-mappings-replacement" }); + row.createEl("td", { text: categoryLabel(rule.category) }); + row.createEl("td", { text: String(rule.priority) }); + row.createEl("td", { text: statusLabel(rule.status) }); + const editBtn = row.createEl("td").createEl("button", { cls: "pseudobs-mappings-edit-btn" }); + (0, import_obsidian7.setIcon)(editBtn, "pencil"); + editBtn.addEventListener("click", () => new EditRuleModal(this.app, this.plugin, loc).open()); + } } } // ---- Onglet Dictionnaires -------------------------------------- @@ -32844,10 +33583,7 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { dicts.forEach((d) => this.checkedDicts.add(d.dictionaryId)); } if (dicts.length === 0) { - el.createEl("p", { - text: "Aucun dictionnaire install\xE9. Installez-en un depuis le wizard (Param\xE8tres \u2192 Reconfigurer) ou importez un fichier local.", - cls: "pseudobs-view-hint" - }); + el.createEl("p", { text: t("panel.dict.noneInstalled"), cls: "pseudobs-view-hint" }); } else { for (const dict of dicts) { const card = el.createDiv("pseudobs-dict-card"); @@ -32855,7 +33591,7 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { checkbox.type = "checkbox"; checkbox.checked = this.checkedDicts.has(dict.dictionaryId); checkbox.addClass("pseudobs-dict-card-checkbox"); - checkbox.title = "Inclure dans le scan group\xE9"; + checkbox.title = t("panel.dict.checkbox"); checkbox.addEventListener("change", () => { if (checkbox.checked) this.checkedDicts.add(dict.dictionaryId); @@ -32868,16 +33604,16 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { if (dict.roles?.detection) { const scanBtn = card.createEl("button", { cls: "pseudobs-dict-card-scan mod-cta" }); (0, import_obsidian7.setIcon)(scanBtn, "scan-search"); - scanBtn.setAttribute("aria-label", `Scanner avec ${dict.label}`); - scanBtn.title = `Scanner le fichier actif avec "${dict.label}"`; + scanBtn.setAttribute("aria-label", t("panel.dict.scanWith", dict.label)); + scanBtn.title = t("panel.dict.scanWith", dict.label); scanBtn.addEventListener("click", () => { void this.plugin.scanCurrentFileWithDictionaries([dict.dictionaryId]); }); } const removeBtn = card.createEl("button", { cls: "pseudobs-dict-card-remove" }); (0, import_obsidian7.setIcon)(removeBtn, "trash-2"); - removeBtn.setAttribute("aria-label", "Supprimer ce dictionnaire"); - removeBtn.title = "Supprimer ce dictionnaire du vault"; + removeBtn.setAttribute("aria-label", t("panel.dict.remove")); + removeBtn.title = t("panel.dict.remove"); removeBtn.addEventListener("click", () => { void (async () => { const f = this.app.vault.getAbstractFileByPath( @@ -32894,11 +33630,11 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { el.createEl("hr"); const groupScanBtn = el.createEl("button", { cls: "pseudobs-dict-group-scan mod-cta" }); (0, import_obsidian7.setIcon)(groupScanBtn, "scan-search"); - groupScanBtn.createSpan({ text: "Scanner les dictionnaires coch\xE9s" }); + groupScanBtn.createSpan({ text: t("panel.dict.scanAll") }); groupScanBtn.addEventListener("click", () => { const ids = [...this.checkedDicts]; if (ids.length === 0) { - new import_obsidian7.Notice("Aucun dictionnaire coch\xE9."); + new import_obsidian7.Notice(t("notice.noCheckedDicts")); return; } void this.plugin.scanCurrentFileWithDictionaries(ids); @@ -32906,7 +33642,7 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { } el.createEl("hr"); const importBtn = el.createEl("button", { - text: "Importer un fichier local (.dict.json)", + text: t("panel.dict.importLocal"), cls: "pseudobs-view-add-btn" }); importBtn.addEventListener("click", () => { @@ -32939,11 +33675,11 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { } ok++; } catch { - new import_obsidian7.Notice(`Format invalide : ${f.name}`); + new import_obsidian7.Notice(t("notice.invalidFormat", f.name)); } } if (ok > 0) { - new import_obsidian7.Notice(`\u2713 ${ok} dictionnaire${ok > 1 ? "s" : ""} import\xE9${ok > 1 ? "s" : ""}`); + new import_obsidian7.Notice(t("notice.dictImported", String(ok), ok > 1 ? t("notice.dictImported.many") : t("notice.dictImported.one"))); await this.plugin.dictionaryLoader.load(); } await this.renderTab("dictionaries"); @@ -32956,17 +33692,17 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { renderExportsTab(el) { const file = this.getFile(); if (!file) { - el.createEl("p", { text: "Aucun fichier actif.", cls: "pseudobs-view-hint" }); + el.createEl("p", { text: t("panel.mappings.noFile"), cls: "pseudobs-view-hint" }); return; } - el.createEl("p", { text: `Fichier actif : ${file.name}`, cls: "pseudobs-view-filename" }); - new import_obsidian7.Setting(el).setName("Pseudonymiser et exporter").setDesc("G\xE9n\xE8re un fichier .pseudonymized.[ext] dans le dossier d'exports configur\xE9").addButton( - (btn) => btn.setButtonText("Exporter").setCta().onClick(() => { + el.createEl("p", { text: `${file.name}`, cls: "pseudobs-view-filename" }); + new import_obsidian7.Setting(el).setName(t("panel.exports.pseudonymize")).addButton( + (btn) => btn.setButtonText(t("panel.exports.pseudonymize")).setCta().onClick(() => { void this.plugin.pseudonymizeActiveFile(); }) ); - new import_obsidian7.Setting(el).setName("Exporter la table de correspondance").setDesc("Copie le mapping JSON dans le dossier d'exports").addButton( - (btn) => btn.setButtonText("Exporter le mapping").onClick(() => { + new import_obsidian7.Setting(el).setName(t("panel.exports.exportMapping")).addButton( + (btn) => btn.setButtonText(t("panel.exports.exportMapping")).onClick(() => { void this.plugin.exportMappingForFile(file); }) ); @@ -32976,20 +33712,14 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { const s = this.plugin.settings; const nerScanBtn = el.createEl("button", { cls: "pseudobs-view-action-btn mod-cta" }); (0, import_obsidian7.setIcon)(nerScanBtn, "scan-search"); - nerScanBtn.createSpan({ text: "Identifier des candidats" }); - nerScanBtn.title = "D\xE9tecter les entit\xE9s nomm\xE9es dans le fichier actif et les surligner en bleu"; + nerScanBtn.createSpan({ text: t("panel.ner.scanBtn") }); + nerScanBtn.title = t("panel.ner.scanBtn"); nerScanBtn.addEventListener("click", () => void this.plugin.scanCurrentFileNer()); el.createEl("hr"); - el.createEl("p", { - text: "Param\xE8tres du scanner de d\xE9tection automatique des entit\xE9s nomm\xE9es.", - cls: "pseudobs-view-hint" - }); + el.createEl("p", { text: t("panel.ner.hint"), cls: "pseudobs-view-hint" }); const scoreSection = el.createDiv("pseudobs-ner-section"); - scoreSection.createEl("strong", { text: "Seuil de confiance" }); - scoreSection.createEl("p", { - text: "Les entit\xE9s dont le score est inf\xE9rieur \xE0 cette valeur sont ignor\xE9es. Plus la valeur est haute, moins de faux positifs mais aussi moins de d\xE9tections.", - cls: "pseudobs-view-hint" - }); + scoreSection.createEl("strong", { text: t("panel.ner.threshold") }); + scoreSection.createEl("p", { text: t("panel.ner.thresholdDesc"), cls: "pseudobs-view-hint" }); const scoreRow = scoreSection.createDiv("pseudobs-ner-score-row"); const scoreDisplay = scoreRow.createEl("span", { text: s.nerMinScore.toFixed(2), @@ -33010,18 +33740,15 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { void this.plugin.saveSettings(); }); const fwSection = el.createDiv("pseudobs-ner-section"); - fwSection.createEl("strong", { text: "Mots fonctionnels exclus" }); - fwSection.createEl("p", { - text: "Un mot par ligne. Ces termes ne seront jamais retenus comme entit\xE9s nomm\xE9es, m\xEAme si le mod\xE8le les d\xE9tecte (artefacts de tokenisation).", - cls: "pseudobs-view-hint" - }); + fwSection.createEl("strong", { text: t("panel.ner.functionWords") }); + fwSection.createEl("p", { text: t("panel.ner.functionWordsDesc"), cls: "pseudobs-view-hint" }); const textarea = fwSection.createEl("textarea"); textarea.addClass("pseudobs-ner-fw-textarea"); textarea.value = s.nerFunctionWords.join("\n"); textarea.rows = 10; textarea.spellcheck = false; const saveBtn = fwSection.createEl("button", { - text: "Enregistrer", + text: t("panel.ner.save"), cls: "pseudobs-view-action-btn" }); saveBtn.addEventListener("click", () => { @@ -33030,16 +33757,16 @@ var PseudonymizationView = class extends import_obsidian7.ItemView { this.plugin.settings.nerFunctionWords = words; await this.plugin.saveSettings(); saveBtn.addClass("pseudobs-btn-saved"); - saveBtn.setText("Enregistr\xE9"); + saveBtn.setText(t("panel.ner.saved")); window.setTimeout(() => { saveBtn.removeClass("pseudobs-btn-saved"); - saveBtn.setText("Enregistrer"); + saveBtn.setText(t("panel.ner.save")); }, 2e3); })(); }); const resetBtn = fwSection.createEl("button", { cls: "pseudobs-view-action-btn" }); (0, import_obsidian7.setIcon)(resetBtn, "rotate-ccw"); - resetBtn.createSpan({ text: "R\xE9initialiser par d\xE9faut" }); + resetBtn.createSpan({ text: t("panel.ner.reset") }); resetBtn.addClass("pseudobs-ner-reset-btn"); resetBtn.addEventListener("click", () => { void (async () => { @@ -33108,12 +33835,12 @@ var OnnxNerScanner = class { async _doLoad() { const notice = new import_obsidian8.Notice("Chargement du mod\xE8le NER (premi\xE8re utilisation \u2014 ~66 Mo)\u2026", 0); try { - const t = await Promise.resolve().then(() => (init_transformers(), transformers_exports)); - const { env: env3, pipeline: pipeline2 } = t; - if (Array.isArray(t.executionProviders)) { - const cpuIdx = t.executionProviders.indexOf("cpu"); + const t2 = await Promise.resolve().then(() => (init_transformers(), transformers_exports)); + const { env: env3, pipeline: pipeline2 } = t2; + if (Array.isArray(t2.executionProviders)) { + const cpuIdx = t2.executionProviders.indexOf("cpu"); if (cpuIdx !== -1) - t.executionProviders.splice(cpuIdx, 1); + t2.executionProviders.splice(cpuIdx, 1); } const pluginDir = this.getPluginDir(); env3.cacheDir = pluginDir ? path4.join(pluginDir, ".ner-cache") : path4.join(os.homedir(), ".cache", "huggingface", "hub"); @@ -33458,7 +34185,7 @@ var DictionaryLoader = class { for (let i2 = 0; i2 < tokens.length; i2++) { let matched = false; for (let n = Math.min(MAX_NGRAM, tokens.length - i2); n >= 1; n--) { - const phrase = tokens.slice(i2, i2 + n).map((t) => t.word).join(" "); + const phrase = tokens.slice(i2, i2 + n).map((t2) => t2.word).join(" "); const allHits = this.getDetectionHits(phrase); const hits = dictIds ? allHits.filter((h) => dictIds.includes(h.dict.dictionaryId)) : allHits; if (hits.length === 0) @@ -33513,6 +34240,7 @@ var DictionaryLoader = class { // src/ui/DictScanReviewModal.ts var import_obsidian9 = require("obsidian"); +init_i18n(); var DictScanReviewModal = class extends import_obsidian9.Modal { constructor(app, plugin, file, results, existingReplacements) { super(app); @@ -33532,10 +34260,11 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { this.modalEl.addClass("pseudobs-modal-review-outer"); const { contentEl } = this; contentEl.addClass("pseudobs-dict-review-modal"); - contentEl.createEl("h2", { text: "R\xE9vision du scan \u2014 dictionnaires" }); + contentEl.createEl("h2", { text: t("dictScanModal.title") }); const dicts = [...new Set(this.results.map((r) => r.dictLabel))]; + const n = this.results.length; contentEl.createEl("p", { - text: `${this.results.length} entit\xE9${this.results.length > 1 ? "s" : ""} d\xE9tect\xE9e${this.results.length > 1 ? "s" : ""} \xB7 ${dicts.join(", ")}`, + text: t("dictScanModal.summary", String(n), n > 1 ? t("dictScanModal.summary.entities") : t("dictScanModal.summary.entity"), dicts.join(", ")), cls: "pseudobs-scan-summary" }); const scroll = contentEl.createDiv("pseudobs-dict-review-scroll"); @@ -33545,7 +34274,7 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { const termWrap = header.createDiv("pseudobs-dict-review-card-term-wrap"); termWrap.createEl("span", { text: item.term, cls: "pseudobs-dict-review-term" }); termWrap.createEl("span", { - text: item.category.replace("_", " "), + text: t(`category.${item.category}`), cls: "pseudobs-dict-review-cat" }); const meta = header.createDiv("pseudobs-dict-review-card-meta"); @@ -33603,7 +34332,7 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { }); }); const footer = contentEl.createDiv("pseudobs-dict-review-footer"); - footer.createEl("button", { text: "Annuler" }).addEventListener("click", () => this.close()); + footer.createEl("button", { text: t("dictScanModal.cancel") }).addEventListener("click", () => this.close()); this.applyBtn = footer.createEl("button", { cls: "mod-cta" }); this.applyBtn.addEventListener("click", () => void this.apply()); this.recomputeIndices(); @@ -33650,7 +34379,7 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { } updateApplyLabel() { const n = this.checked.filter(Boolean).length; - this.applyBtn.textContent = n === 0 ? "Aucune r\xE8gle \xE0 appliquer" : `Cr\xE9er ${n} r\xE8gle${n > 1 ? "s" : ""}`; + this.applyBtn.textContent = n === 0 ? t("dictScanModal.noRules") : t("dictScanModal.apply", String(n), n > 1 ? t("dictScanModal.apply.rules") : t("dictScanModal.apply.rule")); this.applyBtn.toggleClass("pseudobs-dict-review-btn-empty", n === 0); } async apply() { @@ -33695,7 +34424,7 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { await this.app.vault.create(mappingPath, json); } const n = toCreate.length; - new import_obsidian9.Notice(`\u2713 ${n} r\xE8gle${n > 1 ? "s" : ""} cr\xE9\xE9e${n > 1 ? "s" : ""}`); + new import_obsidian9.Notice(t("notice.rulesCreated", String(n), n > 1 ? t("notice.rulesCreated.rules") : t("notice.rulesCreated.rule"))); void this.plugin.refreshHighlightData(); this.close(); } @@ -33704,6 +34433,176 @@ var DictScanReviewModal = class extends import_obsidian9.Modal { } }; +// src/ui/CorpusModal.ts +var import_obsidian10 = require("obsidian"); +init_i18n(); +function getCorpusClasses(app, transcriptionsFolder) { + const folder = app.vault.getAbstractFileByPath(transcriptionsFolder); + if (!(folder instanceof import_obsidian10.TFolder)) + return []; + return folder.children.filter((c) => c instanceof import_obsidian10.TFolder).map((c) => c.name).sort(); +} +var CorpusModal = class extends import_obsidian10.Modal { + constructor(app, plugin) { + super(app); + this.plugin = plugin; + } + onOpen() { + this.render(); + } + render() { + const { contentEl } = this; + contentEl.empty(); + contentEl.addClass("pseudobs-corpus-modal"); + contentEl.createEl("h2", { text: t("corpus.modal.title") }); + contentEl.createEl("p", { text: t("corpus.modal.hint"), cls: "pseudobs-view-hint" }); + const classes = getCorpusClasses(this.app, this.plugin.settings.transcriptionsFolder); + if (classes.length === 0) { + contentEl.createEl("p", { text: t("corpus.modal.noClasses"), cls: "pseudobs-view-hint" }); + } else { + const list = contentEl.createEl("ul", { cls: "pseudobs-corpus-class-list" }); + for (const cls of classes) { + this.renderClassRow(list, cls); + } + } + const addRow = contentEl.createDiv("pseudobs-corpus-add-row"); + const input = addRow.createEl("input"); + input.type = "text"; + input.placeholder = t("corpus.modal.classNamePlaceholder"); + input.addClass("pseudobs-corpus-add-input"); + const addBtn = addRow.createEl("button", { + text: t("corpus.modal.addClass"), + cls: "pseudobs-view-add-btn mod-cta" + }); + addBtn.addEventListener("click", () => void this.addClass(input.value)); + input.addEventListener("keydown", (e) => { + if (e.key === "Enter") + void this.addClass(input.value); + }); + contentEl.createEl("hr"); + contentEl.createEl("button", { text: t("corpus.modal.close"), cls: "pseudobs-view-action-btn" }).addEventListener("click", () => this.close()); + } + renderClassRow(list, cls) { + const s = this.plugin.settings; + const transcPath = `${s.transcriptionsFolder}/${cls}`; + const folder = this.app.vault.getAbstractFileByPath(transcPath); + const fileCount = folder instanceof import_obsidian10.TFolder ? folder.children.filter((c) => !(c instanceof import_obsidian10.TFolder)).length : 0; + const li = list.createEl("li", { cls: "pseudobs-corpus-class-item" }); + const nameWrap = li.createDiv("pseudobs-corpus-class-name"); + nameWrap.createEl("strong", { text: cls }); + nameWrap.createEl("small", { + text: t("corpus.modal.files", String(fileCount)), + cls: "pseudobs-corpus-class-count" + }); + const mirrorPaths = [ + `${s.mappingFolder}/${cls}`, + `${s.exportsFolder}/${cls}` + ]; + const mirrorEl = li.createEl("small", { cls: "pseudobs-corpus-class-mirror" }); + mirrorEl.setText(mirrorPaths.join(" \xB7 ")); + const delBtn = li.createEl("button", { cls: "pseudobs-dict-card-remove" }); + delBtn.setText("\u2715"); + delBtn.title = t("corpus.modal.deleteConfirm", cls); + delBtn.addEventListener("click", () => void this.deleteClass(cls)); + } + async addClass(name2) { + const trimmed = name2.trim(); + if (!trimmed) { + new import_obsidian10.Notice(t("corpus.modal.classNameEmpty")); + return; + } + const existing = getCorpusClasses(this.app, this.plugin.settings.transcriptionsFolder); + if (existing.includes(trimmed)) { + new import_obsidian10.Notice(t("corpus.modal.classExists")); + return; + } + const s = this.plugin.settings; + await this.plugin.ensureFolder(`${s.transcriptionsFolder}/${trimmed}`); + await this.plugin.ensureFolder(`${s.mappingFolder}/${trimmed}`); + await this.plugin.ensureFolder(`${s.exportsFolder}/${trimmed}`); + this.render(); + } + async deleteClass(name2) { + const s = this.plugin.settings; + const paths = [ + `${s.transcriptionsFolder}/${name2}`, + `${s.mappingFolder}/${name2}`, + `${s.exportsFolder}/${name2}` + ]; + for (const p of paths) { + const item = this.app.vault.getAbstractFileByPath(p); + if (item) + await this.app.fileManager.trashFile(item); + } + this.render(); + } + onClose() { + this.contentEl.empty(); + } +}; +var ClassSelectModal = class extends import_obsidian10.Modal { + constructor(app, plugin, classes) { + super(app); + this.plugin = plugin; + this.classes = classes; + } + open() { + super.open(); + return this; + } + prompt() { + return new Promise((resolve) => { + this.resolve = resolve; + super.open(); + }); + } + onOpen() { + const { contentEl } = this; + contentEl.createEl("h2", { text: t("corpus.select.title") }); + contentEl.createEl("p", { text: t("corpus.select.hint"), cls: "pseudobs-view-hint" }); + let selected = null; + const list = contentEl.createEl("ul", { cls: "pseudobs-corpus-class-list" }); + const noneItem = list.createEl("li", { cls: "pseudobs-corpus-select-item" }); + const noneBtn = noneItem.createEl("button", { + text: t("corpus.select.none"), + cls: "pseudobs-onboarding-none-btn" + }); + noneBtn.addEventListener("click", () => { + selected = null; + list.querySelectorAll(".pseudobs-corpus-select-item-active").forEach( + (el) => el.removeClass("pseudobs-corpus-select-item-active") + ); + noneItem.addClass("pseudobs-corpus-select-item-active"); + }); + for (const cls of this.classes) { + const item = list.createEl("li", { cls: "pseudobs-corpus-select-item" }); + const btn = item.createEl("button", { text: cls, cls: "pseudobs-onboarding-select-btn" }); + btn.addEventListener("click", () => { + selected = cls; + list.querySelectorAll(".pseudobs-corpus-select-item-active").forEach( + (el) => el.removeClass("pseudobs-corpus-select-item-active") + ); + item.addClass("pseudobs-corpus-select-item-active"); + btn.addClass("pseudobs-onboarding-select-btn-active"); + }); + } + const footer = contentEl.createDiv("pseudobs-dict-review-footer"); + footer.createEl("button", { text: t("corpus.modal.close") }).addEventListener("click", () => { + this.resolve(void 0); + this.close(); + }); + footer.createEl("button", { text: t("corpus.select.confirm"), cls: "mod-cta" }).addEventListener("click", () => { + this.resolve(selected); + this.close(); + }); + } + onClose() { + this.contentEl.empty(); + if (this.resolve) + this.resolve(void 0); + } +}; + // src/parsers/SrtParser.ts var SrtParser = class { parse(content) { @@ -33836,7 +34735,7 @@ function lineGroup(line) { } // src/mappings/ScopeResolver.ts -var import_obsidian10 = require("obsidian"); +var import_obsidian11 = require("obsidian"); var ScopeResolver = class { constructor(vault, mappingFolder) { this.vault = vault; @@ -33844,11 +34743,11 @@ var ScopeResolver = class { } async getRulesFor(filePath) { const folder = this.vault.getAbstractFileByPath(this.mappingFolder); - if (!(folder instanceof import_obsidian10.TFolder)) + if (!(folder instanceof import_obsidian11.TFolder)) return []; const allRules = []; for (const child of folder.children) { - if (!(child instanceof import_obsidian10.TFile)) + if (!(child instanceof import_obsidian11.TFile)) continue; if (!child.name.endsWith(".mapping.json")) continue; @@ -33873,11 +34772,11 @@ var ScopeResolver = class { // Retourne aussi le store et le chemin JSON pour permettre la modification. async findRuleByTerm(term) { const folder = this.vault.getAbstractFileByPath(this.mappingFolder); - if (!(folder instanceof import_obsidian10.TFolder)) + if (!(folder instanceof import_obsidian11.TFolder)) return null; const needle = term.toLowerCase(); for (const child of folder.children) { - if (!(child instanceof import_obsidian10.TFile) || !child.name.endsWith(".mapping.json")) + if (!(child instanceof import_obsidian11.TFile) || !child.name.endsWith(".mapping.json")) continue; try { const data = JSON.parse(await this.vault.read(child)); @@ -33896,11 +34795,11 @@ var ScopeResolver = class { // Utilisé par l'onglet Mappings du panneau latéral pour l'édition et la suppression. async getRulesWithLocation(filePath) { const folder = this.vault.getAbstractFileByPath(this.mappingFolder); - if (!(folder instanceof import_obsidian10.TFolder)) + if (!(folder instanceof import_obsidian11.TFolder)) return []; const result = []; for (const child of folder.children) { - if (!(child instanceof import_obsidian10.TFile) || !child.name.endsWith(".mapping.json")) + if (!(child instanceof import_obsidian11.TFile) || !child.name.endsWith(".mapping.json")) continue; try { const data = JSON.parse(await this.vault.read(child)); @@ -33920,12 +34819,33 @@ var ScopeResolver = class { } return result; } + // Retourne TOUTES les règles de TOUS les fichiers de mapping, sans filtre de scope. + // Utilisé par l'onglet Mappings en mode "toutes les règles". + async getAllRulesWithLocation() { + const folder = this.vault.getAbstractFileByPath(this.mappingFolder); + if (!(folder instanceof import_obsidian11.TFolder)) + return []; + const result = []; + for (const child of folder.children) { + if (!(child instanceof import_obsidian11.TFile) || !child.name.endsWith(".mapping.json")) + continue; + try { + const data = JSON.parse(await this.vault.read(child)); + const store = MappingStore.fromJSON(data); + for (const rule of store.getAll()) { + result.push({ rule, store, filePath: child.path }); + } + } catch { + } + } + return result; + } // Charge les règles validées d'un fichier de mapping spécifique, sans filtre de scope. // Utilisé pour les fichiers exportés (*.pseudonymized.*) dont le scope path ne correspond pas. async getRulesFromMappingFile(mappingFilename) { const path5 = `${this.mappingFolder}/${mappingFilename}`; const file = this.vault.getAbstractFileByPath(path5); - if (!(file instanceof import_obsidian10.TFile)) + if (!(file instanceof import_obsidian11.TFile)) return []; try { const data = JSON.parse(await this.vault.read(file)); @@ -33939,7 +34859,7 @@ var ScopeResolver = class { async saveStore(store, filePath) { const file = this.vault.getAbstractFileByPath(filePath); const json = JSON.stringify(store.toJSON(), null, 2); - if (file instanceof import_obsidian10.TFile) { + if (file instanceof import_obsidian11.TFile) { await this.vault.modify(file, json); } } @@ -33962,7 +34882,7 @@ var PseudonymizationEngine = class { // src/main.ts var CONVERTIBLE_EXTS = ["srt", "cha", "chat"]; -var PseudObsPlugin = class extends import_obsidian11.Plugin { +var PseudObsPlugin = class extends import_obsidian12.Plugin { constructor() { super(...arguments); // Cache synchrone pour le surlignage CM6 (mis à jour de façon asynchrone) @@ -33973,6 +34893,7 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } async onload() { await this.loadSettings(); + setLocale(this.settings.language); this.scopeResolver = new ScopeResolver(this.app.vault, this.settings.mappingFolder); this.nerScanner = new OnnxNerScanner(this.app); this.dictionaryLoader = new DictionaryLoader(this.app, this); @@ -33998,7 +34919,7 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } this.registerEvent( this.app.vault.on("create", (file) => { - if (!(file instanceof import_obsidian11.TFile)) + if (!(file instanceof import_obsidian12.TFile)) return; if (!CONVERTIBLE_EXTS.includes(file.extension.toLowerCase())) return; @@ -34007,41 +34928,46 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { }, 300); }) ); + this.addCommand({ + id: "organize-corpus", + name: t("command.organizeCorpus"), + callback: () => new CorpusModal(this.app, this).open() + }); this.addCommand({ id: "add-transcription", - name: "Ajouter une transcription", + name: t("command.addTranscription"), callback: () => this.openFilePicker() }); this.addCommand({ id: "pseudonymize-current-file", - name: "Pseudonymiser le fichier courant", + name: t("command.pseudonymizeFile"), callback: () => this.pseudonymizeActiveFile() }); this.addCommand({ id: "create-rule", - name: "Cr\xE9er une r\xE8gle de remplacement", + name: t("command.createRule"), editorCallback: (editor) => { new RuleModal(this.app, this, editor.getSelection()).open(); } }); this.addCommand({ id: "scan-current-file", - name: "Scanner le fichier courant", + name: t("command.scanFile"), callback: () => this.scanCurrentFile() }); this.addCommand({ id: "scan-ner", - name: "Scanner le fichier avec d\xE9tection NER", + name: t("command.scanNer"), callback: () => void this.scanCurrentFileNer() }); this.addCommand({ id: "scan-dictionaries", - name: "Scanner le fichier avec les dictionnaires", + name: t("command.scanDictionaries"), callback: () => void this.scanCurrentFileWithDictionaries() }); this.addCommand({ id: "pseudonymize-selection", - name: "Pseudonymiser la s\xE9lection", + name: t("command.pseudonymizeSelection"), editorCheckCallback: (checking, editor) => { if (!editor.getSelection()) return false; @@ -34062,12 +34988,13 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { const isSource = this.highlightData.sources.some((s) => s.toLowerCase() === bareLower); const isReplacement = this.highlightData.replacements.some((r) => r.toLowerCase() === bareLower); const isKnown = isSource || isReplacement; + const truncate = (s) => s.slice(0, 25) + (s.length > 25 ? "\u2026" : ""); if (isReplacement) { menu.addItem( - (item) => item.setTitle(`Annuler la pseudonymisation de "${bare.slice(0, 25)}${bare.length > 25 ? "\u2026" : ""}"`).setIcon("undo").onClick(async () => { + (item) => item.setTitle(t("contextMenu.cancelPseudonymization", truncate(bare))).setIcon("undo").onClick(async () => { const location = await this.scopeResolver.findRuleByTerm(bare); if (!location) { - new import_obsidian11.Notice("R\xE8gle introuvable dans les mappings."); + new import_obsidian12.Notice(t("notice.ruleNotFound")); return; } editor.replaceSelection(location.rule.source); @@ -34077,33 +35004,33 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } if (isKnown) { menu.addItem( - (item) => item.setTitle(`Modifier la r\xE8gle pour "${bare.slice(0, 25)}${bare.length > 25 ? "\u2026" : ""}"`).setIcon("settings").onClick(async () => { + (item) => item.setTitle(t("contextMenu.editRule", truncate(bare))).setIcon("settings").onClick(async () => { const location = await this.scopeResolver.findRuleByTerm(bare); if (location) { new EditRuleModal(this.app, this, location).open(); } else { - new import_obsidian11.Notice("R\xE8gle introuvable dans les mappings."); + new import_obsidian12.Notice(t("notice.ruleNotFound")); } }) ); } menu.addItem( - (item) => item.setTitle(`Pseudonymiser "${selection.slice(0, 25)}${selection.length > 25 ? "\u2026" : ""}"`).setIcon("eye-off").onClick(() => new QuickPseudonymizeModal(this.app, this, editor).open()) + (item) => item.setTitle(t("contextMenu.pseudonymize", truncate(selection))).setIcon("eye-off").onClick(() => new QuickPseudonymizeModal(this.app, this, editor).open()) ); menu.addItem( - (item) => item.setTitle(`Pseudonymiser avec Pr Baptiste Coulmont`).setIcon("book-user").onClick(async () => { - const notice = new import_obsidian11.Notice("Recherche sur coulmont.com\u2026", 0); + (item) => item.setTitle(t("contextMenu.coulmont")).setIcon("book-user").onClick(async () => { + const notice = new import_obsidian12.Notice("Recherche sur coulmont.com\u2026", 0); const suggestions = await this.fetchCoulmont(selection); notice.hide(); if (suggestions.length === 0) { - new import_obsidian11.Notice(`Aucun r\xE9sultat Coulmont pour "${selection}".`); + new import_obsidian12.Notice(`Aucun r\xE9sultat Coulmont pour "${selection}".`); return; } new RuleModal(this.app, this, selection, "", suggestions).open(); }) ); menu.addItem( - (item) => item.setTitle("Cr\xE9er une r\xE8gle de remplacement\u2026").setIcon("pencil").onClick(() => new RuleModal(this.app, this, selection).open()) + (item) => item.setTitle(t("contextMenu.createRule")).setIcon("pencil").onClick(() => new RuleModal(this.app, this, selection).open()) ); }) ); @@ -34128,7 +35055,7 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { async fetchCoulmont(prenom) { try { const url2 = `https://coulmont.com/bac/results.php?search=${encodeURIComponent(prenom)}`; - const response = await (0, import_obsidian11.requestUrl)({ url: url2, method: "GET" }); + const response = await (0, import_obsidian12.requestUrl)({ url: url2, method: "GET" }); const doc = new DOMParser().parseFromString(response.text, "text/html"); const els = doc.querySelectorAll( "#hero > div > div > div > div > p.mb-1.mb-md-1 > a" @@ -34171,7 +35098,7 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { this.highlightData = { sources: [], replacements: [], nerCandidates }; } } - const view = this.app.workspace.getActiveViewOfType(import_obsidian11.MarkdownView); + const view = this.app.workspace.getActiveViewOfType(import_obsidian12.MarkdownView); const cm = view?.editor && view.editor.cm; cm?.dispatch({ effects: highlightDataChanged.of(void 0) }); } @@ -34189,8 +35116,8 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } else { mdContent = chatToMarkdown(new ChatParser().parse(raw), file.name); } - if (this.app.vault.getAbstractFileByPath(mdPath) instanceof import_obsidian11.TFile) { - new import_obsidian11.Notice(`\u26A0 ${basename}.md existe d\xE9j\xE0 \u2014 conversion ignor\xE9e pour ${file.name}`); + if (this.app.vault.getAbstractFileByPath(mdPath) instanceof import_obsidian12.TFile) { + new import_obsidian12.Notice(t("notice.conversionSkipped", basename, file.name)); return; } await this.app.vault.create(mdPath, mdContent); @@ -34202,12 +35129,12 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } await this.app.fileManager.trashFile(file); const mdFile = this.app.vault.getAbstractFileByPath(mdPath); - if (mdFile instanceof import_obsidian11.TFile) { + if (mdFile instanceof import_obsidian12.TFile) { await this.app.workspace.getLeaf().openFile(mdFile); } - new import_obsidian11.Notice(`\u2713 ${file.name} \u2192 ${basename}.md`); + new import_obsidian12.Notice(t("notice.converted", file.name, `${basename}.md`)); } catch (e) { - new import_obsidian11.Notice(`Erreur de conversion de ${file.name} : ${e.message}`); + new import_obsidian12.Notice(t("notice.conversionError", file.name, e.message)); } } // --- Commande "Ajouter une transcription" --- @@ -34232,11 +35159,20 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { } async copyToVault(browserFile) { const raw = await browserFile.text(); - const destFolder = this.settings.transcriptionsFolder; - await this.ensureFolder(destFolder); - const destPath = `${destFolder}/${browserFile.name}`; - if (this.app.vault.getAbstractFileByPath(destPath) instanceof import_obsidian11.TFile) { - new import_obsidian11.Notice(`Le fichier existe d\xE9j\xE0 dans le vault : ${browserFile.name}`); + const classes = getCorpusClasses(this.app, this.settings.transcriptionsFolder); + let targetFolder = this.settings.transcriptionsFolder; + if (classes.length > 0) { + const modal = new ClassSelectModal(this.app, this, classes); + const chosen = await modal.prompt(); + if (chosen === void 0) + return; + if (chosen !== null) + targetFolder = `${this.settings.transcriptionsFolder}/${chosen}`; + } + await this.ensureFolder(targetFolder); + const destPath = `${targetFolder}/${browserFile.name}`; + if (this.app.vault.getAbstractFileByPath(destPath) instanceof import_obsidian12.TFile) { + new import_obsidian12.Notice(t("notice.fileExists", browserFile.name)); return; } await this.app.vault.create(destPath, raw); @@ -34245,22 +35181,18 @@ var PseudObsPlugin = class extends import_obsidian11.Plugin { async pseudonymizeActiveFile() { const file = this.app.workspace.getActiveFile(); if (!file) { - new import_obsidian11.Notice("Aucun fichier actif."); + new import_obsidian12.Notice(t("notice.noActiveFile")); return; } const ext = file.extension.toLowerCase(); if (!["srt", "cha", "chat", "md", "txt"].includes(ext)) { - new import_obsidian11.Notice(`Format non pris en charge : .${ext}`); + new import_obsidian12.Notice(t("notice.formatUnsupported", ext)); return; } const content = await this.app.vault.read(file); const rules = await this.scopeResolver.getRulesFor(file.path); if (rules.length === 0) { - new import_obsidian11.Notice( - `Aucune r\xE8gle valid\xE9e. -Cr\xE9ez des r\xE8gles via Ctrl+P \u2192 "Cr\xE9er une r\xE8gle". -Mapping attendu : ${this.settings.mappingFolder}/${file.basename}.mapping.json` - ); + new import_obsidian12.Notice(t("notice.noRules")); return; } const marker = this.settings.useMarkerInExport ? { open: this.settings.markerOpen, close: this.settings.markerClose } : void 0; @@ -34291,27 +35223,26 @@ Mapping attendu : ${this.settings.mappingFolder}/${file.basename}.mapping.json` await this.ensureFolder(this.settings.exportsFolder); const outputPath = `${this.settings.exportsFolder}/${file.basename}.pseudonymized.${ext}`; const existing = this.app.vault.getAbstractFileByPath(outputPath); - if (existing instanceof import_obsidian11.TFile) { + if (existing instanceof import_obsidian12.TFile) { await this.app.vault.modify(existing, pseudonymized); } else { await this.app.vault.create(outputPath, pseudonymized); } - new import_obsidian11.Notice(`\u2713 ${rules.length} r\xE8gle(s) appliqu\xE9e(s) -\u2192 ${outputPath}`); + new import_obsidian12.Notice(t("notice.exportDone", String(rules.length), outputPath)); } async scanCurrentFileNer() { if (this.settings.nerBackend !== "transformers-js") { - new import_obsidian11.Notice("La d\xE9tection NER transformers.js n'est pas activ\xE9e.\nActivez-la dans Param\xE8tres \u2192 Pseudonymizer Tool."); + new import_obsidian12.Notice("La d\xE9tection NER transformers.js n'est pas activ\xE9e.\nActivez-la dans Param\xE8tres \u2192 Pseudonymizer Tool."); return; } const file = this.app.workspace.getActiveFile(); if (!file) { - new import_obsidian11.Notice("Aucun fichier actif."); + new import_obsidian12.Notice(t("notice.noActiveFile")); return; } const ext = file.extension.toLowerCase(); if (!["srt", "cha", "chat", "md", "txt"].includes(ext)) { - new import_obsidian11.Notice(`Format non pris en charge : .${ext}`); + new import_obsidian12.Notice(t("notice.formatUnsupported", ext)); return; } try { @@ -34321,35 +35252,31 @@ Mapping attendu : ${this.settings.mappingFolder}/${file.basename}.mapping.json` functionWords: new Set(this.settings.nerFunctionWords.map((w) => w.toLowerCase())) }); if (occurrences.length === 0) { - new import_obsidian11.Notice("Aucune entit\xE9 d\xE9tect\xE9e par le NER."); + new import_obsidian12.Notice(t("notice.noNerEntities")); return; } const unique = [...new Set(occurrences.map((o) => o.text).filter(Boolean))]; this.nerCandidateFile = file; this.nerCandidates = unique; void this.refreshHighlightData(); - new import_obsidian11.Notice( - `\u2713 ${unique.length} entit\xE9${unique.length > 1 ? "s" : ""} d\xE9tect\xE9e${unique.length > 1 ? "s" : ""} \u2014 surlign\xE9e${unique.length > 1 ? "s" : ""} en bleu. -Clic droit sur un terme pour cr\xE9er une r\xE8gle.`, - 6e3 - ); + new import_obsidian12.Notice(t("notice.nerEntitiesFound", String(unique.length), unique.length > 1 ? t("notice.nerEntitiesFound.entities") : t("notice.nerEntitiesFound.entity")), 6e3); } catch (e) { - new import_obsidian11.Notice(`Erreur NER : ${e.message}`); + new import_obsidian12.Notice(`NER error: ${e.message}`); } } async scanCurrentFileWithDictionaries(dictIds) { if (!this.dictionaryLoader.hasDetection()) { - new import_obsidian11.Notice("Aucun dictionnaire de d\xE9tection charg\xE9.\nInstallez un dictionnaire depuis le panneau Dictionnaires."); + new import_obsidian12.Notice(t("notice.noDictDetection")); return; } const file = this.app.workspace.getActiveFile(); if (!file) { - new import_obsidian11.Notice("Aucun fichier actif."); + new import_obsidian12.Notice(t("notice.noActiveFile")); return; } const ext = file.extension.toLowerCase(); if (!["srt", "cha", "chat", "md", "txt"].includes(ext)) { - new import_obsidian11.Notice(`Format non pris en charge : .${ext}`); + new import_obsidian12.Notice(t("notice.formatUnsupported", ext)); return; } const content = await this.app.vault.read(file); @@ -34357,7 +35284,7 @@ Clic droit sur un terme pour cr\xE9er une r\xE8gle.`, const existingSources = new Set(rules.map((r) => r.source.toLowerCase())); const occurrences = this.dictionaryLoader.scanText(content, file.path, existingSources, dictIds); if (occurrences.length === 0) { - new import_obsidian11.Notice("Aucune entit\xE9 trouv\xE9e dans les dictionnaires de d\xE9tection."); + new import_obsidian12.Notice(t("notice.noDictEntities")); return; } const seenTerms = /* @__PURE__ */ new Map(); @@ -34401,7 +35328,7 @@ Clic droit sur un terme pour cr\xE9er une r\xE8gle.`, }); } if (results.length === 0) { - new import_obsidian11.Notice("Aucun remplacement disponible pour les entit\xE9s trouv\xE9es."); + new import_obsidian12.Notice("Aucun remplacement disponible pour les entit\xE9s trouv\xE9es."); return; } this.nerCandidateFile = file; @@ -34418,30 +35345,30 @@ Clic droit sur un terme pour cr\xE9er une r\xE8gle.`, async exportMappingForFile(file) { const mappingPath = `${this.settings.mappingFolder}/${file.basename}.mapping.json`; const mappingFile = this.app.vault.getAbstractFileByPath(mappingPath); - if (!(mappingFile instanceof import_obsidian11.TFile)) { - new import_obsidian11.Notice(`Aucun mapping trouv\xE9 pour ${file.name}`); + if (!(mappingFile instanceof import_obsidian12.TFile)) { + new import_obsidian12.Notice(t("notice.noMapping", file.name)); return; } const content = await this.app.vault.read(mappingFile); await this.ensureFolder(this.settings.exportsFolder); const destPath = `${this.settings.exportsFolder}/${file.basename}.mapping.json`; const existing = this.app.vault.getAbstractFileByPath(destPath); - if (existing instanceof import_obsidian11.TFile) { + if (existing instanceof import_obsidian12.TFile) { await this.app.vault.modify(existing, content); } else { await this.app.vault.create(destPath, content); } - new import_obsidian11.Notice(`\u2713 Mapping export\xE9 \u2192 ${destPath}`); + new import_obsidian12.Notice(t("notice.mappingExported", destPath)); } async scanCurrentFile() { const file = this.app.workspace.getActiveFile(); if (!file) { - new import_obsidian11.Notice("Aucun fichier actif."); + new import_obsidian12.Notice(t("notice.noActiveFile")); return; } const rules = await this.scopeResolver.getRulesFor(file.path); if (rules.length === 0) { - new import_obsidian11.Notice('Aucune r\xE8gle pour ce fichier.\nCr\xE9ez des r\xE8gles via Ctrl+P \u2192 "Cr\xE9er une r\xE8gle".'); + new import_obsidian12.Notice(t("notice.noRules")); return; } const content = await this.app.vault.read(file); @@ -34450,7 +35377,7 @@ Clic droit sur un terme pour cr\xE9er une r\xE8gle.`, wholeWordOnly: this.settings.wholeWordOnly }); if (occurrences.length === 0) { - new import_obsidian11.Notice("Aucune occurrence trouv\xE9e pour les r\xE8gles actives."); + new import_obsidian12.Notice(t("notice.noOccurrences")); return; } const countByRule = /* @__PURE__ */ new Map(); diff --git a/src/dictionaries/DictionaryLoader.ts b/src/dictionaries/DictionaryLoader.ts index 60e54b0..bb685d3 100644 --- a/src/dictionaries/DictionaryLoader.ts +++ b/src/dictionaries/DictionaryLoader.ts @@ -7,7 +7,6 @@ import type { DictionaryCondition, DictionaryPattern, Occurrence, - EntityCategory, } from '../types'; // Séquence de tokens avec positions dans la ligne d'origine diff --git a/src/i18n/index.ts b/src/i18n/index.ts new file mode 100644 index 0000000..b804e2f --- /dev/null +++ b/src/i18n/index.ts @@ -0,0 +1,40 @@ +import en from './locales/en.json'; +import fr from './locales/fr.json'; + +type Strings = Record; + +const LOCALES: Record = { en, fr }; +const FALLBACK = 'en'; + +let _locale = FALLBACK; + +/** Définit la locale active. Appelé au chargement du plugin depuis les settings. */ +export function setLocale(lang: string): void { + _locale = LOCALES[lang] ? lang : FALLBACK; +} + +export function getLocale(): string { + return _locale; +} + +/** + * Retourne la chaîne traduite pour la clé donnée. + * Les arguments {0}, {1}… sont remplacés par les valeurs correspondantes. + * + * @example + * t('notice.ruleCreated', 'Jean', 'Pierre') // "✓ Règle créée : "Jean" → "Pierre"" + */ +export function t(key: string, ...args: (string | number)[]): string { + const locale = LOCALES[_locale] ?? LOCALES[FALLBACK]; + let s = locale[key] ?? LOCALES[FALLBACK][key] ?? key; + for (let i = 0; i < args.length; i++) { + s = s.replace(`{${i}}`, String(args[i])); + } + return s; +} + +/** Langues disponibles avec leur nom natif. */ +export const AVAILABLE_LANGUAGES: Record = { + en: 'English', + fr: 'Français', +}; diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json new file mode 100644 index 0000000..3339cd0 --- /dev/null +++ b/src/i18n/locales/en.json @@ -0,0 +1,309 @@ +{ + "corpus.modal.title": "Organize corpus", + "corpus.modal.hint": "Each class creates mirrored folders for transcriptions, mappings and exports.", + "corpus.modal.noClasses": "No classes defined. Add one to organize your documents by folder.", + "corpus.modal.addClass": "Add a class", + "corpus.modal.classNamePlaceholder": "Class name (e.g. Session_A, Informant_1…)", + "corpus.modal.classNameEmpty": "Class name cannot be empty.", + "corpus.modal.classExists": "A class with this name already exists.", + "corpus.modal.deleteConfirm": "Delete class \"{0}\"? The folders will be removed from the vault (files inside will be trashed).", + "corpus.modal.files": "{0} file(s)", + "corpus.modal.close": "Close", + "corpus.select.title": "Add to which class?", + "corpus.select.hint": "Choose the class (folder) for this transcription.", + "corpus.select.none": "No class (root)", + "corpus.select.confirm": "Add", + "quickModal.title": "Pseudonymize", + "quickModal.source": "Selected expression", + "quickModal.sourceDesc": "Term to replace — cannot be modified", + "quickModal.replaceBy": "Replace with", + "quickModal.replacementPlaceholder": "Pseudonym or analytical category", + "quickModal.scope": "Replacement scope", + "quickModal.scopeFile": "All occurrences in this file", + "quickModal.scopeOccurrence": "This occurrence only", + "quickModal.submit": "Pseudonymize", + "notice.appliedOccurrence": "✓ \"{0}\" → \"{1}\" (this occurrence)", + "notice.appliedFile": "✓ \"{0}\" → \"{1}\" ({2} occurrence{3})", + "onboarding.dict.importOk": "{0} dictionary imported", + "onboarding.dict.importOkMany": "{0} dictionaries imported", + "onboarding.dict.importErr": "{0} file rejected", + "onboarding.dict.importErrMany": "{0} files rejected", + "onboarding.dict.importError": "Error importing {0} — check the .dict.json format", + "notice.noActiveFile": "No active file.", + "notice.formatUnsupported": "Unsupported format: .{0}", + "notice.noRules": "No rules for this file.\nCreate rules via Ctrl+P → \"Create a rule\".", + "notice.noOccurrences": "No occurrences found for the active rules.", + "notice.noNerEntities": "No entities detected by NER.", + "notice.nerEntitiesFound": "✓ {0} {1} detected — highlighted in blue.\nRight-click to create a rule.", + "notice.nerEntitiesFound.entity": "entity", + "notice.nerEntitiesFound.entities": "entities", + "notice.nerNotEnabled": "transformers.js NER detection is not enabled.\nEnable it in Settings → Pseudonymizer Tool.", + "notice.noDictDetection": "No detection dictionary loaded.\nInstall a dictionary from the Dictionaries panel.", + "notice.noDictEntities": "No entities found in the detection dictionaries.", + "notice.noDictReplacements": "No replacements available for the found entities.", + "notice.ruleCreated": "✓ Rule created: \"{0}\" → \"{1}\"", + "notice.rulesCreated": "✓ {0} {1} created", + "notice.rulesCreated.rule": "rule", + "notice.rulesCreated.rules": "rules", + "notice.occurrencesPseudonymized": "✓ {0} {1} pseudonymized in \"{2}\"", + "notice.occurrencesPseudonymized.occurrence": "occurrence", + "notice.occurrencesPseudonymized.occurrences": "occurrences", + "notice.converted": "✓ {0} → {1}", + "notice.conversionError": "Conversion error for {0}: {1}", + "notice.fileExists": "File already exists in vault: {0}", + "notice.conversionSkipped": "⚠ {0}.md already exists — conversion skipped for {1}", + "notice.exportDone": "✓ {0} rule(s) applied\n→ {1}", + "notice.mappingExported": "✓ Mapping exported → {0}", + "notice.noMapping": "No mapping found for {0}", + "notice.invalidFormat": "Invalid format: {0}", + "notice.dictImported": "✓ {0} {1} imported", + "notice.dictImported.one": "dictionary", + "notice.dictImported.many": "dictionaries", + "notice.dictRejected": "{0} {1} rejected", + "notice.dictRejected.one": "file", + "notice.dictRejected.many": "files", + "notice.nerModelLoaded": "✓ NER model loaded", + "notice.nerModelLoading": "Loading NER model (first use — ~66 MB)…", + "notice.ruleNotFound": "Rule not found in mappings.", + "notice.noCheckedDicts": "No dictionary checked.", + + "command.organizeCorpus": "Organize corpus", + "command.addTranscription": "Add a transcription", + "command.pseudonymizeFile": "Pseudonymize current file", + "command.createRule": "Create a replacement rule", + "command.scanFile": "Scan current file", + "command.scanNer": "Scan file with NER detection", + "command.scanDictionaries": "Scan file with dictionaries", + "command.pseudonymizeSelection": "Pseudonymize selection", + "command.openPanel": "Pseudonymization: open panel", + + "contextMenu.cancelPseudonymization": "Cancel pseudonymization of \"{0}\"", + "contextMenu.editRule": "Edit rule for \"{0}\"", + "contextMenu.pseudonymize": "Pseudonymize \"{0}\"", + "ruleModal.delete": "Delete rule", + "ruleModal.scopeWarnTitle": "Longitudinal scope", + "ruleModal.scopeOkTitle": "File scope", + "ruleModal.scopeOk": "Good practice. This pseudonym will only apply to this transcription — each file remains independent.", + "contextMenu.coulmont": "Pseudonymize with Prof. Baptiste Coulmont", + "contextMenu.createRule": "Create a replacement rule…", + + "ruleModal.title": "Create a replacement rule", + "ruleModal.source": "Source", + "ruleModal.sourceDesc": "Original term to replace", + "ruleModal.replacement": "Replacement", + "ruleModal.replacementDesc": "Pseudonym or analytical category", + "ruleModal.replacementDescClass": "The exact index will be calculated at creation based on existing rules in the scope.", + "ruleModal.category": "Category", + "ruleModal.scope": "Scope", + "ruleModal.scopeFile": "This file only", + "ruleModal.scopeFolder": "This folder", + "ruleModal.scopeVault": "Entire vault", + "ruleModal.priority": "Priority", + "ruleModal.priorityDesc": "Free integer, like a CSS z-index — default 0, higher = applied first", + "ruleModal.submit": "Create rule", + "ruleModal.errorMissing": "Source and replacement are required.", + "ruleModal.errorNoFile": "No active file.", + "ruleModal.coulomontLabel": "Equivalent first name suggestions — choose:", + "ruleModal.dictLabel": "Dictionary: \"{0}\" → class {1}", + "ruleModal.dictUseClass": "Use \"{0}\" (scope: {1})", + + "category.first_name": "First name", + "category.last_name": "Last name", + "category.full_name": "Full name", + "category.place": "Place", + "category.institution": "Institution", + "category.date": "Date", + "category.age": "Age", + "category.profession": "Profession", + "category.custom": "Other", + + "scope.file": "File", + "scope.folder": "Folder", + "scope.vault": "Vault", + + "status.validated": "✓", + "status.ignored": "✗", + "status.partial": "◑", + "status.suggested": "?", + "status.conflict": "⚠", + "status.disabled": "–", + "status.needs_review": "👁", + + "panel.tab.mappings": "Mappings", + "panel.tab.dictionaries": "Dictionaries", + "panel.tab.exports": "Exports", + "panel.tab.ner": "NER", + + "panel.mappings.filterActive": "Active file only", + "panel.mappings.warnBroadName": "⚠ Generalizing a first name or surname beyond file scope should only be done as a deliberate analytical choice — for example, to consistently track the same participant in a longitudinal study. Even when the same individual appears in multiple files, file-level pseudonymization is generally preferable: it keeps each transcription independent and reduces the risk of cross-file identification.", + "panel.mappings.addRule": "Add a rule", + "panel.mappings.scanFile": "Scan file", + "panel.mappings.scanning": "Scanning…", + "panel.mappings.noFile": "No active file.", + "panel.mappings.noRules": "No rules for {0}.", + "panel.mappings.noRulesHint": "No active rules for this file. Create rules via the context menu or the \"create a rule\" command.", + "panel.mappings.col.source": "Source", + "panel.mappings.col.replacement": "Replacement", + "panel.mappings.col.category": "Category", + "panel.mappings.col.scope": "Scope", + "panel.mappings.col.priority": "P.", + "panel.mappings.col.status": "Status", + + "panel.dict.noneInstalled": "No dictionary installed. Install one from the wizard (Settings → Reconfigure) or import a local file.", + "panel.dict.checkbox": "Include in grouped scan", + "panel.dict.scanAll": "Scan checked dictionaries", + "panel.dict.importLocal": "Import a local file (.dict.json)", + "panel.dict.scanWith": "Scan active file with \"{0}\"", + "panel.dict.remove": "Remove this dictionary", + + "panel.exports.pseudonymize": "Pseudonymize and export", + "panel.exports.exportMapping": "Export correspondence table", + + "panel.ner.scanBtn": "Identify candidates", + "panel.ner.hint": "Settings for the automatic named entity detection scanner.", + "panel.ner.threshold": "Confidence threshold", + "panel.ner.thresholdDesc": "Entities with a score below this value are ignored. Higher = fewer false positives but fewer detections.", + "panel.ner.functionWords": "Excluded function words", + "panel.ner.functionWordsDesc": "One word per line. These tokens will never be retained as named entities, even if detected by the model.", + "panel.ner.save": "Save", + "panel.ner.saved": "Saved", + "panel.ner.reset": "Reset to defaults", + + "dictScanModal.title": "Dictionary scan review", + "dictScanModal.summary": "{0} {1} detected · {2}", + "dictScanModal.summary.entity": "entity", + "dictScanModal.summary.entities": "entities", + "dictScanModal.hint": "Uncheck false positives. The prefix is editable; the index is calculated automatically.", + "dictScanModal.apply": "Create {0} {1}", + "dictScanModal.apply.rule": "rule", + "dictScanModal.apply.rules": "rules", + "dictScanModal.noRules": "No rules to apply", + "dictScanModal.cancel": "Cancel", + + "mappingScanModal.title": "Mapping scan review", + "mappingScanModal.summary": "{0} active {1} with occurrences in \"{2}\"", + "mappingScanModal.summary.rule": "rule", + "mappingScanModal.summary.rules": "rules", + "mappingScanModal.hint": "Uncheck rules not to apply. Replacements will be written to the source file.", + "mappingScanModal.col.source": "", + "mappingScanModal.col.replacement": "Replacement", + "mappingScanModal.col.occurrences": "Occ.", + "mappingScanModal.apply": "Pseudonymize ({0} {1}, {2} {3})", + "mappingScanModal.apply.rule": "rule", + "mappingScanModal.apply.rules": "rules", + "mappingScanModal.apply.occurrence": "occurrence", + "mappingScanModal.apply.occurrences": "occurrences", + "mappingScanModal.noRules": "No rules to apply", + "mappingScanModal.cancel": "Cancel", + + "onboarding.step.storage": "Storage", + "onboarding.step.language": "Language", + "onboarding.step.welcome": "Welcome", + "onboarding.step.ner": "NER Detection", + "onboarding.step.dictionaries": "Dictionaries", + "onboarding.step.summary": "Summary", + "onboarding.welcome.title": "Pseudonymizer Tool", + "onboarding.welcome.desc": "This plugin helps you correct and pseudonymize transcripts of interviews and interactional corpora (Jefferson, ICOR, .srt, .cha formats).", + "onboarding.welcome.steps": "The wizard will guide you in a few quick steps:", + "onboarding.welcome.step1": "Choose the interface language.", + "onboarding.welcome.step2": "Choose an automatic named entity detection engine (optional).", + "onboarding.welcome.step3": "Install replacement candidate dictionaries if you need them.", + "onboarding.welcome.hint": "You can reconfigure these options at any time via the plugin settings.", + "onboarding.storage.title": "Storage", + "onboarding.storage.vaultPerCorpus": "One vault per corpus", + "onboarding.storage.vaultPerCorpusDesc": "We recommend using a dedicated Obsidian vault for each corpus. This keeps mapping files, dictionaries and exports together with their transcriptions, and makes it easier to share or archive a corpus.", + "onboarding.storage.transcriptionsFolder": "Transcriptions folder", + "onboarding.storage.mappingFolder": "Correspondence tables", + "onboarding.storage.dictionariesFolder": "Dictionaries", + "onboarding.storage.exportsFolder": "Exports", + "onboarding.storage.hint": "These paths are relative to the vault root. You can change them later in Settings.", + "onboarding.language.title": "Interface language", + "onboarding.language.hint": "The interface language does not affect transcript analysis. Conventions (Jefferson, ICOR) are language-independent.", + "onboarding.ner.desc": "A NER model (named entity recognition) can automatically detect first names, surnames, places and institutions in your transcripts — without an exhaustive list, running locally in Obsidian.", + "onboarding.ner.tfjsTitle": "transformers.js — embedded ONNX model", + "onboarding.ner.tfjsBadge": "No Python required", + "onboarding.ner.tfjsDesc": "Multilingual NER model running locally in the vault. WASM files (~19 MB) are downloaded once. The model (~66 MB) is downloaded on first scan.", + "onboarding.ner.wasmReady": "WASM files already installed", + "onboarding.ner.installBtn": "Install and use transformers.js", + "onboarding.ner.selectedBtn": "Selected", + "onboarding.ner.noneActive": "Disabled (manual rules only)", + "onboarding.ner.noneSkip": "Skip — I will work manually", + + "onboarding.dict.title": "Replacement candidate dictionaries", + "onboarding.dict.desc": "Dictionaries provide replacement candidates (cities, first names…) and feed automatic detection. They are hosted in a dedicated repository and downloaded into your vault — no transcript data leaves Obsidian.", + "onboarding.dict.catalogueLoading": "Loading catalogue…", + "onboarding.dict.catalogueError": "Unable to reach the online catalogue. Check your connection or import a local file below.", + "onboarding.dict.recommended": "Recommended", + "onboarding.dict.col.dict": "Dictionary", + "onboarding.dict.col.lang": "Language", + "onboarding.dict.col.roles": "Roles", + "onboarding.dict.col.size": "Size", + "onboarding.dict.role.detection": "detection", + "onboarding.dict.role.replacement": "replacement", + "onboarding.dict.role.classes": "classes", + "onboarding.dict.install": "Install", + "onboarding.dict.reinstall": "Reinstall", + "onboarding.dict.installed": "Installed", + "onboarding.dict.manualHint": "Already have a .dict.json file? Import it manually:", + "onboarding.dict.importBtn": "Import a local file (.dict.json)", + "onboarding.dict.listTitle": "Dictionaries installed in this vault ({0}):", + "onboarding.dict.remove": "Remove this dictionary", + + "onboarding.summary.ner.none": "Disabled — manual rules only", + "onboarding.summary.ner.tfjs": "transformers.js — ONNX model (download on first scan)", + + "onboarding.nav.cancel": "Cancel", + "onboarding.nav.back": "Back", + "onboarding.nav.skip": "Skip this step", + "onboarding.nav.next": "Next", + "onboarding.nav.start": "Get started", + "onboarding.nav.finish": "Start working", + "onboarding.summary.title": "Configuration complete", + "onboarding.summary.intro": "Here is what was configured:", + "onboarding.summary.ner": "NER Detection", + "onboarding.summary.dicts": "Dictionaries", + "onboarding.summary.dicts.count": "{0} file(s) in vault", + "onboarding.summary.hint": "These settings can be changed at any time via plugin settings: Reconfigure.", + + "settings.heading.general": "General", + "settings.heading.textDetection": "Text detection", + "settings.heading.pseudonymization": "Pseudonymization", + "settings.heading.ner": "Automatic detection (NER)", + "settings.heading.storage": "Storage", + "settings.heading.security": "Security", + "settings.language": "Interface language", + "settings.languageDesc": "Does not affect transcript analysis. Conventions (Jefferson, ICOR) are language-independent.", + "settings.vaultPerCorpus": "One vault per corpus", + "settings.vaultPerCorpusDesc": "We recommend using a dedicated Obsidian vault for each corpus. This ensures mapping files, dictionaries and exports stay together with their transcriptions.", + "settings.transcriptionsFolder": "Imported transcriptions", + "settings.transcriptionsFolderDesc": "Destination folder for imported transcriptions.", + "settings.mappingFolder": "Correspondence tables", + "settings.mappingFolderDesc": "Relative path in the vault.", + "settings.dictionariesFolder": "Dictionaries", + "settings.dictionariesFolderDesc": "Relative path in the vault.", + "settings.exportsFolder": "Exports", + "settings.accentSensitive": "Accent sensitive", + "settings.preserveCase": "Preserve case", + "settings.preserveCaseDesc": "Adapt the replacement case to match the source (e.g. JEAN → PIERRE, jean → pierre, Jean → Pierre).", + "settings.preserveAnalyticNotation": "Preserve analytical notation", + "settings.preserveAnalyticNotationDesc": "Never replace Jefferson or ICOR analytical convention symbols.", + "settings.useMarkerInExport": "Add marker around pseudonyms in export", + "settings.useMarkerInExportDesc": "Allows visual identification of pseudonymized terms in the exported file.", + "settings.markerOpen": "Opening marker", + "settings.markerOpenDesc": "Example: {{ ⟦ [ «", + "settings.markerClose": "Closing marker", + "settings.markerCloseDesc": "Example: }} ⟧ ] »", + "settings.nerBackend": "Detection engine", + "settings.nerBackendDesc": "Backend used for automatic detection of identifying named entities.", + "settings.nerBackend.none": "Disabled — manual rules only", + "settings.nerBackend.tfjs": "transformers.js (embedded ONNX model)", + "settings.reconfigure": "Setup wizard", + "settings.reconfigureDesc2": "Relaunch the wizard to reconfigure NER detection and dictionaries.", + "settings.reconfigureBtn2": "Reconfigure…", + "settings.warnIfSyncedFolder": "Warn if folder is synced", + "settings.warnIfSyncedFolderDesc": "Alert if correspondence tables are in a Git, iCloud or Synology Drive folder.", + "settings.caseSensitive": "Case sensitive", + "settings.caseSensitiveDesc": "If enabled, \"Jean\" and \"jean\" are treated as distinct.", + "settings.wholeWordOnly": "Whole words only", + "settings.wholeWordOnlyDesc": "If enabled, only complete word occurrences are replaced." +} diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json new file mode 100644 index 0000000..d7759cd --- /dev/null +++ b/src/i18n/locales/fr.json @@ -0,0 +1,309 @@ +{ + "corpus.modal.title": "Organiser le corpus", + "corpus.modal.hint": "Chaque classe crée des dossiers en miroir pour les transcriptions, les mappings et les exports.", + "corpus.modal.noClasses": "Aucune classe définie. Ajoutez-en une pour organiser vos documents par dossier.", + "corpus.modal.addClass": "Ajouter une classe", + "corpus.modal.classNamePlaceholder": "Nom de la classe (ex. Session_A, Informateur_1…)", + "corpus.modal.classNameEmpty": "Le nom de la classe ne peut pas être vide.", + "corpus.modal.classExists": "Une classe avec ce nom existe déjà.", + "corpus.modal.deleteConfirm": "Supprimer la classe « {0} » ? Les dossiers seront retirés du vault (les fichiers à l'intérieur seront mis à la corbeille).", + "corpus.modal.files": "{0} fichier(s)", + "corpus.modal.close": "Fermer", + "corpus.select.title": "Ajouter dans quelle classe ?", + "corpus.select.hint": "Choisissez la classe (dossier) pour cette transcription.", + "corpus.select.none": "Sans classe (racine)", + "corpus.select.confirm": "Ajouter", + "quickModal.title": "Pseudonymiser", + "quickModal.source": "Expression sélectionnée", + "quickModal.sourceDesc": "Terme à remplacer — non modifiable", + "quickModal.replaceBy": "Remplacer par", + "quickModal.replacementPlaceholder": "Pseudonyme ou catégorie analytique", + "quickModal.scope": "Portée du remplacement", + "quickModal.scopeFile": "Toutes les occurrences dans ce fichier", + "quickModal.scopeOccurrence": "Cette occurrence uniquement", + "quickModal.submit": "Pseudonymiser", + "notice.appliedOccurrence": "✓ \"{0}\" → \"{1}\" (cette occurrence)", + "notice.appliedFile": "✓ \"{0}\" → \"{1}\" ({2} occurrence{3})", + "onboarding.dict.importOk": "{0} dictionnaire importé", + "onboarding.dict.importOkMany": "{0} dictionnaires importés", + "onboarding.dict.importErr": "{0} fichier rejeté", + "onboarding.dict.importErrMany": "{0} fichiers rejetés", + "onboarding.dict.importError": "Erreur lors de l'import de {0} — vérifiez le format .dict.json", + "notice.noActiveFile": "Aucun fichier actif.", + "notice.formatUnsupported": "Format non pris en charge : .{0}", + "notice.noRules": "Aucune règle pour ce fichier.\nCréez des règles via Ctrl+P → \"Créer une règle\".", + "notice.noOccurrences": "Aucune occurrence trouvée pour les règles actives.", + "notice.noNerEntities": "Aucune entité détectée par le NER.", + "notice.nerEntitiesFound": "✓ {0} {1} détectée{2} — surlignée{2} en bleu.\nClic droit pour créer une règle.", + "notice.nerEntitiesFound.entity": "entité", + "notice.nerEntitiesFound.entities": "entités", + "notice.nerNotEnabled": "La détection NER transformers.js n'est pas activée.\nActivez-la dans Paramètres → Pseudonymizer Tool.", + "notice.noDictDetection": "Aucun dictionnaire de détection chargé.\nInstallez un dictionnaire depuis le panneau Dictionnaires.", + "notice.noDictEntities": "Aucune entité trouvée dans les dictionnaires de détection.", + "notice.noDictReplacements": "Aucun remplacement disponible pour les entités trouvées.", + "notice.ruleCreated": "✓ Règle créée : \"{0}\" → \"{1}\"", + "notice.rulesCreated": "✓ {0} règle{1} créée{1}", + "notice.rulesCreated.rule": "", + "notice.rulesCreated.rules": "s", + "notice.occurrencesPseudonymized": "✓ {0} occurrence{1} pseudonymisée{1} dans \"{2}\"", + "notice.occurrencesPseudonymized.occurrence": "", + "notice.occurrencesPseudonymized.occurrences": "s", + "notice.converted": "✓ {0} → {1}", + "notice.conversionError": "Erreur de conversion de {0} : {1}", + "notice.fileExists": "Le fichier existe déjà dans le vault : {0}", + "notice.conversionSkipped": "⚠ {0}.md existe déjà — conversion ignorée pour {1}", + "notice.exportDone": "✓ {0} règle(s) appliquée(s)\n→ {1}", + "notice.mappingExported": "✓ Mapping exporté → {0}", + "notice.noMapping": "Aucun mapping trouvé pour {0}", + "notice.invalidFormat": "Format invalide : {0}", + "notice.dictImported": "✓ {0} dictionnaire{1} importé{1}", + "notice.dictImported.one": "", + "notice.dictImported.many": "s", + "notice.dictRejected": "{0} fichier{1} rejeté{1}", + "notice.dictRejected.one": "", + "notice.dictRejected.many": "s", + "notice.nerModelLoaded": "✓ Modèle NER chargé", + "notice.nerModelLoading": "Chargement du modèle NER (première utilisation — ~66 Mo)…", + "notice.ruleNotFound": "Règle introuvable dans les mappings.", + "notice.noCheckedDicts": "Aucun dictionnaire coché.", + + "command.organizeCorpus": "Organiser le corpus", + "command.addTranscription": "Ajouter une transcription", + "command.pseudonymizeFile": "Pseudonymiser le fichier courant", + "command.createRule": "Créer une règle de remplacement", + "command.scanFile": "Scanner le fichier courant", + "command.scanNer": "Scanner le fichier avec détection NER", + "command.scanDictionaries": "Scanner le fichier avec les dictionnaires", + "command.pseudonymizeSelection": "Pseudonymiser la sélection", + "command.openPanel": "Pseudonymisation : ouvrir le panneau", + + "contextMenu.cancelPseudonymization": "Annuler la pseudonymisation de \"{0}\"", + "contextMenu.editRule": "Modifier la règle pour \"{0}\"", + "contextMenu.pseudonymize": "Pseudonymiser \"{0}\"", + "ruleModal.delete": "Supprimer la règle", + "ruleModal.scopeWarnTitle": "Portée longitudinale", + "ruleModal.scopeOkTitle": "Portée fichier", + "ruleModal.scopeOk": "Bonne pratique. Ce pseudonyme ne s'appliquera qu'à cette transcription — chaque fichier reste indépendant.", + "contextMenu.coulmont": "Pseudonymiser avec Pr Baptiste Coulmont", + "contextMenu.createRule": "Créer une règle de remplacement…", + + "ruleModal.title": "Créer une règle de remplacement", + "ruleModal.source": "Source", + "ruleModal.sourceDesc": "Terme original à remplacer", + "ruleModal.replacement": "Remplacement", + "ruleModal.replacementDesc": "Pseudonyme ou catégorie analytique", + "ruleModal.replacementDescClass": "L'index exact sera calculé à la création selon les règles existantes dans la portée.", + "ruleModal.category": "Catégorie", + "ruleModal.scope": "Portée", + "ruleModal.scopeFile": "Ce fichier uniquement", + "ruleModal.scopeFolder": "Ce dossier", + "ruleModal.scopeVault": "Tout le vault", + "ruleModal.priority": "Priorité", + "ruleModal.priorityDesc": "Entier libre, comme un z-index CSS — défaut 0, plus grand = appliqué en premier", + "ruleModal.submit": "Créer la règle", + "ruleModal.errorMissing": "La source et le remplacement sont obligatoires.", + "ruleModal.errorNoFile": "Aucun fichier actif.", + "ruleModal.coulomontLabel": "Suggestions de prénoms équivalents — choisissez :", + "ruleModal.dictLabel": "Dictionnaire : \"{0}\" → classe {1}", + "ruleModal.dictUseClass": "Utiliser \"{0}\" (portée : {1})", + + "category.first_name": "Prénom", + "category.last_name": "Nom de famille", + "category.full_name": "Nom complet", + "category.place": "Lieu", + "category.institution": "Institution", + "category.date": "Date", + "category.age": "Âge", + "category.profession": "Profession", + "category.custom": "Autre", + + "scope.file": "Fichier", + "scope.folder": "Dossier", + "scope.vault": "Vault", + + "status.validated": "✓", + "status.ignored": "✗", + "status.partial": "◑", + "status.suggested": "?", + "status.conflict": "⚠", + "status.disabled": "–", + "status.needs_review": "👁", + + "panel.tab.mappings": "Mappings", + "panel.tab.dictionaries": "Dictionnaires", + "panel.tab.exports": "Exports", + "panel.tab.ner": "NER", + + "panel.mappings.filterActive": "Fichier actif uniquement", + "panel.mappings.warnBroadName": "⚠ Généraliser un prénom ou un nom de famille au-delà du fichier ne doit être fait que comme choix analytique délibéré — par exemple pour suivre de manière cohérente le même participant dans une étude longitudinale. Même si le même individu apparaît dans plusieurs fichiers, la pseudonymisation à l'échelle du fichier reste préférable : elle préserve l'indépendance de chaque transcription et réduit le risque d'identification croisée.", + "panel.mappings.addRule": "Ajouter une règle", + "panel.mappings.scanFile": "Scanner le fichier", + "panel.mappings.scanning": "Scan en cours…", + "panel.mappings.noFile": "Aucun fichier actif.", + "panel.mappings.noRules": "Aucune règle pour {0}.", + "panel.mappings.noRulesHint": "Aucune règle active pour ce fichier. Créez des règles via le menu contextuel ou la commande \"créer une règle\".", + "panel.mappings.col.source": "Source", + "panel.mappings.col.replacement": "Remplacement", + "panel.mappings.col.category": "Catégorie", + "panel.mappings.col.scope": "Portée", + "panel.mappings.col.priority": "P.", + "panel.mappings.col.status": "Statut", + + "panel.dict.noneInstalled": "Aucun dictionnaire installé. Installez-en un depuis le wizard (Paramètres → Reconfigurer) ou importez un fichier local.", + "panel.dict.checkbox": "Inclure dans le scan groupé", + "panel.dict.scanAll": "Scanner les dictionnaires cochés", + "panel.dict.importLocal": "Importer un fichier local (.dict.json)", + "panel.dict.scanWith": "Scanner le fichier actif avec \"{0}\"", + "panel.dict.remove": "Supprimer ce dictionnaire", + + "panel.exports.pseudonymize": "Pseudonymiser et exporter", + "panel.exports.exportMapping": "Exporter la table de correspondance", + + "panel.ner.scanBtn": "Identifier des candidats", + "panel.ner.hint": "Paramètres du scanner de détection automatique des entités nommées.", + "panel.ner.threshold": "Seuil de confiance", + "panel.ner.thresholdDesc": "Les entités dont le score est inférieur à cette valeur sont ignorées. Plus la valeur est haute, moins de faux positifs mais aussi moins de détections.", + "panel.ner.functionWords": "Mots fonctionnels exclus", + "panel.ner.functionWordsDesc": "Un mot par ligne. Ces termes ne seront jamais retenus comme entités nommées, même si le modèle les détecte (artefacts de tokenisation).", + "panel.ner.save": "Enregistrer", + "panel.ner.saved": "Enregistré", + "panel.ner.reset": "Réinitialiser par défaut", + + "dictScanModal.title": "Révision du scan — dictionnaires", + "dictScanModal.summary": "{0} entité{1} détectée{1} · {2}", + "dictScanModal.summary.entity": "", + "dictScanModal.summary.entities": "s", + "dictScanModal.hint": "Décochez les faux positifs. Le préfixe est éditable ; l'index est calculé automatiquement.", + "dictScanModal.apply": "Créer {0} règle{1}", + "dictScanModal.apply.rule": "", + "dictScanModal.apply.rules": "s", + "dictScanModal.noRules": "Aucune règle à appliquer", + "dictScanModal.cancel": "Annuler", + + "mappingScanModal.title": "Révision du scan — mappings", + "mappingScanModal.summary": "{0} règle{1} active{1} avec des occurrences dans \"{2}\"", + "mappingScanModal.summary.rule": "", + "mappingScanModal.summary.rules": "s", + "mappingScanModal.hint": "Décochez les règles à ne pas appliquer. Les remplacements seront écrits dans le fichier source.", + "mappingScanModal.col.source": "", + "mappingScanModal.col.replacement": "Remplacement", + "mappingScanModal.col.occurrences": "Occ.", + "mappingScanModal.apply": "Pseudonymiser ({0} règle{1}, {2} occurrence{3})", + "mappingScanModal.apply.rule": "", + "mappingScanModal.apply.rules": "s", + "mappingScanModal.apply.occurrence": "", + "mappingScanModal.apply.occurrences": "s", + "mappingScanModal.noRules": "Aucune règle à appliquer", + "mappingScanModal.cancel": "Annuler", + + "onboarding.step.storage": "Stockage", + "onboarding.step.language": "Langue", + "onboarding.step.welcome": "Bienvenue", + "onboarding.step.ner": "Détection NER", + "onboarding.step.dictionaries": "Dictionnaires", + "onboarding.step.summary": "Résumé", + "onboarding.welcome.title": "Pseudonymizer Tool", + "onboarding.welcome.desc": "Ce plugin vous aide à corriger et pseudonymiser des transcriptions d'entretiens et de corpus interactionnels (conventions Jefferson, ICOR, formats .srt, .cha).", + "onboarding.welcome.steps": "L'assistant va vous guider en quelques étapes rapides :", + "onboarding.welcome.step1": "Choisir la langue de l'interface.", + "onboarding.welcome.step2": "Choisir un moteur de détection automatique des entités nommées (optionnel).", + "onboarding.welcome.step3": "Installer des dictionnaires de candidats de remplacement si vous en avez besoin.", + "onboarding.welcome.hint": "Vous pourrez reconfigurer ces options à tout moment via les paramètres du plugin.", + "onboarding.storage.title": "Stockage", + "onboarding.storage.vaultPerCorpus": "Un vault par corpus", + "onboarding.storage.vaultPerCorpusDesc": "Nous recommandons d'utiliser un vault Obsidian dédié par corpus. Cela garantit que les fichiers de mapping, les dictionnaires et les exports restent avec leurs transcriptions, et facilite le partage ou l'archivage d'un corpus.", + "onboarding.storage.transcriptionsFolder": "Transcriptions", + "onboarding.storage.mappingFolder": "Tables de correspondance", + "onboarding.storage.dictionariesFolder": "Dictionnaires", + "onboarding.storage.exportsFolder": "Exports", + "onboarding.storage.hint": "Ces chemins sont relatifs à la racine du vault. Vous pouvez les modifier ultérieurement dans les Paramètres.", + "onboarding.language.title": "Langue de l'interface", + "onboarding.language.hint": "La langue de l'interface n'a aucun effet sur l'analyse des transcriptions. Les conventions (Jefferson, ICOR) sont indépendantes de la langue.", + "onboarding.ner.desc": "Un modèle NER (reconnaissance d'entités nommées) peut détecter automatiquement les prénoms, noms, lieux et institutions dans vos transcriptions — sans liste exhaustive, directement dans Obsidian.", + "onboarding.ner.tfjsTitle": "transformers.js — modèle ONNX embarqué", + "onboarding.ner.tfjsBadge": "Python n'est pas requis", + "onboarding.ner.tfjsDesc": "Modèle NER multilingue exécuté localement dans le vault. Les fichiers .wasm (~19 Mo) sont téléchargés une seule fois ici. Le modèle (~66 Mo) est téléchargé au premier scan.", + "onboarding.ner.wasmReady": "Fichiers .wasm déjà installés", + "onboarding.ner.installBtn": "Installer et utiliser transformers.js", + "onboarding.ner.selectedBtn": "Sélectionné", + "onboarding.ner.noneActive": "Désactivé (règles manuelles uniquement)", + "onboarding.ner.noneSkip": "Passer — je travaillerai manuellement", + + "onboarding.dict.title": "Dictionnaires de candidats de remplacement", + "onboarding.dict.desc": "Les dictionnaires fournissent des candidats de remplacement (villes, prénoms…) et alimentent la détection automatique. Ils sont hébergés dans un dépôt dédié et téléchargés dans votre vault — aucune donnée de transcription ne quitte Obsidian.", + "onboarding.dict.catalogueLoading": "Chargement du catalogue…", + "onboarding.dict.catalogueError": "Impossible de contacter le catalogue en ligne. Vérifiez votre connexion ou importez un fichier local ci-dessous.", + "onboarding.dict.recommended": "Recommandé", + "onboarding.dict.col.dict": "Dictionnaire", + "onboarding.dict.col.lang": "Langue", + "onboarding.dict.col.roles": "Rôles", + "onboarding.dict.col.size": "Taille", + "onboarding.dict.role.detection": "détection", + "onboarding.dict.role.replacement": "remplacement", + "onboarding.dict.role.classes": "classes", + "onboarding.dict.install": "Installer", + "onboarding.dict.reinstall": "Réinstaller", + "onboarding.dict.installed": "Installé", + "onboarding.dict.manualHint": "Vous avez déjà un fichier .dict.json ? Importez-le manuellement :", + "onboarding.dict.importBtn": "Importer un fichier local (.dict.json)", + "onboarding.dict.listTitle": "Dictionnaires installés dans ce vault ({0}) :", + "onboarding.dict.remove": "Retirer ce dictionnaire", + + "onboarding.summary.ner.none": "Désactivé — règles manuelles uniquement", + "onboarding.summary.ner.tfjs": "transformers.js — modèle ONNX (téléchargement au premier scan)", + + "onboarding.nav.cancel": "Annuler", + "onboarding.nav.back": "Retour", + "onboarding.nav.skip": "Passer cette étape", + "onboarding.nav.next": "Suivant", + "onboarding.nav.start": "Commencer", + "onboarding.nav.finish": "Commencer à travailler", + "onboarding.summary.title": "Configuration terminée", + "onboarding.summary.intro": "Voici ce qui a été configuré :", + "onboarding.summary.ner": "Détection NER", + "onboarding.summary.dicts": "Dictionnaires", + "onboarding.summary.dicts.count": "{0} fichier(s) dans le vault", + "onboarding.summary.hint": "Ces paramètres sont modifiables à tout moment via les paramètres du plugin : Reconfigurer.", + + "settings.heading.general": "Général", + "settings.heading.textDetection": "Détection du texte", + "settings.heading.pseudonymization": "Pseudonymisation", + "settings.heading.ner": "Détection automatique (NER)", + "settings.heading.storage": "Stockage", + "settings.heading.security": "Sécurité", + "settings.language": "Langue de l'interface", + "settings.languageDesc": "N'affecte pas l'analyse des transcriptions. Les conventions (Jefferson, ICOR) sont indépendantes de la langue.", + "settings.vaultPerCorpus": "Un vault par corpus", + "settings.vaultPerCorpusDesc": "Nous recommandons d'utiliser un vault Obsidian dédié par corpus. Cela garantit que les fichiers de mapping, les dictionnaires et les exports restent avec leurs transcriptions.", + "settings.transcriptionsFolder": "Transcriptions importées", + "settings.transcriptionsFolderDesc": "Dossier de destination des transcriptions importées.", + "settings.mappingFolder": "Tables de correspondance", + "settings.mappingFolderDesc": "Chemin relatif dans le vault.", + "settings.dictionariesFolder": "Dictionnaires", + "settings.dictionariesFolderDesc": "Chemin relatif dans le vault.", + "settings.exportsFolder": "Exports", + "settings.accentSensitive": "Sensible aux accents", + "settings.preserveCase": "Préserver la casse", + "settings.preserveCaseDesc": "Adapter la casse du remplacement à celle de la source (ex. : JEAN → PIERRE, jean → pierre, Jean → Pierre).", + "settings.preserveAnalyticNotation": "Préserver les notations analytiques", + "settings.preserveAnalyticNotationDesc": "Ne jamais remplacer les symboles de convention analytique de type Jefferson ou ICOR.", + "settings.useMarkerInExport": "Ajouter un marqueur autour des pseudonymes dans l'export", + "settings.useMarkerInExportDesc": "Permet d'identifier visuellement les termes pseudonymisés dans le fichier exporté.", + "settings.markerOpen": "Marqueur ouvrant", + "settings.markerOpenDesc": "Exemple : {{ ⟦ [ «", + "settings.markerClose": "Marqueur fermant", + "settings.markerCloseDesc": "Exemple : }} ⟧ ] »", + "settings.nerBackend": "Moteur de détection", + "settings.nerBackendDesc": "Backend utilisé pour la détection automatique des entités nommées identifiantes.", + "settings.nerBackend.none": "Désactivé — règles manuelles uniquement", + "settings.nerBackend.tfjs": "transformers.js (modèle ONNX embarqué)", + "settings.reconfigure": "Assistant de configuration", + "settings.reconfigureDesc2": "Relancer l'assistant pour reconfigurer la détection NER et les dictionnaires.", + "settings.reconfigureBtn2": "Reconfigurer…", + "settings.warnIfSyncedFolder": "Avertir si le dossier est synchronisé", + "settings.warnIfSyncedFolderDesc": "Alerter si les tables de correspondance sont dans un dossier Git, iCloud ou Synology Drive.", + "settings.caseSensitive": "Sensible à la casse", + "settings.caseSensitiveDesc": "Si activé, \"Jean\" et \"jean\" sont traités comme distincts.", + "settings.wholeWordOnly": "Mots entiers uniquement", + "settings.wholeWordOnlyDesc": "Si activé, seules les occurrences de mots complets sont remplacées." +} diff --git a/src/main.ts b/src/main.ts index 24d0853..9163241 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,5 @@ import { Plugin, Notice, TFile, TAbstractFile, Editor, Menu, MarkdownView, requestUrl, WorkspaceLeaf } from 'obsidian'; +import { t, setLocale } from './i18n'; import { EditorView } from '@codemirror/view'; import { PseudObsSettings, DEFAULT_SETTINGS, PseudObsSettingTab } from './settings'; import { RuleModal } from './ui/RuleModal'; @@ -10,6 +11,7 @@ import { OnboardingModal } from './ui/OnboardingModal'; import { OnnxNerScanner } from './scanner/OnnxNerScanner'; import { DictionaryLoader } from './dictionaries/DictionaryLoader'; import { DictScanReviewModal } from './ui/DictScanReviewModal'; +import { CorpusModal, ClassSelectModal, getCorpusClasses } from './ui/CorpusModal'; import type { DictScanResultItem } from './ui/DictScanReviewModal'; import { MappingScanReviewModal } from './ui/MappingScanReviewModal'; import type { MappingRuleResult } from './ui/MappingScanReviewModal'; @@ -39,6 +41,7 @@ export default class PseudObsPlugin extends Plugin { async onload(): Promise { await this.loadSettings(); + setLocale(this.settings.language); this.scopeResolver = new ScopeResolver(this.app.vault, this.settings.mappingFolder); this.nerScanner = new OnnxNerScanner(this.app); this.dictionaryLoader = new DictionaryLoader(this.app, this); @@ -79,21 +82,27 @@ export default class PseudObsPlugin extends Plugin { }) ); + this.addCommand({ + id: 'organize-corpus', + name: t('command.organizeCorpus'), + callback: () => new CorpusModal(this.app, this).open(), + }); + this.addCommand({ id: 'add-transcription', - name: 'Ajouter une transcription', + name: t('command.addTranscription'), callback: () => this.openFilePicker(), }); this.addCommand({ id: 'pseudonymize-current-file', - name: 'Pseudonymiser le fichier courant', + name: t('command.pseudonymizeFile'), callback: () => this.pseudonymizeActiveFile(), }); this.addCommand({ id: 'create-rule', - name: 'Créer une règle de remplacement', + name: t('command.createRule'), editorCallback: (editor) => { new RuleModal(this.app, this, editor.getSelection()).open(); }, @@ -101,25 +110,25 @@ export default class PseudObsPlugin extends Plugin { this.addCommand({ id: 'scan-current-file', - name: 'Scanner le fichier courant', + name: t('command.scanFile'), callback: () => this.scanCurrentFile(), }); this.addCommand({ id: 'scan-ner', - name: 'Scanner le fichier avec détection NER', + name: t('command.scanNer'), callback: () => void this.scanCurrentFileNer(), }); this.addCommand({ id: 'scan-dictionaries', - name: 'Scanner le fichier avec les dictionnaires', + name: t('command.scanDictionaries'), callback: () => void this.scanCurrentFileWithDictionaries(), }); this.addCommand({ id: 'pseudonymize-selection', - name: 'Pseudonymiser la sélection', + name: t('command.pseudonymizeSelection'), editorCheckCallback: (checking, editor) => { if (!editor.getSelection()) return false; if (!checking) new QuickPseudonymizeModal(this.app, this, editor).open(); @@ -144,16 +153,16 @@ export default class PseudObsPlugin extends Plugin { const isReplacement = this.highlightData.replacements.some((r) => r.toLowerCase() === bareLower); const isKnown = isSource || isReplacement; + const truncate = (s: string) => s.slice(0, 25) + (s.length > 25 ? '…' : ''); + if (isReplacement) { - // Terme déjà pseudonymisé : proposer l'annulation en premier menu.addItem((item) => item - .setTitle(`Annuler la pseudonymisation de "${bare.slice(0, 25)}${bare.length > 25 ? '…' : ''}"`) + .setTitle(t('contextMenu.cancelPseudonymization', truncate(bare))) .setIcon('undo') .onClick(async () => { const location = await this.scopeResolver.findRuleByTerm(bare); - if (!location) { new Notice('Règle introuvable dans les mappings.'); return; } - // Remplacer la sélection (avec ou sans marqueurs) par la source originale + if (!location) { new Notice(t('notice.ruleNotFound')); return; } editor.replaceSelection(location.rule.source); void this.refreshHighlightData(); }) @@ -163,14 +172,14 @@ export default class PseudObsPlugin extends Plugin { if (isKnown) { menu.addItem((item) => item - .setTitle(`Modifier la règle pour "${bare.slice(0, 25)}${bare.length > 25 ? '…' : ''}"`) + .setTitle(t('contextMenu.editRule', truncate(bare))) .setIcon('settings') .onClick(async () => { const location = await this.scopeResolver.findRuleByTerm(bare); if (location) { new EditRuleModal(this.app, this, location).open(); } else { - new Notice('Règle introuvable dans les mappings.'); + new Notice(t('notice.ruleNotFound')); } }) ); @@ -178,14 +187,14 @@ export default class PseudObsPlugin extends Plugin { menu.addItem((item) => item - .setTitle(`Pseudonymiser "${selection.slice(0, 25)}${selection.length > 25 ? '…' : ''}"`) + .setTitle(t('contextMenu.pseudonymize', truncate(selection))) .setIcon('eye-off') .onClick(() => new QuickPseudonymizeModal(this.app, this, editor).open()) ); menu.addItem((item) => item - .setTitle(`Pseudonymiser avec Pr Baptiste Coulmont`) + .setTitle(t('contextMenu.coulmont')) .setIcon('book-user') .onClick(async () => { const notice = new Notice('Recherche sur coulmont.com…', 0); @@ -200,7 +209,7 @@ export default class PseudObsPlugin extends Plugin { ); menu.addItem((item) => item - .setTitle('Créer une règle de remplacement…') + .setTitle(t('contextMenu.createRule')) .setIcon('pencil') .onClick(() => new RuleModal(this.app, this, selection).open()) ); @@ -315,13 +324,12 @@ export default class PseudObsPlugin extends Plugin { // Si un .md du même nom existe déjà, ne pas écraser if (this.app.vault.getAbstractFileByPath(mdPath) instanceof TFile) { - new Notice(`⚠ ${basename}.md existe déjà — conversion ignorée pour ${file.name}`); + new Notice(t('notice.conversionSkipped', basename, file.name)); return; } await this.app.vault.create(mdPath, mdContent); - // Mapping JSON vide const mappingPath = `${this.settings.mappingFolder}/${basename}.mapping.json`; if (!this.app.vault.getAbstractFileByPath(mappingPath)) { await this.ensureFolder(this.settings.mappingFolder); @@ -329,18 +337,16 @@ export default class PseudObsPlugin extends Plugin { await this.app.vault.create(mappingPath, JSON.stringify(store.toJSON(), null, 2)); } - // Supprimer le fichier source non-Markdown maintenant remplacé par le .md await this.app.fileManager.trashFile(file); - // Ouvrir le .md const mdFile = this.app.vault.getAbstractFileByPath(mdPath); if (mdFile instanceof TFile) { await this.app.workspace.getLeaf().openFile(mdFile); } - new Notice(`✓ ${file.name} → ${basename}.md`); + new Notice(t('notice.converted', file.name, `${basename}.md`)); } catch (e) { - new Notice(`Erreur de conversion de ${file.name} : ${(e as Error).message}`); + new Notice(t('notice.conversionError', file.name, (e as Error).message)); } } @@ -370,17 +376,26 @@ export default class PseudObsPlugin extends Plugin { private async copyToVault(browserFile: File): Promise { const raw = await browserFile.text(); - const destFolder = this.settings.transcriptionsFolder; - await this.ensureFolder(destFolder); - const destPath = `${destFolder}/${browserFile.name}`; + + // Sélection de classe si le corpus est organisé en sous-dossiers + const classes = getCorpusClasses(this.app, this.settings.transcriptionsFolder); + let targetFolder = this.settings.transcriptionsFolder; + + if (classes.length > 0) { + const modal = new ClassSelectModal(this.app, this, classes); + const chosen = await modal.prompt(); + if (chosen === undefined) return; // annulé + if (chosen !== null) targetFolder = `${this.settings.transcriptionsFolder}/${chosen}`; + } + + await this.ensureFolder(targetFolder); + const destPath = `${targetFolder}/${browserFile.name}`; if (this.app.vault.getAbstractFileByPath(destPath) instanceof TFile) { - new Notice(`Le fichier existe déjà dans le vault : ${browserFile.name}`); + new Notice(t('notice.fileExists', browserFile.name)); return; } - // Créer le fichier brut dans le vault — le watcher vault.on('create') prendra le relai - // pour les formats convertibles (.srt, .cha, .chat) await this.app.vault.create(destPath, raw); } @@ -388,21 +403,18 @@ export default class PseudObsPlugin extends Plugin { async pseudonymizeActiveFile(): Promise { const file = this.app.workspace.getActiveFile(); - if (!file) { new Notice('Aucun fichier actif.'); return; } + if (!file) { new Notice(t('notice.noActiveFile')); return; } const ext = file.extension.toLowerCase(); if (!['srt', 'cha', 'chat', 'md', 'txt'].includes(ext)) { - new Notice(`Format non pris en charge : .${ext}`); + new Notice(t('notice.formatUnsupported', ext)); return; } const content = await this.app.vault.read(file); - // Charger les règles depuis les trois niveaux (fichier + dossier + vault) const rules = await this.scopeResolver.getRulesFor(file.path); if (rules.length === 0) { - new Notice( - `Aucune règle validée.\nCréez des règles via Ctrl+P → "Créer une règle".\nMapping attendu : ${this.settings.mappingFolder}/${file.basename}.mapping.json` - ); + new Notice(t('notice.noRules')); return; } @@ -445,7 +457,7 @@ export default class PseudObsPlugin extends Plugin { await this.app.vault.create(outputPath, pseudonymized); } - new Notice(`✓ ${rules.length} règle(s) appliquée(s)\n→ ${outputPath}`); + new Notice(t('notice.exportDone', String(rules.length), outputPath)); } async scanCurrentFileNer(): Promise { @@ -455,11 +467,11 @@ export default class PseudObsPlugin extends Plugin { } const file = this.app.workspace.getActiveFile(); - if (!file) { new Notice('Aucun fichier actif.'); return; } + if (!file) { new Notice(t('notice.noActiveFile')); return; } const ext = file.extension.toLowerCase(); if (!['srt', 'cha', 'chat', 'md', 'txt'].includes(ext)) { - new Notice(`Format non pris en charge : .${ext}`); + new Notice(t('notice.formatUnsupported', ext)); return; } @@ -471,39 +483,33 @@ export default class PseudObsPlugin extends Plugin { }); if (occurrences.length === 0) { - new Notice('Aucune entité détectée par le NER.'); + new Notice(t('notice.noNerEntities')); return; } - // Dédoublonner — un terme peut apparaître plusieurs fois dans le texte const unique = [...new Set(occurrences.map((o) => o.text).filter(Boolean))]; - this.nerCandidateFile = file; this.nerCandidates = unique; - void this.refreshHighlightData(); - new Notice( - `✓ ${unique.length} entité${unique.length > 1 ? 's' : ''} détectée${unique.length > 1 ? 's' : ''} — surlignée${unique.length > 1 ? 's' : ''} en bleu.\nClic droit sur un terme pour créer une règle.`, - 6000 - ); + new Notice(t('notice.nerEntitiesFound', String(unique.length), unique.length > 1 ? t('notice.nerEntitiesFound.entities') : t('notice.nerEntitiesFound.entity')), 6000); } catch (e) { - new Notice(`Erreur NER : ${(e as Error).message}`); + new Notice(`NER error: ${(e as Error).message}`); } } async scanCurrentFileWithDictionaries(dictIds?: string[]): Promise { if (!this.dictionaryLoader.hasDetection()) { - new Notice('Aucun dictionnaire de détection chargé.\nInstallez un dictionnaire depuis le panneau Dictionnaires.'); + new Notice(t('notice.noDictDetection')); return; } const file = this.app.workspace.getActiveFile(); - if (!file) { new Notice('Aucun fichier actif.'); return; } + if (!file) { new Notice(t('notice.noActiveFile')); return; } const ext = file.extension.toLowerCase(); if (!['srt', 'cha', 'chat', 'md', 'txt'].includes(ext)) { - new Notice(`Format non pris en charge : .${ext}`); + new Notice(t('notice.formatUnsupported', ext)); return; } @@ -514,7 +520,7 @@ export default class PseudObsPlugin extends Plugin { const occurrences = this.dictionaryLoader.scanText(content, file.path, existingSources, dictIds); if (occurrences.length === 0) { - new Notice('Aucune entité trouvée dans les dictionnaires de détection.'); + new Notice(t('notice.noDictEntities')); return; } @@ -587,7 +593,7 @@ export default class PseudObsPlugin extends Plugin { const mappingFile = this.app.vault.getAbstractFileByPath(mappingPath); if (!(mappingFile instanceof TFile)) { - new Notice(`Aucun mapping trouvé pour ${file.name}`); + new Notice(t('notice.noMapping', file.name)); return; } @@ -602,16 +608,16 @@ export default class PseudObsPlugin extends Plugin { await this.app.vault.create(destPath, content); } - new Notice(`✓ Mapping exporté → ${destPath}`); + new Notice(t('notice.mappingExported', destPath)); } private async scanCurrentFile(): Promise { const file = this.app.workspace.getActiveFile(); - if (!file) { new Notice('Aucun fichier actif.'); return; } + if (!file) { new Notice(t('notice.noActiveFile')); return; } const rules = await this.scopeResolver.getRulesFor(file.path); if (rules.length === 0) { - new Notice('Aucune règle pour ce fichier.\nCréez des règles via Ctrl+P → "Créer une règle".'); + new Notice(t('notice.noRules')); return; } @@ -622,7 +628,7 @@ export default class PseudObsPlugin extends Plugin { }); if (occurrences.length === 0) { - new Notice('Aucune occurrence trouvée pour les règles actives.'); + new Notice(t('notice.noOccurrences')); return; } diff --git a/src/mappings/ScopeResolver.ts b/src/mappings/ScopeResolver.ts index 06cc876..3cc17cd 100644 --- a/src/mappings/ScopeResolver.ts +++ b/src/mappings/ScopeResolver.ts @@ -103,6 +103,30 @@ export class ScopeResolver { return result; } + // Retourne TOUTES les règles de TOUS les fichiers de mapping, sans filtre de scope. + // Utilisé par l'onglet Mappings en mode "toutes les règles". + async getAllRulesWithLocation(): Promise { + const folder = this.vault.getAbstractFileByPath(this.mappingFolder); + if (!(folder instanceof TFolder)) return []; + + const result: RuleLocation[] = []; + + for (const child of folder.children) { + if (!(child instanceof TFile) || !child.name.endsWith('.mapping.json')) continue; + try { + const data = JSON.parse(await this.vault.read(child)) as MappingFile; + const store = MappingStore.fromJSON(data); + for (const rule of store.getAll()) { + result.push({ rule, store, filePath: child.path }); + } + } catch { + // ignorer les fichiers malformés + } + } + + return result; + } + // Charge les règles validées d'un fichier de mapping spécifique, sans filtre de scope. // Utilisé pour les fichiers exportés (*.pseudonymized.*) dont le scope path ne correspond pas. async getRulesFromMappingFile(mappingFilename: string): Promise { diff --git a/src/settings.ts b/src/settings.ts index 52a4526..0a6bf03 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,6 +1,7 @@ import { App, PluginSettingTab, Setting } from 'obsidian'; import type PseudObsPlugin from './main'; import { OnboardingModal } from './ui/OnboardingModal'; +import { t, setLocale, AVAILABLE_LANGUAGES } from './i18n'; export type NerBackend = 'none' | 'spacy' | 'transformers-js'; @@ -19,6 +20,8 @@ export interface PseudObsSettings { useMarkerInExport: boolean; markerOpen: string; markerClose: string; + // Langue de l'interface + language: string; // Onboarding onboardingCompleted: boolean; nerBackend: NerBackend; @@ -43,6 +46,7 @@ export const DEFAULT_SETTINGS: PseudObsSettings = { useMarkerInExport: true, markerOpen: '{{', markerClose: '}}', + language: 'en', onboardingCompleted: false, nerBackend: 'none', spacyServerUrl: 'http://localhost:5757', @@ -67,69 +71,40 @@ export class PseudObsSettingTab extends PluginSettingTab { const { containerEl } = this; containerEl.empty(); - new Setting(containerEl).setName('Dossiers').setHeading(); + // ---- Général ------------------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.general')).setHeading(); new Setting(containerEl) - .setName('Transcriptions importées') - .setDesc('Dossier de destination des transcriptions importées') - .addText((text) => - text.setValue(this.plugin.settings.transcriptionsFolder).onChange(async (value) => { - this.plugin.settings.transcriptionsFolder = value; + .setName(t('settings.language')) + .setDesc(t('settings.languageDesc')) + .addDropdown((d) => { + for (const [code, name] of Object.entries(AVAILABLE_LANGUAGES)) { + d.addOption(code, name); + } + d.setValue(this.plugin.settings.language); + d.onChange(async (v) => { + this.plugin.settings.language = v; await this.plugin.saveSettings(); + setLocale(v); + this.display(); + }); + }); + + new Setting(containerEl) + .setName(t('settings.reconfigure')) + .setDesc(t('settings.reconfigureDesc2')) + .addButton((btn) => + btn.setButtonText(t('settings.reconfigureBtn2')).onClick(() => { + new OnboardingModal(this.app, this.plugin).open(); }) ); - new Setting(containerEl) - .setName('Tables de correspondance') - .setDesc('Chemin relatif dans le vault') - .addText((text) => - text.setValue(this.plugin.settings.mappingFolder).onChange(async (value) => { - this.plugin.settings.mappingFolder = value; - await this.plugin.saveSettings(); - }) - ); + // ---- Détection du texte -------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.textDetection')).setHeading(); new Setting(containerEl) - .setName('Dictionnaires') - .setDesc('Chemin relatif dans le vault') - .addText((text) => - text.setValue(this.plugin.settings.dictionariesFolder).onChange(async (value) => { - this.plugin.settings.dictionariesFolder = value; - await this.plugin.saveSettings(); - }) - ); - - new Setting(containerEl) - .setName('Exports') - .addText((text) => - text.setValue(this.plugin.settings.exportsFolder).onChange(async (value) => { - this.plugin.settings.exportsFolder = value; - await this.plugin.saveSettings(); - }) - ); - - new Setting(containerEl).setName('Remplacement').setHeading(); - - new Setting(containerEl) - .setName('Sensible à la casse') - .addToggle((toggle) => - toggle.setValue(this.plugin.settings.caseSensitive).onChange(async (value) => { - this.plugin.settings.caseSensitive = value; - await this.plugin.saveSettings(); - }) - ); - - new Setting(containerEl) - .setName('Sensible aux accents') - .addToggle((toggle) => - toggle.setValue(this.plugin.settings.accentSensitive).onChange(async (value) => { - this.plugin.settings.accentSensitive = value; - await this.plugin.saveSettings(); - }) - ); - - new Setting(containerEl) - .setName('Mots entiers uniquement') + .setName(t('settings.wholeWordOnly')) + .setDesc(t('settings.wholeWordOnlyDesc')) .addToggle((toggle) => toggle.setValue(this.plugin.settings.wholeWordOnly).onChange(async (value) => { this.plugin.settings.wholeWordOnly = value; @@ -138,8 +113,30 @@ export class PseudObsSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName('Préserver la casse') - .setDesc('Adapter la casse du remplacement à celle de la source (ex. : JEAN → PIERRE, jean → pierre, Jean → Pierre)') + .setName(t('settings.caseSensitive')) + .setDesc(t('settings.caseSensitiveDesc')) + .addToggle((toggle) => + toggle.setValue(this.plugin.settings.caseSensitive).onChange(async (value) => { + this.plugin.settings.caseSensitive = value; + await this.plugin.saveSettings(); + }) + ); + + new Setting(containerEl) + .setName(t('settings.accentSensitive')) + .addToggle((toggle) => + toggle.setValue(this.plugin.settings.accentSensitive).onChange(async (value) => { + this.plugin.settings.accentSensitive = value; + await this.plugin.saveSettings(); + }) + ); + + // ---- Pseudonymisation ---------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.pseudonymization')).setHeading(); + + new Setting(containerEl) + .setName(t('settings.preserveCase')) + .setDesc(t('settings.preserveCaseDesc')) .addToggle((toggle) => toggle.setValue(this.plugin.settings.preserveCase).onChange(async (value) => { this.plugin.settings.preserveCase = value; @@ -148,8 +145,8 @@ export class PseudObsSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName('Préserver les notations analytiques') - .setDesc('Ne jamais remplacer les symboles de convention analytique de type Jefferson ou ICOR') + .setName(t('settings.preserveAnalyticNotation')) + .setDesc(t('settings.preserveAnalyticNotationDesc')) .addToggle((toggle) => toggle .setValue(this.plugin.settings.preserveAnalyticNotation) @@ -159,11 +156,9 @@ export class PseudObsSettingTab extends PluginSettingTab { }) ); - new Setting(containerEl).setName("Marqueur d'export").setHeading(); - new Setting(containerEl) - .setName('Ajouter un marqueur autour des pseudonymes dans l\'export') - .setDesc('Permet d\'identifier visuellement les termes pseudonymisés dans le fichier exporté') + .setName(t('settings.useMarkerInExport')) + .setDesc(t('settings.useMarkerInExportDesc')) .addToggle((toggle) => toggle.setValue(this.plugin.settings.useMarkerInExport).onChange(async (value) => { this.plugin.settings.useMarkerInExport = value; @@ -172,8 +167,8 @@ export class PseudObsSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName('Marqueur ouvrant') - .setDesc('Exemple : {{ ⟦ [ «') + .setName(t('settings.markerOpen')) + .setDesc(t('settings.markerOpenDesc')) .addText((text) => text.setValue(this.plugin.settings.markerOpen).onChange(async (value) => { this.plugin.settings.markerOpen = value; @@ -182,8 +177,8 @@ export class PseudObsSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName('Marqueur fermant') - .setDesc('Exemple : }} ⟧ ] »') + .setName(t('settings.markerClose')) + .setDesc(t('settings.markerCloseDesc')) .addText((text) => text.setValue(this.plugin.settings.markerClose).onChange(async (value) => { this.plugin.settings.markerClose = value; @@ -191,14 +186,15 @@ export class PseudObsSettingTab extends PluginSettingTab { }) ); - new Setting(containerEl).setName('Détection automatique (NER)').setHeading(); + // ---- Détection NER ------------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.ner')).setHeading(); new Setting(containerEl) - .setName('Moteur de détection') - .setDesc('Backend utilisé pour la détection automatique des entités nommées identifiantes') + .setName(t('settings.nerBackend')) + .setDesc(t('settings.nerBackendDesc')) .addDropdown((d) => { - d.addOption('none', 'Désactivé — règles manuelles uniquement'); - d.addOption('transformers-js', 'transformers.js (modèle ONNX embarqué)'); + d.addOption('none', t('settings.nerBackend.none')); + d.addOption('transformers-js', t('settings.nerBackend.tfjs')); d.setValue(this.plugin.settings.nerBackend); d.onChange(async (v) => { this.plugin.settings.nerBackend = v as PseudObsSettings['nerBackend']; @@ -207,20 +203,58 @@ export class PseudObsSettingTab extends PluginSettingTab { }); }); + // ---- Stockage ------------------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.storage')).setHeading(); + new Setting(containerEl) - .setName('Assistant de configuration') - .setDesc('Relancer l\'assistant pour reconfigurer la détection NER et les dictionnaires') - .addButton((btn) => - btn.setButtonText('Reconfigurer…').onClick(() => { - new OnboardingModal(this.app, this.plugin).open(); + .setName(t('settings.transcriptionsFolder')) + .setDesc(t('settings.transcriptionsFolderDesc')) + .addText((text) => + text.setValue(this.plugin.settings.transcriptionsFolder).onChange(async (value) => { + this.plugin.settings.transcriptionsFolder = value; + await this.plugin.saveSettings(); }) ); - new Setting(containerEl).setName('Sécurité').setHeading(); + new Setting(containerEl) + .setName(t('settings.mappingFolder')) + .setDesc(t('settings.mappingFolderDesc')) + .addText((text) => + text.setValue(this.plugin.settings.mappingFolder).onChange(async (value) => { + this.plugin.settings.mappingFolder = value; + await this.plugin.saveSettings(); + }) + ); new Setting(containerEl) - .setName('Avertir si le dossier est synchronisé') - .setDesc('Alerter si les tables de correspondance sont dans un dossier Git, iCloud ou Synology Drive') + .setName(t('settings.dictionariesFolder')) + .setDesc(t('settings.dictionariesFolderDesc')) + .addText((text) => + text.setValue(this.plugin.settings.dictionariesFolder).onChange(async (value) => { + this.plugin.settings.dictionariesFolder = value; + await this.plugin.saveSettings(); + }) + ); + + new Setting(containerEl) + .setName(t('settings.exportsFolder')) + .addText((text) => + text.setValue(this.plugin.settings.exportsFolder).onChange(async (value) => { + this.plugin.settings.exportsFolder = value; + await this.plugin.saveSettings(); + }) + ); + + // ---- Sécurité ------------------------------------------------------- + new Setting(containerEl).setName(t('settings.heading.security')).setHeading(); + + new Setting(containerEl) + .setName(t('settings.vaultPerCorpus')) + .setDesc(t('settings.vaultPerCorpusDesc')); + + new Setting(containerEl) + .setName(t('settings.warnIfSyncedFolder')) + .setDesc(t('settings.warnIfSyncedFolderDesc')) .addToggle((toggle) => toggle.setValue(this.plugin.settings.warnIfSyncedFolder).onChange(async (value) => { this.plugin.settings.warnIfSyncedFolder = value; diff --git a/src/ui/CorpusModal.ts b/src/ui/CorpusModal.ts new file mode 100644 index 0000000..2bf3aa1 --- /dev/null +++ b/src/ui/CorpusModal.ts @@ -0,0 +1,227 @@ +import { App, Modal, Notice, TFolder } from 'obsidian'; +import type PseudObsPlugin from '../main'; +import { t } from '../i18n'; + +/** + * Retourne les sous-dossiers directs d'un dossier du vault. + * Ce sont les "classes" de l'organisation du corpus. + */ +export function getCorpusClasses(app: App, transcriptionsFolder: string): string[] { + const folder = app.vault.getAbstractFileByPath(transcriptionsFolder); + if (!(folder instanceof TFolder)) return []; + return folder.children + .filter((c): c is TFolder => c instanceof TFolder) + .map((c) => c.name) + .sort(); +} + +/** + * Modale de gestion de l'organisation du corpus par classes (sous-dossiers). + * Créer une classe = créer le sous-dossier dans Transcriptions/ + miroir dans mappings/ et exports/. + */ +export class CorpusModal extends Modal { + private plugin: PseudObsPlugin; + + constructor(app: App, plugin: PseudObsPlugin) { + super(app); + this.plugin = plugin; + } + + onOpen(): void { + this.render(); + } + + private render(): void { + const { contentEl } = this; + contentEl.empty(); + contentEl.addClass('pseudobs-corpus-modal'); + + contentEl.createEl('h2', { text: t('corpus.modal.title') }); + contentEl.createEl('p', { text: t('corpus.modal.hint'), cls: 'pseudobs-view-hint' }); + + const classes = getCorpusClasses(this.app, this.plugin.settings.transcriptionsFolder); + + if (classes.length === 0) { + contentEl.createEl('p', { text: t('corpus.modal.noClasses'), cls: 'pseudobs-view-hint' }); + } else { + const list = contentEl.createEl('ul', { cls: 'pseudobs-corpus-class-list' }); + for (const cls of classes) { + this.renderClassRow(list, cls); + } + } + + // Bouton ajouter + const addRow = contentEl.createDiv('pseudobs-corpus-add-row'); + const input = addRow.createEl('input'); + input.type = 'text'; + input.placeholder = t('corpus.modal.classNamePlaceholder'); + input.addClass('pseudobs-corpus-add-input'); + + const addBtn = addRow.createEl('button', { + text: t('corpus.modal.addClass'), + cls: 'pseudobs-view-add-btn mod-cta', + }); + addBtn.addEventListener('click', () => void this.addClass(input.value)); + input.addEventListener('keydown', (e) => { + if (e.key === 'Enter') void this.addClass(input.value); + }); + + // Bouton fermer + contentEl.createEl('hr'); + contentEl.createEl('button', { text: t('corpus.modal.close'), cls: 'pseudobs-view-action-btn' }) + .addEventListener('click', () => this.close()); + } + + private renderClassRow(list: HTMLElement, cls: string): void { + const s = this.plugin.settings; + const transcPath = `${s.transcriptionsFolder}/${cls}`; + + // Compter les fichiers dans le dossier transcriptions + const folder = this.app.vault.getAbstractFileByPath(transcPath); + const fileCount = folder instanceof TFolder + ? folder.children.filter((c) => !(c instanceof TFolder)).length + : 0; + + const li = list.createEl('li', { cls: 'pseudobs-corpus-class-item' }); + + const nameWrap = li.createDiv('pseudobs-corpus-class-name'); + nameWrap.createEl('strong', { text: cls }); + nameWrap.createEl('small', { + text: t('corpus.modal.files', String(fileCount)), + cls: 'pseudobs-corpus-class-count', + }); + + // Miroir : indiquer les dossiers associés + const mirrorPaths = [ + `${s.mappingFolder}/${cls}`, + `${s.exportsFolder}/${cls}`, + ]; + const mirrorEl = li.createEl('small', { cls: 'pseudobs-corpus-class-mirror' }); + mirrorEl.setText(mirrorPaths.join(' · ')); + + // Bouton supprimer + const delBtn = li.createEl('button', { cls: 'pseudobs-dict-card-remove' }); + delBtn.setText('✕'); + delBtn.title = t('corpus.modal.deleteConfirm', cls); + delBtn.addEventListener('click', () => void this.deleteClass(cls)); + } + + private async addClass(name: string): Promise { + const trimmed = name.trim(); + if (!trimmed) { + new Notice(t('corpus.modal.classNameEmpty')); + return; + } + + const existing = getCorpusClasses(this.app, this.plugin.settings.transcriptionsFolder); + if (existing.includes(trimmed)) { + new Notice(t('corpus.modal.classExists')); + return; + } + + const s = this.plugin.settings; + await this.plugin.ensureFolder(`${s.transcriptionsFolder}/${trimmed}`); + await this.plugin.ensureFolder(`${s.mappingFolder}/${trimmed}`); + await this.plugin.ensureFolder(`${s.exportsFolder}/${trimmed}`); + + this.render(); + } + + private async deleteClass(name: string): Promise { + const s = this.plugin.settings; + const paths = [ + `${s.transcriptionsFolder}/${name}`, + `${s.mappingFolder}/${name}`, + `${s.exportsFolder}/${name}`, + ]; + + for (const p of paths) { + const item = this.app.vault.getAbstractFileByPath(p); + if (item) await this.app.fileManager.trashFile(item); + } + + this.render(); + } + + onClose(): void { + this.contentEl.empty(); + } +} + +/** + * Modal de sélection de classe à l'import d'une transcription. + * Retourne le nom de la classe choisie, ou null si l'utilisateur choisit "sans classe". + * Retourne undefined si l'utilisateur annule. + */ +export class ClassSelectModal extends Modal { + private plugin: PseudObsPlugin; + private classes: string[]; + private resolve!: (value: string | null | undefined) => void; + + constructor(app: App, plugin: PseudObsPlugin, classes: string[]) { + super(app); + this.plugin = plugin; + this.classes = classes; + } + + open(): this { + super.open(); + return this; + } + + prompt(): Promise { + return new Promise((resolve) => { + this.resolve = resolve; + super.open(); + }); + } + + onOpen(): void { + const { contentEl } = this; + contentEl.createEl('h2', { text: t('corpus.select.title') }); + contentEl.createEl('p', { text: t('corpus.select.hint'), cls: 'pseudobs-view-hint' }); + + let selected: string | null = null; + + const list = contentEl.createEl('ul', { cls: 'pseudobs-corpus-class-list' }); + + // Option "sans classe" + const noneItem = list.createEl('li', { cls: 'pseudobs-corpus-select-item' }); + const noneBtn = noneItem.createEl('button', { + text: t('corpus.select.none'), + cls: 'pseudobs-onboarding-none-btn', + }); + noneBtn.addEventListener('click', () => { + selected = null; + list.querySelectorAll('.pseudobs-corpus-select-item-active').forEach((el) => + el.removeClass('pseudobs-corpus-select-item-active') + ); + noneItem.addClass('pseudobs-corpus-select-item-active'); + }); + + for (const cls of this.classes) { + const item = list.createEl('li', { cls: 'pseudobs-corpus-select-item' }); + const btn = item.createEl('button', { text: cls, cls: 'pseudobs-onboarding-select-btn' }); + btn.addEventListener('click', () => { + selected = cls; + list.querySelectorAll('.pseudobs-corpus-select-item-active').forEach((el) => + el.removeClass('pseudobs-corpus-select-item-active') + ); + item.addClass('pseudobs-corpus-select-item-active'); + btn.addClass('pseudobs-onboarding-select-btn-active'); + }); + } + + const footer = contentEl.createDiv('pseudobs-dict-review-footer'); + footer.createEl('button', { text: t('corpus.modal.close') }) + .addEventListener('click', () => { this.resolve(undefined); this.close(); }); + footer.createEl('button', { text: t('corpus.select.confirm'), cls: 'mod-cta' }) + .addEventListener('click', () => { this.resolve(selected); this.close(); }); + } + + onClose(): void { + this.contentEl.empty(); + // Si fermé sans confirmation (croix), résoudre avec undefined + if (this.resolve) this.resolve(undefined); + } +} diff --git a/src/ui/DictScanReviewModal.ts b/src/ui/DictScanReviewModal.ts index 5bf437f..be85881 100644 --- a/src/ui/DictScanReviewModal.ts +++ b/src/ui/DictScanReviewModal.ts @@ -1,4 +1,5 @@ import { App, Modal, Notice, TFile } from 'obsidian'; +import { t } from '../i18n'; import type PseudObsPlugin from '../main'; import { MappingStore } from '../mappings/MappingStore'; import type { EntityCategory, MappingFile } from '../types'; @@ -53,11 +54,12 @@ export class DictScanReviewModal extends Modal { const { contentEl } = this; contentEl.addClass('pseudobs-dict-review-modal'); - contentEl.createEl('h2', { text: 'Révision du scan — dictionnaires' }); + contentEl.createEl('h2', { text: t('dictScanModal.title') }); const dicts = [...new Set(this.results.map((r) => r.dictLabel))]; + const n = this.results.length; contentEl.createEl('p', { - text: `${this.results.length} entité${this.results.length > 1 ? 's' : ''} détectée${this.results.length > 1 ? 's' : ''} · ${dicts.join(', ')}`, + text: t('dictScanModal.summary', String(n), n > 1 ? t('dictScanModal.summary.entities') : t('dictScanModal.summary.entity'), dicts.join(', ')), cls: 'pseudobs-scan-summary', }); @@ -72,7 +74,7 @@ export class DictScanReviewModal extends Modal { const termWrap = header.createDiv('pseudobs-dict-review-card-term-wrap'); termWrap.createEl('span', { text: item.term, cls: 'pseudobs-dict-review-term' }); termWrap.createEl('span', { - text: item.category.replace('_', ' '), + text: t(`category.${item.category}`), cls: 'pseudobs-dict-review-cat', }); @@ -139,7 +141,7 @@ export class DictScanReviewModal extends Modal { // Pied de page const footer = contentEl.createDiv('pseudobs-dict-review-footer'); - footer.createEl('button', { text: 'Annuler' }) + footer.createEl('button', { text: t('dictScanModal.cancel') }) .addEventListener('click', () => this.close()); this.applyBtn = footer.createEl('button', { cls: 'mod-cta' }); @@ -198,8 +200,8 @@ export class DictScanReviewModal extends Modal { private updateApplyLabel(): void { const n = this.checked.filter(Boolean).length; this.applyBtn.textContent = n === 0 - ? 'Aucune règle à appliquer' - : `Créer ${n} règle${n > 1 ? 's' : ''}`; + ? t('dictScanModal.noRules') + : t('dictScanModal.apply', String(n), n > 1 ? t('dictScanModal.apply.rules') : t('dictScanModal.apply.rule')); this.applyBtn.toggleClass('pseudobs-dict-review-btn-empty', n === 0); } @@ -245,7 +247,7 @@ export class DictScanReviewModal extends Modal { } const n = toCreate.length; - new Notice(`✓ ${n} règle${n > 1 ? 's' : ''} créée${n > 1 ? 's' : ''}`); + new Notice(t('notice.rulesCreated', String(n), n > 1 ? t('notice.rulesCreated.rules') : t('notice.rulesCreated.rule'))); void this.plugin.refreshHighlightData(); this.close(); } diff --git a/src/ui/EditRuleModal.ts b/src/ui/EditRuleModal.ts index d3d8656..18df78f 100644 --- a/src/ui/EditRuleModal.ts +++ b/src/ui/EditRuleModal.ts @@ -2,12 +2,12 @@ import { App, Modal, Notice, Setting } from 'obsidian'; import type PseudObsPlugin from '../main'; import type { EntityCategory, ScopeType } from '../types'; import type { RuleLocation } from '../mappings/ScopeResolver'; +import { t } from '../i18n'; export class EditRuleModal extends Modal { private plugin: PseudObsPlugin; private location: RuleLocation; - // Valeurs éditables — initialisées depuis la règle existante private replacement: string; private category: EntityCategory; private scopeType: ScopeType; @@ -27,67 +27,94 @@ export class EditRuleModal extends Modal { onOpen(): void { const { contentEl } = this; const { rule } = this.location; - contentEl.createEl('h2', { text: 'Modifier la règle' }); + contentEl.createEl('h2', { text: t('ruleModal.title') }); new Setting(contentEl) - .setName('Source') + .setName(t('ruleModal.source')) .setDesc('Non modifiable — créez une nouvelle règle pour changer la source') - .addText((t) => { - t.setValue(rule.source).setDisabled(true); - t.inputEl.addClass('pseudobs-disabled-input'); + .addText((tx) => { + tx.setValue(rule.source).setDisabled(true); + tx.inputEl.addClass('pseudobs-disabled-input'); }); new Setting(contentEl) - .setName('Remplacement') - .addText((t) => - t.setValue(this.replacement).onChange((v) => (this.replacement = v)) + .setName(t('ruleModal.replacement')) + .addText((tx) => + tx.setValue(this.replacement).onChange((v) => (this.replacement = v)) ); new Setting(contentEl) - .setName('Catégorie') + .setName(t('ruleModal.category')) .addDropdown((d) => { - const options: Record = { - first_name: 'Prénom', last_name: 'Nom de famille', full_name: 'Nom complet', - place: 'Lieu', institution: 'Institution', date: 'Date', - age: 'Âge', profession: 'Profession', custom: 'Autre', - }; - for (const [value, label] of Object.entries(options)) d.addOption(value, label); + const cats: EntityCategory[] = ['first_name','last_name','full_name','place','institution','date','age','profession','custom']; + for (const cat of cats) d.addOption(cat, t(`category.${cat}`)); d.setValue(this.category); - d.onChange((v) => (this.category = v as EntityCategory)); + d.onChange((v) => { + this.category = v as EntityCategory; + updateWarn(); + }); }); new Setting(contentEl) - .setName('Portée') + .setName(t('ruleModal.scope')) .addDropdown((d) => { - d.addOption('file', 'Ce fichier uniquement'); - d.addOption('folder', 'Ce dossier'); - d.addOption('vault', 'Tout le vault'); + d.addOption('file', t('ruleModal.scopeFile')); + d.addOption('folder', t('ruleModal.scopeFolder')); + d.addOption('vault', t('ruleModal.scopeVault')); d.setValue(this.scopeType); - d.onChange((v) => (this.scopeType = v as ScopeType)); + d.onChange((v) => { + this.scopeType = v as ScopeType; + updateWarn(); + }); }); + // Callout dynamique + const calloutEl = contentEl.createDiv(); + const isNameCat = () => ['first_name', 'last_name', 'full_name'].includes(this.category); + const isBroad = () => this.scopeType !== 'file'; + const updateWarn = () => { + if (!isNameCat()) { calloutEl.hide(); return; } + calloutEl.empty(); + calloutEl.show(); + if (isBroad()) { + calloutEl.setAttribute('data-callout', 'warning'); + calloutEl.className = 'callout pseudobs-rule-callout'; + calloutEl.createDiv('callout-title').createSpan({ text: t('ruleModal.scopeWarnTitle') }); + calloutEl.createDiv('callout-content').createEl('p', { text: t('panel.mappings.warnBroadName') }); + } else { + calloutEl.setAttribute('data-callout', 'success'); + calloutEl.className = 'callout pseudobs-rule-callout'; + calloutEl.createDiv('callout-title').createSpan({ text: t('ruleModal.scopeOkTitle') }); + calloutEl.createDiv('callout-content').createEl('p', { text: t('ruleModal.scopeOk') }); + } + }; + // État initial + if (isNameCat()) { + calloutEl.show(); + updateWarn(); + } else { + calloutEl.hide(); + } + new Setting(contentEl) - .setName('Priorité') - .setDesc('Entier libre, comme un z-index CSS — défaut 0') - .addText((t) => - t.setValue(String(this.priority)).onChange((v) => (this.priority = parseInt(v, 10) || 0)) + .setName(t('ruleModal.priority')) + .setDesc(t('ruleModal.priorityDesc')) + .addText((tx) => + tx.setValue(String(this.priority)).onChange((v) => (this.priority = parseInt(v, 10) || 0)) ); new Setting(contentEl) .addButton((btn) => - btn.setButtonText('Enregistrer').setCta().onClick(() => this.save()) + btn.setButtonText(t('panel.ner.save')).setCta().onClick(() => void this.save()) ) .addButton((btn) => - btn - .setButtonText('Supprimer la règle') - .setWarning() - .onClick(() => this.delete()) + btn.setButtonText(t('ruleModal.delete')).setWarning().onClick(() => void this.delete()) ); } private async save(): Promise { if (!this.replacement.trim()) { - new Notice('Le remplacement est obligatoire.'); + new Notice(t('ruleModal.errorMissing')); return; } @@ -100,7 +127,7 @@ export class EditRuleModal extends Modal { }); await this.plugin.scopeResolver.saveStore(store, filePath); - new Notice(`✓ Règle mise à jour : "${rule.source}" → "${this.replacement.trim()}"`); + new Notice(t('notice.ruleCreated', rule.source, this.replacement.trim())); void this.plugin.refreshHighlightData(); this.close(); } @@ -109,7 +136,7 @@ export class EditRuleModal extends Modal { const { store, filePath, rule } = this.location; store.remove(rule.id); await this.plugin.scopeResolver.saveStore(store, filePath); - new Notice(`✓ Règle supprimée : "${rule.source}"`); + new Notice(`✓ "${rule.source}"`); void this.plugin.refreshHighlightData(); this.close(); } diff --git a/src/ui/MappingScanReviewModal.ts b/src/ui/MappingScanReviewModal.ts index 50113c2..4132067 100644 --- a/src/ui/MappingScanReviewModal.ts +++ b/src/ui/MappingScanReviewModal.ts @@ -1,4 +1,5 @@ import { App, Modal, Notice, TFile } from 'obsidian'; +import { t } from '../i18n'; import type PseudObsPlugin from '../main'; import type { MappingRule } from '../types'; import { findSpansForRule } from '../pseudonymizer/ReplacementPlanner'; @@ -37,22 +38,20 @@ export class MappingScanReviewModal extends Modal { const { contentEl } = this; contentEl.addClass('pseudobs-dict-review-modal'); - contentEl.createEl('h2', { text: 'Révision du scan — mappings' }); + contentEl.createEl('h2', { text: t('mappingScanModal.title') }); + const nr = this.ruleResults.length; contentEl.createEl('p', { - text: `${this.ruleResults.length} règle${this.ruleResults.length > 1 ? 's' : ''} active${this.ruleResults.length > 1 ? 's' : ''} avec des occurrences dans "${this.file.name}"`, + text: t('mappingScanModal.summary', String(nr), nr > 1 ? t('mappingScanModal.summary.rules') : t('mappingScanModal.summary.rule'), this.file.name), cls: 'pseudobs-scan-summary', }); - contentEl.createEl('p', { - text: 'Décochez les règles à ne pas appliquer. Les remplacements seront écrits dans le fichier source.', - cls: 'pseudobs-view-hint', - }); + contentEl.createEl('p', { text: t('mappingScanModal.hint'), cls: 'pseudobs-view-hint' }); const scroll = contentEl.createDiv('pseudobs-dict-review-scroll'); const table = scroll.createEl('table', { cls: 'pseudobs-dict-review-table' }); const thead = table.createEl('thead'); const hr = thead.createEl('tr'); - ['', 'Source', '', 'Remplacement', 'Occ.'].forEach((h) => + ['', 'Source', '', t('mappingScanModal.col.replacement'), t('mappingScanModal.col.occurrences')].forEach((h) => hr.createEl('th', { text: h }) ); @@ -90,7 +89,7 @@ export class MappingScanReviewModal extends Modal { }); const footer = contentEl.createDiv('pseudobs-dict-review-footer'); - footer.createEl('button', { text: 'Annuler' }) + footer.createEl('button', { text: t('mappingScanModal.cancel') }) .addEventListener('click', () => this.close()); this.applyBtn = footer.createEl('button', { cls: 'mod-cta' }); @@ -104,8 +103,10 @@ export class MappingScanReviewModal extends Modal { .filter((_, i) => this.checked[i]) .reduce((sum, r) => sum + r.matchCount, 0); this.applyBtn.textContent = n === 0 - ? 'Aucune règle à appliquer' - : `Pseudonymiser (${n} règle${n > 1 ? 's' : ''}, ${total} occurrence${total > 1 ? 's' : ''})`; + ? t('mappingScanModal.noRules') + : t('mappingScanModal.apply', + String(n), n > 1 ? t('mappingScanModal.apply.rules') : t('mappingScanModal.apply.rule'), + String(total), total > 1 ? t('mappingScanModal.apply.occurrences') : t('mappingScanModal.apply.occurrence')); this.applyBtn.toggleClass('pseudobs-dict-review-btn-empty', n === 0); } @@ -137,7 +138,7 @@ export class MappingScanReviewModal extends Modal { const resolved = resolveSpans(allSpans); if (resolved.length === 0) { - new Notice('Aucune occurrence à remplacer.'); + new Notice(t('notice.noOccurrences')); this.close(); return; } @@ -147,7 +148,10 @@ export class MappingScanReviewModal extends Modal { void this.plugin.refreshHighlightData(); const total = resolved.length; - new Notice(`✓ ${total} occurrence${total > 1 ? 's' : ''} pseudonymisée${total > 1 ? 's' : ''} dans "${this.file.name}"`); + new Notice(t('notice.occurrencesPseudonymized', + String(total), + total > 1 ? t('notice.occurrencesPseudonymized.occurrences') : t('notice.occurrencesPseudonymized.occurrence'), + this.file.name)); this.close(); } diff --git a/src/ui/OnboardingModal.ts b/src/ui/OnboardingModal.ts index 08b1da8..332a945 100644 --- a/src/ui/OnboardingModal.ts +++ b/src/ui/OnboardingModal.ts @@ -4,6 +4,7 @@ import * as path from 'path'; import type PseudObsPlugin from '../main'; import type { NerBackend } from '../settings'; import type { DictionaryFile, DictionaryManifest, DictionaryManifestEntry } from '../types'; +import { t, setLocale, AVAILABLE_LANGUAGES } from '../i18n'; // Version du package @xenova/transformers embarqué — doit rester synchronisée avec package.json const TRANSFORMERS_VERSION = '2.17.2'; @@ -16,16 +17,20 @@ const WASM_FILES = [ 'ort-wasm.wasm', ] as const; -type Step = 'welcome' | 'ner' | 'dictionaries' | 'summary'; +type Step = 'welcome' | 'language' | 'storage' | 'ner' | 'dictionaries' | 'summary'; -const STEPS: Step[] = ['welcome', 'ner', 'dictionaries', 'summary']; +const STEPS: Step[] = ['welcome', 'language', 'storage', 'ner', 'dictionaries', 'summary']; -const STEP_LABELS: Record = { - welcome: 'Bienvenue', - ner: 'Détection NER', - dictionaries: 'Dictionnaires', - summary: 'Résumé', -}; +function stepLabels(): Record { + return { + welcome: t('onboarding.step.welcome'), + language: t('onboarding.step.language'), + storage: t('onboarding.step.storage'), + ner: t('onboarding.step.ner'), + dictionaries: t('onboarding.step.dictionaries'), + summary: t('onboarding.step.summary'), + }; +} export class OnboardingModal extends Modal { private plugin: PseudObsPlugin; @@ -63,10 +68,12 @@ export class OnboardingModal extends Modal { const body = contentEl.createDiv('pseudobs-onboarding-body'); - if (this.currentStep === 'welcome') this.renderWelcome(body); - else if (this.currentStep === 'ner') this.renderNer(body); + if (this.currentStep === 'welcome') this.renderWelcome(body); + else if (this.currentStep === 'language') this.renderLanguage(body); + else if (this.currentStep === 'storage') this.renderStorage(body); + else if (this.currentStep === 'ner') this.renderNer(body); else if (this.currentStep === 'dictionaries') this.renderDictionaries(body); - else this.renderSummary(body); + else this.renderSummary(body); this.renderNav(contentEl); } @@ -80,60 +87,115 @@ export class OnboardingModal extends Modal { if (step === this.currentStep) dot.addClass('pseudobs-onboarding-step-current'); else if (STEPS.indexOf(step) < STEPS.indexOf(this.currentStep)) dot.addClass('pseudobs-onboarding-step-done'); - dot.createSpan({ text: STEP_LABELS[step] }); + dot.createSpan({ text: stepLabels()[step] }); } } // ---- Étape 1 : Bienvenue ---------------------------------------- private renderWelcome(el: HTMLElement): void { - el.createEl('h2', { text: 'Pseudonymizer tool' }); - el.createEl('p', { - text: 'Ce plugin vous aide à corriger et pseudonymiser des transcriptions d\'entretiens et de corpus interactionnels (formats Jefferson, ICOR, .srt, .cha).', - }); - el.createEl('p', { - text: 'L\'assistant va vous guider en deux étapes rapides :', - }); + el.createEl('h2', { text: t('onboarding.welcome.title') }); + el.createEl('p', { text: t('onboarding.welcome.desc') }); + el.createEl('p', { text: t('onboarding.welcome.steps') }); const list = el.createEl('ul'); - list.createEl('li', { text: 'Choisir un moteur de détection automatique des entités nommées (optionnel).' }); - list.createEl('li', { text: 'Importer des dictionnaires de candidats de remplacement (.dict.json) si vous en avez.' }); - el.createEl('p', { - text: 'Vous pourrez reconfigurer ces options à tout moment via les paramètres du plugin.', - cls: 'pseudobs-onboarding-hint', - }); + list.createEl('li', { text: t('onboarding.welcome.step1') }); + list.createEl('li', { text: t('onboarding.welcome.step2') }); + list.createEl('li', { text: t('onboarding.welcome.step3') }); + el.createEl('p', { text: t('onboarding.welcome.hint'), cls: 'pseudobs-onboarding-hint' }); } - // ---- Étape 2 : NER ---------------------------------------------- + // ---- Étape 2 : Langue ------------------------------------------- - private renderNer(el: HTMLElement): void { - el.createEl('h2', { text: 'Détection automatique des entités' }); + private renderLanguage(el: HTMLElement): void { + // Titre toujours bilingue — l'utilisateur n'a pas encore choisi de langue + el.createEl('h2', { text: 'Interface language / Langue de l\'interface' }); el.createEl('p', { - text: 'Un modèle NER (reconnaissance d\'entités nommées) peut détecter automatiquement les prénoms, noms, lieux et institutions dans vos transcriptions — sans liste exhaustive, directement dans Obsidian.', + text: 'The interface language does not affect transcript analysis. / La langue de l\'interface n\'affecte pas l\'analyse des transcriptions.', + cls: 'pseudobs-onboarding-hint', }); - // --- Carte transformers.js --- + const currentLang = this.plugin.settings.language; + + for (const [code, name] of Object.entries(AVAILABLE_LANGUAGES)) { + const card = el.createDiv('pseudobs-onboarding-ner-card'); + if (currentLang === code) card.addClass('pseudobs-onboarding-ner-card-selected'); + + card.createEl('strong', { text: name }); + + const btn = card.createEl('button', { + text: currentLang === code ? 'Selected' : 'Select', + cls: 'pseudobs-onboarding-select-btn', + }); + if (currentLang === code) btn.addClass('pseudobs-onboarding-select-btn-active'); + + btn.addEventListener('click', () => { void (async () => { + this.plugin.settings.language = code; + await this.plugin.saveSettings(); + setLocale(code); + this.scheduleRender(); + })(); }); + } + } + + // ---- Étape 3 : Stockage ----------------------------------------- + + private renderStorage(el: HTMLElement): void { + el.createEl('h2', { text: t('onboarding.storage.title') }); + + // Recommandation 1 vault / corpus + const rec = el.createDiv('pseudobs-onboarding-ner-card pseudobs-onboarding-ner-card-selected'); + const recHeader = rec.createDiv('pseudobs-onboarding-ner-card-header'); + recHeader.createEl('strong', { text: t('onboarding.storage.vaultPerCorpus') }); + rec.createEl('p', { text: t('onboarding.storage.vaultPerCorpusDesc') }); + + el.createEl('hr'); + el.createEl('p', { text: t('onboarding.storage.hint'), cls: 'pseudobs-onboarding-hint' }); + + const fields: [string, keyof typeof this.plugin.settings][] = [ + [t('onboarding.storage.transcriptionsFolder'), 'transcriptionsFolder'], + [t('onboarding.storage.mappingFolder'), 'mappingFolder'], + [t('onboarding.storage.dictionariesFolder'), 'dictionariesFolder'], + [t('onboarding.storage.exportsFolder'), 'exportsFolder'], + ]; + + for (const [label, key] of fields) { + const row = el.createDiv('pseudobs-onboarding-url-row'); + row.createEl('small', { text: label }); + const input = row.createEl('input'); + input.type = 'text'; + input.value = String(this.plugin.settings[key]); + input.addEventListener('change', () => { void (async () => { + (this.plugin.settings as unknown as Record)[key] = input.value.trim() || String(this.plugin.settings[key]); + await this.plugin.saveSettings(); + })(); }); + } + } + + // ---- Étape 4 : NER ---------------------------------------------- + + private renderNer(el: HTMLElement): void { + el.createEl('h2', { text: t('onboarding.step.ner') }); + el.createEl('p', { text: t('onboarding.ner.desc') }); + const cardTfjs = el.createDiv('pseudobs-onboarding-ner-card'); if (this.nerBackend === 'transformers-js') cardTfjs.addClass('pseudobs-onboarding-ner-card-selected'); const tfjsHeader = cardTfjs.createDiv('pseudobs-onboarding-ner-card-header'); - tfjsHeader.createEl('strong', { text: 'transformers.js — modèle ONNX embarqué' }); - tfjsHeader.createEl('span', { text: 'Python n\'est pas requis', cls: 'pseudobs-onboarding-badge' }); + tfjsHeader.createEl('strong', { text: t('onboarding.ner.tfjsTitle') }); + tfjsHeader.createEl('span', { text: t('onboarding.ner.tfjsBadge'), cls: 'pseudobs-onboarding-badge' }); - cardTfjs.createEl('p', { - text: 'Modèle NER multilingue exécuté localement dans le vault. Les fichiers .wasm (~19 Mo) sont téléchargés une seule fois ici. Le modèle (~66 Mo) est téléchargé au premier scan.', - }); + cardTfjs.createEl('p', { text: t('onboarding.ner.tfjsDesc') }); const wasmRow = cardTfjs.createDiv('pseudobs-onboarding-url-row'); const wasmStatus = wasmRow.createSpan({ cls: 'pseudobs-onboarding-test-status' }); - const wasmAlreadyPresent = this.checkWasmFiles(); - if (wasmAlreadyPresent) { - wasmStatus.setText('Fichiers .wasm déjà installés'); + if (this.checkWasmFiles()) { + wasmStatus.setText(t('onboarding.ner.wasmReady')); wasmStatus.classList.add('pseudobs-onboarding-test-ok'); } const selectTfjs = cardTfjs.createEl('button', { - text: this.nerBackend === 'transformers-js' ? 'Sélectionné' : 'Installer et utiliser transformers.js', + text: this.nerBackend === 'transformers-js' ? t('onboarding.ner.selectedBtn') : t('onboarding.ner.installBtn'), cls: 'pseudobs-onboarding-select-btn', }); if (this.nerBackend === 'transformers-js') selectTfjs.addClass('pseudobs-onboarding-select-btn-active'); @@ -141,19 +203,16 @@ export class OnboardingModal extends Modal { selectTfjs.addEventListener('click', () => { void (async () => { this.nerBackend = 'transformers-js'; await this.saveNerSettings(); - if (!this.checkWasmFiles()) { const ok = await this.downloadWasmFiles(wasmStatus, selectTfjs); if (!ok) return; } - this.scheduleRender(); })(); }); - // --- Désactiver --- const noneRow = el.createDiv('pseudobs-onboarding-none-row'); const noneBtn = noneRow.createEl('button', { - text: this.nerBackend === 'none' ? 'Désactivé (règles manuelles uniquement)' : 'Passer — je travaillerai manuellement', + text: this.nerBackend === 'none' ? t('onboarding.ner.noneActive') : t('onboarding.ner.noneSkip'), cls: 'pseudobs-onboarding-none-btn', }); if (this.nerBackend === 'none') noneBtn.addClass('pseudobs-onboarding-none-btn-active'); @@ -227,27 +286,19 @@ export class OnboardingModal extends Modal { // ---- Étape 3 : Dictionnaires ------------------------------------ private renderDictionaries(el: HTMLElement): void { - el.createEl('h2', { text: 'Dictionnaires de candidats' }); - el.createEl('p', { - text: 'Les dictionnaires proposent des candidats de remplacement (villes, prénoms…) et alimentent la détection. Ils sont hébergés dans un dépôt dédié et téléchargés dans votre vault — aucune donnée ne quitte Obsidian.', - }); + el.createEl('h2', { text: t('onboarding.dict.title') }); + el.createEl('p', { text: t('onboarding.dict.desc') }); - // Zone catalogue (remplie de façon asynchrone) const catalogueEl = el.createDiv('pseudobs-onboarding-catalogue'); - catalogueEl.createEl('p', { text: 'Chargement du catalogue…', cls: 'pseudobs-onboarding-hint' }); + catalogueEl.createEl('p', { text: t('onboarding.dict.catalogueLoading'), cls: 'pseudobs-onboarding-hint' }); void this.renderCatalogue(catalogueEl); - // Séparateur el.createEl('hr'); - // Import manuel (fallback offline) const manualRow = el.createDiv('pseudobs-onboarding-import-row'); - manualRow.createEl('small', { - text: 'Vous avez déjà un fichier .dict.json ? Importez-le manuellement :', - cls: 'pseudobs-onboarding-hint', - }); + manualRow.createEl('small', { text: t('onboarding.dict.manualHint'), cls: 'pseudobs-onboarding-hint' }); const importBtn = manualRow.createEl('button', { - text: 'Importer un fichier local (.dict.json)', + text: t('onboarding.dict.importBtn'), cls: 'pseudobs-onboarding-import-btn', }); const importStatus = manualRow.createSpan({ cls: 'pseudobs-onboarding-test-status' }); @@ -273,10 +324,7 @@ export class OnboardingModal extends Modal { manifest = res.json as DictionaryManifest; } catch { container.empty(); - container.createEl('p', { - text: 'Impossible de contacter le catalogue en ligne. Vérifiez votre connexion ou importez un fichier local ci-dessous.', - cls: 'pseudobs-onboarding-hint', - }); + container.createEl('p', { text: t('onboarding.dict.catalogueError'), cls: 'pseudobs-onboarding-hint' }); return; } @@ -287,7 +335,7 @@ export class OnboardingModal extends Modal { const thead = table.createEl('thead'); const headerRow = thead.createEl('tr'); - ['Dictionnaire', 'Langue', 'Rôles', 'Taille', ''].forEach((h) => + [t('onboarding.dict.col.dict'), t('onboarding.dict.col.lang'), t('onboarding.dict.col.roles'), t('onboarding.dict.col.size'), ''].forEach((h) => headerRow.createEl('th', { text: h }) ); @@ -306,26 +354,22 @@ export class OnboardingModal extends Modal { const nameCell = tr.createEl('td', { cls: 'pseudobs-onboarding-dict-name-cell' }); nameCell.createEl('span', { text: entry.label }); if (entry.recommended) { - nameCell.createEl('span', { text: 'Recommandé', cls: 'pseudobs-onboarding-badge' }); + nameCell.createEl('span', { text: t('onboarding.dict.recommended'), cls: 'pseudobs-onboarding-badge' }); } - // Langue tr.createEl('td', { text: entry.language.toUpperCase() }); - // Rôles const roles: string[] = []; - if (entry.roles.detection) roles.push('détection'); - if (entry.roles.replacement) roles.push('remplacement'); - if (entry.roles.classes) roles.push('classes'); + if (entry.roles.detection) roles.push(t('onboarding.dict.role.detection')); + if (entry.roles.replacement) roles.push(t('onboarding.dict.role.replacement')); + if (entry.roles.classes) roles.push(t('onboarding.dict.role.classes')); tr.createEl('td', { text: roles.join(' · '), cls: 'pseudobs-onboarding-dict-roles' }); - // Taille tr.createEl('td', { text: this.formatSize(entry.size), cls: 'pseudobs-onboarding-dict-size' }); - // Bouton icône uniquement const actionCell = tr.createEl('td', { cls: 'pseudobs-onboarding-dict-action' }); const btn = actionCell.createEl('button', { cls: 'pseudobs-onboarding-icon-btn' }); - btn.setAttribute('aria-label', alreadyInstalled ? 'Réinstaller' : 'Installer'); + btn.setAttribute('aria-label', alreadyInstalled ? t('onboarding.dict.reinstall') : t('onboarding.dict.install')); setIcon(btn, alreadyInstalled ? 'cloud-check' : 'cloud-download'); if (alreadyInstalled) btn.addClass('pseudobs-onboarding-icon-btn-done'); @@ -411,17 +455,17 @@ export class OnboardingModal extends Modal { ok++; } catch { err++; - new Notice(`Erreur lors de l'import de ${f.name} — vérifiez le format .dict.json`); + new Notice(t('onboarding.dict.importError', f.name)); } } if (ok > 0) { - statusEl.setText(`${ok} dictionnaire${ok > 1 ? 's' : ''} importé${ok > 1 ? 's' : ''}`); + statusEl.setText(ok > 1 ? t('onboarding.dict.importOkMany', String(ok)) : t('onboarding.dict.importOk', String(ok))); statusEl.addClass('pseudobs-onboarding-test-ok'); void this.plugin.dictionaryLoader.load(); } if (err > 0) { - statusEl.setText(`${err} fichier${err > 1 ? 's' : ''} rejeté${err > 1 ? 's' : ''}`); + statusEl.setText(err > 1 ? t('onboarding.dict.importErrMany', String(err)) : t('onboarding.dict.importErr', String(err))); statusEl.addClass('pseudobs-onboarding-test-err'); } @@ -443,7 +487,7 @@ export class OnboardingModal extends Modal { if (files.length === 0) return; el.createEl('p', { - text: `Dictionnaires installés dans ce vault (${files.length}) :`, + text: t('onboarding.dict.listTitle', String(files.length)), cls: 'pseudobs-onboarding-dict-count', }); @@ -452,7 +496,7 @@ export class OnboardingModal extends Modal { const li = list.createEl('li'); li.createSpan({ text: f.name }); const removeBtn = li.createEl('button', { text: '✕', cls: 'pseudobs-onboarding-dict-remove' }); - removeBtn.title = 'Retirer ce dictionnaire du vault'; + removeBtn.title = t('onboarding.dict.remove'); removeBtn.addEventListener('click', () => { void (async () => { await this.app.fileManager.trashFile(f); void this.plugin.dictionaryLoader.load(); @@ -464,20 +508,20 @@ export class OnboardingModal extends Modal { // ---- Étape 4 : Résumé ------------------------------------------ private renderSummary(el: HTMLElement): void { - el.createEl('h2', { text: 'Configuration terminée' }); + el.createEl('h2', { text: t('onboarding.summary.title') }); const NER_LABELS: Record = { - none: 'Désactivé — règles manuelles uniquement', - spacy: `spaCy local (${this.plugin.settings.spacyServerUrl})`, - 'transformers-js': 'transformers.js — modèle ONNX (téléchargement au premier scan)', + none: t('onboarding.summary.ner.none'), + spacy: `spaCy local (${this.plugin.settings.spacyServerUrl})`, + 'transformers-js': t('onboarding.summary.ner.tfjs'), }; - el.createEl('p', { text: 'Voici ce qui a été configuré :' }); + el.createEl('p', { text: t('onboarding.summary.intro') }); const table = el.createEl('table', { cls: 'pseudobs-onboarding-summary-table' }); const rows: [string, string][] = [ - ['Détection NER', NER_LABELS[this.plugin.settings.nerBackend]], + [t('onboarding.summary.ner'), NER_LABELS[this.plugin.settings.nerBackend]], ]; const folder = this.app.vault.getAbstractFileByPath(this.plugin.settings.dictionariesFolder); @@ -487,7 +531,7 @@ export class OnboardingModal extends Modal { if (child instanceof TFile && child.name.endsWith('.json')) dictCount++; } } - rows.push(['Dictionnaires', `${dictCount} fichier${dictCount > 1 ? 's' : ''} dans le vault`]); + rows.push([t('onboarding.summary.dicts'), t('onboarding.summary.dicts.count', String(dictCount))]); for (const [label, value] of rows) { const tr = table.createEl('tr'); @@ -495,10 +539,7 @@ export class OnboardingModal extends Modal { tr.createEl('td', { text: value }); } - el.createEl('p', { - text: 'Ces paramètres sont modifiables à tout moment via les paramètres du plugin : Reconfigurer.', - cls: 'pseudobs-onboarding-hint', - }); + el.createEl('p', { text: t('onboarding.summary.hint'), cls: 'pseudobs-onboarding-hint' }); } // ---- Navigation ------------------------------------------------ @@ -509,31 +550,29 @@ export class OnboardingModal extends Modal { // Bouton Annuler — toujours présent sauf à l'étape Résumé if (this.currentStep !== 'summary') { - nav.createEl('button', { text: 'Annuler', cls: 'pseudobs-onboarding-cancel-btn' }) + nav.createEl('button', { text: t('onboarding.nav.cancel'), cls: 'pseudobs-onboarding-cancel-btn' }) .addEventListener('click', () => this.close()); } const rightBtns = nav.createDiv('pseudobs-onboarding-nav-right'); - // Bouton Retour if (idx > 0) { - rightBtns.createEl('button', { text: 'Retour', cls: 'pseudobs-onboarding-back-btn' }) + rightBtns.createEl('button', { text: t('onboarding.nav.back'), cls: 'pseudobs-onboarding-back-btn' }) .addEventListener('click', () => { this.currentStep = STEPS[idx - 1]; this.scheduleRender(); }); } - // Bouton principal if (this.currentStep === 'welcome') { - rightBtns.createEl('button', { text: 'Commencer', cls: 'pseudobs-onboarding-next-btn mod-cta' }) + rightBtns.createEl('button', { text: t('onboarding.nav.start'), cls: 'pseudobs-onboarding-next-btn mod-cta' }) .addEventListener('click', () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); }); } else if (this.currentStep === 'summary') { - rightBtns.createEl('button', { text: 'Commencer à travailler', cls: 'pseudobs-onboarding-next-btn mod-cta' }) + rightBtns.createEl('button', { text: t('onboarding.nav.finish'), cls: 'pseudobs-onboarding-next-btn mod-cta' }) .addEventListener('click', () => { void (async () => { this.plugin.settings.onboardingCompleted = true; await this.plugin.saveSettings(); @@ -541,13 +580,12 @@ export class OnboardingModal extends Modal { })(); }); } else { - // Étapes intermédiaires : Passer + Suivant - rightBtns.createEl('button', { text: 'Passer cette étape', cls: 'pseudobs-onboarding-skip-btn' }) + rightBtns.createEl('button', { text: t('onboarding.nav.skip'), cls: 'pseudobs-onboarding-skip-btn' }) .addEventListener('click', () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); }); - rightBtns.createEl('button', { text: 'Suivant', cls: 'pseudobs-onboarding-next-btn mod-cta' }) + rightBtns.createEl('button', { text: t('onboarding.nav.next'), cls: 'pseudobs-onboarding-next-btn mod-cta' }) .addEventListener('click', () => { this.currentStep = STEPS[idx + 1]; this.scheduleRender(); diff --git a/src/ui/PseudonymizationView.ts b/src/ui/PseudonymizationView.ts index a2ca40c..23eb0e2 100644 --- a/src/ui/PseudonymizationView.ts +++ b/src/ui/PseudonymizationView.ts @@ -1,4 +1,5 @@ import { ItemView, Notice, Setting, TFile, WorkspaceLeaf, setIcon } from 'obsidian'; +import { t } from '../i18n'; import type { DictionaryFile } from '../types'; import type PseudObsPlugin from '../main'; import { scanOccurrences } from '../scanner/OccurrenceScanner'; @@ -11,20 +12,9 @@ export const VIEW_TYPE_PSEUDOBS = 'pseudonymization-view'; type Tab = 'mappings' | 'dictionaries' | 'exports' | 'ner'; -const CATEGORY_LABELS: Record = { - first_name: 'Prénom', last_name: 'Nom', full_name: 'Nom complet', - place: 'Lieu', institution: 'Institution', date: 'Date', - age: 'Âge', profession: 'Profession', custom: 'Autre', -}; - -const SCOPE_LABELS: Record = { - file: 'Fichier', folder: 'Dossier', vault: 'Vault', -}; - -const STATUS_LABELS: Record = { - validated: '✓', ignored: '✗', partial: '◑', - suggested: '?', conflict: '⚠', disabled: '–', needs_review: '👁', -}; +function categoryLabel(cat: string): string { return t(`category.${cat}`) || cat; } +function scopeLabel(s: string): string { return t(`scope.${s}`) || s; } +function statusLabel(s: string): string { return t(`status.${s}`) || s; } export class PseudonymizationView extends ItemView { private plugin: PseudObsPlugin; @@ -36,6 +26,8 @@ export class PseudonymizationView extends ItemView { private lastFile: TFile | null = null; // IDs des dictionnaires cochés pour le scan groupé (tous cochés par défaut) private checkedDicts = new Set(); + // Onglet Mappings : filtrer sur le fichier actif (coché par défaut) + private mappingsFilterActive = true; // Garde contre la réentrance de onFileChange (le panneau lui-même peut devenir feuille active) private _renderingTab = false; @@ -57,12 +49,12 @@ export class PseudonymizationView extends ItemView { const content = root.createDiv('pseudobs-view-content'); const tabs: [Tab, string][] = [ - ['mappings', 'Mappings'], - ['dictionaries', 'Dictionnaires'], - ['exports', 'Exports'], + ['mappings', t('panel.tab.mappings')], + ['dictionaries', t('panel.tab.dictionaries')], + ['exports', t('panel.tab.exports')], ]; if (this.plugin.settings.nerBackend !== 'none') { - tabs.push(['ner', 'NER']); + tabs.push(['ner', t('panel.tab.ner')]); } this.panes = {} as Record; @@ -137,34 +129,30 @@ export class PseudonymizationView extends ItemView { private async renderMappingsTab(el: HTMLElement): Promise { const file = this.getFile(); + // ---- Toolbar ---- const toolbar = el.createDiv('pseudobs-view-toolbar'); - // Bouton ajouter règle + const addRuleBtn = toolbar.createEl('button', { cls: 'pseudobs-view-action-btn' }); setIcon(addRuleBtn, 'list-plus'); - addRuleBtn.createSpan({ text: 'Ajouter une règle' }); + addRuleBtn.createSpan({ text: t('panel.mappings.addRule') }); addRuleBtn.addEventListener('click', () => new RuleModal(this.app, this.plugin).open()); - - // Bouton scan — ouvre MappingScanReviewModal + const scanBtn = toolbar.createEl('button', { cls: 'pseudobs-view-action-btn' }); setIcon(scanBtn, 'scan-search'); - scanBtn.createSpan({ text: 'Scanner le fichier' }); + scanBtn.createSpan({ text: t('panel.mappings.scanFile') }); if (!file) scanBtn.setAttr('disabled', 'true'); scanBtn.addEventListener('click', () => { void (async () => { if (!file) return; scanBtn.setAttr('disabled', 'true'); - scanBtn.setText('Scan en cours…'); + scanBtn.querySelector('span')?.setText(t('panel.mappings.scanning')); try { const content = await this.app.vault.read(file); const rules = await this.plugin.scopeResolver.getRulesFor(file.path); - if (rules.length === 0) { - new Notice('Aucune règle active pour ce fichier. Créez des règles via le menu contextuel.'); - return; - } + if (rules.length === 0) { new Notice(t('panel.mappings.noRulesHint')); return; } const occs = scanOccurrences(content, file.path, rules, { caseSensitive: this.plugin.settings.caseSensitive, wholeWordOnly: this.plugin.settings.wholeWordOnly, }); - // Grouper par règle const countByRule = new Map(); for (const occ of occs) { const id = occ.mappingId ?? ''; @@ -173,50 +161,84 @@ export class PseudonymizationView extends ItemView { const ruleResults: MappingRuleResult[] = rules .filter((r) => countByRule.has(r.id)) .map((r) => ({ rule: r, matchCount: countByRule.get(r.id)! })); - if (ruleResults.length === 0) { - new Notice('Aucune occurrence trouvée pour les règles actives.'); - return; - } + if (ruleResults.length === 0) { new Notice(t('notice.noOccurrences')); return; } new MappingScanReviewModal(this.app, this.plugin, file, content, ruleResults).open(); } finally { scanBtn.removeAttribute('disabled'); - scanBtn.setText('Scanner le fichier'); + scanBtn.querySelector('span')?.setText(t('panel.mappings.scanFile')); } })(); }); - if (!file) { - el.createEl('p', { text: 'Aucun fichier actif.', cls: 'pseudobs-view-hint' }); + // ---- Checkbox filtre fichier actif ---- + const filterRow = el.createDiv('pseudobs-mappings-filter-row'); + const cb = filterRow.createEl('input'); + cb.type = 'checkbox'; + cb.checked = this.mappingsFilterActive; + cb.addClass('pseudobs-dict-review-cb'); + filterRow.createEl('label', { text: t('panel.mappings.filterActive') }); + cb.addEventListener('change', () => { + this.mappingsFilterActive = cb.checked; + void this.renderTab('mappings'); + }); + + if (!file && this.mappingsFilterActive) { + el.createEl('p', { text: t('panel.mappings.noFile'), cls: 'pseudobs-view-hint' }); return; } - const locations = await this.plugin.scopeResolver.getRulesWithLocation(file.path); + // ---- Chargement des règles ---- + const locations = this.mappingsFilterActive && file + ? await this.plugin.scopeResolver.getRulesWithLocation(file.path) + : await this.plugin.scopeResolver.getAllRulesWithLocation(); if (locations.length === 0) { - el.createEl('p', { text: `Aucune règle pour ${file.name}.`, cls: 'pseudobs-view-hint' }); + el.createEl('p', { + text: this.mappingsFilterActive && file + ? t('panel.mappings.noRules', file.name) + : t('panel.mappings.noRules', '—'), + cls: 'pseudobs-view-hint', + }); return; } - const table = el.createEl('table', { cls: 'pseudobs-mappings-table' }); - const headerRow = table.createEl('thead').createEl('tr'); - for (const col of ['Source', 'Remplacement', 'Catégorie', 'Portée', 'P.', 'Statut', '']) { - headerRow.createEl('th', { text: col }); + // ---- Grouper par portée ---- + const byScope: Record = { file: [], folder: [], vault: [] }; + for (const loc of locations) { + const s = loc.rule.scope.type; + (byScope[s] ??= []).push(loc); } - const tbody = table.createEl('tbody'); - for (const loc of locations) { - const { rule } = loc; - const row = tbody.createEl('tr'); - row.createEl('td', { text: rule.source, cls: 'pseudobs-mappings-source' }); - row.createEl('td', { text: rule.replacement, cls: 'pseudobs-mappings-replacement' }); - row.createEl('td', { text: CATEGORY_LABELS[rule.category] ?? rule.category }); - row.createEl('td', { text: SCOPE_LABELS[rule.scope.type] ?? rule.scope.type }); - row.createEl('td', { text: String(rule.priority) }); - row.createEl('td', { text: STATUS_LABELS[rule.status] ?? rule.status }); + const scopeOrder: Array<'file' | 'folder' | 'vault'> = ['file', 'folder', 'vault']; + const cols = [ + t('panel.mappings.col.source'), t('panel.mappings.col.replacement'), + t('panel.mappings.col.category'), t('panel.mappings.col.priority'), + t('panel.mappings.col.status'), '', + ]; - const editBtn = row.createEl('td').createEl('button', { cls: 'pseudobs-mappings-edit-btn' }); - setIcon(editBtn, "pencil"); - editBtn.title = 'Modifier'; - editBtn.addEventListener('click', () => new EditRuleModal(this.app, this.plugin, loc).open()); + for (const scopeType of scopeOrder) { + const locs = byScope[scopeType]; + if (!locs || locs.length === 0) continue; + + el.createEl('h3', { text: scopeLabel(scopeType), cls: 'pseudobs-mappings-scope-heading' }); + + const table = el.createEl('table', { cls: 'pseudobs-mappings-table' }); + const headerRow = table.createEl('thead').createEl('tr'); + for (const col of cols) headerRow.createEl('th', { text: col }); + + const tbody = table.createEl('tbody'); + for (const loc of locs) { + const { rule } = loc; + const row = tbody.createEl('tr'); + row.createEl('td', { text: rule.source, cls: 'pseudobs-mappings-source' }); + row.createEl('td', { text: rule.replacement, cls: 'pseudobs-mappings-replacement' }); + row.createEl('td', { text: categoryLabel(rule.category) }); + row.createEl('td', { text: String(rule.priority) }); + row.createEl('td', { text: statusLabel(rule.status) }); + + const editBtn = row.createEl('td').createEl('button', { cls: 'pseudobs-mappings-edit-btn' }); + setIcon(editBtn, 'pencil'); + editBtn.addEventListener('click', () => new EditRuleModal(this.app, this.plugin, loc).open()); + } } } @@ -231,47 +253,39 @@ export class PseudonymizationView extends ItemView { } if (dicts.length === 0) { - el.createEl('p', { - text: 'Aucun dictionnaire installé. Installez-en un depuis le wizard (Paramètres → Reconfigurer) ou importez un fichier local.', - cls: 'pseudobs-view-hint', - }); + el.createEl('p', { text: t('panel.dict.noneInstalled'), cls: 'pseudobs-view-hint' }); } else { - // Mini cards for (const dict of dicts) { const card = el.createDiv('pseudobs-dict-card'); - // Checkbox scan groupé const checkbox = card.createEl('input'); checkbox.type = 'checkbox'; checkbox.checked = this.checkedDicts.has(dict.dictionaryId); checkbox.addClass('pseudobs-dict-card-checkbox'); - checkbox.title = 'Inclure dans le scan groupé'; + checkbox.title = t('panel.dict.checkbox'); checkbox.addEventListener('change', () => { if (checkbox.checked) this.checkedDicts.add(dict.dictionaryId); else this.checkedDicts.delete(dict.dictionaryId); }); - // Infos const info = card.createDiv('pseudobs-dict-card-info'); info.createEl('strong', { text: dict.label, cls: 'pseudobs-dict-card-title' }); info.createEl('small', { text: `${dict.dictionaryId}.dict.json`, cls: 'pseudobs-dict-card-filename' }); - // Bouton scan individuel if (dict.roles?.detection) { const scanBtn = card.createEl('button', { cls: 'pseudobs-dict-card-scan mod-cta' }); setIcon(scanBtn, 'scan-search'); - scanBtn.setAttribute('aria-label', `Scanner avec ${dict.label}`); - scanBtn.title = `Scanner le fichier actif avec "${dict.label}"`; + scanBtn.setAttribute('aria-label', t('panel.dict.scanWith', dict.label)); + scanBtn.title = t('panel.dict.scanWith', dict.label); scanBtn.addEventListener('click', () => { void this.plugin.scanCurrentFileWithDictionaries([dict.dictionaryId]); }); } - // Bouton suppression const removeBtn = card.createEl('button', { cls: 'pseudobs-dict-card-remove' }); setIcon(removeBtn, 'trash-2'); - removeBtn.setAttribute('aria-label', 'Supprimer ce dictionnaire'); - removeBtn.title = 'Supprimer ce dictionnaire du vault'; + removeBtn.setAttribute('aria-label', t('panel.dict.remove')); + removeBtn.title = t('panel.dict.remove'); removeBtn.addEventListener('click', () => { void (async () => { const f = this.app.vault.getAbstractFileByPath( `${this.plugin.settings.dictionariesFolder}/${dict.dictionaryId}.dict.json` @@ -283,22 +297,20 @@ export class PseudonymizationView extends ItemView { })(); }); } - // Bouton scan groupé el.createEl('hr'); const groupScanBtn = el.createEl('button', { cls: 'pseudobs-dict-group-scan mod-cta' }); setIcon(groupScanBtn, 'scan-search'); - groupScanBtn.createSpan({ text: 'Scanner les dictionnaires cochés' }); + groupScanBtn.createSpan({ text: t('panel.dict.scanAll') }); groupScanBtn.addEventListener('click', () => { const ids = [...this.checkedDicts]; - if (ids.length === 0) { new Notice('Aucun dictionnaire coché.'); return; } + if (ids.length === 0) { new Notice(t('notice.noCheckedDicts')); return; } void this.plugin.scanCurrentFileWithDictionaries(ids); }); } - // Import manuel el.createEl('hr'); const importBtn = el.createEl('button', { - text: 'Importer un fichier local (.dict.json)', + text: t('panel.dict.importLocal'), cls: 'pseudobs-view-add-btn', }); importBtn.addEventListener('click', () => { @@ -327,10 +339,10 @@ export class PseudonymizationView extends ItemView { await this.app.vault.create(dest, text); } ok++; - } catch { new Notice(`Format invalide : ${f.name}`); } + } catch { new Notice(t('notice.invalidFormat', f.name)); } } if (ok > 0) { - new Notice(`✓ ${ok} dictionnaire${ok > 1 ? 's' : ''} importé${ok > 1 ? 's' : ''}`); + new Notice(t('notice.dictImported', String(ok), ok > 1 ? t('notice.dictImported.many') : t('notice.dictImported.one'))); await this.plugin.dictionaryLoader.load(); } await this.renderTab('dictionaries'); @@ -345,26 +357,24 @@ export class PseudonymizationView extends ItemView { const file = this.getFile(); if (!file) { - el.createEl('p', { text: 'Aucun fichier actif.', cls: 'pseudobs-view-hint' }); + el.createEl('p', { text: t('panel.mappings.noFile'), cls: 'pseudobs-view-hint' }); return; } - el.createEl('p', { text: `Fichier actif : ${file.name}`, cls: 'pseudobs-view-filename' }); + el.createEl('p', { text: `${file.name}`, cls: 'pseudobs-view-filename' }); new Setting(el) - .setName('Pseudonymiser et exporter') - .setDesc('Génère un fichier .pseudonymized.[ext] dans le dossier d\'exports configuré') + .setName(t('panel.exports.pseudonymize')) .addButton((btn) => - btn.setButtonText('Exporter').setCta().onClick(() => { + btn.setButtonText(t('panel.exports.pseudonymize')).setCta().onClick(() => { void this.plugin.pseudonymizeActiveFile(); }) ); new Setting(el) - .setName('Exporter la table de correspondance') - .setDesc('Copie le mapping JSON dans le dossier d\'exports') + .setName(t('panel.exports.exportMapping')) .addButton((btn) => - btn.setButtonText('Exporter le mapping').onClick(() => { + btn.setButtonText(t('panel.exports.exportMapping')).onClick(() => { void this.plugin.exportMappingForFile(file); }) ); @@ -375,27 +385,19 @@ export class PseudonymizationView extends ItemView { private async renderNerTab(el: HTMLElement): Promise { const s = this.plugin.settings; - // Bouton scan NER const nerScanBtn = el.createEl('button', { cls: 'pseudobs-view-action-btn mod-cta' }); setIcon(nerScanBtn, 'scan-search'); - nerScanBtn.createSpan({ text: 'Identifier des candidats' }); - nerScanBtn.title = 'Détecter les entités nommées dans le fichier actif et les surligner en bleu'; + nerScanBtn.createSpan({ text: t('panel.ner.scanBtn') }); + nerScanBtn.title = t('panel.ner.scanBtn'); nerScanBtn.addEventListener('click', () => void this.plugin.scanCurrentFileNer()); el.createEl('hr'); - el.createEl('p', { - text: 'Paramètres du scanner de détection automatique des entités nommées.', - cls: 'pseudobs-view-hint', - }); + el.createEl('p', { text: t('panel.ner.hint'), cls: 'pseudobs-view-hint' }); - // --- Seuil de confiance --- const scoreSection = el.createDiv('pseudobs-ner-section'); - scoreSection.createEl('strong', { text: 'Seuil de confiance' }); - scoreSection.createEl('p', { - text: 'Les entités dont le score est inférieur à cette valeur sont ignorées. Plus la valeur est haute, moins de faux positifs mais aussi moins de détections.', - cls: 'pseudobs-view-hint', - }); + scoreSection.createEl('strong', { text: t('panel.ner.threshold') }); + scoreSection.createEl('p', { text: t('panel.ner.thresholdDesc'), cls: 'pseudobs-view-hint' }); const scoreRow = scoreSection.createDiv('pseudobs-ner-score-row'); const scoreDisplay = scoreRow.createEl('span', { @@ -417,13 +419,9 @@ export class PseudonymizationView extends ItemView { void this.plugin.saveSettings(); }); - // --- Mots fonctionnels --- const fwSection = el.createDiv('pseudobs-ner-section'); - fwSection.createEl('strong', { text: 'Mots fonctionnels exclus' }); - fwSection.createEl('p', { - text: 'Un mot par ligne. Ces termes ne seront jamais retenus comme entités nommées, même si le modèle les détecte (artefacts de tokenisation).', - cls: 'pseudobs-view-hint', - }); + fwSection.createEl('strong', { text: t('panel.ner.functionWords') }); + fwSection.createEl('p', { text: t('panel.ner.functionWordsDesc'), cls: 'pseudobs-view-hint' }); const textarea = fwSection.createEl('textarea'); textarea.addClass('pseudobs-ner-fw-textarea'); @@ -432,7 +430,7 @@ export class PseudonymizationView extends ItemView { textarea.spellcheck = false; const saveBtn = fwSection.createEl('button', { - text: 'Enregistrer', + text: t('panel.ner.save'), cls: 'pseudobs-view-action-btn', }); saveBtn.addEventListener('click', () => { void (async () => { @@ -443,13 +441,13 @@ export class PseudonymizationView extends ItemView { this.plugin.settings.nerFunctionWords = words; await this.plugin.saveSettings(); saveBtn.addClass('pseudobs-btn-saved'); - saveBtn.setText('Enregistré'); - window.setTimeout(() => { saveBtn.removeClass('pseudobs-btn-saved'); saveBtn.setText('Enregistrer'); }, 2000); + saveBtn.setText(t('panel.ner.saved')); + window.setTimeout(() => { saveBtn.removeClass('pseudobs-btn-saved'); saveBtn.setText(t('panel.ner.save')); }, 2000); })(); }); const resetBtn = fwSection.createEl('button', { cls: 'pseudobs-view-action-btn' }); setIcon(resetBtn, 'rotate-ccw'); - resetBtn.createSpan({ text: 'Réinitialiser par défaut' }); + resetBtn.createSpan({ text: t('panel.ner.reset') }); resetBtn.addClass('pseudobs-ner-reset-btn'); resetBtn.addEventListener('click', () => { void (async () => { const { DEFAULT_SETTINGS } = await import('../settings'); diff --git a/src/ui/QuickPseudonymizeModal.ts b/src/ui/QuickPseudonymizeModal.ts index 5943d9f..e043d17 100644 --- a/src/ui/QuickPseudonymizeModal.ts +++ b/src/ui/QuickPseudonymizeModal.ts @@ -2,6 +2,7 @@ import { App, Editor, EditorPosition, Modal, Notice, Setting, TFile } from 'obsi import type PseudObsPlugin from '../main'; import { MappingStore } from '../mappings/MappingStore'; import type { EntityCategory, MappingFile } from '../types'; +import { t } from '../i18n'; type ApplyScope = 'occurrence' | 'file'; @@ -30,7 +31,6 @@ export class QuickPseudonymizeModal extends Modal { this.source = editor.getSelection(); this.replacement = prefillReplacement; this.suggestions = suggestions; - // Coulmont ne traite que des prénoms if (suggestions.length > 0) this.category = 'first_name'; this.from = editor.getCursor('from'); this.to = editor.getCursor('to'); @@ -38,30 +38,26 @@ export class QuickPseudonymizeModal extends Modal { onOpen(): void { const { contentEl } = this; - contentEl.createEl('h2', { text: 'Pseudonymiser' }); + contentEl.createEl('h2', { text: t('quickModal.title') }); - // Source en lecture seule new Setting(contentEl) - .setName('Expression sélectionnée') - .setDesc('Terme à remplacer — non modifiable') - .addText((t) => { - t.setValue(this.source).setDisabled(true); - t.inputEl.addClass('pseudobs-disabled-input'); + .setName(t('quickModal.source')) + .setDesc(t('quickModal.sourceDesc')) + .addText((tx) => { + tx.setValue(this.source).setDisabled(true); + tx.inputEl.addClass('pseudobs-disabled-input'); }); - // Suggestions Coulmont : boutons cliquables qui remplissent le champ let replacementInput: HTMLInputElement; + if (this.suggestions.length > 0) { - const suggBox = contentEl.createDiv(); - suggBox.addClass('pseudobs-suggestions-box'); - suggBox.createEl('small', { text: 'Suggestions de prénoms équivalents (m/f non différenciés) :' }) + const suggBox = contentEl.createDiv('pseudobs-suggestions-box'); + suggBox.createEl('small', { text: t('ruleModal.coulomontLabel') }) .addClass('pseudobs-suggestions-label'); - const tags = suggBox.createDiv(); - tags.addClass('pseudobs-suggestions-tags'); + const tags = suggBox.createDiv('pseudobs-suggestions-tags'); const btnEls: HTMLElement[] = []; for (const name of this.suggestions) { - const btn = tags.createEl('button', { text: name }); - btn.addClass('pseudobs-suggestion-btn'); + const btn = tags.createEl('button', { text: name, cls: 'pseudobs-suggestion-btn' }); btn.addEventListener('click', () => { this.replacement = name; if (replacementInput) { @@ -75,74 +71,55 @@ export class QuickPseudonymizeModal extends Modal { } } - // Champ de remplacement — pré-rempli si un prénom a déjà été sélectionné new Setting(contentEl) - .setName('Remplacer par') - .addText((t) => { - t.setPlaceholder('Pseudonyme ou catégorie analytique'); - t.setValue(this.replacement); - t.onChange((v) => (this.replacement = v)); - replacementInput = t.inputEl; + .setName(t('quickModal.replaceBy')) + .addText((tx) => { + tx.setPlaceholder(t('quickModal.replacementPlaceholder')); + tx.setValue(this.replacement); + tx.onChange((v) => (this.replacement = v)); + replacementInput = tx.inputEl; }); new Setting(contentEl) - .setName('Catégorie') + .setName(t('ruleModal.category')) .addDropdown((d) => { - const options: Record = { - first_name: 'Prénom', - last_name: 'Nom de famille', - full_name: 'Nom complet', - place: 'Lieu', - institution: 'Institution', - date: 'Date', - age: 'Âge', - profession: 'Profession', - custom: 'Autre', - }; - for (const [value, label] of Object.entries(options)) { - d.addOption(value, label); - } + const cats: EntityCategory[] = ['first_name','last_name','full_name','place','institution','date','age','profession','custom']; + for (const cat of cats) d.addOption(cat, t(`category.${cat}`)); d.setValue('custom'); d.onChange((v) => (this.category = v as EntityCategory)); }); new Setting(contentEl) - .setName('Portée du remplacement') + .setName(t('quickModal.scope')) .addDropdown((d) => { - d.addOption('file', 'Toutes les occurrences dans ce fichier'); - d.addOption('occurrence', 'Cette occurrence uniquement'); + d.addOption('file', t('quickModal.scopeFile')); + d.addOption('occurrence', t('quickModal.scopeOccurrence')); d.setValue('file'); d.onChange((v) => (this.applyScope = v as ApplyScope)); }); new Setting(contentEl).addButton((btn) => - btn - .setButtonText('Pseudonymiser') - .setCta() - .onClick(() => this.apply()) + btn.setButtonText(t('quickModal.submit')).setCta().onClick(() => void this.apply()) ); - // Focus sur le champ de remplacement à l'ouverture window.setTimeout(() => replacementInput?.focus(), 50); } private async apply(): Promise { const replacement = this.replacement.trim(); if (!replacement) { - new Notice('Le remplacement est obligatoire.'); + new Notice(t('ruleModal.errorMissing')); return; } const activeFile = this.app.workspace.getActiveFile(); if (!activeFile) { - new Notice('Aucun fichier actif.'); + new Notice(t('notice.noActiveFile')); return; } - // 1. Sauvegarder la règle dans le mapping JSON (valeur brute, sans marqueurs) await this.saveRule(activeFile, replacement); - // 2. Appliquer dans le fichier — avec marqueurs si activés const s = this.plugin.settings; const marked = s.useMarkerInExport ? `${s.markerOpen}${replacement}${s.markerClose}` @@ -150,13 +127,12 @@ export class QuickPseudonymizeModal extends Modal { if (this.applyScope === 'occurrence') { this.editor.replaceRange(marked, this.from, this.to); - new Notice(`✓ "${this.source}" → "${marked}" (cette occurrence)`); + new Notice(t('notice.appliedOccurrence', this.source, marked)); } else { const count = await this.plugin.applyRuleToFile(activeFile, this.source, marked); - new Notice(`✓ "${this.source}" → "${marked}" (${count} occurrence${count > 1 ? 's' : ''})`); + new Notice(t('notice.appliedFile', this.source, marked, String(count), count > 1 ? 's' : '')); } - // Rafraîchir le surlignage immédiatement void this.plugin.refreshHighlightData(); this.close(); } diff --git a/src/ui/RuleModal.ts b/src/ui/RuleModal.ts index d492004..d5f5d69 100644 --- a/src/ui/RuleModal.ts +++ b/src/ui/RuleModal.ts @@ -1,7 +1,8 @@ import { App, Modal, Setting, TFile, Notice } from 'obsidian'; +import { t } from '../i18n'; import type PseudObsPlugin from '../main'; import { MappingStore } from '../mappings/MappingStore'; -import type { EntityCategory, MappingFile, MappingRule, ScopeType } from '../types'; +import type { EntityCategory, MappingFile, ScopeType } from '../types'; export class RuleModal extends Modal { private plugin: PseudObsPlugin; @@ -70,15 +71,13 @@ export class RuleModal extends Modal { onOpen(): void { const { contentEl } = this; - contentEl.createEl('h2', { text: 'Créer une règle de remplacement' }); + contentEl.createEl('h2', { text: t('ruleModal.title') }); new Setting(contentEl) - .setName('Source') - .setDesc('Terme original à remplacer') - .addText((t) => - t.setValue(this.source).onChange((v) => { - this.source = v; - }) + .setName(t('ruleModal.source')) + .setDesc(t('ruleModal.sourceDesc')) + .addText((tx) => + tx.setValue(this.source).onChange((v) => { this.source = v; }) ); // --- Suggestions Coulmont --- @@ -86,7 +85,7 @@ export class RuleModal extends Modal { if (this.coulomontSuggestions.length > 0) { const box = contentEl.createDiv(); box.addClass('pseudobs-suggestions-box'); - box.createEl('small', { text: 'Suggestions de prénoms équivalents — choisissez :' }) + box.createEl('small', { text: t('ruleModal.coulomontLabel') }) .addClass('pseudobs-suggestions-label'); const tags = box.createDiv(); tags.addClass('pseudobs-suggestions-tags'); @@ -116,12 +115,12 @@ export class RuleModal extends Modal { box.addClass('pseudobs-suggestions-box'); const label = box.createEl('small'); label.addClass('pseudobs-suggestions-label'); - label.setText(`Dictionnaire : "${this.source}" → classe ${this.dictEntryClass}`); + label.setText(t('ruleModal.dictLabel', this.source, this.dictEntryClass)); const row = box.createDiv(); row.addClass('pseudobs-suggestions-tags'); - const classBtn = row.createEl('button', { text: `Utiliser "${preview}" (portée : ${scope})` }); + const classBtn = row.createEl('button', { text: t('ruleModal.dictUseClass', preview, scope) }); classBtn.addClass('pseudobs-suggestion-btn'); classBtn.addEventListener('click', () => { this.useClass = true; @@ -129,7 +128,6 @@ export class RuleModal extends Modal { classBtn.addClass('pseudobs-suggestion-btn-selected'); }); - // Pré-sélectionner automatiquement si aucune suggestion Coulmont if (this.coulomontSuggestions.length === 0) { this.useClass = true; if (replacementInput) replacementInput.value = preview; @@ -138,45 +136,33 @@ export class RuleModal extends Modal { } new Setting(contentEl) - .setName('Remplacement') - .setDesc( - this.dictEntryClass - ? 'L\'index exact sera calculé à la création selon les règles existantes dans la portée.' - : 'Pseudonyme ou catégorie analytique' - ) - .addText((t) => { + .setName(t('ruleModal.replacement')) + .setDesc(this.dictEntryClass ? t('ruleModal.replacementDescClass') : t('ruleModal.replacementDesc')) + .addText((tx) => { const preview = this.dictEntryClass ? (this.plugin.dictionaryLoader?.getById(this.dictId ?? '')?.config?.replacementPattern ?? '{class}_{index}') .replace('{class}', this.dictEntryClass) .replace('{index}', 'N') : this.replacement; - t.setValue(preview).onChange((v) => { + tx.setValue(preview).onChange((v) => { this.replacement = v; - this.useClass = false; // saisie manuelle désactive le mode classe + this.useClass = false; }); - replacementInput = t.inputEl; + replacementInput = tx.inputEl; }); - // Catégorie — masquée si Coulmont impose 'first_name' new Setting(contentEl) - .setName('Catégorie') + .setName(t('ruleModal.category')) .addDropdown((d) => { - const options: Record = { - first_name: 'Prénom', - last_name: 'Nom de famille', - full_name: 'Nom complet', - place: 'Lieu', - institution: 'Institution', - date: 'Date', - age: 'Âge', - profession: 'Profession', - custom: 'Autre', - }; - for (const [value, label] of Object.entries(options)) { - d.addOption(value, label); + const cats: EntityCategory[] = ['first_name','last_name','full_name','place','institution','date','age','profession','custom']; + for (const cat of cats) { + d.addOption(cat, t(`category.${cat}`)); } d.setValue(this.category); - d.onChange((v) => { this.category = v as EntityCategory; }); + d.onChange((v) => { + this.category = v as EntityCategory; + updateBroadScopeWarning(); + }); if (this.coulomontSuggestions.length > 0) { const settingItem = d.selectEl.closest('.setting-item'); if (settingItem instanceof HTMLElement) settingItem.hide(); @@ -184,36 +170,61 @@ export class RuleModal extends Modal { }); new Setting(contentEl) - .setName('Portée') + .setName(t('ruleModal.scope')) .addDropdown((d) => { - d.addOption('file', 'Ce fichier uniquement'); - d.addOption('folder', 'Ce dossier'); - d.addOption('vault', 'Tout le vault'); + d.addOption('file', t('ruleModal.scopeFile')); + d.addOption('folder', t('ruleModal.scopeFolder')); + d.addOption('vault', t('ruleModal.scopeVault')); d.setValue('file'); - d.onChange((v) => { this.scopeType = v as ScopeType; }); + d.onChange((v) => { + this.scopeType = v as ScopeType; + updateBroadScopeWarning(); + }); }); + // Callout dynamique — visible uniquement pour les catégories noms/prénoms + const calloutEl = contentEl.createDiv(); + calloutEl.hide(); + const isNameCategory = () => ['first_name', 'last_name', 'full_name'].includes(this.category); + const isBroadScope = () => this.scopeType !== 'file'; + const updateBroadScopeWarning = () => { + if (!isNameCategory()) { calloutEl.hide(); return; } + calloutEl.empty(); + calloutEl.show(); + if (isBroadScope()) { + calloutEl.setAttribute('data-callout', 'warning'); + calloutEl.className = 'callout pseudobs-rule-callout'; + calloutEl.createDiv('callout-title').createSpan({ text: t('ruleModal.scopeWarnTitle') }); + calloutEl.createDiv('callout-content').createEl('p', { text: t('panel.mappings.warnBroadName') }); + } else { + calloutEl.setAttribute('data-callout', 'success'); + calloutEl.className = 'callout pseudobs-rule-callout'; + calloutEl.createDiv('callout-title').createSpan({ text: t('ruleModal.scopeOkTitle') }); + calloutEl.createDiv('callout-content').createEl('p', { text: t('ruleModal.scopeOk') }); + } + }; + new Setting(contentEl) - .setName('Priorité') - .setDesc('Entier libre, comme un z-index CSS — défaut 0, plus grand = appliqué en premier') - .addText((t) => - t.setValue('0').onChange((v) => { this.priority = parseInt(v, 10) || 0; }) + .setName(t('ruleModal.priority')) + .setDesc(t('ruleModal.priorityDesc')) + .addText((tx) => + tx.setValue('0').onChange((v) => { this.priority = parseInt(v, 10) || 0; }) ); new Setting(contentEl).addButton((btn) => - btn.setButtonText('Créer la règle').setCta().onClick(() => void this.createRule()) + btn.setButtonText(t('ruleModal.submit')).setCta().onClick(() => void this.createRule()) ); } private async createRule(): Promise { if (!this.source.trim()) { - new Notice('La source est obligatoire.'); + new Notice(t('ruleModal.errorMissing')); return; } const activeFile = this.app.workspace.getActiveFile(); if (!activeFile) { - new Notice('Aucun fichier actif.'); + new Notice(t('ruleModal.errorNoFile')); return; } @@ -230,7 +241,7 @@ export class RuleModal extends Modal { } if (!this.replacement.trim()) { - new Notice('Le remplacement est obligatoire.'); + new Notice(t('ruleModal.errorMissing')); return; } @@ -271,7 +282,7 @@ export class RuleModal extends Modal { await this.app.vault.create(mappingPath, json); } - new Notice(`✓ Règle créée : "${this.source.trim()}" → "${this.replacement.trim()}"`); + new Notice(t('notice.ruleCreated', this.source.trim(), this.replacement.trim())); void this.plugin.refreshHighlightData(); this.close(); } diff --git a/styles.css b/styles.css index 27aa744..39b82be 100644 --- a/styles.css +++ b/styles.css @@ -955,3 +955,96 @@ } .pseudobs-onboarding-icon-btn-loading { cursor: wait; } .pseudobs-onboarding-icon-btn-loading svg { animation: pseudobs-spin 0.9s linear infinite; } + +/* ---- CorpusModal ---- */ + +.pseudobs-corpus-class-list { + list-style: none; + padding: 0; + margin: 10px 0; + display: flex; + flex-direction: column; + gap: 6px; +} + +.pseudobs-corpus-class-item { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 10px; + border: 1px solid var(--background-modifier-border); + border-radius: 6px; +} +.pseudobs-corpus-class-item:hover { border-color: var(--background-modifier-border-hover); } + +.pseudobs-corpus-class-name { + flex: 1; + display: flex; + flex-direction: column; + gap: 2px; +} +.pseudobs-corpus-class-count { + font-size: 0.78em; + color: var(--text-faint); +} +.pseudobs-corpus-class-mirror { + font-family: var(--font-monospace); + font-size: 0.72em; + color: var(--text-faint); + display: block; +} + +.pseudobs-corpus-add-row { + display: flex; + gap: 8px; + margin: 12px 0; +} +.pseudobs-corpus-add-input { + flex: 1; + padding: 5px 10px; + border-radius: 5px; + border: 1px solid var(--background-modifier-border); + background: var(--background-primary); + color: var(--text-normal); + font-size: 0.9em; +} +.pseudobs-corpus-add-input:focus { border-color: var(--interactive-accent); outline: none; } + +.pseudobs-corpus-select-item { list-style: none; } +.pseudobs-corpus-select-item-active button { + border-color: var(--interactive-accent); + background: color-mix(in srgb, var(--interactive-accent) 10%, transparent); + font-weight: 600; +} + +/* Onglet Mappings — filtre et sous-titres de portée */ +.pseudobs-mappings-filter-row { + display: flex; + align-items: center; + gap: 6px; + margin-bottom: 10px; + font-size: 0.85em; + color: var(--text-muted); +} +.pseudobs-mappings-scope-heading { + font-size: 0.8em; + font-weight: 700; + color: var(--text-muted); + text-transform: uppercase; + letter-spacing: 0.06em; + margin: 12px 0 4px; + padding-bottom: 3px; + border-bottom: 1px solid var(--background-modifier-border); +} +.pseudobs-mappings-scope-heading:first-of-type { margin-top: 0; } + +/* Callout portée dans RuleModal / EditRuleModal */ +.pseudobs-rule-callout { + margin: 6px 0 12px; + font-size: 0.82em; +} +.pseudobs-rule-callout .callout-content p { + margin: 0; + font-size: 0.95em; + line-height: 1.55; +} diff --git a/tsconfig.json b/tsconfig.json index 7c58e9c..2bbff0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,8 @@ "noImplicitAny": true, "noUnusedLocals": false, "noUnusedParameters": false, - "lib": ["ES2020", "DOM"] + "lib": ["ES2020", "DOM"], + "resolveJsonModule": true }, - "include": ["src/**/*.ts"] + "include": ["src/**/*.ts", "src/**/*.json"] }