vendor: 58,683 bytes, lines 1-2
1import{s as De}from"./select-BigU4G0v.js";import{d as tn}from"./dispatch-kxCwF96_.js";import{r as nn}from"./file-url-DoxvUUVV.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-Dn324h3u.js";import"./MarkdownCode.svelte_svelte_type_style_lang-C4fBIMNi.js";import{B as Rt}from"./BlockLabel-8WtM61r3.js";import{I as Ie}from"./IconButton-DSs-aBrk.js";import{E as _t}from"./Empty-AVq7jL0F.js";import{C as It}from"./Clear-By3xiIwg.js";import{D as Lt}from"./Download-DVtk-Jv3.js";import{I as Le,F as sn}from"./FullscreenButton-zMG84Fb2.js";import{U as ln}from"./Undo-DCjBnnSO.js";import{I as on}from"./IconButtonWrapper-jknaAjP6.js";import{w as rn,k as ft,i as an}from"./index-Do3LSwBC.js";import{D as Bt}from"./DownloadLink-QIttOhoR.js";import{n as un,l as _n,i as ct,S as qt}from"./index-Dk7BRz4q.js";import{a as Pt}from"./Upload-B_zkKtR-.js";import{B as Ut}from"./Block-CygNNd5z.js";import{U as Nt}from"./UploadText-sHYakqun.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import"./prism-python-Cp7Xa0u5.js";import"./svelte/svelte.js";/* empty css */function st(i,e){if(i===e||i!==i)return()=>i;const t=typeof i;if(t!==typeof e||Array.isArray(i)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(i)){const n=e.map((s,l)=>st(i[l],s));return s=>n.map(l=>l(s))}if(t==="object"){if(!i||!e)throw new Error("Object cannot be null");if(ct(i)&&ct(e)){i=i.getTime(),e=e.getTime();const l=e-i;return r=>new Date(i+r*l)}const n=Object.keys(e),s={};return n.forEach(l=>{s[l]=st(i[l],e[l])}),l=>{const r={};return n.forEach(u=>{r[u]=s[u](l)}),r}}if(t==="number"){const n=e-i;return s=>i+s*n}throw new Error(`Cannot interpolate ${t} values`)}function fn(i,e={}){const t=rn(i);let n,s=i;function l(r,u){if(i==null)return t.set(i=r),Promise.resolve();s=r;let o=n,_=!1,{delay:a=0,duration:f=400,easing:h=an,interpolate:b=st}=ft(ft({},e),u);if(f===0)return o&&(o.abort(),o=null),t.set(i=s),Promise.resolve();const g=un()+a;let d;return n=_n(w=>{if(w<g)return!0;_||(d=b(i,r),typeof f=="function"&&(f=f(i,r)),_=!0),o&&(o.abort(),o=null);const $=w-g;return $>f?(t.set(i=r),!1):(t.set(i=d(h($/f))),!0)}),n.promise}return{set:l,update:(r,u)=>l(r(s,i),u),subscribe:t.subscribe}}function cn(i){let e;for(;e=i.sourceEvent;)i=e;return i}function ht(i,e){if(i=cn(i),e===void 0&&(e=i.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var n=t.createSVGPoint();return n.x=i.clientX,n.y=i.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[i.clientX-s.left-e.clientLeft,i.clientY-s.top-e.clientTop]}}return[i.pageX,i.pageY]}const hn={passive:!1},Se={capture:!0,passive:!1};function tt(i){i.stopImmediatePropagation()}function ve(i){i.preventDefault(),i.stopImmediatePropagation()}function dn(i){var e=i.document.documentElement,t=De(i).on("dragstart.drag",ve,Se);"onselectstart"in e?t.on("selectstart.drag",ve,Se):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function gn(i,e){var t=i.document.documentElement,n=De(i).on("dragstart.drag",null);e&&(n.on("click.drag",ve,Se),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in t?n.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const qe=i=>()=>i;function lt(i,{sourceEvent:e,subject:t,target:n,identifier:s,active:l,x:r,y:u,dx:o,dy:_,dispatch:a}){Object.defineProperties(this,{type:{value:i,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:o,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:a}})}lt.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function mn(i){return!i.ctrlKey&&!i.button}function bn(){return this.parentNode}function pn(i,e){return e??{x:i.x,y:i.y}}function wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function vn(){var i=mn,e=bn,t=pn,n=wn,s={},l=tn("start","drag","end"),r=0,u,o,_,a,f=0;function h(m){m.on("mousedown.drag",b).filter(n).on("touchstart.drag",w).on("touchmove.drag",$,hn).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(m,X){if(!(a||!i.call(this,m,X))){var Y=D(this,e.call(this,m,X),m,X,"mouse");Y&&(De(m.view).on("mousemove.drag",g,Se).on("mouseup.drag",d,Se),dn(m.view),tt(m),_=!1,u=m.clientX,o=m.clientY,Y("start",m))}}function g(m){if(ve(m),!_){var X=m.clientX-u,Y=m.clientY-o;_=X*X+Y*Y>f}s.mouse("drag",m)}function d(m){De(m.view).on("mousemove.drag mouseup.drag",null),gn(m.view,_),ve(m),s.mouse("end",m)}function w(m,X){if(i.call(this,m,X)){var Y=m.changedTouches,E=e.call(this,m,X),M=Y.length,c,q;for(c=0;c<M;++c)(q=D(this,E,m,X,Y[c].identifier,Y[c]))&&(tt(m),q("start",m,Y[c]))}}function $(m){var X=m.changedTouches,Y=X.length,E,M;for(E=0;E<Y;++E)(M=s[X[E].identifier])&&(ve(m),M("drag",m,X[E]))}function z(m){var X=m.changedTouches,Y=X.length,E,M;for(a&&clearTimeout(a),a=setTimeout(function(){a=null},500),E=0;E<Y;++E)(M=s[X[E].identifier])&&(tt(m),M("end",m,X[E]))}function D(m,X,Y,E,M,c){var q=l.copy(),L=ht(c||Y,X),I,P,U;if((U=t.call(m,new lt("beforestart",{sourceEvent:Y,target:h,identifier:M,active:r,x:L[0],y:L[1],dx:0,dy:0,dispatch:q}),E))!=null)return I=U.x-L[0]||0,P=U.y-L[1]||0,function Q(se,re,k){var x=L,F;switch(se){case"start":s[M]=Q,F=r++;break;case"end":delete s[M],--r;case"drag":L=ht(k||re,X),F=r;break}q.call(se,m,new lt(se,{sourceEvent:re,subject:U,target:h,identifier:M,active:F,x:L[0]+I,y:L[1]+P,dx:L[0]-x[0],dy:L[1]-x[1],dispatch:q}),E)}}return h.filter=function(m){return arguments.length?(i=typeof m=="function"?m:qe(!!m),h):i},h.container=function(m){return arguments.length?(e=typeof m=="function"?m:qe(m),h):e},h.subject=function(m){return arguments.length?(t=typeof m=="function"?m:qe(m),h):t},h.touchable=function(m){return arguments.length?(n=typeof m=="function"?m:qe(!!m),h):n},h.on=function(){var m=l.on.apply(l,arguments);return m===l?h:m},h.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,h):Math.sqrt(f)},h}const{SvelteComponent:kn,append:oe,attr:ee,binding_callbacks:nt,create_slot:zn,detach:$n,element:ue,flush:me,get_all_dirty_from_scope:Xn,get_slot_changes:Yn,init:En,insert:Mn,listen:Tn,safe_not_equal:Dn,set_style:be,space:dt,toggle_class:_e,transition_in:Sn,transition_out:Cn,update_slot_base:Rn}=window.__gradio__svelte__internal,{onMount:In}=window.__gradio__svelte__internal;function Ln(i){let e,t,n,s,l,r,u,o,_,a,f,h,b;const g=i[11].default,d=zn(g,i,i[10],null);return{c(){e=ue("div"),t=ue("div"),d&&d.c(),n=dt(),s=ue("div"),l=ue("span"),r=ue("span"),r.textContent="â¢",u=ue("span"),o=ue("span"),o.textContent="â¢",_=dt(),a=ue("div"),ee(t,"class","content svelte-fpmna9"),ee(r,"class","icon left svelte-fpmna9"),ee(u,"class","icon center svelte-fpmna9"),be(u,"--color",i[4]),ee(o,"class","icon right svelte-fpmna9"),ee(l,"class","icon-wrap svelte-fpmna9"),_e(l,"active",i[7]),_e(l,"disabled",i[3]),ee(a,"class","inner svelte-fpmna9"),be(a,"--color",i[4]),ee(s,"class","outer svelte-fpmna9"),ee(s,"role","none"),be(s,"transform","translateX("+i[6]+"px)"),_e(s,"disabled",i[3]),_e(s,"grab",i[7]),ee(e,"class","wrap svelte-fpmna9"),ee(e,"role","none")},m(w,$){Mn(w,e,$),oe(e,t),d&&d.m(t,null),i[13](t),oe(e,n),oe(e,s),oe(s,l),oe(l,r),oe(l,u),oe(l,o),oe(s,_),oe(s,a),i[14](s),i[15](e),f=!0,h||(b=Tn(window,"resize",i[12]),h=!0)},p(w,[$]){d&&d.p&&(!f||$&1024)&&Rn(d,g,w,w[10],f?Yn(g,w[10],$,null):Xn(w[10]),null),$&16&&be(u,"--color",w[4]),(!f||$&128)&&_e(l,"active",w[7]),(!f||$&8)&&_e(l,"disabled",w[3]),$&16&&be(a,"--color",w[4]),(!f||$&64)&&be(s,"transform","translateX("+w[6]+"px)"),(!f||$&8)&&_e(s,"disabled",w[3]),(!f||$&128)&&_e(s,"grab",w[7])},i(w){f||(Sn(d,w),f=!0)},o(w){Cn(d,w),f=!1},d(w){w&&$n(e),d&&d.d(w),i[13](null),i[14](null),i[15](null),h=!1,b()}}}function it(i,e,t){return Math.min(Math.max(i,e),t)}function Bn(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function qn(i,e,t){let{$$slots:n={},$$scope:s}=e,{position:l=.5}=e,{disabled:r=!1}=e,{slider_color:u="var(--border-color-primary)"}=e,{image_size:o={top:0,left:0,width:0,height:0}}=e,{el:_=void 0}=e,{parent_el:a=void 0}=e,f,h=0,b=!1,g=0;function d(c){g=a?.getBoundingClientRect().width||0,c===0&&t(0,o.width=_?.getBoundingClientRect().width||0,o),t(6,h=it(o.width*l+o.left,0,g))}function w(c){t(6,h=it(c,0,g)),t(9,l=Bn((c-o.left)/o.width,5))}function $(c){r||(t(7,b=!0),w(c.x))}function z(c){r||w(c.x)}function D(){r||t(7,b=!1)}function m(c){t(6,h=it(o.width*c+o.left,0,g))}In(()=>{d(o.width);const c=vn().on("start",$).on("drag",z).on("end",D);De(f).call(c)});const X=()=>d(o.width);function Y(c){nt[c?"unshift":"push"](()=>{_=c,t(1,_)})}function E(c){nt[c?"unshift":"push"](()=>{f=c,t(5,f)})}function M(c){nt[c?"unshift":"push"](()=>{a=c,t(2,a)})}return i.$$set=c=>{"position"in c&&t(9,l=c.position),"disabled"in c&&t(3,r=c.disabled),"slider_color"in c&&t(4,u=c.slider_color),"image_size"in c&&t(0,o=c.image_size),"el"in c&&t(1,_=c.el),"parent_el"in c&&t(2,a=c.parent_el),"$$scope"in c&&t(10,s=c.$$scope)},i.$$.update=()=>{i.$$.dirty&1&&d(o.width),i.$$.dirty&512&&m(l)},[o,_,a,r,u,f,h,b,d,l,s,n,X,Y,E,M]}class Wt extends kn{constructor(e){super(),En(this,e,qn,Ln,Dn,{position:9,disabled:3,slider_color:4,image_size:0,el:1,parent_el:2})}get position(){return this.$$.ctx[9]}set position(e){this.$$set({position:e}),me()}get disabled(){return this.$$.ctx[3]}set disabled(e){this.$$set({disabled:e}),me()}get slider_color(){return this.$$.ctx[4]}set slider_color(e){this.$$set({slider_color:e}),me()}get image_size(){return this.$$.ctx[0]}set image_size(e){this.$$set({image_size:e}),me()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),me()}get parent_el(){return this.$$.ctx[2]}set parent_el(e){this.$$set({parent_el:e}),me()}}const{SvelteComponent:Pn,assign:ot,binding_callbacks:Un,compute_rest_props:gt,detach:Nn,element:Wn,exclude_internal_props:On,flush:fe,get_spread_update:jn,init:An,insert:Fn,listen:Hn,noop:mt,safe_not_equal:Jn,set_attributes:bt,set_style:Pe,src_url_equal:yn,toggle_class:N}=window.__gradio__svelte__internal,{createEventDispatcher:Gn,onMount:Vn,tick:Kn}=window.__gradio__svelte__internal;function Zn(i){let e,t,n,s,l=[{src:t=i[7]},i[9]],r={};for(let u=0;u<l.length;u+=1)r=ot(r,l[u]);return{c(){e=Wn("img"),bt(e,r),N(e,"fixed",i[2]),N(e,"hidden",i[4]),N(e,"preview",i[5]==="preview"),N(e,"slider",i[5]==="upload"),N(e,"fullscreen",i[1]),N(e,"small",!i[1]),Pe(e,"transform",i[3]),Pe(e,"max-height",i[6]&&!i[1]?`${i[6]}px`:null),N(e,"svelte-k63p1v",!0)},m(u,o){Fn(u,e,o),i[12](e),n||(s=Hn(e,"load",i[13]),n=!0)},p(u,[o]){bt(e,r=jn(l,[o&128&&!yn(e.src,t=u[7])&&{src:t},o&512&&u[9]])),N(e,"fixed",u[2]),N(e,"hidden",u[4]),N(e,"preview",u[5]==="preview"),N(e,"slider",u[5]==="upload"),N(e,"fullscreen",u[1]),N(e,"small",!u[1]),Pe(e,"transform",u[3]),Pe(e,"max-height",u[6]&&!u[1]?`${u[6]}px`:null),N(e,"svelte-k63p1v",!0)},i:mt,o:mt,d(u){u&&Nn(e),i[12](null),n=!1,s()}}}function pt(i){if(!i)return{top:0,left:0,width:0,height:0};const e=i.parentElement?.getBoundingClientRect();if(!e)return{top:0,left:0,width:0,height:0};const t=i.naturalWidth/i.naturalHeight,n=e.width/e.height;let s,l;t>n?(s=e.width,l=e.width/t):(l=e.height,s=e.height*t);const r=(e.width-s)/2;return{top:(e.height-l)/2,left:r,width:s,height:l}}function Qn(i,e,t){const n=["src","fullscreen","fixed","transform","img_el","hidden","variant","max_height"];let s=gt(e,n),{src:l=void 0}=e,{fullscreen:r=!1}=e,u,{fixed:o=!1}=e,{transform:_="translate(0px, 0px) scale(1)"}=e,{img_el:a=null}=e,{hidden:f=!1}=e,{variant:h="upload"}=e,{max_height:b=500}=e,g;const d=Gn();Vn(()=>{const z=new ResizeObserver(async D=>{for(const m of D)await Kn(),d("load",pt(a))});return z.observe(a),()=>{z.disconnect()}});function w(z){Un[z?"unshift":"push"](()=>{a=z,t(0,a)})}const $=()=>d("load",pt(a));return i.$$set=z=>{e=ot(ot({},e),On(z)),t(9,s=gt(e,n)),"src"in z&&t(10,l=z.src),"fullscreen"in z&&t(1,r=z.fullscreen),"fixed"in z&&t(2,o=z.fixed),"transform"in z&&t(3,_=z.transform),"img_el"in z&&t(0,a=z.img_el),"hidden"in z&&t(4,f=z.hidden),"variant"in z&&t(5,h=z.variant),"max_height"in z&&t(6,b=z.max_height)},i.$$.update=()=>{if(i.$$.dirty&3072){t(7,u=l),t(11,g=l);const z=l;nn(z).then(D=>{g===z&&t(7,u=D)})}},[a,r,o,_,f,h,b,u,d,s,l,g,w,$]}class Oe extends Pn{constructor(e){super(),An(this,e,Qn,Zn,Jn,{src:10,fullscreen:1,fixed:2,transform:3,img_el:0,hidden:4,variant:5,max_height:6})}get src(){return this.$$.ctx[10]}set src(e){this.$$set({src:e}),fe()}get fullscreen(){return this.$$.ctx[1]}set fullscreen(e){this.$$set({fullscreen:e}),fe()}get fixed(){return this.$$.ctx[2]}set fixed(e){this.$$set({fixed:e}),fe()}get transform(){return this.$$.ctx[3]}set transform(e){this.$$set({transform:e}),fe()}get img_el(){return this.$$.ctx[0]}set img_el(e){this.$$set({img_el:e}),fe()}get hidden(){return this.$$.ctx[4]}set hidden(e){this.$$set({hidden:e}),fe()}get variant(){return this.$$.ctx[5]}set variant(e){this.$$set({variant:e}),fe()}get max_height(){return this.$$.ctx[6]}set max_height(e){this.$$set({max_height:e}),fe()}}class xn{container;image;scale;offsetX;offsetY;isDragging;lastX;lastY;initial_left_padding;initial_top_padding;initial_width;initial_height;subscribers;handleImageLoad;real_image_size={top:0,left:0,width:0,height:0};last_touch_distance;constructor(e,t){this.container=e,this.image=t,this.scale=1,this.offsetX=0,this.offsetY=0,this.isDragging=!1,this.lastX=0,this.lastY=0,this.initial_left_padding=0,this.initial_top_padding=0,this.initial_width=0,this.initial_height=0,this.subscribers=[],this.last_touch_distance=0,this.handleWheel=this.handleWheel.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleImageLoad=this.init.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.image.addEventListener("load",this.handleImageLoad),this.container.addEventListener("wheel",this.handleWheel),this.container.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.container.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("touchend",this.handleTouchEnd),new ResizeObserver(s=>{for(const l of s)l.target===this.container&&(this.handleResize(),this.get_image_size(this.image))}).observe(this.container)}handleResize(){this.init()}init(){const e=this.container.getBoundingClientRect(),t=this.image.getBoundingClientRect();this.initial_left_padding=t.left-e.left,this.initial_top_padding=t.top-e.top,this.initial_width=t.width,this.initial_height=t.height,this.reset_zoom(),this.updateTransform()}reset_zoom(){this.scale=1,this.offsetX=0,this.offsetY=0,this.updateTransform()}handleMouseDown(e){const t=this.image.getBoundingClientRect();if(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom){if(e.preventDefault(),this.scale===1)return;this.isDragging=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.image.style.cursor="grabbing"}}handleMouseMove(e){if(!this.isDragging)return;const t=e.clientX-this.lastX,n=e.clientY-this.lastY;this.offsetX+=t,this.offsetY+=n,this.lastX=e.clientX,this.lastY=e.clientY,this.updateTransform(),this.updateTransform()}handleMouseUp(){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1,this.image.style.cursor=this.scale>1?"grab":"zoom-in")}async handleWheel(e){e.preventDefault();const t=this.container.getBoundingClientRect(),n=this.image.getBoundingClientRect();if(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)return;const s=1.05,l=this.scale,r=-Math.sign(e.deltaY)>0?Math.min(15,l*s):Math.max(1,l/s);if(r===l)return;const u=e.clientX-t.left-this.initial_left_padding,o=e.clientY-t.top-this.initial_top_padding;this.scale=r,this.offsetX=this.compute_new_offset({cursor_position:u,current_offset:this.offsetX,new_scale:r,old_scale:l}),this.offsetY=this.compute_new_offset({cursor_position:o,current_offset:this.offsetY,new_scale:r,old_scale:l}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.image.style.cursor=this.scale>1?"grab":"zoom-in"}compute_new_position({position:e,scale:t,anchor_position:n}){return e-(e-n)*(t/this.scale)}compute_new_offset({cursor_position:e,current_offset:t,new_scale:n,old_scale:s}){return e-n/s*(e-t)}constrain_to_bounds(e=!1){if(this.scale===1){this.offsetX=0,this.offsetY=0;return}const t={top:this.real_image_size.top*this.scale+this.offsetY,left:this.real_image_size.left*this.scale+this.offsetX,width:this.real_image_size.width*this.scale,height:this.real_image_size.height*this.scale,bottom:this.real_image_size.top*this.scale+this.offsetY+this.real_image_size.height*this.scale,right:this.real_image_size.left*this.scale+this.offsetX+this.real_image_size.width*this.scale},n=this.real_image_size.left+this.real_image_size.width,s=this.real_image_size.top+this.real_image_size.height;e&&(t.top>this.real_image_size.top?this.offsetY=this.calculate_position(this.real_image_size.top,0,"y"):t.bottom<s&&(this.offsetY=this.calculate_position(s,1,"y")),t.left>this.real_image_size.left?this.offsetX=this.calculate_position(this.real_image_size.left,0,"x"):t.right<n&&(this.offsetX=this.calculate_position(n,1,"x")))}updateTransform(){this.notify({x:this.offsetX,y:this.offsetY,scale:this.scale})}destroy(){this.container.removeEventListener("wheel",this.handleWheel),this.container.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.container.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),this.image.removeEventListener("load",this.handleImageLoad)}subscribe(e){this.subscribers.push(e)}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t!==e)}notify({x:e,y:t,scale:n}){this.subscribers.forEach(s=>s({x:e,y:t,scale:n}))}handleTouchStart(e){e.preventDefault();const t=this.image.getBoundingClientRect(),n=e.touches[0];if(n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom){if(e.touches.length===1&&this.scale>1)this.isDragging=!0,this.lastX=n.clientX,this.lastY=n.clientY;else if(e.touches.length===2){const s=e.touches[0],l=e.touches[1];this.last_touch_distance=Math.hypot(l.clientX-s.clientX,l.clientY-s.clientY)}}}get_image_size(e){if(!e)return;const t=e.parentElement?.getBoundingClientRect();if(!t)return;const n=e.naturalWidth/e.naturalHeight,s=t.width/t.height;let l,r;n>s?(l=t.width,r=t.width/n):(r=t.height,l=t.height*n);const u=(t.width-l)/2,o=(t.height-r)/2;this.real_image_size={top:o,left:u,width:l,height:r}}handleTouchMove(e){if(e.touches.length===1&&this.isDragging){e.preventDefault();const t=e.touches[0],n=t.clientX-this.lastX,s=t.clientY-this.lastY;this.offsetX+=n,this.offsetY+=s,this.lastX=t.clientX,this.lastY=t.clientY,this.updateTransform()}else if(e.touches.length===2){e.preventDefault();const t=e.touches[0],n=e.touches[1],s=Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY);if(this.last_touch_distance===0){this.last_touch_distance=s;return}const l=s/this.last_touch_distance,r=this.scale,u=Math.min(15,Math.max(1,r*l));if(u===r){this.last_touch_distance=s;return}const o=this.container.getBoundingClientRect(),_=(t.clientX+n.clientX)/2-o.left-this.initial_left_padding,a=(t.clientY+n.clientY)/2-o.top-this.initial_top_padding;this.scale=u,this.offsetX=this.compute_new_offset({cursor_position:_,current_offset:this.offsetX,new_scale:u,old_scale:r}),this.offsetY=this.compute_new_offset({cursor_position:a,current_offset:this.offsetY,new_scale:u,old_scale:r}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.last_touch_distance=s,this.image.style.cursor=this.scale>1?"grab":"zoom-in"}}handleTouchEnd(e){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1),e.touches.length===0&&(this.last_touch_distance=0)}calculate_position(e,t,n){if(this.container.getBoundingClientRect(),n==="x"){const s=e,l=this.real_image_size.left+t*this.real_image_size.width;return s-l*this.scale}if(n==="y"){const s=e,l=this.real_image_size.top+t*this.real_image_size.height;return s-l*this.scale}return 0}}const{SvelteComponent:ei,add_flush_callback:Me,add_iframe_resize_listener:ti,add_render_callback:ni,append:wt,attr:vt,bind:Te,binding_callbacks:ge,check_outros:Ue,component_subscribe:ii,create_component:H,destroy_component:J,detach:ce,element:kt,empty:Ot,flush:O,group_outros:Ne,init:si,insert:he,mount_component:y,noop:li,safe_not_equal:oi,space:ke,toggle_class:zt,transition_in:C,transition_out:B}=window.__gradio__svelte__internal,{onMount:ri}=window.__gradio__svelte__internal,{createEventDispatcher:ai}=window.__gradio__svelte__internal;function ui(i){let e,t,n,s,l,r,u,o,_,a;t=new on({props:{$$slots:{default:[ci]},$$scope:{ctx:i}}});function f(d){i[32](d)}function h(d){i[33](d)}function b(d){i[34](d)}let g={slider_color:i[9],image_size:i[15],$$slots:{default:[hi]},$$scope:{ctx:i}};return i[0]!==void 0&&(g.position=i[0]),i[14]!==void 0&&(g.el=i[14]),i[18]!==void 0&&(g.parent_el=i[18]),l=new Wt({props:g}),ge.push(()=>Te(l,"position",f)),ge.push(()=>Te(l,"el",h)),ge.push(()=>Te(l,"parent_el",b)),{c(){e=kt("div"),H(t.$$.fragment),n=ke(),s=kt("div"),H(l.$$.fragment),vt(s,"class","slider-wrap svelte-eb87wk"),ni(()=>i[36].call(s)),zt(s,"limit_height",!i[20]),vt(e,"class","image-container svelte-eb87wk")},m(d,w){he(d,e,w),y(t,e,null),wt(e,n),wt(e,s),y(l,s,null),i[35](s),_=ti(s,i[36].bind(s)),i[37](e),a=!0},p(d,w){const $={};w[0]&1774674|w[1]&1024&&($.$$scope={dirty:w,ctx:d}),t.$set($);const z={};w[0]&512&&(z.slider_color=d[9]),w[0]&32768&&(z.image_size=d[15]),w[0]&5318786|w[1]&1024&&(z.$$scope={dirty:w,ctx:d}),!r&&w[0]&1&&(r=!0,z.position=d[0],Me(()=>r=!1)),!u&&w[0]&16384&&(u=!0,z.el=d[14],Me(()=>u=!1)),!o&&w[0]&262144&&(o=!0,z.parent_el=d[18],Me(()=>o=!1)),l.$set(z),(!a||w[0]&1048576)&&zt(s,"limit_height",!d[20])},i(d){a||(C(t.$$.fragment,d),C(l.$$.fragment,d),a=!0)},o(d){B(t.$$.fragment,d),B(l.$$.fragment,d),a=!1},d(d){d&&ce(e),J(t),J(l),i[35](null),_(),i[37](null)}}}function _i(i){let e,t;return e=new _t({props:{unpadded_box:!0,size:"large",$$slots:{default:[di]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(n,s){y(e,n,s),t=!0},p(n,s){const l={};s[1]&1024&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){B(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function $t(i){let e,t,n;function s(r){i[29](r)}let l={container:i[17]};return i[20]!==void 0&&(l.is_full_screen=i[20]),e=new sn({props:l}),ge.push(()=>Te(e,"is_full_screen",s)),{c(){H(e.$$.fragment)},m(r,u){y(e,r,u),n=!0},p(r,u){const o={};u[0]&131072&&(o.container=r[17]),!t&&u[0]&1048576&&(t=!0,o.is_full_screen=r[20],Me(()=>t=!1)),e.$set(o)},i(r){n||(C(e.$$.fragment,r),n=!0)},o(r){B(e.$$.fragment,r),n=!1},d(r){J(e,r)}}}function Xt(i){let e,t;return e=new Bt({props:{href:i[1][1]?.url,download:i[1][1]?.orig_name||"image",$$slots:{default:[fi]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(n,s){y(e,n,s),t=!0},p(n,s){const l={};s[0]&2&&(l.href=n[1][1]?.url),s[0]&2&&(l.download=n[1][1]?.orig_name||"image"),s[0]&64|s[1]&1024&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){B(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function fi(i){let e,t;return e=new Ie({props:{Icon:Lt,label:i[6]("common.download")}}),{c(){H(e.$$.fragment)},m(n,s){y(e,n,s),t=!0},p(n,s){const l={};s[0]&64&&(l.label=n[6]("common.download")),e.$set(l)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){B(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function Yt(i){let e,t;return e=new Ie({props:{Icon:It,label:"Remove Image"}}),e.$on("click",i[30]),{c(){H(e.$$.fragment)},m(n,s){y(e,n,s),t=!0},p:li,i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){B(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function ci(i){let e,t,n,s,l,r;e=new Ie({props:{Icon:ln,label:i[6]("common.undo"),disabled:i[16].z===1}}),e.$on("click",i[28]);let u=i[10]&&$t(i),o=i[4]&&Xt(i),_=i[12]&&Yt(i);return{c(){H(e.$$.fragment),t=ke(),u&&u.c(),n=ke(),o&&o.c(),s=ke(),_&&_.c(),l=Ot()},m(a,f){y(e,a,f),he(a,t,f),u&&u.m(a,f),he(a,n,f),o&&o.m(a,f),he(a,s,f),_&&_.m(a,f),he(a,l,f),r=!0},p(a,f){const h={};f[0]&64&&(h.label=a[6]("common.undo")),f[0]&65536&&(h.disabled=a[16].z===1),e.$set(h),a[10]?u?(u.p(a,f),f[0]&1024&&C(u,1)):(u=$t(a),u.c(),C(u,1),u.m(n.parentNode,n)):u&&(Ne(),B(u,1,1,()=>{u=null}),Ue()),a[4]?o?(o.p(a,f),f[0]&16&&C(o,1)):(o=Xt(a),o.c(),C(o,1),o.m(s.parentNode,s)):o&&(Ne(),B(o,1,1,()=>{o=null}),Ue()),a[12]?_?(_.p(a,f),f[0]&4096&&C(_,1)):(_=Yt(a),_.c(),C(_,1),_.m(l.parentNode,l)):_&&(Ne(),B(_,1,1,()=>{_=null}),Ue())},i(a){r||(C(e.$$.fragment,a),C(u),C(o),C(_),r=!0)},o(a){B(e.$$.fragment,a),B(u),B(o),B(_),r=!1},d(a){a&&(ce(t),ce(n),ce(s),ce(l)),J(e,a),u&&u.d(a),o&&o.d(a),_&&_.d(a)}}}function hi(i){let e,t,n,s,l;function r(o){i[31](o)}let u={src:i[1]?.[0]?.url,alt:"",loading:"lazy",variant:"preview",transform:"translate("+i[16].x+"px, "+i[16].y+"px) scale("+i[16].z+")",fullscreen:i[20],max_height:i[11]};return i[13]!==void 0&&(u.img_el=i[13]),e=new Oe({props:u}),ge.push(()=>Te(e,"img_el",r)),e.$on("load",i[25]),s=new Oe({props:{variant:"preview",fixed:i[7],hidden:!i[1]?.[1]?.url,src:i[1]?.[1]?.url,alt:"",loading:"lazy",style:i[22],transform:"translate("+i[16].x+"px, "+i[16].y+"px) scale("+i[16].z+")",fullscreen:i[20],max_height:i[11]}}),s.$on("load",i[25]),{c(){H(e.$$.fragment),n=ke(),H(s.$$.fragment)},m(o,_){y(e,o,_),he(o,n,_),y(s,o,_),l=!0},p(o,_){const a={};_[0]&2&&(a.src=o[1]?.[0]?.url),_[0]&65536&&(a.transform="translate("+o[16].x+"px, "+o[16].y+"px) scale("+o[16].z+")"),_[0]&1048576&&(a.fullscreen=o[20]),_[0]&2048&&(a.max_height=o[11]),!t&&_[0]&8192&&(t=!0,a.img_el=o[13],Me(()=>t=!1)),e.$set(a);const f={};_[0]&128&&(f.fixed=o[7]),_[0]&2&&(f.hidden=!o[1]?.[1]?.url),_[0]&2&&(f.src=o[1]?.[1]?.url),_[0]&4194304&&(f.style=o[22]),_[0]&65536&&(f.transform="translate("+o[16].x+"px, "+o[16].y+"px) scale("+o[16].z+")"),_[0]&1048576&&(f.fullscreen=o[20]),_[0]&2048&&(f.max_height=o[11]),s.$set(f)},i(o){l||(C(e.$$.fragment,o),C(s.$$.fragment,o),l=!0)},o(o){B(e.$$.fragment,o),B(s.$$.fragment,o),l=!1},d(o){o&&ce(n),J(e,o),J(s,o)}}}function di(i){let e,t;return e=new Le({}),{c(){H(e.$$.fragment)},m(n,s){y(e,n,s),t=!0},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){B(e.$$.fragment,n),t=!1},d(n){J(e,n)}}}function gi(i){let e,t,n,s,l,r;e=new Rt({props:{show_label:i[5],Icon:Le,label:i[3]||i[6]("image.image")}});const u=[_i,ui],o=[];function _(a,f){return(a[1]===null||a[1][0]===null||a[1][1]===null)&&!a[8]?0:1}return n=_(i),s=o[n]=u[n](i),{c(){H(e.$$.fragment),t=ke(),s.c(),l=Ot()},m(a,f){y(e,a,f),he(a,t,f),o[n].m(a,f),he(a,l,f),r=!0},p(a,f){const h={};f[0]&32&&(h.show_label=a[5]),f[0]&72&&(h.label=a[3]||a[6]("image.image")),e.$set(h);let b=n;n=_(a),n===b?o[n].p(a,f):(Ne(),B(o[b],1,1,()=>{o[b]=null}),Ue(),s=o[n],s?s.p(a,f):(s=o[n]=u[n](a),s.c()),C(s,1),s.m(l.parentNode,l))},i(a){r||(C(e.$$.fragment,a),C(s),r=!0)},o(a){B(e.$$.fragment,a),B(s),r=!1},d(a){a&&(ce(t),ce(l)),J(e,a),o[n].d(a)}}}function mi(i,e,t,n,s,l){return(i*t+n-s)/l/e}function bi(i,e,t){let n,s,l,{value:r=[null,null]}=e,{label:u=void 0}=e,{show_download_button:o=!0}=e,{show_label:_}=e,{i18n:a}=e,{position:f}=e,{layer_images:h=!0}=e,{show_single:b=!1}=e,{slider_color:g}=e,{show_fullscreen_button:d=!0}=e,{el_width:w=0}=e,{max_height:$}=e,{interactive:z=!0}=e;const D=ai();let m,X,Y,E=fn({x:0,y:0,z:1},{duration:75});ii(i,E,v=>t(16,l=v));let M,c=0,q=null,L=null;function I(v,de){!v||!de||(q?.destroy(),L?.disconnect(),v?.getBoundingClientRect().width,t(26,c=de?.getBoundingClientRect().width||0),t(19,q=new xn(de,v)),q.subscribe(({x:Ee,y:ae,scale:et})=>{E.set({x:Ee,y:ae,z:et})}),L=new ResizeObserver(Ee=>{for(const ae of Ee)ae.target===de&&t(26,c=ae.contentRect.width),ae.target===v&&ae.contentRect.width}),L.observe(de),L.observe(v))}ri(()=>()=>{q?.destroy(),L?.disconnect()});let P=!1,U,Q={top:0,left:0,width:0,height:0};function se(v){t(15,Q=v.detail)}const re=()=>q?.reset_zoom();function k(v){P=v,t(20,P)}const x=v=>{t(1,r=[null,null]),D("clear"),v.stopPropagation()};function F(v){m=v,t(13,m)}function Ge(v){f=v,t(0,f)}function Ve(v){X=v,t(14,X)}function Ke(v){M=v,t(18,M)}function Ze(v){ge[v?"unshift":"push"](()=>{U=v,t(21,U)})}function Qe(){w=this.clientWidth,t(2,w)}function xe(v){ge[v?"unshift":"push"](()=>{Y=v,t(17,Y)})}return i.$$set=v=>{"value"in v&&t(1,r=v.value),"label"in v&&t(3,u=v.label),"show_download_button"in v&&t(4,o=v.show_download_button),"show_label"in v&&t(5,_=v.show_label),"i18n"in v&&t(6,a=v.i18n),"position"in v&&t(0,f=v.position),"layer_images"in v&&t(7,h=v.layer_images),"show_single"in v&&t(8,b=v.show_single),"slider_color"in v&&t(9,g=v.slider_color),"show_fullscreen_button"in v&&t(10,d=v.show_fullscreen_button),"el_width"in v&&t(2,w=v.el_width),"max_height"in v&&t(11,$=v.max_height),"interactive"in v&&t(12,z=v.interactive)},i.$$.update=()=>{i.$$.dirty[0]&67207169&&t(27,n=mi(f,c,Q.width,Q.left,l.x,l.z)),i.$$.dirty[0]&134217856&&t(22,s=h?`clip-path: inset(0 0 0 ${n*100}%)`:""),i.$$.dirty[0]&24576&&I(m,X)},[f,r,w,u,o,_,a,h,b,g,d,$,z,m,X,Q,l,Y,M,q,P,U,s,D,E,se,c,n,re,k,x,F,Ge,Ve,Ke,Ze,Qe,xe]}class pi extends ei{constructor(e){super(),si(this,e,bi,gi,oi,{value:1,label:3,show_download_button:4,show_label:5,i18n:6,position:0,layer_images:7,show_single:8,slider_color:9,show_fullscreen_button:10,el_width:2,max_height:11,interactive:12},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),O()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),O()}get show_download_button(){return this.$$.ctx[4]}set show_download_button(e){this.$$set({show_download_button:e}),O()}get show_label(){return this.$$.ctx[5]}set show_label(e){this.$$set({show_label:e}),O()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),O()}get position(){return this.$$.ctx[0]}set position(e){this.$$set({position:e}),O()}get layer_images(){return this.$$.ctx[7]}set layer_images(e){this.$$set({layer_images:e}),O()}get show_single(){return this.$$.ctx[8]}set show_single(e){this.$$set({show_single:e}),O()}get slider_color(){return this.$$.ctx[9]}set slider_color(e){this.$$set({slider_color:e}),O()}get show_fullscreen_button(){return this.$$.ctx[10]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),O()}get el_width(){return this.$$.ctx[2]}set el_width(e){this.$$set({el_width:e}),O()}get max_height(){return this.$$.ctx[11]}set max_height(e){this.$$set({max_height:e}),O()}get interactive(){return this.$$.ctx[12]}set interactive(e){this.$$set({interactive:e}),O()}}const{SvelteComponent:wi,attr:vi,create_component:ki,destroy_component:zi,detach:$i,element:Xi,init:Yi,insert:Ei,mount_component:Mi,noop:Ti,safe_not_equal:Di,transition_in:Si,transition_out:Ci}=window.__gradio__svelte__internal,{createEventDispatcher:Ri}=window.__gradio__svelte__internal;function Ii(i){let e,t,n;return t=new Ie({props:{Icon:It,label:"Remove Image"}}),t.$on("click",i[1]),{c(){e=Xi("div"),ki(t.$$.fragment),vi(e,"class","svelte-s6ybro")},m(s,l){Ei(s,e,l),Mi(t,e,null),n=!0},p:Ti,i(s){n||(Si(t.$$.fragment,s),n=!0)},o(s){Ci(t.$$.fragment,s),n=!1},d(s){s&&$i(e),zi(t)}}}function Li(i){const e=Ri();return[e,n=>{e("remove_image"),n.stopPropagation()}]}class Bi extends wi{constructor(e){super(),Yi(this,e,Li,Ii,Di,{})}}const{SvelteComponent:qi,add_flush_callback:Ae,add_iframe_resize_listener:Pi,add_render_callback:Ui,append:rt,attr:ze,bind:Fe,binding_callbacks:He,check_outros:Ce,create_component:V,create_slot:jt,destroy_component:K,detach:$e,element:Be,flush:W,get_all_dirty_from_scope:At,get_slot_changes:Ft,group_outros:Re,init:Ni,insert:Xe,mount_component:Z,noop:Ht,safe_not_equal:Wi,set_style:we,space:We,toggle_class:Ye,transition_in:T,transition_out:R,update_slot_base:Jt}=window.__gradio__svelte__internal,{createEventDispatcher:Oi,tick:ji}=window.__gradio__svelte__internal;function Et(i){let e,t;return e=new Bi({}),e.$on("remove_image",i[22]),{c(){V(e.$$.fragment)},m(n,s){Z(e,n,s),t=!0},p:Ht,i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Mt(i){let e,t,n=i[7]&&Tt(i);return{c(){e=Be("div"),n&&n.c(),ze(e,"class","icon-buttons svelte-143b07a")},m(s,l){Xe(s,e,l),n&&n.m(e,null),t=!0},p(s,l){s[7]?n?(n.p(s,l),l&128&&T(n,1)):(n=Tt(s),n.c(),T(n,1),n.m(e,null)):n&&(Re(),R(n,1,1,()=>{n=null}),Ce())},i(s){t||(T(n),t=!0)},o(s){R(n),t=!1},d(s){s&&$e(e),n&&n.d()}}}function Tt(i){let e,t;return e=new Bt({props:{href:i[0][1].url,download:i[0][1].orig_name||"image",$$slots:{default:[Ai]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,s){Z(e,n,s),t=!0},p(n,s){const l={};s&1&&(l.href=n[0][1].url),s&1&&(l.download=n[0][1].orig_name||"image"),s&1073741824&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Ai(i){let e,t;return e=new Ie({props:{Icon:Lt}}),{c(){V(e.$$.fragment)},m(n,s){Z(e,n,s),t=!0},p:Ht,i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Fi(i){let e,t,n;function s(r){i[25](r)}let l={variant:"upload",src:i[14][0]?.url,alt:"",max_height:i[13]};return i[15]!==void 0&&(l.img_el=i[15]),e=new Oe({props:l}),He.push(()=>Fe(e,"img_el",s)),{c(){V(e.$$.fragment)},m(r,u){Z(e,r,u),n=!0},p(r,u){const o={};u&16384&&(o.src=r[14][0]?.url),u&8192&&(o.max_height=r[13]),!t&&u&32768&&(t=!0,o.img_el=r[15],Ae(()=>t=!1)),e.$set(o)},i(r){n||(T(e.$$.fragment,r),n=!0)},o(r){R(e.$$.fragment,r),n=!1},d(r){K(e,r)}}}function Hi(i){let e,t,n,s;function l(u){i[23](u)}let r={filetype:"image/*",disable_click:!!i[0]?.[0],root:i[5],file_count:"multiple",upload:i[9],stream_handler:i[10],max_file_size:i[11],$$slots:{default:[Ji]},$$scope:{ctx:i}};return i[1]!==void 0&&(r.dragging=i[1]),t=new Pt({props:r}),He.push(()=>Fe(t,"dragging",l)),t.$on("load",i[24]),{c(){e=Be("div"),V(t.$$.fragment),ze(e,"class","wrap svelte-143b07a"),Ye(e,"half-wrap",i[6]===1)},m(u,o){Xe(u,e,o),Z(t,e,null),s=!0},p(u,o){const _={};o&1&&(_.disable_click=!!u[0]?.[0]),o&32&&(_.root=u[5]),o&512&&(_.upload=u[9]),o&1024&&(_.stream_handler=u[10]),o&2048&&(_.max_file_size=u[11]),o&1073741824&&(_.$$scope={dirty:o,ctx:u}),!n&&o&2&&(n=!0,_.dragging=u[1],Ae(()=>n=!1)),t.$set(_),(!s||o&64)&&Ye(e,"half-wrap",u[6]===1)},i(u){s||(T(t.$$.fragment,u),s=!0)},o(u){R(t.$$.fragment,u),s=!1},d(u){u&&$e(e),K(t)}}}function Ji(i){let e;const t=i[21].default,n=jt(t,i,i[30],null);return{c(){n&&n.c()},m(s,l){n&&n.m(s,l),e=!0},p(s,l){n&&n.p&&(!e||l&1073741824)&&Jt(n,t,s,s[30],e?Ft(t,s[30],l,null):At(s[30]),null)},i(s){e||(T(n,s),e=!0)},o(s){R(n,s),e=!1},d(s){n&&n.d(s)}}}function yi(i){let e,t;return e=new Oe({props:{variant:"upload",src:i[14][1].url,alt:"",fixed:i[6]===1,transform:"translate(0px, 0px) scale(1)",max_height:i[13]}}),{c(){V(e.$$.fragment)},m(n,s){Z(e,n,s),t=!0},p(n,s){const l={};s&16384&&(l.src=n[14][1].url),s&64&&(l.fixed=n[6]===1),s&8192&&(l.max_height=n[13]),e.$set(l)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Gi(i){let e,t,n=`${i[16]*(1-i[2])}px`,s=`translateX(${i[16]*i[2]}px)`,l;return t=new _t({props:{unpadded_box:!0,size:"large",$$slots:{default:[Ki]},$$scope:{ctx:i}}}),{c(){e=Be("div"),V(t.$$.fragment),ze(e,"class","empty-wrap fixed svelte-143b07a"),Ye(e,"white-icon",!i[0]?.[0]?.url),we(e,"width",n),we(e,"transform",s)},m(r,u){Xe(r,e,u),Z(t,e,null),l=!0},p(r,u){const o={};u&1073741824&&(o.$$scope={dirty:u,ctx:r}),t.$set(o),(!l||u&1)&&Ye(e,"white-icon",!r[0]?.[0]?.url),u&65540&&n!==(n=`${r[16]*(1-r[2])}px`)&&we(e,"width",n),u&65540&&s!==(s=`translateX(${r[16]*r[2]}px)`)&&we(e,"transform",s)},i(r){l||(T(t.$$.fragment,r),l=!0)},o(r){R(t.$$.fragment,r),l=!1},d(r){r&&$e(e),K(t)}}}function Vi(i){let e,t,n;function s(r){i[26](r)}let l={filetype:"image/*",disable_click:!!i[0]?.[1],root:i[5],file_count:"multiple",upload:i[9],stream_handler:i[10],max_file_size:i[11],$$slots:{default:[Zi]},$$scope:{ctx:i}};return i[1]!==void 0&&(l.dragging=i[1]),e=new Pt({props:l}),He.push(()=>Fe(e,"dragging",s)),e.$on("load",i[27]),{c(){V(e.$$.fragment)},m(r,u){Z(e,r,u),n=!0},p(r,u){const o={};u&1&&(o.disable_click=!!r[0]?.[1]),u&32&&(o.root=r[5]),u&512&&(o.upload=r[9]),u&1024&&(o.stream_handler=r[10]),u&2048&&(o.max_file_size=r[11]),u&1073741824&&(o.$$scope={dirty:u,ctx:r}),!t&&u&2&&(t=!0,o.dragging=r[1],Ae(()=>t=!1)),e.$set(o)},i(r){n||(T(e.$$.fragment,r),n=!0)},o(r){R(e.$$.fragment,r),n=!1},d(r){K(e,r)}}}function Ki(i){let e,t;return e=new Le({}),{c(){V(e.$$.fragment)},m(n,s){Z(e,n,s),t=!0},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Zi(i){let e;const t=i[21].default,n=jt(t,i,i[30],null);return{c(){n&&n.c()},m(s,l){n&&n.m(s,l),e=!0},p(s,l){n&&n.p&&(!e||l&1073741824)&&Jt(n,t,s,s[30],e?Ft(t,s[30],l,null):At(s[30]),null)},i(s){e||(T(n,s),e=!0)},o(s){R(n,s),e=!1},d(s){n&&n.d(s)}}}function Qi(i){let e,t,n,s,l,r,u;const o=[Hi,Fi],_=[];function a(g,d){return g[14]?.[0]?1:0}t=a(i),n=_[t]=o[t](i);const f=[Vi,Gi,yi],h=[];function b(g,d){return!g[14]?.[1]&&g[6]===2?0:!g[14]?.[1]&&g[6]===1?1:g[14]?.[1]?2:-1}return~(l=b(i))&&(r=h[l]=f[l](i)),{c(){e=Be("div"),n.c(),s=We(),r&&r.c(),ze(e,"class","upload-wrap svelte-143b07a"),Ye(e,"side-by-side",i[6]===2),we(e,"display",i[6]===2?"flex":"block")},m(g,d){Xe(g,e,d),_[t].m(e,null),rt(e,s),~l&&h[l].m(e,null),u=!0},p(g,d){let w=t;t=a(g),t===w?_[t].p(g,d):(Re(),R(_[w],1,1,()=>{_[w]=null}),Ce(),n=_[t],n?n.p(g,d):(n=_[t]=o[t](g),n.c()),T(n,1),n.m(e,s));let $=l;l=b(g),l===$?~l&&h[l].p(g,d):(r&&(Re(),R(h[$],1,1,()=>{h[$]=null}),Ce()),~l?(r=h[l],r?r.p(g,d):(r=h[l]=f[l](g),r.c()),T(r,1),r.m(e,null)):r=null),(!u||d&64)&&Ye(e,"side-by-side",g[6]===2),d&64&&we(e,"display",g[6]===2?"flex":"block")},i(g){u||(T(n),T(r),u=!0)},o(g){R(n),R(r),u=!1},d(g){g&&$e(e),_[t].d(),~l&&h[l].d()}}}function xi(i){let e,t,n,s,l,r,u,o,_;e=new Rt({props:{show_label:i[4],Icon:Le,label:i[3]||i[12]("image.image")}});let a=(i[0]?.[0]?.url||i[0]?.[1]?.url)&&Et(i),f=i[0]?.[1]?.url&&Mt(i);function h(g){i[28](g)}let b={disabled:i[6]==2||!i[0]?.[0],slider_color:i[8],$$slots:{default:[Qi]},$$scope:{ctx:i}};return i[2]!==void 0&&(b.position=i[2]),r=new Wt({props:b}),He.push(()=>Fe(r,"position",h)),{c(){V(e.$$.fragment),t=We(),n=Be("div"),a&&a.c(),s=We(),f&&f.c(),l=We(),V(r.$$.fragment),ze(n,"data-testid","image"),ze(n,"class","image-container svelte-143b07a"),Ui(()=>i[29].call(n))},m(g,d){Z(e,g,d),Xe(g,t,d),Xe(g,n,d),a&&a.m(n,null),rt(n,s),f&&f.m(n,null),rt(n,l),Z(r,n,null),o=Pi(n,i[29].bind(n)),_=!0},p(g,[d]){const w={};d&16&&(w.show_label=g[4]),d&4104&&(w.label=g[3]||g[12]("image.image")),e.$set(w),g[0]?.[0]?.url||g[0]?.[1]?.url?a?(a.p(g,d),d&1&&T(a,1)):(a=Et(g),a.c(),T(a,1),a.m(n,s)):a&&(Re(),R(a,1,1,()=>{a=null}),Ce()),g[0]?.[1]?.url?f?(f.p(g,d),d&1&&T(f,1)):(f=Mt(g),f.c(),T(f,1),f.m(n,l)):f&&(Re(),R(f,1,1,()=>{f=null}),Ce());const $={};d&65&&($.disabled=g[6]==2||!g[0]?.[0]),d&256&&($.slider_color=g[8]),d&1073868391&&($.$$scope={dirty:d,ctx:g}),!u&&d&4&&(u=!0,$.position=g[2],Ae(()=>u=!1)),r.$set($)},i(g){_||(T(e.$$.fragment,g),T(a),T(f),T(r.$$.fragment,g),_=!0)},o(g){R(e.$$.fragment,g),R(a),R(f),R(r.$$.fragment,g),_=!1},d(g){g&&($e(t),$e(n)),K(e,g),a&&a.d(),f&&f.d(),K(r),o()}}}function es(i,e,t){let{$$slots:n={},$$scope:s}=e,{value:l}=e,{label:r=void 0}=e,{show_label:u}=e,{root:o}=e,{position:_}=e,{upload_count:a=2}=e,{show_download_button:f=!0}=e,{slider_color:h}=e,{upload:b}=e,{stream_handler:g}=e,{max_file_size:d=null}=e,{i18n:w}=e,{max_height:$}=e,z=l||[null,null],D,m,X;async function Y({detail:k},x){const F=[l[0],l[1]];k.length>1?F[x]=k[0]:F[x]=k[x],t(0,l=F),await ji(),M("upload",F)}let E="";const M=Oi();let{dragging:c=!1}=e;const q=()=>{t(2,_=.5),t(0,l=[null,null]),M("clear")};function L(k){c=k,t(1,c)}const I=k=>Y(k,0);function P(k){D=k,t(15,D)}function U(k){c=k,t(1,c)}const Q=k=>Y(k,1);function se(k){_=k,t(2,_)}function re(){m=this.clientWidth,X=this.clientHeight,t(16,m),t(17,X)}return i.$$set=k=>{"value"in k&&t(0,l=k.value),"label"in k&&t(3,r=k.label),"show_label"in k&&t(4,u=k.show_label),"root"in k&&t(5,o=k.root),"position"in k&&t(2,_=k.position),"upload_count"in k&&t(6,a=k.upload_count),"show_download_button"in k&&t(7,f=k.show_download_button),"slider_color"in k&&t(8,h=k.slider_color),"upload"in k&&t(9,b=k.upload),"stream_handler"in k&&t(10,g=k.stream_handler),"max_file_size"in k&&t(11,d=k.max_file_size),"i18n"in k&&t(12,w=k.i18n),"max_height"in k&&t(13,$=k.max_height),"dragging"in k&&t(1,c=k.dragging),"$$scope"in k&&t(30,s=k.$$scope)},i.$$.update=()=>{i.$$.dirty&1048577&&JSON.stringify(l)!==E&&(t(20,E=JSON.stringify(l)),t(14,z=l)),i.$$.dirty&2&&M("drag",c)},[l,c,_,r,u,o,a,f,h,b,g,d,w,$,z,D,m,X,Y,M,E,n,q,L,I,P,U,Q,se,re,s]}class ts extends qi{constructor(e){super(),Ni(this,e,es,xi,Wi,{value:0,label:3,show_label:4,root:5,position:2,upload_count:6,show_download_button:7,slider_color:8,upload:9,stream_handler:10,max_file_size:11,i18n:12,max_height:13,dragging:1})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),W()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),W()}get show_label(){return this.$$.ctx[4]}set show_label(e){this.$$set({show_label:e}),W()}get root(){return this.$$.ctx[5]}set root(e){this.$$set({root:e}),W()}get position(){return this.$$.ctx[2]}set position(e){this.$$set({position:e}),W()}get upload_count(){return this.$$.ctx[6]}set upload_count(e){this.$$set({upload_count:e}),W()}get show_download_button(){return this.$$.ctx[7]}set show_download_button(e){this.$$set({show_download_button:e}),W()}get slider_color(){return this.$$.ctx[8]}set slider_color(e){this.$$set({slider_color:e}),W()}get upload(){return this.$$.ctx[9]}set upload(e){this.$$set({upload:e}),W()}get stream_handler(){return this.$$.ctx[10]}set stream_handler(e){this.$$set({stream_handler:e}),W()}get max_file_size(){return this.$$.ctx[11]}set max_file_size(e){this.$$set({max_file_size:e}),W()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),W()}get max_height(){return this.$$.ctx[13]}set max_height(e){this.$$set({max_height:e}),W()}get dragging(){return this.$$.ctx[1]}set dragging(e){this.$$set({dragging:e}),W()}}const{SvelteComponent:ns,add_flush_callback:Dt,bind:St,binding_callbacks:Ct,bubble:pe,create_component:is,create_slot:ss,destroy_component:ls,flush:G,get_all_dirty_from_scope:os,get_slot_changes:rs,init:as,mount_component:us,safe_not_equal:_s,transition_in:yt,transition_out:Gt,update_slot_base:fs}=window.__gradio__svelte__internal;function cs(i){let e;const t=i[11].default,n=ss(t,i,i[21],null);return{c(){n&&n.c()},m(s,l){n&&n.m(s,l),e=!0},p(s,l){n&&n.p&&(!e||l&2097152)&&fs(n,t,s,s[21],e?rs(t,s[21],l,null):os(s[21]),null)},i(s){e||(yt(n,s),e=!0)},o(s){Gt(n,s),e=!1},d(s){n&&n.d(s)}}}function hs(i){let e,t,n,s;function l(o){i[12](o)}function r(o){i[13](o)}let u={slider_color:"var(--border-color-primary)",position:.5,root:i[7],label:i[4],show_label:i[5],upload_count:i[8],stream_handler:i[3],upload:i[2],max_file_size:i[10],max_height:i[9],i18n:i[6],$$slots:{default:[cs]},$$scope:{ctx:i}};return i[0]!==void 0&&(u.value=i[0]),i[1]!==void 0&&(u.dragging=i[1]),e=new ts({props:u}),Ct.push(()=>St(e,"value",l)),Ct.push(()=>St(e,"dragging",r)),e.$on("edit",i[14]),e.$on("clear",i[15]),e.$on("stream",i[16]),e.$on("drag",i[17]),e.$on("upload",i[18]),e.$on("select",i[19]),e.$on("share",i[20]),{c(){is(e.$$.fragment)},m(o,_){us(e,o,_),s=!0},p(o,[_]){const a={};_&128&&(a.root=o[7]),_&16&&(a.label=o[4]),_&32&&(a.show_label=o[5]),_&256&&(a.upload_count=o[8]),_&8&&(a.stream_handler=o[3]),_&4&&(a.upload=o[2]),_&1024&&(a.max_file_size=o[10]),_&512&&(a.max_height=o[9]),_&64&&(a.i18n=o[6]),_&2097152&&(a.$$scope={dirty:_,ctx:o}),!t&&_&1&&(t=!0,a.value=o[0],Dt(()=>t=!1)),!n&&_&2&&(n=!0,a.dragging=o[1],Dt(()=>n=!1)),e.$set(a)},i(o){s||(yt(e.$$.fragment,o),s=!0)},o(o){Gt(e.$$.fragment,o),s=!1},d(o){ls(e,o)}}}function ds(i,e,t){let{$$slots:n={},$$scope:s}=e,{value:l=[null,null]}=e,{upload:r}=e,{stream_handler:u}=e,{label:o}=e,{show_label:_}=e,{i18n:a}=e,{root:f}=e,{upload_count:h=1}=e,{dragging:b}=e,{max_height:g}=e,{max_file_size:d=null}=e;function w(c){l=c,t(0,l)}function $(c){b=c,t(1,b)}function z(c){pe.call(this,i,c)}function D(c){pe.call(this,i,c)}function m(c){pe.call(this,i,c)}const X=({detail:c})=>t(1,b=c);function Y(c){pe.call(this,i,c)}function E(c){pe.call(this,i,c)}function M(c){pe.call(this,i,c)}return i.$$set=c=>{"value"in c&&t(0,l=c.value),"upload"in c&&t(2,r=c.upload),"stream_handler"in c&&t(3,u=c.stream_handler),"label"in c&&t(4,o=c.label),"show_label"in c&&t(5,_=c.show_label),"i18n"in c&&t(6,a=c.i18n),"root"in c&&t(7,f=c.root),"upload_count"in c&&t(8,h=c.upload_count),"dragging"in c&&t(1,b=c.dragging),"max_height"in c&&t(9,g=c.max_height),"max_file_size"in c&&t(10,d=c.max_file_size),"$$scope"in c&&t(21,s=c.$$scope)},[l,b,r,u,o,_,a,f,h,g,d,n,w,$,z,D,m,X,Y,E,M,s]}class gs extends ns{constructor(e){super(),as(this,e,ds,hs,_s,{value:0,upload:2,stream_handler:3,label:4,show_label:5,i18n:6,root:7,upload_count:8,dragging:1,max_height:9,max_file_size:10})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),G()}get upload(){return this.$$.ctx[2]}set upload(e){this.$$set({upload:e}),G()}get stream_handler(){return this.$$.ctx[3]}set stream_handler(e){this.$$set({stream_handler:e}),G()}get label(){return this.$$.ctx[4]}set label(e){this.$$set({label:e}),G()}get show_label(){return this.$$.ctx[5]}set show_label(e){this.$$set({show_label:e}),G()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),G()}get root(){return this.$$.ctx[7]}set root(e){this.$$set({root:e}),G()}get upload_count(){return this.$$.ctx[8]}set upload_count(e){this.$$set({upload_count:e}),G()}get dragging(){return this.$$.ctx[1]}set dragging(e){this.$$set({dragging:e}),G()}get max_height(){return this.$$.ctx[9]}set max_height(e){this.$$set({max_height:e}),G()}get max_file_size(){return this.$$.ctx[10]}set max_file_size(e){this.$$set({max_file_size:e}),G()}}const{SvelteComponent:ms,add_flush_callback:at,assign:Vt,bind:ut,binding_callbacks:je,check_outros:bs,create_component:te,destroy_component:ne,detach:Je,empty:Kt,flush:S,get_spread_object:Zt,get_spread_update:Qt,group_outros:ps,init:ws,insert:ye,mount_component:ie,safe_not_equal:vs,space:xt,transition_in:j,transition_out:A}=window.__gradio__svelte__internal,{afterUpdate:ks}=window.__gradio__svelte__internal;function zs(i){let e,t;return e=new Ut({props:{visible:i[4],variant:i[0]===null?"dashed":"solid",border_mode:i[21]?"focus":"base",padding:!1,elem_id:i[2],elem_classes:i[3],height:i[9]||void 0,width:i[10],allow_overflow:!1,container:i[11],scale:i[12],min_width:i[13],$$slots:{default:[Ds]},$$scope:{ctx:i}}}),e.$on("dragenter",i[24]),e.$on("dragleave",i[24]),e.$on("dragover",i[24]),e.$on("drop",i[25]),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},p(n,s){const l={};s[0]&16&&(l.visible=n[4]),s[0]&1&&(l.variant=n[0]===null?"dashed":"solid"),s[0]&2097152&&(l.border_mode=n[21]?"focus":"base"),s[0]&4&&(l.elem_id=n[2]),s[0]&8&&(l.elem_classes=n[3]),s[0]&512&&(l.height=n[9]||void 0),s[0]&1024&&(l.width=n[10]),s[0]&2048&&(l.container=n[11]),s[0]&4096&&(l.scale=n[12]),s[0]&8192&&(l.min_width=n[13]),s[0]&8028515|s[1]&32768&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function $s(i){let e,t;return e=new Ut({props:{visible:i[4],variant:"solid",border_mode:i[21]?"focus":"base",padding:!1,elem_id:i[2],elem_classes:i[3],height:i[9]||void 0,width:i[10],allow_overflow:!1,container:i[11],scale:i[12],min_width:i[13],$$slots:{default:[Ss]},$$scope:{ctx:i}}}),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},p(n,s){const l={};s[0]&16&&(l.visible=n[4]),s[0]&2097152&&(l.border_mode=n[21]?"focus":"base"),s[0]&4&&(l.elem_id=n[2]),s[0]&8&&(l.elem_classes=n[3]),s[0]&512&&(l.height=n[9]||void 0),s[0]&1024&&(l.width=n[10]),s[0]&2048&&(l.container=n[11]),s[0]&4096&&(l.scale=n[12]),s[0]&8192&&(l.min_width=n[13]),s[0]&10305763|s[1]&32768&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function Xs(i){let e,t;return e=new _t({props:{unpadded_box:!0,size:"large",$$slots:{default:[Ms]},$$scope:{ctx:i}}}),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},p(n,s){const l={};s[1]&32768&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function Ys(i){let e,t;return e=new Nt({props:{i18n:i[20].i18n,type:"clipboard",mode:"short"}}),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},p(n,s){const l={};s[0]&1048576&&(l.i18n=n[20].i18n),e.$set(l)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function Es(i){let e,t;return e=new Nt({props:{i18n:i[20].i18n,type:"image",placeholder:i[15]}}),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},p(n,s){const l={};s[0]&1048576&&(l.i18n=n[20].i18n),s[0]&32768&&(l.placeholder=n[15]),e.$set(l)},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function Ms(i){let e,t;return e=new Le({}),{c(){te(e.$$.fragment)},m(n,s){ie(e,n,s),t=!0},i(n){t||(j(e.$$.fragment,n),t=!0)},o(n){A(e.$$.fragment,n),t=!1},d(n){ne(e,n)}}}function Ts(i){let e,t,n,s;const l=[Es,Ys,Xs],r=[];function u(o,_){return 0}return e=u(),t=r[e]=l[e](i),{c(){t.c(),n=Kt()},m(o,_){r[e].m(o,_),ye(o,n,_),s=!0},p(o,_){t.p(o,_)},i(o){s||(j(t),s=!0)},o(o){A(t),s=!1},d(o){o&&Je(n),r[e].d(o)}}}function Ds(i){let e,t,n,s,l,r;const u=[{autoscroll:i[20].autoscroll},{i18n:i[20].i18n},i[1]];let o={};for(let h=0;h<u.length;h+=1)o=Vt(o,u[h]);e=new qt({props:o}),e.$on("clear_status",i[35]);function _(h){i[38](h)}function a(h){i[39](h)}let f={root:i[8],label:i[5],show_label:i[6],upload_count:i[17],max_file_size:i[20].max_file_size,i18n:i[20].i18n,upload:i[36],stream_handler:i[20].client?.stream,max_height:i[19],$$slots:{default:[Ts]},$$scope:{ctx:i}};return i[0]!==void 0&&(f.value=i[0]),i[21]!==void 0&&(f.dragging=i[21]),n=new gs({props:f}),i[37](n),je.push(()=>ut(n,"value",_)),je.push(()=>ut(n,"dragging",a)),n.$on("edit",i[40]),n.$on("clear",i[41]),n.$on("drag",i[42]),n.$on("upload",i[43]),n.$on("error",i[44]),n.$on("close_stream",i[45]),{c(){te(e.$$.fragment),t=xt(),te(n.$$.fragment)},m(h,b){ie(e,h,b),ye(h,t,b),ie(n,h,b),r=!0},p(h,b){const g=b[0]&1048578?Qt(u,[b[0]&1048576&&{autoscroll:h[20].autoscroll},b[0]&1048576&&{i18n:h[20].i18n},b[0]&2&&Zt(h[1])]):{};e.$set(g);const d={};b[0]&256&&(d.root=h[8]),b[0]&32&&(d.label=h[5]),b[0]&64&&(d.show_label=h[6]),b[0]&131072&&(d.upload_count=h[17]),b[0]&1048576&&(d.max_file_size=h[20].max_file_size),b[0]&1048576&&(d.i18n=h[20].i18n),b[0]&1048576&&(d.upload=h[36]),b[0]&1048576&&(d.stream_handler=h[20].client?.stream),b[0]&524288&&(d.max_height=h[19]),b[0]&1081344|b[1]&32768&&(d.$$scope={dirty:b,ctx:h}),!s&&b[0]&1&&(s=!0,d.value=h[0],at(()=>s=!1)),!l&&b[0]&2097152&&(l=!0,d.dragging=h[21],at(()=>l=!1)),n.$set(d)},i(h){r||(j(e.$$.fragment,h),j(n.$$.fragment,h),r=!0)},o(h){A(e.$$.fragment,h),A(n.$$.fragment,h),r=!1},d(h){h&&Je(t),ne(e,h),i[37](null),ne(n,h)}}}function Ss(i){let e,t,n,s,l;const r=[{autoscroll:i[20].autoscroll},{i18n:i[20].i18n},i[1]];let u={};for(let a=0;a<r.length;a+=1)u=Vt(u,r[a]);e=new qt({props:u});function o(a){i[30](a)}let _={interactive:i[14],label:i[5],show_label:i[6],show_download_button:i[7],i18n:i[20].i18n,show_fullscreen_button:i[16],position:i[23],slider_color:i[18],max_height:i[19]};return i[0]!==void 0&&(_.value=i[0]),n=new pi({props:_}),je.push(()=>ut(n,"value",o)),n.$on("select",i[31]),n.$on("share",i[32]),n.$on("error",i[33]),n.$on("clear",i[34]),{c(){te(e.$$.fragment),t=xt(),te(n.$$.fragment)},m(a,f){ie(e,a,f),ye(a,t,f),ie(n,a,f),l=!0},p(a,f){const h=f[0]&1048578?Qt(r,[f[0]&1048576&&{autoscroll:a[20].autoscroll},f[0]&1048576&&{i18n:a[20].i18n},f[0]&2&&Zt(a[1])]):{};e.$set(h);const b={};f[0]&16384&&(b.interactive=a[14]),f[0]&32&&(b.label=a[5]),f[0]&64&&(b.show_label=a[6]),f[0]&128&&(b.show_download_button=a[7]),f[0]&1048576&&(b.i18n=a[20].i18n),f[0]&65536&&(b.show_fullscreen_button=a[16]),f[0]&8388608&&(b.position=a[23]),f[0]&262144&&(b.slider_color=a[18]),f[0]&524288&&(b.max_height=a[19]),!s&&f[0]&1&&(s=!0,b.value=a[0],at(()=>s=!1)),n.$set(b)},i(a){l||(j(e.$$.fragment,a),j(n.$$.fragment,a),l=!0)},o(a){A(e.$$.fragment,a),A(n.$$.fragment,a),l=!1},d(a){a&&Je(t),ne(e,a),ne(n,a)}}}function Cs(i){let e,t,n,s;const l=[$s,zs],r=[];function u(o,_){return!o[14]||o[0]?.[1]&&o[0]?.[0]?0:1}return e=u(i),t=r[e]=l[e](i),{c(){t.c(),n=Kt()},m(o,_){r[e].m(o,_),ye(o,n,_),s=!0},p(o,_){let a=e;e=u(o),e===a?r[e].p(o,_):(ps(),A(r[a],1,1,()=>{r[a]=null}),bs(),t=r[e],t?t.p(o,_):(t=r[e]=l[e](o),t.c()),j(t,1),t.m(n.parentNode,n))},i(o){s||(j(t),s=!0)},o(o){A(t),s=!1},d(o){o&&Je(n),r[e].d(o)}}}let Rs=!1;function Is(i,e,t){let n,{value_is_output:s=!1}=e,{elem_id:l=""}=e,{elem_classes:r=[]}=e,{visible:u=!0}=e,{value:o=[null,null]}=e,_=[null,null],{label:a}=e,{show_label:f}=e,{show_download_button:h}=e,{root:b}=e,{height:g}=e,{width:d}=e,{container:w=!0}=e,{scale:$=null}=e,{min_width:z=void 0}=e,{loading_status:D}=e,{interactive:m}=e,{placeholder:X=void 0}=e,{show_fullscreen_button:Y}=e,{input_ready:E}=e,{slider_position:M}=e,{upload_count:c=1}=e,{slider_color:q="var(--border-color-primary)"}=e,{max_height:L}=e,{gradio:I}=e;ks(()=>{t(26,s=!1)});let P,U;const Q=p=>{const le=p;le.preventDefault(),le.stopPropagation(),le.type==="dragenter"||le.type==="dragover"?t(21,P=!0):le.type==="dragleave"&&t(21,P=!1)},se=p=>{if(m){const le=p;le.preventDefault(),le.stopPropagation(),t(21,P=!1),U&&U.loadFilesFromDrop(le)}};function re(p){o=p,t(0,o)}const k=({detail:p})=>I.dispatch("select",p),x=({detail:p})=>I.dispatch("share",p),F=({detail:p})=>I.dispatch("error",p),Ge=()=>I.dispatch("clear"),Ve=()=>I.dispatch("clear_status",D),Ke=(...p)=>I.client.upload(...p);function Ze(p){je[p?"unshift":"push"](()=>{U=p,t(22,U)})}function Qe(p){o=p,t(0,o)}function xe(p){P=p,t(21,P)}const v=()=>I.dispatch("edit"),de=()=>{I.dispatch("clear")},Ee=({detail:p})=>t(21,P=p),ae=()=>I.dispatch("upload"),et=({detail:p})=>{t(1,D=D||{}),t(1,D.status="error",D),I.dispatch("error",p)},en=()=>{I.dispatch("close_stream","stream")};return i.$$set=p=>{"value_is_output"in p&&t(26,s=p.value_is_output),"elem_id"in p&&t(2,l=p.elem_id),"elem_classes"in p&&t(3,r=p.elem_classes),"visible"in p&&t(4,u=p.visible),"value"in p&&t(0,o=p.value),"label"in p&&t(5,a=p.label),"show_label"in p&&t(6,f=p.show_label),"show_download_button"in p&&t(7,h=p.show_download_button),"root"in p&&t(8,b=p.root),"height"in p&&t(9,g=p.height),"width"in p&&t(10,d=p.width),"container"in p&&t(11,w=p.container),"scale"in p&&t(12,$=p.scale),"min_width"in p&&t(13,z=p.min_width),"loading_status"in p&&t(1,D=p.loading_status),"interactive"in p&&t(14,m=p.interactive),"placeholder"in p&&t(15,X=p.placeholder),"show_fullscreen_button"in p&&t(16,Y=p.show_fullscreen_button),"input_ready"in p&&t(27,E=p.input_ready),"slider_position"in p&&t(28,M=p.slider_position),"upload_count"in p&&t(17,c=p.upload_count),"slider_color"in p&&t(18,q=p.slider_color),"max_height"in p&&t(19,L=p.max_height),"gradio"in p&&t(20,I=p.gradio)},i.$$.update=()=>{i.$$.dirty[0]&268435456&&t(23,n=Math.max(0,Math.min(100,M))/100),i.$$.dirty[0]&605028353&&JSON.stringify(o)!==JSON.stringify(_)&&(t(29,_=o),I.dispatch("change"),s||I.dispatch("input"))},t(27,E=!Rs),[o,D,l,r,u,a,f,h,b,g,d,w,$,z,m,X,Y,c,q,L,I,P,U,n,Q,se,s,E,M,_,re,k,x,F,Ge,Ve,Ke,Ze,Qe,xe,v,de,Ee,ae,et,en]}class sl extends ms{constructor(e){super(),ws(this,e,Is,Cs,vs,{value_is_output:26,elem_id:2,elem_classes:3,visible:4,value:0,label:5,show_label:6,show_download_button:7,root:8,height:9,width:10,container:11,scale:12,min_width:13,loading_status:1,interactive:14,placeholder:15,show_fullscreen_button:16,input_ready:27,slider_position:28,upload_count:17,slider_color:18,max_height:19,gradio:20},null,[-1,-1])}get value_is_output(){return this.$$.ctx[26]}set value_is_output(e){this.$$set({value_is_output:e}),S()}get elem_id(){return this.$$.ctx[2]}set elem_id(e){this.$$set({elem_id:e}),S()}get elem_classes(){return this.$$.ctx[3]}set elem_classes(e){this.$$set({elem_classes:e}),S()}get visible(){return this.$$.ctx[4]}set visible(e){this.$$set({visible:e}),S()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),S()}get label(){return this.$$.ctx[5]}set label(e){this.$$set({label:e}),S()}get show_label(){return this.$$.ctx[6]}set show_label(e){this.$$set({show_label:e}),S()}get show_download_button(){return this.$$.ctx[7]}set show_download_button(e){this.$$set({show_download_button:e}),S()}get root(){return this.$$.ctx[8]}set root(e){this.$$set({root:e}),S()}get height(){return this.$$.ctx[9]}set height(e){this.$$set({height:e}),S()}get width(){return this.$$.ctx[10]}set width(e){this.$$set({width:e}),S()}get container(){return this.$$.ctx[11]}set container(e){this.$$set({container:e}),S()}get scale(){return this.$$.ctx[12]}set scale(e){this.$$set({scale:e}),S()}get min_width(){return this.$$.ctx[13]}set min_width(e){this.$$set({min_width:e}),S()}get loading_status(){return this.$$.ctx[1]}set loading_status(e){this.$$set({loading_status:e}),S()}get interactive(){return this.$$.ctx[14]}set interactive(e){this.$$set({interactive:e}),S()}get placeholder(){return this.$$.ctx[15]}set placeholder(e){this.$$set({placeholder:e}),S()}get show_fullscreen_button(){return this.$$.ctx[16]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),S()}get input_ready(){return this.$$.ctx[27]}set input_ready(e){this.$$set({input_ready:e}),S()}get slider_position(){return this.$$.ctx[28]}set slider_position(e){this.$$set({slider_position:e}),S()}get upload_count(){return this.$$.ctx[17]}set upload_count(e){this.$$set({upload_count:e}),S()}get slider_color(){return this.$$.ctx[18]}set slider_color(e){this.$$set({slider_color:e}),S()}get max_height(){return this.$$.ctx[19]}set max_height(e){this.$$set({max_height:e}),S()}get gradio(){return this.$$.ctx[20]}set gradio(e){this.$$set({gradio:e}),S()}}export{sl as default}; 2//# sourceMappingURL=Index-u4lY7hkr.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.