vendor: 5,793 bytes, line 1
1import{w as _t,p as h,e as Re,s as Pe,d as be,b as ze,f as Xe,l as Ve,c as ft,S as mt,C as pt,i as ee,q as vt,m as bt,r as wt,g as qe}from"./i18n-eTakDDhg.js";import{R as ye,aa as Ge,w as l,a1 as we,G as P,a2 as He,Z as tt,aw as yt,V as ie,Y as ne,X as N,a8 as xt,x as D,t as Me,a as A,T as xe,a3 as O,U as g,W as Z,a4 as Be,M as Ne,_ as zt,S as te,z as k,ad as H,a6 as ve,u as Se,v as Yt,y as Xt,a5 as de}from"./index-BkylzejB.js";import{G as Mt}from"./utils.svelte-DZ62NrTu.js";import{b as Oe}from"./size-oyICZHuE.js";import{b as pe}from"./misc-Q1bfX-rj.js";import{s as Te}from"./select-BigU4G0v.js";import{d as Et}from"./dispatch-kxCwF96_.js";import{I as Ee}from"./ScrollFade.svelte_svelte_type_style_lang-De9nUaYy.js";import{B as rt}from"./BlockLabel-Da0UC1oT.js";import{D as st}from"./DownloadLink-Bx9WBqOo.js";import{E as it}from"./Empty-DQDlXvhE.js";import{C as nt}from"./Clear-Daql2pLY.js";import{D as at}from"./Download-CPfSgwpW.js";import{I as Le}from"./Image-D_any2zo.js";import{U as Tt}from"./Undo-glJl2cU-.js";import{I as Dt}from"./IconButtonWrapper-33oacT7w.js";import{F as Rt}from"./FullscreenButton-4wvwkSe5.js";import{r as kt,l as St}from"./StreamingBar.svelte_svelte_type_style_lang-CFNH9sqm.js";import{i as Je,S as Ze}from"./index-C-r_2iGV.js";import{U as Ke}from"./Upload-ri50JgFh.js";import{B as Qe}from"./Block-Bl_3z_UU.js";import{U as It}from"./UploadText-DeRpmmaX.js";import"./clone-IGppQJ7B.js";import"./snippet-CC9u6I34.js";import"./Maximize-B_CM6J2b.js";import"./html-DvOIMrhY.js";import"./index-B_pwUImq.js";import"./actions-CWv1ghz2.js";function Pt(i){return i}function $e(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 s=e.map((a,r)=>$e(i[r],a));return a=>s.map(r=>r(a))}if(t==="object"){if(!i||!e)throw new Error("Object cannot be null");if(Je(i)&&Je(e)){const r=i.getTime(),o=e.getTime()-r;return _=>new Date(r+_*o)}const s=Object.keys(e),a={};return s.forEach(r=>{a[r]=$e(i[r],e[r])}),r=>{const c={};return s.forEach(o=>{c[o]=a[o](r)}),c}}if(t==="number"){const s=e-i;return a=>i+a*s}return()=>e}function Lt(i,e={}){const t=_t(i);let s,a=i;function r(c,o){if(a=c,i==null)return t.set(i=c),Promise.resolve();let _=s,Y=!1,{delay:z=0,duration:x=400,easing:b=Pt,interpolate:S=$e}={...e,...o};if(x===0)return _&&(_.abort(),_=null),t.set(i=a),Promise.resolve();const B=kt.now()+z;let u;return s=St(m=>{if(m<B)return!0;Y||(u=S(i,c),typeof x=="function"&&(x=x(i,c)),Y=!0),_&&(_.abort(),_=null);const w=m-B;return w>x?(t.set(i=c),!1):(t.set(i=u(b(w/x))),!0)}),s.promise}return{set:r,update:(c,o)=>r(c(a,i),o),subscribe:t.subscribe}}function Ct(i){let e;for(;e=i.sourceEvent;)i=e;return i}function et(i,e){if(i=Ct(i),e===void 0&&(e=i.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var s=t.createSVGPoint();return s.x=i.clientX,s.y=i.clientY,s=s.matrixTransform(e.getScreenCTM().inverse()),[s.x,s.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[i.clientX-a.left-e.clientLeft,i.clientY-a.top-e.clientTop]}}return[i.pageX,i.pageY]}const Bt={passive:!1},De={capture:!0,passive:!1};function Ae(i){i.stopImmediatePropagation()}function Ye(i){i.preventDefault(),i.stopImmediatePropagation()}function Ut(i){var e=i.document.documentElement,t=Te(i).on("dragstart.drag",Ye,De);"onselectstart"in e?t.on("selectstart.drag",Ye,De):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Wt(i,e){var t=i.document.documentElement,s=Te(i).on("dragstart.drag",null);e&&(s.on("click.drag",Ye,De),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in t?s.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const Ie=i=>()=>i;function Fe(i,{sourceEvent:e,subject:t,target:s,identifier:a,active:r,x:c,y:o,dx:_,dy:Y,dispatch:z}){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:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:_,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:z}})}Fe.prototype.on=function(){var i=this._.on.apply(this._,arguments);return i===this._?this:i};function jt(i){return!i.ctrlKey&&!i.button}function At(){return this.parentNode}function Ot(i,e){return e??{x:i.x,y:i.y}}function $t(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ft(){var i=jt,e=At,t=Ot,s=$t,a={},r=Et("start","drag","end"),c=0,o,_,Y,z,x=0;function b(n){n.on("mousedown.drag",S).filter(s).on("touchstart.drag",m).on("touchmove.drag",w,Bt).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(n,y){if(!(z||!i.call(this,n,y))){var X=$(this,e.call(this,n,y),n,y,"mouse");X&&(Te(n.view).on("mousemove.drag",B,De).on("mouseup.drag",u,De),Ut(n.view),Ae(n),Y=!1,o=n.clientX,_=n.clientY,X("start",n))}}function B(n){if(Ye(n),!Y){var y=n.clientX-o,X=n.clientY-_;Y=y*y+X*X>x}a.mouse("drag",n)}function u(n){Te(n.view).on("mousemove.drag mouseup.drag",null),Wt(n.view,Y),Ye(n),a.mouse("end",n)}function m(n,y){if(i.call(this,n,y)){var X=n.changedTouches,M=e.call(this,n,y),R=X.length,C,U;for(C=0;C<R;++C)(U=$(this,M,n,y,X[C].identifier,X[C]))&&(Ae(n),U("start",n,X[C]))}}function w(n){var y=n.changedTouches,X=y.length,M,R;for(M=0;M<X;++M)(R=a[y[M].identifier])&&(Ye(n),R("drag",n,y[M]))}function E(n){var y=n.changedTouches,X=y.length,M,R;for(z&&clearTimeout(z),z=setTimeout(function(){z=null},500),M=0;M<X;
1++M)(R=a[y[M].identifier])&&(Ae(n),R("end",n,y[M]))}function $(n,y,X,M,R,C){var U=r.copy(),f=et(C||X,y),ae,re,F;if((F=t.call(n,new Fe("beforestart",{sourceEvent:X,target:b,identifier:R,active:c,x:f[0],y:f[1],dx:0,dy:0,dispatch:U}),M))!=null)return ae=F.x-f[0]||0,re=F.y-f[1]||0,function V(v,d,W){var G=f,q;switch(v){case"start":a[R]=V,q=c++;break;case"end":delete a[R],--c;case"drag":f=et(W||d,y),q=c;break}U.call(v,n,new Fe(v,{sourceEvent:d,subject:F,target:b,identifier:R,active:q,x:f[0]+ae,y:f[1]+re,dx:f[0]-G[0],dy:f[1]-G[1],dispatch:U}),M)}}return b.filter=function(n){return arguments.length?(i=typeof n=="function"?n:Ie(!!n),b):i},b.container=function(n){return arguments.length?(e=typeof n=="function"?n:Ie(n),b):e},b.subject=function(n){return arguments.length?(t=typeof n=="function"?n:Ie(n),b):t},b.touchable=function(n){return arguments.length?(s=typeof n=="function"?n:Ie(!!n),b):s},b.on=function(){var n=r.on.apply(r,arguments);return n===r?b:n},b.clickDistance=function(n){return arguments.length?(x=(n=+n)*n,b):Math.sqrt(x)},b}var Gt=Z('<div class="wrap svelte-b2bl92" role="none"><div class="content svelte-b2bl92"><!></div> <div role="none"><span><span class="icon left svelte-b2bl92">â¢</span><span class="icon center svelte-b2bl92"></span><span class="icon right svelte-b2bl92">â¢</span></span> <div class="inner svelte-b2bl92"></div></div></div>');function lt(i,e){ye(e,!1);function t(v,d,W){return Math.min(Math.max(v,d),W)}let s=h(e,"position",12,.5),a=h(e,"disabled",12,!1),r=h(e,"slider_color",12,"var(--border-color-primary)"),c=h(e,"image_size",28,()=>({top:0,left:0,width:0,height:0})),o=h(e,"el",12,void 0),_=h(e,"parent_el",12,void 0),Y=O(),z=O(0),x=O(!1),b=0;function S(v){b=_()?.getBoundingClientRect().width||0,v===0&&c(c().width=o()?.getBoundingClientRect().width||0,!0),D(z,t(c().width*s()+c().left,0,b))}function B(v,d){const W=Math.pow(10,d);return Math.round((v+Number.EPSILON)*W)/W}function u(v){D(z,t(v,0,b)),s(B((v-c().left)/c().width,5))}function m(v){a()||(D(x,!0),u(v.x))}function w(v){a()||u(v.x)}function E(){a()||D(x,!1)}function $(v){D(z,t(c().width*v+c().left,0,b))}Ge(()=>{S(c().width);const v=Ft().on("start",m).on("drag",w).on("end",E);Te(l(Y)).call(v)}),we(()=>P(c()),()=>{S(c().width)}),we(()=>P(s()),()=>{$(s())}),He();var n={get position(){return s()},set position(v){s(v),g()},get disabled(){return a()},set disabled(v){a(v),g()},get slider_color(){return r()},set slider_color(v){r(v),g()},get image_size(){return c()},set image_size(v){c(v),g()},get el(){return o()},set el(v){o(v),g()},get parent_el(){return _()},set parent_el(v){_(v),g()}};Re();var y=Gt();tt("resize",yt,()=>S(c().width));var X=ie(y),M=ie(X);Pe(M,e,"default",{}),ne(X),be(X,v=>o(v),()=>o());var R=N(X,2);let C;var U=ie(R);let f;var ae=N(ie(U));let re;xt(),ne(U);var F=N(U,2);let V;return ne(R),be(R,v=>D(Y,v),()=>l(Y)),ne(y),be(y,v=>_(v),()=>_()),Me(()=>{C=ze(R,1,"outer svelte-b2bl92",null,C,{disabled:a(),grab:l(x)}),Xe(R,`transform: translateX(${l(z)??""}px)`),f=ze(U,1,"icon-wrap svelte-b2bl92",null,f,{active:l(x),disabled:a()}),re=Xe(ae,"",re,{"--color":r()}),V=Xe(F,"",V,{"--color":r()})}),A(i,y),xe(n)}var Ht=Z("<img/>");function Ce(i,e){const t=Ve(e,["children","$$slots","$$events","$$legacy"]),s=Ve(t,["src","fullscreen","fixed","transform","img_el","hidden","variant","max_height"]);ye(e,!1);let a=h(e,"src",12,void 0),r=h(e,"fullscreen",12,!1),c=h(e,"fixed",12,!1),o=h(e,"transform",12,"translate(0px, 0px) scale(1)"),_=h(e,"img_el",12,null),Y=h(e,"hidden",12,!1),z=h(e,"variant",12,"upload"),x=h(e,"max_height",12,500);const b=Be();function S(m){if(!m)return{top:0,left:0,width:0,height:0};const w=m.parentElement?.getBoundingClientRect();if(!w)return{top:0,left:0,width:0,height:0};const E=m.naturalWidth/m.naturalHeight,$=w.width/w.height;let n,y;E>$?(n=w.width,y=w.width/E):(y=w.height,n=w.height*E);const X=(w.width-n)/2;return{top:(w.height-y)/2,left:X,width:n,height:y}}Ge(()=>{const m=new ResizeObserver(async w=>{for(const E of w)await Ne(),b("load",S(_()))});return m.observe(_()),()=>{m.disconnect()}});var B={get src(){return a()},set src(m){a(m),g()},get fullscreen(){return r()},set fullscreen(m){r(m),g()},get fixed(){return c()},set fixed(m){c(m),g()},get transform(){return o()},set transform(m){o(m),g()},get img_el(){return _()},set img_el(m){_(m),g()},get hidden(){return Y()},set hidden(m){Y(m),g()},get variant(){return z()},set variant(m){z(m),g()},get max_height(){return x()},set max_height(m){x(m),g()}};Re();var u=Ht();return ft(u,()=>({src:a(),...s,[pt]:{fixed:c(),hidden:Y(),preview:z()==="preview",slider:z()==="upload",fullscreen:r(),small:!r()}
1,[mt]:{transform:o(),"max-height":x()&&!r()?`${x()}px`:null}}),void 0,void 0,void 0,"svelte-j3ek2n"),be(u,m=>_(m),()=>_()),zt(u),tt("load",u,()=>b("load",S(_()))),A(i,u),xe(B)}class Nt{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(a=>{for(const r of a)r.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,s=e.clientY-this.lastY;this.offsetX+=t,this.offsetY+=s,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>
vendor: 4,249 bytes, line 1
11?"grab":"zoom-in")}async handleWheel(e){e.preventDefault();const t=this.container.getBoundingClientRect(),s=this.image.getBoundingClientRect();if(e.clientX<s.left||e.clientX>s.right||e.clientY<s.top||e.clientY>s.bottom)return;const a=1.05,r=this.scale,c=-Math.sign(e.deltaY)>0?Math.min(15,r*a):Math.max(1,r/a);if(c===r)return;const o=e.clientX-t.left-this.initial_left_padding,_=e.clientY-t.top-this.initial_top_padding;this.scale=c,this.offsetX=this.compute_new_offset({cursor_position:o,current_offset:this.offsetX,new_scale:c,old_scale:r}),this.offsetY=this.compute_new_offset({cursor_position:_,current_offset:this.offsetY,new_scale:c,old_scale:r}),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:s}){return e-(e-s)*(t/this.scale)}compute_new_offset({cursor_position:e,current_offset:t,new_scale:s,old_scale:a}){return e-s/a*(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},s=this.real_image_size.left+this.real_image_size.width,a=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<a&&(this.offsetY=this.calculate_position(a,1,"y")),t.left>this.real_image_size.left?this.offsetX=this.calculate_position(this.real_image_size.left,0,"x"):t.right<s&&(this.offsetX=this.calculate_position(s,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:s}){this.subscribers.forEach(a=>a({x:e,y:t,scale:s}))}handleTouchStart(e){e.preventDefault();const t=this.image.getBoundingClientRect(),s=e.touches[0];if(s.clientX>=t.left&&s.clientX<=t.right&&s.clientY>=t.top&&s.clientY<=t.bottom){if(e.touches.length===1&&this.scale>1)this.isDragging=!0,this.lastX=s.clientX,this.lastY=s.clientY;else if(e.touches.length===2){const a=e.touches[0],r=e.touches[1];this.last_touch_distance=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)}}}get_image_size(e){if(!e)return;const t=e.parentElement?.getBoundingClientRect();if(!t)return;const s=e.naturalWidth/e.naturalHeight,a=t.width/t.height;let r,c;s>a?(r=t.width,c=t.width/s):(c=t.height,r=t.height*s);const o=(t.width-r)/2,_=(t.height-c)/2;this.real_image_size={top:_,left:o,width:r,height:c}}handleTouchMove(e){if(e.touches.length===1&&this.isDragging){e.preventDefault();const t=e.touches[0],s=t.clientX-this.lastX,a=t.clientY-this.lastY;this.offsetX+=s,this.offsetY+=a,this.lastX=t.clientX,this.lastY=t.clientY,this.updateTransform()}else if(e.touches.length===2){e.preventDefault();const t=e.touches[0],s=e.touches[1],a=Math.hypot(s.clientX-t.clientX,s.clientY-t.clientY);if(this.last_touch_distance===0){this.last_touch_distance=a;return}const r=a/this.last_touch_distance,c=this.scale,o=Math.min(15,Math.max(1,c*r));if(o===c){this.last_touch_distance=a;return}const _=this.container.getBoundingClientRect(),Y=(t.clientX+s.clientX)/2-_.left-this.initial_left_padding,z=(t.clientY+s.clientY)/2-_.top-this.initial_top_padding;this.scale=o,this.offsetX=this.compute_new_offset({cursor_position:Y,current_offset:this.offsetX,new_scale:o,old_scale:c}
1),this.offsetY=this.compute_new_offset({cursor_position:z,current_offset:this.offsetY,new_scale:o,old_scale:c}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.last_touch_distance=a,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,s){if(this.container.getBoundingClientRect(),s==="x"){const a=e,r=this.real_image_size.left+t*this.real_image_size.width;return a-r*this.scale}if(s==="y"){const a=e,r=this.real_image_size.top+t*this.real_image_size.height;return a-r*this.scale}return 0}}var Vt=Z("<!> <!> <!> <!>",1),qt=Z("<!> <!>",1),Jt=Z('<div class="image-container svelte-1880bc6"><!> <div><!></div></div>'),Zt=Z("<!> <!>",1);function Kt(i,e){ye(e,!1);const t=()=>vt(f,"$transform",s),[s,a]=bt(),r=O(),c=O();let o=h(e,"value",28,()=>[null,null]),_=h(e,"label",12,void 0),Y=h(e,"show_download_button",12,!0),z=h(e,"show_label",12),x=h(e,"i18n",12),b=h(e,"position",12),S=h(e,"layer_images",12,!0),B=h(e,"show_single",12,!1),u=h(e,"slider_color",12),m=h(e,"show_fullscreen_button",12,!0),w=h(e,"fullscreen",12,!1),E=h(e,"buttons",12,null),$=h(e,"on_custom_button_click",12,null),n=h(e,"el_width",12,0),y=h(e,"max_height",12),X=h(e,"interactive",12,!0);const M=Be();let R=O(),C=O(),U=O(),f=Lt({x:0,y:0,z:1},{duration:75}),ae=O();function re(p,L,j,I,le,oe){return(p*j+I-le)/oe/L}let F=O(0),V=O(null),v=null;function d(p,L){!p||!L||(l(V)?.destroy(),v?.disconnect(),p?.getBoundingClientRect().width,D(F,L?.getBoundingClientRect().width||0),D(V,new Nt(L,p)),l(V).subscribe(({x:j,y:I,scale:le})=>{f.set({x:j,y:I,z:le})}),v=new ResizeObserver(j=>{for(const I of j)I.target===L&&D(F,I.contentRect.width),I.target===p&&I.contentRect.width}),v.observe(L),v.observe(p))}Ge(()=>()=>{l(V)?.destroy(),v?.disconnect()});let W=O(),G=O({top:0,left:0,width:0,height:0});function q(p){D(G,p.detail)}we(()=>(P(b()),l(F),l(G),t()),()=>{D(r,re(b(),l(F),l(G).width,l(G).left,t().x,t().z))}),we(()=>(P(S()),l(r)),()=>{D(c,S()?`clip-path: inset(0 0 0 ${l(r)*100}%)`:"")}),we(()=>(l(R),l(C)),()=>{d(l(R),l(C))}),He();var he={get value(){return o()},set value(p){o(p),g()},get label(){return _()},set label(p){_(p),g()},get show_download_button(){return Y()},set show_download_button(p){Y(p),g()},get show_label(){return z()},set show_label(p){z(p),g()},get i18n(){return x()},set i18n(p){x(p),g()},get position(){return b()},set position(p){b(p),g()},get layer_images(){return S()},set layer_images(p){S(p),g()},get show_single(){return B()},set show_single(p){B(p),g()},get slider_color(){return u()},set slider_color(p){u(p),g()},get show_fullscreen_button(){return m()},set show_fullscreen_button(p){m(p),g()},get fullscreen(){return w()},set fullscreen(p){w(p),g()},get buttons(){return E()},set buttons(p){E(p),g()},get on_custom_button_click(){return $()},set on_custom_button_click(p){$(p),g()},get el_width(){return n()},set el_width(p){n(p),g()},get max_height(){return y()},set max_height(p){y(p),g()},get interactive(){return X()},set interactive(p){X(p),g()}};Re();var ge=Zt(),_e=te(ge);{let p=H(()=>(P(_()),P(x()),k(()=>_()||x()("image.image"))));rt(_e,{get show_label(){return z()},get Icon(){return Le},get label(){return l(p)}})}var ke=N(_e,2);{var Ue=p=>{it(p,{unpadded_box:!0,size:"large",children:(L,j)=>{Le(L)},$$slots:{default:!0}})},We=p=>{var L=Jt(),j=ie(L);Dt(j,{get buttons(){return E()},get on_custom_button_click(){return $()},children:(T,se)=>{var J=Vt(),K=te(J);{let Q=H(()=>(P(x()),k(()=>x()("common.undo")))),me=H(()=>(t(),k(()=>t().z===1)));Ee(K,{get Icon(){return Tt},get label(){return l(Q)},get disabled(){return l(me)},onclick:()=>l(V)?.reset_zoom()})}var ue=N(K,2);{var ce=Q=>{Rt(Q,{get fullscreen(){return w()},$$events:{fullscreen(me){pe.call(this,e,me)}}})};ee(ue,Q=>{m()&&Q(ce)})}var fe=N(ue,2);{var ot=Q=>{{let me=H(()=>(P(o()),k(()=>o()[1]?.url))),dt=H(()=>(P(o()),k(()=>o()[1]?.orig_name||"image")));st(Q,{get href(){return l(me)},get download(){return l(dt)},children:(ht,cr)=>{{let gt=H(()=>(P(x()),k(()=>x()("common.download"))));Ee(ht,{get Icon(){return at},get label(){return l(gt)}})}},$$slots:{default:!0}})}};ee(fe,Q=>
1{Y()&&Q(ot)})}var ut=N(fe,2);{var ct=Q=>{Ee(Q,{get Icon(){return nt},label:"Remove Image",onclick:me=>{o([null,null]),M("clear"),me.stopPropagation()}})};ee(ut,Q=>{X()&&Q(ct)})}A(T,J)},$$slots:{default:!0}});var I=N(j,2);let le;var oe=ie(I);lt(oe,{get slider_color(){return u()},get image_size(){return l(G)},get position(){return b()},set position(T){b(T)},get el(){return l(C)},set el(T){D(C,T)},get parent_el(){return l(ae)},set parent_el(T){D(ae,T)},children:(T,se)=>{var J=qt(),K=te(J);{let ce=H(()=>(P(o()),k(()=>o()?.[0]?.url)));Ce(K,{get src(){return l(ce)},alt:"",loading:"lazy",variant:"preview",get transform(){return`translate(${t(),k(()=>t().x)??""}px, ${t(),k(()=>t().y)??""}px) scale(${t(),k(()=>t().z)??""})`},get fullscreen(){return w()},get max_height(){return y()},get img_el(){return l(R)},set img_el(fe){D(R,fe)},$$events:{load:q},$$legacy:!0})}var ue=N(K,2);{let ce=H(()=>(P(o()),k(()=>!o()?.[1]?.url))),fe=H(()=>(P(o()),k(()=>o()?.[1]?.url)));Ce(ue,{variant:"preview",get fixed(){return S()},get hidden(){return l(ce)},get src(){return l(fe)},alt:"",loading:"lazy",get style(){return`${l(c)??""}; background: var(--block-background-fill);`},get transform(){return`translate(${t(),k(()=>t().x)??""}px, ${t(),k(()=>t().y)??""}px) scale(${t(),k(()=>t().z)??""})`},get fullscreen(){return w()},get max_height(){return y()},$$events:{load:q}})}A(T,J)},$$slots:{default:!0},$$legacy:!0}),ne(I),be(I,T=>D(W,T),()=>l(W)),ne(L),be(L,T=>D(U,T),()=>l(U)),Me(()=>le=ze(I,1,"slider-wrap svelte-1880bc6",null,le,{limit_height:!w()})),Oe(I,"clientWidth",n),A(p,L)};ee(ke,p=>{P(o()),P(B()),k(()=>(o()===null||o()[0]===null||o()[1]===null)&&!B())?p(Ue):p(We,!1)})}A(i,ge);var je=xe(he);return a(),je}var Qt=Z('<div class="svelte-2ufkjh"><!></div>');function er(i,e){ye(e,!1);const t=Be();Re();var s=Qt(),a=ie(s);Ee(a,{get Icon(){return nt},label:"Remove Image",onclick:r=>{t("remove_image"),r.stopPropagation()}}),ne(s),A(i,s),xe()}var tr=Z('<div class="icon-buttons svelte-1c8zs50"><!></div>'),rr=Z("<div><!></div>"),sr=Z("<div><!></div>"),ir=Z("<div><!> <!></div>"),nr=Z('<!> <div data-testid="image" class="image-container svelte-1c8zs50"><!> <!> <!></div>',1);function ar(i,e){ye(e,!1);let t=h(e,"value",12),s=h(e,"label",12,void 0),a=h(e,"show_label",12),r=h(e,"root",12),c=h(e,"position",12),o=h(e,"upload_count",12,2),_=h(e,"show_download_button",12,!0),Y=h(e,"slider_color",12),z=h(e,"upload",12),x=h(e,"stream_handler",12),b=h(e,"max_file_size",12,null),S=h(e,"i18n",12),B=h(e,"max_height",12),u=h(e,"upload_promise",12,null),m=O(t()||[null,null]),w=O(),E=O(),$=O();async function n(d,W){const G=[t()[0],t()[1]];d.length>1?G[W]=d[0]:G[W]=d[W],t(G),await Ne(),X("upload",G)}let y=O("");const X=Be();let M=h(e,"dragging",12,!1);we(()=>(P(t()),l(y)),()=>{JSON.stringify(t())!==l(y)&&(D(y,JSON.stringify(t())),D(m,t()))}),we(()=>P(M()),()=>{X("drag",M())}),He();var R={get value(){return t()},set value(d){t(d),g()},get label(){return s()},set label(d){s(d),g()},get show_label(){return a()},set show_label(d){a(d),g()},get root(){return r()},set root(d){r(d),g()},get position(){return c()},set position(d){c(d),g()},get upload_count(){return o()},set upload_count(d){o(d),g()},get show_download_button(){return _()},set show_download_button(d){_(d),g()},get slider_color(){return Y()},set slider_color(d){Y(d),g()},get upload(){return z()},set upload(d){z(d),g()},get stream_handler(){return x()},set stream_handler(d){x(d),g()},get max_file_size(){return b()},set max_file_size(d){b(d),g()},get i18n(){return S()},set i18n(d){S(d),g()},get max_height(){return B()},set max_height(d){B(d),g()},get upload_promise(){return u()},set upload_promise(d){u(d),g()},get dragging(){return M()},set dragging(d){M(d),g()}};Re();
1var C=nr(),U=te(C);{let d=H(()=>(P(s()),P(S()),k(()=>s()||S()("image.image"))));rt(U,{get show_label(){return a()},get Icon(){return Le},get label(){return l(d)}})}var f=N(U,2),ae=ie(f);{var re=d=>{er(d,{$$events:{remove_image:()=>{c(.5),t([null,null]),X("clear")}}})};ee(ae,d=>{P(t()),k(()=>t()?.[0]?.url||t()?.[1]?.url)&&d(re)})}var F=N(ae,2);{var V=d=>{var W=tr(),G=ie(W);{var q=he=>{{let ge=H(()=>(P(t()),k(()=>t()[1].orig_name||"image")));st(he,{get href(){return P(t()),k(()=>t()[1].url)},get download(){return l(ge)},children:(_e,ke)=>{Ee(_e,{get Icon(){return at}})},$$slots:{default:!0}})}};ee(G,he=>{_()&&he(q)})}ne(W),A(d,W)};ee(F,d=>{P(t()),k(()=>t()?.[1]?.url)&&d(V)})}var v=N(F,2);{let d=H(()=>(P(o()),P(t()),k(()=>o()==2||!t()?.[0])));lt(v,{get disabled(){return l(d)},get slider_color(){return Y()},get position(){return c()},set position(W){c(W)},children:(W,G)=>{var q=ir();let he,ge;var _e=ie(q);{var ke=L=>{var j=rr();let I;var le=ie(j);{let oe=H(()=>(P(t()),k(()=>!!t()?.[0])));Ke(le,{filetype:"image/*",onload:T=>n(T,0),get disable_click(){return l(oe)},get root(){return r()},file_count:"multiple",get upload(){return z()},get stream_handler(){return x()},get max_file_size(){return b()},get upload_promise(){return u()},set upload_promise(T){u(T)},get dragging(){return M()},set dragging(T){M(T)},children:(T,se)=>{var J=ve(),K=te(J);Pe(K,e,"default",{}),A(T,J)},$$slots:{default:!0},$$legacy:!0})}ne(j),Me(()=>I=ze(j,1,"wrap svelte-1c8zs50",null,I,{"half-wrap":o()===1})),A(L,j)},Ue=L=>{{let j=H(()=>(l(m),k(()=>l(m)[0]?.url)));Ce(L,{variant:"upload",get src(){return l(j)},alt:"",get max_height(){return B()},get img_el(){return l(w)},set img_el(I){D(w,I)},$$legacy:!0})}};ee(_e,L=>{l(m),k(()=>!l(m)?.[0])?L(ke):L(Ue,!1)})}var We=N(_e,2);{var je=L=>{{let j=H(()=>(P(t()),k(()=>!!t()?.[1])));Ke(L,{filetype:"image/*",onload:I=>n(I,1),get disable_click(){return l(j)},get root(){return r()},file_count:"multiple",get upload(){return z()},get stream_handler(){return x()},get max_file_size(){return b()},get upload_promise(){return u()},set upload_promise(I){u(I)},get dragging(){return M()},set dragging(I){M(I)},children:(I,le)=>{var oe=ve(),T=te(oe);Pe(T,e,"default",{}),A(I,oe)},$$slots:{default:!0},$$legacy:!0})}},p=L=>{var j=ve(),I=te(j);{var le=T=>{var se=sr();let J,K;var ue=ie(se);it(ue,{unpadded_box:!0,size:"large",children:(ce,fe)=>{Le(ce)},$$slots:{default:!0}}),ne(se),Me(()=>{J=ze(se,1,"empty-wrap fixed svelte-1c8zs50",null,J,{"white-icon":!t()?.[0]?.url}),K=Xe(se,"",K,{width:`${l(E)*(1-c())}px`,transform:`translateX(${l(E)*c()}px)`})}),A(T,se)},oe=T=>{var se=ve(),J=te(se);{var K=ue=>{{let ce=H(()=>o()===1);Ce(ue,{variant:"upload",get src(){return l(m),k(()=>l(m)[1].url)},alt:"",get fixed(){return l(ce)},transform:"translate(0px, 0px) scale(1)",get max_height(){return B()}})}};ee(J,ue=>{l(m),k(()=>l(m)?.[1])&&ue(K)},!0)}A(T,se)};ee(I,T=>{l(m),P(o()),k(()=>!l(m)?.[1]&&o()===1)?T(le):T(oe,!1)},!0)}A(L,j)};ee(We,L=>{l(m),P(o()),k(()=>!l(m)?.[1]&&o()===2)?L(je):L(p,!1)})}ne(q),Me(()=>{he=ze(q,1,"upload-wrap svelte-1c8zs50",null,he,{"side-by-side":o()===2}),ge=Xe(q,"",ge,{display:o()===2?"flex":"block"})}),A(W,q)},$$slots:{default:!0},$$legacy:!0})}return ne(f),Oe(f,"clientWidth",d=>D(E,d)),Oe(f,"clientHeight",d=>D($,d)),A(i,C),xe(R)}function lr(i,e){ye(e,!1);let t=h(e,"value",28,()=>[null,null]),s=h(e,"upload",12),a=h(e,"stream_handler",12),r=h(e,"label",12),c=h(e,"show_label",12),o=h(e,"i18n",12),_=h(e,"root",12),Y=h(e,"upload_count",12,1),z=h(e,"dragging",12),x=h(e,"max_height",12),b=h(e,"max_file_size",12,null),S=h(e,"upload_promise",12,null);var B={get value(){return t()},set value(u){t(u),g()},get upload(){return s()},set upload(u){s(u),g()},get stream_handler(){return a()},set stream_handler(u){a(u),g()},get label(){return r()},set label(u){r(u),g()},get show_label(){return c()},set show_label(u){c(u),g()},get i18n(){return o()},set i18n(u){o(u),g()},get root(){return _()},set root(u){_(u),g()},get upload_count(){return Y()},set upload_count(u){Y(u),g()},get dragging(){return z()},set dragging(u){z(u),g()},get max_height(){return x()},set max_height(u){x(u),g()},get max_file_size(){return b()},set max_file_size(u){b(u),g()},get upload_promise(){return S()},set upload_promise(u){S(u),g()}};return ar(i,{slider_color:"var(--border-color-primary)",position:.5,get root(){return _()},get label(){return r()},get show_label(){return c()},get upload_count(){return Y()},get stream_handler(){return a()},get upload(){return s()},get max_file_size(){return b()},get max_height(){return x()},get i18n(){return o()},get upload_promise(){return S()},set upload_promise(u){S(u)},get value(){return t()},set value(u){t(u)},get dragging(){return z()},set dragging(u){z(u)},$$events:{edit(u){pe.call(this,e,u)},clear(u){pe.call(this,e,u)},stream(u){pe.call(this,e,u)},drag:({detail:u})=>z(u),upload(u){pe.call(this,e,u)},select(u){pe.call(this,e,u)},share(u){pe.call(this,e,u)}},children:(u,m)=>{var w=ve(),E=te(w);Pe(E,e,"default",{}),A(u,w)},$$slots:{default:!0},$$legacy:!0}),xe(B)}var or=Z("<!> <!>",1),ur=Z("<!> <!>",1);function Wr(i,e){ye(e,!0);let t=Se(void 0);class s extends Mt{async get_data(){return l(t)&&(await l(t),await Ne()),await super.get_data()}}const a=wt(e,["$$slots","$$events","$$legacy"]),r=new s(a);let c=Se(Yt(r.props.value)),o=Se(!1),_=Se(!1),Y,z=de(()=>Math.max(0,Math.min(100,r.props.slider_position))/100);Xt(()=>{l(c)!=r.props.value&&(D(c,r.props.value,!0),r.dispatch("change"),r.dispatch("input"))});const x=w=>{const E=w;E.preventDefault(),E.stopPropagation(),E.type==="dragenter"||E.type==="dragover"?D(_,!0):E.type==="dragleave"&&D(_,!1)},b=w=>{if(r.shared.interactive){const E=w;E.preventDefault(),E.stopPropagation(),D(_,!1),Y&&Y.loadFilesFromDrop(E)}};var S=ve(),B=te(S);{var u=w=>{{let E=de(()=>l(_)?"focus":"base"),$=de(()=>r.props.height||void 0);Qe(w,{get visible(){return r.shared.visible},variant:"solid",get border_mode(){return l(E)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l($)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},get fullscreen(){return l(o)},set fullscreen(n){D(o,n,!0)},children:(n,y)=>{var X=or(),M=te(X);Ze(M,qe({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status));var R=N(M,2);{let C=de(()=>r.props.buttons.some(f=>typeof f=="string"&&f==="download")),U=de(()=>r.props.buttons.some(f=>typeof f=="string"&&f==="fullscreen"));Kt(R,{get fullscreen(){return l(o)},get interactive(){return r.shared.interactive},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get show_download_button(){return l(C)},get i18n(){return r.i18n},get show_fullscreen_button(){return l(U)},get buttons(){return r.props.buttons},on_custom_button_click:f=>{r.dispatch("custom_button_click",{id:f})},get position(){return l(z)},get slider_color(){return r.props.slider_color},get max_height(){return r.props.max_height},get value(){return r.props.value},set value(f){r.props.value=f},$$events:{select:({detail:f})=>r.dispatch("select",f),share:({detail:f})=>r.dispatch("share",f),error:({detail:f})=>r.dispatch("error",f),clear:()=>r.dispatch("clear"),fullscreen:({detail:f})=>{D(o,f,!0)}}})}A(n,X)},$$slots:{default:!0}})}},m=w=>{{let E=de(()=>r.props.value===null?"dashed":"solid"),$=de(()=>l(_)?"focus":"base"),n=de(()=>r.props.height||void 0);Qe(w,{get visible(){return r.shared.visible},get variant(){return l(E)},get border_mode(){return l($)},padding:!1,get elem_id(){return r.shared.elem_id},get elem_classes(){return r.shared.elem_classes},get height(){return l(n)},get width(){return r.props.width},allow_overflow:!1,get container(){return r.shared.container},get scale(){return r.shared.scale},get min_width(){return r.shared.min_width},$$events:{dragenter:x,dragleave:x,dragover:x,drop:b},children:(y,X)=>{var M=ur(),R=te(M);Ze(R,qe({get autoscroll(){return r.shared.autoscroll},get i18n(){return r.i18n}},()=>r.shared.loading_status,{on_clear_status:()=>r.dispatch("clear_status",r.shared.loading_status)}));var C=N(R,2);{let U=de(()=>r.shared.client?.stream);be(lr(C,{get root(){return r.shared.root},get label(){return r.shared.label},get show_label(){return r.shared.show_label},get upload_count(){return r.props.upload_count},get max_file_size(){return r.shared.max_file_size},get i18n(){return r.i18n},upload:(...f)=>r.shared.client.upload(...f),get stream_handler(){return l(U)},get max_height(){return r.props.max_height},get upload_promise(){return l(t)},set upload_promise(f){D(t,f,!0)},get value(){return r.props.value},set value(f){r.props.value=f},get dragging(){return l(_)},set dragging(f){D(_,f,!0)},$$events:{edit:()=>r.dispatch("edit"),clear:()=>
1{r.dispatch("clear")},drag:({detail:f})=>D(_,f,!0),upload:()=>r.dispatch("upload"),error:({detail:f})=>{r.shared.loading_status&&(r.shared.loading_status.status="error"),r.dispatch("error",f)},close_stream:()=>{r.dispatch("close_stream","stream")}},children:(f,ae)=>{var re=ve(),F=te(re);{var V=v=>{It(v,{get i18n(){return r.i18n},type:"image",get placeholder(){return r.props.placeholder}})};ee(F,v=>{v(V)})}A(f,re)},$$slots:{default:!0}}),f=>Y=f,()=>Y)}A(y,M)},$$slots:{default:!0}})}};ee(B,w=>{!r.shared.interactive||r.props.value?.[1]&&r.props.value?.[0]?w(u):w(m,!1)})}A(i,S),xe()}export{Wr 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.