import{s as oe,n as he,o as fe}from"../chunks/scheduler.ea9963d4.js";import{S as ge,i as $e,e as f,s as n,c as p,h as de,a as g,d as a,b as l,f as ce,g as i,j as W,k as re,l as ue,m as s,n as m,t as c,o as r,p as o}from"../chunks/index.2ecb6441.js";import{C as Me,H as _,E as Je}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.b27212aa.js";import{C as E}from"../chunks/CodeBlock.5675cb3b.js";function Te(se){let h,R,v,Q,$,Y,d,H,u,ne="A Typescript powered wrapper for the Space <code>mini_header</code> feature.",z,M,le='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/space-header-package/thumbnail.png" alt="space header preview"/>',N,J,x,T,q,w,F,y,L,U,V,j,X,I,pe="❗Important note: The <code>init</code> method must be called on the client side.",A,C,P,G,ie="Uses the <code>target</code> option to inject the space-header into another DOM element",D,b,O,B,me="If you already have the space data, you can also pass it as a parameter to avoid a fetch",K,Z,ee,k,te,S,ae;return $=new Me({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),d=new _({props:{title:"🤗 Hugging Face Space Header",local:"-hugging-face-space-header",headingTag:"h1"}}),J=new _({props:{title:"Install",local:"install",headingTag:"h2"}}),T=new E({props:{code:"cG5wbSUyMGFkZCUyMCU0MGh1Z2dpbmdmYWNlJTJGc3BhY2UtaGVhZGVyJTBBJTBBbnBtJTIwYWRkJTIwJTQwaHVnZ2luZ2ZhY2UlMkZzcGFjZS1oZWFkZXIlMEElMEF5YXJuJTIwYWRkJTIwJTQwaHVnZ2luZ2ZhY2UlMkZzcGFjZS1oZWFkZXI=",highlighted:`pnpm add @huggingface/space-header

npm add @huggingface/space-header

yarn add @huggingface/space-header`,wrap:!1}}),w=new _({props:{title:"Deno",local:"deno",headingTag:"h3"}}),y=new E({props:{code:"JTJGJTJGJTIwZXNtLnNoJTBBaW1wb3J0JTIwJTdCJTIwaW5pdCUyMCU3RCUyMGZyb20lMjAlMjJodHRwcyUzQSUyRiUyRmVzbS5zaCUyRiU0MGh1Z2dpbmdmYWNlJTJGc3BhY2UtaGVhZGVyJTIyJTBBJTJGJTJGJTIwb3IlMjBucG0lM0ElMEFpbXBvcnQlMjAlN0IlMjBpbml0JTIwJTdEJTIwZnJvbSUyMCUyMm5wbSUzQSU0MGh1Z2dpbmdmYWNlJTJGc3BhY2UtaGVhZGVyJTIy",highlighted:`<span class="hljs-comment">// esm.sh</span>
<span class="hljs-keyword">import</span> { init } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://esm.sh/@huggingface/space-header&quot;</span>
<span class="hljs-comment">// or npm:</span>
<span class="hljs-keyword">import</span> { init } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;npm:@huggingface/space-header&quot;</span>`,wrap:!1}}),U=new _({props:{title:"Initialize",local:"initialize",headingTag:"h3"}}),j=new E({props:{code:"aW1wb3J0JTIwJTdCJTIwaW5pdCUyMCU3RCUyMGZyb20lMjAlMjIlNDBodWdnaW5nZmFjZSUyRnNwYWNlLWhlYWRlciUyMiUzQiUwQSUwQSUyRiUyRiUyMC4uLiUwQSUwQWluaXQoJTIyJTNBdXNlciUyRiUzQXNwYWNlSWQlMjIpJTNCJTBBJTJGJTJGJTIwaW5pdCglMjJlbnpvc3R2cyUyRmxvcmEtc3R1ZGlvJTIyKSUyMGZvciUyMGV4YW1wbGU=",highlighted:`<span class="hljs-keyword">import</span> { init } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@huggingface/space-header&quot;</span>;

<span class="hljs-comment">// ...</span>

<span class="hljs-title function_">init</span>(<span class="hljs-string">&quot;:user/:spaceId&quot;</span>);
<span class="hljs-comment">// init(&quot;enzostvs/lora-studio&quot;) for example</span>`,wrap:!1}}),C=new _({props:{title:"Usage",local:"usage",headingTag:"h2"}}),b=new E({props:{code:"Y29uc3QlMjBhcHAlMjAlM0QlMjBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCglMjJhcHAlMjIpJTNCJTBBJTBBJTJGJTJGJTIwLi4uJTBBJTBBaW5pdCglMjIlM0F1c2VyJTJGJTNBc3BhY2VJZCUyMiUyQyUyMCU3QiUwQSUyMCUyMHRhcmdldCUzQSUyMGFwcCUwQSU3RCklM0I=",highlighted:`<span class="hljs-keyword">const</span> app = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&quot;app&quot;</span>);

<span class="hljs-comment">// ...</span>

<span class="hljs-title function_">init</span>(<span class="hljs-string">&quot;:user/:spaceId&quot;</span>, {
  <span class="hljs-attr">target</span>: app
});`,wrap:!1}}),Z=new E({props:{code:"aW5pdChzcGFjZSklM0IlMEElMEElMkYlMkYlMjBzcGFjZSUyMCUzRCUyMCU3QiUwQSUyRiUyRiUyMCUyMGlkJTNBJTIwc3RyaW5nJTNCJTBBJTJGJTJGJTIwJTIwbGlrZXMlM0ElMjBudW1iZXIlM0IlMEElMkYlMkYlMjAlMjBhdXRob3IlM0ElMjBzdHJpbmclM0IlMEElMkYlMkYlMjAlN0Q=",highlighted:`<span class="hljs-title function_">init</span>(space);

<span class="hljs-comment">// space = {</span>
<span class="hljs-comment">//  id: string;</span>
<span class="hljs-comment">//  likes: number;</span>
<span class="hljs-comment">//  author: string;</span>
<span class="hljs-comment">// }</span>`,wrap:!1}}),k=new Je({props:{source:"https://github.com/huggingface/huggingface.js/blob/main/docs/space-header/README.md"}}),{c(){h=f("meta"),R=n(),v=f("p"),Q=n(),p($.$$.fragment),Y=n(),p(d.$$.fragment),H=n(),u=f("p"),u.innerHTML=ne,z=n(),M=f("p"),M.innerHTML=le,N=n(),p(J.$$.fragment),x=n(),p(T.$$.fragment),q=n(),p(w.$$.fragment),F=n(),p(y.$$.fragment),L=n(),p(U.$$.fragment),V=n(),p(j.$$.fragment),X=n(),I=f("p"),I.innerHTML=pe,A=n(),p(C.$$.fragment),P=n(),G=f("p"),G.innerHTML=ie,D=n(),p(b.$$.fragment),O=n(),B=f("p"),B.textContent=me,K=n(),p(Z.$$.fragment),ee=n(),p(k.$$.fragment),te=n(),S=f("p"),this.h()},l(e){const t=de("svelte-u9bgzb",document.head);h=g(t,"META",{name:!0,content:!0}),t.forEach(a),R=l(e),v=g(e,"P",{}),ce(v).forEach(a),Q=l(e),i($.$$.fragment,e),Y=l(e),i(d.$$.fragment,e),H=l(e),u=g(e,"P",{"data-svelte-h":!0}),W(u)!=="svelte-119h1st"&&(u.innerHTML=ne),z=l(e),M=g(e,"P",{"data-svelte-h":!0}),W(M)!=="svelte-j50m0u"&&(M.innerHTML=le),N=l(e),i(J.$$.fragment,e),x=l(e),i(T.$$.fragment,e),q=l(e),i(w.$$.fragment,e),F=l(e),i(y.$$.fragment,e),L=l(e),i(U.$$.fragment,e),V=l(e),i(j.$$.fragment,e),X=l(e),I=g(e,"P",{"data-svelte-h":!0}),W(I)!=="svelte-1pgkvcv"&&(I.innerHTML=pe),A=l(e),i(C.$$.fragment,e),P=l(e),G=g(e,"P",{"data-svelte-h":!0}),W(G)!=="svelte-11hvv9a"&&(G.innerHTML=ie),D=l(e),i(b.$$.fragment,e),O=l(e),B=g(e,"P",{"data-svelte-h":!0}),W(B)!=="svelte-1xt72pc"&&(B.textContent=me),K=l(e),i(Z.$$.fragment,e),ee=l(e),i(k.$$.fragment,e),te=l(e),S=g(e,"P",{}),ce(S).forEach(a),this.h()},h(){re(h,"name","hf:doc:metadata"),re(h,"content",we)},m(e,t){ue(document.head,h),s(e,R,t),s(e,v,t),s(e,Q,t),m($,e,t),s(e,Y,t),m(d,e,t),s(e,H,t),s(e,u,t),s(e,z,t),s(e,M,t),s(e,N,t),m(J,e,t),s(e,x,t),m(T,e,t),s(e,q,t),m(w,e,t),s(e,F,t),m(y,e,t),s(e,L,t),m(U,e,t),s(e,V,t),m(j,e,t),s(e,X,t),s(e,I,t),s(e,A,t),m(C,e,t),s(e,P,t),s(e,G,t),s(e,D,t),m(b,e,t),s(e,O,t),s(e,B,t),s(e,K,t),m(Z,e,t),s(e,ee,t),m(k,e,t),s(e,te,t),s(e,S,t),ae=!0},p:he,i(e){ae||(c($.$$.fragment,e),c(d.$$.fragment,e),c(J.$$.fragment,e),c(T.$$.fragment,e),c(w.$$.fragment,e),c(y.$$.fragment,e),c(U.$$.fragment,e),c(j.$$.fragment,e),c(C.$$.fragment,e),c(b.$$.fragment,e),c(Z.$$.fragment,e),c(k.$$.fragment,e),ae=!0)},o(e){r($.$$.fragment,e),r(d.$$.fragment,e),r(J.$$.fragment,e),r(T.$$.fragment,e),r(w.$$.fragment,e),r(y.$$.fragment,e),r(U.$$.fragment,e),r(j.$$.fragment,e),r(C.$$.fragment,e),r(b.$$.fragment,e),r(Z.$$.fragment,e),r(k.$$.fragment,e),ae=!1},d(e){e&&(a(R),a(v),a(Q),a(Y),a(H),a(u),a(z),a(M),a(N),a(x),a(q),a(F),a(L),a(V),a(X),a(I),a(A),a(P),a(G),a(D),a(O),a(B),a(K),a(ee),a(te),a(S)),a(h),o($,e),o(d,e),o(J,e),o(T,e),o(w,e),o(y,e),o(U,e),o(j,e),o(C,e),o(b,e),o(Z,e),o(k,e)}}}const we='{"title":"🤗 Hugging Face Space Header","local":"-hugging-face-space-header","sections":[{"title":"Install","local":"install","sections":[{"title":"Deno","local":"deno","sections":[],"depth":3},{"title":"Initialize","local":"initialize","sections":[],"depth":3}],"depth":2},{"title":"Usage","local":"usage","sections":[],"depth":2}],"depth":1}';function ye(se){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ge extends ge{constructor(h){super(),$e(this,h,ye,Te,oe,{})}}export{Ge as component};
