1import{O as V}from"./Overlay--zPS9tw1.js";import{n as j,g as E,Z as w,q as D,p as H,aB as A,aC as P,s as x,a0 as F,v as N,B as S,o as U,i as L,ai as M,am as q,x as I,cb as $,ao as G,an as z,cd as C,cl as O,_ as K,b as o,j as v,w as y,aE as Z,cm as J,cc as Q,ak as W,by as X,N as _,c as l,t as m,L as R,ae as T,D as b,T as Y,e as g,F as B,G as k,K as ee}from"./app-BV_MRGiY.js";import{L as te}from"./LoadingDummyH1-WBYPd09P.js";import{L as se}from"./LoadingDummyCustom-TdSBOfeM.js";import{V as ae,a as ne,b as oe,c as ie}from"./VExpansionPanels-BE2O81p8.js";import"./VContainer-D4zTugS6.js";import"./VRow-DyK-XPgq.js";import"./VCol-B_mXRjjw.js";import"./_commonjsHelpers-DaWZu8wl.js";import"./LoadingDummy-DMOrQAEG.js";const re="/api/cross_reference",ce=j("crossRef",{state:()=>({crossRefs:{},reload:!1}),actions:{async getCrossRefs({abbr:e,textref:t}){try{let s=E(),a=w(s),c=!0,i=await D({url:encodeURI(`${re}/${a.getAbbrByAbbreviation(e)}/${t}`),options:{headers:H({useCache:c})},useCache:c,tags:[`bible.${e}`]});if(A(i))throw new Error("Fehler in Api-Response");this.crossRefs=i.data}catch(s){P(s,!0)}}}});function le(){let e=ce(E());const{crossRefs:t,reload:s}=x(e);let a=F();const{messagesLoaded:c,updateData:i,asyncStatus:d}=N({actions:[{item:t,action:e.getCrossRefs,payload:function(){return{abbr:a.params.abbreviation,textref:a.params.textref}}}],loadAsyncMessages:["crossref","common"]});let r=async(u,n)=>{u!==n&&await i()};S(()=>a.params.textref,r),S(()=>a.params.abbreviation,r),S(s,async(u,n)=>{u&&u!==n&&(await i(),t.reload=!1)}),U(()=>{t.value={}});const f=L(()=>d.value===M);return{messagesLoaded:c,crossRefs:t,asyncStatusLoaded:f}}const de=({asyncStatusLoaded:e,crossRefs:t})=>{const{messagesLoaded:s}=q(["crossref"]),{t:a}=I(),{getRefByCanonicals:c}=$(),{excludeFootnotes:i}=O(),{bibles:d}=x(w(E())),{params:r}=F(),f=L(()=>s.value&&e.value?`${a("async.crossref.title")} â ${c({canonicals:[t.value.ref.canonical],type:C})} â ${n.value.name}`:""),u=L(()=>s.value&&e.value?`${a("async.crossref.introduction",{verse:c({canonicals:[t.value.ref.canonical],type:C}),bible:n.value.name})}${t.value.ref.content?` â ${i(t.value.ref.content).replace(/^(.{60}[^\s]*).*/,"$1")} ...`:""}`:""),n=L(()=>d.value[r.abbreviation]||{});return G(z({title:f,description:u})),{bible:n}},ue={name:"CrossReferenceOverlay",components:{LoadingDummyCustom:se,LoadingDummyH1:te,Overlay:V},setup(){const e=E(),t=w(e),{selectedBibles:s}=x(t),a=W(e),{booknamesLoaded:c}=x(a),{messagesLoaded:i,crossRefs:d,asyncStatusLoaded:r}=le();return{selectedBibles:s,booknamesLoaded:c,...O(),...$(),...X(),...I(),messagesLoaded:i,crossRefs:d,asyncStatusLoaded:r,...de({asyncStatusLoaded:r,crossRefs:d})}},data:()=>({activeTab:null}),computed:{crossRefsRefContent(){return this.excludeFootnotes((this.crossRefs.ref||{}).content||"")},crossRefsFormatted(){return Object.entries(this.crossRefs.crossRefs).map(e=>{let t=e[0],s=e[1];return{canonicalRef:t,templateId:"verse-"+this.slugify(s.link),shortRef:this.getRefByCanonicals({canonicals:[t],type:Q}),defaultRef:this.getRefByCanonicals({canonicals:Object.keys(s.verses),type:C}),content:this.excludeFootnotes(s.verses[t].content),verses:Object.entries(s.verses).map(a=>{let c=a[1],{verse:i,heading:d,subheading:r,verse_end:f,content:u,canonical:n,id:h}=c;return{id:h,canonical:n,heading:d,subheading:r,verseContent:this.excludeFootnotes(u),verseNumber:i+(f?`-${f}`:"")}}),moreLink:`/${J(this.selectedBibles.join("."))}/${s.link.split("/")[2]}`}})},descriptionLinked:function(){if(this.messagesLoaded&&this.asyncStatusLoaded){let e=`<a href="/${encodeURIComponent(this.selectedBibles.join("."))}/${encodeURIComponent(this.$route.params.textref)}" id="link_crossref" title="{{verse}}">{{verse}}</a>`;return this.t("async.crossref.introduction").split("{verse}").join(e).split("{{verse}}").join(this.getRefByCanonicals({canonicals:[this.crossRefs.ref.canonical],type:C})).split("{bible}").join(this.bible.name)}return""}},watch:{asyncStatusLoaded:{handler(e,t){if(e!==t&&e&&this.$route.hash){let s=0;this.activeElem=null;const a=setInterval(()=>{s+=1,(this.activeElem||s===20)&&(clearInterval(a),this.activeElem&&(this.activeTab=parseInt(this.activeElem.dataset?.id))),this.activeElem=document.getElementById(this.$route.hash.replace("#",""))},100)}},immediate:!0},activeTab:function(e,t){e!==t&&setTimeout(()=>{let s=document.querySelector(".v-expansion-panel--active");s&&window.scrollTo(0,parseInt(s.offsetTop)-(parseInt(document.querySelector(".bs-header-wrapper").clientHeight)+(this.$vuetify.display.xsOnly?80:56)))},500)}},methods:{close(){this.activeTab=null},slugify:function(e){return Z(e.split("/")[2])}}},me={key:0,class:"hidden-print-only mb-4"},fe=["innerHTML"],pe={key:4,class:"cross-ref-view__content"},he={class:"context-content"},ye={key:0},ve={key:1},be={class:"verse-number"};function ge(e,t,s,a,c,i){const d=_("loading-dummy-h1"),r=_("loading-dummy-custom"),f=_("router-link"),u=_("overlay");return o(),v(u,{"class-name":"cross-ref-view"},{default:y(()=>[a.messagesLoaded?(o(),l("h1",me,m(e.t("async.crossref.title")),1)):(o(),v(d,{key:1})),a.messagesLoaded&&a.asyncStatusLoaded&&a.booknamesLoaded?(o(),l("p",{key:2,class:"cross-ref-view__description",onClick:t[0]||(t[0]=(...n)=>e.handleRoutableLink&&e.handleRoutableLink(...n)),innerHTML:i.descriptionLinked},null,8,fe)):(o(),v(r,{key:3,height:"32px",width:"400px",margin:"8px 0px 20px 0px"})),a.asyncStatusLoaded?(o(),l("p",pe,' "'+m(i.crossRefsRefContent)+'" ',1)):(o(),v(r,{key:5,height:"56px",margin:"4px 0px 24px 0px"})),a.asyncStatusLoaded?(o(),v(ae,{key:6,modelValue:e.activeTab,"onUpdate:modelValue":t[2]||(t[2]=n=>e.activeTab=n)},{default:y(()=>[(o(!0),l(R,null,T(i.crossRefsFormatted,(n,h)=>(o(),v(ne,{id:n.templateId,key:h,"data-id":h,elevation:"0"},{default:y(()=>[b(oe,null,{default:y(()=>[b(Y,{name:"fade",mode:"out-in"},{default:y(()=>[e.activeTab===h?(o(),l("span",{key:h+"b"},[g("strong",null,m(n.defaultRef),1)])):(o(),l("span",{key:h+"c"},[g("strong",null,m(n.shortRef),1),B("Â "+m(n.content),1)]))]),_:2},1024)]),_:2},1024),b(ie,null,{default:y(()=>[g("div",he,[(o(!0),l(R,null,T(n.verses,p=>
1(o(),l(R,{key:p.id+"heading"},[typeof p.heading<"u"?(o(),l("h3",ye,m(p.heading),1)):k("",!0),typeof p.subheading<"u"?(o(),l("h4",ve,m(p.subheading),1)):k("",!0),g("span",{class:ee([{active:p.canonical===n.canonicalRef}]),onClick:t[1]||(t[1]=_e=>i.close())},[g("span",be,m(p.verseNumber),1),B("Â "+m(p.verseContent)+"Â ",1)],2)],64))),128)),b(f,{to:{path:n.moreLink}},{default:y(()=>[B(m(e.t("async.common.button.more")),1)]),_:1},8,["to"])])]),_:2},1024)]),_:2},1032,["id","data-id"]))),128))]),_:1},8,["modelValue"])):k("",!0),a.asyncStatusLoaded?k("",!0):(o(),l(R,{key:7},T(6,n=>b(r,{key:"dummy_"+n,height:"60px",margin:"12px 0px"})),64))]),_:1})}const Fe=K(ue,[["render",ge]]);export{Fe as default}; 2//# sourceMappingURL=CrossReferenceOverlay-CkX37Zle.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.