UNPKG

angular-t9n

Version:

A translation tool for Angular i18n

3 lines (2 loc) 7.54 kB
import{a as ne}from"./chunk-YZWX42DL.js";import{a as Pe}from"./chunk-5YNGG6ZH.js";import{a as ee,b as te}from"./chunk-ZOA5KTCR.js";import{a as ae,b as _e,c as re,d as le,e as de,f as ce,g as Se,h as me,i as Oe,j as pe,k as se,l as Re,m as Ce,n as Ee}from"./chunk-5X2CMPER.js";import{a as ie,b as oe}from"./chunk-2GFTPPRY.js";import{a as Q,b as W,c as Y,e as Z}from"./chunk-3UMPV344.js";import{d as q,f as J,g as K}from"./chunk-JCOG3QZD.js";import"./chunk-SWXDJEZV.js";import"./chunk-IZB6ZOII.js";import"./chunk-OHHIBRCV.js";import{Db as n,Dc as F,Eb as i,Fb as A,Fc as V,Gb as s,Hb as R,Jb as B,Ob as c,Pb as T,Q as L,Rb as j,U as g,X as G,Ya as a,Za as P,ac as l,bc as p,cc as H,eb as z,ec as U,g as w,hc as f,ic as u,ma as X,na as k,q as h,sb as O,ub as C}from"./chunk-XN5ZPBP6.js";import{c as x}from"./chunk-4CLCTAJ7.js";var fe=()=>["distance","id","description","meaning","source","action"];function ue(e,o){if(e&1&&(n(0,"dl")(1,"dt"),c(2,2),i(),n(3,"dd"),l(4),i(),n(5,"dt"),c(6,3),i(),n(7,"dd"),l(8),i(),n(9,"dt"),c(10,4),i(),n(11,"dd",31),l(12),i(),n(13,"dt"),c(14,5),i(),n(15,"dd",32),l(16),i()()),e&2){let t=o.ngIf;a(4),p(t.description||"-"),a(4),p(t.meaning||"-"),a(4),p(t.source),a(4),p(t._embedded.locales.join(", "))}}function Ne(e,o){e&1&&(n(0,"th",33),c(1,6),i())}function Ae(e,o){if(e&1&&(n(0,"td",34),l(1),i()),e&2){let t=o.$implicit;a(),H(" ",t.distance," ")}}function Me(e,o){e&1&&(n(0,"th",35),c(1,7),i())}function he(e,o){if(e&1&&(n(0,"td",36),l(1),i()),e&2){let t=o.$implicit;C("matTooltip",t.locations==null?null:t.locations.join(` `))("matTooltipDisabled",!(t.locations!=null&&t.locations.length)),a(),H(" ",t.id," ")}}function ge(e,o){e&1&&(n(0,"th",35),c(1,8),i())}function Te(e,o){if(e&1&&(n(0,"td",37),l(1),i()),e&2){let t=o.$implicit;a(),p(t.description)}}function He(e,o){e&1&&(n(0,"th",35),c(1,9),i())}function Ue(e,o){if(e&1&&(n(0,"td",37),l(1),i()),e&2){let t=o.$implicit;a(),p(t.meaning)}}function $e(e,o){e&1&&(n(0,"th",35),c(1,10),i())}function be(e,o){if(e&1&&(n(0,"td",37),l(1),i()),e&2){let t=o.$implicit;a(),p(t.source)}}function Ie(e,o){e&1&&A(0,"th",38)}function ye(e,o){if(e&1){let t=B();n(0,"td",37)(1,"button",39),T("click",function(){let d=X(t).$implicit,S=j();return k(S.migrate(d))}),n(2,"mat-icon"),l(3,"input"),i()()()}}function De(e,o){e&1&&A(0,"tr",40)}function ve(e,o){e&1&&A(0,"tr",41)}var ot=(()=>{class e{constructor(t,_,d,S){this._sourceOrphanService=t,this._route=_,this._router=d,this._snackbar=S,this._destroy=new w,this.params=this._route.params.pipe(h(M=>{var E=M,{orphanId:m}=E,N=x(E,["orphanId"]);return N})),this.orphan=this._route.paramMap.pipe(g(m=>this._sourceOrphanService.orphan(m.get("orphanId"))),G(m=>this._orphan=m),L()),this.similar=this.orphan.pipe(h(m=>m._embedded.similar))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}migrate(t){this.orphan&&this._orphanAction(this._sourceOrphanService.migrateOrphan(this._orphan,t),`Migrated orphan ${this._orphan.id} to unit ${t.id}`)}delete(){this.orphan&&this._orphanAction(this._sourceOrphanService.deleteOrphan(this._orphan),`Deleted orphan ${this._orphan.id}`)}_orphanAction(t,_){t.pipe(g(()=>this._router.navigate([".."],{relativeTo:this._route}))).subscribe(()=>this._snackbar.open(_,void 0,{duration:2500}))}static{this.\u0275fac=function(_){return new(_||e)(P(Pe),P(q),P(J),P(ne))}}static{this.\u0275cmp=z({type:e,selectors:[["t9n-source-orphan"]],decls:37,vars:17,consts:()=>{let t;t=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let _;_=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let d;d=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let S;S=$localize`:␟53150cdcaa3fc290a4f4018e446e44b998f1f155␟5246620794703463867: Delete orphan `;let m;m=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let N;N=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let M;M=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let E;E=$localize`:␟2dafad4f27d4a3856002fe0ecf2e074cd79da428␟3620242059178560709:Occurs in Targets`;let $;$=$localize`:␟33f0509c876e1399d92a9d1882ce38e6f4245ce3␟2590415407309830681: Distance `;let b;b=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let I;I=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let y;y=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let D;D=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let v;return v=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[d,S,m,N,M,E,$,b,I,y,D,[4,"ngIf"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label","Similar units",3,"dataSource"],["matColumnDef","distance"],["mat-header-cell","","matTooltip",t,4,"matHeaderCellDef"],["mat-cell","","matTooltip",_,4,"matCellDef"],["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"],["matColumnDef","action"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"actions"],["mat-raised-button","","color","primary","routerLink","..",3,"queryParams"],["type","button","mat-raised-button","","color","warn",3,"click"],[1,"source"],[1,"target"],["mat-header-cell","","matTooltip",t],["mat-cell","","matTooltip",_],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-cell",""],["type","button","mat-icon-button","","matTooltip",v,3,"click"],["mat-header-row",""],["mat-row",""]]},template:function(_,d){if(_&1&&(n(0,"h2"),l(1),f(2,"async"),i(),O(3,ue,17,4,"dl",11),f(4,"async"),n(5,"div",12)(6,"table",13),f(7,"async"),s(8,14),O(9,Ne,2,0,"th",15)(10,Ae,2,1,"td",16),R(),s(11,17),O(12,Me,2,0,"th",18)(13,he,2,3,"td",19),R(),s(14,20),O(15,ge,2,0,"th",18)(16,Te,2,1,"td",21),R(),s(17,22),O(18,He,2,0,"th",18)(19,Ue,2,1,"td",21),R(),s(20,23),O(21,$e,2,0,"th",18)(22,be,2,1,"td",21),R(),s(23,24),O(24,Ie,1,0,"th",25)(25,ye,4,0,"td",21),R(),O(26,De,1,0,"tr",26)(27,ve,1,0,"tr",27),i()(),n(28,"div",28)(29,"a",29),f(30,"async"),n(31,"mat-icon"),l(32,"keyboard_backspace"),i(),s(33),c(34,0),R(),i(),n(35,"button",30),T("click",function(){return d.delete()}),c(36,1),i()()),_&2){let S;a(),p((S=u(2,7,d.orphan))==null?null:S.id),a(2),C("ngIf",u(4,9,d.orphan)),a(3),C("dataSource",u(7,11,d.similar)),a(20),C("matHeaderRowDef",U(15,fe))("matHeaderRowDefSticky",!0),a(),C("matRowDefColumns",U(16,fe)),a(2),C("queryParams",u(30,13,d.params))}},dependencies:[F,Ee,le,ce,pe,Se,de,se,me,Oe,Re,Ce,re,ae,_e,oe,ie,Z,W,Q,Y,te,ee,K,V],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem 1.5rem}.source[_ngcontent-%COMP%], .target[_ngcontent-%COMP%]{white-space:pre-wrap}table[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})}}return e})();export{ot as SourceOrphanComponent};