PageSourceSearch

https://johnsmith9982-chuanhuchatgpt.hf.space/assets/index-807b9841.js

js johnsmith9982-chuanhuchatgpt.hf.space collected 2026-10-03 10:20:27 UTC 9,180 bytes, 2 lines download raw bytes

1import{S as G,e as H,s as L,F as U,o as M,Q as z,G as B,h as j,r as K,u as m,v as Y,w as b,k as J,H as S,C as p,a7 as x,E as $,R as ee,U as te,X as le,a9 as se,ab as ie,ac as ne,ad as ae,ag as c,ar as fe,as as ue,Z as oe,ae as re,V as _e,W as ce,n as ge}from"./index-2576a72b.js";import{U as he}from"./Upload-b4bd710d.js";import{M as me}from"./ModifyUpload-938490b9.js";import{B as be,n as D,d as de}from"./Button-ae6c8a38.js";import{B as we}from"./BlockLabel-99d695f3.js";import{F as ke}from"./File-9f7ecde3.js";import{F as Fe}from"./FilePreview-0958895d.js";import{U as ye}from"./UploadText-8f800619.js";import"./IconButton-a3421c90.js";import"./Undo-3c4b5558.js";function Ae(s){let e,l,t;function i(r){s[13](r)}let n={filetype:s[7],parse_to_data_url:!1,file_count:s[3],$$slots:{default:[Be]},$$scope:{ctx:s}};return s[6]!==void 0&&(n.dragging=s[6]),e=new he({props:n}),ee.push(()=>te(e,"dragging",i)),e.$on("load",s[8]),{c(){U(e.$$.fragment)},m(r,a){B(e,r,a),t=!0},p(r,a){const o={};a&128&&(o.filetype=r[7]),a&8&&(o.file_count=r[3]),a&16384&&(o.$$scope={dirty:a,ctx:r}),!l&&a&64&&(l=!0,o.dragging=r[6],le(()=>l=!1)),e.$set(o)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){m(e.$$.fragment,r),t=!1},d(r){S(e,r)}}}function Ue(s){let e,l,t,i;return e=new me({props:{absolute:!0}}),e.$on("clear",s[9]),t=new Fe({props:{selectable:s[4],value:s[0],height:s[5]}}),t.$on("select",s[12]),{c(){U(e.$$.fragment),l=M(),U(t.$$.fragment)},m(n,r){B(e,n,r),j(n,l,r),B(t,n,r),i=!0},p(n,r){const a={};r&16&&(a.selectable=n[4]),r&1&&(a.value=n[0]),r&32&&(a.height=n[5]),t.$set(a)},i(n){i||(b(e.$$.fragment,n),b(t.$$.fragment,n),i=!0)},o(n){m(e.$$.fragment,n),m(t.$$.fragment,n),i=!1},d(n){n&&J(l),S(e,n),S(t,n)}}}function Be(s){let e;const l=s[11].default,t=se(l,s,s[14],null);return{c(){t&&t.c()},m(i,n){t&&t.m(i,n),e=!0},p(i,n){t&&t.p&&(!e||n&16384)&&ie(t,l,i,i[14],e?ae(l,i[14],n,null):ne(i[14]),null)},i(i){e||(b(t,i),e=!0)},o(i){m(t,i),e=!1},d(i){t&&t.d(i)}}}function Se(s){let e,l,t,i,n,r;e=new we({props:{show_label:s[2],Icon:ke,float:s[0]===null,label:s[1]||"File"}});const a=[Ue,Ae],o=[];function h(u,g){return u[0]?0:1}return t=h(s),i=o[t]=a[t](s),{c(){U(e.$$.fragment),l=M(),i.c(),n=z()},m(u,g){B(e,u,g),j(u,l,g),o[t].m(u,g),j(u,n,g),r=!0},p(u,[g]){const d={};g&4&&(d.show_label=u[2]),g&1&&(d.float=u[0]===null),g&2&&(d.label=u[1]||"File"),e.$set(d);let k=t;t=h(u),t===k?o[t].p(u,g):(K(),m(o[k],1,1,()=>{o[k]=null}),Y(),i=o[t],i?i.p(u,g):(i=o[t]=a[t](u),i.c()),b(i,1),i.m(n.parentNode,n))},i(u){r||(b(e.$$.fragment,u),b(i),r=!0)},o(u){m(e.$$.fragment,u),m(i),r=!1},d(u){u&&(J(l),J(n)),S(e,u),o[t].d(u)}}}function ve(s,e,l){let{$$slots:t={},$$scope:i}=e,{value:n}=e,{label:r}=e,{show_label:a=!0}=e,{file_count:o="single"}=e,{file_types:h=null}=e,{selectable:u=!1}=e,{height:g=void 0}=e;async function d({detail:_}){l(0,n=_),await x(),F("change",n),F("upload",_)}function k({detail:_}){l(0,n=null),F("change",n),F("clear")}const F=p();let y;h==null?y=null:(h=h.map(_=>_.startsWith(".")?_:_+"/*"),y=h.join(", "));let v=!1;function I(_){$.call(this,s,_)}function N(_){v=_,l(6,v)}return s.$$set=_=>{"value"in _&&l(0,n=_.value),"label"in _&&l(1,r=_.label),"show_label"in _&&l(2,a=_.show_label),"file_count"in _&&l(3,o=_.file_count),"file_types"in _&&l(10,h=_.file_types),"selectable"in _&&l(4,u=_.selectable),"height"in _&&l(5,g=_.height),"$$scope"in _&&l(14,i=_.$$scope)},s.$$.update=()=>{s.$$.dirty&64&&F("drag",v)},[n,r,a,o,u,g,v,y,d,k,h,t,I,N,i]}class Ee extends G{constructor(e){super(),H(this,e,ve,Se,L,{value:0,label:1,show_label:2,file_count:3,file_types:10,selectable:4,height:5})}}function Ce(s){let e,l;return e=new ye({props:{type:"file"}}),{c(){U(e.$$.fragment)},m(t,i){B(e,t,i),l=!0},p:ge,i(t){l||(b(e.$$.fragment,t),l=!0)},o(t){m(e.$$.fragment,t),l=!1},d(t){S(e,t)}}}function Ie(s){let e,l,t,i;const n=[s[9],{status:s[17]?"generating":s[9]?.status||"complete"}];let r={};for(let a=0;a<n.length;a+=1)r=oe(r,n[a]);return e=new re({props:r}),t=new Ee({props:{label:s[4],show_label:s[5],value:s[15],file_count:s[6],file_types:s[7],selectable:s[8],height:s[13],$$slots:{default:[Ce]},$$scope:{ctx:s}}}),t.$on("change",s[22]),t.$on("drag",s[23]),t.$on("clear",s[24]),t.$on("select",s[25]),{c(){U(e.$$.fragment),l=M(),U(t.$$.fragment)},m(a,o){B(e,a,o),j(a,l,o),B(t,a,o),i=!0},p(a,o){const h=o&131584?_e(n,[o&512&&ce(a[9]),{status:a[17]?"generating":a[9]?.status||"complete"}]):{};e.$set(h);const u={};o&16&&(u.label=a[4]),o&32&&(u.show_label=a[5]),o&32768&&(u.value=a[15]),o&64&&(u.file_count=a[6]),o&128&&(u.file_types=a[7]),o&256&&(u.selectable=a[8]),o&8192&&(u.height=a[13]),o&134217728&&(u.$$scope={dirty:o,ctx:a}),t.$set(u)},i(a){i||(b(e.$$.fragment,a),b(t.$$.fragment,a),i=!0)},o(a){m(e.$$.fragment,a),m(t.$$.fragment,a),i=!1},d(a){a&&J(l),S(e,a),S(t,a)}}}function Ne(s){let e,l;return e=new be({props:{visible:s[3],variant:s[0]===null?"dashed":"solid",border_mode:s[16]?"focus":"base",padding:!1,elem_id:s[1],elem_classes:s[2],container:s[10],scale:s[11],min_width:s[12],height:s[13],allow_overflow:!1,$$slots:{default:[Ie]},$$scope:{ctx:s}}}),{c(){U(e.$$.fragment)},m(t,i){B(e,t,i),l=!0},p(t,[i]){const n={};i&8&&(n.visible=t[3]),i&1&&(n.variant=t[0]===null?"dashed":"solid"),i&65536&&(n.border_mode=t[16]?"focus":"base"),i&2&&(n.elem_id=t[1]),i&4&&(n.elem_classes=t[2]),i&1024&&(n.container=t[10]),i&2048&&(n.scale=t[11]),i&4096&&(n.min_width=t[12]),i&8192&&(n.height=t[13]),i&134472689&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){l||(b(e.$$.fragment,t),l=!0)},o(t){m(e.$$.fragment,t),l=!1},d(t){S(e,t)}}}function je(s,e,l){let t,{elem_id:i=""}=e,{elem_classes:n=[]}=e,{visible:r=!0}=e,{value:a}=e,o,{mode:h}=e,{root:u}=e,{label:g}=e,{show_label:d}=e,{file_count:k}=e,{file_types:F=["file"]}=e,{root_url:y}=e,{selectable:v=!1}=e,{loading_status:I}=e,{container:N=!0}=e,{scale:_=null}=e,{min_width:O=void 0}=e,{height:T=void 0}=e,{gradio:A}=e;const P=fe("upload_files")??ue;let W=!1,E=!1;const Q=({detail:f})=>l(0,a=f),R=({detail:f})=>l(16,W=f),V=()=>A.dispatch("clear"),X=({detail:f})=>A.dispatch("select",f);return s.$$set=f=>{"elem_id"in f&&l(1,i=f.elem_id),"elem_classes"in f&&l(2,n=f.elem_classes),"visible"in f&&l(3,r=f.visible),"value"in f&&l(0,a=f.value),"mode"in f&&l(18,h=f.mode),"root"in f&&l(19,u=f.root),"label"in f&&l(4,g=f.label),"show_label"in f&&l(5,d=f.show_label),"file_count"in f&&l(6,k=f.file_count),"file_types"in f&&l(7,F=f.file_types),"root_url"in f&&l(20,y=f.root_url),"selectable"in f&&l(8,v=f.selectable),"loading_status"in f&&l(9,I=f.loading_status),"container"in f&&l(10,N=f.container),"scale"in f&&l(11,_=f.scale),"min_width"in f&&l(12,O=f.min_width),"height"in f&&l(13,T=f.height),"gradio"in f&&l(14,A=f.gradio)},s.$$.update=()=>{if(s.$$.dirty&1572865&&l(15,t=D(a,u,y)),s.$$.dirty&3981313&&JSON.stringify(t)!==JSON.stringify(o)){if(l(21,o=t),t===null)A.dispatch("change"),l(17,E=!1);else if(!(Array.isArray(t)?t:[t]).every(f=>f.blob))l(17,E=!1),A.dispatch("change");else if(h==="interactive"){let f=(Array.isArray(t)?t:[t]).map(C=>C.blob),Z=t;l(17,E=!0),P(u,f).then(C=>
1{Z===t&&(l(17,E=!1),C.error?(Array.isArray(t)?t:[t]).forEach(async(w,q)=>{w.data=await de(w.blob),w.blob=void 0}):((Array.isArray(t)?t:[t]).forEach((w,q)=>{C.files&&(w.orig_name=w.name,w.name=C.files[q],w.is_file=!0,w.blob=void 0)}),l(21,o=l(15,t=D(a,u,y)))),A.dispatch("change"),A.dispatch("upload"))})}}},[a,i,n,r,g,d,k,F,v,I,N,_,O,T,A,t,W,E,h,u,y,o,Q,R,V,X]}class Je extends G{constructor(e){super(),H(this,e,je,Ne,L,{elem_id:1,elem_classes:2,visible:3,value:0,mode:18,root:19,label:4,show_label:5,file_count:6,file_types:7,root_url:20,selectable:8,loading_status:9,container:10,scale:11,min_width:12,height:13,gradio:14})}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),c()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),c()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),c()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),c()}get mode(){return this.$$.ctx[18]}set mode(e){this.$$set({mode:e}),c()}get root(){return this.$$.ctx[19]}set root(e){this.$$set({root:e}),c()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),c()}get show_label(){return this.$$.ctx[5]}set show_label(e){this.$$set({show_label:e}),c()}get file_count(){return this.$$.ctx[6]}set file_count(e){this.$$set({file_count:e}),c()}get file_types(){return this.$$.ctx[7]}set file_types(e){this.$$set({file_types:e}),c()}get root_url(){return this.$$.ctx[20]}set root_url(e){this.$$set({root_url:e}),c()}get selectable(){return this.$$.ctx[8]}set selectable(e){this.$$set({selectable:e}),c()}get loading_status(){return this.$$.ctx[9]}set loading_status(e){this.$$set({loading_status:e}),c()}get container(){return this.$$.ctx[10]}set container(e){this.$$set({container:e}),c()}get scale(){return this.$$.ctx[11]}set scale(e){this.$$set({scale:e}),c()}get min_width(){return this.$$.ctx[12]}set min_width(e){this.$$set({min_width:e}),c()}get height(){return this.$$.ctx[13]}set height(e){this.$$set({height:e}),c()}get gradio(){return this.$$.ctx[14]}set gradio(e){this.$$set({gradio:e}),c()}}const Qe=Je;export{Qe as default};
2//# sourceMappingURL=index-807b9841.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.