"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[3408,7063],{67063:function(e,t,r){r.r(t),r.d(t,{BaseBrush:function(){return i}});r(21703);class i{constructor(e,t={}){this.canvas=e,this.options=t,this.id=t.id||this.constructor.name,this.name=t.name||"未命名笔刷",this.description=t.description||"",this.icon=t.icon||null,this.category=t.category||"默认",this.brush=null}create(){throw new Error("必须由子类实现create方法")}configure(e,t){throw new Error("必须由子类实现configure方法")}getMetadata(){return{id:this.id,name:this.name,description:this.description,icon:this.icon,category:this.category}}getPreview(){return null}getConfigurableProperties(){return[{id:"size",name:"笔刷大小",type:"slider",defaultValue:5,min:.5,max:100,step:.5,description:"笔刷的大小（像素）",category:"基本",order:10},{id:"color",name:"笔刷颜色",type:"color",defaultValue:"#000000",description:"笔刷的颜色",category:"基本",order:20},{id:"opacity",name:"不透明度",type:"slider",defaultValue:1,min:.05,max:1,step:.01,description:"笔刷的不透明度",category:"基本",order:30}]}mergeWithBaseProperties(e){const t=super.getConfigurableProperties(),r=t.filter((t=>!e.some((e=>e.id===t.id))));return[...r,...e]}updateProperty(e,t){if("size"===e){if(this.brush)return this.brush.width=t,!0}else if("color"===e){if(this.brush)return this.brush.color=t,!0}else if("opacity"===e&&this.brush)return this.brush.opacity=t,!0;return!1}isPropertyVisible(e,t){if(!e.visibleWhen)return!0;if("function"===typeof e.visibleWhen)return e.visibleWhen(t);if("object"===typeof e.visibleWhen){for(const[r,i]of Object.entries(e.visibleWhen))if(t[r]!==i)return!1;return!0}return!0}getDynamicOptions(e,t){return e.dynamicOptions&&"function"===typeof e.dynamicOptions?e.dynamicOptions(t):e.options||[]}onSelected(){}onDeselected(){}destroy(){this.brush=null}}},83408:function(e,t,r){r.r(t),r.d(t,{FurBrush:function(){return s}});r(21703);var i=r(67063);class s extends i.BaseBrush{constructor(e,t={}){super(e,{id:"fur",name:"毛发笔刷",description:"创建类似于毛发或草的纹理效果",category:"特效笔刷",icon:"fur",...t}),this.furLength=t.furLength||10,this.furDensity=t.furDensity||.7,this.furRandomness=t.furRandomness||.5}create(){if(!this.canvas)throw new Error("画布实例不存在");return this.brush=new fabric.FurBrush(this.canvas),this.configure(this.brush,this.options),this.brush}configure(e,t={}){e&&(void 0!==t.width&&(e.width=t.width),void 0!==t.color&&(e.color=t.color),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.furLength&&(this.furLength=t.furLength),void 0!==t.furDensity&&(this.furDensity=t.furDensity),void 0!==t.furRandomness&&(this.furRandomness=t.furRandomness))}setFurLength(e){return this.furLength=Math.max(1,Math.min(50,e)),this.furLength}setFurDensity(e){return this.furDensity=Math.max(.1,Math.min(1,e)),this.furDensity}setFurRandomness(e){return this.furRandomness=Math.max(0,Math.min(1,e)),this.furRandomness}getConfigurableProperties(){const e=super.getConfigurableProperties(),t=[{id:"furLength",name:"毛发长度",type:"slider",defaultValue:this.furLength,min:1,max:50,step:1,description:"控制毛发的长度",category:"毛发设置",order:100},{id:"furDensity",name:"毛发密度",type:"slider",defaultValue:this.furDensity,min:.1,max:1,step:.05,description:"控制毛发的密度",category:"毛发设置",order:110},{id:"furRandomness",name:"随机性",type:"slider",defaultValue:this.furRandomness,min:0,max:1,step:.05,description:"控制毛发的随机分布程度",category:"毛发设置",order:120}];return[...e,...t]}updateProperty(e,t){return!!super.updateProperty(e,t)||("furLength"===e?(this.setFurLength(t),!0):"furDensity"===e?(this.setFurDensity(t),!0):"furRandomness"===e&&(this.setFurRandomness(t),!0))}getPreview(){return"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48cGF0aCBkPSJNMTAgODBMNTAgMjBNMjAgODBMNjAgMjBNMzAgODBMNzAgMjBNNDAgODBMODAgMjBNNTAgODBMOTAgMjAiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIi8+PC9zdmc+"}}}}]);