1import{a as T,b as fe}from"./chunk-6GSSZCVG.js";import{d as E}from"./chunk-NGU2QJKY.js";import"./chunk-I4T2QFYJ.js";import"./chunk-LOPNCJGN.js";import{$ as c,$b as oe,Db as ee,Eb as te,G as R,H as O,Ha as K,I as j,Ic as he,J as D,K as o,L as x,La as q,Lb as ie,Ma as X,N as A,Ob as ne,Oc as _e,Pc as ue,R as p,T as _,Ta as J,Tb as re,U,Va as Y,W as h,X as W,Z as z,_ as H,aa as a,ba as u,cc as ae,dc as le,fa as w,fc as ce,ga as C,ha as m,ka as V,ma as L,na as N,nc as se,oa as $,pc as de,qa as s,ra as k,sa as v,sc as me,tc as pe,u as B,v as y,w as b,wb as Z,ya as Q,za as G}from"./chunk-LW6HKP4X.js";import"./chunk-CYHQNBVJ.js";import"./chunk-4Y2CX5QG.js";import"./chunk-HC6MZPB3.js";import"./chunk-4QCDUIMV.js";import"./chunk-WP7CHTTB.js";import"./chunk-3H72FJST.js";import"./chunk-I3L5IO2V.js";import"./chunk-5CJ4Q3WZ.js";import"./chunk-BL3ES2ZX.js";import"./chunk-WQFHGS2I.js";import"./chunk-MDNOIDWB.js";import"./chunk-XAKB7R5D.js";import"./chunk-RTD7OIC3.js";import"./chunk-5OMUW5VI.js";import"./chunk-OBXDPQ3V.js";import"./chunk-6MRCLBSZ.js";import"./chunk-MCRJI3T3.js";import"./chunk-MJBR6MFX.js";import"./chunk-LAF5CN3T.js";import"./chunk-XGHWADQB.js";import"./chunk-RLGX6EJO.js";import"./chunk-6LZHRIYV.js";import"./chunk-FVMC7TAS.js";import"./chunk-4U6PRYVA.js";import"./chunk-U4MOEAPB.js";import"./chunk-JWIEPCRG.js";import"./chunk-C5RQ2IC2.js";import"./chunk-D4VGNZLR.js";import"./chunk-JHLW7V75.js";import"./chunk-SV7S5NYR.js";import{k as S}from"./chunk-AOMQVBFH.js";function ye(n,r){if(n&1){let i=w();c(0,"ion-button",3),C("click",function(){y(i);let e=m(3);return b(e.openInBrowser())}),s(1,"Open Original"),a()}}function be(n,r){if(n&1&&(s(0),Q(1,"date")),n&2){let i=m(4);v(" | ",G(1,1,i.article.date)," ")}}function Se(n,r){if(n&1&&(c(0,"div",9),s(1),a()),n&2){let i=m(4);o(),v(" ",i.article.tags.join(" \u2022 ")," ")}}function Ie(n,r){n&1&&s(0,", ")}function we(n,r){if(n&1){let i=w();c(0,"span",3),C("click",function(e){let l=y(i).$implicit,d=m(4);return b(d.loadArtist(e,l))}),c(1,"a",11),s(2),a(),p(3,Ie,1,0),a()}if(n&2){let i=r.$implicit,t=r.$index,e=r.$count;o(2),k(i.name),o(),h(t!==e-1?3:-1)}}function Me(n,r){if(n&1&&(c(0,"div",9),s(1),a(),c(2,"div",9),s(3),a(),c(4,"div",9),s(5),a()),n&2){let i=m(4);o(),v("Genres: ",i.article.genres.join(", "),""),o(2),v("Keywords: ",i.article.keywords.join(", "),""),o(2),v("ID: ",i.article.id,"")}}function Pe(n,r){if(n&1&&(c(0,"p"),u(1,"img",12),a()),n&2){let i=m(4);o(),_("src",i.headerImage,O)}}function Oe(n,r){if(n&1&&(c(0,"div")(1,"div",4)(2,"div",5)(3,"ion-thumbnail",6),u(4,"img",7),a(),c(5,"span"),s(6),a()(),c(7,"h1")(8,"a",8),s(9),a()(),c(10,"div",9),s(11),p(12,be,2,3),a(),p(13,Se,2,1,"div",9),c(14,"div",9),s(15,"Artists: "),z(16,we,4,2,"span",null,W),a(),p(18,Me,6,3),u(19,"hr"),p(20,Pe,2,1,"p"),a(),u(21,"div",10),a()),n&2){let i=m(3);o(4),V("alt",i.article.sourceName),_("src",i.article.sourceImage,O),o(2),k(i.article.sourceName),o(2),V("href",i.article.url,O),o(),k(i.article.title),o(2),v("",i.article.author," "),o(),h(i.article.date?12:-1),o(),h(i.article.tags&&i.article.tags.length>0?13:-1),o(3),H(i.article.artists),o(2),h(i.ux.adminMode?18:-1),o(2),h(i.headerImage?20:-1),o(),_("innerHTML",i.article.safeReadable||i.article.safeDescription||i.article.textContent,R)}}function Ae(n,r){if(n&1&&(c(0,"div",1),p(1,ye,2,0,"ion-button")(2,Oe,22,11,"div"),a()),n&2){let i=m(2);o(),h(i.article.iframeFailed&&i.readerStyle=="original"?1:-1),o(),h(i.article&&i.article.title?2:-1)}}function ke(n,r){n&1&&(c(0,"ion-text")(1,"p",14),s(2,"This page could not be embedded. Opening in an external browser"),a()())}function Ee(n,r){if(n&1&&(u(0,"iframe",13,0),p(2,ke,3,0,"ion-text")),n&2){let i=m(3);_("src",i.article.safeUrl,j),o(2),h(i.article.iframeFailed?2:-1)}}function Te(n,r){if(n&1&&(c(0,"div",2),p(1,Ee,3,2),a()),n&2){let i=m(2);o(),h(i.article&&i.article.safeUrl?1:-1)}}function Ve(n,r){if(n&1&&p(0,Ae,3,2,"div",1)(1,Te,2,1,"div",2),n&2){let i=m();h(i.readerStyle=="reader"||i.article.iframeFailed?0:-1),o(),h(i.readerStyle=="original"&&!i.article.iframeFailed?1:-1)}}var ge=(()=>{let r=class r{constructor(t,e){this.ux=t,this.musicService=e,this.readerStyle="reader",this.displayParams={showCondensed:"reader",showPlayer:!0},this.iframeFailed=!1,this.headerImage=""}ngOnInit(){let t=this.article.image;if(this.article&&this.article.image){let e=new URL(this.article.image);t=e.origin+e.pathname}t&&this.article.readable&&this.article.readable.search("<img")==-1&&this.article.readable.search(t)==-1&&(this.headerImage=t)}openInBrowser(){return S(this,null,function*(){this.article&&(yield this.ux.openBrowser(this.article.url))})}setReaderStyle(t){this.readerStyle=this.readerStyle==="original"?"reader":"original",localStorage.setItem("readerStyle",this.readerStyle),this.article&&this.readerStyle=="original"&&this.ux.isIframable(this.article.url).then(e=>{this.article&&(this.article.iframeFailed=!e)})}loadArtist(t,e){if(e&&e.link){let l={name:e.name,artists:[e],source:"spotify",sourceId:this.article.i
1d||"",genres:e.genres||[],spotifyGenres:e.spotifyGenres||[],type:"artist",exactMatch:e.exactMatch||!1,images:e.images||[e.image||this.article.image],url:e.link,safeUrl:e.safeUrl,thumbnail:e.thumbnail||e.image||this.article.image};this.musicService.prependCurrentMusic([l]),t.stopPropagation(),t.preventDefault()}else console.warn("Artist link is not available:",e)}ngOnChanges(t){if(t.readerStyle){let e=t.readerStyle;e.currentValue=="original"&&e.previousValue=="reader"&&console.log("change",this.article.title)}}};r.\u0275fac=function(e){return new(e||r)(x(E),x(T))},r.\u0275cmp=A({type:r,selectors:[["app-article-component"]],inputs:{article:"article",readerStyle:"readerStyle"},features:[B],decls:2,vars:1,consts:[["externalFrame",""],[1,"text-font","room-for-player","reader","ion-padding"],[1,"resp-container","room-for-player"],[3,"click"],[1,"metadata"],[1,"article-info","article-attribution"],["slot","start",1,"source-image"],[1,"img-thumb",3,"alt","src"],["target","_blank",1,"title",3,"href"],[1,"article-info"],[3,"innerHTML"],["href",""],[3,"src"],["frameborder","0","allowtransparency","true","allow","encrypted-media",1,"resp-iframe","article",3,"src"],[1,"ion-padding","ion-margin"]],template:function(e,l){e&1&&(c(0,"div"),p(1,Ve,2,2),a()),e&2&&(o(),h(l.article?1:-1))},dependencies:[q,ee,ae,le],styles:["iframe[_ngcontent-%COMP%] .article[_ngcontent-%COMP%]{height:100%}.metadata[_ngcontent-%COMP%]{text-align:center}.article-attribution[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.metadata[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-decoration:none}ion-thumbnail.source-image[_ngcontent-%COMP%]{display:flex;--size: 30px;margin-top:4px;margin-bottom:4px;margin-right:4px}.img-thumb[_ngcontent-%COMP%]{max-width:30px;border-radius:4px;width:unset;height:unset;margin:0}.resp-container[_ngcontent-%COMP%]{position:relative;overflow:hidden;padding-top:calc(100% - 120px);padding-top:0;height:100%;height:100vh}.room-for-player[_ngcontent-%COMP%]{margin-bottom:30vh!important;margin:0 auto;background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #0000001a}.reader[_ngcontent-%COMP%]{margin-bottom:30vh!important;max-width:var(--reader-width);margin:0 auto;background-color:#fff;border-radius:8px;box-shadow:0 2px 10px #0000001a;text-wrap:auto}h1[_ngcontent-%COMP%] a[_ngcontent-%COMP%], h2[_ngcontent-%COMP%] a[_ngcontent-%COMP%], h3[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--text-color);font-size:2rem}.resp-iframe[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100vh;border:0}ion-label[_ngcontent-%COMP%]{line-height:1.2;display:block}hr[_ngcontent-%COMP%]{background:#e6e6e6;margin-left:1rem;margin-right:1rem;margin-top:1rem}.article-info[_ngcontent-%COMP%]{font-size:.9rem;color:var(--text-color);margin-bottom:.25rem}"]});let n=r;return n})();var Fe=["scrollContainer"];function Be(n,r){if(n&1&&(c(0,"div",17),u(1,"app-article-component",18),a()),n&2){let i=r.$implicit,t=m();U("left",i.offset,"px")("position","absolute"),o(),_("article",i.article)("readerStyle",t.readerStyle)}}var Ke=(()=>{let r=class r{constructor(t,e,l,d,g){this.articlesService=t,this.route=e,this.router=l,this.musicService=d,this.ux=g,this.totalItems=1e4,this.itemWidth=window.innerWidth,this.buffer=3,this.allItems=[],this.visibleItems=[],this.startIndex=0,this.article=!1,this.readerStyle="reader",de({chevronForward:pe,chevronBack:me,playBack:_e,playForward:ue,openOutline:he}),this.route.queryParams.subscribe(f=>S(this,null,function*(){let I=this.router.getCurrentNavigation();if(I&&I.extras.state){let M=I.extras.state.article;M&&(this.recoverViewMode(),this.setArticle(M))}}))}ngOnInit(){}ngAfterViewInit(){this.itemWidth=window.innerWidth,this.initItems(),this.startIndex=this.articlesService.getDisplayableIndex(),this.updateVisibleItems(this.startIndex)}initItems(){this.allItems=this.articlesService.currentArticles.map((t,e)=>({article:t,offset:e*this.itemWidth}))}onScroll(t){this.updateVisibleItems()}scrollRightOneItem(t,e){this.updateVisibleItems();let l=this.scrollContainer.nativeElement;l.scrollLeft+=e*this.itemWidth}updateVisibleItems(t=0){var F;let e=this.scrollContainer.nativeElement,l=e.scrollLeft,d=e.clientWidth,g=t+Math.max(Math.floor(l/this.itemWidth)-this.buffer,0),f=t+Math.min(Math.ceil((l+d)/this.itemWidth)+this.buffer,this.totalItems);this.visibleItems=this.allItems.slice(g,f);let I=l+d/2,M=Math.floor(I/this.itemWidth),P=(F=this.allItems[M])==null?void 0:F.article;
1P&&(!this.article||this.article.id!=P.id)&&(this.setArticle(P),P.id===this.articlesService.currentArticles[this.articlesService.currentArticles.length-2].id&&this.loadMoreArticles())}loadMoreArticles(){var t;this.articlesService.searchParams&&(this.articlesService.searchParams.page=((t=this.articlesService.searchParams.page)!=null?t:1)+1),this.articlesService.nextPage().then(e=>{this.initItems()})}setArticle(t){return S(this,null,function*(){t&&(console.log("set Article ",t),this.article=t,t.music&&this.musicService.setCurrentMusic(t.music),t&&this.readerStyle=="original"&&this.ux.isIframable(t.url).then(e=>{this.article&&(this.article.iframeFailed=!e)}))})}recoverViewMode(){return S(this,null,function*(){let t=localStorage.getItem("readerStyle");(t==="original"||t==="reader")&&(this.readerStyle=t)})}setReaderStyle(t){this.readerStyle=this.readerStyle==="original"?"reader":"original",localStorage.setItem("readerStyle",this.readerStyle),this.article&&this.readerStyle=="original"&&this.ux.isIframable(this.article.url).then(e=>{this.article&&(this.article.iframeFailed=!e)})}openInBrowser(){return S(this,null,function*(){this.article&&(yield this.ux.openBrowser(this.article.url))})}handleKeyboardEvent(t){let l=t.key==="ArrowRight",d=t.key==="ArrowLeft";l?this.scrollRightOneItem(t,1):d&&this.scrollRightOneItem(t,-1)}};r.\u0275fac=function(e){return new(e||r)(x(fe),x(J),x(Y),x(T),x(E))},r.\u0275cmp=A({type:r,selectors:[["app-article"]],viewQuery:function(e,l){if(e&1&&L(Fe,5),e&2){let d;
1N(d=$())&&(l.scrollContainer=d.first)}},hostBindings:function(e,l){e&1&&C("keydown",function(g){return l.handleKeyboardEvent(g)},!1,D)},decls:22,vars:5,consts:[["scrollContainer",""],[3,"translucent"],["color","dark",2,"--ion-color-base","#12000C !important"],[2,"padding-inline-start","0"],["slot","start"],["defaultHref","/tabs/listen"],["slot","end"],["mode","ios",3,"ionChange","value"],["value","original"],["value","reader"],[3,"fullscreen"],["color","primary","shape","round","size","large","aria-label","Scroll next",1,"scroll-button","button-next",3,"click"],["slot","icon-only","name","chevron-forward"],["color","primary","shape","round","size","large","aria-label","Scroll previous",1,"scroll-button","button-prev",3,"click"],["slot","icon-only","name","chevron-back"],[1,"carousel",3,"scroll"],["class","carousel-item",3,"left","position",4,"ngFor","ngForOf"],[1,"carousel-item"],[3,"article","readerStyle"]],template:function(e,l){if(e&1){let d=w();c(0,"ion-header",1)(1,"ion-toolbar",2)(2,"ion-title",3),s(3),a(),c(4,"ion-buttons",4),u(5,"ion-back-button",5),a(),c(6,"ion-buttons",6)(7,"ion-segment",7),C("ionChange",function(f){return y(d),b(l.setReaderStyle(f))}),c(8,"ion-segment-button",8)(9,"ion-label"),s(10,"Original"),a()(),c(11,"ion-segment-button",9)(12,"ion-label"),s(13,"Reader"),a()()()()()(),c(14,"ion-content",10)(15,"ion-button",11),C("click",function(f){return y(d),b(l.scrollRightOneItem(f,1))}),u(16,"ion-icon",12),a(),c(17,"ion-button",13),C("click",function(f){return y(d),b(l.scrollRightOneItem(f,-1))}),u(18,"ion-icon",14),a(),c(19,"div",15,0),C("scroll",function(f){return y(d),b(l.onScroll(f))}),p(21,Be,2,6,"div",16),a()()}e&2&&(_("translucent",!0),o(3),v(" ",l.article?l.article.title:""," "),o(4),_("value",l.readerStyle),o(7),_("fullscreen",!0),o(7),_("ngForOf",l.visibleItems))},dependencies:[X,K,ie,ne,ce,te,Z,se,oe,re,ge],styles:["iframe[_ngcontent-%COMP%] .article[_ngcontent-%COMP%]{height:100%}h2[_ngcontent-%COMP%] a[_ngcontent-%COMP%], h3[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--text-color)}ion-label[_ngcontent-%COMP%]{line-height:1.2;display:block}.carousel[_ngcontent-%COMP%]{width:100%;height:100%;heightX:calc(100vh - 130px);max-heightX:calc(100vh - 130px);position:relative;overflow-x:auto;white-space:nowrap;scroll-behavior:smooth;scroll-snap-type:x mandatory}.carousel-item[_ngcontent-%COMP%]{width:100%;height:100vh;position:absolute;overflow-y:scroll;scroll-snap-align:start;margin-right:16px;background-color:#eee;display:inline-block;border-radius:10px}.scroll-button[_ngcontent-%COMP%]{position:fixed;top:50%;transform:translate(-50%,-50%);z-index:1000;border-radius:50%;width:3rem;height:3rem;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px #0003}.button-next[_ngcontent-%COMP%]{right:10px}.button-prev[_ngcontent-%COMP%]{left:calc(3rem + 10px)}"]});let n=r;return n})();export{Ke as ArticlePage};
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.