angular-t9n
Version:
A translation tool for Angular i18n
4 lines • 6.77 kB
JavaScript
import {J,Z}from'./chunk-4RiDaDru.js';import {S}from'./chunk-XuDY5ztv.js';import {V as Ve,B as Be$1}from'./chunk-VgysnmPQ.js';import {J as Jt,B as Be,V,h as ht}from'./chunk-Cfbj5Ou5.js';import {V as Vi,I as Ii,A as Ai,z as zi,H as Hi,N as Ni,L as Li,P as Pi,B as Bi,j as ji,U as Ui,w as wi,b as bt,g as gi}from'./chunk-BC8OLdk0.js';import {g,a$ as cn,e as en,h as hn,u as un,Y as Yt,m as mt,x as xT,L as Ls,W as Wb,J as Jl,q as qm,o as Lm,Z as Zm,c as Ym,p as sw,t as pb,b as xC,d as bg,P as Pm,z as cw,C as gb,O as OC,aO as td,ad as xm,aP as nd,aE as Zb,aK as SC,E as EC,aQ as id,f as fy}from'./main-XWPOM5LO.js';import {M as Mn,d as de,E as En,A as An,L as Le$1,W as Wt,C as Cn,V as Vn,r as rt,w as wt,K as Kt,X as Xt}from'./chunk-BaYJwvwh.js';import'./chunk-C1Idjiqb.js';import'./chunk-C2N3F-hv.js';import'./chunk-DvU4UsWB.js';var Ie=()=>["id","description","meaning","source"];function Ge(e,i){e&1&&(Ls(0,"mat-error"),Wb(1,4),Jl());}function Ue(e,i){e&1&&(Ls(0,"mat-error"),Wb(1,5),Jl());}function $e(e,i){e&1&&Lm(0,"mat-spinner");}function be(e,i){e&1&&(Ls(0,"h4"),Wb(1,6),Jl());}function De(e,i){e&1&&(Ls(0,"th",27),Wb(1,8),Jl());}function Le(e,i){if(e&1&&(Ls(0,"td",28),EC(1),Jl()),e&2){let t=i.$implicit;Pm("matTooltip",t.locations==null?null:t.locations.join(`
`))("matTooltipDisabled",!t.locations?.length),bg(),id(" ",t.id," ");}}function He(e,i){e&1&&(Ls(0,"th",27),Wb(1,9),Jl());}function ye(e,i){if(e&1&&(Ls(0,"td",29),EC(1),Jl()),e&2){let t=i.$implicit;bg(),fy(t.description);}}function Fe(e,i){e&1&&(Ls(0,"th",27),Wb(1,10),Jl());}function we(e,i){if(e&1&&(Ls(0,"td",29),EC(1),Jl()),e&2){let t=i.$implicit;bg(),fy(t.meaning);}}function ve(e,i){e&1&&(Ls(0,"th",27),Wb(1,11),Jl());}function Xe(e,i){if(e&1&&(Ls(0,"td",29),EC(1),Jl()),e&2){let t=i.$implicit;bg(),fy(t.source);}}function ke(e,i){e&1&&Lm(0,"tr",30);}function xe(e,i){e&1&&Lm(0,"tr",31);}function ze(e,i){if(e&1&&(Ls(0,"h4"),Wb(1,7),Jl(),Ls(2,"div",16)(3,"table",17),td(4,18),xm(5,De,2,0,"th",19)(6,Le,2,3,"td",20),nd(),td(7,21),xm(8,He,2,0,"th",19)(9,ye,2,1,"td",22),nd(),td(10,23),xm(11,Fe,2,0,"th",19)(12,we,2,1,"td",22),nd(),td(13,24),xm(14,ve,2,0,"th",19)(15,Xe,2,1,"td",22),nd(),xm(16,ke,1,0,"tr",25)(17,xe,1,0,"tr",26),Jl()()),e&2){let t=Zb();bg(3),Pm("dataSource",t),bg(13),Pm("matHeaderRowDef",SC(4,Ie))("matHeaderRowDefSticky",true),bg(),Pm("matRowDefColumns",SC(5,Ie));}}function qe(e,i){if(e&1&&(pb(0,be,2,0,"h4"),pb(1,ze,18,6)),e&2){let t=i;gb(t.length?-1:0),bg(),gb(t.length?1:-1);}}var Mt=(()=>{class e{constructor(){this._sourceOrphansService=g(S),this.loading=new cn(false),this.migrations=new cn(null);let t=g(Mn);this.configuration=t.group({distanceThreshold:[0,[de.min(0),de.required]]});}autoMigrate(){this.loading.next(true);let t=+this.configuration.get("distanceThreshold").value;this._sourceOrphansService.autoMigrateOrphans(t).subscribe(d=>{this.migrations.next(d),this.loading.next(false);});}static{this.\u0275fac=function(d){return new(d||e)};}static{this.\u0275cmp=en({type:e,selectors:[["t9n-auto-migrate"]],decls:19,vars:12,consts:()=>{let t;t=$localize`:␟b526d031b42722e7cf8f52258430151b09155310␟8720444212022970709:Auto-Migration`;let d;d=$localize`:␟645da333888a6046d72b7f15fd1e87a9867f6e0b␟3354447976218397931: Migrate orphans which are below or equal to the distance threshold. The distance is according to the ${"\uFFFD#4\uFFFD"}:START_LINK:levenshtein algorithm${"\uFFFD/#4\uFFFD"}:CLOSE_LINK:. It will skip the auto-migration for a unit if multiple units with the same distance are found.
`;let l;l=$localize`:␟d7889457595bfbba70a08a2fda7900d9a03c145d␟1566498821816930256:Distance Threshold`;let c;c=$localize`:␟e3edd3e19833c7f464489875500c01f419dc5bf9␟6106421584531086998: Auto-Migrate `;let P;P=$localize`:␟f65037cd7d8696da381c6bbfdb16a64e68cfd8f9␟8169327733416527426:The distance threshold is required`;let h;h=$localize`:␟9798f27134a0031635334c98475b181d4b5fde46␟5286185694292962955:The distance threshold must be greater or equal to 0`;let I;I=$localize`:␟7a0a2c89ce48e66e873d5af4ab5586dc2325c019␟190365802837090999:No orphans met conditions.`;let G;G=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let U;U=$localize`:␟4d56cc943bf3b8863ab0a40c3e30d1a75763c968␟693184310236136215:Successful migrations`;let $;$=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let b;b=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let D;D=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let L;return L=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`,[t,d,l,c,P,h,I,U,$,b,D,L,["href","https://en.wikipedia.org/wiki/Levenshtein_distance"],[3,"ngSubmit","formGroup"],["matInput","","type","number","formControlName","distanceThreshold","required","","min","0"],["mat-raised-button","","color","primary",3,"disabled"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",G,3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-row",""],["mat-row",""]]},template:function(d,l){if(d&1&&(Ls(0,"h2"),Wb(1,0),Jl(),Ls(2,"p"),qm(3,1),Lm(4,"a",12),Zm(),Jl(),Ls(5,"form",13),Ym("ngSubmit",function(){return l.autoMigrate()}),Ls(6,"mat-form-field")(7,"mat-label"),Wb(8,2),Jl(),Lm(9,"input",14),sw(),pb(10,Ge,2,0,"mat-error"),pb(11,Ue,2,0,"mat-error"),Jl(),Ls(12,"button",15),xC(13,"async"),Wb(14,3),Jl()(),pb(15,$e,1,0,"mat-spinner"),xC(16,"async"),pb(17,qe,2,2),xC(18,"async")),d&2){let c;bg(5),Pm("formGroup",l.configuration),bg(4),cw(),bg(),gb(l.configuration.get("distanceThreshold")?.errors?.required?10:-1),bg(),gb(l.configuration.get("distanceThreshold")?.errors?.min?11:-1),bg(),Pm("disabled",OC(13,6,l.loading)&&l.configuration.valid),bg(3),gb(OC(16,8,l.loading)?15:-1),bg(2),gb((c=OC(18,10,l.migrations))?17:-1,c);}},dependencies:[En,An,Le$1,Wt,Cn,Vn,rt,wt,Kt,Xt,Jt,Be,V,ht,Ve,Be$1,hn,un,J,Z,Vi,Ii,Ai,zi,Hi,Ni,Li,Pi,Bi,ji,Ui,wi,bt,gi,Yt,mt,xT],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem}form[_ngcontent-%COMP%]{margin-bottom:1rem}form[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:block;margin-top:2rem}"]});}}return e})();
export{Mt as AutoMigrateComponent};