import{d as X,u as ie,a$ as Ce,c as P,a as C,E as A,g as t,o,s as ye,w as f,v as O,F as S,b as u,p as _e,t as V,aP as be,H as I,G as Q,l as ke,x as xe,m as Se,ad as ve,b0 as he,i as q,Z as je,r as re,N as ue,n as Be,J as se,b1 as ne,aA as Ee,ag as me,C as Fe,aU as Oe,$ as Ne,j as De,W as Je,b2 as Pe,b3 as Ae,aS as we,aV as Ie,aW as Me,b4 as He,X as Ue,b5 as We,b6 as Te,b7 as Ke,q as Ge,b8 as Qe,b9 as ze,ba as Ze,aT as Xe,bb as Ye,bc as qe,e as et,a0 as tt,bd as st,be as nt,bf as at,bg as lt,bh as fe,_ as ot}from"./B7g2SrGs.js";const W={ej:{columnDBName:{ja:"データベース名",en:"Database name"},columnGenre:{ja:"ジャンル",en:"Genre"},columnDescription:{ja:"説明",en:"Description"},columnData:{ja:"データ",en:"Data"},columnUsage:{ja:"利用",en:"Usage"}}},ct={class:"ej-head is-hidden-mobile"},rt={class:"srej-block"},ut={class:"srej-block"},it={class:"srej-block"},_t={class:"srej-block"},pt={key:1},dt={class:"has-text-body-s has-text-sub"},ht={key:0,class:"has-text-body-s has-text-sub"},mt={class:"has-text-headline-s has-text-heading is-hidden-desktop"},ft={class:"has-text-headline-s has-text-heading is-hidden-desktop"},gt=X({__name:"SearchResultJsonEJ",props:{ss:{},cs:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=Ce(),a=(r,B)=>d.getValue(r,B)?.[0]||"",i=r=>{const B=d.getValue(r,"library"),E=d.getValue(r,"pcflag"),F=l.$state.loc,v=l.$state.ejFlag?.split("")||[];return!(!he(B)&&!B.includes(F)||!he(E)&&v.every(_=>!E.includes(_)))},h=(r,B,E)=>{const F=d.cs.searchFields?.filter(_=>_.key===E)?.pop()?.options;return d.getValue(r,B).map(_=>F.filter(j=>j.key===_).pop()?.name).filter(_=>_).map(_=>s(_))},d=e,D=P(()=>d.ss.searchState.result);return(r,B)=>{const E=_e,F=be,v=xe,_=ke,j=ve,R=ye;return t(D)?(o(),C(R,{key:0,class:"search-result-ej"},{default:f(()=>[O("div",ct,[u(E,{gap:"40"},{default:f(()=>[O("p",null,V(t(s)(t(W).ej.columnDBName)),1),O("p",null,V(t(s)(t(W).ej.columnGenre)),1),O("p",null,V(t(s)(t(W).ej.columnDescription)),1)]),_:1}),O("div",rt,[u(F)]),O("div",ut,[O("p",null,V(t(s)(t(W).ej.columnData)),1)]),O("div",it,[u(F)]),O("div",_t,[O("p",null,V(t(s)(t(W).ej.columnUsage)),1)])]),(o(!0),S(I,null,Q(t(D).list,p=>(o(),S("div",{key:a(p,"id"),class:"ej"},[u(_,{class:"ej-title",level:"3","visual-level":"headline"},{default:f(()=>[i(p)?(o(),C(v,{key:0,to:a(p,"url")},{default:f(()=>[Se(V(a(p,"title")),1)]),_:2},1032,["to"])):(o(),S("span",pt,V(a(p,"title")),1))]),_:2},1024),u(R,{class:"ej-desc has-text-body-s has-text-sub",gap:"8"},{default:f(()=>[O("span",null,V(h(p,"subject","genre").join(", "))+" - "+V(h(p,"subjectSub","genre").join(", ")),1),O("p",dt,[u(j,{md:a(p,"content")?.replaceAll(/\\n/g,` `)},null,8,["md"])]),i(p)?(o(),S("p",ht,[u(j,{md:a(p,"activeContent")?.replaceAll(/\\n/g,` `)},null,8,["md"])])):A("",!0)]),_:2},1024),u(R,{class:"ej-data srej-block has-text-body-s"},{default:f(()=>[O("span",mt,V(t(s)(t(W).ej.columnData)),1),(o(!0),S(I,null,Q(h(p,"category","category"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024),u(R,{class:"ej-note srej-block has-text-body-s"},{default:f(()=>[O("span",ft,V(t(s)(t(W).ej.columnUsage)),1),(o(!0),S(I,null,Q(e.getValue(p,"useNote"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024)]))),128))]),_:1})):A("",!0)}}}),yt=Object.assign(q(gt,[["__scopeId","data-v-11b8b6dd"]]),{__name:"SearchResultJsonEJ"}),bt={key:1},kt={key:0,class:"search-result-item-meta",gap:"8","flex-wrap":""},xt={key:0,class:"field-label has-text-headline-s has-text-heading"},St={key:1,class:"search-result-item-content"},vt=X({__name:"SearchResultJsonEntry",props:{ss:{},cs:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean},layout:{},row:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=e,{cs:a,ss:i}=je(l),h=F=>{const v=l.getValue(l.row,F);return v?v[0]:""},d=P(()=>l.ss.searchState.result),D=P(()=>l.layout==="page"?null:new RegExp(i.value.searchState.resultQuery?.keyword.join("|"))),r=re(!1);ue(d,()=>{r.value=!1});const B=P(()=>l.detailLink?`?cs=${a.value.id}&olid=${h("id")}`:h("url")?h("url"):null),E=F=>{if(!a.value.columns)return[];const v=[];return a.value.columns.forEach(_=>{const j=[];_.fields.forEach(R=>{if(_.type==="OPTIONS"){const p=a.value.searchFields?.filter(L=>L.key===_.codeKey)?.pop()?.options;p&&l.getValue(F,R)?.forEach(L=>{const K=p.filter(J=>J.key===L).pop();K&&j.push(s(K.name))})}else l.getValue(F,R)?.forEach(p=>{j.push(p)});j.length>0&&v.push({label:_.header,values:j})})}),v};return(F,v)=>{const _=_e,j=xe,R=ke,p=be,L=Ee,K=ve;return o(),S("div",{class:Be(["search-result-json-entry","layout-"+e.layout])},[u(_,{class:"search-result-item-format","vertical-align":"top",gap:"8"}),u(_,{class:"search-result-item-heading",gap:"16"},{default:f(()=>[se((o(),C(R,{level:e.layout==="page"?1:3,"visual-level":e.layout==="page"?null:"headline"},{default:f(()=>[t(B)?(o(),C(j,{key:0,to:t(B)},{default:f(()=>[Se(V(h("title")),1)]),_:1},8,["to"])):(o(),S("span",bt,V(h("title")),1))]),_:1},8,["level","visual-level"])),[[t(ne),t(D)]])]),_:1}),t(a).columns?se((o(),S("div",kt,[(o(!0),S(I,null,Q(E(e.row),(J,k)=>(o(),C(_,{key:k,gap:"16","vertical-align":"top"},{default:f(()=>[t(s)(J.label)?(o(),S("span",xt,V(t(s)(J.label)),1)):A("",!0),u(_,{gap:"8","flex-wrap":"",class:"has-text-body-s"},{default:f(()=>[(o(!0),S(I,null,Q(J.values,(M,Y)=>(o(),S("span",{key:Y},V(M),1))),128))]),_:2},1024),u(p)]),_:2},1024))),128))])),[[t(ne),t(D)]]):A("",!0),h("content")?(o(),S(I,{key:1},[e.detailAllOpen?A("",!0):(o(),C(L,{key:0,modelValue:t(r),"onUpdate:modelValue":v[0]||(v[0]=J=>Fe(r)?r.value=J:null),class:"search-result-item-content-disclosure",labels:[t(s)(t(me).result.detail.open),t(s)(t(me).result.detail.close)]},null,8,["modelValue","labels"])),t(r)||e.detailAllOpen?se((o(),S("div",St,[u(K,{md:h("content")},null,8,["md"])])),[[t(ne),t(D)]]):A("",!0)],64)):A("",!0)],2)}}}),jt=Object.assign(q(vt,[["__scopeId","data-v-7b138407"]]),{__name:"SearchResultJsonEntry"}),Lt=X({__name:"SearchResultJson",props:{ss:{},cs:{},detailAllOpen:{type:Boolean},detailLink:{type:Boolean},layout:{},getValue:{type:Function}},setup(e){const s=e,l=(d,D)=>{const r=s.getValue(d,D);return r?r[0]:""},{cs:a,ss:i}=je(s),h=P(()=>s.ss.searchState.result);return(d,D)=>{const r=jt,B=Oe;return t(h)?(o(),C(B,{key:0},{default:f(()=>[(o(!0),S(I,null,Q(t(h).list,E=>(o(),C(r,{key:l(E,"id"),row:E,ss:t(i),cs:t(a),"get-value":e.getValue,"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["row","ss","cs","get-value","detail-link","layout","detail-all-open"]))),128))]),_:1})):A("",!0)}}}),$t=Object.assign(q(Lt,[["__scopeId","data-v-6c59d708"]]),{__name:"SearchResultJson"}),ae=(e,s="AND")=>{const l={must:[],should:[],must_not:[]};if(!e||e.length===0)return l;if(e.length===1){const{keyword:a,prefix:i}=le(e[0],s);i==="-"?l.must_not.push(a):l.must.push(a)}else{let a=null;switch(e.forEach(i=>{const h=le(i,s);if(a!==null)switch(a.prefix+h.prefix){case"++":case"+-":l.should.push(a.keyword);break;case"+/":l.should.push(a.keyword);break;case"-+":case"--":case"-/":l.must_not.push(a.keyword);break;case"/+":l.should.push(a.keyword);break;case"/-":case"//":l.must.push(a.keyword)}a=le(i,s)}),a.prefix){case"+":l.should.push(a.keyword);break;case"-":l.must_not.push(a.keyword);break;case"/":l.must.push(a.keyword)}}return l},le=(e,s)=>(e=e.replace(/^([+-]?)"(.+)"$/,"1ドル2ドル"),s==="OR"&&!e.startsWith("+")&&!e.startsWith("-")&&(e="+"+e),e.startsWith("-")?{keyword:e.substring(1),prefix:"-"}:e.startsWith("+")?{keyword:e.substring(1),prefix:"+"}:{keyword:e,prefix:"/"}),Rt=e=>e.must_not.length>0&&e.must.length===0&&e.should.length===0,T=e=>!e||e.length===0,oe=e=>e.map(s=>s?.split(/\|\|/g)).filter(s=>s).flatMap(s=>s),ce=(e,s,l)=>Rt(s)?T(e)||!e.some(a=>s.must_not.includes(a)):!(T(e)||!T(s.must)&&s.must.some(a=>e.every(i=>!l(i,a)))||!T(s.should)&&s.should.every(a=>e.every(i=>!l(i,a)))||!T(s.must_not)&&s.must_not.some(a=>e.some(i=>l(i,a)))),Vt=(e,s)=>!T(e)&&!T(s)?s.every(l=>{const a=l.from!==""?Number(l.from):null,i=l.to!==""?Number(l.to):null;return e.some(h=>{const d=h&&Number(h);return d==null?!1:i==null&&a==null?!0:i==null?a<=d:(a==null||a<=d)&&d<=i})}):!1,ge=(e,s)=>e?.toLocaleLowerCase().includes(s?.toLocaleLowerCase()),Ct=(e,s)=>s?.endsWith("*")?e?.toLocaleLowerCase().startsWith(s.toLocaleLowerCase().substring(0,s.length-1)):e?.toLocaleLowerCase()===s?.toLocaleLowerCase(),Bt=X({__name:"SearchJsonPart",props:{url:{},layout:{default:"list"},detailLink:{type:Boolean,default:!1},detailAllOpen:{type:Boolean,default:!1},historyName:{}},async setup(e){let s,l;const a=Ne(),i=De(),h=e,d=([s,l]=Je(()=>Pe(h.url)),s=await s,l(),s),D=P(()=>d.template?i.page(d.template)?.md?.md:void 0),r=d.cs,B=d.columns.split(/\t/g),E=d.data.map(n=>n.split(/\t/g)),{$isEn:F}=ie(),v=n=>{if(F.value){const c=B.indexOf(n+"_en");if(c>=0)return c}return B.indexOf(n)},_=n=>n?.map(c=>v(c)).filter(c=>c>=0),j=(n,c)=>oe(c.map($=>n[$]).filter($=>$)),R=(n,c)=>{const $=v(c);return $<0||$>=n.length?null:n[$]?oe([n[$]])||[]:[]},p=re(null),L=P(()=>{if(p.value){const n=v("id");return E.filter(c=>c[n]===p.value).pop()}return null}),K=P(()=>{const n={};return B.forEach(c=>{n[c]=R(L.value,c)?.[0]?.replaceAll("\\n",` `)}),{id:R(L.value,"id")[0],title:R(L.value,"title")[0],md:{md:R(L.value,"content")[0]},props:n}}),J=n=>{const c=[];let $=!1,N="";for(let w=0;w0&&(c.push(N),N=""):N+=n[w];return N.length>0&&c.push(N),c},k=Ae(r.id,a.path,n=>{k.searchState.searching=!0,n.keyword=n.keyword.flatMap(m=>J(m)),Object.keys(n.query).forEach(m=>{n.query[m]=n.query[m].flatMap(x=>J(x))}),Object.keys(n.filter).forEach(m=>{n.filter[m]=n.filter[m].flatMap(x=>J(x))});let c=E;if(n.keyword){const m=_(r.keywordFields.map(x=>x.field));if(m.length){const x=ae(n.keyword);c=c.filter(g=>ce(j(g,m),x,ge))}}n.query&&Object.entries(n.query).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x);c=c.filter(H=>ce(j(H,y),b,ge))}}}),n.filter&&Object.entries(n.filter).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x,g.defaultOperator);c=c.filter(H=>ce(j(H,y),b,Ct))}}}),n.range&&Object.entries(n.range).forEach(([m,x])=>{const g=r.searchFields?.filter(y=>y.key===m)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));y.length&&(c=c.filter(b=>Vt(j(b,y),x)))}});const $=[];r.searchFields?.filter(m=>m.facetField)?.forEach(m=>{const x=v(m.facetField),g={};c?.forEach(y=>{y[x]&&oe([y[x]])?.forEach(b=>{g[b]?g[b]++:g[b]=1})}),$.push({field:m.key,counts:g})});const N=n.sort?.[0]||r.defaultSort||null;if(N){const[m,x]=N.split(":"),g=r.sorts?.filter(b=>b.key===m)?.pop(),y=_(g?.fields);y&&(c=c.sort((b,H)=>{const z=j(b,y)?.join("_"),Z=j(H,y)?.join("_");let U=0;return z&&Z?U=z.localeCompare(Z,"ja"):Z?U=-1:z&&(U=1),U*(x==="desc"?-1:1)}))}const w=Math.max(0,n.from||0),G=Math.min(w+(n.size||20),c.length);return{list:c.slice(w,G),hit:c.length,facets:$}}),M=P(()=>we(a)),Y=async()=>{M.value.cs?.[0]===r.id?M.value.olid?p.value=M.value.olid?.[0]:(k.restoreQuery(M.value),await k.apiCallSearch(),p.value=null):(p.value=null,k.searchState.result=null)};Y();const ee=re();ue(M,()=>{if(Y(),k.searchState.scroll){let n=ee.value?.getElementsByClassName("sticky-observer")[0];n||(n=ee.value?.getElementsByClassName("search-result")[0]),n&&n.scrollIntoView({behavior:"auto"}),k.searchState.scroll=!1}});const pe=P(()=>k.searchState.result),te=Ie(),{getSearchResultTitle:Le,getTitle:de}=Me(),$e=P(()=>p.value?de(R(L.value,"title")[0],te.page.title):k.searchState.resultQuery&&r?Le(k.searchState.resultQuery,r):de(te.page.title,te.page.subSite));if(h.historyName){const n=He();ue(()=>a.query,()=>{n.setup(a,h.historyName)},{immediate:!0})}return Ue({title:$e}),(n,c)=>{const $=We,N=Te,w=Ke,G=_e,m=Qe,x=ze,g=Ze,y=Xe,b=yt,H=$t,z=Ge,Z=Ye,U=ye,Re=tt,Ve=et;return o(),S("div",{ref_key:"root",ref:ee,class:"search-bibpart"},[u(,ドル{ss:t(k),cs:t(r),"history-name":e.historyName},null,8,["ss","cs","history-name"]),t(pe)?(o(),C(U,{key:0,class:"search-result"},{default:f(()=>[u(U,{gap:"24"},{default:f(()=>[u(G,{gap:"24"},{default:f(()=>[u(N,{ss:t(k)},null,8,["ss"]),u(w,{ss:t(k),class:"is-hidden-mobile"},null,8,["ss"])]),_:1}),u(z,{padding:"0"},{default:f(()=>[u(G,{class:"search-result-option",gap:"8"},{default:f(()=>[u(G,{gap:"8"},{default:f(()=>[u(m,{ss:t(k)},null,8,["ss"]),u(x,{ss:t(k),cs:t(r)},null,8,["ss","cs"])]),_:1})]),_:1}),t(k)?.searchState?.searching?(o(),C(g,{key:0})):t(pe).hit===0?(o(),C(y,{key:1,"target-class":"search-result-ndls-bib-nohit"})):(o(),S(I,{key:2},[e.layout==="ej"?(o(),C(b,{key:0,ss:t(k),cs:t(r),"get-value":R},null,8,["ss","cs"])):(o(),C(H,{key:1,ss:t(k),cs:t(r),"get-value":R,"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["ss","cs","detail-link","layout","detail-all-open"]))],64))]),_:1}),u(G,{align:"center"},{default:f(()=>[u(Z,{ss:t(k),"auto-scroll":""},null,8,["ss"])]),_:1})]),_:1})]),_:1})):A("",!0),t(p)?(o(),C(qe,{key:1,to:"#main-overlay"},[t(L)?(o(),C(Ve,{key:0,class:"search-json-page"},{default:f(()=>[u(Re,{page:t(K),template:t(D)},null,8,["page","template"])]),_:1})):A("",!0)])):A("",!0)],512)}}}),Et=Object.assign(q(Bt,[["__scopeId","data-v-a6393f5d"]]),{__name:"SearchJsonPart"}),Ft=X({__name:"CmsSearchJson",props:{url:{},layout:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean}},setup(e){const s=e;return(l,a)=>{const i=lt,h=Et,d=ot;return o(),C(d,null,{fallback:f(()=>[u(i,{message:l.$langLabel(t(fe).search_json.loading)},null,8,["message"])]),default:f(()=>[(o(),C(st,null,{fallback:f(()=>[u(i,{message:l.$langLabel(t(fe).search_json.loading)},null,8,["message"])]),default:f(()=>[u(h,nt(at(s)),null,16)]),_:1}))]),_:1})}}}),Nt=Object.assign(Ft,{__name:"CmsSearchJson"});export{Nt as default};

AltStyle によって変換されたページ (->オリジナル) /