import{i as k,c as O}from"./app-Ba7ZqSpq.js";import{_ as I}from"./app-Cft_lrsr.js";import{_ as V}from"./app-DFulsyXy.js";import{_ as P}from"./app-DWUwCFNm.js";import{_ as S}from"./app-rIYFLdeU.js";import{r as v,o as a,g as m,a as e,u as t,b as s,w as _,c as d,h as l,d as g,f as p,t as N,e as b}from"./app-SC54XQDl.js";import{_ as q}from"./app-FlPLZh9D.js";import{_ as y}from"./app-BzdF9mA3.js";import{_ as R}from"./app-DkOT0Z3c.js";import{_ as W}from"./app-DjJGwY8P.js";import{_ as C}from"./app-BXes872u.js";import{_ as B}from"./app-BEdXL-DZ.js";import{D}from"./app-ZeVDYyDS.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-Dhl-Bw0H.js";import"./app-BjSCO7rC.js";import"./app-CNHjdV6U.js";import"./app-B9xxzP2y.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DZaelcLs.js";import"./app-CVQkwzlf.js";import"./app-DnXuoh8P.js";import"./app-DoVkxbmA.js";import"./app-BxWqoSpr.js";import"./app-PrSv7rSt.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-DgoEZtNT.js";import"./app-Dw0jKdCD.js";import"./app-CHxME8Sw.js";function j(){k(this),this.success=this.$NotifyReloadSuccess("保存成功")}const E=["value"],G=e("td",{class:"title"},"启用WebP压缩",-1),M={class:"comment"},U={key:0},J=["href"],A={key:1},H=e("td",null,"支持的扩展名",-1),z=e("p",{class:"comment"},"含有这些扩展名的URL将会被转成WebP，不区分大小写。",-1),F=e("td",null,"支持的MimeType",-1),K=e("p",{class:"comment"},"响应的Content-Type里包含这些MimeType的内容将会被转成WebP。",-1),Q=e("td",null,"内容最小长度",-1),X=e("p",{class:"comment"},"0表示不限制，内容长度从文件尺寸或Content-Length中获取。",-1),Y=e("td",null,"内容最大长度",-1),Z=e("p",{class:"comment"},"0表示不限制，内容长度从文件尺寸或Content-Length中获取。",-1),ee=e("td",null,"匹配条件",-1),ne={__name:"HTTPWebPConfigBox",props:["v-webp-config","v-is-location","v-is-group","v-require-cache","minCacheLife"],setup(r){const i=r,{config:o,moreOptionsVisible:u}=function(){let n=i.vWebpConfig;return n==null&&(n={isPrior:!1,isOn:!1,minLength:{count:0,unit:"kb"},maxLength:{count:0,unit:"kb"},mimeTypes:["image/png","image/jpeg","image/bmp","image/x-ico"],extensions:[".png",".jpeg",".jpg",".bmp",".ico"],conds:null}),n.mimeTypes==null&&(n.mimeTypes=[]),n.extensions==null&&(n.extensions=[]),{config:v(n),moreOptionsVisible:v(!1)}}(),h=function(){return(!i.vIsLocation&&!i.vIsGroup||o.value.isPrior)&&o.value.isOn},x=function(n){n.forEach(function(c,f){c.length>0&&c[0]!="."&&(n[f]="."+c)}),o.value.extensions=n},L=function(n){o.value.mimeTypes=n},$=function(){u.value=!u.value},w=function(n){o.value.conds=n},T=window.location.toString().replace("/webp?","/cache?");return(n,c)=>(a(),m("div",null,[e("input",{type:"hidden",name:"webpJSON",value:JSON.stringify(t(o))},null,8,E),s(D,null,{default:_(()=>[n.vIsLocation||n.vIsGroup?(a(),d(R,{key:0,"v-config":t(o)},null,8,["v-config"])):l("",!0),g(e("tbody",null,[e("tr",null,[G,e("td",null,[s(q,{value:"1",modelValue:t(o).isOn,"onUpdate:modelValue":c[0]||(c[0]=f=>t(o).isOn=f)},null,8,["modelValue"]),e("p",M,[p("选中后表示开启自动WebP压缩；图片的宽和高均不能超过16383像素"),n.vRequireCache?(a(),m("span",U,[p("；只有满足 "),e("a",{href:t(T)},"[缓存条件]",8,J),p(" 的图片内容才会被转换")])):l("",!0),n.vRequireCache&&r.minCacheLife>0?(a(),m("span",A,"；最小缓存时间为："+N(r.minCacheLife)+"秒",1)):l("",!0),p("。 ")])])])],512),[[b,!n.vIsLocation&&!n.vIsGroup||t(o).isPrior]]),h()?(a(),d(W,{key:1,onChange:$})):l("",!0),g(e("tbody",null,[e("tr",null,[H,e("td",null,[s(y,{values:t(o).extensions,onChange:x,placeholder:"比如 .html"},null,8,["values"]),z])]),e("tr",null,[F,e("td",null,[s(y,{values:t(o).mimeTypes,onChange:L,placeholder:"比如 text/*"},null,8,["values"]),K])]),e("tr",null,[Q,e("td",null,[s(C,{"v-name":"minLength","v-value":t(o).minLength,"v-unit":"kb"},null,8,["v-value"]),X])]),e("tr",null,[Y,e("td",null,[s(C,{"v-name":"maxLength","v-value":t(o).maxLength,"v-unit":"mb"},null,8,["v-value"]),Z])]),e("tr",null,[ee,e("td",null,[s(B,{"v-conds":t(o).conds,onChange:w},null,8,["v-conds"])])])],512),[[b,h()&&t(u)]])]),_:1})]))}},te={key:0},oe=["value"],ie={key:1},Me={__name:"index",setup(r){const i=O(new j);return(o,u)=>(a(),d(I,{ctx:t(i)},{default:_(()=>[t(i).featureIsOn?(a(),m("div",te,[s(V,{action:"$",onSuccess:t(i).success},{default:_(()=>[e("input",{type:"hidden",name:"webId",value:t(i).webId},null,8,oe),s(ne,{"v-webp-config":t(i).webpConfig,"v-require-cache":t(i).requireCache,"min-cache-life":t(i).minCacheLife},null,8,["v-webp-config","v-require-cache","min-cache-life"]),s(P,{class:"mt-4"})]),_:1},8,["onSuccess"])])):l("",!0),t(i).featureIsOn?l("",!0):(a(),m("div",ie,[s(S)]))]),_:1},8,["ctx"]))}};export{Me as default};
