import{i as k,c as O}from"./app-a6cKceqE.js";import{_ as I}from"./app-C3oVnfUH.js";import{_ as V}from"./app-CQ-vNlMj.js";import{_ as P}from"./app-CignoBaV.js";import{_ as S}from"./app-B8JChEZz.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-BYcXwl4U.js";import{_ as q}from"./app-DwtlHtUX.js";import{_ as y}from"./app-DKwGUiXR.js";import{_ as R}from"./app-B2nvVMhu.js";import{_ as W}from"./app-JrQl8j_T.js";import{_ as C}from"./app-Co4ciZEn.js";import{_ as B}from"./app-DCnS8hND.js";import{D}from"./app-7GBSHA5C.js";import"./app-CLawzVMq.js";import"./app-BeFNDz9n.js";import"./app-BDgR0DSb.js";import"./app-DxjODhok.js";import"./app-DPDEogA0.js";import"./app-CrjU8lgK.js";import"./app-D7QVa3_6.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-BHl80pFw.js";import"./app-Ufpj4Ll4.js";import"./app-ysQ8KbGS.js";import"./app-D2Wz0BUQ.js";import"./app-0YmIdYYs.js";import"./app-DxbU-QrX.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-CNARLpXE.js";import"./app-D5k1HLu9.js";import"./app-MtOp7vk3.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};
