1"use strict";(self.webpackChunkvokabeldojo=self.webpackChunkvokabeldojo||[]).push([[425],{643:(P,C,_)=>{_.d(C,{h:()=>h});var n=_(9676);let h=(()=>{class e{constructor(){this.onChange=new n.vpe,this._currentStyle="serif",this.loadSetting()}get currentStyle(){return this._currentStyle}updateFontStyle(r,a){window.localStorage.setItem("userSettings",JSON.stringify({style:r})),this._currentStyle=r,a||this.onChange.emit(r)}loadSetting(){try{const r=window.localStorage.getItem("userSettings");r&&(this._currentStyle=JSON.parse(r).style)}catch(r){console.error(r),this._currentStyle="serif"}}}return e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=n.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},9425:(P,C,_)=>{_.d(C,{R:()=>M});var n=_(9676),h=_(2508),e=_(266),d=_(6720),r=_(1126),a=_(7199),s=_(5182),l=_(4666),p=_(1847),c=_(5352),g=_(643);function y(T,w){if(1&T&&n._UZ(0,"app-word-type",7),2&T){const o=n.oxw().$implicit;n.Q6J("card",o)}}function O(T,w){if(1&T){const o=n.EpF();n.ynx(0),n.TgZ(1,"div",2),n.NdJ("click",function(){const x=n.CHM(o).$implicit,S=n.oxw();return n.KtG(S.show(x))}),n.TgZ(2,"span",3),n._uU(3),n.qZA(),n.TgZ(4,"span",4),n._uU(5),n.qZA(),n.TgZ(6,"div",5),n.YNc(7,y,1,1,"app-word-type",6),n.qZA()(),n.BQk()}if(2&T){const o=w.$implicit,i=n.oxw();n.xp6(2),n.ekj("serif","serif"===i.fontMode),n.xp6(1),n.hij(" ",o.japanese," "),n.xp6(2),n.hij(" ",o.german.join(", ")," "),n.xp6(2),n.Q6J("ngIf",o.wordType)}}let M=(()=>{class T{constructor(o,i,m,x){this.router=o,this.cardService=i,this.fontSwitcherService=m,this.cdr=x,this.allowEdit=!1,this.selectedCard=new n.vpe,this.showSubmenu=!1,this.searchForm=new h.NI(""),this.modeForm=new h.cw({left:new h.NI("japanese"),right:new h.NI("german")})}get leftSide(){return this.modeForm.get("left").value}get rightSide(){return this.modeForm.get("right").value}get fontMode(){return this.fontSwitcherService.currentStyle}get cardTypes(){return a.eT}get wordTypes(){return a.CH}get adjectiveTypes(){return a.V3}get verbTypes(){return a.X7}ngOnChanges(o){for(const i in o){const m=o[i];JSON.stringify(m.currentValue),JSON.stringify(m.previousValue),this.cdr.detectChanges()}}ngOnInit(){this.cards||(this.cardSub=this.cardService.allPublicCards().subscribe(o=>{this.cards=o.map(i=>r.Z.createFromCardInterface(i))})),this.modeSub=this.modeForm.valueChanges.subscribe(()=>{this.updateFilter()}),this.searchFormSub=this.searchForm.valueChanges.subscribe(()=>{this.updateFilter()})}ngOnDestroy(){this.cardSub?.unsubscribe(),this.modeSub?.unsubscribe(),this.searchFormSub?.unsubscribe()}updateFilter(){if(this.searchForm.value){const o=new e.Z(this.cards,["german","japanese","examples.german","examples.japanese","examples.reading","japanese_readings","chinese_readings"],{caseSensitive:!1});this.cards=o.search(this.searchForm.value)}}reading(o,i){return o[i]?o[i]:o.kanji?o.kanji:o.hiragana?o.hiragana:o.katakana?o.katakana:o.romaji?o.romaji:void 0}readingWithPreference(o,i){switch(o){case"japanese":if(i.japanese)return i.japanese;if(i.kanji)return i.kanji;if(i.hiragana)return i.hiragana;if(i.katakana)return i.katakana;break;case"reading":if(i.japanese_readings)return i.chinese_readings?i.japanese_readings.concat(i.chinese_readings.join(", ")):i.japanese_readings.join(", ");if(i.chinese_readings)return i.chinese_readings.join(", ");break;case"german":return""!=i.german[0]?i.german[0]:this.readingWithPreference("reading",i)}}show(o){this.selectedCard.emit(o),this.router.navigate([{outlets:{modal:["cards",o.uid]}}])}}return T.\u0275fac=function(o){return new(o||T)(n.Y36(d.F0),n.Y36(c.J),n.Y36(g.h),n.Y36(n.sBO))},T.\u0275cmp=n.Xpm({type:T,selectors:[["app-word-list"]],inputs:{cards:"cards",user:"user",deck:"deck",allowEdit:"allowEdit"},outputs:{selectedCard:"selectedCard"},standalone:!0,features:[n.TTD,n.jDz],decls:2,vars:1,consts:[[1,"word-list"],[4,"ngFor","ngForOf"],[1,"card","c-pointer",3,"click"],[1,"japanese"],[1,"translation","muted"],[1,"type"],[3,"card",4,"ngIf"],[3,"card"]],template:function(o,i){1&o&&(n.TgZ(0,"div",0),n.YNc(1,O,8,5,"ng-container",1),n.qZA()),2&o&&(n.xp6(1),n.Q6J("ngForOf",i.cards))},dependencies:[d.Bz,l.ez,l.sg,l.O5,p.V],styles:["[_nghost-%COMP%]{display:block;overflow:hidden;padding:3px;margin:-3px}.word-list[_ngcontent-%COMP%]{padding-top:10px;padding-bottom:20px}.word-list[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding:6px;width:100%;margin:8px 0;box-sizing:border-box;display:inline-block;border:1px solid gray;-webkit-appearance:none}tr[_ngcontent-%COMP%]{min-height:25px}td[_ngcontent-%COMP%]{padding:5px}li[_ngcontent-%COMP%]{text-align:center}tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#6464641a}@media (hover: hover){tr[_ngcontent-%COMP%]:hover{background-color:#6464644d}}.card[_ngcontent-%COMP%]{box-shadow:0 1px 3px #00000080;overflow:hidden;position:relative;background-color:var(--light-background);border-radius:5px;min-height:50px;padding:5px;margin-bottom:5px;transition:all .3s}@media (prefers-color-scheme: dark){.card[_ngcontent-%COMP%]:hover{background-color:var(--menu-hover)}}.card[_ngcontent-%COMP%] .japanese[_ngcontent-%COMP%]{display:block;font-size:20px}.card[_ngcontent-%COMP%] .translation[_ngcontent-%COMP%]{display:block}
1.card[_ngcontent-%COMP%] .type[_ngcontent-%COMP%]{position:absolute;top:0;right:0;padding:5px;font-size:14px}"],data:{animation:[s.O4]}}),T})()},1847:(P,C,_)=>{_.d(C,{V:()=>j});var n=_(4666),h=_(7199),e=_(9676);function d(t,u){1&t&&(e.TgZ(0,"div",11),e._uU(1," Nomen "),e.qZA())}function r(t,u){1&t&&(e.TgZ(0,"div",11),e._uU(1," \u3059\u308b-Nomen "),e.qZA())}function a(t,u){1&t&&(e.ynx(0),e.TgZ(1,"ruby"),e._uU(2,"\u4e00"),e.TgZ(3,"rt"),e._uU(4,"\u3044\u3061"),e.qZA(),e._uU(5,"\u6bb5"),e.TgZ(6,"rt"),e._uU(7,"\u3060\u3093"),e.qZA()(),e._uU(8," Verb "),e.BQk())}function s(t,u){1&t&&(e.ynx(0),e.TgZ(1,"ruby"),e._uU(2,"\u4e94"),e.TgZ(3,"rt"),e._uU(4,"\u3054"),e.qZA(),e._uU(5,"\u6bb5"),e.TgZ(6,"rt"),e._uU(7,"\u3060\u3093"),e.qZA()(),e._uU(8," Verb "),e.BQk())}function l(t,u){1&t&&(e.ynx(0),e._uU(1," Suru Verb "),e.BQk())}function p(t,u){1&t&&(e.ynx(0),e._uU(1," Irregular Verb "),e.BQk())}function c(t,u){1&t&&(e.ynx(0),e._uU(1," Verb "),e.BQk())}function g(t,u){if(1&t&&(e.TgZ(0,"div",12),e.ynx(1,0),e.YNc(2,a,9,0,"ng-container",13),e.YNc(3,s,9,0,"ng-container",13),e.YNc(4,l,2,0,"ng-container",13),e.YNc(5,p,2,0,"ng-container",13),e.YNc(6,c,2,0,"ng-container",14),e.BQk(),e.qZA()),2&t){const v=e.oxw();e.xp6(1),e.Q6J("ngSwitch",v.card.verbType),e.xp6(1),e.Q6J("ngSwitchCase",v.verbTypes.ichidan),e.xp6(1),e.Q6J("ngSwitchCase",v.verbTypes.godan),e.xp6(1),e.Q6J("ngSwitchCase",v.verbTypes.suru),e.xp6(1),e.Q6J("ngSwitchCase",v.verbTypes.irregular)}}function y(t,u){1&t&&(e.ynx(0),e._uU(1," \u3044 Adjektiv "),e.BQk())}function O(t,u){1&t&&e._uU(0," \u306a Adjektiv ")}function M(t,u){if(1&t&&(e.TgZ(0,"div",15),e.YNc(1,y,2,0,"ng-container",16),e.YNc(2,O,1,0,"ng-template",null,17,e.W1O),e.qZA()),2&t){const v=e.MAs(3),f=e.oxw();e.xp6(1),e.Q6J("ngIf",f.card.adjectiveType==f.adjectiveTypes.iAdjective)("ngIfElse",v)}}function T(t,u){1&t&&(e.TgZ(0,"div",18),e._uU(1," Adverb "),e.qZA())}function w(t,u){1&t&&(e.TgZ(0,"div",19),e._uU(1," Pronomen "),e.qZA())}function o(t,u){1&t&&(e.TgZ(0,"div",20),e._uU(1," Pr\xe4position "),e.qZA())}function i(t,u){1&t&&(e.TgZ(0,"div",21),e._uU(1," Konjunktion "),e.qZA())}function m(t,u){1&t&&(e.TgZ(0,"div",22),e._uU(1," Numeral "),e.qZA())}function x(t,u){1&t&&(e.TgZ(0,"div",23),e._uU(1," Interjektion "),e.qZA())}function S(t,u){1&t&&(e.TgZ(0,"div",24),e._uU(1," Kanji "),e.qZA())}let j=(()=>{class t{constructor(){}get wordTypes(){return h.CH}get verbTypes(){return h.X7}get adjectiveTypes(){return h.V3}ngOnInit(){}}return t.\u0275fac=function(v){return new(v||t)},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-word-type"]],inputs:{card:"card"},standalone:!0,features:[e.jDz],decls:12,vars:12,consts:[[3,"ngSwitch"],["class","wordType noun",4,"ngSwitchCase"],["class","wordType verb",4,"ngSwitchCase"],["class","wordType adjective",4,"ngSwitchCase"],["class","wordType adverb",4,"ngSwitchCase"],["class","wordType pronoun",4,"ngSwitchCase"],["class","wordType preposition",4,"ngSwitchCase"],["class","wordType conjunction",4,"ngSwitchCase"],["class","wordType numeral",4,"ngSwitchCase"],["class","wordType interjection",4,"ngSwitchCase"],["class","wordType kanji",4,"ngSwitchCase"],[1,"wordType","noun"],[1,"wordType","verb"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"wordType","adjective"],[4,"ngIf","ngIfElse"],["naAdj",""],[1,"wordType","adverb"],[1,"wordType","pronoun"],[1,"wordType","preposition"],[1,"wordType","conjunction"],[1,"wordType","numeral"],[1,"wordType","interjection"],[1,"wordType","kanji"]],template:function(v,f){1&v&&(e.ynx(0,0),e.YNc(1,d,2,0,"div",1),e.YNc(2,r,2,0,"div",1),e.YNc(3,g,7,5,"div",2),e.YNc(4,M,4,2,"div",3),e.YNc(5,T,2,0,"div",4),e.YNc(6,w,2,0,"div",5),e.YNc(7,o,2,0,"div",6),e.YNc(8,i,2,0,"div",7),e.YNc(9,m,2,0,"div",8),e.YNc(10,x,2,0,"div",9),e.YNc(11,S,2,0,"div",10),e.BQk()),2&v&&(e.Q6J("ngSwitch",null==f.card?null:f.card.wordType),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.noun),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.surunoun),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.verb),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.adjective),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.adverb),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.pronoun),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.preposition),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.conjunction),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.numeral),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.interjection),e.xp6(1),e.Q6J("ngSwitchCase",f.wordTypes.kanji))},dependencies:[n.ez,n.O5,n.RF,n.n9,n.ED],styles:["[_nghost-%COMP%]{display:inline-block;font-size:1rem}.wordType[_ngcontent-%COMP%]{color:#fff}
1.wordType.noun[_ngcontent-%COMP%]{color:var(--wordtype-noun)}.wordType.verb[_ngcontent-%COMP%]{color:var(--wordtype-verb)}.wordType.adjective[_ngcontent-%COMP%]{color:var(--wordtype-adjective)}.wordType.adverb[_ngcontent-%COMP%]{color:var(--wordtype-adverb)}.wordType.pronoun[_ngcontent-%COMP%]{color:var(--wordtype-pronoun)}.wordType.preposition[_ngcontent-%COMP%]{color:var(--wordtype-preposition)}.wordType.conjunction[_ngcontent-%COMP%]{color:var(--wordtype-conjunction)}.wordType.numeral[_ngcontent-%COMP%]{color:var(--wordtype-numeral)}.wordType.interjection[_ngcontent-%COMP%]{color:var(--wordtype-interjection)}.wordType.kanji[_ngcontent-%COMP%]{color:var(--wordtype-kanji)}"]}),t})()},266:(P,C,_)=>{_.d(C,{Z:()=>h});class n{static getDescendantProperty(d,r,a=[]){let s,l,p,c,g,y;if(r){if(p=r.indexOf("."),-1===p?s=r:(s=r.slice(0,p),l=r.slice(p+1)),c=d[s],null!==c&&typeof c<"u")if(l||"string"!=typeof c&&"number"!=typeof c)if("[object Array]"===Object.prototype.toString.call(c))for(g=0,y=c.length;g<y;g++)n.getDescendantProperty(c[g],l,a);else l&&n.getDescendantProperty(c,l,a);else a.push(c)}else a.push(d);return a}}class h{constructor(d=[],r=[],a={}){Array.isArray(r)||(a=r,r=[]),this.haystack=d,this.keys=r,this.options=Object.assign({caseSensitive:!1,sort:!1},a)}search(d=""){if(""===d)return this.haystack;const r=[];for(let a=0;a<this.haystack.length;a++){const s=this.haystack[a];if(0===this.keys.length){const l=h.isMatch(s,d,this.options.caseSensitive);l&&r.push({item:s,score:l})}else for(let l=0;l<this.keys.length;l++){const p=n.getDescendantProperty(s,this.keys[l]);let c=!1;for(let g=0;g<p.length;g++){const y=h.isMatch(p[g],d,this.options.caseSensitive);if(y){c=!0,r.push({item:s,score:y});break}}if(c)break}}return this.options.sort&&r.sort((a,s)=>a.score-s.score),r.map(a=>a.item)}static isMatch(d,r,a){d=String(d),r=String(r),a||(d=d.toLocaleLowerCase(),r=r.toLocaleLowerCase());const s=h.nearestIndexesFor(d,r);return!!s&&(d===r?1:s.length>1?s[s.length-1]-s[0]+2:2+s[0])}static nearestIndexesFor(d,r){const a=r.split("");let s=[];return h.indexesOfFirstLetter(d,r).forEach((p,c)=>{let g=p+1;s[c]=[p];for(let y=1;y<a.length;y++){if(g=d.indexOf(a[y],g),-1===g){s[c]=!1;break}s[c].push(g),g++}}),s=s.filter(p=>!1!==p),!!s.length&&s.sort((p,c)=>1===p.length?p[0]-c[0]:(p=p[p.length-1]-p[0])-(c=c[c.length-1]-c[0]))[0]}static indexesOfFirstLetter(d,r){const a=r[0];return d.split("").map((s,l)=>s===a&&l).filter(s=>!1!==s)}}}}]); 2//# sourceMappingURL=425.e449f1ecc49e614c.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.