PageSourceSearch

https://jinero.online/build/assets/fonts-library-B9sVhCBp.js

js jinero.online collected 2026-09-24 15:08:19 UTC 24,990 bytes, 95 lines download raw bytes

1import{n as T}from"./nouislider-B_G20eMg.js";import{f as P}from"./app-Doso7iid.js";import{i as G}from"./load-more-DO2sOFa3.js";import{loadVisibleFonts as q,loadFont as R}from"./font-preview-Bw_T-piw.js";const c={apiUrl:"/api/v1/fonts",debounceDelay:300,searchDebounceDelay:300,scrollThreshold:400,autocompleteMinChars:2,autocompleteLimit:5,perPage:48,defaultSampleText:"Sphinx of black quartz, judge my vow",defaultSize:60,minSize:10,maxSize:144,stylesMin:1,stylesMax:20},m=document.getElementById("fontLibraryApp"),J=(()=>{if(!m)return[];try{return JSON.parse(m.dataset.liked||"[]")}catch(e){return console.warn("Failed to parse font likes:",e),[]}})(),K=(()=>{if(!m)return[];try{return JSON.parse(m.dataset.bookmarked||"[]")}catch(e){return console.warn("Failed to parse font bookmarks:",e),[]}})(),k={trending:{order:"likes",sort:"desc"},az:{order:"name",sort:"asc"},za:{order:"name",sort:"desc"},downloads:{order:"downloads",sort:"desc"},newest:{order:"created_at",sort:"desc"}},o={size:c.defaultSize,sampleText:"",view:"list",liked:new Set(J),bookmarked:new Set(K),currentPage:1,totalPages:1,totalResults:0,hasMore:!1,isLoading:!1,filters:{name:"",category:[],langs:[],variable:!1,source:[],order:"likes",sort:"desc"},autocomplete:{activeIndex:-1,results:[],isOpen:!1,abortController:null},fetchController:null,autoFillPending:!1,loadMoreInstance:null};function b(e,n=c.debounceDelay){let t;return function(...s){clearTimeout(t),t=setTimeout(()=>e.apply(this,s),n)}}function U(e,n,t){return Math.max(n,Math.min(t,e))}function j(){return{to(e){return String(Math.round(Number(e)))},from(e){return Number(e)}}}function u(e){return String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function I(e){o.size=U(e,c.minSize,c.maxSize),document.querySelectorAll(".fl-preview").forEach(t=>{t.style.fontSize=o.size+"px"}),window.sizeSlider&&window.sizeSlider.noUiSlider&&window.sizeSlider.noUiSlider.set(o.size);const n=document.getElementById("sizeValue");n&&(n.value=o.size)}function X(e){o.sampleText=e;const n=e||c.defaultSampleText;document.querySelectorAll(".fl-preview").forEach(t=>{const s=t.closest(".fl-card"),r=(s==null?void 0:s.dataset.previewText)||c.defaultSampleText;e?t.textContent=n:t.textContent=r})}function S(e){o.view=e;const n=document.getElementById("fontGrid"),t=document.getElementById("showRow"),s=document.getElementById("showGrid");n&&(e==="list"?(n.classList.add("is-list"),t==null||t.classList.add("is-active"),s==null||s.classList.remove("is-active")):(n.classList.remove("is-list"),s==null||s.classList.add("is-active"),t==null||t.classList.remove("is-active")),localStorage.setItem("fl_view",e))}function W(){var e;return((e=document.querySelector('meta[name="csrf-token"]'))==null?void 0:e.getAttribute("content"))||""}function Q(e,n){const t=n==="bookmark"?m==null?void 0:m.dataset.bookmarkUrlTemplate:m==null?void 0:m.dataset.likeUrlTemplate;return t?t.replace("__slug__",e):`/fonts/${e}/${n}`}async function D(e,n){const t=await fetch(Q(e,n),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-CSRF-TOKEN":W(),"X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({})});if(!t.ok)throw new Error("Failed to update favorite font");return t.json()}function Y(){const e={name:"",category:[],langs:[],style:[],variable:!1,monospace:!1,source:[],styles_min:c.stylesMin,styles_max:c.stylesMax,order:"likes",sort:"desc"},n=document.getElementById("searchInput");n&&(e.name=n.value.trim());const t=document.getElementById("sortSelect");if(t){const a=t.value,i=k[a];i&&(e.order=i.order,e.sort=i.sort)}document.querySelectorAll('input[name="langs[]"]:checked').forEach(a=>{e.langs.push(a.value)}),document.querySelectorAll('input[name="category[]"]:checked').forEach(a=>{e.category.push(a.value)}),document.querySelectorAll('input[name="style[]"]:checked').forEach(a=>{e.style.push(a.value)});const s=document.querySelector('input[name="variable"]');s&&(e.variable=s.checked);const r=document.querySelector('input[name="monospace"]');if(r&&(e.monospace=r.checked),document.querySelectorAll('input[name="source[]"]:checked').forEach(a=>
1{e.source.push(a.value)}),window.stylesSlider&&window.stylesSlider.noUiSlider){const a=window.stylesSlider.noUiSlider.get();e.styles_min=Math.round(parseFloat(a[0])),e.styles_max=Math.round(parseFloat(a[1]))}return e}function H(e,n=1){var s;const t=new URLSearchParams;return e.name&&t.set("name",e.name),e.category.length&&e.category.forEach(r=>t.append("category[]",r)),e.langs.length&&e.langs.forEach(r=>t.append("langs[]",r)),(s=e.style)!=null&&s.length&&e.style.forEach(r=>t.append("style[]",r)),e.variable&&t.set("variable","1"),e.monospace&&t.set("monospace","1"),e.source.length&&e.source.forEach(r=>t.append("source[]",r)),e.styles_min>c.stylesMin&&t.set("styles_min",e.styles_min),e.styles_max<c.stylesMax&&t.set("styles_max",e.styles_max),t.set("order",e.order),t.set("sort",e.sort),t.set("per_page",c.perPage),t.set("page",n),t}function Z(e,n=1){const t=H(e,n);t.delete("per_page"),n===1&&t.delete("page");const s=`${window.location.pathname}${t.toString()?"?"+t.toString():""}`;window.history.pushState({filters:e,page:n},"",s)}async function _(e,n=1){o.fetchController&&o.fetchController.abort(),o.fetchController=new AbortController;const t=H(e,n);try{o.isLoading=!0,te();const s=await fetch(`${c.apiUrl}?${t}`,{signal:o.fetchController.signal});if(!s.ok)throw new Error("Failed to fetch fonts");const r=await s.json();return o.currentPage=r.current_page||1,o.totalPages=r.last_page||1,o.totalResults=r.total||0,o.filters=e,r.data||[]}catch(s){return s.name!=="AbortError"&&console.error("Fetch fonts error:",s),null}finally{o.isLoading=!1}}function ee(e){const n=e.license_chip;if(!n||!n.label)return"";const t=n.restricted?" chip--warn":"",s=e.license?` title="${u(e.license)}"`:"";return`<span class="chip chip--sm${t}"${s}>${u(n.label)}</span>`}function C(e){const n=(m==null?void 0:m.dataset.authenticated)!=="1"?'data-tooltip="Authorization required"':"",t=o.liked.has(e.slug),s=o.bookmarked.has(e.slug),r=o.sampleText||e.preview_text||e.name,a=e.monospace?"monospace":e.category==="serif"?"serif":"sans-serif",i=e.source==="google-fonts"?'<img class="fl-source-icon" src="/images/svg/google-icon.svg" alt="Google Fonts" title="Google Fonts" width="16" height="16">':"",p=(e.langs||[]).map(d=>`<span class="chip chip--sm">${u(d.charAt(0).toUpperCase()+d.slice(1))}</span>`).join(""),l=(e.style_tags||[]).map(d=>`<a href="/fonts/style/${u(d.slug)}" class="chip chip--sm">${u(d.label)}</a>`).join("");return`
2        <article class="fl-card"
3                 data-id="${e.id}"
4                 data-font-url="${e.regular_url||""}"
5                 data-preview-text="${u(e.preview_text||e.name)}"
6                 data-href="/fonts/${u(e.slug)}"
7                 role="link"
8                 tabindex="0">
9            <div class="fl-card__head">
10                <div>
11                    <div class="fl-title-row">
12                        <a class="fl-title truncate" href="/fonts/${u(e.slug)}">${u(e.name)}</a>
13                        ${i}
14                    </div>
15                    <div class="fl-meta">
16                        ${e.variable?"Variable":"Static"}
17                        ${e.fonts_count?`· ${e.fonts_count} styles`:""}
18                    </div>
19                </div>
20                <div class="entity-actions">
21                    <a class="entity-action-btn entity-action-btn--download fl-download-btn"
22                       href="/fonts/${u(e.slug)}/download"
23                       rel="nofollow"
24                       aria-label="Download font"
25                       title="Download">
26                        <i class="icon-download icon-fi icon-xs entity-action-btn__icon-outline" aria-hidden="true"></i>
27                    </a>
28                    <button class="entity-action-btn entity-action-btn--bookmark fl-bookmark-btn js-bookmark-font ${s?"is-active":""}"
29                            data-slug="${u(e.slug)}"
30                            aria-label="Save font"
31                            ${n}>
32                        <svg class="svg-icon entity-action-btn__icon-outline">
33                            <use xlink:href="/images/svg/sprite.svg#add"></use>
34                        </svg>
35                        <svg class="svg-icon entity-action-btn__icon-fill">
36                            <use xlink:href="/images/svg/sprite.svg#add-fill"></use>
37                        </svg>
38                    </button>
39                    <button class="entity-action-btn entity-action-btn--like fl-like-btn js-like-font ${t?"is-active":""}"
40                            data-slug="${u(e.slug)}"
41                            aria-label="Like font"
42                            ${n}>
43                        <svg class="svg-icon entity-action-btn__icon-outline">
44                            <use xlink:href="/images/svg/sprite.svg#like"></use>
45                        </svg>
46                        <svg class="svg-icon entity-action-btn__icon-fill">
47                            <use xlink:href="/images/svg/sprite.svg#like-fill"></use>
48                        </svg>
49                        <span class="entity-action-btn__count js-font-likes-count">${P(e.likes_count||0)}</span>
50                    </button>
51                </div>
52            </div>
53
54            <div class="fl-preview" style="font-family: '${u(e.name)}', ${a}; font-size: ${o.size}px;">
55                ${u(r)}
56            </div>
57
58            <div class="fl-card__actions">
59                <div class="fl-chips">
60                    ${ee(e)}
61                    ${e.category?`<span class="chip chip--sm">${u(e.category.charAt(0).toUpperCase()+e.category.slice(1))}</span>`:""}
62                    ${e.variable?'<span class="chip chip--sm">Variable</span>':""}
63                    ${l}
64                    ${p}
65                </div>
66            </div>
67        </article>
68    `}function E(){const e=document.getElementById("fontLoader");e&&(e.style.display=o.isLoading&&o.currentPage>=1?"flex":"none")}function x(e,{append:n=!1}={}){var a;const t=document.getElementById("fontGrid"),s=document.getElementById("emptyState"),r=document.getElementById("resultsCount");if(t){if(r&&(r.textContent=o.totalResults),!e||e.length===0){n||(t.innerHTML=""),s?s.style.display="block":n||(t.innerHTML=`
69                    <div class="c-empty py-5 w-100">
70                        <p class="c-empty__text body-sm">No fonts match your filters.</p>
71                        <button type="button" id="resetFiltersEmpty" class="button button--white button--sm">
72                            <div class="button__wrapper">Reset Filters</div>
73                        </button>
74                    </div>
75                `,(a=document.getElementById("resetFiltersEmpty"))==null||a.addEventListener("click",V)),E();return}s&&(s.style.display="none"),n?t.insertAdjacentHTML("beforeend",e.map(C).join("")):t.innerHTML=e.map(C).join(""),q(),E()}}function te(){const e=document.getElementById("fontGrid");e&&e.classList.add("is-loading"),E()}function L(){const e=document.getElementById("fontGrid");e&&e.classList.remove("is-loading"),E()}async function y(e=1){const n=Y(),t=await _(n,e);t!==null&&(o.hasMore=o.currentPage<o.totalPages,x(t),Z(n,e),L(),o.loadMoreInstance&&(o.loadMoreInstance.setPage(1),o.loadMoreInstance.setTotalPages(o.totalPages),o.loadMoreInstance.setHasMore(o.hasMore))),M()}const ne=b(()=>y(1),c.debounceDelay);async function oe(e){if(o.isLoading||!o.hasMore)return{hasMore:!1};const n=await _(o.filters,e);return n!==null?(o.hasMore=o.currentPage<o.totalPages,x(n,{append:!0}),L(),{hasMore:o.hasMore}):{hasMore:!1}}async function se(e){const n=await _(o.filters,e);return n===null?{hasMore:o.hasMore}:(x(n,{append:!1}),L(),o.hasMore=o.currentPage<o.totalPages,{hasMore:o.hasMore,totalPages:o.totalPages})}const ae={"langs[]":"Language","category[]":"Category","style[]":"Style","source[]":"Source",variable:"Variable",monospace:"Monospace"};function M(){const e=document.getElementById("activeFilters"),n=document.getElementById("activeFiltersList");if(!e||!n)return;n.innerHTML="";const t=[],s=document.getElementById("searchInput");s&&s.value.trim()&&t.push({label:`"${s.value.trim()}"`,remove:()=>{s.value=""}});const r=document.getElementById("sampleText");r&&r.value.trim()&&t.push({label:`Text: "${r.value.trim()}"`,remove:()=>{r.value="",o.sampleText=""}});const a=document.getElementById("filterForm");if(a&&a.querySelectorAll('input[type="checkbox"]:checked').forEach(i=>{const p=ae[i.name]||i.name,l=i.closest("label"),d=l?l.textContent.trim():i.value,f=i.value==="1"?d:`${p}: ${d}`;t.push({label:f,remove:()=>{i.checked=!1}})}),t.length===0){e.style.display="none";return}if(t.forEach(i=>{const p=document.createElement("span");p.className="il-filter-tag",p.innerHTML=`${u(i.label)}<button type="button" class="il-filter-tag__remove" title="Remove">&times;</button>`,p.querySelector(".il-filter-tag__remove").addEventListener("click",()=>{i.remove(),M(),y(1)}),n.appendChild(p)}),t.length>1){const i=document.createElement("span");i.className="il-filter-tag il-filter-tag--clear",i.textContent="Clear all",i.addEventListener("click",()=>{V()}),n.appendChild(i)}e.style.display=""}function V(){document.querySelectorAll('#filterForm input[type="checkbox"]').forEach(s=>{s.checked=!1}
75);const e=document.getElementById("searchInput");e&&(e.value="");const n=document.getElementById("sortSelect");n&&(n.tomselect?n.tomselect.setValue("trending",!0):n.value="trending"),window.sizeSlider&&window.sizeSlider.noUiSlider&&window.sizeSlider.noUiSlider.set(c.defaultSize),I(c.defaultSize),window.stylesSlider&&window.stylesSlider.noUiSlider&&window.stylesSlider.noUiSlider.set([c.stylesMin,c.stylesMax]);const t=document.getElementById("sampleText");t&&(t.value=""),o.sampleText="",y(1)}function le(){const e=document.getElementById("sizeRange");e&&(T.create(e,{start:[c.defaultSize],step:1,tooltips:[!0],format:j(),range:{min:c.minSize,max:c.maxSize}}),window.sizeSlider=e,e.noUiSlider.on("update",function(n){const t=Math.round(parseFloat(n[0])),s=document.getElementById("sizeValue");s&&(s.value=t)}),e.noUiSlider.on("change",function(n){const t=Math.round(parseFloat(n[0]));o.size=U(t,c.minSize,c.maxSize),document.querySelectorAll(".fl-preview").forEach(s=>{s.style.fontSize=o.size+"px"})}))}function ie(){const e=document.getElementById("stylesRange");if(!e)return;T.create(e,{start:[c.stylesMin,c.stylesMax],connect:!0,step:1,tooltips:[!0,!0],format:j(),range:{min:1,max:20}}),window.stylesSlider=e;const n=document.getElementById("stylesRangeValue");e.noUiSlider.on("update",function(t){const[s,r]=t.map(a=>Math.round(parseFloat(a)));n&&(n.textContent=`${s}–${r}`)}),e.noUiSlider.on("change",b(function(){y(1)}))}async function re(e){o.autocomplete.abortController&&o.autocomplete.abortController.abort(),o.autocomplete.abortController=new AbortController;try{const n=new URLSearchParams({name:e,per_page:c.autocompleteLimit}),t=await fetch(`${c.apiUrl}?${n}`,{signal:o.autocomplete.abortController.signal});if(!t.ok)throw new Error("Failed to fetch");return(await t.json()).data||[]}catch(n){return n.name!=="AbortError"&&console.warn("Autocomplete fetch error:",n),[]}}function ce(e){const n=document.getElementById("searchAutocomplete");if(n){if(o.autocomplete.results=e,o.autocomplete.activeIndex=-1,e.length===0){n.innerHTML='<div class="search-autocomplete__empty">No fonts found</div>';return}n.innerHTML=e.map((t,s)=>`
76        <div class="search-autocomplete__item" data-index="${s}" data-name="${u(t.name)}">
77            <div>
78                <div class="search-autocomplete__name">${u(t.name)}</div>
79                <div class="search-autocomplete__meta">${t.fonts_count} styles · ${t.category||"Sans"}</div>
80            </div>
81            <div class="search-autocomplete__preview" style="font-family: '${u(t.name)}', sans-serif;">
82                Aa
83            </div>
84        </div>
85    `).join(""),e.forEach(t=>{t.regular_url&&R(t.name,t.regular_url)})}}function $(){const e=document.getElementById("searchAutocomplete");e&&(e.classList.add("is-open"),o.autocomplete.isOpen=!0)}function v(){const e=document.getElementById("searchAutocomplete");e&&(e.classList.remove("is-open"),o.autocomplete.isOpen=!1,o.autocomplete.activeIndex=-1)}function z(e){const n=document.getElementById("searchInput");n&&(n.value=e),v(),y(1)}function F(e){const n=o.autocomplete.results;if(n.length===0)return;let t=o.autocomplete.activeIndex+e;t<0?t=n.length-1:t>=n.length&&(t=0),o.autocomplete.activeIndex=t;const s=document.getElementById("searchAutocomplete");s&&s.querySelectorAll(".search-autocomplete__item").forEach((r,a)=>{r.classList.toggle("is-active",a===t)})}function de(){const e=document.getElementById("searchAutocomplete");e&&(e.innerHTML='<div class="search-autocomplete__loading">Searching...</div>',$())}const ue=b(async function(e){if(e.length<c.autocompleteMinChars){v();return}de();const n=await re(e);ce(n),$()},c.searchDebounceDelay);function me(){const e=document.getElementById("searchInput");e&&(e.addEventListener("input",function(){const l=this.value.trim();ue(l)}),e.addEventListener("keydown",function(l){if(!o.autocomplete.isOpen){l.key==="Enter"&&(l.preventDefault(),y(1));return}switch(l.key){case"ArrowDown":l.preventDefault(),F(1);break;case"ArrowUp":l.preventDefault(),F(-1);break;case"Enter":if(l.preventDefault(),o.autocomplete.activeIndex>=0){const d=o.autocomplete.results[o.autocomplete.activeIndex];d&&z(d.name)}else v(),y(1);break;case"Escape":l.preventDefault(),v();break}}),e.addEventListener("focus",function(){this.value.trim().length>=c.autocompleteMinChars&&o.autocomplete.results.length>0&&$()}),e.addEventListener("blur",function(){setTimeout(()=>{v()},250)}));const n=document.getElementById("searchAutocomplete");n&&n.addEventListener("mousedown",function(l){l.preventDefault();const d=l.target.closest(".search-autocomplete__item");if(d){const f=d.dataset.name;f&&z(f)}});const t=document.getElementById("sizeValue");t&&t.addEventListener("input",b(function(){const l=parseInt(this.value,10);isNaN(l)||I(l)}));const s=document.getElementById("sampleText");s&&s.addEventListener("input",b(function(){X(this.value)},150));const r=document.getElementById("sortSelect");r&&r.addEventListener("change",function(){y(1)});const a=document.getElementById("filterForm");a&&(a.querySelectorAll('input[type="checkbox"]').forEach(l=>{l.addEventListener("change",function(){ne()})}),a.addEventListener("submit",function(l){l.preventDefault(),y(1)}));const i=document.getElementById("showRow"),p=document.getElementById("showGrid");i&&i.addEventListener("click",function(l){l.preventDefault(),S("list")}),p&&p.addEventListener("click",function(l){l.preventDefault(),S("grid")}),document.addEventListener("click",function(l){const d=l.target.closest(".fl-card");if(!d||l.target.closest(".entity-actions, a, button, input, select, textarea, label"))return;const f=d.dataset.href;f&&(window.location.href=f)}),document.addEventListener("keydown",function(l){const d=l.target.closest(".fl-card");if(!d||l.key!=="Enter"&&l.key!==" "||l.target.closest(".entity-actions, a, button, input, select, textarea, label"))return;l.preventDefault();const f=d.dataset.href;f&&(window.location.href=f)}),document.addEventListener("click",function(l){const d=l.target.closest(".
85js-like-font, .js-bookmark-font");if(!d)return;l.preventDefault(),l.stopPropagation();const f=d.dataset.slug;if(!f)return;if((m==null?void 0:m.dataset.authenticated)!=="1"){const g=m==null?void 0:m.dataset.loginUrl;g&&(window.location.href=g);return}if(d.dataset.loading==="1")return;d.dataset.loading="1";const A=d.classList.contains("js-bookmark-font")?"bookmark":"like";D(f,A).then(g=>{if(A==="bookmark"){g.bookmarked?o.bookmarked.add(f):o.bookmarked.delete(f),document.querySelectorAll(`.js-bookmark-font[data-slug="${f}"]`).forEach(w=>{w.classList.toggle("is-active",g.bookmarked)}),B(g.count);const h=document.getElementById("fontCollectionPanel");h&&h.classList.contains("show")&&O()}else g.liked?o.liked.add(f):o.liked.delete(f),document.querySelectorAll(`.js-like-font[data-slug="${f}"]`).forEach(h=>{h.classList.toggle("is-active",g.liked);const w=h.querySelector(".js-font-likes-count");w&&(w.textContent=P(g.likes_count))})}).catch(g=>{console.error("Font action sync error:",g)}).finally(()=>{document.querySelectorAll(`[data-slug="${f}"]`).forEach(g=>{delete g.dataset.loading})})}),window.addEventListener("popstate",function(l){l.state&&l.state.filters&&(N(l.state.filters),y(l.state.page||1))})}function N(e){const n=document.getElementById("searchInput");n&&(n.value=e.name||"");const t=document.getElementById("sortSelect");if(t){const a=Object.keys(k).find(i=>k[i].order===e.order&&k[i].sort===e.sort)||"trending";t.tomselect?t.tomselect.setValue(a,!0):t.value=a}document.querySelectorAll('input[name="langs[]"]').forEach(a=>{var i;a.checked=((i=e.langs)==null?void 0:i.includes(a.value))||!1}),document.querySelectorAll('input[name="category[]"]').forEach(a=>{var i;a.checked=((i=e.category)==null?void 0:i.includes(a.value))||!1}),document.querySelectorAll('input[name="style[]"]').forEach(a=>{var i;a.checked=((i=e.style)==null?void 0:i.includes(a.value))||!1}),document.querySelectorAll('input[name="source[]"]').forEach(a=>{var i;a.checked=((i=e.source)==null?void 0:i.includes(a.value))||!1});const s=document.querySelector('input[name="variable"]');s&&(s.checked=e.variable||!1);const r=document.querySelector('input[name="monospace"]');if(r&&(r.checked=e.monospace||!1),window.stylesSlider&&window.stylesSlider.noUiSlider){const a=e.styles_min||c.stylesMin,i=e.styles_max||c.stylesMax;window.stylesSlider.noUiSlider.set([a,i])}}function fe(){const e=new URLSearchParams(window.location.search),n={name:e.get("name")||"",category:e.getAll("category[]"),langs:e.getAll("langs[]"),style:e.getAll("style[]"),variable:e.get("variable")==="1",monospace:e.get("monospace")==="1",source:e.getAll("source[]"),styles_min:parseInt(e.get("styles_min"),10)||c.stylesMin,styles_max:parseInt(e.get("styles_max"),10)||c.stylesMax,order:e.get("order")||"likes",sort:e.get("sort")||"desc"};return N(n),{filters:n,page:parseInt(e.get("page"),10)||1}}function B(e){const n=document.getElementById("fontCollectionBadge");n&&(n.textContent=e);const t=document.getElementById("fontCollectionBtn");t&&t.classList.toggle("has-items",e>0)}function pe(e){return`
86        <div class="fl-collection-item" data-slug="${u(e.slug)}">
87            <a href="/fonts/${u(e.slug)}" class="fl-collection-item__info">
88                <span class="fl-collection-item__name">${u(e.name)}</span>
89                <span class="fl-collection-item__meta">${u(e.category||"")}</span>
90            </a>
91            <button class="fl-collection-item__remove js-collection-remove"
92                    data-slug="${u(e.slug)}" title="Remove">
93                <i class="icon-trash-2 icon-fi icon-xs"></i>
94            </button>
95        </div>`}async function O(){const e=document.getElementById("fontCollectionList"),n=document.getElementById("fontCollectionEmpty");if(e)try{const t=await fetch("/fonts/bookmarks",{headers:{Accept:"application/json"}});if(!t.ok)return;const s=await t.json();s.fonts.length===0?(e.style.display="none",n&&(n.style.display="")):(e.innerHTML=s.fonts.map(pe).join(""),e.style.display="",n&&(n.style.display="none")),B(s.count)}catch{}}function ge(){const e=document.getElementById("fontCollectionPanel");e&&(e.addEventListener("show.bs.offcanvas",O),e.addEventListener("click",async n=>
95{const t=n.target.closest(".js-collection-remove");if(!t)return;const s=t.dataset.slug;if(s)try{await D(s,"bookmark"),o.bookmarked.delete(s),document.querySelectorAll(`.js-bookmark-font[data-slug="${s}"]`).forEach(l=>{l.classList.remove("is-active")});const r=t.closest(".fl-collection-item");r&&r.remove();const a=document.getElementById("fontCollectionList"),i=document.getElementById("fontCollectionEmpty"),p=a?a.children.length:0;B(p),p===0&&(a&&(a.style.display="none"),i&&(i.style.display=""))}catch{}}),e.addEventListener("click",n=>{var s;if(n.target.closest(".js-collection-remove"))return;n.target.closest(".fl-collection-item__info")&&((s=bootstrap.Offcanvas.getInstance(e))==null||s.hide())}))}function we(){var t;if(!document.body.classList.contains("fonts-library-page"))return;const e=localStorage.getItem("fl_view")||"list";S(e),le(),ie(),me(),I(c.defaultSize),q(),o.totalPages=parseInt((m==null?void 0:m.dataset.totalPages)||"1",10)||1,o.totalResults=parseInt(((t=document.getElementById("resultsCount"))==null?void 0:t.textContent)||"0",10)||0,fe(),o.loadMoreInstance=G({container:document.getElementById("fontLoadMore"),onLoadMore:oe,onGoToPage:se,totalPages:o.totalPages,scrollTarget:document.getElementById("fontGrid")});const n=o.loadMoreInstance?o.loadMoreInstance.getPage():1;o.currentPage=n,o.hasMore=n<o.totalPages,o.loadMoreInstance&&o.loadMoreInstance.setHasMore(o.hasMore),ge(),M()}export{we as initFontsLibrary};

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.