%PDF- %PDF-
Direktori : /proc/self/root/var/www/projetos/stb.ind.br/wp-content/plugins/webp-express/lib/wcfm/ |
Current File : //proc/self/root/var/www/projetos/stb.ind.br/wp-content/plugins/webp-express/lib/wcfm/wcfm.js |
import{_ as u,o as c,c as d,a as Z,b as n,n as w,d as m,e as v,t as f,p as C,f as S,r as h,g as _,F as z,h as F,i as y,j as M,k as P,m as H,V as R,w as b,l as k,v as V,s as Y,q as L,u as j}from"./vendor.b4e4e155.js";const B=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function o(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerpolicy&&(i.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?i.credentials="include":s.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function l(s){if(s.ep)return;s.ep=!0;const i=o(s);fetch(s.href,i)}};B();class x{static post(t,o,l){var s=this;window.wcfmoptions.poster(t,o,function(i){l.call(s,i)},function(){console.log("failure")})}}const U={},E={style:{position:"absolute",width:"0",height:"0"},width:"0",height:"0",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},A=Z(`<defs><symbol id="icon-folder" viewBox="0 0 309.267 309.267"><g><path style="fill:#D0994B;" d="M260.944,43.491H125.64c0,0-18.324-28.994-28.994-28.994H48.323c-10.67,0-19.329,8.65-19.329,19.329 v222.286c0,10.67,8.659,19.329,19.329,19.329h212.621c10.67,0,19.329-8.659,19.329-19.329V62.82 C280.273,52.15,271.614,43.491,260.944,43.491z"></path><path style="fill:#E4E7E7;" d="M28.994,72.484h251.279v77.317H28.994V72.484z"></path><path style="fill:#F4B459;" d="M19.329,91.814h270.609c10.67,0,19.329,8.65,19.329,19.329l-19.329,164.298 c0,10.67-8.659,19.329-19.329,19.329H38.658c-10.67,0-19.329-8.659-19.329-19.329L0,111.143C0,100.463,8.659,91.814,19.329,91.814z "></path></g></symbol><symbol id="icon-unfold" viewBox="0 0 32 32"><path d="M28,14H18V4c0-1.104-0.896-2-2-2s-2,0.896-2,2v10H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h10v10c0,1.104,0.896,2,2,2 s2-0.896,2-2V18h10c1.104,0,2-0.896,2-2S29.104,14,28,14z"></path></symbol><symbol id="icon-fold" viewBox="0 0 24 24"><g fill="none" stroke="#000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></g></symbol><symbol id="icon-file" viewBox="0 0 56 56"><g><path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074 c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z"></path><polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 "></polygon><circle style="fill:#F3D55B;" cx="18.931" cy="14.431" r="4.569"></circle><polygon style="fill:#26B99A;" points="6.5,39 17.5,39 49.5,39 49.5,28 39.5,18.5 29,30 23.517,24.517 "></polygon><path style="fill:#14A085;" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z"></path><g></g></g></symbol><svg id="icon-ok" viewBox="0 0 256 256"><g fill="green" stroke="none" transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"><path d="M1064 2545 c-406 -72 -744 -324 -927 -690 -96 -193 -127 -333 -127 -575 0 -243 33 -387 133 -585 177 -351 518 -606 907 -676 118 -22 393 -17 511 8 110 24 252 78 356 136 327 183 569 525 628 887 19 122 19 338 0 460 -81 498 -483 914 -990 1025 -101 22 -389 28 -491 10z m814 -745 c39 -27 73 -59 77 -70 9 -27 10 -25 -372 -590 -345 -510 -357 -524 -420 -512 -19 4 -98 74 -250 225 -123 121 -225 228 -228 238 -3 10 1 31 9 47 20 40 125 132 149 132 11 0 79 -59 162 -140 79 -77 146 -140 149 -140 3 0 38 48 78 108 95 143 465 678 496 720 35 46 64 42 150 -18z"></path></g></svg><svg id="icon-not-available" viewBox="0 0 500.000000 500.000000" preserveAspectRatio="xMidYMid meet"><g fill="#b11010" stroke="none" transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"><path d="M2315 4800 c-479 -35 -928 -217 -1303 -527 -352 -293 -615 -702 -738 -1151 -104 -380 -104 -824 0 -1204 107 -389 302 -724 591 -1013 354 -354 785 -572 1279 -646 196 -30 476 -30 672 0 494 74 925 292 1279 646 354 354 571 784 646 1279 30 197 30 475 0 672 -75 495 -292 925 -646 1279 -289 289 -624 484 -1013 591 -228 62 -528 91 -767 74z m353 -511 c458 -50 874 -272 1170 -624 417 -497 536 -1174 308 -1763 -56 -145 -176 -367 -235 -434 -4 -4 -566 552 -1250 1236 l-1243 1243 94 60 c354 229 754 327 1156 282z m864 -3200 c-67 -59 -289 -179 -434 -235 -946 -366 -2024 172 -2322 1158 -47 155 -66 276 -73 453 -13 362 84 704 290 1023 l60 94 1243 -1243 c684 -684 1240 -1246 1236 -1250z"></path></g></svg><svg id="icon-help" viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve"><g><path style="fill:#cccccc;" d="M199.996,0C89.719,0,0,89.72,0,200c0,110.279,89.719,200,199.996,200C310.281,400,400,310.279,400,200 C400,89.72,310.281,0,199.996,0z M199.996,373.77C104.187,373.77,26.23,295.816,26.23,200 c0-95.817,77.957-173.769,173.766-173.769c95.816,0,173.772,77.953,173.772,173.769 C373.769,295.816,295.812,373.77,199.996,373.77z"></path><path style="fill:#000000;" d="M199.996,91.382c-35.176,0-63.789,28.616-63.789,63.793c0,7.243,5.871,13.115,13.113,13.115 c7.246,0,13.117-5.873,13.117-13.115c0-20.71,16.848-37.562,37.559-37.562c20.719,0,37.566,16.852,37.566,37.562 c0,20.714-16.849,37.566-37.566,37.566c-7.242,0-13.113,5.873-13.113,13.114v45.684c0,7.243,5.871,13.115,13.113,13.115 s13.117-5.872,13.117-13.115v-33.938c28.905-6.064,50.68-31.746,50.68-62.427C263.793,119.998,235.176,91.382,199.996,91.382z"></path><path d="M200.004,273.738c-9.086,0-16.465,7.371-16.465,16.462s7.379,16.465,16.465,16.465c9.094,0,16.457-7.374,16.457-16.465 S209.098,273.738,200.004,273.738z"></path></g></svg><svg id="icon-help2" viewBox="0 0 431.855 431.855" style="enable-background:new 0 0 431.855 431.855;" xml:space="preserve"><g><path style="fill:#aaaaaa;" d="M215.936,0C96.722,0,0.008,96.592,0.008,215.814c0,119.336,96.714,216.041,215.927,216.041 c119.279,0,215.911-96.706,215.911-216.041C431.847,96.592,335.214,0,215.936,0z M231.323,335.962 c-5.015,4.463-10.827,6.706-17.411,6.706c-6.812,0-12.754-2.203-17.826-6.617c-5.08-4.406-7.625-10.575-7.625-18.501 c0-7.031,2.463-12.949,7.373-17.745c4.91-4.796,10.933-7.194,18.078-7.194c7.031,0,12.949,2.398,17.753,7.194 c4.796,4.796,7.202,10.713,7.202,17.745C238.858,325.362,236.346,331.5,231.323,335.962z M293.856,180.934 c-3.853,7.145-8.429,13.306-13.737,18.501c-5.292,5.194-14.81,13.924-28.548,26.198c-3.788,3.463-6.836,6.503-9.12,9.12 c-2.284,2.626-3.991,5.023-5.105,7.202c-1.122,2.178-1.983,4.357-2.593,6.535c-0.61,2.17-1.528,5.999-2.772,11.469 c-2.113,11.608-8.754,17.411-19.915,17.411c-5.804,0-10.681-1.894-14.656-5.69c-3.959-3.796-5.934-9.429-5.934-16.907 c0-9.372,1.455-17.493,4.357-24.361c2.886-6.869,6.747-12.892,11.543-18.086c4.804-5.194,11.274-11.356,19.427-18.501 c7.145-6.251,12.307-10.965,15.485-14.144c3.186-3.186,5.861-6.73,8.031-10.632c2.187-3.91,3.26-8.145,3.26-12.721 c0-8.933-3.308-16.46-9.957-22.597c-6.641-6.137-15.209-9.21-25.703-9.21c-12.282,0-21.321,3.097-27.125,9.291 c-5.804,6.194-10.705,15.314-14.729,27.369c-3.804,12.616-11.006,18.923-21.598,18.923c-6.251,0-11.526-2.203-15.826-6.609 c-4.292-4.406-6.438-9.177-6.438-14.314c0-10.6,3.406-21.346,10.21-32.23c6.812-10.884,16.745-19.899,29.807-27.036 c13.054-7.145,28.296-10.722,45.699-10.722c16.184,0,30.466,2.991,42.854,8.966c12.388,5.966,21.963,14.087,28.718,24.361 c6.747,10.266,10.128,21.427,10.128,33.482C299.635,165.473,297.709,173.789,293.856,180.934z"></path></g></svg></defs>`,1),q=[A];function G(e,t){return c(),d("svg",E,q)}var K=u(U,[["render",G]]);const J={name:"FileItem",emits:["toggle","select"],props:{item:Object},data(){return{hover:!1,selected:!1}},inject:["wcfm"],methods:{onClick(e){this.selected=!0,this.$emit("select",this)},getWCFM(){return this.wcfm},getFullPath(){for(var e=this.$parent,t=[];e!==null&&e.$parent!==null;)e.item&&t.push(e.item.name),e=e.$parent;return t.pop(),t.reverse().join("/")},infoClick(){this.getWCFM().displayInfo(this.getFullPath())},convertClick(){this.getWCFM().onConvertClick(this.getFullPath())}}},$=e=>(C("data-v-1c7f963e"),e=e(),S(),e),Q={key:0,class:"icon-fold"},ee=$(()=>n("use",{"xlink:href":"#icon-fold"},null,-1)),te=[ee],oe={key:1,class:"icon-unfold"},se=$(()=>n("use",{"xlink:href":"#icon-unfold"},null,-1)),ie=[se],ne=$(()=>n("use",{"xlink:href":"#icon-folder"},null,-1)),le=[ne],ae={key:2,class:"icon-file"},re=$(()=>n("use",{"xlink:href":"#icon-file"},null,-1)),ce=[re];function de(e,t,o,l,s,i){return c(),d("div",{class:w({fileitem:!0,selected:s.selected}),onMouseover:t[2]||(t[2]=a=>s.hover=!0),onMouseleave:t[3]||(t[3]=a=>s.hover=!1),onClick:t[4]||(t[4]=(...a)=>i.onClick&&i.onClick(...a))},[n("p",null,[o.item.isDir?(c(),d("span",{key:0,class:w({"fold-unfold":!0,empty:o.item.children.length==0}),onClick:t[0]||(t[0]=a=>this.$emit("toggle"))},[o.item.isOpen?(c(),d("svg",Q,te)):m("",!0),o.item.isOpen?m("",!0):(c(),d("svg",oe,ie))],2)):m("",!0),o.item.isDir?(c(),d("svg",{key:1,class:"icon-folder",onClick:t[1]||(t[1]=a=>this.$emit("toggle"))},le)):m("",!0),o.item.isDir?m("",!0):(c(),d("svg",ae,ce)),v(" "+f(o.item.name),1)])],34)}var he=u(J,[["render",de],["__scopeId","data-v-1c7f963e"]]);const ue={name:"FileTree",components:{FileItem:he},emits:["select"],props:{item:Object},methods:{toggle(){this.item.isOpen=!this.item.isOpen},onSelect(e){this.$emit("select",e)}}},me={key:0,class:"tree"};function _e(e,t,o,l,s,i){const a=h("FileItem"),r=h("FileTree",!0);return c(),d(z,null,[_(a,{item:o.item,onDblclick:i.toggle,onToggle:i.toggle,onSelect:i.onSelect},null,8,["item","onDblclick","onToggle","onSelect"]),o.item.children!==void 0&&o.item.isOpen?(c(),d("ul",me,[(c(!0),d(z,null,F(o.item.children,p=>(c(),d("li",null,[_(r,{item:p,onSelect:i.onSelect},null,8,["item","onSelect"])]))),256))])):m("",!0)],64)}var fe=u(ue,[["render",_e]]);const pe={name:"Files",components:{FileTree:fe},emits:["select"],props:{item:Object,statusText:String},methods:{onSelect(e){this.selectedItem&&(this.selectedItem.selected=!1),this.selectedItem=e,this.$emit("select",this.selectedItem.getFullPath(),this.selectedItem.item.isDir)}},data(){return{selected:null}}},ge={key:1};function ve(e,t,o,l,s,i){const a=h("FileTree");return c(),d(z,null,[o.item?(c(),y(a,{key:0,item:o.item,onSelect:i.onSelect},null,8,["item","onSelect"])):m("",!0),o.item?m("",!0):(c(),d("div",ge,f(o.statusText),1))],64)}var ye=u(pe,[["render",ve]]);const ze={name:"Modal",emits:["close"],props:{title:{type:String},closeButtonText:{type:String},alignment:{type:String},width:{type:[Number,String],default:"95%"},height:{type:[Number,String],default:"95%"},maxheight:{type:[Number,String],default:"700px"}},computed:{containerStyle(){let e={width:this.width,height:this.height,"max-height":this.maxheight};return this.alignment=="center"&&(e.margin="0px auto"),this.alignment=="right"&&(e.position="absolute",e.right="10px"),e}},methods:{onCloseClick(){this.$emit("close")}}},be={class:"modal-mask"},xe={class:"modal-wrapper"},$e={class:"title"},we={class:"modal-body"},Ce={class:"content"},Se=v(" default body "),ke={class:"close-button-with-text"};function Ve(e,t,o,l,s,i){return c(),d("div",be,[n("div",xe,[n("div",{class:"modal-container",style:M(i.containerStyle)},[n("a",{class:"close-button",onClick:t[0]||(t[0]=(...a)=>i.onCloseClick&&i.onCloseClick(...a))},"X"),n("div",$e,f(o.title),1),n("div",we,[n("div",Ce,[P(e.$slots,"default",{},()=>[Se]),n("div",ke,[n("button",{onClick:t[1]||(t[1]=(...a)=>i.onCloseClick&&i.onCloseClick(...a))},f(o.closeButtonText),1)])])])],4)])])}var Ie=u(ze,[["render",Ve]]);const Fe={name:"ZoomSlider",components:{Slider:H},emits:["update:zoom"],props:{zoom:{type:Number,default:1}},watch:{exp(e,t){this.$emit("update:zoom",2**e)},zoom(e,t){this.exp=Math.log2(e)}},methods:{sliderFormat(e){return Math.round(2**e*100)+"%"}},mounted(){},data(){return{exp:0}}},Me={class:"zoom-slider"};function Re(e,t,o,l,s,i){const a=h("Slider");return c(),d("div",Me,[_(a,{modelValue:s.exp,"onUpdate:modelValue":t[0]||(t[0]=r=>s.exp=r),min:-4,max:4,width:100,step:-1,format:i.sliderFormat,tooltipPosition:"bottom",orientation:"horizontal"},null,8,["modelValue","format"])])}var Ye=u(Fe,[["render",Re]]);const Xe={name:"ImageViewport",components:{VueZoomer:R,ZoomSlider:Ye},emits:["update:zoom","update:translateX","update:translateY","load","resize"],props:{src:{type:String},height:{type:Number,default:500},zoom:{type:Number,default:1},scaleZoomRatio:{type:Number},translateX:{type:Number,default:1},translateY:{type:Number,default:1}},data(){return{ratio:1,ro:null}},watch:{height(e,t){var o;((o=this.$refs)==null?void 0:o.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos())},scaleZoomRatio(e){var t;((t=this.$refs)==null?void 0:t.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos()),this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio},zoom(e,t){this.isImageReady(),this.$refs.zoomer.scale=e*this.scaleZoomRatio},translateX(e,t){this.$refs.zoomer.translateX!=e&&(this.$refs.zoomer.translateX=e)},translateY(e,t){this.$refs.zoomer.translateY!=e&&(this.$refs.zoomer.translateY=e)}},methods:{getGoodContainerHeight(){var e,t,o;if((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth){let l=this.$refs.theimg.naturalWidth/this.$refs.theimg.naturalHeight,i=((o=this.$refs.root)==null?void 0:o.offsetWidth)/l;return i>300&&(i=300),i}return 300},updateContainerHeight(){},isImageReady(){var e,t,o;return!(!((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth)||!((o=this.$refs.root)==null?void 0:o.offsetWidth))},calcScaleZoomRatio(){var l,s;if(!this.isImageReady())return 1;let e=this.$refs.theimg.naturalWidth/((l=this.$refs.root)==null?void 0:l.offsetWidth),t=this.$refs.theimg.naturalHeight/((s=this.$refs.root)==null?void 0:s.offsetHeight),o=Math.max(e,t);return isNaN(o)?1:o},updateRatio(){},updateScale(){this.zoom&&(this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio)},zoomToFit(){},onImgLoad(){var e,t;((t=(e=this.$refs)==null?void 0:e.theimg)==null?void 0:t.naturalWidth)&&this.$emit("load")},onResize(){this.$emit("resize")},onDoubleTap(){console.log("double tab - zoom to 100%"),this.$emit("update:zoom",1),this.$emit("update:translateX",0),this.$emit("update:translateY",0)}},mounted(){window.ResizeObserver&&(this.ro=new ResizeObserver(this.onResize).observe(this.$refs.root)),this.$refs.zoomer.tapDetector.onDoubleTap(this.onDoubleTap),this.$watch("$refs.zoomer.scale",(e,t)=>{this.isImageReady(),this.$emit("update:zoom",e/this.scaleZoomRatio)}),this.$watch("$refs.zoomer.translateX",(e,t)=>{this.$emit("update:translateX",e)}),this.$watch("$refs.zoomer.translateY",(e,t)=>{this.$emit("update:translateY",e)})},beforeDestroy(){window.ResizeObserver&&this.ro.unobserve(this.$refs.zoomer)}},Oe={ref:"root",class:"image-viewport"},Te=["src"],De={class:"zoom-info"};function We(e,t,o,l,s,i){const a=h("v-zoomer");return c(),d("div",Oe,[_(a,{ref:"zoomer",class:"zoomer",minScale:.1,maxScale:8,onResize:i.onResize,doubleClickToZoom:!1,style:M({height:o.height+"px"}),pivot:"cursor",limitTranslation:!1,lockPanOnNoScale:!1},{default:b(()=>[n("img",{ref:"theimg",src:o.src,onLoad:t[0]||(t[0]=(...r)=>i.onImgLoad&&i.onImgLoad(...r))},null,40,Te)]),_:1},8,["minScale","onResize","style"]),n("div",De," zoom: "+f(Math.round(o.zoom*100))+"% ",1)],512)}var Ne=u(Xe,[["render",We]]);const Ze={name:"Variant",components:{ImageViewport:Ne},emits:["select","update:zoom","update:translateX","update:translateY","load","resize"],props:{title:{type:String},info:{type:Object},url:{type:String,default:""},height:{type:Number},zoom:{type:Number},scaleZoomRatio:{type:Number},translateX:{type:Number},translateY:{type:Number},variantIndex:{type:Number}},computed:{imageUrl:function(){var e;return(e=this.info)==null?void 0:e.url},filesize:function(){var t;if(!((t=this.info)==null?void 0:t.size))return"";let e=this.info.size;return e<1024?e+" bytes":(e/=1024,e<1024?Math.round(e*10)/10+" kb":(e/=1024,Math.round(e*10)/10+" MB"))}},methods:{onVariantSelect(){this.$emit("select",this.variantIndex)},onLoad(){this.$emit("load")},zoomToFit(){this.$refs.theport.zoomToFit()}},mounted(){this.$watch("$refs.theport.zoom",(e,t)=>{this.$emit("update:zoom",e)}),this.$watch("$refs.theport.translateX",(e,t)=>{this.$emit("update:translateX",e)}),this.$watch("$refs.theport.translateY",(e,t)=>{this.$emit("update:translateY",e)})},data(){return{}}},Pe={class:"variant"},He={class:"header"},Le={class:"title"},je={class:"size"};function Be(e,t,o,l,s,i){const a=h("ImageViewport");return c(),d("div",Pe,[n("div",He,[n("div",Le,f(o.title),1),n("div",je,f(i.filesize),1)]),_(a,{ref:"theport",src:i.imageUrl,height:o.height,zoom:o.zoom,"onUpdate:zoom":t[0]||(t[0]=r=>o.zoom=r),scaleZoomRatio:o.scaleZoomRatio,translateX:o.translateX,"onUpdate:translateX":t[1]||(t[1]=r=>o.translateX=r),translateY:o.translateY,"onUpdate:translateY":t[2]||(t[2]=r=>o.translateY=r),onLoad:i.onLoad,onResize:t[3]||(t[3]=r=>this.$emit("resize"))},null,8,["src","height","zoom","scaleZoomRatio","translateX","translateY","onLoad"])])}var X=u(Ze,[["render",Be],["__scopeId","data-v-0372e854"]]);const Ue={name:"Variants",components:{Variant:X},emits:["update:zoom","update:translateX","update:translateY"],props:{file:{type:Object},viewport:{type:Object},height:{type:Number},zoom:{type:Number,default:1},translateX:{type:Number,default:0},translateY:{type:Number,default:0}},watch:{file(e,t){}},methods:{onZoomChange(e){this.$emit("update:zoom",e)},onTranslateXChange(e){this.$emit("update:translateX",e)},onTranslateYChange(e){this.$emit("update:translateY",e)},sliderFormat(e){return Math.round(e*100)+"%"},changeImage(){this.imageUrl=="http://localhost:3000/src/assets/dummy.jpg"?this.imageUrl="http://localhost:3000/src/assets/dummy2.jpg":this.imageUrl="http://localhost:3000/src/assets/dummy.jpg",this.selectedVariant=-1},onVariantSelect(e){this.selectedVariant=e}},mounted(){this.$watch("$refs.variants.zoom",(e,t)=>{})},data(){var e="http://localhost:3000/src/assets/200x100.jpg";return{imageUrl:"",selectedVariant:-1,variants:[{title:"Existing conversion",size:732,url:e},{title:"Lossy, q:20",size:35e5,url:e}]}}},O=e=>(C("data-v-25a3327e"),e=e(),S(),e),Ee={class:"variants-component"},Ae=O(()=>n("br",null,null,-1)),qe=O(()=>n("br",null,null,-1)),Ge={class:"variants"};function Ke(e,t,o,l,s,i){const a=h("Variant");return c(),d("div",Ee,[v(" File: "+f(o.file)+" ",1),n("button",{onClick:t[0]||(t[0]=r=>i.changeImage())},"Change image"),Ae,qe,n("div",Ge,[(c(!0),d(z,null,F(s.variants,(r,p)=>(c(),y(a,{title:r.title,info:r,variantIndex:p,class:w({selected:p==s.selectedVariant}),height:o.height,zoom:o.zoom,"onUpdate:zoom":[t[1]||(t[1]=g=>o.zoom=g),i.onZoomChange],translateX:o.translateX,"onUpdate:translateX":[t[2]||(t[2]=g=>o.translateX=g),i.onTranslateXChange],translateY:o.translateY,"onUpdate:translateY":[t[3]||(t[3]=g=>o.translateY=g),i.onTranslateYChange],onSelect:i.onVariantSelect},null,8,["title","info","variantIndex","class","height","zoom","translateX","translateY","onSelect","onUpdate:zoom","onUpdate:translateX","onUpdate:translateY"]))),256))])])}var Je=u(Ue,[["render",Ke],["__scopeId","data-v-25a3327e"]]);const Qe={name:"FileProperties",components:{Variant:X,Variants:Je},props:{file:{type:Object,default:{}}},watch:{file(e,t){e.isDir||this.load(e.path)}},methods:{onVariantSelect(e){this.selectedVariant=e},onOriginalLoad(){if(this.updateHeight(),this.$refs.original.$refs.theport.calcScaleZoomRatio()>1){let t=this.$refs.original.$refs.theport,o=t.$refs.theimg,l=t.$refs.root,s=o.naturalWidth,i=o.naturalHeight,a=l.offsetWidth,p=this.height/i,g=a/s;this.zoom=Math.min(p,g)}else this.zoom=1;this.translateX=0,this.translateY=0},onOriginalResize(){this.updateHeight()},updateHeight(){this.$refs.original&&(this.height=this.$refs.original.$refs.theport.getGoodContainerHeight(),this.scaleZoomRatio=this.$refs.original.$refs.theport.calcScaleZoomRatio())},reset(){this.originalInfo=null,this.convertedInfo=null,this.errorMsg=""},load(e){let t=this;t.reset(),t.loading=!0,x.post("info",{path:e},function(o){o.success||(t.errorMsg=o.data),t.loading=!1,t.originalInfo=o.original,o.converted&&(t.convertedInfo=o.converted)})}},mounted(){this.file&&this.load(this.file.path)},data(){return{zoom:1,scaleZoomRatio:1,translateX:0,translateY:0,height:100,loading:!1,errorMsg:"",originalInfo:null,convertedInfo:null}}},T=e=>(C("data-v-32d950b3"),e=e(),S(),e),et={class:"file-properties"},tt={class:"path"},ot=v(" Path: "),st={class:"path"},it={key:0,class:"error"},nt=T(()=>n("p",null," Above, you see the original image. If it has been converted, you also see the converted image (provided that your browser supports webp). ",-1)),lt=T(()=>n("p",null," You can zoom in on the image, ie using scroll wheel. Both images will zoom, allowing you to compare the quality. Double-click the image to set zoom to 100%. You can also drag the image. ",-1));function at(e,t,o,l,s,i){const a=h("Variant");return c(),d("div",et,[n("div",tt,[ot,n("span",st,f(o.file.path),1)]),s.errorMsg?(c(),d("div",it,f(s.errorMsg),1)):m("",!0),k(n("div",null,"Getting info...",512),[[V,s.loading]]),k(_(a,{ref:"original",title:"Original",info:s.originalInfo,height:s.height,zoom:s.zoom,"onUpdate:zoom":t[0]||(t[0]=r=>s.zoom=r),scaleZoomRatio:s.scaleZoomRatio,translateX:s.translateX,"onUpdate:translateX":t[1]||(t[1]=r=>s.translateX=r),translateY:s.translateY,"onUpdate:translateY":t[2]||(t[2]=r=>s.translateY=r),onLoad:i.onOriginalLoad,onResize:i.onOriginalResize},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY","onLoad","onResize"]),[[V,s.originalInfo]]),k(_(a,{title:"Existing conversion",info:s.convertedInfo,height:s.height,zoom:s.zoom,"onUpdate:zoom":t[3]||(t[3]=r=>s.zoom=r),scaleZoomRatio:s.scaleZoomRatio,translateX:s.translateX,"onUpdate:translateX":t[4]||(t[4]=r=>s.translateX=r),translateY:s.translateY,"onUpdate:translateY":t[5]||(t[5]=r=>s.translateY=r)},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY"]),[[V,s.convertedInfo]]),nt,lt])}var rt=u(Qe,[["render",at],["__scopeId","data-v-32d950b3"]]);const ct={name:"FolderProperties",components:{},props:{file:{type:Object,default:{}}},watch:{file(e,t){}}},dt={class:"folder-properties"},ht={class:"path"},ut=v(" Path: "),mt={class:"path"},_t=n("p",null," You cannot do anything on folders yet. Browse to an image... ",-1);function ft(e,t,o,l,s,i){return c(),d("div",dt,[n("div",ht,[ut,n("span",mt,f(o.file.path),1)]),_t])}var pt=u(ct,[["render",ft]]);const gt={name:"Welcome"},vt={class:"welcome"},yt=n("p",{class:"headline"},[n("div",null,"Welcome to"),n("h3",null,"WebP Convert file manager 0.1")],-1),zt=n("p",null,[v(" At current stage you can browse the image files and compare the original vs the converted file."),n("br"),v(' To open a folder, click the "+" sign next to the folder name or double click the folder name')],-1),bt=n("p",null,[n("h4",null,"Whats new?"),v(" Everything is new! This is the first tentative pre-alpha work-in-progress release. ")],-1),xt=n("p",null,[n("h4",null,"Whats planned ahead?"),v(" Next thing is of course to enable you to trigger conversions. To support development, you can "),n("a",{href:"https://ko-fi.com/rosell",target:"_blank"},"buy me a cup of coffee")],-1),$t=[yt,zt,bt,xt];function wt(e,t,o,l,s,i){return c(),d("div",vt,$t)}var Ct=u(gt,[["render",wt]]);const St={name:"WCFM",components:{SVGs:K,FileProperties:rt,FolderProperties:pt,Modal:Ie,Files:ye,Splitpanes:Y.exports.Splitpanes,Pane:Y.exports.Pane,Welcome:Ct},methods:{onConvertClick(e){var l,s;let t=(s=(l=this.$refs.convertOptions)==null?void 0:l.general)==null?void 0:s.data,o={path:e,convertOptions:t};console.log(o),x.post("convert",o,function(i){console.log("convert response:",i)})},onConvertCloseClick(){console.log("CLRCL"),this.showConvertOptions=!1},onFileSelect(e,t){this.file={path:e,isDir:t}},displayInfo(e){var t=this;x.post("info",{path:e},function(o){t.selectedInfo=o})},sortTree(e){var t=this;return e.children.sort(function(o,l){return o.isDir&&!l.isDir?-1:!o.isDir&&l.isDir||o.name>l.name?1:o.name<l.name?-1:0}),e.children.forEach(function(o){o.isDir&&(o=t.sortTree(o))}),e}},mounted(){var e=this;x.post("get-tree",{folder:""},function(t){e.treeStatusText="sorting...",e.item=e.sortTree(t)})},data(){return{file:null,selectedItem:null,item:null,treeStatusText:"loading file tree...",selectedInfo:{},showConvertOptions:!1}},provide(){return{wcfm:this}}},kt={class:"wcfm",style:{overflow:"hidden"}},Vt={class:"pane-content"},It={key:0,class:"pane-content"};function Ft(e,t,o,l,s,i){const a=h("SVGs"),r=h("Files"),p=h("pane"),g=h("FileProperties"),D=h("FolderProperties"),W=h("Welcome"),N=h("splitpanes");return c(),d("div",kt,[_(a),_(N,{class:"default-theme",style:{position:"absolute",top:"0",left:"0"}},{default:b(()=>[_(p,{size:"30"},{default:b(()=>[n("div",Vt,[n("div",null,[_(r,{item:s.item,statusText:s.treeStatusText,onSelect:i.onFileSelect},null,8,["item","statusText","onSelect"])])])]),_:1}),_(p,{size:"70",style:{"overflow-y":"auto"}},{default:b(()=>[s.file?(c(),d("div",It,[s.file.isDir?m("",!0):(c(),y(g,{key:0,file:s.file},null,8,["file"])),s.file.isDir?(c(),y(D,{key:1,file:s.file},null,8,["file"])):m("",!0)])):m("",!0),s.file?m("",!0):(c(),y(W,{key:1}))]),_:1})]),_:1})])}var Mt=u(St,[["render",Ft]]);const I=L(Mt);I.use(R);I.use(j,{defaultHtml:!1});window.wcfmoptions||(window.wcfmoptions={},window.wcfmoptions.poster=function(e,t,o,l){switch(e){case"get-tree":var s={name:"root",isDir:!0,isOpen:!0,children:[{name:"empty-folder",isDir:!0,children:[]},{name:"file",isDir:!1,isConverted:!0},{name:"aaa",isDir:!1,isConverted:!0},{name:"test-folder",isDir:!0,children:[{name:"banana",isDir:!1},{name:"subfolder",isDir:!0,children:[{name:"file2",isDir:!1},{name:"file1",isDir:!1}]},{name:"apple",isDir:!1}]},{name:"file2",isDir:!1,isConverted:!1}]};break;case"conversion-settings":var s={systemStatus:{converterRequirements:{gd:{extensionLoaded:!1,compiledWithWebP:!0}}}};break;case"info":if(t.path=="root/file2")var s={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/200x100.jpg"},converted:{filename:"file.png.webp",size:70,url:"http://localhost:3000/src/assets/200x100.jpg"},log:"blah blah blah"};else if(t.path=="root/file")var s={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/dummy2.jpg"},log:"blah blah blah"};else var s={original:{filename:"file.png",size:100,url:"http://localhost:3000/src/assets/dummy.jpg"},converted:{filename:"file.png.webp",size:70,url:"http://localhost:3000/src/assets/dummy.jpg"},log:"blah blah blah"};break;case"convert":var s={success:!1,msg:"Image type could not be detected"};break;default:var s="ok";break}o(s)});I.mount("#webpconvert-filemanager");