PageSourceSearch

https://heinrichhimmler1-tokenhoster.hf.space/assets/Index-BvaQ9xP4.js

js heinrichhimmler1-tokenhoster.hf.space collected 2026-10-04 16:56:06 UTC 7,536 bytes, 1 lines download raw bytes

1import{i as I,k as ke,d as xe,b as Z,u as $e,a as oe,t as Be,g as De,r as Ee}from"./i18n-BlwlR3g4.js";import{a as f,f as Ie,R as ie,u as j,v as Me,y as Oe,w as t,x as o,a7 as q,t as E,Z as k,T as ue,a5 as _,X as x,V as h,W as M,at as le,a0 as C,a8 as Ae,Y as b,S as ce}from"./index-B5CnGmTK.js";import{G as Se}from"./utils.svelte-Cn7aBojF.js";import{b as Ge}from"./input-2DWUN4z0.js";import{p as Pe}from"./event-modifiers-CdEA5IGF.js";import"./ScrollFade.svelte_svelte_type_style_lang-3SfI1hia.js";import{B as Re}from"./BlockTitle-swcOJpHO.js";import{D as Te}from"./DropdownArrow-DsE4n_6d.js";import{I as We}from"./IconButtonWrapper-D8MDVsLy.js";import{D as ze,h as Le,a as Ve,b as Xe}from"./Dropdown-DMoLL5nQ.js";import{B as Ye}from"./Block-CimeBYgM.js";import{S as Ze}from"./index-pSSnyPc8.js";import"./StreamingBar.svelte_svelte_type_style_lang-lroHh1Vk.js";import{default as kt}from"./Example-C3Aop945.js";import"./clone-CePNcxlk.js";import"./snippet-qnvrkjTU.js";import"./Info-DLBy31It.js";import"./html-Dw1CmxWF.js";import"./window-_x_xJ--7.js";import"./Clear-DNBmcX61.js";import"./index-B_pwUImq.js";/* empty css                                              */var je=Ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="100%" height="100%"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>');function ne(O){var $=je();f(O,$)}var qe=M('<div class="token-remove svelte-1dv2vbb" role="button" tabindex="0"><!></div>'),Ce=M('<div class="token svelte-1dv2vbb"><span class="svelte-1dv2vbb"><!></span> <!></div>'),Fe=M('<div role="button" tabindex="0" class="token-remove remove-all svelte-1dv2vbb"><!></div>'),He=M('<!> <span class="icon-wrap svelte-1dv2vbb"><!></span>',1),Je=M('<div><!> <!> <div class="wrap svelte-1dv2vbb"><div><!> <div class="secondary-wrap svelte-1dv2vbb"><input autocomplete="off"/> <!></div></div> <!></div></div>');function Ke(O,$){ie($,!0);const r=$.gradio;let s,n=j(""),F=_(()=>r.shared.label||"Multiselect"),B=_(()=>r.props.buttons),A=_(()=>r.props.choices.map(e=>e[0])),g=_(()=>r.props.choices.map(e=>e[1])),D=_(()=>!r.shared.interactive),d=j(!1),w=_(()=>{const e=Ve(r.props.choices,t(n));return[e,e.length>0&&!r.props.allow_custom_value?e[0]:null]}),v=_(()=>le(t(w),2)),W=_(()=>t(v)[0]),m=_(()=>t(v)[1]);function pe(){return r.props.value===void 0?[]:Array.isArray(r.props.value)?r.props.value.map(e=>{const a=t(g).indexOf(e);if(a!==-1)return a;if(r.props.allow_custom_value)return e}).filter(e=>e!==void 0):[]}let i=_(pe);function de(){r.props.allow_custom_value||o(n,""),r.props.allow_custom_value&&t(n)!==""&&(L(t(n)),o(n,"")),r.dispatch("blur"),o(d,!1),o(m,null)}function z(e){o(i,t(i).filter(a=>a!==e)),r.props.value=t(i).map(a=>typeof a=="number"?t(g)[a]:a),r.dispatch("input"),r.dispatch("select",{index:typeof e=="number"?e:-1,value:typeof e=="number"?t(g)[e]:e,selected:!1})}function L(e){(r.props.max_choices==null||t(i).length<r.props.max_choices)&&(t(i).push(e),r.dispatch("select",{index:typeof e=="number"?e:-1,value:typeof e=="number"?t(g)[e]:e,selected:!0})),t(i).length===r.props.max_choices&&(o(d,!1),o(m,null),s.blur()),r.props.value=t(i).map(a=>typeof a=="number"?t(g)[a]:a)}function ve(e){const a=parseInt(e);H(a)}function H(e){t(i).includes(e)?z(e):L(e),o(n,""),o(m,null),r.dispatch("input")}function J(e){o(i,[]),o(n,""),r.props.value=[],e.preventDefault()}function _e(e){o(W,r.props.choices.map((a,l)=>l)),(r.props.max_choices===null||t(i).length<r.props.max_choices)&&o(d,!0),r.dispatch("focus"),o(d,!0)}function fe(e){if((a=>{var l=le(a,2);o(d,l[0],!0),o(m,l[1])})(Le(e,t(m),t(W))),e.key==="Enter"&&(t(m)!==null?H(t(m)):r.props.allow_custom_value&&(L(t(n)),o(n,""))),e.key==="Backspace"&&t(n)===""){const a=t(i).slice(0,-1);r.props.value=a.map(l=>typeof l=="number"?t(g)[l]:l)}t(i).length===r.props.max_choices&&(o(d,!1),o(m,null))}let K=j(Me(r.props.value));Oe(()=>{t(K)!==r.props.value&&(o(K,r.props.value,!0),r.dispatch("change"))});function me(e){r.dispatch("custom_button_click",{id:e})}var P=Je();let N;var Q=h(P);{var he=e=>{We(e,{get buttons(){return t(B)},on_custom_button_click:me})};I(Q,e=>{r.shared.show_label&&t(B)&&t(B).length>0&&e(he)})}var U=x(Q,2);Re(U,{get show_label(){return r.shared.show_label},get info(){return r.props.info},children:(e,a)=>{Ae();var l=q();E(()=>C(l,t(F))),f(e,l)},$$slots:{default:!0}});var ee=x(U,2),R=h(ee);let te;var re=h(R);ke(re,17,()=>t(i),$e,(e,a)=>{var l=Ce(),S=h(l),T=h(S);{var V=u=>{var c=q();E(()=>C(c,t(A)[t(a)])),f(u,c)},G=u=>{var c=q();E(()=>C(c,t(a))),f(u,c)};I(T,u=>{typeof t(a)=="number"?u(V):u(G,!1)})}b(S);var y=x(S,2);{var X=u=>{var c=qe(),ye=h(c);ne(ye),b(c),E(Y=>oe(c,"title",Y),[()=>r.i18n("common.remove")+" "+t(a)]),k("click",c,Pe(()=>z(t(a)))),k("keydown",c,Y=>{Y.key==="Enter"&&z(t(a))}),f(u,c)};I(y,u=>{t(D)||u(X)})}b(l),f(e,l)}
1);var se=x(re,2),p=h(se);Be(p);let ae;xe(p,e=>s=e,()=>s);var be=x(p,2);{var ge=e=>{var a=He(),l=ce(a);{var S=G=>{var y=Fe(),X=h(y);ne(X),b(y),E(u=>oe(y,"title",u),[()=>r.i18n("common.clear")]),k("click",y,J),k("keydown",y,u=>{u.key==="Enter"&&J(u)}),f(G,y)};I(l,G=>{t(i).length>0&&G(S)})}var T=x(l,2),V=h(T);Te(V),b(T),f(e,a)};I(be,e=>{t(D)||e(ge)})}b(se),b(R);var we=x(R,2);ze(we,{get show_options(){return t(d)},get choices(){return r.props.choices},get filtered_indices(){return t(W)},get disabled(){return t(D)},get selected_indices(){return t(i)},get active_index(){return t(m)},remember_scroll:!0,onchange:ve}),b(ee),b(P),E(e=>{N=Z(P,1,"svelte-1dv2vbb",null,N,{container:r.shared.container}),te=Z(R,1,"wrap-inner svelte-1dv2vbb",null,te,{show_options:t(d)}),ae=Z(p,1,"border-none svelte-1dv2vbb",null,ae,e),p.disabled=t(D),p.readOnly=!r.props.filterable},[()=>({subdued:!t(A).includes(t(n))&&!r.props.allow_custom_value||t(i).length===r.props.max_choices})]),Ge(p,()=>t(n),e=>o(n,e)),k("keydown",p,fe),k("keyup",p,e=>{r.dispatch("key_up",{key:e.key,input_value:t(n)})}),k("blur",p,de),k("focus",p,_e),f(O,P),ue()}var Ne=M("<!> <!>",1);function gt(O,$){ie($,!0);let r=Ee($,["$$slots","$$events","$$legacy"]);const s=new Se(r);Ye(O,{get visible(){return s.shared.visible},get elem_id(){return s.shared.elem_id},get elem_classes(){return s.shared.elem_classes},get padding(){return s.shared.container},allow_overflow:!1,get scale(){return s.shared.scale},get min_width(){return s.shared.min_width},children:(n,F)=>{var B=Ne(),A=ce(B);Ze(A,De({get autoscroll(){return s.shared.autoscroll},get i18n(){return s.i18n}},()=>s.shared.loading_status,{on_clear_status:()=>s.dispatch("clear_status",loading_status)}));var g=x(A,2);{var D=w=>{Ke(w,{get gradio(){return s}})},d=w=>{Xe(w,{get label(){return s.shared.label},get info(){return s.props.info},get choices(){return s.props.choices},get interactive(){return s.shared.interactive},get show_label(){return s.shared.show_label},get container(){return s.shared.container},get allow_custom_value(){return s.props.allow_custom_value},get filterable(){return s.props.filterable},get buttons(){return s.props.buttons},oncustom_button_click:v=>{s.dispatch("custom_button_click",{id:v})},on_change:()=>s.dispatch("change"),on_input:()=>s.dispatch("input"),on_select:v=>s.dispatch("select",v),on_focus:()=>s.dispatch("focus"),on_blur:()=>s.dispatch("blur"),on_key_up:v=>s.dispatch("key_up",v),get value(){return s.props.value},set value(v){s.props.value=v}})};I(g,w=>{s.props.multiselect?w(D):w(d,!1)})}f(n,B)},$$slots:{default:!0}}),ue()}export{Xe as BaseDropdown,ze as BaseDropdownOptions,kt as BaseExample,Ke as BaseMultiselect,gt as default};

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.