UNPKG

angular-t9n

Version:

A translation tool for Angular i18n

3 lines (2 loc) 7.54 kB
import{a as ne}from"./chunk-6NYZCEZT.js";import{a as Pe}from"./chunk-KZXKYXXO.js";import{a as ee,b as te}from"./chunk-GKXKJW7N.js";import{a as _e,b as ae,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 Re,l as se,m as Ce,n as Ee}from"./chunk-F5XE4YAN.js";import{a as ie,b as oe}from"./chunk-YO72B5SH.js";import{a as W,b as Y,c as Z}from"./chunk-MFCYHQDO.js";import{d as J,f as K,g as Q}from"./chunk-6DDCRX73.js";import"./chunk-FK6IRHWX.js";import"./chunk-4NKRI2IB.js";import"./chunk-NRGBO6B5.js";import"./chunk-XUIN44YA.js";import{Ab as R,Bb as s,Db as j,Hb as c,Ib as M,Ic as V,Jb as F,Kc as q,Q as G,Ta as a,U as A,X,Xb as d,Yb as p,Zb as g,ac as h,cb as B,da as E,dc as P,ec as f,g as L,hb as O,ia as k,ja as z,q as u,wb as C,xb as n,yb as i,zb as N}from"./chunk-IRWV2DJQ.js";import{c as w}from"./chunk-4CLCTAJ7.js";var fe=()=>["distance","id","description","meaning","source","action"];function Ne(e,t){if(e&1&&(n(0,"dl")(1,"dt"),c(2,2),i(),n(3,"dd"),d(4),i(),n(5,"dt"),c(6,3),i(),n(7,"dd"),d(8),i(),n(9,"dt"),c(10,4),i(),n(11,"dd",31),d(12),i(),n(13,"dt"),c(14,5),i(),n(15,"dd",32),d(16),i()()),e&2){let o=t.ngIf;a(4),p(o.description||"-"),a(4),p(o.meaning||"-"),a(4),p(o.source),a(4),p(o._embedded.locales.join(", "))}}function ue(e,t){e&1&&(n(0,"th",33),c(1,6),i())}function Ae(e,t){if(e&1&&(n(0,"td",34),d(1),i()),e&2){let o=t.$implicit;a(),g(" ",o.distance," ")}}function Me(e,t){e&1&&(n(0,"th",35),c(1,7),i())}function ge(e,t){if(e&1&&(n(0,"td",36),d(1),i()),e&2){let o=t.$implicit;C("matTooltip",o.locations==null?null:o.locations.join(` `))("matTooltipDisabled",!(o.locations!=null&&o.locations.length)),a(),g(" ",o.id," ")}}function he(e,t){e&1&&(n(0,"th",35),c(1,8),i())}function Te(e,t){if(e&1&&(n(0,"td",37),d(1),i()),e&2){let o=t.$implicit;a(),p(o.description)}}function He(e,t){e&1&&(n(0,"th",35),c(1,9),i())}function Ue(e,t){if(e&1&&(n(0,"td",37),d(1),i()),e&2){let o=t.$implicit;a(),p(o.meaning)}}function $e(e,t){e&1&&(n(0,"th",35),c(1,10),i())}function be(e,t){if(e&1&&(n(0,"td",37),d(1),i()),e&2){let o=t.$implicit;a(),p(o.source)}}function Ie(e,t){e&1&&N(0,"th",38)}function ye(e,t){if(e&1){let o=j();n(0,"td",37)(1,"button",39),M("click",function(){let r=k(o).$implicit,S=F();return z(S.migrate(r))}),n(2,"mat-icon"),d(3,"input"),i()()()}}function De(e,t){e&1&&N(0,"tr",40)}function ve(e,t){e&1&&N(0,"tr",41)}var nt=(()=>{let t=class t{constructor(){this._sourceOrphanService=E(Pe),this._route=E(J),this._router=E(K),this._snackbar=E(ne),this._destroy=new L,this.params=this._route.params.pipe(u(S=>{var m=S,{orphanId:_}=m,r=w(m,["orphanId"]);return r})),this.orphan=this._route.paramMap.pipe(A(_=>this._sourceOrphanService.orphan(_.get("orphanId"))),X(_=>this._orphan=_),G()),this.similar=this.orphan.pipe(u(_=>_._embedded.similar))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}migrate(_){this.orphan&&this._orphanAction(this._sourceOrphanService.migrateOrphan(this._orphan,_),`Migrated orphan ${this._orphan.id} to unit ${_.id}`)}delete(){this.orphan&&this._orphanAction(this._sourceOrphanService.deleteOrphan(this._orphan),`Deleted orphan ${this._orphan.id}`)}_orphanAction(_,r){_.pipe(A(()=>this._router.navigate([".."],{relativeTo:this._route}))).subscribe(()=>this._snackbar.open(r,void 0,{duration:2500}))}};t.\u0275fac=function(r){return new(r||t)},t.\u0275cmp=B({type:t,selectors:[["t9n-source-orphan"]],decls:37,vars:17,consts:()=>{let _;_=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let r;r=$localize`:␟a4c8dd97ad35918071742dd1be55f3959bff306a␟6470405644971425740:Distance according to the levenshtein comparison`;let S;S=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let m;m=$localize`:␟53150cdcaa3fc290a4f4018e446e44b998f1f155␟5246620794703463867: Delete orphan `;let T;T=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let H;H=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let U;U=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let $;$=$localize`:␟2dafad4f27d4a3856002fe0ecf2e074cd79da428␟3620242059178560709:Occurs in Targets`;let b;b=$localize`:␟33f0509c876e1399d92a9d1882ce38e6f4245ce3␟2590415407309830681: Distance `;let I;I=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let y;y=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let D;D=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let v;v=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let x;return x=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[S,m,T,H,U,$,b,I,y,D,v,[4,"ngIf"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label","Similar units",3,"dataSource"],["matColumnDef","distance"],["mat-header-cell","","matTooltip",_,4,"matHeaderCellDef"],["mat-cell","","matTooltip",r,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",_],["mat-cell","","matTooltip",r],["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",x,3,"click"],["mat-header-row",""],["mat-row",""]]},template:function(r,S){if(r&1&&(n(0,"h2"),d(1),P(2,"async"),i(),O(3,Ne,17,4,"dl",11),P(4,"async"),n(5,"div",12)(6,"table",13),P(7,"async"),R(8,14),O(9,ue,2,0,"th",15)(10,Ae,2,1,"td",16),s(),R(11,17),O(12,Me,2,0,"th",18)(13,ge,2,3,"td",19),s(),R(14,20),O(15,he,2,0,"th",18)(16,Te,2,1,"td",21),s(),R(17,22),O(18,He,2,0,"th",18)(19,Ue,2,1,"td",21),s(),R(20,23),O(21,$e,2,0,"th",18)(22,be,2,1,"td",21),s(),R(23,24),O(24,Ie,1,0,"th",25)(25,ye,4,0,"td",21),s(),O(26,De,1,0,"tr",26)(27,ve,1,0,"tr",27),i()(),n(28,"div",28)(29,"a",29),P(30,"async"),n(31,"mat-icon"),d(32,"keyboard_backspace"),i(),R(33),c(34,0),s(),i(),n(35,"button",30),M("click",function(){return S.delete()}),c(36,1),i()()),r&2){let m;a(),p((m=f(2,7,S.orphan))==null?null:m.id),a(2),C("ngIf",f(4,9,S.orphan)),a(3),C("dataSource",f(7,11,S.similar)),a(20),C("matHeaderRowDef",h(15,fe))("matHeaderRowDefSticky",!0),a(),C("matRowDefColumns",h(16,fe)),a(2),C("queryParams",f(30,13,S.params))}},dependencies:[V,Ee,le,ce,pe,Se,de,Re,me,Oe,se,Ce,re,_e,ae,oe,ie,Z,Y,W,te,ee,Q,q],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});let e=t;return e})();export{nt as SourceOrphanComponent};