@zhangqingcq/vgce 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +51 -13
- package/dist/style.css +1 -1
- package/dist/vgce.js +261 -250
- package/dist/vgce.umd.cjs +4 -4
- package/package.json +1 -1
- package/src/components/svg-editor/center-panel.vue +146 -147
- package/src/components/svg-editor/index.vue +5 -1
- package/src/components/svg-viewer.vue +68 -69
- package/src/views/EditorS.vue +21 -21
- package/src/views/Preview.vue +38 -38
package/dist/vgce.umd.cjs
CHANGED
@@ -195,7 +195,7 @@
|
|
195
195
|
<rect x="7" y="22.0476" width="34" height="22" rx="2" stroke="currentColor" stroke-width="4" stroke-linejoin="round" />\r
|
196
196
|
<path d="M14 22V14.0047C13.9948 8.87022 17.9227 4.56718 23.0859 4.05117C28.249 3.53516 32.9673 6.97408 34 12.0059" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />\r
|
197
197
|
<path d="M24 30V36" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />\r
|
198
|
-
</symbol>`,n.insertBefore(i,n.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r()}const main="",index$2="";var ELineBindAnchors=(r=>(r.TopCenter="TopCenter",r.Left="Left",r.Right="Right",r.BottomCenter="BottomCenter",r))(ELineBindAnchors||{}),EConfigAnimationsType=(r=>(r.None="None",r.Electricity="Electricity",r.WaterDrop="WaterDrop",r.Track="Track",r))(EConfigAnimationsType||{}),EConfigItemPropsType=(r=>(r.Input="Input",r.Textarea="Textarea",r.Color="Color",r.InputNumber="InputNumber",r.Switch="Switch",r.JsonEdit="JsonEdit",r.Select="Select",r))(EConfigItemPropsType||{}),EDoneJsonType=(r=>(r.File="File",r.StraightLine="StraightLine",r.ConnectionLine="ConnectionLine",r.CustomSvg="CustomSvg",r.Vue="Vue",r))(EDoneJsonType||{}),EEventType=(r=>(r.Click="Click",r.Change="Change",r.Null="",r))(EEventType||{}),EEventAction=(r=>(r.ChangeAttr="ChangeAttr",r.JavaScript="JavaScript",r.Null="",r))(EEventAction||{}),EConditionType=(r=>(r.None="None",r.Relation="Relation",r))(EConditionType||{}),EGlobalStoreIntention=(r=>(r.None="None",r.Create="Create",r.Move="Move",r.GroupMove="GroupMove",r.MoveCanvas="MoveCanvas",r.Select="Select",r.Zoom="Zoom",r.Rotate="Rotate",r.Connection="Connection",r.SetConnectionLineNode="SetConnectionLineNode",r.ContextMenu="ContextMenu",r.SelectArea="SelectArea",r))(EGlobalStoreIntention||{}),EMouseInfoState=(r=>(r.Down="Down",r.Up="Up",r))(EMouseInfoState||{}),EScaleInfoType=(r=>(r.None="",r.TopLeft="TopLeft",r.TopCenter="TopCenter",r.TopRight="TopRight",r.Left="Left",r.Right="Right",r.BottomLeft="BottomLeft",r.BottomCenter="BottomCenter",r.BottomRight="BottomRight",r))(EScaleInfoType||{});const t$p={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"white",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$o={groupType:"stateful",title:"状态SVG",list:[t$p]},t$n={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:120}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$m={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$l={name:"hotpot",title:"火锅",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$k={name:"hamburger",title:"汉堡",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$j={groupType:"stateless",title:"静态SVG",list:[t$k,t$l,t$n,t$m]},t$i={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$h={groupType:"have_animation",title:"动画SVG",list:[t$i]},t$g={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$f={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$e={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:60},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:50},isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$d={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{centerColor:{title:"针顶颜色",type:EConfigItemPropsType.Color,val:"#EBF257"},secondsColor:{title:"秒针颜色",type:EConfigItemPropsType.Color,val:"#E83E24"},circleColor:{title:"针圈颜色",type:EConfigItemPropsType.Color,val:"#F45AFC"},minutesColor:{title:"分针颜色",type:EConfigItemPropsType.Color,val:"#50E68E"},hoursColor:{title:"时针颜色",type:EConfigItemPropsType.Color,val:"#9A36E7"},scaleColor:{title:"刻度颜色",type:EConfigItemPropsType.Color,val:"#4942CF"},backgroundColor:{title:"表盘颜色",type:EConfigItemPropsType.Color,val:"#ffffff"},borderColor:{title:"表框颜色",type:EConfigItemPropsType.Color,val:"#B3A7FF"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$c={groupType:"custom_svg_group",title:"SVG组件",list:[t$g,t$f,t$e,t$d]},t$b=Object.seal([t$j,t$o,t$h,t$c]),t$a={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$9={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$8={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$7={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$6={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$5={name:"text-box",title:"文字背景框",tag:"text-box",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:250},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},bgColor:{title:"背景颜色",type:EConfigItemPropsType.Color,val:"#000000"},bgOpacity:{title:"背景透明度(%)",type:EConfigItemPropsType.InputNumber,val:1},borderColor:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#cccccc"},borderWidth:{title:"边框宽度",type:EConfigItemPropsType.InputNumber,val:1},borderRadius:{title:"边框圆角",type:EConfigItemPropsType.InputNumber,val:5},borderOpacity:{title:"边框透明度(%)",type:EConfigItemPropsType.InputNumber,val:100}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$4={groupType:"custom-vue",title:"VUE组件",list:[t$a,t$6,t$9,t$8,t$7,t$5]},t$3={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$2={groupType:"echarts",title:"图表",list:[t$3]},t$1=Object.seal([t$4,t$2]),_sfc_main$M=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(r,{emit:n}){const i=r,o=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>i.percentage,()=>{n("onChange")}),(a,u)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElProgress),{type:"dashboard",percentage:Number(i.percentage),color:o},null,8,["percentage"]))}}),_hoisted_1$m=["id"],_hoisted_2$i=["id"],_hoisted_3$f=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$7=[_hoisted_3$f,_hoisted_4$b,_hoisted_5$9],_hoisted_7$7=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$5=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$L=vue.defineComponent({__name:"switch-r",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-open`},_hoisted_6$7,8,_hoisted_2$i),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-close`},_hoisted_12$5,8,_hoisted_7$7),vue.createElementVNode("use",{"xlink:href":`#${i.id}switch-demo-${i.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$m))}}),_sfc_main$K=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.text,()=>{vue.nextTick(function(){n("resize")})}),(o,a)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":i.bold?"bold":"normal"})},vue.toDisplayString(i.text),5))}}),_sfc_main$J=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(r){const n=r,i=vue.ref({});return vue.watchEffect(()=>{const{colConfig:o,...a}=n;i.value=a}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(i))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,u=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTableColumn),vue.mergeProps({key:u.prop},u),null,16))),128))]),_:1},16))}}),_hoisted_1$l={class:"flex mt-5px"},_sfc_main$I=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(r){const n=r,i=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),o=vue.ref(new Date),a=vue.ref(),u=vue.computed(()=>{const d=o.value.getFullYear(),h=o.value.getMonth()+1,v=o.value.getDate();return d.toString()+"年"+h.toString()+"月"+v.toString()+"日"}),c=vue.computed(()=>{const d=o.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][d]}),f=vue.computed(()=>{const d=o.value.getHours(),h=o.value.getMinutes(),v=o.value.getSeconds();return(d<10?"0"+d.toString():d.toString())+":"+(h<10?"0"+h.toString():h.toString())+":"+(v<10?"0"+v.toString():v.toString())});return vue.onMounted(()=>{a.value=setInterval(()=>{o.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(a.value)}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(u)),5),vue.createElementVNode("div",_hoisted_1$l,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(c)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(f)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc$1=(r,n)=>{const i=r.__vccOpts||r;for(const[o,a]of n)i[o]=a;return i},NowTime=_export_sfc$1(_sfc_main$I,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
|
198
|
+
</symbol>`,n.insertBefore(i,n.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r()}const main="",index$2="";var ELineBindAnchors=(r=>(r.TopCenter="TopCenter",r.Left="Left",r.Right="Right",r.BottomCenter="BottomCenter",r))(ELineBindAnchors||{}),EConfigAnimationsType=(r=>(r.None="None",r.Electricity="Electricity",r.WaterDrop="WaterDrop",r.Track="Track",r))(EConfigAnimationsType||{}),EConfigItemPropsType=(r=>(r.Input="Input",r.Textarea="Textarea",r.Color="Color",r.InputNumber="InputNumber",r.Switch="Switch",r.JsonEdit="JsonEdit",r.Select="Select",r))(EConfigItemPropsType||{}),EDoneJsonType=(r=>(r.File="File",r.StraightLine="StraightLine",r.ConnectionLine="ConnectionLine",r.CustomSvg="CustomSvg",r.Vue="Vue",r))(EDoneJsonType||{}),EEventType=(r=>(r.Click="Click",r.Change="Change",r.Null="",r))(EEventType||{}),EEventAction=(r=>(r.ChangeAttr="ChangeAttr",r.JavaScript="JavaScript",r.Null="",r))(EEventAction||{}),EConditionType=(r=>(r.None="None",r.Relation="Relation",r))(EConditionType||{}),EGlobalStoreIntention=(r=>(r.None="None",r.Create="Create",r.Move="Move",r.GroupMove="GroupMove",r.MoveCanvas="MoveCanvas",r.Select="Select",r.Zoom="Zoom",r.Rotate="Rotate",r.Connection="Connection",r.SetConnectionLineNode="SetConnectionLineNode",r.ContextMenu="ContextMenu",r.SelectArea="SelectArea",r))(EGlobalStoreIntention||{}),EMouseInfoState=(r=>(r.Down="Down",r.Up="Up",r))(EMouseInfoState||{}),EScaleInfoType=(r=>(r.None="",r.TopLeft="TopLeft",r.TopCenter="TopCenter",r.TopRight="TopRight",r.Left="Left",r.Right="Right",r.BottomLeft="BottomLeft",r.BottomCenter="BottomCenter",r.BottomRight="BottomRight",r))(EScaleInfoType||{});const t$p={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"white",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$o={groupType:"stateful",title:"状态SVG",list:[t$p]},t$n={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:120}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$m={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$l={name:"hotpot",title:"火锅",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$k={name:"hamburger",title:"汉堡",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$j={groupType:"stateless",title:"静态SVG",list:[t$k,t$l,t$n,t$m]},t$i={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$h={groupType:"have_animation",title:"动画SVG",list:[t$i]},t$g={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$f={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$e={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:60},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:50},isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$d={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{centerColor:{title:"针顶颜色",type:EConfigItemPropsType.Color,val:"#EBF257"},secondsColor:{title:"秒针颜色",type:EConfigItemPropsType.Color,val:"#E83E24"},circleColor:{title:"针圈颜色",type:EConfigItemPropsType.Color,val:"#F45AFC"},minutesColor:{title:"分针颜色",type:EConfigItemPropsType.Color,val:"#50E68E"},hoursColor:{title:"时针颜色",type:EConfigItemPropsType.Color,val:"#9A36E7"},scaleColor:{title:"刻度颜色",type:EConfigItemPropsType.Color,val:"#4942CF"},backgroundColor:{title:"表盘颜色",type:EConfigItemPropsType.Color,val:"#ffffff"},borderColor:{title:"表框颜色",type:EConfigItemPropsType.Color,val:"#B3A7FF"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$c={groupType:"custom_svg_group",title:"SVG组件",list:[t$g,t$f,t$e,t$d]},t$b=Object.seal([t$j,t$o,t$h,t$c]),t$a={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$9={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$8={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$7={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$6={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$5={name:"text-box",title:"文字背景框",tag:"text-box",type:EDoneJsonType.Vue,config:{can_zoom:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:250},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:150},bgColor:{title:"背景颜色",type:EConfigItemPropsType.Color,val:"#000000"},bgOpacity:{title:"背景透明度(%)",type:EConfigItemPropsType.InputNumber,val:1},borderColor:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#cccccc"},borderWidth:{title:"边框宽度",type:EConfigItemPropsType.InputNumber,val:1},borderRadius:{title:"边框圆角",type:EConfigItemPropsType.InputNumber,val:5},borderOpacity:{title:"边框透明度(%)",type:EConfigItemPropsType.InputNumber,val:100}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$4={groupType:"custom-vue",title:"VUE组件",list:[t$a,t$6,t$9,t$8,t$7,t$5]},t$3={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},t$2={groupType:"echarts",title:"图表",list:[t$3]},t$1=Object.seal([t$4,t$2]),_sfc_main$M=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(r,{emit:n}){const i=r,o=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>i.percentage,()=>{n("onChange")}),(a,u)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElProgress),{type:"dashboard",percentage:Number(i.percentage),color:o},null,8,["percentage"]))}}),_hoisted_1$m=["id"],_hoisted_2$i=["id"],_hoisted_3$f=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$8=[_hoisted_3$f,_hoisted_4$b,_hoisted_5$9],_hoisted_7$8=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$5=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$L=vue.defineComponent({__name:"switch-r",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-open`},_hoisted_6$8,8,_hoisted_2$i),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${i.id}switch-demo-close`},_hoisted_12$5,8,_hoisted_7$8),vue.createElementVNode("use",{"xlink:href":`#${i.id}switch-demo-${i.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$m))}}),_sfc_main$K=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.text,()=>{vue.nextTick(function(){n("resize")})}),(o,a)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":i.bold?"bold":"normal"})},vue.toDisplayString(i.text),5))}}),_sfc_main$J=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(r){const n=r,i=vue.ref({});return vue.watchEffect(()=>{const{colConfig:o,...a}=n;i.value=a}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(i))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,u=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTableColumn),vue.mergeProps({key:u.prop},u),null,16))),128))]),_:1},16))}}),_hoisted_1$l={class:"flex mt-5px"},_sfc_main$I=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(r){const n=r,i=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),o=vue.ref(new Date),a=vue.ref(),u=vue.computed(()=>{const d=o.value.getFullYear(),h=o.value.getMonth()+1,v=o.value.getDate();return d.toString()+"年"+h.toString()+"月"+v.toString()+"日"}),c=vue.computed(()=>{const d=o.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][d]}),f=vue.computed(()=>{const d=o.value.getHours(),h=o.value.getMinutes(),v=o.value.getSeconds();return(d<10?"0"+d.toString():d.toString())+":"+(h<10?"0"+h.toString():h.toString())+":"+(v<10?"0"+v.toString():v.toString())});return vue.onMounted(()=>{a.value=setInterval(()=>{o.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(a.value)}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(u)),5),vue.createElementVNode("div",_hoisted_1$l,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(c)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(i))},vue.toDisplayString(vue.unref(f)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc$1=(r,n)=>{const i=r.__vccOpts||r;for(const[o,a]of n)i[o]=a;return i},NowTime=_export_sfc$1(_sfc_main$I,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
|
199
199
|
Copyright (c) Microsoft Corporation.
|
200
200
|
|
201
201
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -241,7 +241,7 @@ echarts.use([`+z+"]);":"Unknown series "+V))}return}if(g==="tooltip"){if(S){proc
|
|
241
241
|
|
242
242
|
`:"<br/>",w=g.join(A);this._showOrMove(f,function(){this._updateContentNotChangedOnAxis(i,h)?this._updatePosition(f,y,c[0],c[1],this._tooltipContent,h):this._showTooltipContent(f,w,h,Math.random()+"",c[0],c[1],y,null,p)})},n.prototype._showSeriesItemTooltip=function(i,o,a){var u=this._ecModel,c=getECData(o),f=c.seriesIndex,d=u.getSeriesByIndex(f),h=c.dataModel||d,v=c.dataIndex,g=c.dataType,p=h.getData(g),y=this._renderMode,_=i.positionDefault,b=buildTooltipModel([p.getItemModel(v),h,d&&(d.coordinateSystem||{}).model],this._tooltipModel,_?{position:_}:null),A=b.get("trigger");if(!(A!=null&&A!=="item")){var w=h.getDataParams(v,g),T=new TooltipMarkupStyleCreator;w.marker=T.makeTooltipMarker("item",convertToColorString(w.color),y);var S=normalizeTooltipFormatResult(h.formatTooltip(v,!1,g)),x=b.get("order"),O=b.get("valueFormatter"),L=S.frag,M=L?buildTooltipMarkup(O?extend({valueFormatter:O},L):L,T,y,x,u.get("useUTC"),b.get("textStyle")):S.text,re="item_"+h.name+"_"+v;this._showOrMove(b,function(){this._showTooltipContent(b,M,w,re,i.offsetX,i.offsetY,i.position,i.target,T)}),a({type:"showTip",dataIndexInside:v,dataIndex:p.getRawIndex(v),seriesIndex:f,from:this.uid})}},n.prototype._showComponentItemTooltip=function(i,o,a){var u=getECData(o),c=u.tooltipConfig,f=c.option||{};if(isString$2(f)){var d=f;f={content:d,formatter:d}}var h=[f],v=this._ecModel.getComponent(u.componentMainType,u.componentIndex);v&&h.push(v),h.push({formatter:f.content});var g=i.positionDefault,p=buildTooltipModel(h,this._tooltipModel,g?{position:g}:null),y=p.get("content"),_=Math.random()+"",b=new TooltipMarkupStyleCreator;this._showOrMove(p,function(){var A=clone$2(p.get("formatterParams")||{});this._showTooltipContent(p,y,A,_,i.offsetX,i.offsetY,i.position,o,b)}),a({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(i,o,a,u,c,f,d,h,v){if(this._ticket="",!(!i.get("showContent")||!i.get("show"))){var g=this._tooltipContent;g.setEnterable(i.get("enterable"));var p=i.get("formatter");d=d||i.get("position");var y=o,_=this._getNearestPoint([c,f],a,i.get("trigger"),i.get("borderColor")),b=_.color;if(p)if(isString$2(p)){var A=i.ecModel.get("useUTC"),w=isArray$1(a)?a[0]:a,T=w&&w.axisType&&w.axisType.indexOf("time")>=0;y=p,T&&(y=format$1(w.axisValue,y,A)),y=formatTpl(y,a,!0)}else if(isFunction$1(p)){var S=bind$1(function(x,O){x===this._ticket&&(g.setContent(O,v,i,b,d),this._updatePosition(i,d,c,f,g,a,h))},this);this._ticket=u,y=p(a,u,S)}else y=p;g.setContent(y,v,i,b,d),g.show(i,b),this._updatePosition(i,d,c,f,g,a,h)}},n.prototype._getNearestPoint=function(i,o,a,u){if(a==="axis"||isArray$1(o))return{color:u||(this._renderMode==="html"?"#fff":"none")};if(!isArray$1(o))return{color:u||o.color||o.borderColor}},n.prototype._updatePosition=function(i,o,a,u,c,f,d){var h=this._api.getWidth(),v=this._api.getHeight();o=o||i.get("position");var g=c.getSize(),p=i.get("align"),y=i.get("verticalAlign"),_=d&&d.getBoundingRect().clone();if(d&&_.applyTransform(d.transform),isFunction$1(o)&&(o=o([a,u],f,c.el,_,{viewSize:[h,v],contentSize:g.slice()})),isArray$1(o))a=parsePercent(o[0],h),u=parsePercent(o[1],v);else if(isObject$3(o)){var b=o;b.width=g[0],b.height=g[1];var A=getLayoutRect(b,{width:h,height:v});a=A.x,u=A.y,p=null,y=null}else if(isString$2(o)&&d){var w=calcTooltipPosition(o,_,g,i.get("borderWidth"));a=w[0],u=w[1]}else{var w=refixTooltipPosition(a,u,c,h,v,p?null:20,y?null:20);a=w[0],u=w[1]}if(p&&(a-=isCenterAlign(p)?g[0]/2:p==="right"?g[0]:0),y&&(u-=isCenterAlign(y)?g[1]/2:y==="bottom"?g[1]:0),shouldTooltipConfine(i)){var w=confineTooltipPosition(a,u,c,h,v);a=w[0],u=w[1]}c.moveTo(a,u)},n.prototype._updateContentNotChangedOnAxis=function(i,o){var a=this._lastDataByCoordSys,u=this._cbParamsList,c=!!a&&a.length===i.length;return c&&each$4(a,function(f,d){var h=f.dataByAxis||[],v=i[d]||{},g=v.dataByAxis||[];c=c&&h.length===g.length,c&&each$4(h,function(p,y){var _=g[y]||{},b=p.seriesDataIndices||[],A=_.seriesDataIndices||[];c=c&&p.value===_.value&&p.axisType===_.axisType&&p.axisId===_.axisId&&b.length===A.length,c&&each$4(b,function(w,T){var S=A[T];c=c&&w.seriesIndex===S.seriesIndex&&w.dataIndex===S.dataIndex}),u&&each$4(p.seriesDataIndices,function(w){var T=w.seriesIndex,S=o[T],x=u[T];S&&x&&x.data!==S.data&&(c=!1)})})}),this._lastDataByCoordSys=i,this._cbParamsList=o,!!c},n.prototype._hide=function(i){this._lastDataByCoordSys=null,i({type:"hideTip",from:this.uid})},n.prototype.dispose=function(i,o){env$1.node||!o.getDom()||(clear(this,"_updatePosition"),this._tooltipContent.dispose(),unregister("itemTooltip",o))},n.type="tooltip",n}(ComponentView$1);function buildTooltipModel(r,n,i){var o=n.ecModel,a;i?(a=new Model$1(i,o,o),a=new Model$1(n.option,a,o)):a=n;for(var u=r.length-1;u>=0;u--){var c=r[u];c&&(c instanceof Model$1&&(c=c.get("tooltip",!0)),isString$2(c)&&(c={formatter:c}),c&&(a=new Model$1(c,a,o)))}return a}function makeDispatchAction(r,n){return r.dispatchAction||bind$1(n.dispatchAction,n)}function refixTooltipPosition(r,n,i,o,a,u,c){var f=i.getSize(),d=f[0],h=f[1];return u!=null&&(r+d+u+2>o?r-=d+u:r+=u),c!=null&&(n+h+c>a?n-=h+c:n+=c),[r,n]}function confineTooltipPosition(r,n,i,o,a){var u=i.getSize(),c=u[0],f=u[1];return r=Math.min(r+c,o)-c,n=Math.min(n+f,a)-f,r=Math.max(r,0),n=Math.max(n,0),[r,n]}function calcTooltipPosition(r,n,i,o){var a=i[0],u=i[1],c=Math.ceil(Math.SQRT2*o)+8,f=0,d=0,h=n.width,v=n.height;switch(r){case"inside":f=n.x+h/2-a/2,d=n.y+v/2-u/2;break;case"top":f=n.x+h/2-a/2,d=n.y-u-c;break;case"bottom":f=n.x+h/2-a/2,d=n.y+v+c;break;case"left":f=n.x-a-c,d=n.y+v/2-u/2;break;case"right":f=n.x+h+c,d=n.y+v/2-u/2}return[f,d]}function isCenterAlign(r){return r==="center"||r==="middle"}function findComponentReference(r,n,i){var o=preParseFinder(r).queryOptionMap,a=o.keys()[0];if(!(!a||a==="series")){var u=queryReferringComponents(n,a,o.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),c=u.models[0];if(c){var f=i.getViewOfComponentModel(c),d;if(f.group.traverse(function(h){var v=getECData(h).tooltipConfig;if(v&&v.name===r.name)return d=h,!0}),d)return{componentMainType:a,componentIndex:c.componentIndex,el:d}}}}const TooltipView$1=TooltipView;function install$4(r){use(install$5),r.registerComponentModel(TooltipModel$1),r.registerComponentView(TooltipView$1),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},noop$1),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},noop$1)}var TitleModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.layoutMode={type:"box",ignoreSize:!0},i}return n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},n}(ComponentModel$1),TitleView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.render=function(i,o,a){if(this.group.removeAll(),!!i.get("show")){var u=this.group,c=i.getModel("textStyle"),f=i.getModel("subtextStyle"),d=i.get("textAlign"),h=retrieve2(i.get("textBaseline"),i.get("textVerticalAlign")),v=new ZRText$1({style:createTextStyle(c,{text:i.get("text"),fill:c.getTextColor()},{disableBox:!0}),z2:10}),g=v.getBoundingRect(),p=i.get("subtext"),y=new ZRText$1({style:createTextStyle(f,{text:p,fill:f.getTextColor(),y:g.height+i.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),_=i.get("link"),b=i.get("sublink"),A=i.get("triggerEvent",!0);v.silent=!_&&!A,y.silent=!b&&!A,_&&v.on("click",function(){windowOpen(_,"_"+i.get("target"))}),b&&y.on("click",function(){windowOpen(b,"_"+i.get("subtarget"))}),getECData(v).eventData=getECData(y).eventData=A?{componentType:"title",componentIndex:i.componentIndex}:null,u.add(v),p&&u.add(y);var w=u.getBoundingRect(),T=i.getBoxLayoutParams();T.width=w.width,T.height=w.height;var S=getLayoutRect(T,{width:a.getWidth(),height:a.getHeight()},i.get("padding"));d||(d=i.get("left")||i.get("right"),d==="middle"&&(d="center"),d==="right"?S.x+=S.width:d==="center"&&(S.x+=S.width/2)),h||(h=i.get("top")||i.get("bottom"),h==="center"&&(h="middle"),h==="bottom"?S.y+=S.height:h==="middle"&&(S.y+=S.height/2),h=h||"top"),u.x=S.x,u.y=S.y,u.markRedraw();var x={align:d,verticalAlign:h};v.setStyle(x),y.setStyle(x),w=u.getBoundingRect();var O=S.margin,L=i.getItemStyle(["color","opacity"]);L.fill=i.get("backgroundColor");var M=new Rect$1({shape:{x:w.x-O[3],y:w.y-O[0],width:w.width+O[1]+O[3],height:w.height+O[0]+O[2],r:i.get("borderRadius")},style:L,subPixelOptimize:!0,silent:!0});u.add(M)}},n.type="title",n}(ComponentView$1);function install$3(r){r.registerComponentModel(TitleModel),r.registerComponentView(TitleView)}var getDefaultSelectorOptions=function(r,n){if(n==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(n==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},LegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.layoutMode={type:"box",ignoreSize:!0},i}return n.prototype.init=function(i,o,a){this.mergeDefaultAndTheme(i,a),i.selected=i.selected||{},this._updateSelector(i)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),this._updateSelector(i)},n.prototype._updateSelector=function(i){var o=i.selector,a=this.ecModel;o===!0&&(o=i.selector=["all","inverse"]),isArray$1(o)&&each$4(o,function(u,c){isString$2(u)&&(u={type:u}),o[c]=merge(u,getDefaultSelectorOptions(a,u.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var i=this._data;if(i[0]&&this.get("selectedMode")==="single"){for(var o=!1,a=0;a<i.length;a++){var u=i[a].get("name");if(this.isSelected(u)){this.select(u),o=!0;break}}!o&&this.select(i[0].get("name"))}},n.prototype._updateData=function(i){var o=[],a=[];i.eachRawSeries(function(d){var h=d.name;a.push(h);var v;if(d.legendVisualProvider){var g=d.legendVisualProvider,p=g.getAllNames();i.isSeriesFiltered(d)||(a=a.concat(p)),p.length?o=o.concat(p):v=!0}else v=!0;v&&isNameSpecified(d)&&o.push(d.name)}),this._availableNames=a;var u=this.get("data")||o,c=createHashMap(),f=map$1(u,function(d){return(isString$2(d)||isNumber$1(d))&&(d={name:d}),c.get(d.name)?null:(c.set(d.name,!0),new Model$1(d,this,this.ecModel))},this);this._data=filter(f,function(d){return!!d})},n.prototype.getData=function(){return this._data},n.prototype.select=function(i){var o=this.option.selected,a=this.get("selectedMode");if(a==="single"){var u=this._data;each$4(u,function(c){o[c.get("name")]=!1})}o[i]=!0},n.prototype.unSelect=function(i){this.get("selectedMode")!=="single"&&(this.option.selected[i]=!1)},n.prototype.toggleSelected=function(i){var o=this.option.selected;o.hasOwnProperty(i)||(o[i]=!0),this[o[i]?"unSelect":"select"](i)},n.prototype.allSelect=function(){var i=this._data,o=this.option.selected;each$4(i,function(a){o[a.get("name",!0)]=!0})},n.prototype.inverseSelect=function(){var i=this._data,o=this.option.selected;each$4(i,function(a){var u=a.get("name",!0);o.hasOwnProperty(u)||(o[u]=!0),o[u]=!o[u]})},n.prototype.isSelected=function(i){var o=this.option.selected;return!(o.hasOwnProperty(i)&&!o[i])&&indexOf(this._availableNames,i)>=0},n.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},n}(ComponentModel$1);const LegendModel$1=LegendModel;var curry=curry$1,each=each$4,Group$1=Group$3,LegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!1,i}return n.prototype.init=function(){this.group.add(this._contentGroup=new Group$1),this.group.add(this._selectorGroup=new Group$1),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(i,o,a){var u=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!i.get("show",!0)){var c=i.get("align"),f=i.get("orient");(!c||c==="auto")&&(c=i.get("left")==="right"&&f==="vertical"?"right":"left");var d=i.get("selector",!0),h=i.get("selectorPosition",!0);d&&(!h||h==="auto")&&(h=f==="horizontal"?"end":"start"),this.renderInner(c,i,o,a,d,f,h);var v=i.getBoxLayoutParams(),g={width:a.getWidth(),height:a.getHeight()},p=i.get("padding"),y=getLayoutRect(v,g,p),_=this.layoutInner(i,c,y,u,d,h),b=getLayoutRect(defaults({width:_.width,height:_.height},v),g,p);this.group.x=b.x-_.x,this.group.y=b.y-_.y,this.group.markRedraw(),this.group.add(this._backgroundEl=makeBackground(_,i))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this.getContentGroup(),v=createHashMap(),g=o.get("selectedMode"),p=[];a.eachRawSeries(function(y){!y.get("legendHoverLink")&&p.push(y.id)}),each(o.getData(),function(y,_){var b=y.get("name");if(!this.newlineDisabled&&(b===""||b===`
|
243
243
|
`)){var A=new Group$1;A.newline=!0,h.add(A);return}var w=a.getSeriesByName(b)[0];if(!v.get(b)){if(w){var T=w.getData(),S=T.getVisual("legendLineStyle")||{},x=T.getVisual("legendIcon"),O=T.getVisual("style"),L=this._createItem(w,b,_,y,o,i,S,O,x,g,u);L.on("click",curry(dispatchSelectAction,b,null,u,p)).on("mouseover",curry(dispatchHighlightAction,w.name,null,u,p)).on("mouseout",curry(dispatchDownplayAction,w.name,null,u,p)),v.set(b,!0)}else a.eachRawSeries(function(M){if(!v.get(b)&&M.legendVisualProvider){var re=M.legendVisualProvider;if(!re.containName(b))return;var F=re.indexOfName(b),j=re.getItemVisual(F,"style"),V=re.getItemVisual(F,"legendIcon"),z=parse(j.fill);z&&z[3]===0&&(z[3]=.2,j=extend(extend({},j),{fill:stringify(z,"rgba")}));var $=this._createItem(M,b,_,y,o,i,{},j,V,g,u);$.on("click",curry(dispatchSelectAction,null,b,u,p)).on("mouseover",curry(dispatchHighlightAction,null,b,u,p)).on("mouseout",curry(dispatchDownplayAction,null,b,u,p)),v.set(b,!0)}},this);process.env.NODE_ENV!=="production"&&(v.get(b)||console.warn(b+" series not exists. Legend data should be same with series name or data name."))}},this),c&&this._createSelector(c,o,u,f,d)},n.prototype._createSelector=function(i,o,a,u,c){var f=this.getSelectorGroup();each(i,function(h){var v=h.type,g=new ZRText$1({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){a.dispatchAction({type:v==="all"?"legendAllSelect":"legendInverseSelect"})}});f.add(g);var p=o.getModel("selectorLabel"),y=o.getModel(["emphasis","selectorLabel"]);setLabelStyle(g,{normal:p,emphasis:y},{defaultText:h.title}),enableHoverEmphasis(g)})},n.prototype._createItem=function(i,o,a,u,c,f,d,h,v,g,p){var y=i.visualDrawType,_=c.get("itemWidth"),b=c.get("itemHeight"),A=c.isSelected(o),w=u.get("symbolRotate"),T=u.get("symbolKeepAspect"),S=u.get("icon");v=S||v||"roundRect";var x=getLegendStyle(v,u,d,h,y,A,p),O=new Group$1,L=u.getModel("textStyle");if(isFunction$1(i.getLegendIcon)&&(!S||S==="inherit"))O.add(i.getLegendIcon({itemWidth:_,itemHeight:b,icon:v,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:T}));else{var M=S==="inherit"&&i.getData().getVisual("symbol")?w==="inherit"?i.getData().getVisual("symbolRotate"):w:0;O.add(getDefaultLegendIcon({itemWidth:_,itemHeight:b,icon:v,iconRotate:M,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:T}))}var re=f==="left"?_+5:-5,F=f,j=c.get("formatter"),V=o;isString$2(j)&&j?V=j.replace("{name}",o??""):isFunction$1(j)&&(V=j(o));var z=u.get("inactiveColor");O.add(new ZRText$1({style:createTextStyle(L,{text:V,x:re,y:b/2,fill:A?L.getTextColor():z,align:F,verticalAlign:"middle"})}));var $=new Rect$1({shape:O.getBoundingRect(),invisible:!0}),he=u.getModel("tooltip");return he.get("show")&&setTooltipConfig({el:$,componentModel:c,itemName:o,itemTooltipOption:he.option}),O.add($),O.eachChild(function(le){le.silent=!0}),$.silent=!g,this.getContentGroup().add(O),enableHoverEmphasis(O),O.__legendDataIndex=a,O},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getContentGroup(),h=this.getSelectorGroup();box(i.get("orient"),d,i.get("itemGap"),a.width,a.height);var v=d.getBoundingRect(),g=[-v.x,-v.y];if(h.markRedraw(),d.markRedraw(),c){box("horizontal",h,i.get("selectorItemGap",!0));var p=h.getBoundingRect(),y=[-p.x,-p.y],_=i.get("selectorButtonGap",!0),b=i.getOrient().index,A=b===0?"width":"height",w=b===0?"height":"width",T=b===0?"y":"x";f==="end"?y[b]+=v[A]+_:g[b]+=p[A]+_,y[1-b]+=v[w]/2-p[w]/2,h.x=y[0],h.y=y[1],d.x=g[0],d.y=g[1];var S={x:0,y:0};return S[A]=v[A]+_+p[A],S[w]=Math.max(v[w],p[w]),S[T]=Math.min(0,p[T]+y[1-b]),S}else return d.x=g[0],d.y=g[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(ComponentView$1);function getLegendStyle(r,n,i,o,a,u,c){function f(A,w){A.lineWidth==="auto"&&(A.lineWidth=w.lineWidth>0?2:0),each(A,function(T,S){A[S]==="inherit"&&(A[S]=w[S])})}var d=n.getModel("itemStyle"),h=d.getItemStyle(),v=r.lastIndexOf("empty",0)===0?"fill":"stroke",g=d.getShallow("decal");h.decal=!g||g==="inherit"?o.decal:createOrUpdatePatternFromDecal(g,c),h.fill==="inherit"&&(h.fill=o[a]),h.stroke==="inherit"&&(h.stroke=o[v]),h.opacity==="inherit"&&(h.opacity=(a==="fill"?o:i).opacity),f(h,o);var p=n.getModel("lineStyle"),y=p.getLineStyle();if(f(y,i),h.fill==="auto"&&(h.fill=o.fill),h.stroke==="auto"&&(h.stroke=o.fill),y.stroke==="auto"&&(y.stroke=o.fill),!u){var _=n.get("inactiveBorderWidth"),b=h[v];h.lineWidth=_==="auto"?o.lineWidth>0&&b?2:0:h.lineWidth,h.fill=n.get("inactiveColor"),h.stroke=n.get("inactiveBorderColor"),y.stroke=p.get("inactiveColor"),y.lineWidth=p.get("inactiveWidth")}return{itemStyle:h,lineStyle:y}}function getDefaultLegendIcon(r){var n=r.icon||"roundRect",i=createSymbol(n,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return i.setStyle(r.itemStyle),i.rotation=(r.iconRotate||0)*Math.PI/180,i.setOrigin([r.itemWidth/2,r.itemHeight/2]),n.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i}function dispatchSelectAction(r,n,i,o){dispatchDownplayAction(r,n,i,o),i.dispatchAction({type:"legendToggleSelect",name:r??n}),dispatchHighlightAction(r,n,i,o)}function isUseHoverLayer(r){for(var n=r.getZr().storage.getDisplayList(),i,o=0,a=n.length;o<a&&!(i=n[o].states.emphasis);)o++;return i&&i.hoverLayer}function dispatchHighlightAction(r,n,i,o){isUseHoverLayer(i)||i.dispatchAction({type:"highlight",seriesName:r,name:n,excludeSeriesId:o})}function dispatchDownplayAction(r,n,i,o){isUseHoverLayer(i)||i.dispatchAction({type:"downplay",seriesName:r,name:n,excludeSeriesId:o})}const LegendView$1=LegendView;function legendFilter(r){var n=r.findComponents({mainType:"legend"});n&&n.length&&r.filterSeries(function(i){for(var o=0;o<n.length;o++)if(!n[o].isSelected(i.name))return!1;return!0})}function legendSelectActionHandler(r,n,i){var o={},a=r==="toggleSelected",u;return i.eachComponent("legend",function(c){a&&u!=null?c[u?"select":"unSelect"](n.name):r==="allSelect"||r==="inverseSelect"?c[r]():(c[r](n.name),u=c.isSelected(n.name));var f=c.getData();each$4(f,function(d){var h=d.get("name");if(!(h===`
|
244
|
-
`||h==="")){var v=c.isSelected(h);o.hasOwnProperty(h)?o[h]=o[h]&&v:o[h]=v}})}),r==="allSelect"||r==="inverseSelect"?{selected:o}:{name:n.name,selected:o}}function installLegendAction(r){r.registerAction("legendToggleSelect","legendselectchanged",curry$1(legendSelectActionHandler,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",curry$1(legendSelectActionHandler,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",curry$1(legendSelectActionHandler,"inverseSelect")),r.registerAction("legendSelect","legendselected",curry$1(legendSelectActionHandler,"select")),r.registerAction("legendUnSelect","legendunselected",curry$1(legendSelectActionHandler,"unSelect"))}function install$2(r){r.registerComponentModel(LegendModel$1),r.registerComponentView(LegendView$1),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),r.registerSubTypeDefaulter("legend",function(){return"plain"}),installLegendAction(r)}var ScrollableLegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.setScrollDataIndex=function(i){this.option.scrollDataIndex=i},n.prototype.init=function(i,o,a){var u=getLayoutParams(i);r.prototype.init.call(this,i,o,a),mergeAndNormalizeLayoutParams(this,i,u)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),mergeAndNormalizeLayoutParams(this,this.option,i)},n.type="legend.scroll",n.defaultOption=inheritDefaultOption(LegendModel$1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),n}(LegendModel$1);function mergeAndNormalizeLayoutParams(r,n,i){var o=r.getOrient(),a=[1,1];a[o.index]=0,mergeLayoutParam(n,i,{type:"box",ignoreSize:!!a})}const ScrollableLegendModel$1=ScrollableLegendModel;var Group=Group$3,WH=["width","height"],XY=["x","y"],ScrollableLegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!0,i._currentIndex=0,i}return n.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new Group),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group)},n.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this;r.prototype.renderInner.call(this,i,o,a,u,c,f,d);var v=this._controllerGroup,g=o.get("pageIconSize",!0),p=isArray$1(g)?g:[g,g];_("pagePrev",0);var y=o.getModel("pageTextStyle");v.add(new ZRText$1({name:"pageText",style:{text:"xx/xx",fill:y.getTextColor(),font:y.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),_("pageNext",1);function _(b,A){var w=b+"DataIndex",T=createIcon(o.get("pageIcons",!0)[o.getOrient().name][A],{onclick:bind$1(h._pageGo,h,w,o,u)},{x:-p[0]/2,y:-p[1]/2,width:p[0],height:p[1]});T.name=b,v.add(T)}},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getSelectorGroup(),h=i.getOrient().index,v=WH[h],g=XY[h],p=WH[1-h],y=XY[1-h];c&&box("horizontal",d,i.get("selectorItemGap",!0));var _=i.get("selectorButtonGap",!0),b=d.getBoundingRect(),A=[-b.x,-b.y],w=clone$2(a);c&&(w[v]=a[v]-b[v]-_);var T=this._layoutContentAndController(i,u,w,h,v,p,y,g);if(c){if(f==="end")A[h]+=T[v]+_;else{var S=b[v]+_;A[h]-=S,T[g]-=S}T[v]+=b[v]+_,A[1-h]+=T[y]+T[p]/2-b[p]/2,T[p]=Math.max(T[p],b[p]),T[y]=Math.min(T[y],b[y]+A[1-h]),d.x=A[0],d.y=A[1],d.markRedraw()}return T},n.prototype._layoutContentAndController=function(i,o,a,u,c,f,d,h){var v=this.getContentGroup(),g=this._containerGroup,p=this._controllerGroup;box(i.get("orient"),v,i.get("itemGap"),u?a.width:null,u?null:a.height),box("horizontal",p,i.get("pageButtonItemGap",!0));var y=v.getBoundingRect(),_=p.getBoundingRect(),b=this._showController=y[c]>a[c],A=[-y.x,-y.y];o||(A[u]=v[h]);var w=[0,0],T=[-_.x,-_.y],S=retrieve2(i.get("pageButtonGap",!0),i.get("itemGap",!0));if(b){var x=i.get("pageButtonPosition",!0);x==="end"?T[u]+=a[c]-_[c]:w[u]+=_[c]+S}T[1-u]+=y[f]/2-_[f]/2,v.setPosition(A),g.setPosition(w),p.setPosition(T);var O={x:0,y:0};if(O[c]=b?a[c]:y[c],O[f]=Math.max(y[f],_[f]),O[d]=Math.min(0,_[d]+T[1-u]),g.__rectSize=a[c],b){var L={x:0,y:0};L[c]=Math.max(a[c]-_[c]-S,0),L[f]=O[f],g.setClipPath(new Rect$1({shape:L})),g.__rectSize=L[c]}else p.eachChild(function(re){re.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(i);return M.pageIndex!=null&&updateProps$1(v,{x:M.contentPosition[0],y:M.contentPosition[1]},b?i:null),this._updatePageInfoView(i,M),O},n.prototype._pageGo=function(i,o,a){var u=this._getPageInfo(o)[i];u!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:u,legendId:o.id})},n.prototype._updatePageInfoView=function(i,o){var a=this._controllerGroup;each$4(["pagePrev","pageNext"],function(v){var g=v+"DataIndex",p=o[g]!=null,y=a.childOfName(v);y&&(y.setStyle("fill",p?i.get("pageIconColor",!0):i.get("pageIconInactiveColor",!0)),y.cursor=p?"pointer":"default")});var u=a.childOfName("pageText"),c=i.get("pageFormatter"),f=o.pageIndex,d=f!=null?f+1:0,h=o.pageCount;u&&c&&u.setStyle("text",isString$2(c)?c.replace("{current}",d==null?"":d+"").replace("{total}",h==null?"":h+""):c({current:d,total:h}))},n.prototype._getPageInfo=function(i){var o=i.get("scrollDataIndex",!0),a=this.getContentGroup(),u=this._containerGroup.__rectSize,c=i.getOrient().index,f=WH[c],d=XY[c],h=this._findTargetItemIndex(o),v=a.children(),g=v[h],p=v.length,y=p?1:0,_={contentPosition:[a.x,a.y],pageCount:y,pageIndex:y-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return _;var b=x(g);_.contentPosition[c]=-b.s;for(var A=h+1,w=b,T=b,S=null;A<=p;++A)S=x(v[A]),(!S&&T.e>w.s+u||S&&!O(S,w.s))&&(T.i>w.i?w=T:w=S,w&&(_.pageNextDataIndex==null&&(_.pageNextDataIndex=w.i),++_.pageCount)),T=S;for(var A=h-1,w=b,T=b,S=null;A>=-1;--A)S=x(v[A]),(!S||!O(T,S.s))&&w.i<T.i&&(T=w,_.pagePrevDataIndex==null&&(_.pagePrevDataIndex=w.i),++_.pageCount,++_.pageIndex),w=S;return _;function x(L){if(L){var M=L.getBoundingRect(),re=M[d]+L[d];return{s:re,e:re+M[f],i:L.__legendDataIndex}}}function O(L,M){return L.e>=M&&L.s<=M+u}},n.prototype._findTargetItemIndex=function(i){if(!this._showController)return 0;var o,a=this.getContentGroup(),u;return a.eachChild(function(c,f){var d=c.__legendDataIndex;u==null&&d!=null&&(u=f),d===i&&(o=f)}),o??u},n.type="legend.scroll",n}(LegendView$1);const ScrollableLegendView$1=ScrollableLegendView;function installScrollableLegendAction(r){r.registerAction("legendScroll","legendscroll",function(n,i){var o=n.scrollDataIndex;o!=null&&i.eachComponent({mainType:"legend",subType:"scroll",query:n},function(a){a.setScrollDataIndex(o)})})}function install$1(r){use(install$2),r.registerComponentModel(ScrollableLegendModel$1),r.registerComponentView(ScrollableLegendView$1),installScrollableLegendAction(r)}function install(r){use(install$2),use(install$1)}const _sfc_main$H=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(r){const n=r;use([install$7,install$6,install$3,install$4,install]),vue.provide(VChart.THEME_KEY,"dark");const i=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,o=>{i.title.text=o.title,i.series[0].name=o.seriesName,i.series[0].data=o.seriesData}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(VChart),{class:"chart",option:vue.unref(i),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc$1(_sfc_main$H,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$k=["id"],_hoisted_2$h=["id"],_hoisted_3$e=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$6=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$6=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$4=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$3=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$3=["xlink:href","width","height"],_sfc_main$G=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1},height:{default:100},width:{default:100}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${i.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:i.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$e),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:i.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$a),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:i.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$6,_hoisted_7$6,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_8$6),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_9$6),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_10$5),_hoisted_11$4,_hoisted_12$4,_hoisted_13$3],8,_hoisted_2$h),vue.createElementVNode("use",{"xlink:href":`#${i.id}light-121`,width:o.width,height:o.height},null,8,_hoisted_14$3)],8,_hoisted_1$k))}}),_hoisted_1$j=["id"],_hoisted_2$g=["id"],_hoisted_3$d=["fill"],_hoisted_4$9=["fill"],_hoisted_5$7=["fill"],_hoisted_6$5=["from","to"],_hoisted_7$5=["fill"],_hoisted_8$5=["from","to"],_hoisted_9$5=["fill"],_hoisted_10$4=["fill"],_hoisted_11$3=["fill"],_hoisted_12$3=["from","to"],_hoisted_13$2=["fill"],_hoisted_14$2=["xlink:href"],_sfc_main$F=vue.defineComponent({__name:"clock-a",props:{id:{default:""},centerColor:{default:"#EBF257"},secondsColor:{default:"#E83E24"},circleColor:{default:"#F45AFC"},minutesColor:{default:"#50E68E"},hoursColor:{default:"#9A36E7"},scaleColor:{default:"#4942CF"},backgroundColor:{default:"#ffffff"},borderColor:{default:"#B3A7FF"}},setup(r){const n=r,i=new Date(Number(window.sessionStorage.getItem("editorLoadTime")||"0")),o=i.getSeconds()+1,a=i.getMinutes(),u=Math.floor((i.getHours()+(a+o/60)/60)*30);return(c,f)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:n.borderColor},null,8,_hoisted_3$d),vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:n.backgroundColor},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:n.minutesColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(a)*6} 512.3 506.3`,to:`${405+vue.unref(a)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_6$5)],8,_hoisted_5$7),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:n.hoursColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(u)} 512.3 506.3`,to:`${315+vue.unref(u)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_8$5)],8,_hoisted_7$5),vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:n.circleColor},null,8,_hoisted_9$5),vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:n.scaleColor},null,8,_hoisted_10$4),vue.createElementVNode("path",{d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:n.secondsColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+o*6} 512.3 506.3`,to:`${495.5+o*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12$3)],8,_hoisted_11$3),vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:n.centerColor},null,8,_hoisted_13$2)],8,_hoisted_2$g),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$j))}}),_sfc_main$E=vue.defineComponent({__name:"text-box",props:{width:{default:250},height:{default:150},bgColor:{default:"#ffffff"},bgOpacity:{default:50},borderColor:{default:"#000000"},borderWidth:{default:1},borderRadius:{default:5},borderOpacity:{default:100}},setup(r){const n=r,i=vue.computed(()=>({width:(n.width>0?n.width:0)+"px",height:(n.height>0?n.height:0)+"px",borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px"})),o=vue.computed(()=>({border:`${n.borderWidth>0?n.borderWidth:0}px solid ${n.borderColor}`,borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px",opacity:(n.borderOpacity>0?n.borderOpacity<100?n.borderOpacity:100:0)/100})),a=vue.computed(()=>({backgroundColor:n.bgColor,opacity:(n.bgOpacity>0?n.bgOpacity<100?n.bgOpacity:100:0)/100,borderRadius:n.borderRadius+"px"}));return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",{class:"outM",style:vue.normalizeStyle(i.value)},[vue.createElementVNode("div",{class:"wallI",style:vue.normalizeStyle(a.value)},null,4),vue.createElementVNode("div",{class:"borderB",style:vue.normalizeStyle(o.value)},null,4)],4))}}),textBox_vue_vue_type_style_index_0_scoped_4ab181ea_lang="",TextBox=_export_sfc$1(_sfc_main$E,[["__scopeId","data-v-4ab181ea"]]),vueComp={"svg-text":_sfc_main$K,"el-button":elementPlus.ElButton,"progress-a":_sfc_main$M,"el-tag":elementPlus.ElTag,"common-table":_sfc_main$J,"pie-charts":PieCharts,"switch-r":_sfc_main$L,"now-time":NowTime,"light-a":_sfc_main$G,"clock-a":_sfc_main$F,"text-box":TextBox},config=[...t$b,...t$1],useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),actions:{setCreateInfo(r){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=r},setDoneJson(r){isOfType(r,"id")?(this.done_json.push(r),vue.nextTick(()=>{setSvgActualInfo(r)})):this.done_json=objectDeepClone(r),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setHandleSvgInfo(r,n){let i=n;r?(!i&&i!=0&&(i=this.done_json.findIndex(o=>o.id===r.id)??-1),this.handle_svg_info={info:r,index:i}):this.handle_svg_info=r},spliceDoneJson(r){const n=useGlobalStore(),o=n.done_json.splice(r,1)[0];unbindAnchors(o.id),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=r=>{r.stopPropagation()},preventDefault=r=>{r.preventDefault()};function componentsRegister(r){var o,a;const n=vue.getCurrentInstance(),i=r?Object.assign(vueComp,r):vueComp;for(let u in i)!((o=n==null?void 0:n.appContext)!=null&&o.components.hasOwnProperty(u))&&vueComp.hasOwnProperty(u)&&((a=n==null?void 0:n.appContext)==null||a.app.component(u,vueComp[u]))}function setEditorLoadTime(){window.sessionStorage.setItem("editorLoadTime",new Date().getTime().toString())}const randomString=r=>{r=r||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=n.length;let o="";for(let a=0;a<r;a++){let u=i;a===0&&(u=i-10),o+=n.charAt(Math.floor(Math.random()*u))}return o},isOfType=(r,n)=>r[n]!==void 0,getCoordinateOffset=(r,n)=>r/2*(n-1),angleToRadian=r=>r*Math.PI/180,calculateRotatedPointCoordinate=(r,n,i)=>({x:parseFloat(((r.x-n.x)*Math.cos(angleToRadian(i))-(r.y-n.y)*Math.sin(angleToRadian(i))+n.x).toFixed(1)),y:parseFloat(((r.x-n.x)*Math.sin(angleToRadian(i))+(r.y-n.y)*Math.cos(angleToRadian(i))+n.y).toFixed(1))}),getCenterPoint=(r,n)=>({x:r.x+(n.x-r.x)/2,y:r.y+(n.y-r.y)/2}),positionArrToPath=r=>{let n="";for(let i=0;i<r.length;i++)i===0?n+=`M ${r[i].x} ${r[i].y}`:n+=` L ${r[i].x} ${r[i].y}`;return n},getSvgNowPosition=(r,n,i)=>i+(n-r),objectDeepClone=(r,n={})=>r?JSON.parse(JSON.stringify(r)):n,setSvgActualInfo=(r,n)=>{var a,u;const i=document.querySelector(`#${r.id}`),o=document.querySelector(`#rect${r.id}`);if(i){let c=0,f=0,d=0,h=0;if(r.type===EDoneJsonType.Vue){d=((a=r.props.width)==null?void 0:a.val)||i.offsetWidth||100,h=((u=r.props.height)==null?void 0:u.val)||i.offsetHeight||100,c=50-d/2,f=50-h/2;const v=document.querySelector(`#foreign-object${r.id}`);v&&(v.getAttribute("x")==="0"&&v.getAttribute("y")==="0"&&v.getAttribute("width")==="0"&&v.getAttribute("height")==="0"||n)&&(v.setAttribute("x",c.toString()),v.setAttribute("y",f.toString()),v.setAttribute("width",d.toString()),v.setAttribute("height",h.toString()))}else{const v=i.getBBox();c=parseFloat(v.x.toFixed(0)),f=parseFloat(v.y.toFixed(0)),d=parseFloat(v.width.toFixed(0)),h=parseFloat(v.height.toFixed(0))}o&&(o.getAttribute("x")==="0"&&o.getAttribute("y")==="0"&&o.getAttribute("width")==="0"&&o.getAttribute("height")==="0"||n)&&(o.setAttribute("x",c.toString()),o.setAttribute("y",f.toString()),o.setAttribute("width",d.toString()),o.setAttribute("height",h.toString())),(r.actual_bound.x===0&&r.actual_bound.y===0&&r.actual_bound.width===0&&r.actual_bound.height===0||n)&&(r.actual_bound={x:c,y:f,width:d,height:h}),r.center_position={x:r.x+r.actual_bound.x+d/2,y:r.y+r.actual_bound.y+h/2},r.point_coordinate.tl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tc={x:r.center_position.x,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tr={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.l={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.r={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.bl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.bc={x:r.center_position.x,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.br={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.rotate!==0&&setAfterRotationPointCoordinate(r),moveAnchors(r)}},resetHandlePointOld=r=>{for(const n of Object.keys(r.point_coordinate))r.point_coordinate_old&&(r.point_coordinate_old[n].x=0,r.point_coordinate_old[n].y=0)},moveHandlePoint=(r,n,i)=>{const o=useGlobalStore(pinia),a=n??o.mouse_info.new_position_x-o.mouse_info.position_x,u=i??o.mouse_info.new_position_y-o.mouse_info.position_y;for(const c of Object.keys(r.point_coordinate))n!==void 0&&i!==void 0?(r.point_coordinate[c].x+=a,r.point_coordinate[c].y+=u):r.point_coordinate_old&&(r.point_coordinate[c].x=r.point_coordinate_old[c].x+a,r.point_coordinate[c].y=r.point_coordinate_old[c].y+u)},moveAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)if(c.type===EDoneJsonType.ConnectionLine){if(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.start.type,r);c.props.point_position.val[0]={x:f.x-c.x,y:f.y-c.y}}if(((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.end.type,r);c.props.point_position.val[c.props.point_position.val.length-1]={x:f.x-c.x,y:f.y-c.y}}}},unbindAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)c.type===EDoneJsonType.ConnectionLine&&(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r&&(c.bind_anchors.start=null),((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r&&(c.bind_anchors.end=null))},getAnchorPosByAnchorType=(r,n)=>r===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:r===ELineBindAnchors.Left?n.point_coordinate.l:r===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=r=>{r.point_coordinate={tl:calculateRotatedPointCoordinate(r.point_coordinate.tl,r.center_position,r.rotate),tc:calculateRotatedPointCoordinate(r.point_coordinate.tc,r.center_position,r.rotate),tr:calculateRotatedPointCoordinate(r.point_coordinate.tr,r.center_position,r.rotate),l:calculateRotatedPointCoordinate(r.point_coordinate.l,r.center_position,r.rotate),r:calculateRotatedPointCoordinate(r.point_coordinate.r,r.center_position,r.rotate),bl:calculateRotatedPointCoordinate(r.point_coordinate.bl,r.center_position,r.rotate),bc:calculateRotatedPointCoordinate(r.point_coordinate.bc,r.center_position,r.rotate),br:calculateRotatedPointCoordinate(r.point_coordinate.br,r.center_position,r.rotate)}},prosToVBind=(r,n=[])=>{let i={};if(r.state){for(const o in r.state)if(r.state.hasOwnProperty(o)&&o===r.defaultState){for(let a in r.state[o])a!=="label"&&(i[lodashEs.kebabCase(a)]=r.state[o][a]);break}}for(const o in r.props)n.indexOf(o)<0&&(i[lodashEs.kebabCase(o)]=r.props[o].val);return i},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(r=>r.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=r=>!r.common_animations||!r.common_animations.val?"":`common-ani animate__animated animate__${r.common_animations.val} animate__${r.common_animations.speed} animate__${r.common_animations.repeat} animate__${r.common_animations.delay}`,numberArray=r=>{let n=[];for(let i=0;i<r;i++)n.push(i);return n},getStringWidth=(r,n=12)=>{if(r.length>0){let i=document.createElement("span");i.style.fontSize=n+"px",i.style.fontFamily="inherit",i.innerHTML=r,i.style.opacity="0",i.style.position="fixed",i.style.top="3000px",document.body.append(i);const o=i.clientWidth;return document.body.removeChild(i),o}return 0},valFormat=r=>/false|true/.test(r)?r!=="false":/^\d+(\.\d+)?$/.test(r)?Number(r):r,createLine=(r,n,i)=>{r.preventDefault();const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),{clientX:c,clientY:f}=r;let d=objectDeepClone(a.connection_line),h=0,v=0;if(n&&i){d.bind_anchors.start={type:n,target_id:i.id};let p=getAnchorPosByAnchorType(n,i);h=p.x,v=p.y}else h=Math.round((c-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),v=Math.round((f-u.canvasInfo.top)/a.svg.scale-u.center_offset.y);const g={id:randomString(),x:h,y:v,client:{x:h,y:v},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...d};g.props.point_position.val.push({x:0,y:0}),o.setDoneJson(g),o.setHandleSvgInfo(g,o.done_json.length-1),o.intention=EGlobalStoreIntention.Connection,o.mouse_info={state:EMouseInfoState.Down,position_x:h,position_y:v,now_position_x:h,now_position_y:v,new_position_x:0,new_position_y:0}};Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]});const connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#602a00"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let r=JSON.parse(l);t=r.connection_line,s=r.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});var EContextMenuInfoType=(r=>(r.Copy="Copy",r.Delete="Delete",r.MoveUpOneLevel="MoveUpOneLevel",r.MoveDownOneLevel="MoveDownOneLevel",r.MoveUpTopLevel="MoveUpTopLevel",r.MoveDownTopLevel="MoveDownTopLevel",r))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(r){return r.history_now_index>=1},getTopBtnRedoStatus(r){return r.history_now_index+1!=r.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl + c",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl + →",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl + ←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl + ↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl + ↓",enable:!0}}}),actions:{onContextMenuClick(r){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,r){case EContextMenuInfoType.Copy:const i=objectDeepClone(n.handle_svg_info.info);i.id=randomString(),i.title+="-copy",i.x+=10,i.y+=10,n.setDoneJson(i),this.display=!1,n.setHandleSvgInfo(i,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const o=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=o,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(o,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const a=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=a,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(a,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const u=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(u),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(u,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const c=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push(c),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(c,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=r=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(r),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=r=>{try{const n=JSON.parse(r);if(!n.config||!n.layout_center||!n.done_json)return elementPlus.ElMessage.error("请导入正确的数据模型!"),!1;const i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return a.$state=n.config,o.center_offset=n.layout_center,i.setDoneJson(n.done_json),!0}catch(n){return elementPlus.ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$i={"aria-hidden":"true"},_hoisted_2$f=["xlink:href"],_sfc_main$D=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(r){const n=r,i=vue.computed(()=>`#svg-${n.name}`);return(o,a)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$i,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(i)},n.props),null,16,_hoisted_2$f)]))}});var EVisibleConfKey=(r=>(r.ImportJson="ImportJson",r.ExportJson="ExportJson",r.ImportFile="ImportFile",r))(EVisibleConfKey||{});const _withScopeId$2=r=>(vue.pushScopeId("data-v-62907637"),r=r(),vue.popScopeId(),r),_hoisted_1$h={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$e={class:"flex items-center justify-between",style:{width:"250px"}},_hoisted_3$c=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$4={class:"flex items-center mr-20px"},_hoisted_7$4={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$2=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36$1=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$C=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(r,{emit:n}){const i=useSvgEditLayoutStore(pinia),o=useGlobalStore(pinia),a=useEditPrivateStore(pinia),u=useConfigStore(pinia),c=()=>{o.done_json.length<=0||o.setDoneJson([]),o.intention=EGlobalStoreIntention.None},f=v=>{const g={layout_center:i.center_offset,config:u.$state,done_json:o.done_json};n(v,g)},d=vue.ref(!1),h=vue.computed({get:()=>o.intention===EGlobalStoreIntention.Connection,set(v){o.intention=v?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,v&&o.setHandleSvgInfo(null)}});return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$e,[_hoisted_3$c,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[0]||(g[0]=p=>vue.unref(i).left_nav=!vue.unref(i).left_nav),title:vue.unref(i).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(a).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:g[1]||(g[1]=()=>vue.unref(a).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(a).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:g[2]||(g[2]=()=>vue.unref(a).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(vue.unref(o).done_json.length>0?"bt-Icon":"icon-disable"),size:24,onClick:c},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(o).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:g[3]||(g[3]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"import"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:g[4]||(g[4]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"export"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(h)}]),size:24,onClick:g[5]||(g[5]=p=>h.value=!vue.unref(h))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(h)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:g[6]||(g[6]=p=>d.value=!vue.unref(d))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:g[7]||(g[7]=p=>f("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"return"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:g[8]||(g[8]=p=>f("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"save"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:g[9]||(g[9]=p=>f("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[10]||(g[10]=p=>vue.unref(i).right_nav=!vue.unref(i).right_nav),title:vue.unref(i).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(elementPlus.ElDialog),{modelValue:vue.unref(d),"onUpdate:modelValue":g[11]||(g[11]=p=>vue.isRef(d)?d.value=p:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$2,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$2,_hoisted_17,_hoisted_18,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22$1,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26$1,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32$1,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36$1]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-62907637"]]),_hoisted_1$g={class:"component-group flex flex-wrap"},_hoisted_2$d=["onDragstart","title"],_sfc_main$B=vue.defineComponent({__name:"left-panel",props:{customToolbar:{}},setup(r){const n=r,i=useGlobalStore(pinia),o=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:i.config_center),a=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),u=d=>{i.setCreateInfo(c(d))},c=d=>(d!=null&&d.props&&!lodashEs.isEmpty(d.props)&&Object.keys(d.props).forEach((h,v)=>{d.props[h].sort=String(v)}),d),f=d=>{var h;if(((h=d.dataTransfer)==null?void 0:h.dropEffect)!=="copy"){elementPlus.ElMessage.warning("请将组件拖到画布中!"),i.intention=EGlobalStoreIntention.None;return}};return(d,h)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(a),"onUpdate:modelValue":h[0]||(h[0]=v=>vue.isRef(a)?a.value=v:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:v.groupType,key:v.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(v.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.list,g=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:g.name,draggable:"true",onDragstart:p=>u(g),onDragend:f,title:g.title},[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:g.name,props:vue.unref(prosToVBind)(g,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$d))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_8aba8565_lang="",LeftPanel=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-8aba8565"]]),calculateLeftTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateTop=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateRight=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateLeft=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$f={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$c=["fill","x","y"],_hoisted_3$b=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$3=["fill","x","y"],_hoisted_7$3=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$A=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(r){const n=r;vue.useCssVars(p=>({"5c831aea":vue.unref(c)}));const i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=vue.ref(4),c=vue.ref("#ab712e"),f=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],d=vue.computed(()=>n.itemInfo.config.can_zoom),h=(p,y)=>{console.log("handMousedown",y);const{clientX:_,clientY:b}=y;y.stopPropagation(),i.intention=EGlobalStoreIntention.Zoom;const A=Math.round((_-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),w=Math.round((b-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);i.mouse_info={state:EMouseInfoState.Down,position_x:A,position_y:w,now_position_x:A,now_position_y:w,new_position_x:0,new_position_y:0},i.scale_info={type:p,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:A+Math.abs(A-n.itemInfo.center_position.x)*2*(A>n.itemInfo.center_position.x?-1:1),y:w+Math.abs(w-n.itemInfo.center_position.y)*2*(w>n.itemInfo.center_position.y?-1:1)}}},v=p=>{const{clientX:y,clientY:_}=p,b=Math.round((y-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),A=Math.round((_-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);p.stopPropagation(),i.intention=EGlobalStoreIntention.Rotate,i.rotate_info={angle:n.itemInfo.rotate},i.mouse_info={state:EMouseInfoState.Down,position_x:b,position_y:A,now_position_x:b,now_position_y:A,new_position_x:0,new_position_y:0}},g=p=>{const y=(p+n.itemInfo.rotate)%360,_=f.find(b=>b.start<=y&&b.end>y);return _?{cursor:_.cursor+"-resize",type:_.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(p,y)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$f,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[0]||(y[0]=_=>h(vue.unref(EScaleInfoType).TopLeft,_))},null,44,_hoisted_2$c),[[vue.vShow,vue.unref(d)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:v},null,40,_hoisted_3$b),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref(c),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(u),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[1]||(y[1]=_=>h(vue.unref(EScaleInfoType).TopCenter,_))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(u)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[2]||(y[2]=_=>h(vue.unref(EScaleInfoType).TopRight,_))},null,44,_hoisted_6$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[3]||(y[3]=_=>h(vue.unref(EScaleInfoType).Left,_))},null,44,_hoisted_7$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[4]||(y[4]=_=>h(vue.unref(EScaleInfoType).Right,_))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[5]||(y[5]=_=>h(vue.unref(EScaleInfoType).BottomLeft,_))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[6]||(y[6]=_=>h(vue.unref(EScaleInfoType).BottomCenter,_))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[7]||(y[7]=_=>h(vue.unref(EScaleInfoType).BottomRight,_))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(d)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$e=["fill"],_hoisted_2$b=["cx","cy","r"],_hoisted_3$a=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$2=["cx","cy","r"],_hoisted_7$2=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$z=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(r){const n=r,i=vue.ref(4),o=vue.ref("#ab712e"),a=vue.ref(4),u=vue.ref(12),c=useGlobalStore(pinia),f=useSvgEditLayoutStore(pinia),d=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-i.value+a.value),h=vue.computed(()=>n.itemInfo.actual_bound.y-i.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),v=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),g=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),p=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width/2+a.value),y=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),_=vue.computed(()=>n.itemInfo.actual_bound.x-i.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),b=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),A=(T,S)=>{var x;c.intention===EGlobalStoreIntention.SetConnectionLineNode&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&c.connection_line_node_info&&(c.connection_line_node_info.point_index===0?c.handle_svg_info.info.bind_anchors.start={type:S,target_id:n.itemInfo.id}:c.connection_line_node_info.point_index===c.handle_svg_info.info.props.point_position.val.length-1&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id}),c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},w=(T,S)=>{var x;c.intention===EGlobalStoreIntention.None?(createLine(T,S,n.itemInfo),c.handle_svg_info&&(c.handle_svg_info.info.props.point_position.val.length!==1?c.handle_svg_info.info.props.point_position.val.push({x:c.mouse_info.new_position_x-c.mouse_info.position_x-f.center_offset.x,y:c.mouse_info.new_position_y-c.mouse_info.position_y-f.center_offset.y}):c.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):c.intention===EGlobalStoreIntention.Connection&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id},c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(T,S)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(o),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:S[0]||(S[0]=x=>w(x,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:S[1]||(S[1]=x=>A(x,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_2$b),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_3$a)],32),vue.createElementVNode("g",{onMousedown:S[2]||(S[2]=x=>w(x,vue.unref(ELineBindAnchors).Right)),onMouseup:S[3]||(S[3]=x=>A(x,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:S[4]||(S[4]=x=>w(x,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:S[5]||(S[5]=x=>A(x,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_6$2),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_7$2)],32),vue.createElementVNode("g",{onMousedown:S[6]||(S[6]=x=>w(x,vue.unref(ELineBindAnchors).Left)),onMouseup:S[7]||(S[7]=x=>A(x,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(a),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$e))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$d=["d","stroke-width"],_hoisted_2$a=["d","stroke-width"],_hoisted_3$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$1=["from","to","dur","repeatCount"],_hoisted_7$1=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r","stroke-width"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$y=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(r){const n=r,i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=(c,f,d,h)=>{if(i.intention===EGlobalStoreIntention.Connection)return;i.setHandleSvgInfo(n.itemInfo);const{clientX:v,clientY:g}=f;f.stopPropagation(),i.connection_line_node_info={init_pos:{x:d,y:h},point_index:c},i.intention=EGlobalStoreIntention.SetConnectionLineNode,i.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((v-a.canvasInfo.left)/o.svg.scale),position_y:Math.round((g-a.canvasInfo.top)/o.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return(c,f)=>{var d,h,v,g,p,y;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(i).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":Math.ceil(n.itemInfo.props["stroke-width"].val*1.2)+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$d),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((d=vue.unref(i).handle_svg_info)==null?void 0:d.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$a),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((h=n.itemInfo.animations)==null?void 0:h.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((v=n.itemInfo.animations)==null?void 0:v.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((g=n.itemInfo.animations)==null?void 0:g.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$9),((p=n.itemInfo.animations)==null?void 0:p.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_6$1)],8,_hoisted_5$3)):((y=n.itemInfo.animations)==null?void 0:y.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_8$1)],8,_hoisted_7$1)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>{var A;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":Math.ceil(n.itemInfo.props.point_r.val*.2)+1,stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((A=vue.unref(i).handle_svg_info)==null?void 0:A.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>(vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:A=>u(b,A,_.x,_.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$c={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_2$9=["stroke"],_hoisted_3$8=["stroke"],_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_7=["transform"],_hoisted_8=["transform"],_hoisted_9=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_10=["xlink:href","width","height","id","transform"],_hoisted_11=["id"],_hoisted_12$1=["id","x1","y1","x2","y2"],_hoisted_13=["id"],_hoisted_14=["x","y","height","width"],_hoisted_15=["onClick"],_hoisted_16$1={class:"shortcut"},_sfc_main$x=vue.defineComponent({__name:"center-panel",props:{vueComp:{}},setup(r,{expose:n}){const i=r;vue.useCssVars(pe=>({"6831c8e2":vue.unref(g)}));const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),c=useEditPrivateStore(pinia),f=useContextMenuStore(pinia);componentsRegister(i.vueComp);const d=vue.ref(),h=vue.ref(),v={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},g=vue.computed(()=>Object.keys(v).indexOf(o.intention)>-1?v[o.intention]:"default"),p=vue.reactive({handle_panel:vue.computed(()=>o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Zoom||o.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),y=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),_=vue.computed(()=>o.intention===EGlobalStoreIntention.SelectArea&&y.value.b.x&&y.value.b.y?{with:Math.abs(y.value.b.x-y.value.a.x),height:Math.abs(y.value.b.y-y.value.a.y),x:y.value.a.x<y.value.b.x?y.value.a.x:y.value.b.x,y:y.value.a.y<y.value.b.y?y.value.a.y:y.value.b.y}:{with:0,height:0,x:0,y:0}),b=vue.computed(()=>{let pe=0;for(let Lt of o.done_json)Lt.selected&&pe++;return pe>0});let A=!1,w=!1;const T=pe=>{var Lt;if(o.intention!=EGlobalStoreIntention.None){if(o.intention==EGlobalStoreIntention.Create){if(!o.create_svg_info){console.error("要创建的数据获取失败");return}const _e=Math.floor(pe.offsetX/a.svg.scale-u.center_offset.x),Et=Math.floor(pe.offsetY/a.svg.scale-u.center_offset.y),Cn={id:randomString(),x:_e,y:Et,client:{x:_e,y:Et},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},selected:!1,...objectDeepClone(o.create_svg_info)};o.setDoneJson(Cn),o.setHandleSvgInfo(Cn,o.done_json.length),o.intention=EGlobalStoreIntention.None}(Lt=h.value)==null||Lt.focus()}},S=pe=>{pe.preventDefault()},x=pe=>{pe.preventDefault()},O=(pe,Lt,_e)=>{var Et,Cn,vn;if((Et=h.value)==null||Et.focus(),o.intention===EGlobalStoreIntention.Connection){_e.stopPropagation();return}if(_e.preventDefault(),_e.stopPropagation(),_e.ctrlKey&&_e.button===0)((Cn=o.handle_svg_info)!=null&&Cn.index||((vn=o.handle_svg_info)==null?void 0:vn.index)===0)&&(o.done_json[o.handle_svg_info.index].selected=!0,o.setHandleSvgInfo(null),o.intention=EGlobalStoreIntention.None),pe.selected=!pe.selected;else if(b.value){o.intention=EGlobalStoreIntention.GroupMove,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Dt of o.done_json)Dt.selected&&(Dt.old_position={x:Dt.x,y:Dt.y},Dt.point_coordinate_old=objectDeepClone(Dt.point_coordinate))}else o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0},pe.point_coordinate_old=objectDeepClone(pe.point_coordinate)},L=(pe,Lt,_e)=>{if(!(o.intention===EGlobalStoreIntention.Connection||o.mouse_info.state!=EMouseInfoState.Down)&&b.value&&!A&&["SelectArea","Move","Select"].indexOf(o.intention)<0){for(let Et of o.done_json)Et.selected=!1,Et.old_position={x:0,y:0},resetHandlePointOld(Et);o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0}}},M=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),p.connection_panel=!0,p.connection_line=!0,!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.select_item.info=pe,p.select_item.index=Lt)},re=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.connection_panel=!1,p.connection_line=!1,p.select_item.info=null,p.select_item.index=-1)},F=pe=>{var vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt,_n,ie;if(o.mouse_info.state!=EMouseInfoState.Down&&o.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Lt,clientY:_e}=pe;o.mouse_info.new_position_x=Math.round((Lt-u.canvasInfo.left)/a.svg.scale),o.mouse_info.new_position_y=Math.round((_e-u.canvasInfo.top)/a.svg.scale);const Et=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+o.mouse_info.now_position_x),Cn=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+o.mouse_info.now_position_y);if((vn=o.handle_svg_info)!=null&&vn.info&&(o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Move)){if(o.handle_svg_info.info.x=Et,o.handle_svg_info.info.y=Cn,o.handle_svg_info.info.client={x:Et,y:Cn},o.intention=EGlobalStoreIntention.Move,moveHandlePoint(o.handle_svg_info.info),moveAnchors(o.handle_svg_info.info),o.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Dt=o.handle_svg_info.info.bind_anchors)!=null&&Dt.start){let ae=null;for(let Y of o.done_json)Y.id===((qe=(de=o.handle_svg_info.info.bind_anchors)==null?void 0:de.start)==null?void 0:qe.target_id)&&(ae=Y);ae&&moveAnchors(ae)}if((Pt=o.handle_svg_info.info.bind_anchors)!=null&&Pt.end){let ae=null;for(let Y of o.done_json)Y.id===(($e=(In=o.handle_svg_info.info.bind_anchors)==null?void 0:In.end)==null?void 0:$e.target_id)&&(ae=Y);ae&&moveAnchors(ae)}}}else if(o.intention===EGlobalStoreIntention.MoveCanvas)u.center_offset.x=Et,u.center_offset.y=Cn;else if(o.intention===EGlobalStoreIntention.SelectArea)y.value.b.x=o.mouse_info.new_position_x-u.center_offset.x,y.value.b.y=o.mouse_info.new_position_y-u.center_offset.y;else if(o.intention===EGlobalStoreIntention.GroupMove){A=!0;for(let ae of o.done_json)if(ae.selected&&ae.old_position){const Y=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+ae.old_position.x),k=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+ae.old_position.y);if(ae.x=Y,ae.y=k,ae.client={x:Y,y:k},moveHandlePoint(ae),moveAnchors(ae),ae.type===EDoneJsonType.ConnectionLine&&((Ce=ae.bind_anchors)!=null&&Ce.end)){let D=null;for(let oe of o.done_json)oe.id===((At=(ue=ae.bind_anchors)==null?void 0:ue.end)==null?void 0:At.target_id)&&(D=oe);D&&moveAnchors(D)}}}else if(o.intention===EGlobalStoreIntention.Zoom){if(!o.handle_svg_info)return;const ae={x:o.mouse_info.new_position_x-u.center_offset.x,y:o.mouse_info.new_position_y-u.center_offset.y};let Y={width:0,height:0,is_old_width:!1,is_old_height:!1};if(o.scale_info.type===EScaleInfoType.TopLeft?Y=calculateLeftTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopRight?Y=calculateRightTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomRight?Y=calculateRightBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomLeft?Y=calculateLeftBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopCenter?Y=calculateTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Right?Y=calculateRight(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.BottomCenter?Y=calculateBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Left&&(Y=calculateLeft(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client)),o.handle_svg_info&&Y.width>0&&Y.height>0){const k=Y.is_old_width?1:parseFloat((Y.width/o.handle_svg_info.info.actual_bound.width).toFixed(3)),D=Y.is_old_height?1:parseFloat((Y.height/o.handle_svg_info.info.actual_bound.height).toFixed(3)),oe=getCenterPoint(ae,o.scale_info.symmetric_point);k>0&&o.scale_info.type!==EScaleInfoType.TopCenter&&o.scale_info.type!==EScaleInfoType.BottomCenter&&(o.handle_svg_info.info.scale_x=k,o.handle_svg_info.info.x=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.x,oe.x,o.handle_svg_info.info.client.x))),D>0&&o.scale_info.type!==EScaleInfoType.Left&&o.scale_info.type!==EScaleInfoType.Right&&(o.handle_svg_info.info.scale_y=D,o.handle_svg_info.info.y=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.y,oe.y,o.handle_svg_info.info.client.y)))}}else if(o.intention===EGlobalStoreIntention.Rotate){if(!o.handle_svg_info)return;const ae=Math.atan2(o.mouse_info.position_y-o.handle_svg_info.info.y,o.mouse_info.position_x-o.handle_svg_info.info.x)/(Math.PI/180),Y=Math.atan2(o.mouse_info.new_position_y-u.center_offset.y-o.handle_svg_info.info.y,o.mouse_info.new_position_x-u.center_offset.x-o.handle_svg_info.info.x)/(Math.PI/180);o.handle_svg_info.info.rotate=parseFloat((o.rotate_info.angle+Y-ae).toFixed(2))}else if(o.intention===EGlobalStoreIntention.Connection&&o.handle_svg_info){const ae=(Ne=o.handle_svg_info)==null?void 0:Ne.info.props.point_position.val.length,Y=o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,k=o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y,D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((kt=(Oe=o.handle_svg_info)==null?void 0:Oe.info.props.point_r)==null?void 0:kt.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;pe.ctrlKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:D.x,y:k+ze}:pe.shiftKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:D.y}:o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:k+ze}}else if(o.intention===EGlobalStoreIntention.SetConnectionLineNode&&o.handle_svg_info){!w&&(o.connection_line_node_info.point_index===o.handle_svg_info.info.props.point_position.val.length-1||o.connection_line_node_info.point_index===0)&&(w=!0);const ae=(jt=o.handle_svg_info)==null?void 0:jt.info.props.point_position.val.length,Y=getSvgNowPosition(o.mouse_info.position_x,o.mouse_info.new_position_x,o.connection_line_node_info.init_pos.x),k=getSvgNowPosition(o.mouse_info.position_y,o.mouse_info.new_position_y,o.connection_line_node_info.init_pos.y),D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((ie=(_n=o.handle_svg_info)==null?void 0:_n.info.props.point_r)==null?void 0:ie.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;o.handle_svg_info.info.props.point_position.val[o.connection_line_node_info.point_index]={x:Y+xe,y:k+ze}}},j=()=>{var pe,Lt,_e,Et;if(o.mouse_info.state==EMouseInfoState.Down){if((pe=o.handle_svg_info)!=null&&pe.info&&o.intention==EGlobalStoreIntention.Move)setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.intention=EGlobalStoreIntention.None,o.setDoneJson(o.done_json);else if(o.intention==EGlobalStoreIntention.GroupMove)A&&(A=!1,o.intention=EGlobalStoreIntention.None);else if((Lt=o.handle_svg_info)!=null&&Lt.info&&o.intention==EGlobalStoreIntention.Zoom)o.handle_svg_info.info.client={x:o.handle_svg_info.info.x,y:o.handle_svg_info.info.y},o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json);else if(o.intention===EGlobalStoreIntention.Rotate&&((_e=o.handle_svg_info)!=null&&_e.info))setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json),o.intention=EGlobalStoreIntention.None;else{if(o.intention===EGlobalStoreIntention.Connection)return;if(o.intention===EGlobalStoreIntention.SetConnectionLineNode)w&&((Et=o.handle_svg_info)!=null&&Et.info.bind_anchors)&&(o.connection_line_node_info.point_index===0?o.handle_svg_info.info.bind_anchors.start=null:o.handle_svg_info.info.bind_anchors.end=null),o.intention=EGlobalStoreIntention.None,w=!1;else if(o.intention===EGlobalStoreIntention.SelectArea){o.setHandleSvgInfo(null);for(let Cn of o.done_json){const vn=_.value;Cn.selected=Cn.x>vn.x&&Cn.x<vn.x+vn.with&&Cn.y>vn.y&&Cn.y<vn.y+vn.height}o.intention=EGlobalStoreIntention.None}else o.intention!=EGlobalStoreIntention.Select&&(o.intention=EGlobalStoreIntention.None)}o.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},f.display=!1}},V=pe=>{const{clientX:Lt,clientY:_e}=pe;if(o.intention===EGlobalStoreIntention.Connection){o.handle_svg_info||createLine(pe),o.handle_svg_info&&(pe.button===0?o.handle_svg_info.info.props.point_position.val.length!==1?o.handle_svg_info.info.props.point_position.val.push({x:o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,y:o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y}):o.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):pe.button===2&&(o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setHandleSvgInfo(null)));return}pe.button===0?(o.intention=EGlobalStoreIntention.SelectArea,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale-u.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},y.value={a:{x:o.mouse_info.position_x,y:o.mouse_info.position_y},b:{x:0,y:0}}):pe.button===2&&(o.intention=EGlobalStoreIntention.MoveCanvas,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale),now_position_x:u.center_offset.x,now_position_y:u.center_offset.y,new_position_x:0,new_position_y:0})};function z(pe){pe!=null&&pe.wheelDelta&&(pe.wheelDelta>0?a.svg.scale=parseFloat((a.svg.scale+.1).toFixed(1)):a.svg.scale=parseFloat((a.svg.scale-.1).toFixed(1)))}const $=pe=>{pe.stopPropagation(),pe.preventDefault()},he=(pe,Lt,_e)=>{o.intention!==EGlobalStoreIntention.Connection&&d.value&&(o.intention=EGlobalStoreIntention.ContextMenu,o.setHandleSvgInfo(pe,Lt),d.value.style.left=_e.pageX+"px",d.value.style.top=_e.pageY+"px",f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!0,Lt===o.done_json.length-1&&(f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=!1),Lt===0&&(f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!1),f.display=!0)},le=(pe,Lt,_e)=>({x:parseFloat((pe.x-pe.width/2*Lt+pe.width/2).toFixed(1)),y:parseFloat((pe.y-pe.height/2*_e+pe.height/2).toFixed(1)),width:parseFloat((pe.width*Lt).toFixed(1)),height:parseFloat((pe.height*_e).toFixed(1))}),Ie=pe=>{pe.preventDefault();let Lt=[];if(!pe.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(pe.key)>-1&&(b.value?Lt=o.done_json.map((_e,Et)=>({selected:_e.selected,i:Et})).filter(_e=>_e.selected).map(_e=>_e.i):o.handle_svg_info&&Lt.push(o.handle_svg_info.index)),!pe.ctrlKey&&pe.key=="ArrowUp"){for(let _e of Lt)o.done_json[_e].y-=1,o.done_json[_e].client.y-=1,moveHandlePoint(o.done_json[_e],0,-1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowDown"){for(let _e of Lt)o.done_json[_e].y+=1,o.done_json[_e].client.y+=1,moveHandlePoint(o.done_json[_e],0,1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowLeft"){for(let _e of Lt)o.done_json[_e].x-=1,o.done_json[_e].client.x-=1,moveHandlePoint(o.done_json[_e],-1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowRight"){for(let _e of Lt)o.done_json[_e].x+=1,o.done_json[_e].client.x+=1,moveHandlePoint(o.done_json[_e],1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else pe.ctrlKey&&pe.key.toLowerCase()=="c"?f.onContextMenuClick(EContextMenuInfoType.Copy):!pe.ctrlKey&&pe.key=="Delete"?b.value?(o.setDoneJson(o.done_json.filter(_e=>!_e.selected)),o.setHandleSvgInfo(o.done_json[o.done_json.length-1],o.done_json.length-1)):f.onContextMenuClick(EContextMenuInfoType.Delete):pe.ctrlKey&&pe.key=="ArrowUp"?f.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):pe.ctrlKey&&pe.key=="ArrowDown"?f.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):pe.ctrlKey&&pe.key=="ArrowLeft"?f.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):pe.ctrlKey&&pe.key=="ArrowRight"?f.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):pe.ctrlKey&&pe.shiftKey&&pe.key.toLowerCase()=="z"?c.topRedoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="z"?c.topUndoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="delete"&&(o.done_json.length<=0||o.setDoneJson([]))},Fe=()=>{setSvgActualInfo(o.done_json[o.handle_svg_info.index],!0)};return vue.onMounted(()=>{var pe;(pe=h.value)==null||pe.focus(),vue.nextTick(function(){var _e;const Lt=(_e=h.value)==null?void 0:_e.getBoundingClientRect();u.canvasInfo={height:(Lt==null?void 0:Lt.height)||0,with:(Lt==null?void 0:Lt.width)||0,top:(Lt==null?void 0:Lt.top)||0,left:(Lt==null?void 0:Lt.left)||0}})}),n({onCanvasMouseUp:j}),(pe,Lt)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:h,onDrop:T,onDragenter:S,onDragover:x,onMousedown:V,onMousemove:F,onMouseup:j,onContextmenu:$,onKeydown:Ie,onMousewheel:z},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(a).svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_1$c,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_2$9),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_3$8),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_5$2)])]),vue.unref(a).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(u).center_offset.x*vue.unref(a).svg.scale},${vue.unref(u).center_offset.y*vue.unref(a).svg.scale})rotate(0)scale(${vue.unref(a).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o).done_json,(_e,Et)=>{var Cn,vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:_e.id,transform:`translate(${_e.x},${_e.y})rotate(0)scale(1)`,onMousewheel:Lt[0]||(Lt[0]=(...jt)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...jt))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(_e)}`)},[vue.createElementVNode("g",{transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2})rotate(${_e.rotate}) scale(1) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`,onMousedown:jt=>O(_e,Et,jt),onMouseup:jt=>L(_e,Et,jt),onMouseenter:jt=>M(_e,Et,jt),onMouseleave:jt=>re(_e,Et,jt),onContextmenu:jt=>he(_e,Et,jt)},[_e.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":_e,"point-visible":vue.unref(p).connection_line&&((Cn=vue.unref(p).select_item.info)==null?void 0:Cn.id)==_e.id},null,8,["item-info","point-visible"])):_e.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${_e.name}`},vue.unref(prosToVBind)(_e,["height","width"]),{width:((Dt=(vn=_e.props)==null?void 0:vn.width)==null?void 0:Dt.val)??100,height:((qe=(de=_e.props)==null?void 0:de.height)==null?void 0:qe.val)??100,id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,_hoisted_10)):_e.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(_e,["height","width"]),{width:((In=(Pt=_e.props)==null?void 0:Pt.width)==null?void 0:In.val)??100,height:((Ce=($e=_e.props)==null?void 0:$e.height)==null?void 0:Ce.val)??100,id:_e.id,onResize:Fe,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,["width","height","id","transform"])):_e.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},le(_e.actual_bound,_e.scale_x,_e.scale_y),{id:`foreign-object${_e.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps(vue.unref(prosToVBind)(_e),{id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_e.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_11)):_e.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:_e.id,x1:_e.props.start_x.val,y1:_e.props.start_y.val,x2:_e.props.end_x.val,y2:_e.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_12$1)):vue.createCommentVNode("",!0),_e.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${_e.id}`,fill:"black","fill-opacity":"0"},le(_e.actual_bound,_e.scale_x,_e.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!_e.selected&&(vue.unref(o).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Move&&((ue=vue.unref(o).handle_svg_info)==null?void 0:ue.info.id)==_e.id,"svg-item-select":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select&&((At=vue.unref(o).handle_svg_info)==null?void 0:At.info.id)==_e.id,"svg-item-in-group":_e.selected}}),null,16,_hoisted_13)):vue.createCommentVNode("",!0),((Ne=vue.unref(o).handle_svg_info)==null?void 0:Ne.info.id)===_e.id&&vue.unref(p).handle_panel&&_e.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0),!_e.selected&&((Oe=vue.unref(p).select_item.info)==null?void 0:Oe.id)==_e.id&&vue.unref(p).connection_panel&&_e.config.have_anchor&&vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).Select||_e.id!==((kt=vue.unref(o).handle_svg_info)==null?void 0:kt.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:$,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_9)],2)],40,_hoisted_8)),[[vue.vShow,_e.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(_).x,y:vue.unref(_).y,height:vue.unref(_).height,width:vue.unref(_).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_14)],8,_hoisted_7)],4))],544),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:d,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f).info,(_e,Et)=>(vue.openBlock(),vue.createElementBlock("li",{key:_e.title,onClick:Cn=>vue.unref(f).onContextMenuClick(Et)},[vue.createElementVNode("p",{class:vue.normalizeClass(_e.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(_e.title)+" ",1),vue.createElementVNode("span",_hoisted_16$1,vue.toDisplayString(_e.hot_key),1)],2)],8,_hoisted_15))),128))],512),[[vue.vShow,vue.unref(f).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_45eb2bb8_lang="",CenterPanel=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-45eb2bb8"]]);/*! Element Plus Icons Vue v2.1.0 */var export_helper_default=(r,n)=>{let i=r.__vccOpts||r;for(let[o,a]of n)i[o]=a;return i},aim_vue_vue_type_script_lang_default={name:"Aim"},_hoisted_12={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_22=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_32=vue.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32zm0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32zM96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32zm576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32z"},null,-1),_hoisted_42=[_hoisted_22,_hoisted_32];function _sfc_render2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_12,_hoisted_42)}var aim_default=export_helper_default(aim_vue_vue_type_script_lang_default,[["render",_sfc_render2],["__file","aim.vue"]]),arrow_down_vue_vue_type_script_lang_default={name:"ArrowDown"},_hoisted_16={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_26=vue.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null,-1),_hoisted_36=[_hoisted_26];function _sfc_render6(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_16,_hoisted_36)}var arrow_down_default=export_helper_default(arrow_down_vue_vue_type_script_lang_default,[["render",_sfc_render6],["__file","arrow-down.vue"]]),circle_check_vue_vue_type_script_lang_default={name:"CircleCheck"},_hoisted_149={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_249=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_348=vue.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"},null,-1),_hoisted_415=[_hoisted_249,_hoisted_348];function _sfc_render49(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_149,_hoisted_415)}var circle_check_default=export_helper_default(circle_check_vue_vue_type_script_lang_default,[["render",_sfc_render49],["__file","circle-check.vue"]]),circle_close_vue_vue_type_script_lang_default={name:"CircleClose"},_hoisted_151={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_251=vue.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"},null,-1),_hoisted_350=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_416=[_hoisted_251,_hoisted_350];function _sfc_render51(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_151,_hoisted_416)}var circle_close_default=export_helper_default(circle_close_vue_vue_type_script_lang_default,[["render",_sfc_render51],["__file","circle-close.vue"]]),close_vue_vue_type_script_lang_default={name:"Close"},_hoisted_156={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_256=vue.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"},null,-1),_hoisted_355=[_hoisted_256];function _sfc_render56(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_156,_hoisted_355)}var close_default=export_helper_default(close_vue_vue_type_script_lang_default,[["render",_sfc_render56],["__file","close.vue"]]),hide_vue_vue_type_script_lang_default={name:"Hide"},_hoisted_1133={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2133=vue.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"},null,-1),_hoisted_3132=vue.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"},null,-1),_hoisted_438=[_hoisted_2133,_hoisted_3132];function _sfc_render133(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1133,_hoisted_438)}var hide_default=export_helper_default(hide_vue_vue_type_script_lang_default,[["render",_sfc_render133],["__file","hide.vue"]]),loading_vue_vue_type_script_lang_default={name:"Loading"},_hoisted_1150={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2150=vue.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),_hoisted_3149=[_hoisted_2150];function _sfc_render150(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1150,_hoisted_3149)}var loading_default=export_helper_default(loading_vue_vue_type_script_lang_default,[["render",_sfc_render150],["__file","loading.vue"]]),view_vue_vue_type_script_lang_default={name:"View"},_hoisted_1283={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2283=vue.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),_hoisted_3282=[_hoisted_2283];function _sfc_render283(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1283,_hoisted_3282)}var view_default=export_helper_default(view_vue_vue_type_script_lang_default,[["render",_sfc_render283],["__file","view.vue"]]),MapShim=function(){if(typeof Map<"u")return Map;function r(n,i){var o=-1;return n.some(function(a,u){return a[0]===i?(o=u,!0):!1}),o}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(i){var o=r(this.__entries__,i),a=this.__entries__[o];return a&&a[1]},n.prototype.set=function(i,o){var a=r(this.__entries__,i);~a?this.__entries__[a][1]=o:this.__entries__.push([i,o])},n.prototype.delete=function(i){var o=this.__entries__,a=r(o,i);~a&&o.splice(a,1)},n.prototype.has=function(i){return!!~r(this.__entries__,i)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(i,o){o===void 0&&(o=null);for(var a=0,u=this.__entries__;a<u.length;a++){var c=u[a];i.call(o,c[1],c[0])}},n}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle(r,n){var i=!1,o=!1,a=0;function u(){i&&(i=!1,r()),o&&f()}function c(){requestAnimationFrame$1(u)}function f(){var d=Date.now();if(i){if(d-a<trailingTimeout)return;o=!0}else i=!0,o=!1,setTimeout(c,n);a=d}return f}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return r.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},r.prototype.removeObserver=function(n){var i=this.observers_,o=i.indexOf(n);~o&&i.splice(o,1),!i.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},r.prototype.updateObservers_=function(){var n=this.observers_.filter(function(i){return i.gatherActive(),i.hasActive()});return n.forEach(function(i){return i.broadcastActive()}),n.length>0},r.prototype.connect_=function(){!isBrowser||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!isBrowser||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var i=n.propertyName,o=i===void 0?"":i,a=transitionKeys.some(function(u){return!!~o.indexOf(u)});a&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),defineConfigurable=function(r,n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Object.defineProperty(r,a,{value:n[a],enumerable:!1,writable:!1,configurable:!0})}return r},getWindowOf=function(r){var n=r&&r.ownerDocument&&r.ownerDocument.defaultView;return n||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(r){return parseFloat(r)||0}function getBordersSize(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.reduce(function(o,a){var u=r["border-"+a+"-width"];return o+toFloat(u)},0)}function getPaddings(r){for(var n=["top","right","bottom","left"],i={},o=0,a=n;o<a.length;o++){var u=a[o],c=r["padding-"+u];i[u]=toFloat(c)}return i}function getSVGContentRect(r){var n=r.getBBox();return createRectInit(0,0,n.width,n.height)}function getHTMLElementContentRect(r){var n=r.clientWidth,i=r.clientHeight;if(!n&&!i)return emptyRect;var o=getWindowOf(r).getComputedStyle(r),a=getPaddings(o),u=a.left+a.right,c=a.top+a.bottom,f=toFloat(o.width),d=toFloat(o.height);if(o.boxSizing==="border-box"&&(Math.round(f+u)!==n&&(f-=getBordersSize(o,"left","right")+u),Math.round(d+c)!==i&&(d-=getBordersSize(o,"top","bottom")+c)),!isDocumentElement(r)){var h=Math.round(f+u)-n,v=Math.round(d+c)-i;Math.abs(h)!==1&&(f-=h),Math.abs(v)!==1&&(d-=v)}return createRectInit(a.left,a.top,f,d)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof getWindowOf(r).SVGGraphicsElement}:function(r){return r instanceof getWindowOf(r).SVGElement&&typeof r.getBBox=="function"}}();function isDocumentElement(r){return r===getWindowOf(r).document.documentElement}function getContentRect(r){return isBrowser?isSVGGraphicsElement(r)?getSVGContentRect(r):getHTMLElementContentRect(r):emptyRect}function createReadOnlyRect(r){var n=r.x,i=r.y,o=r.width,a=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(u.prototype);return defineConfigurable(c,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),c}function createRectInit(r,n,i,o){return{x:r,y:n,width:i,height:o}}var ResizeObservation=function(){function r(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=n}return r.prototype.isActive=function(){var n=getContentRect(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},r}(),ResizeObserverEntry=function(){function r(n,i){var o=createReadOnlyRect(i);defineConfigurable(this,{target:n,contentRect:o})}return r}(),ResizeObserverSPI=function(){function r(n,i,o){if(this.activeObservations_=[],this.observations_=new MapShim,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=i,this.callbackCtx_=o}return r.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)||(i.set(n,new ResizeObservation(n)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)&&(i.delete(n),i.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(i){i.isActive()&&n.activeObservations_.push(i)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,i=this.activeObservations_.map(function(o){return new ResizeObserverEntry(o.target,o.broadcastRect())});this.callback_.call(n,i,n),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(n,i,this);observers.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){ResizeObserver$1.prototype[r]=function(){var n;return(n=observers.get(this))[r].apply(n,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}();const Events=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],VAceEditor=vue.defineComponent({props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...Events],render(){return vue.h("div")},mounted(){const r=this._editor=vue.markRaw(ace.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,r.on("change",()=>{if(this._isSettingContent)return;const n=r.getValue();this._contentBackup=n,this.$emit("update:value",n)}),Events.forEach(n=>{const i="on"+vue.capitalize(n);typeof this.$.vnode.props[i]=="function"&&r.on(n,this.$emit.bind(this,n))}),this._ro=new index$1(()=>r.resize()),this._ro.observe(this.$el),this.$emit("init",r)},beforeUnmount(){var r,n;(r=this._ro)===null||r===void 0||r.disconnect(),(n=this._editor)===null||n===void 0||n.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()}},watch:{value(r){if(this._contentBackup!==r){try{this._isSettingContent=!0,this._editor.setValue(r,1)}finally{this._isSettingContent=!1}this._contentBackup=r}},theme(r){this._editor.setTheme("ace/theme/"+r)},options(r){this._editor.setOptions(r)},readonly(r){this._editor.setReadOnly(r)},placeholder(r){this._editor.setOption("placeholder",r)},wrap(r){this._editor.setWrapBehavioursEnabled(r)},printMargin(r){this._editor.setOption("printMargin",r)},lang(r){this._editor.setOption("mode","ace/mode/"+r)},minLines(r){this._editor.setOption("minLines",r)},maxLines(r){this._editor.setOption("maxLines",r)}}}),themeUrl2="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe21vZHVsZS5leHBvcnRzID0gIi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXIge1xuICBiYWNrZ3JvdW5kOiAjMWMxOTE3O1xuICBjb2xvcjogI0ZDRkZFMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfcHJpbnQtbWFyZ2luIHtcbiAgd2lkdGg6IDFweDtcbiAgYmFja2dyb3VuZDogIzFjMTkxN1xufVxuXG4uYWNlLWtyLXRoZW1lIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzBCMEEwOTtcbiAgY29sb3I6ICNGQ0ZGRTBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2N1cnNvciB7XG4gIGNvbG9yOiAjRkY5OTAwXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9tYXJrZXItbGF5ZXIgLmFjZV9zZWxlY3Rpb24ge1xuICBiYWNrZ3JvdW5kOiByZ2JhKDE3MCwgMCwgMjU1LCAwLjQ1KVxufVxuXG4uYWNlLWtyLXRoZW1lLmFjZV9tdWx0aXNlbGVjdCAuYWNlX3NlbGVjdGlvbi5hY2Vfc3RhcnQge1xuICBib3gtc2hhZG93OiAwIDAgM3B4IDBweCAjMEIwQTA5O1xufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2Vfc3RlcCB7XG4gIGJhY2tncm91bmQ6IHJnYigxMDIsIDgyLCAwKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2VfYnJhY2tldCB7XG4gIG1hcmdpbjogLTFweCAwIDAgLTFweDtcbiAgYm9yZGVyOiAxcHggc29saWQgcmdiYSgyNTUsIDE3NywgMTExLCAwLjMyKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2VfYWN0aXZlLWxpbmUge1xuICBiYWNrZ3JvdW5kOiAjMzg0MDNEXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXItYWN0aXZlLWxpbmUge1xuICBiYWNrZ3JvdW5kLWNvbG9yIDogIzM4NDAzRFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2Vfc2VsZWN0ZWQtd29yZCB7XG4gIGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMTcwLCAwLCAyNTUsIDAuNDUpXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9pbnZpc2libGUge1xuICBjb2xvcjogcmdiYSgyNTUsIDE3NywgMTExLCAwLjMyKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2Vfa2V5d29yZCxcbi5hY2Uta3ItdGhlbWUgLmFjZV9tZXRhIHtcbiAgY29sb3I6ICM5NDlDOEJcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LFxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LmFjZV9jaGFyYWN0ZXIsXG4uYWNlLWtyLXRoZW1lIC5hY2VfY29uc3RhbnQuYWNlX2NoYXJhY3Rlci5hY2VfZXNjYXBlLFxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LmFjZV9vdGhlciB7XG4gIGNvbG9yOiByZ2JhKDIxMCwgMTE3LCAyNCwgMC43Nilcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2ludmFsaWQge1xuICBjb2xvcjogI0Y4RjhGODtcbiAgYmFja2dyb3VuZC1jb2xvcjogI0E0MTMwMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2Vfc3VwcG9ydCB7XG4gIGNvbG9yOiAjOUZDMjhBXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdXBwb3J0LmFjZV9jb25zdGFudCB7XG4gIGNvbG9yOiAjQzI3RTY2XG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9mb2xkIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzk0OUM4QjtcbiAgYm9yZGVyLWNvbG9yOiAjRkNGRkUwXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdXBwb3J0LmFjZV9mdW5jdGlvbiB7XG4gIGNvbG9yOiAjODU4NzNBXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdG9yYWdlIHtcbiAgY29sb3I6ICNGRkVFODBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3N0cmluZyB7XG4gIGNvbG9yOiByZ2JhKDE2NCwgMTYxLCAxODEsIDAuOClcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3N0cmluZy5hY2VfcmVnZXhwIHtcbiAgY29sb3I6IHJnYmEoMTI1LCAyNTUsIDE5MiwgMC42NSlcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2NvbW1lbnQge1xuICBmb250LXN0eWxlOiBpdGFsaWM7XG4gIGNvbG9yOiAjNzA2RDVCXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV92YXJpYWJsZSB7XG4gIGNvbG9yOiAjRDFBNzk2XG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9saXN0LFxuLmFjZS1rci10aGVtZSAuYWNlX21hcmt1cC5hY2VfbGlzdCB7XG4gIGJhY2tncm91bmQtY29sb3I6ICMwRjAwNDBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3ZhcmlhYmxlLmFjZV9sYW5ndWFnZSB7XG4gIGNvbG9yOiAjRkY4MEUxXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9tZXRhLmFjZV90YWcge1xuICBjb2xvcjogI0JBQkQ5Q1xufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfaW5kZW50LWd1aWRlIHtcbiAgYmFja2dyb3VuZDogdXJsKGRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQUVBQUFBQ0NBWUFBQUNaZ2JZbkFBQUFFa2xFUVZRSW1XTmdZR0JnWUZCWFYvOFBBQUpvQVhYNGtUMkVBQUFBQUVsRlRrU3VRbUNDKSByaWdodCByZXBlYXQteVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfaW5kZW50LWd1aWRlLWFjdGl2ZSB7XG4gIGJhY2tncm91bmQ6IHVybChcImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQUVBQUFBQ0NBWUFBQUNaZ2JZbkFBQUFDWEJJV1hNQUFBc1RBQUFMRXdFQW1wd1lBQUFBSUdOSVVrMEFBSG9sQUFDQWd3QUErZjhBQUlEcEFBQjFNQUFBNm1BQUFEcVlBQUFYYjVKZnhVWUFBQUFaU1VSQlZIamFZdmovLy85L2hpdkt5djhCQUFBQS8vOERBQ0xxQmhidmsrL2VBQUFBQUVsRlRrU3VRbUNDXCIpIHJpZ2h0IHJlcGVhdC15O1xufVxuIjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lIixbInJlcXVpcmUiLCJleHBvcnRzIiwibW9kdWxlIiwiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsImFjZS9saWIvZG9tIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7ZXhwb3J0cy5pc0RhcmsgPSB0cnVlOwpleHBvcnRzLmNzc0NsYXNzID0gImFjZS1rci10aGVtZSI7CmV4cG9ydHMuY3NzVGV4dCA9IHJlcXVpcmUoIi4va3JfdGhlbWUuY3NzIik7CnZhciBkb20gPSByZXF1aXJlKCIuLi9saWIvZG9tIik7CmRvbS5pbXBvcnRDc3NTdHJpbmcoZXhwb3J0cy5jc3NUZXh0LCBleHBvcnRzLmNzc0NsYXNzLCBmYWxzZSk7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL3RoZW1lL2tyX3RoZW1lIl0sIGZ1bmN0aW9uKG0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtb2R1bGUgPT0gIm9iamVjdCIgJiYgdHlwZW9mIGV4cG9ydHMgPT0gIm9iamVjdCIgJiYgbW9kdWxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IG07CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICAgIA==",modeJsonUrl="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvbGliL29vcCIsImFjZS9tb2RlL3RleHRfaGlnaGxpZ2h0X3J1bGVzIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dEhpZ2hsaWdodFJ1bGVzID0gcmVxdWlyZSgiLi90ZXh0X2hpZ2hsaWdodF9ydWxlcyIpLlRleHRIaWdobGlnaHRSdWxlczsKdmFyIEpzb25IaWdobGlnaHRSdWxlcyA9IGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuJHJ1bGVzID0gewogICAgICAgICJzdGFydCI6IFsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdG9rZW46ICJ2YXJpYWJsZSIsCiAgICAgICAgICAgICAgICByZWdleDogJ1siXSg/Oig/OlxcXFwuKXwoPzpbXiJcXFxcXSkpKj9bIl1cXHMqKD89OiknCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAic3RyaW5nIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAnIicsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RyaW5nIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lm51bWVyaWMiLAogICAgICAgICAgICAgICAgcmVnZXg6ICIwW3hYXVswLTlhLWZBLUZdK1xcYiIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJjb25zdGFudC5udW1lcmljIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAiWystXT9cXGQrKD86KD86XFwuXFxkKik/KD86W2VFXVsrLV0/XFxkKyk/KT9cXGIiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29uc3RhbnQubGFuZ3VhZ2UuYm9vbGVhbiIsCiAgICAgICAgICAgICAgICByZWdleDogIig/OnRydWV8ZmFsc2UpXFxiIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbJ10oPzooPzpcXFxcLil8KD86W14nXFxcXF0pKSo/WyddIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbW1lbnQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXC9cXC8uKiQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5zdGFydCIsCiAgICAgICAgICAgICAgICByZWdleDogIlxcL1xcKiIsCiAgICAgICAgICAgICAgICBuZXh0OiAiY29tbWVudCIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5scGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbWyh7XSIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5ycGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbXFxdKX1dIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInB1bmN0dWF0aW9uLm9wZXJhdG9yIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAvWyxdLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXHMrIgogICAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAic3RyaW5nIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lmxhbmd1YWdlLmVzY2FwZSIsCiAgICAgICAgICAgICAgICByZWdleDogL1xcKD86eFswLTlhLWZBLUZdezJ9fHVbMC05YS1mQS1GXXs0fXxbIlxcXC9iZm5ydF0pLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInN0cmluZyIsCiAgICAgICAgICAgICAgICByZWdleDogJyJ8JCcsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RhcnQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIGRlZmF1bHRUb2tlbjogInN0cmluZyIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImNvbW1lbnQiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5lbmQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXCpcXC8iLAogICAgICAgICAgICAgICAgbmV4dDogInN0YXJ0IgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBkZWZhdWx0VG9rZW46ICJjb21tZW50IgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfTsKfTsKb29wLmluaGVyaXRzKEpzb25IaWdobGlnaHRSdWxlcywgVGV4dEhpZ2hsaWdodFJ1bGVzKTsKZXhwb3J0cy5Kc29uSGlnaGxpZ2h0UnVsZXMgPSBKc29uSGlnaGxpZ2h0UnVsZXM7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL21hdGNoaW5nX2JyYWNlX291dGRlbnQiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvcmFuZ2UiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uL3JhbmdlIikuUmFuZ2U7CnZhciBNYXRjaGluZ0JyYWNlT3V0ZGVudCA9IGZ1bmN0aW9uICgpIHsgfTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuY2hlY2tPdXRkZW50ID0gZnVuY3Rpb24gKGxpbmUsIGlucHV0KSB7CiAgICAgICAgaWYgKCEvXlxzKyQvLnRlc3QobGluZSkpCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICByZXR1cm4gL15ccypcfS8udGVzdChpbnB1dCk7CiAgICB9OwogICAgdGhpcy5hdXRvT3V0ZGVudCA9IGZ1bmN0aW9uIChkb2MsIHJvdykgewogICAgICAgIHZhciBsaW5lID0gZG9jLmdldExpbmUocm93KTsKICAgICAgICB2YXIgbWF0Y2ggPSBsaW5lLm1hdGNoKC9eKFxzKlx9KS8pOwogICAgICAgIGlmICghbWF0Y2gpCiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIHZhciBjb2x1bW4gPSBtYXRjaFsxXS5sZW5ndGg7CiAgICAgICAgdmFyIG9wZW5CcmFjZVBvcyA9IGRvYy5maW5kTWF0Y2hpbmdCcmFja2V0KHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0pOwogICAgICAgIGlmICghb3BlbkJyYWNlUG9zIHx8IG9wZW5CcmFjZVBvcy5yb3cgPT0gcm93KQogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB2YXIgaW5kZW50ID0gdGhpcy4kZ2V0SW5kZW50KGRvYy5nZXRMaW5lKG9wZW5CcmFjZVBvcy5yb3cpKTsKICAgICAgICBkb2MucmVwbGFjZShuZXcgUmFuZ2Uocm93LCAwLCByb3csIGNvbHVtbiAtIDEpLCBpbmRlbnQpOwogICAgfTsKICAgIHRoaXMuJGdldEluZGVudCA9IGZ1bmN0aW9uIChsaW5lKSB7CiAgICAgICAgcmV0dXJuIGxpbmUubWF0Y2goL15ccyovKVswXTsKICAgIH07Cn0pLmNhbGwoTWF0Y2hpbmdCcmFjZU91dGRlbnQucHJvdG90eXBlKTsKZXhwb3J0cy5NYXRjaGluZ0JyYWNlT3V0ZGVudCA9IE1hdGNoaW5nQnJhY2VPdXRkZW50OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9mb2xkaW5nL2NzdHlsZSIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSIsImFjZS9saWIvb29wIiwiYWNlL3JhbmdlIiwiYWNlL21vZGUvZm9sZGluZy9mb2xkX21vZGUiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuLi8uLi9saWIvb29wIik7CnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uLy4uL3JhbmdlIikuUmFuZ2U7CnZhciBCYXNlRm9sZE1vZGUgPSByZXF1aXJlKCIuL2ZvbGRfbW9kZSIpLkZvbGRNb2RlOwp2YXIgRm9sZE1vZGUgPSBleHBvcnRzLkZvbGRNb2RlID0gZnVuY3Rpb24gKGNvbW1lbnRSZWdleCkgewogICAgaWYgKGNvbW1lbnRSZWdleCkgewogICAgICAgIHRoaXMuZm9sZGluZ1N0YXJ0TWFya2VyID0gbmV3IFJlZ0V4cCh0aGlzLmZvbGRpbmdTdGFydE1hcmtlci5zb3VyY2UucmVwbGFjZSgvXHxbXnxdKj8kLywgInwiICsgY29tbWVudFJlZ2V4LnN0YXJ0KSk7CiAgICAgICAgdGhpcy5mb2xkaW5nU3RvcE1hcmtlciA9IG5ldyBSZWdFeHAodGhpcy5mb2xkaW5nU3RvcE1hcmtlci5zb3VyY2UucmVwbGFjZSgvXHxbXnxdKj8kLywgInwiICsgY29tbWVudFJlZ2V4LmVuZCkpOwogICAgfQp9Owpvb3AuaW5oZXJpdHMoRm9sZE1vZGUsIEJhc2VGb2xkTW9kZSk7CihmdW5jdGlvbiAoKSB7CiAgICB0aGlzLmZvbGRpbmdTdGFydE1hcmtlciA9IC8oW1x7XFtcKF0pW15cfVxdXCldKiR8XlxzKihcL1wqKS87CiAgICB0aGlzLmZvbGRpbmdTdG9wTWFya2VyID0gL15bXlxbXHtcKF0qKFtcfVxdXCldKXxeW1xzXCpdKihcKlwvKS87CiAgICB0aGlzLnNpbmdsZUxpbmVCbG9ja0NvbW1lbnRSZSA9IC9eXHMqKFwvXCopLipcKlwvXHMqJC87CiAgICB0aGlzLnRyaXBsZVN0YXJCbG9ja0NvbW1lbnRSZSA9IC9eXHMqKFwvXCpcKlwqKS4qXCpcL1xzKiQvOwogICAgdGhpcy5zdGFydFJlZ2lvblJlID0gL15ccyooXC9cKnxcL1wvKSM/cmVnaW9uXGIvOwogICAgdGhpcy5fZ2V0Rm9sZFdpZGdldEJhc2UgPSB0aGlzLmdldEZvbGRXaWRnZXQ7CiAgICB0aGlzLmdldEZvbGRXaWRnZXQgPSBmdW5jdGlvbiAoc2Vzc2lvbiwgZm9sZFN0eWxlLCByb3cpIHsKICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgIGlmICh0aGlzLnNpbmdsZUxpbmVCbG9ja0NvbW1lbnRSZS50ZXN0KGxpbmUpKSB7CiAgICAgICAgICAgIGlmICghdGhpcy5zdGFydFJlZ2lvblJlLnRlc3QobGluZSkgJiYgIXRoaXMudHJpcGxlU3RhckJsb2NrQ29tbWVudFJlLnRlc3QobGluZSkpCiAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgfQogICAgICAgIHZhciBmdyA9IHRoaXMuX2dldEZvbGRXaWRnZXRCYXNlKHNlc3Npb24sIGZvbGRTdHlsZSwgcm93KTsKICAgICAgICBpZiAoIWZ3ICYmIHRoaXMuc3RhcnRSZWdpb25SZS50ZXN0KGxpbmUpKQogICAgICAgICAgICByZXR1cm4gInN0YXJ0IjsgLy8gbGluZUNvbW1lbnRSZWdpb25TdGFydAogICAgICAgIHJldHVybiBmdzsKICAgIH07CiAgICB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZSA9IGZ1bmN0aW9uIChzZXNzaW9uLCBmb2xkU3R5bGUsIHJvdywgZm9yY2VNdWx0aWxpbmUpIHsKICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgIGlmICh0aGlzLnN0YXJ0UmVnaW9uUmUudGVzdChsaW5lKSkKICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0Q29tbWVudFJlZ2lvbkJsb2NrKHNlc3Npb24sIGxpbmUsIHJvdyk7CiAgICAgICAgdmFyIG1hdGNoID0gbGluZS5tYXRjaCh0aGlzLmZvbGRpbmdTdGFydE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm9wZW5pbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHZhciByYW5nZSA9IHNlc3Npb24uZ2V0Q29tbWVudEZvbGRSYW5nZShyb3csIGkgKyBtYXRjaFswXS5sZW5ndGgsIDEpOwogICAgICAgICAgICBpZiAocmFuZ2UgJiYgIXJhbmdlLmlzTXVsdGlMaW5lKCkpIHsKICAgICAgICAgICAgICAgIGlmIChmb3JjZU11bHRpbGluZSkgewogICAgICAgICAgICAgICAgICAgIHJhbmdlID0gdGhpcy5nZXRTZWN0aW9uUmFuZ2Uoc2Vzc2lvbiwgcm93KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbGRTdHlsZSAhPSAiYWxsIikKICAgICAgICAgICAgICAgICAgICByYW5nZSA9IG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJhbmdlOwogICAgICAgIH0KICAgICAgICBpZiAoZm9sZFN0eWxlID09PSAibWFya2JlZ2luIikKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIHZhciBtYXRjaCA9IGxpbmUubWF0Y2godGhpcy5mb2xkaW5nU3RvcE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXggKyBtYXRjaFswXS5sZW5ndGg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsb3NpbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHJldHVybiBzZXNzaW9uLmdldENvbW1lbnRGb2xkUmFuZ2Uocm93LCBpLCAtMSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuZ2V0U2VjdGlvblJhbmdlID0gZnVuY3Rpb24gKHNlc3Npb24sIHJvdykgewogICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgdmFyIHN0YXJ0SW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gcm93OwogICAgICAgIHZhciBzdGFydENvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIHJvdyA9IHJvdyArIDE7CiAgICAgICAgdmFyIGVuZFJvdyA9IHJvdzsKICAgICAgICB2YXIgbWF4Um93ID0gc2Vzc2lvbi5nZXRMZW5ndGgoKTsKICAgICAgICB3aGlsZSAoKytyb3cgPCBtYXhSb3cpIHsKICAgICAgICAgICAgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgICAgICB2YXIgaW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgICAgIGlmIChpbmRlbnQgPT09IC0xKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChzdGFydEluZGVudCA+IGluZGVudCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB2YXIgc3ViUmFuZ2UgPSB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZShzZXNzaW9uLCAiYWxsIiwgcm93KTsKICAgICAgICAgICAgaWYgKHN1YlJhbmdlKSB7CiAgICAgICAgICAgICAgICBpZiAoc3ViUmFuZ2Uuc3RhcnQucm93IDw9IHN0YXJ0Um93KSB7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdWJSYW5nZS5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgcm93ID0gc3ViUmFuZ2UuZW5kLnJvdzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0YXJ0SW5kZW50ID09IGluZGVudCkgewogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVuZFJvdyA9IHJvdzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgc2Vzc2lvbi5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgIH07CiAgICB0aGlzLmdldENvbW1lbnRSZWdpb25CbG9jayA9IGZ1bmN0aW9uIChzZXNzaW9uLCBsaW5lLCByb3cpIHsKICAgICAgICB2YXIgc3RhcnRDb2x1bW4gPSBsaW5lLnNlYXJjaCgvXHMqJC8pOwogICAgICAgIHZhciBtYXhSb3cgPSBzZXNzaW9uLmdldExlbmd0aCgpOwogICAgICAgIHZhciBzdGFydFJvdyA9IHJvdzsKICAgICAgICB2YXIgcmUgPSAvXlxzKig/OlwvXCp8XC9cL3wtLSkjPyhlbmQpP3JlZ2lvblxiLzsKICAgICAgICB2YXIgZGVwdGggPSAxOwogICAgICAgIHdoaWxlICgrK3JvdyA8IG1heFJvdykgewogICAgICAgICAgICBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgICAgIHZhciBtID0gcmUuZXhlYyhsaW5lKTsKICAgICAgICAgICAgaWYgKCFtKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChtWzFdKQogICAgICAgICAgICAgICAgZGVwdGgtLTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVwdGgrKzsKICAgICAgICAgICAgaWYgKCFkZXB0aCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICB2YXIgZW5kUm93ID0gcm93OwogICAgICAgIGlmIChlbmRSb3cgPiBzdGFydFJvdykgewogICAgICAgICAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBsaW5lLmxlbmd0aCk7CiAgICAgICAgfQogICAgfTsKfSkuY2FsbChGb2xkTW9kZS5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uIixbInJlcXVpcmUiLCJleHBvcnRzIiwibW9kdWxlIiwiYWNlL2xpYi9vb3AiLCJhY2UvbW9kZS90ZXh0IiwiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLCJhY2UvbW9kZS9tYXRjaGluZ19icmFjZV9vdXRkZW50IiwiYWNlL21vZGUvYmVoYXZpb3VyL2NzdHlsZSIsImFjZS9tb2RlL2ZvbGRpbmcvY3N0eWxlIiwiYWNlL3dvcmtlci93b3JrZXJfY2xpZW50Il0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dE1vZGUgPSByZXF1aXJlKCIuL3RleHQiKS5Nb2RlOwp2YXIgSGlnaGxpZ2h0UnVsZXMgPSByZXF1aXJlKCIuL2pzb25faGlnaGxpZ2h0X3J1bGVzIikuSnNvbkhpZ2hsaWdodFJ1bGVzOwp2YXIgTWF0Y2hpbmdCcmFjZU91dGRlbnQgPSByZXF1aXJlKCIuL21hdGNoaW5nX2JyYWNlX291dGRlbnQiKS5NYXRjaGluZ0JyYWNlT3V0ZGVudDsKdmFyIENzdHlsZUJlaGF2aW91ciA9IHJlcXVpcmUoIi4vYmVoYXZpb3VyL2NzdHlsZSIpLkNzdHlsZUJlaGF2aW91cjsKdmFyIENTdHlsZUZvbGRNb2RlID0gcmVxdWlyZSgiLi9mb2xkaW5nL2NzdHlsZSIpLkZvbGRNb2RlOwp2YXIgV29ya2VyQ2xpZW50ID0gcmVxdWlyZSgiLi4vd29ya2VyL3dvcmtlcl9jbGllbnQiKS5Xb3JrZXJDbGllbnQ7CnZhciBNb2RlID0gZnVuY3Rpb24gKCkgewogICAgdGhpcy5IaWdobGlnaHRSdWxlcyA9IEhpZ2hsaWdodFJ1bGVzOwogICAgdGhpcy4kb3V0ZGVudCA9IG5ldyBNYXRjaGluZ0JyYWNlT3V0ZGVudCgpOwogICAgdGhpcy4kYmVoYXZpb3VyID0gbmV3IENzdHlsZUJlaGF2aW91cigpOwogICAgdGhpcy5mb2xkaW5nUnVsZXMgPSBuZXcgQ1N0eWxlRm9sZE1vZGUoKTsKfTsKb29wLmluaGVyaXRzKE1vZGUsIFRleHRNb2RlKTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMubGluZUNvbW1lbnRTdGFydCA9ICIvLyI7CiAgICB0aGlzLmJsb2NrQ29tbWVudCA9IHsgc3RhcnQ6ICIvKiIsIGVuZDogIiovIiB9OwogICAgdGhpcy5nZXROZXh0TGluZUluZGVudCA9IGZ1bmN0aW9uIChzdGF0ZSwgbGluZSwgdGFiKSB7CiAgICAgICAgdmFyIGluZGVudCA9IHRoaXMuJGdldEluZGVudChsaW5lKTsKICAgICAgICBpZiAoc3RhdGUgPT0gInN0YXJ0IikgewogICAgICAgICAgICB2YXIgbWF0Y2ggPSBsaW5lLm1hdGNoKC9eLipbXHtcKFxbXVxzKiQvKTsKICAgICAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgICAgICBpbmRlbnQgKz0gdGFiOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBpbmRlbnQ7CiAgICB9OwogICAgdGhpcy5jaGVja091dGRlbnQgPSBmdW5jdGlvbiAoc3RhdGUsIGxpbmUsIGlucHV0KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJG91dGRlbnQuY2hlY2tPdXRkZW50KGxpbmUsIGlucHV0KTsKICAgIH07CiAgICB0aGlzLmF1dG9PdXRkZW50ID0gZnVuY3Rpb24gKHN0YXRlLCBkb2MsIHJvdykgewogICAgICAgIHRoaXMuJG91dGRlbnQuYXV0b091dGRlbnQoZG9jLCByb3cpOwogICAgfTsKICAgIHRoaXMuY3JlYXRlV29ya2VyID0gZnVuY3Rpb24gKHNlc3Npb24pIHsKICAgICAgICB2YXIgd29ya2VyID0gbmV3IFdvcmtlckNsaWVudChbImFjZSJdLCAiYWNlL21vZGUvanNvbl93b3JrZXIiLCAiSnNvbldvcmtlciIpOwogICAgICAgIHdvcmtlci5hdHRhY2hUb0RvY3VtZW50KHNlc3Npb24uZ2V0RG9jdW1lbnQoKSk7CiAgICAgICAgd29ya2VyLm9uKCJhbm5vdGF0ZSIsIGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgIHNlc3Npb24uc2V0QW5ub3RhdGlvbnMoZS5kYXRhKTsKICAgICAgICB9KTsKICAgICAgICB3b3JrZXIub24oInRlcm1pbmF0ZSIsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgc2Vzc2lvbi5jbGVhckFubm90YXRpb25zKCk7CiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHdvcmtlcjsKICAgIH07CiAgICB0aGlzLiRpZCA9ICJhY2UvbW9kZS9qc29uIjsKfSkuY2FsbChNb2RlLnByb3RvdHlwZSk7CmV4cG9ydHMuTW9kZSA9IE1vZGU7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL21vZGUvanNvbiJdLCBmdW5jdGlvbihtKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09ICJvYmplY3QiICYmIHR5cGVvZiBleHBvcnRzID09ICJvYmplY3QiICYmIG1vZHVsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9KSgpOwogICAgICAgICAgICA=",workerJsonUrl="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBjb21wYXJlUG9pbnRzID0gZnVuY3Rpb24gKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IGZ1bmN0aW9uIChzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgZW5kQ29sdW1uKSB7CiAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgIHJvdzogc3RhcnRSb3csCiAgICAgICAgY29sdW1uOiBzdGFydENvbHVtbgogICAgfTsKICAgIHRoaXMuZW5kID0gewogICAgICAgIHJvdzogZW5kUm93LAogICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICB9Owp9OwooZnVuY3Rpb24gKCkgewogICAgdGhpcy5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIHRoaXMudG9TdHJpbmcgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuICgiUmFuZ2U6IFsiICsgdGhpcy5zdGFydC5yb3cgKyAiLyIgKyB0aGlzLnN0YXJ0LmNvbHVtbiArCiAgICAgICAgICAgICJdIC0+IFsiICsgdGhpcy5lbmQucm93ICsgIi8iICsgdGhpcy5lbmQuY29sdW1uICsgIl0iKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMDsKICAgIH07CiAgICB0aGlzLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlUG9pbnQgPSBmdW5jdGlvbiAocCkgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocC5yb3csIHAuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlUG9pbnQocmFuZ2Uuc3RhcnQpID09IDAgJiYgdGhpcy5jb21wYXJlUG9pbnQocmFuZ2UuZW5kKSA9PSAwOwogICAgfTsKICAgIHRoaXMuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIHRoaXMuaXNFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuaXNTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5zZXRFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uOwogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3cucm93OwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5lbmQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuaW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuY29tcGFyZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICghdGhpcy5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gY29sdW1uIDwgdGhpcy5zdGFydC5jb2x1bW4gPyAtMSA6IChjb2x1bW4gPiB0aGlzLmVuZC5jb2x1bW4gPyAxIDogMCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuc3RhcnQucm93KQogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgaWYgKHJvdyA+IHRoaXMuZW5kLnJvdykKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09PSByb3cpCiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uIDw9IHRoaXMuZW5kLmNvbHVtbiA/IDAgOiAxOwogICAgICAgIHJldHVybiAwOwogICAgfTsKICAgIHRoaXMuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuY29tcGFyZUVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlSW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAodGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5leHRlbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgY21wID0gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICBpZiAoY21wID09IDApCiAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgIGVsc2UgaWYgKGNtcCA9PSAtMSkKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHZhciBlbmQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5pc0VtcHR5ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgPT09IHRoaXMuZW5kLnJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PT0gdGhpcy5lbmQuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgdGhpcy5jbG9uZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gUmFuZ2UuZnJvbVBvaW50cyh0aGlzLnN0YXJ0LCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5jb2xsYXBzZVJvd3MgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLmNvbHVtbiA9PSAwKQogICAgICAgICAgICByZXR1cm4gbmV3IFJhbmdlKHRoaXMuc3RhcnQucm93LCAwLCBNYXRoLm1heCh0aGlzLnN0YXJ0LnJvdywgdGhpcy5lbmQucm93IC0gMSksIDApOwogICAgICAgIGVsc2UKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgdGhpcy5lbmQucm93LCAwKTsKICAgIH07CiAgICB0aGlzLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgdGhpcy5tb3ZlQnkgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0LnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gKz0gY29sdW1uOwogICAgICAgIHRoaXMuZW5kLnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5lbmQuY29sdW1uICs9IGNvbHVtbjsKICAgIH07Cn0pLmNhbGwoUmFuZ2UucHJvdG90eXBlKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7ClJhbmdlLmNvbXBhcmVQb2ludHMgPSBmdW5jdGlvbiAocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKZXhwb3J0cy5SYW5nZSA9IFJhbmdlOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvYW5jaG9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuL2xpYi9vb3AiKTsKdmFyIEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoIi4vbGliL2V2ZW50X2VtaXR0ZXIiKS5FdmVudEVtaXR0ZXI7CnZhciBBbmNob3IgPSBleHBvcnRzLkFuY2hvciA9IGZ1bmN0aW9uIChkb2MsIHJvdywgY29sdW1uKSB7CiAgICB0aGlzLiRvbkNoYW5nZSA9IHRoaXMub25DaGFuZ2UuYmluZCh0aGlzKTsKICAgIHRoaXMuYXR0YWNoKGRvYyk7CiAgICBpZiAodHlwZW9mIGNvbHVtbiA9PSAidW5kZWZpbmVkIikKICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdy5yb3csIHJvdy5jb2x1bW4pOwogICAgZWxzZQogICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LCBjb2x1bW4pOwp9OwooZnVuY3Rpb24gKCkgewogICAgb29wLmltcGxlbWVudCh0aGlzLCBFdmVudEVtaXR0ZXIpOwogICAgdGhpcy5nZXRQb3NpdGlvbiA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCh0aGlzLnJvdywgdGhpcy5jb2x1bW4pOwogICAgfTsKICAgIHRoaXMuZ2V0RG9jdW1lbnQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQ7CiAgICB9OwogICAgdGhpcy4kaW5zZXJ0UmlnaHQgPSBmYWxzZTsKICAgIHRoaXMub25DaGFuZ2UgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIHBvaW50ID0gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHsgcm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbiB9LCB0aGlzLiRpbnNlcnRSaWdodCk7CiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihwb2ludC5yb3csIHBvaW50LmNvbHVtbiwgdHJ1ZSk7CiAgICB9OwogICAgZnVuY3Rpb24gJHBvaW50c0luT3JkZXIocG9pbnQxLCBwb2ludDIsIGVxdWFsUG9pbnRzSW5PcmRlcikgewogICAgICAgIHZhciBiQ29sSXNBZnRlciA9IGVxdWFsUG9pbnRzSW5PcmRlciA/IHBvaW50MS5jb2x1bW4gPD0gcG9pbnQyLmNvbHVtbiA6IHBvaW50MS5jb2x1bW4gPCBwb2ludDIuY29sdW1uOwogICAgICAgIHJldHVybiAocG9pbnQxLnJvdyA8IHBvaW50Mi5yb3cpIHx8IChwb2ludDEucm93ID09IHBvaW50Mi5yb3cgJiYgYkNvbElzQWZ0ZXIpOwogICAgfQogICAgZnVuY3Rpb24gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHBvaW50LCBtb3ZlSWZFcXVhbCkgewogICAgICAgIHZhciBkZWx0YUlzSW5zZXJ0ID0gZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiOwogICAgICAgIHZhciBkZWx0YVJvd1NoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5yb3cgLSBkZWx0YS5zdGFydC5yb3cpOwogICAgICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgICAgIHZhciBkZWx0YVN0YXJ0ID0gZGVsdGEuc3RhcnQ7CiAgICAgICAgdmFyIGRlbHRhRW5kID0gZGVsdGFJc0luc2VydCA/IGRlbHRhU3RhcnQgOiBkZWx0YS5lbmQ7IC8vIENvbGxhcHNlIGluc2VydCByYW5nZS4KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgcm93OiBwb2ludC5yb3csCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICByb3c6IHBvaW50LnJvdyArIGRlbHRhUm93U2hpZnQsCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogZGVsdGFTdGFydC5yb3csCiAgICAgICAgICAgIGNvbHVtbjogZGVsdGFTdGFydC5jb2x1bW4KICAgICAgICB9OwogICAgfQogICAgdGhpcy5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICB0aGlzLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIHRoaXMuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBwb3MgPSB7fTsKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KICAgICAgICBpZiAoY29sdW1uIDwgMCkKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgcmV0dXJuIHBvczsKICAgIH07Cn0pLmNhbGwoQW5jaG9yLnByb3RvdHlwZSk7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9kb2N1bWVudCIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi9saWIvb29wIik7CnZhciBhcHBseURlbHRhID0gcmVxdWlyZSgiLi9hcHBseV9kZWx0YSIpLmFwcGx5RGVsdGE7CnZhciBFdmVudEVtaXR0ZXIgPSByZXF1aXJlKCIuL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwp2YXIgUmFuZ2UgPSByZXF1aXJlKCIuL3JhbmdlIikuUmFuZ2U7CnZhciBBbmNob3IgPSByZXF1aXJlKCIuL2FuY2hvciIpLkFuY2hvcjsKdmFyIERvY3VtZW50ID0gZnVuY3Rpb24gKHRleHRPckxpbmVzKSB7CiAgICB0aGlzLiRsaW5lcyA9IFsiIl07CiAgICBpZiAodGV4dE9yTGluZXMubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgfQogICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh0ZXh0T3JMaW5lcykpIHsKICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiAwLCBjb2x1bW46IDAgfSwgdGV4dE9yTGluZXMpOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICB9Cn07CihmdW5jdGlvbiAoKSB7CiAgICBvb3AuaW1wbGVtZW50KHRoaXMsIEV2ZW50RW1pdHRlcik7CiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbGVuID0gdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdGhpcy5yZW1vdmUobmV3IFJhbmdlKDAsIDAsIGxlbiwgdGhpcy5nZXRMaW5lKGxlbikubGVuZ3RoKSk7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0IHx8ICIiKTsKICAgIH07CiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldEFsbExpbmVzKCkuam9pbih0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIoKSk7CiAgICB9OwogICAgdGhpcy5jcmVhdGVBbmNob3IgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gbmV3IEFuY2hvcih0aGlzLCByb3csIGNvbHVtbik7CiAgICB9OwogICAgaWYgKCJhYWEiLnNwbGl0KC9hLykubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kc3BsaXQgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgICAgICByZXR1cm4gdGV4dC5yZXBsYWNlKC9cclxufFxyL2csICJcbiIpLnNwbGl0KCJcbiIpOwogICAgICAgIH07CiAgICB9CiAgICBlbHNlIHsKICAgICAgICB0aGlzLiRzcGxpdCA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgICAgIHJldHVybiB0ZXh0LnNwbGl0KC9cclxufFxyfFxuLyk7CiAgICAgICAgfTsKICAgIH0KICAgIHRoaXMuJGRldGVjdE5ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHZhciBtYXRjaCA9IHRleHQubWF0Y2goL14uKj8oXHJcbnxccnxcbikvbSk7CiAgICAgICAgdGhpcy4kYXV0b05ld0xpbmUgPSBtYXRjaCA/IG1hdGNoWzFdIDogIlxuIjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyID0gZnVuY3Rpb24gKCkgewogICAgICAgIHN3aXRjaCAodGhpcy4kbmV3TGluZU1vZGUpIHsKICAgICAgICAgICAgY2FzZSAid2luZG93cyI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxyXG4iOwogICAgICAgICAgICBjYXNlICJ1bml4IjoKICAgICAgICAgICAgICAgIHJldHVybiAiXG4iOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGF1dG9OZXdMaW5lIHx8ICJcbiI7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJGF1dG9OZXdMaW5lID0gIiI7CiAgICB0aGlzLiRuZXdMaW5lTW9kZSA9ICJhdXRvIjsKICAgIHRoaXMuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lTW9kZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kbmV3TGluZU1vZGU7CiAgICB9OwogICAgdGhpcy5pc05ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHJldHVybiAodGV4dCA9PSAiXHJcbiIgfHwgdGV4dCA9PSAiXHIiIHx8IHRleHQgPT0gIlxuIik7CiAgICB9OwogICAgdGhpcy5nZXRMaW5lID0gZnVuY3Rpb24gKHJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lc1tyb3ddIHx8ICIiOwogICAgfTsKICAgIHRoaXMuZ2V0TGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICByZXR1cm4gdGhpcy4kbGluZXMuc2xpY2UoZmlyc3RSb3csIGxhc3RSb3cgKyAxKTsKICAgIH07CiAgICB0aGlzLmdldEFsbExpbmVzID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzKDAsIHRoaXMuZ2V0TGVuZ3RoKCkpOwogICAgfTsKICAgIHRoaXMuZ2V0TGVuZ3RoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICB9OwogICAgdGhpcy5nZXRUZXh0UmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHJhbmdlKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICB0aGlzLmdldExpbmVzRm9yUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgaWYgKHJhbmdlLnN0YXJ0LnJvdyA9PT0gcmFuZ2UuZW5kLnJvdykgewogICAgICAgICAgICBsaW5lcyA9IFt0aGlzLmdldExpbmUocmFuZ2Uuc3RhcnQucm93KS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uLCByYW5nZS5lbmQuY29sdW1uKV07CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IHRoaXMuZ2V0TGluZXMocmFuZ2Uuc3RhcnQucm93LCByYW5nZS5lbmQucm93KTsKICAgICAgICAgICAgbGluZXNbMF0gPSAobGluZXNbMF0gfHwgIiIpLnN1YnN0cmluZyhyYW5nZS5zdGFydC5jb2x1bW4pOwogICAgICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIDE7CiAgICAgICAgICAgIGlmIChyYW5nZS5lbmQucm93IC0gcmFuZ2Uuc3RhcnQucm93ID09IGwpCiAgICAgICAgICAgICAgICBsaW5lc1tsXSA9IGxpbmVzW2xdLnN1YnN0cmluZygwLCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGxpbmVzOwogICAgfTsKICAgIHRoaXMuaW5zZXJ0TGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUxpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQucmVtb3ZlTGluZXMgaXMgZGVwcmVjYXRlZC4gVXNlIHRoZSByZW1vdmVGdWxsTGluZXMgbWV0aG9kIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMucmVtb3ZlRnVsbExpbmVzKGZpcnN0Um93LCBsYXN0Um93KTsKICAgIH07CiAgICB0aGlzLmluc2VydE5ld0xpbmUgPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5pbnNlcnROZXdMaW5lIGlzIGRlcHJlY2F0ZWQuIFVzZSBpbnNlcnRNZXJnZWRMaW5lcyhwb3NpdGlvbiwgWycnLCAnJ10pIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsiIiwgIiJdKTsKICAgIH07CiAgICB0aGlzLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICB0aGlzLmluc2VydEluTGluZSA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMucG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uICsgdGV4dC5sZW5ndGgpOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBbdGV4dF0KICAgICAgICB9LCB0cnVlKTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMuY2xpcHBlZFBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcm93ID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93ID49IGxlbmd0aCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGggLSAxOwogICAgICAgICAgICBjb2x1bW4gPSB1bmRlZmluZWQ7CiAgICAgICAgfQogICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHJvdyk7CiAgICAgICAgaWYgKGNvbHVtbiA9PSB1bmRlZmluZWQpCiAgICAgICAgICAgIGNvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIGNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KGNvbHVtbiwgMCksIGxpbmUubGVuZ3RoKTsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgdGhpcy5wb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLiRjbGlwUG9zaXRpb24gPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocG9zaXRpb24ucm93ID49IGxlbmd0aCkgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBsZW5ndGggLSAxKTsKICAgICAgICAgICAgcG9zaXRpb24uY29sdW1uID0gdGhpcy5nZXRMaW5lKGxlbmd0aCAtIDEpLmxlbmd0aDsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KHBvc2l0aW9uLmNvbHVtbiwgMCksIHRoaXMuZ2V0TGluZShwb3NpdGlvbi5yb3cpLmxlbmd0aCk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBwb3NpdGlvbjsKICAgIH07CiAgICB0aGlzLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzID0gZnVuY3Rpb24gKHBvc2l0aW9uLCBsaW5lcykgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHsKICAgICAgICAgICAgcm93OiBzdGFydC5yb3cgKyBsaW5lcy5sZW5ndGggLSAxLAogICAgICAgICAgICBjb2x1bW46IChsaW5lcy5sZW5ndGggPT0gMSA/IHN0YXJ0LmNvbHVtbiA6IDApICsgbGluZXNbbGluZXMubGVuZ3RoIC0gMV0ubGVuZ3RoCiAgICAgICAgfTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJpbnNlcnQiLAogICAgICAgICAgICBsaW5lczogbGluZXMKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMucmVtb3ZlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLmVuZC5yb3csIHJhbmdlLmVuZC5jb2x1bW4pOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2UoeyBzdGFydDogc3RhcnQsIGVuZDogZW5kIH0pCiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3Moc3RhcnQpOwogICAgfTsKICAgIHRoaXMucmVtb3ZlSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGZpcnN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgZmlyc3RSb3cpLCB0aGlzLmdldExlbmd0aCgpIC0gMSk7CiAgICAgICAgbGFzdFJvdyA9IE1hdGgubWluKE1hdGgubWF4KDAsIGxhc3RSb3cpLCB0aGlzLmdldExlbmd0aCgpIC0gMSk7CiAgICAgICAgdmFyIGRlbGV0ZUZpcnN0TmV3TGluZSA9IGxhc3RSb3cgPT0gdGhpcy5nZXRMZW5ndGgoKSAtIDEgJiYgZmlyc3RSb3cgPiAwOwogICAgICAgIHZhciBkZWxldGVMYXN0TmV3TGluZSA9IGxhc3RSb3cgPCB0aGlzLmdldExlbmd0aCgpIC0gMTsKICAgICAgICB2YXIgc3RhcnRSb3cgPSAoZGVsZXRlRmlyc3ROZXdMaW5lID8gZmlyc3RSb3cgLSAxIDogZmlyc3RSb3cpOwogICAgICAgIHZhciBzdGFydENvbCA9IChkZWxldGVGaXJzdE5ld0xpbmUgPyB0aGlzLmdldExpbmUoc3RhcnRSb3cpLmxlbmd0aCA6IDApOwogICAgICAgIHZhciBlbmRSb3cgPSAoZGVsZXRlTGFzdE5ld0xpbmUgPyBsYXN0Um93ICsgMSA6IGxhc3RSb3cpOwogICAgICAgIHZhciBlbmRDb2wgPSAoZGVsZXRlTGFzdE5ld0xpbmUgPyAwIDogdGhpcy5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgICAgICB2YXIgcmFuZ2UgPSBuZXcgUmFuZ2Uoc3RhcnRSb3csIHN0YXJ0Q29sLCBlbmRSb3csIGVuZENvbCk7CiAgICAgICAgdmFyIGRlbGV0ZWRMaW5lcyA9IHRoaXMuJGxpbmVzLnNsaWNlKGZpcnN0Um93LCBsYXN0Um93ICsgMSk7CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHJhbmdlLnN0YXJ0LAogICAgICAgICAgICBlbmQ6IHJhbmdlLmVuZCwKICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgbGluZXM6IHRoaXMuZ2V0TGluZXNGb3JSYW5nZShyYW5nZSkKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gZGVsZXRlZExpbmVzOwogICAgfTsKICAgIHRoaXMucmVtb3ZlTmV3TGluZSA9IGZ1bmN0aW9uIChyb3cpIHsKICAgICAgICBpZiAocm93IDwgdGhpcy5nZXRMZW5ndGgoKSAtIDEgJiYgcm93ID49IDApIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3csIHRoaXMuZ2V0TGluZShyb3cpLmxlbmd0aCksCiAgICAgICAgICAgICAgICBlbmQ6IHRoaXMucG9zKHJvdyArIDEsIDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgICAgIGxpbmVzOiBbIiIsICIiXQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7CiAgICAgICAgaWYgKCEocmFuZ2UgaW5zdGFuY2VvZiBSYW5nZSkpCiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhyYW5nZS5zdGFydCwgcmFuZ2UuZW5kKTsKICAgICAgICBpZiAodGV4dC5sZW5ndGggPT09IDAgJiYgcmFuZ2UuaXNFbXB0eSgpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgaWYgKHRleHQgPT0gdGhpcy5nZXRUZXh0UmFuZ2UocmFuZ2UpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2UuZW5kOwogICAgICAgIHRoaXMucmVtb3ZlKHJhbmdlKTsKICAgICAgICB2YXIgZW5kOwogICAgICAgIGlmICh0ZXh0KSB7CiAgICAgICAgICAgIGVuZCA9IHRoaXMuaW5zZXJ0KHJhbmdlLnN0YXJ0LCB0ZXh0KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGVuZCA9IHJhbmdlLnN0YXJ0OwogICAgICAgIH0KICAgICAgICByZXR1cm4gZW5kOwogICAgfTsKICAgIHRoaXMuYXBwbHlEZWx0YXMgPSBmdW5jdGlvbiAoZGVsdGFzKSB7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkZWx0YXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhc1tpXSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGFzID0gZnVuY3Rpb24gKGRlbHRhcykgewogICAgICAgIGZvciAodmFyIGkgPSBkZWx0YXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICAgICAgdGhpcy5yZXZlcnREZWx0YShkZWx0YXNbaV0pOwogICAgICAgIH0KICAgIH07CiAgICB0aGlzLmFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgICAgICB2YXIgaXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgaWYgKGlzSW5zZXJ0ID8gZGVsdGEubGluZXMubGVuZ3RoIDw9IDEgJiYgIWRlbHRhLmxpbmVzWzBdCiAgICAgICAgICAgIDogIVJhbmdlLmNvbXBhcmVQb2ludHMoZGVsdGEuc3RhcnQsIGRlbHRhLmVuZCkpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNJbnNlcnQgJiYgZGVsdGEubGluZXMubGVuZ3RoID4gMjAwMDApIHsKICAgICAgICAgICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEoZGVsdGEsIDIwMDAwKTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGFwcGx5RGVsdGEodGhpcy4kbGluZXMsIGRlbHRhLCBkb05vdFZhbGlkYXRlKTsKICAgICAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2UiLCBkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJHNhZmVBcHBseURlbHRhID0gZnVuY3Rpb24gKGRlbHRhKSB7CiAgICAgICAgdmFyIGRvY0xlbmd0aCA9IHRoaXMuJGxpbmVzLmxlbmd0aDsKICAgICAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmIGRlbHRhLnN0YXJ0LnJvdyA8IGRvY0xlbmd0aCAmJiBkZWx0YS5lbmQucm93IDwgZG9jTGVuZ3RoCiAgICAgICAgICAgIHx8IGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiAmJiBkZWx0YS5zdGFydC5yb3cgPD0gZG9jTGVuZ3RoKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJHNwbGl0QW5kYXBwbHlMYXJnZURlbHRhID0gZnVuY3Rpb24gKGRlbHRhLCBNQVgpIHsKICAgICAgICB2YXIgbGluZXMgPSBkZWx0YS5saW5lczsKICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIE1BWCArIDE7CiAgICAgICAgdmFyIHJvdyA9IGRlbHRhLnN0YXJ0LnJvdzsKICAgICAgICB2YXIgY29sdW1uID0gZGVsdGEuc3RhcnQuY29sdW1uOwogICAgICAgIGZvciAodmFyIGZyb20gPSAwLCB0byA9IDA7IGZyb20gPCBsOyBmcm9tID0gdG8pIHsKICAgICAgICAgICAgdG8gKz0gTUFYIC0gMTsKICAgICAgICAgICAgdmFyIGNodW5rID0gbGluZXMuc2xpY2UoZnJvbSwgdG8pOwogICAgICAgICAgICBjaHVuay5wdXNoKCIiKTsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3cgKyBmcm9tLCBjb2x1bW4pLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyB0bywgY29sdW1uID0gMCksCiAgICAgICAgICAgICAgICBhY3Rpb246IGRlbHRhLmFjdGlvbiwKICAgICAgICAgICAgICAgIGxpbmVzOiBjaHVuawogICAgICAgICAgICB9LCB0cnVlKTsKICAgICAgICB9CiAgICAgICAgZGVsdGEubGluZXMgPSBsaW5lcy5zbGljZShmcm9tKTsKICAgICAgICBkZWx0YS5zdGFydC5yb3cgPSByb3cgKyBmcm9tOwogICAgICAgIGRlbHRhLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGEsIHRydWUpOwogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJyZW1vdmUiIDogImluc2VydCIpLAogICAgICAgICAgICBsaW5lczogZGVsdGEubGluZXMuc2xpY2UoKQogICAgICAgIH0pOwogICAgfTsKICAgIHRoaXMuaW5kZXhUb1Bvc2l0aW9uID0gZnVuY3Rpb24gKGluZGV4LCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICBmb3IgKHZhciBpID0gc3RhcnRSb3cgfHwgMCwgbCA9IGxpbmVzLmxlbmd0aDsgaSA8IGw7IGkrKykgewogICAgICAgICAgICBpbmRleCAtPSBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoOwogICAgICAgICAgICBpZiAoaW5kZXggPCAwKQogICAgICAgICAgICAgICAgcmV0dXJuIHsgcm93OiBpLCBjb2x1bW46IGluZGV4ICsgbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aCB9OwogICAgICAgIH0KICAgICAgICByZXR1cm4geyByb3c6IGwgLSAxLCBjb2x1bW46IGluZGV4ICsgbGluZXNbbCAtIDFdLmxlbmd0aCArIG5ld2xpbmVMZW5ndGggfTsKICAgIH07CiAgICB0aGlzLnBvc2l0aW9uVG9JbmRleCA9IGZ1bmN0aW9uIChwb3MsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIHZhciBpbmRleCA9IDA7CiAgICAgICAgdmFyIHJvdyA9IE1hdGgubWluKHBvcy5yb3csIGxpbmVzLmxlbmd0aCk7CiAgICAgICAgZm9yICh2YXIgaSA9IHN0YXJ0Um93IHx8IDA7IGkgPCByb3c7ICsraSkKICAgICAgICAgICAgaW5kZXggKz0gbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aDsKICAgICAgICByZXR1cm4gaW5kZXggKyBwb3MuY29sdW1uOwogICAgfTsKfSkuY2FsbChEb2N1bWVudC5wcm90b3R5cGUpOwpleHBvcnRzLkRvY3VtZW50ID0gRG9jdW1lbnQ7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvbGFuZyIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpleHBvcnRzLmxhc3QgPSBmdW5jdGlvbiAoYSkgewogICAgcmV0dXJuIGFbYS5sZW5ndGggLSAxXTsKfTsKZXhwb3J0cy5zdHJpbmdSZXZlcnNlID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5zcGxpdCgiIikucmV2ZXJzZSgpLmpvaW4oIiIpOwp9OwpleHBvcnRzLnN0cmluZ1JlcGVhdCA9IGZ1bmN0aW9uIChzdHJpbmcsIGNvdW50KSB7CiAgICB2YXIgcmVzdWx0ID0gJyc7CiAgICB3aGlsZSAoY291bnQgPiAwKSB7CiAgICAgICAgaWYgKGNvdW50ICYgMSkKICAgICAgICAgICAgcmVzdWx0ICs9IHN0cmluZzsKICAgICAgICBpZiAoY291bnQgPj49IDEpCiAgICAgICAgICAgIHN0cmluZyArPSBzdHJpbmc7CiAgICB9CiAgICByZXR1cm4gcmVzdWx0Owp9Owp2YXIgdHJpbUJlZ2luUmVnZXhwID0gL15cc1xzKi87CnZhciB0cmltRW5kUmVnZXhwID0gL1xzXHMqJC87CmV4cG9ydHMuc3RyaW5nVHJpbUxlZnQgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UodHJpbUJlZ2luUmVnZXhwLCAnJyk7Cn07CmV4cG9ydHMuc3RyaW5nVHJpbVJpZ2h0ID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKHRyaW1FbmRSZWdleHAsICcnKTsKfTsKZXhwb3J0cy5jb3B5T2JqZWN0ID0gZnVuY3Rpb24gKG9iaikgewogICAgdmFyIGNvcHkgPSB7fTsKICAgIGZvciAodmFyIGtleSBpbiBvYmopIHsKICAgICAgICBjb3B5W2tleV0gPSBvYmpba2V5XTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmNvcHlBcnJheSA9IGZ1bmN0aW9uIChhcnJheSkgewogICAgdmFyIGNvcHkgPSBbXTsKICAgIGZvciAodmFyIGkgPSAwLCBsID0gYXJyYXkubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgaWYgKGFycmF5W2ldICYmIHR5cGVvZiBhcnJheVtpXSA9PSAib2JqZWN0IikKICAgICAgICAgICAgY29weVtpXSA9IHRoaXMuY29weU9iamVjdChhcnJheVtpXSk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3B5W2ldID0gYXJyYXlbaV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24gKGFycmF5LCB2YWx1ZSkgewogICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAodmFsdWUgPT09IGFycmF5W2ldKSB7CiAgICAgICAgICAgIGFycmF5LnNwbGljZShpLCAxKTsKICAgICAgICB9CiAgICB9Cn07CmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8oWy4qKz9eJHt9KCl8W1xdXC9cXF0pL2csICdcXCQxJyk7Cn07CmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHJldHVybiAoIiIgKyBzdHIpLnJlcGxhY2UoLyYvZywgIiYjMzg7IikucmVwbGFjZSgvIi9nLCAiJiMzNDsiKS5yZXBsYWNlKC8nL2csICImIzM5OyIpLnJlcGxhY2UoLzwvZywgIiYjNjA7Iik7Cn07CmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24gKHN0cmluZywgcmVnRXhwKSB7CiAgICB2YXIgbWF0Y2hlcyA9IFtdOwogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbiAoc3RyKSB7CiAgICAgICAgbWF0Y2hlcy5wdXNoKHsKICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwogICAgcmV0dXJuIG1hdGNoZXM7Cn07CmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBkZWZlcnJlZC5jYW5jZWwoKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgMCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gZGVmZXJyZWQ7Cn07CmV4cG9ydHMuZGVsYXllZENhbGwgPSBmdW5jdGlvbiAoZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBpZiAodGltZXIgPT0gbnVsbCkKICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGNhbGxiYWNrLCB0aW1lb3V0IHx8IGRlZmF1bHRUaW1lb3V0KTsKICAgIH07CiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uICh0aW1lb3V0KSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLnNjaGVkdWxlID0gX3NlbGY7CiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyICYmIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgfTsKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwogICAgcmV0dXJuIF9zZWxmOwp9OwoKfSk7CgphY2UuZGVmaW5lKCJhY2Uvd29ya2VyL21pcnJvciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSkgewoidXNlIHN0cmljdCI7Cgp2YXIgRG9jdW1lbnQgPSByZXF1aXJlKCIuLi9kb2N1bWVudCIpLkRvY3VtZW50Owp2YXIgbGFuZyA9IHJlcXVpcmUoIi4uL2xpYi9sYW5nIik7CiAgICAKdmFyIE1pcnJvciA9IGV4cG9ydHMuTWlycm9yID0gZnVuY3Rpb24oc2VuZGVyKSB7CiAgICB0aGlzLnNlbmRlciA9IHNlbmRlcjsKICAgIHZhciBkb2MgPSB0aGlzLmRvYyA9IG5ldyBEb2N1bWVudCgiIik7CiAgICAKICAgIHZhciBkZWZlcnJlZFVwZGF0ZSA9IHRoaXMuZGVmZXJyZWRVcGRhdGUgPSBsYW5nLmRlbGF5ZWRDYWxsKHRoaXMub25VcGRhdGUuYmluZCh0aGlzKSk7CiAgICAKICAgIHZhciBfc2VsZiA9IHRoaXM7CiAgICBzZW5kZXIub24oImNoYW5nZSIsIGZ1bmN0aW9uKGUpIHsKICAgICAgICB2YXIgZGF0YSA9IGUuZGF0YTsKICAgICAgICBpZiAoZGF0YVswXS5zdGFydCkgewogICAgICAgICAgICBkb2MuYXBwbHlEZWx0YXMoZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICB2YXIgZCwgZXJyOyAKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGFbaSsxXSkpIHsKICAgICAgICAgICAgICAgICAgICBkID0ge2FjdGlvbjogImluc2VydCIsIHN0YXJ0OiBkYXRhW2ldLCBsaW5lczogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJyZW1vdmUiLCBzdGFydDogZGF0YVtpXSwgZW5kOiBkYXRhW2krMV19OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoKGQuYWN0aW9uID09ICJpbnNlcnQiID8gZC5zdGFydCA6IGQuZW5kKS5yb3cgPj0gZG9jLiRsaW5lcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICBlcnIgPSBuZXcgRXJyb3IoIkludmFsaWQgZGVsdGEiKTsKICAgICAgICAgICAgICAgICAgICBlcnIuZGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogX3NlbGYuJHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzTGVuZ3RoOiBkb2MuJGxpbmVzLmxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGQuc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogZC5lbmQKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIHRocm93IGVycjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg==";ace.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl);const _sfc_main$w=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(r,{emit:n}){const i=r,o=vue.ref(!1),a=vue.computed({get(){return i.lang==="json"?JSON.stringify(i.modelValue,null,2):i.modelValue},set(u){i.lang==="json"?n("update:modelValue",JSON.parse(u)):n("update:modelValue",u)}});return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:c[0]||(c[0]=f=>o.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(o),"onUpdate:modelValue":c[2]||(c[2]=f=>vue.isRef(o)?o.value=f:null),title:i.title,width:"60%",onClose:c[3]||(c[3]=f=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(a),"onUpdate:value":c[1]||(c[1]=f=>vue.isRef(a)?a.value=f:null),lang:i.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$b={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$8={key:1},_hoisted_3$7={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$v=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(r,{emit:n}){const i=r,o=vue.computed(()=>{var d;const u={};let c=0,f=[];for(let h of Object.keys(i.objInfo)){const v=(d=i.objInfo[h])==null?void 0:d.sort;if(v){const g=Number(v);g>c&&(c=g)}if(v)u[v]=h;else return Object.keys(i.objInfo).map(g=>({...i.objInfo[g],_key:g}))}for(let h=0;h<c+1;h++){const v=String(h);f.push({...i.objInfo[u[v]],_key:u[v]})}return f});function a(u){let c=window.setTimeout(function(){n("change",u),clearTimeout(c),c=null},200)}return(u,c)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),f=>(vue.openBlock(),vue.createElementBlock("div",{key:f._key},[i.code?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f._key))>78?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:String(f._key),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$b,vue.toDisplayString(f._key),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$8,vue.toDisplayString(f._key),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:JSON.stringify(f.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$7,vue.toDisplayString(f.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString(f.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),i.hide.indexOf(String(f._key))<0?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:f.title,size:"small"},{default:vue.withCtx(()=>[f.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,placeholder:"Select",size:"small",disabled:!!(f!=null&&f.disabled),onChange:a},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(f.options,d=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInputNumber),{key:1,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:2,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:3,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,autosize:"",type:"textarea",disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElColorPicker),{key:4,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSwitch),{key:5,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$w,{key:6,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onClose:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_b2819020_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-b2819020"]]),_hoisted_1$a={style:{height:"100%"}},_hoisted_2$7={class:"flex flex-wrap"},_hoisted_3$6=["onMouseenter","onClick"],_sfc_main$u=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(r,{emit:n}){const i=r,o=vue.ref(i.val),a=vue.ref(!1),u=vue.ref("进入"),c=vue.ref(null),f=d=>{n("updateCommonAniVal",d),a.value=!1};return vue.watch(()=>i.val,d=>{o.value=d}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.unref(o)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,closable:"",onClose:h[0]||(h[0]=v=>f("")),onClick:h[1]||(h[1]=v=>a.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var v;return[vue.createTextVNode(vue.toDisplayString((v=vue.unref(common_animate_list).map(g=>g.children).reduce((g,p)=>g.concat(p)).find(g=>g.value==vue.unref(o)))==null?void 0:v.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:h[2]||(h[2]=v=>a.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(elementPlus.ElDrawer),{modelValue:vue.unref(a),"onUpdate:modelValue":h[5]||(h[5]=v=>vue.isRef(a)?a.value=v:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabs),{modelValue:vue.unref(u),"onUpdate:modelValue":h[4]||(h[4]=v=>vue.isRef(u)?u.value=v:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabPane),{label:v.label,name:v.label,key:v.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$7,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.children,(g,p)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:p,onMouseenter:y=>c.value=p,onMouseleave:h[3]||(h[3]=y=>c.value=null),onClick:y=>f(g.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref(c)==p?`animate__animated animate__${g.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(g.label),3)],40,_hoisted_3$6))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc$1(_sfc_main$u,[["__scopeId","data-v-2668f60c"]]),_sfc_main$t=vue.defineComponent({__name:"component-tree",setup(r){const n=useGlobalStore(pinia),i=vue.computed(()=>{var u;return((u=n.handle_svg_info)==null?void 0:u.info.id)??""}),o=u=>{for(let c of n.done_json)c.selected=!1,c.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(u)},a={children:"children",label:"title"};return(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:a,onNodeClick:o,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(i),"node-key":"id","current-node-key":vue.unref(i)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=r=>(vue.pushScopeId("data-v-98320511"),r=r(),vue.popScopeId(),r),_hoisted_1$9={class:"wall-l"},_hoisted_2$6={class:"head-l"},_hoisted_3$5=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$s=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=()=>{o.value.push({key:"",val:""})},u=c=>{o.value.splice(c,1)};return(c,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$6,[_hoisted_3$5,_hoisted_4$2,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:a},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.key,"onUpdate:modelValue":v=>d.key=v,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.val,"onUpdate:modelValue":v=>d.val=v,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:v=>u(h)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc$1(_sfc_main$s,[["__scopeId","data-v-98320511"]]),composeEventHandlers=(r,n,{checkForDefaultPrevented:i=!0}={})=>a=>{const u=r==null?void 0:r(a);if(i===!1||!u)return n==null?void 0:n(a)};var _a;const isClient=typeof window<"u",isString$1=r=>typeof r=="string",noop=()=>{},isIOS=isClient&&((_a=window==null?void 0:window.navigator)==null?void 0:_a.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function resolveUnref(r){return typeof r=="function"?r():vue.unref(r)}function createFilterWrapper(r,n){function i(...o){return new Promise((a,u)=>{Promise.resolve(r(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})).then(a).catch(u)})}return i}function debounceFilter(r,n={}){let i,o,a=noop;const u=f=>{clearTimeout(f),a(),a=noop};return f=>{const d=resolveUnref(r),h=resolveUnref(n.maxWait);return i&&u(i),d<=0||h!==void 0&&h<=0?(o&&(u(o),o=null),Promise.resolve(f())):new Promise((v,g)=>{a=n.rejectOnCancel?g:v,h&&!o&&(o=setTimeout(()=>{i&&u(i),o=null,v(f())},h)),i=setTimeout(()=>{o&&u(o),o=null,v(f())},d)})}}function identity(r){return r}function tryOnScopeDispose(r){return vue.getCurrentScope()?(vue.onScopeDispose(r),!0):!1}function useDebounceFn(r,n=200,i={}){return createFilterWrapper(debounceFilter(n,i),r)}function refDebounced(r,n=200,i={}){const o=vue.ref(r.value),a=useDebounceFn(()=>{o.value=r.value},n,i);return vue.watch(r,()=>a()),o}function tryOnMounted(r,n=!0){vue.getCurrentInstance()?vue.onMounted(r):n?r():vue.nextTick(r)}function unrefElement(r){var n;const i=resolveUnref(r);return(n=i==null?void 0:i.$el)!=null?n:i}const defaultWindow=isClient?window:void 0;function useEventListener(...r){let n,i,o,a;if(isString$1(r[0])||Array.isArray(r[0])?([i,o,a]=r,n=defaultWindow):[n,i,o,a]=r,!n)return noop;Array.isArray(i)||(i=[i]),Array.isArray(o)||(o=[o]);const u=[],c=()=>{u.forEach(v=>v()),u.length=0},f=(v,g,p,y)=>(v.addEventListener(g,p,y),()=>v.removeEventListener(g,p,y)),d=vue.watch(()=>[unrefElement(n),resolveUnref(a)],([v,g])=>{c(),v&&u.push(...i.flatMap(p=>o.map(y=>f(v,p,y,g))))},{immediate:!0,flush:"post"}),h=()=>{d(),c()};return tryOnScopeDispose(h),h}let _iOSWorkaround=!1;function onClickOutside(r,n,i={}){const{window:o=defaultWindow,ignore:a=[],capture:u=!0,detectIframe:c=!1}=i;if(!o)return;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(o.document.body.children).forEach(p=>p.addEventListener("click",noop)));let f=!0;const d=p=>a.some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(_=>_===p.target||p.composedPath().includes(_));{const _=unrefElement(y);return _&&(p.target===_||p.composedPath().includes(_))}}),v=[useEventListener(o,"click",p=>{const y=unrefElement(r);if(!(!y||y===p.target||p.composedPath().includes(y))){if(p.detail===0&&(f=!d(p)),!f){f=!0;return}n(p)}},{passive:!0,capture:u}),useEventListener(o,"pointerdown",p=>{const y=unrefElement(r);y&&(f=!p.composedPath().includes(y)&&!d(p))},{passive:!0}),c&&useEventListener(o,"blur",p=>{var y;const _=unrefElement(r);((y=o.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&n(p)})].filter(Boolean);return()=>v.forEach(p=>p())}function useSupported(r,n=!1){const i=vue.ref(),o=()=>i.value=!!r();return o(),tryOnMounted(o,n),i}const _global=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},globalKey="__vueuse_ssr_handlers__";_global[globalKey]=_global[globalKey]||{};var __getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__objRest$2=(r,n)=>{var i={};for(var o in r)__hasOwnProp$g.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&__getOwnPropSymbols$g)for(var o of __getOwnPropSymbols$g(r))n.indexOf(o)<0&&__propIsEnum$g.call(r,o)&&(i[o]=r[o]);return i};function useResizeObserver(r,n,i={}){const o=i,{window:a=defaultWindow}=o,u=__objRest$2(o,["window"]);let c;const f=useSupported(()=>a&&"ResizeObserver"in a),d=()=>{c&&(c.disconnect(),c=void 0)},h=vue.watch(()=>unrefElement(r),g=>{d(),f.value&&a&&g&&(c=new ResizeObserver(n),c.observe(g,u))},{immediate:!0,flush:"post"}),v=()=>{d(),h()};return tryOnScopeDispose(v),{isSupported:f,stop:v}}var SwipeDirection;(function(r){r.UP="UP",r.RIGHT="RIGHT",r.DOWN="DOWN",r.LEFT="LEFT",r.NONE="NONE"})(SwipeDirection||(SwipeDirection={}));var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,n,i)=>n in r?__defProp(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,__spreadValues=(r,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(r,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(r,i,n[i]);return r};const _TransitionPresets={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};__spreadValues({linear:identity},_TransitionPresets);const isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const NOOP=()=>{},hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(r,n)=>hasOwnProperty.call(r,n),isArray=Array.isArray,isFunction=r=>typeof r=="function",isString=r=>typeof r=="string",isObject=r=>r!==null&&typeof r=="object",objectToString=Object.prototype.toString,toTypeString=r=>objectToString.call(r),toRawType=r=>toTypeString(r).slice(8,-1),isUndefined=r=>r===void 0,isBoolean=r=>typeof r=="boolean",isNumber=r=>typeof r=="number",isElement=r=>typeof Element>"u"?!1:r instanceof Element,isStringNumber=r=>isString(r)?!Number.isNaN(Number(r)):!1,escapeStringRegexp=(r="")=>r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),getProp=(r,n,i)=>({get value(){return lodashEs.get(r,n,i)},set value(o){lodashEs.set(r,n,o)}});class ElementPlusError extends Error{constructor(n){super(n),this.name="ElementPlusError"}}function throwError(r,n){throw new ElementPlusError(`[${r}] ${n}`)}function debugWarn(r,n){if(process.env.NODE_ENV!=="production"){const i=isString(r)?new ElementPlusError(`[${r}] ${n}`):r;console.warn(i)}}const SCOPE$1="utils/dom/style";function addUnit(r,n="px"){if(!r)return"";if(isNumber(r)||isStringNumber(r))return`${r}${n}`;if(isString(r))return r;debugWarn(SCOPE$1,"binding value must be a string or number")}function scrollIntoView(r,n){if(!isClient)return;if(!n){r.scrollTop=0;return}const i=[];let o=n.offsetParent;for(;o!==null&&r!==o&&r.contains(o);)i.push(o),o=o.offsetParent;const a=n.offsetTop+i.reduce((d,h)=>d+h.offsetTop,0),u=a+n.offsetHeight,c=r.scrollTop,f=c+r.clientHeight;a<c?r.scrollTop=a:u>f&&(r.scrollTop=u-r.clientHeight)}const epPropKey="__epPropKey",definePropType=r=>r,isEpProp=r=>isObject(r)&&!!r[epPropKey],buildProp=(r,n)=>{if(!isObject(r)||isEpProp(r))return r;const{values:i,required:o,default:a,type:u,validator:c}=r,d={type:u,required:!!o,validator:i||c?h=>{let v=!1,g=[];if(i&&(g=Array.from(i),hasOwn(r,"default")&&g.push(a),v||(v=g.includes(h))),c&&(v||(v=c(h))),!v&&g.length>0){const p=[...new Set(g)].map(y=>JSON.stringify(y)).join(", ");vue.warn(`Invalid prop: validation failed${n?` for prop "${n}"`:""}. Expected one of [${p}], got value ${JSON.stringify(h)}.`)}return v}:void 0,[epPropKey]:!0};return hasOwn(r,"default")&&(d.default=a),d},buildProps=r=>lodashEs.fromPairs(Object.entries(r).map(([n,i])=>[n,buildProp(i,n)])),iconPropType=definePropType([String,Object,Function]),ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default},withInstall=(r,n)=>{if(r.install=i=>{for(const o of[r,...Object.values(n??{})])i.component(o.name,o)},n)for(const[i,o]of Object.entries(n))r[i]=o;return r},withNoopInstall=r=>(r.install=NOOP,r),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue",CHANGE_EVENT="change",componentSizes=["","default","small","large"],componentSizeMap={large:40,default:32,small:24},getComponentSize=r=>componentSizeMap[r||"default"],isValidComponentSize=r=>["",...componentSizes].includes(r),isKorean=r=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(r),mutable=r=>r,DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/,useAttrs=(r={})=>{const{excludeListeners:n=!1,excludeKeys:i}=r,o=vue.computed(()=>((i==null?void 0:i.value)||[]).concat(DEFAULT_EXCLUDE_KEYS)),a=vue.getCurrentInstance();return a?vue.computed(()=>{var u;return lodashEs.fromPairs(Object.entries((u=a.proxy)==null?void 0:u.$attrs).filter(([c])=>!o.value.includes(c)&&!(n&&LISTENER_PREFIX.test(c))))}):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),vue.computed(()=>({})))},useDeprecated=({from:r,replacement:n,scope:i,version:o,ref:a,type:u="API"},c)=>{vue.watch(()=>vue.unref(c),f=>{f&&debugWarn(i,`[${u}] ${r} is about to be deprecated in version ${o}, please use ${n} instead.
|
244
|
+
`||h==="")){var v=c.isSelected(h);o.hasOwnProperty(h)?o[h]=o[h]&&v:o[h]=v}})}),r==="allSelect"||r==="inverseSelect"?{selected:o}:{name:n.name,selected:o}}function installLegendAction(r){r.registerAction("legendToggleSelect","legendselectchanged",curry$1(legendSelectActionHandler,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",curry$1(legendSelectActionHandler,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",curry$1(legendSelectActionHandler,"inverseSelect")),r.registerAction("legendSelect","legendselected",curry$1(legendSelectActionHandler,"select")),r.registerAction("legendUnSelect","legendunselected",curry$1(legendSelectActionHandler,"unSelect"))}function install$2(r){r.registerComponentModel(LegendModel$1),r.registerComponentView(LegendView$1),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,legendFilter),r.registerSubTypeDefaulter("legend",function(){return"plain"}),installLegendAction(r)}var ScrollableLegendModel=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i}return n.prototype.setScrollDataIndex=function(i){this.option.scrollDataIndex=i},n.prototype.init=function(i,o,a){var u=getLayoutParams(i);r.prototype.init.call(this,i,o,a),mergeAndNormalizeLayoutParams(this,i,u)},n.prototype.mergeOption=function(i,o){r.prototype.mergeOption.call(this,i,o),mergeAndNormalizeLayoutParams(this,this.option,i)},n.type="legend.scroll",n.defaultOption=inheritDefaultOption(LegendModel$1.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),n}(LegendModel$1);function mergeAndNormalizeLayoutParams(r,n,i){var o=r.getOrient(),a=[1,1];a[o.index]=0,mergeLayoutParam(n,i,{type:"box",ignoreSize:!!a})}const ScrollableLegendModel$1=ScrollableLegendModel;var Group=Group$3,WH=["width","height"],XY=["x","y"],ScrollableLegendView=function(r){__extends(n,r);function n(){var i=r!==null&&r.apply(this,arguments)||this;return i.type=n.type,i.newlineDisabled=!0,i._currentIndex=0,i}return n.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new Group),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Group)},n.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(i,o,a,u,c,f,d){var h=this;r.prototype.renderInner.call(this,i,o,a,u,c,f,d);var v=this._controllerGroup,g=o.get("pageIconSize",!0),p=isArray$1(g)?g:[g,g];_("pagePrev",0);var y=o.getModel("pageTextStyle");v.add(new ZRText$1({name:"pageText",style:{text:"xx/xx",fill:y.getTextColor(),font:y.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),_("pageNext",1);function _(b,A){var w=b+"DataIndex",T=createIcon(o.get("pageIcons",!0)[o.getOrient().name][A],{onclick:bind$1(h._pageGo,h,w,o,u)},{x:-p[0]/2,y:-p[1]/2,width:p[0],height:p[1]});T.name=b,v.add(T)}},n.prototype.layoutInner=function(i,o,a,u,c,f){var d=this.getSelectorGroup(),h=i.getOrient().index,v=WH[h],g=XY[h],p=WH[1-h],y=XY[1-h];c&&box("horizontal",d,i.get("selectorItemGap",!0));var _=i.get("selectorButtonGap",!0),b=d.getBoundingRect(),A=[-b.x,-b.y],w=clone$2(a);c&&(w[v]=a[v]-b[v]-_);var T=this._layoutContentAndController(i,u,w,h,v,p,y,g);if(c){if(f==="end")A[h]+=T[v]+_;else{var S=b[v]+_;A[h]-=S,T[g]-=S}T[v]+=b[v]+_,A[1-h]+=T[y]+T[p]/2-b[p]/2,T[p]=Math.max(T[p],b[p]),T[y]=Math.min(T[y],b[y]+A[1-h]),d.x=A[0],d.y=A[1],d.markRedraw()}return T},n.prototype._layoutContentAndController=function(i,o,a,u,c,f,d,h){var v=this.getContentGroup(),g=this._containerGroup,p=this._controllerGroup;box(i.get("orient"),v,i.get("itemGap"),u?a.width:null,u?null:a.height),box("horizontal",p,i.get("pageButtonItemGap",!0));var y=v.getBoundingRect(),_=p.getBoundingRect(),b=this._showController=y[c]>a[c],A=[-y.x,-y.y];o||(A[u]=v[h]);var w=[0,0],T=[-_.x,-_.y],S=retrieve2(i.get("pageButtonGap",!0),i.get("itemGap",!0));if(b){var x=i.get("pageButtonPosition",!0);x==="end"?T[u]+=a[c]-_[c]:w[u]+=_[c]+S}T[1-u]+=y[f]/2-_[f]/2,v.setPosition(A),g.setPosition(w),p.setPosition(T);var O={x:0,y:0};if(O[c]=b?a[c]:y[c],O[f]=Math.max(y[f],_[f]),O[d]=Math.min(0,_[d]+T[1-u]),g.__rectSize=a[c],b){var L={x:0,y:0};L[c]=Math.max(a[c]-_[c]-S,0),L[f]=O[f],g.setClipPath(new Rect$1({shape:L})),g.__rectSize=L[c]}else p.eachChild(function(re){re.attr({invisible:!0,silent:!0})});var M=this._getPageInfo(i);return M.pageIndex!=null&&updateProps$1(v,{x:M.contentPosition[0],y:M.contentPosition[1]},b?i:null),this._updatePageInfoView(i,M),O},n.prototype._pageGo=function(i,o,a){var u=this._getPageInfo(o)[i];u!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:u,legendId:o.id})},n.prototype._updatePageInfoView=function(i,o){var a=this._controllerGroup;each$4(["pagePrev","pageNext"],function(v){var g=v+"DataIndex",p=o[g]!=null,y=a.childOfName(v);y&&(y.setStyle("fill",p?i.get("pageIconColor",!0):i.get("pageIconInactiveColor",!0)),y.cursor=p?"pointer":"default")});var u=a.childOfName("pageText"),c=i.get("pageFormatter"),f=o.pageIndex,d=f!=null?f+1:0,h=o.pageCount;u&&c&&u.setStyle("text",isString$2(c)?c.replace("{current}",d==null?"":d+"").replace("{total}",h==null?"":h+""):c({current:d,total:h}))},n.prototype._getPageInfo=function(i){var o=i.get("scrollDataIndex",!0),a=this.getContentGroup(),u=this._containerGroup.__rectSize,c=i.getOrient().index,f=WH[c],d=XY[c],h=this._findTargetItemIndex(o),v=a.children(),g=v[h],p=v.length,y=p?1:0,_={contentPosition:[a.x,a.y],pageCount:y,pageIndex:y-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return _;var b=x(g);_.contentPosition[c]=-b.s;for(var A=h+1,w=b,T=b,S=null;A<=p;++A)S=x(v[A]),(!S&&T.e>w.s+u||S&&!O(S,w.s))&&(T.i>w.i?w=T:w=S,w&&(_.pageNextDataIndex==null&&(_.pageNextDataIndex=w.i),++_.pageCount)),T=S;for(var A=h-1,w=b,T=b,S=null;A>=-1;--A)S=x(v[A]),(!S||!O(T,S.s))&&w.i<T.i&&(T=w,_.pagePrevDataIndex==null&&(_.pagePrevDataIndex=w.i),++_.pageCount,++_.pageIndex),w=S;return _;function x(L){if(L){var M=L.getBoundingRect(),re=M[d]+L[d];return{s:re,e:re+M[f],i:L.__legendDataIndex}}}function O(L,M){return L.e>=M&&L.s<=M+u}},n.prototype._findTargetItemIndex=function(i){if(!this._showController)return 0;var o,a=this.getContentGroup(),u;return a.eachChild(function(c,f){var d=c.__legendDataIndex;u==null&&d!=null&&(u=f),d===i&&(o=f)}),o??u},n.type="legend.scroll",n}(LegendView$1);const ScrollableLegendView$1=ScrollableLegendView;function installScrollableLegendAction(r){r.registerAction("legendScroll","legendscroll",function(n,i){var o=n.scrollDataIndex;o!=null&&i.eachComponent({mainType:"legend",subType:"scroll",query:n},function(a){a.setScrollDataIndex(o)})})}function install$1(r){use(install$2),r.registerComponentModel(ScrollableLegendModel$1),r.registerComponentView(ScrollableLegendView$1),installScrollableLegendAction(r)}function install(r){use(install$2),use(install$1)}const _sfc_main$H=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(r){const n=r;use([install$7,install$6,install$3,install$4,install]),vue.provide(VChart.THEME_KEY,"dark");const i=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,o=>{i.title.text=o.title,i.series[0].name=o.seriesName,i.series[0].data=o.seriesData}),(o,a)=>(vue.openBlock(),vue.createBlock(vue.unref(VChart),{class:"chart",option:vue.unref(i),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc$1(_sfc_main$H,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$k=["id"],_hoisted_2$h=["id"],_hoisted_3$e=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$7=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$7=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$4=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$3=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$3=["xlink:href","width","height"],_sfc_main$G=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1},height:{default:100},width:{default:100}},emits:["onChange"],setup(r,{emit:n}){const i=r;return vue.watch(()=>i.isOpen,()=>{n("onChange")}),(o,a)=>(vue.openBlock(),vue.createElementBlock("g",{id:i.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${i.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:i.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$e),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:i.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$a),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:i.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$7,_hoisted_7$7,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_8$6),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_9$6),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":i.isOpen?1:0},null,8,_hoisted_10$5),_hoisted_11$4,_hoisted_12$4,_hoisted_13$3],8,_hoisted_2$h),vue.createElementVNode("use",{"xlink:href":`#${i.id}light-121`,width:o.width,height:o.height},null,8,_hoisted_14$3)],8,_hoisted_1$k))}}),_hoisted_1$j=["id"],_hoisted_2$g=["id"],_hoisted_3$d=["fill"],_hoisted_4$9=["fill"],_hoisted_5$7=["fill"],_hoisted_6$6=["from","to"],_hoisted_7$6=["fill"],_hoisted_8$5=["from","to"],_hoisted_9$5=["fill"],_hoisted_10$4=["fill"],_hoisted_11$3=["fill"],_hoisted_12$3=["from","to"],_hoisted_13$2=["fill"],_hoisted_14$2=["xlink:href"],_sfc_main$F=vue.defineComponent({__name:"clock-a",props:{id:{default:""},centerColor:{default:"#EBF257"},secondsColor:{default:"#E83E24"},circleColor:{default:"#F45AFC"},minutesColor:{default:"#50E68E"},hoursColor:{default:"#9A36E7"},scaleColor:{default:"#4942CF"},backgroundColor:{default:"#ffffff"},borderColor:{default:"#B3A7FF"}},setup(r){const n=r,i=new Date(Number(window.sessionStorage.getItem("editorLoadTime")||"0")),o=i.getSeconds()+1,a=i.getMinutes(),u=Math.floor((i.getHours()+(a+o/60)/60)*30);return(c,f)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:n.borderColor},null,8,_hoisted_3$d),vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:n.backgroundColor},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:n.minutesColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(a)*6} 512.3 506.3`,to:`${405+vue.unref(a)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_6$6)],8,_hoisted_5$7),vue.createElementVNode("path",{d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:n.hoursColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(u)} 512.3 506.3`,to:`${315+vue.unref(u)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_8$5)],8,_hoisted_7$6),vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:n.circleColor},null,8,_hoisted_9$5),vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:n.scaleColor},null,8,_hoisted_10$4),vue.createElementVNode("path",{d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:n.secondsColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+o*6} 512.3 506.3`,to:`${495.5+o*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12$3)],8,_hoisted_11$3),vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:n.centerColor},null,8,_hoisted_13$2)],8,_hoisted_2$g),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$j))}}),_sfc_main$E=vue.defineComponent({__name:"text-box",props:{width:{default:250},height:{default:150},bgColor:{default:"#ffffff"},bgOpacity:{default:50},borderColor:{default:"#000000"},borderWidth:{default:1},borderRadius:{default:5},borderOpacity:{default:100}},setup(r){const n=r,i=vue.computed(()=>({width:(n.width>0?n.width:0)+"px",height:(n.height>0?n.height:0)+"px",borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px"})),o=vue.computed(()=>({border:`${n.borderWidth>0?n.borderWidth:0}px solid ${n.borderColor}`,borderRadius:(n.borderRadius>0?n.borderRadius:0)+"px",opacity:(n.borderOpacity>0?n.borderOpacity<100?n.borderOpacity:100:0)/100})),a=vue.computed(()=>({backgroundColor:n.bgColor,opacity:(n.bgOpacity>0?n.bgOpacity<100?n.bgOpacity:100:0)/100,borderRadius:n.borderRadius+"px"}));return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",{class:"outM",style:vue.normalizeStyle(i.value)},[vue.createElementVNode("div",{class:"wallI",style:vue.normalizeStyle(a.value)},null,4),vue.createElementVNode("div",{class:"borderB",style:vue.normalizeStyle(o.value)},null,4)],4))}}),textBox_vue_vue_type_style_index_0_scoped_4ab181ea_lang="",TextBox=_export_sfc$1(_sfc_main$E,[["__scopeId","data-v-4ab181ea"]]),vueComp={"svg-text":_sfc_main$K,"el-button":elementPlus.ElButton,"progress-a":_sfc_main$M,"el-tag":elementPlus.ElTag,"common-table":_sfc_main$J,"pie-charts":PieCharts,"switch-r":_sfc_main$L,"now-time":NowTime,"light-a":_sfc_main$G,"clock-a":_sfc_main$F,"text-box":TextBox},config=[...t$b,...t$1],useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),actions:{setCreateInfo(r){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=r},setDoneJson(r){isOfType(r,"id")?(this.done_json.push(r),vue.nextTick(()=>{setSvgActualInfo(r)})):this.done_json=objectDeepClone(r),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setHandleSvgInfo(r,n){let i=n;r?(!i&&i!=0&&(i=this.done_json.findIndex(o=>o.id===r.id)??-1),this.handle_svg_info={info:r,index:i}):this.handle_svg_info=r},spliceDoneJson(r){const n=useGlobalStore(),o=n.done_json.splice(r,1)[0];unbindAnchors(o.id),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=r=>{r.stopPropagation()},preventDefault=r=>{r.preventDefault()};function componentsRegister(r){var o,a;const n=vue.getCurrentInstance(),i=r?Object.assign(vueComp,r):vueComp;for(let u in i)!((o=n==null?void 0:n.appContext)!=null&&o.components.hasOwnProperty(u))&&vueComp.hasOwnProperty(u)&&((a=n==null?void 0:n.appContext)==null||a.app.component(u,vueComp[u]))}function setEditorLoadTime(){window.sessionStorage.setItem("editorLoadTime",new Date().getTime().toString())}const randomString=r=>{r=r||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=n.length;let o="";for(let a=0;a<r;a++){let u=i;a===0&&(u=i-10),o+=n.charAt(Math.floor(Math.random()*u))}return o},isOfType=(r,n)=>r[n]!==void 0,getCoordinateOffset=(r,n)=>r/2*(n-1),angleToRadian=r=>r*Math.PI/180,calculateRotatedPointCoordinate=(r,n,i)=>({x:parseFloat(((r.x-n.x)*Math.cos(angleToRadian(i))-(r.y-n.y)*Math.sin(angleToRadian(i))+n.x).toFixed(1)),y:parseFloat(((r.x-n.x)*Math.sin(angleToRadian(i))+(r.y-n.y)*Math.cos(angleToRadian(i))+n.y).toFixed(1))}),getCenterPoint=(r,n)=>({x:r.x+(n.x-r.x)/2,y:r.y+(n.y-r.y)/2}),positionArrToPath=r=>{let n="";for(let i=0;i<r.length;i++)i===0?n+=`M ${r[i].x} ${r[i].y}`:n+=` L ${r[i].x} ${r[i].y}`;return n},getSvgNowPosition=(r,n,i)=>i+(n-r),objectDeepClone=(r,n={})=>r?JSON.parse(JSON.stringify(r)):n,setSvgActualInfo=(r,n)=>{var a,u;const i=document.querySelector(`#${r.id}`),o=document.querySelector(`#rect${r.id}`);if(i){let c=0,f=0,d=0,h=0;if(r.type===EDoneJsonType.Vue){d=((a=r.props.width)==null?void 0:a.val)||i.offsetWidth||100,h=((u=r.props.height)==null?void 0:u.val)||i.offsetHeight||100,c=50-d/2,f=50-h/2;const v=document.querySelector(`#foreign-object${r.id}`);v&&(v.getAttribute("x")==="0"&&v.getAttribute("y")==="0"&&v.getAttribute("width")==="0"&&v.getAttribute("height")==="0"||n)&&(v.setAttribute("x",c.toString()),v.setAttribute("y",f.toString()),v.setAttribute("width",d.toString()),v.setAttribute("height",h.toString()))}else{const v=i.getBBox();c=parseFloat(v.x.toFixed(0)),f=parseFloat(v.y.toFixed(0)),d=parseFloat(v.width.toFixed(0)),h=parseFloat(v.height.toFixed(0))}o&&(o.getAttribute("x")==="0"&&o.getAttribute("y")==="0"&&o.getAttribute("width")==="0"&&o.getAttribute("height")==="0"||n)&&(o.setAttribute("x",c.toString()),o.setAttribute("y",f.toString()),o.setAttribute("width",d.toString()),o.setAttribute("height",h.toString())),(r.actual_bound.x===0&&r.actual_bound.y===0&&r.actual_bound.width===0&&r.actual_bound.height===0||n)&&(r.actual_bound={x:c,y:f,width:d,height:h}),r.center_position={x:r.x+r.actual_bound.x+d/2,y:r.y+r.actual_bound.y+h/2},r.point_coordinate.tl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tc={x:r.center_position.x,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.tr={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y-h*r.scale_y/2},r.point_coordinate.l={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.r={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y},r.point_coordinate.bl={x:r.center_position.x-d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.bc={x:r.center_position.x,y:r.center_position.y+h*r.scale_y/2},r.point_coordinate.br={x:r.center_position.x+d*r.scale_x/2,y:r.center_position.y+h*r.scale_y/2},r.rotate!==0&&setAfterRotationPointCoordinate(r),moveAnchors(r)}},resetHandlePointOld=r=>{for(const n of Object.keys(r.point_coordinate))r.point_coordinate_old&&(r.point_coordinate_old[n].x=0,r.point_coordinate_old[n].y=0)},moveHandlePoint=(r,n,i)=>{const o=useGlobalStore(pinia),a=n??o.mouse_info.new_position_x-o.mouse_info.position_x,u=i??o.mouse_info.new_position_y-o.mouse_info.position_y;for(const c of Object.keys(r.point_coordinate))n!==void 0&&i!==void 0?(r.point_coordinate[c].x+=a,r.point_coordinate[c].y+=u):r.point_coordinate_old&&(r.point_coordinate[c].x=r.point_coordinate_old[c].x+a,r.point_coordinate[c].y=r.point_coordinate_old[c].y+u)},moveAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)if(c.type===EDoneJsonType.ConnectionLine){if(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.start.type,r);c.props.point_position.val[0]={x:f.x-c.x,y:f.y-c.y}}if(((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r.id){const f=getAnchorPosByAnchorType(c.bind_anchors.end.type,r);c.props.point_position.val[c.props.point_position.val.length-1]={x:f.x-c.x,y:f.y-c.y}}}},unbindAnchors=r=>{var i,o,a,u;const n=useGlobalStore(pinia);for(let c of n.done_json)c.type===EDoneJsonType.ConnectionLine&&(((o=(i=c.bind_anchors)==null?void 0:i.start)==null?void 0:o.target_id)===r&&(c.bind_anchors.start=null),((u=(a=c.bind_anchors)==null?void 0:a.end)==null?void 0:u.target_id)===r&&(c.bind_anchors.end=null))},getAnchorPosByAnchorType=(r,n)=>r===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:r===ELineBindAnchors.Left?n.point_coordinate.l:r===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=r=>{r.point_coordinate={tl:calculateRotatedPointCoordinate(r.point_coordinate.tl,r.center_position,r.rotate),tc:calculateRotatedPointCoordinate(r.point_coordinate.tc,r.center_position,r.rotate),tr:calculateRotatedPointCoordinate(r.point_coordinate.tr,r.center_position,r.rotate),l:calculateRotatedPointCoordinate(r.point_coordinate.l,r.center_position,r.rotate),r:calculateRotatedPointCoordinate(r.point_coordinate.r,r.center_position,r.rotate),bl:calculateRotatedPointCoordinate(r.point_coordinate.bl,r.center_position,r.rotate),bc:calculateRotatedPointCoordinate(r.point_coordinate.bc,r.center_position,r.rotate),br:calculateRotatedPointCoordinate(r.point_coordinate.br,r.center_position,r.rotate)}},prosToVBind=(r,n=[])=>{let i={};if(r.state){for(const o in r.state)if(r.state.hasOwnProperty(o)&&o===r.defaultState){for(let a in r.state[o])a!=="label"&&(i[lodashEs.kebabCase(a)]=r.state[o][a]);break}}for(const o in r.props)n.indexOf(o)<0&&(i[lodashEs.kebabCase(o)]=r.props[o].val);return i},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(r=>r.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=r=>!r.common_animations||!r.common_animations.val?"":`common-ani animate__animated animate__${r.common_animations.val} animate__${r.common_animations.speed} animate__${r.common_animations.repeat} animate__${r.common_animations.delay}`,numberArray=r=>{let n=[];for(let i=0;i<r;i++)n.push(i);return n},getStringWidth=(r,n=12)=>{if(r.length>0){let i=document.createElement("span");i.style.fontSize=n+"px",i.style.fontFamily="inherit",i.innerHTML=r,i.style.opacity="0",i.style.position="fixed",i.style.top="3000px",document.body.append(i);const o=i.clientWidth;return document.body.removeChild(i),o}return 0},valFormat=r=>/false|true/.test(r)?r!=="false":/^\d+(\.\d+)?$/.test(r)?Number(r):r,createLine=(r,n,i)=>{r.preventDefault();const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),{clientX:c,clientY:f}=r;let d=objectDeepClone(a.connection_line),h=0,v=0;if(n&&i){d.bind_anchors.start={type:n,target_id:i.id};let p=getAnchorPosByAnchorType(n,i);h=p.x,v=p.y}else h=Math.round((c-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),v=Math.round((f-u.canvasInfo.top)/a.svg.scale-u.center_offset.y);const g={id:randomString(),x:h,y:v,client:{x:h,y:v},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...d};g.props.point_position.val.push({x:0,y:0}),o.setDoneJson(g),o.setHandleSvgInfo(g,o.done_json.length-1),o.intention=EGlobalStoreIntention.Connection,o.mouse_info={state:EMouseInfoState.Down,position_x:h,position_y:v,now_position_x:h,now_position_y:v,new_position_x:0,new_position_y:0}};Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]});const connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#602a00"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let r=JSON.parse(l);t=r.connection_line,s=r.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});var EContextMenuInfoType=(r=>(r.Copy="Copy",r.Delete="Delete",r.MoveUpOneLevel="MoveUpOneLevel",r.MoveDownOneLevel="MoveDownOneLevel",r.MoveUpTopLevel="MoveUpTopLevel",r.MoveDownTopLevel="MoveDownTopLevel",r))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(r){return r.history_now_index>=1},getTopBtnRedoStatus(r){return r.history_now_index+1!=r.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const r=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,r.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl + c",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl + →",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl + ←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl + ↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl + ↓",enable:!0}}}),actions:{onContextMenuClick(r){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,r){case EContextMenuInfoType.Copy:const i=objectDeepClone(n.handle_svg_info.info);i.id=randomString(),i.title+="-copy",i.x+=10,i.y+=10,n.setDoneJson(i),this.display=!1,n.setHandleSvgInfo(i,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const o=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=o,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(o,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const a=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=a,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(a,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const u=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(u),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(u,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const c=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push(c),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(c,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=r=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(r),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=r=>{try{const n=JSON.parse(r);if(!n.config||!n.layout_center||!n.done_json)return elementPlus.ElMessage.error("请导入正确的数据模型!"),!1;const i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return a.$state=n.config,o.center_offset=n.layout_center,i.setDoneJson(n.done_json),!0}catch(n){return elementPlus.ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$i={"aria-hidden":"true"},_hoisted_2$f=["xlink:href"],_sfc_main$D=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(r){const n=r,i=vue.computed(()=>`#svg-${n.name}`);return(o,a)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$i,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(i)},n.props),null,16,_hoisted_2$f)]))}});var EVisibleConfKey=(r=>(r.ImportJson="ImportJson",r.ExportJson="ExportJson",r.ImportFile="ImportFile",r))(EVisibleConfKey||{});const _withScopeId$2=r=>(vue.pushScopeId("data-v-62907637"),r=r(),vue.popScopeId(),r),_hoisted_1$h={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$e={class:"flex items-center justify-between",style:{width:"250px"}},_hoisted_3$c=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$5={class:"flex items-center mr-20px"},_hoisted_7$5={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$2=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36$1=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$C=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(r,{emit:n}){const i=useSvgEditLayoutStore(pinia),o=useGlobalStore(pinia),a=useEditPrivateStore(pinia),u=useConfigStore(pinia),c=()=>{o.done_json.length<=0||o.setDoneJson([]),o.intention=EGlobalStoreIntention.None},f=v=>{const g={layout_center:i.center_offset,config:u.$state,done_json:o.done_json};n(v,g)},d=vue.ref(!1),h=vue.computed({get:()=>o.intention===EGlobalStoreIntention.Connection,set(v){o.intention=v?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,v&&o.setHandleSvgInfo(null)}});return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$e,[_hoisted_3$c,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[0]||(g[0]=p=>vue.unref(i).left_nav=!vue.unref(i).left_nav),title:vue.unref(i).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(a).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:g[1]||(g[1]=()=>vue.unref(a).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(a).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:g[2]||(g[2]=()=>vue.unref(a).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(a).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(vue.unref(o).done_json.length>0?"bt-Icon":"icon-disable"),size:24,onClick:c},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(o).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:g[3]||(g[3]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"import"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:g[4]||(g[4]=p=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"export"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(h)}]),size:24,onClick:g[5]||(g[5]=p=>h.value=!vue.unref(h))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:vue.unref(h)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:g[6]||(g[6]=p=>d.value=!vue.unref(d))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$5,[vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:g[7]||(g[7]=p=>f("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"return"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:g[8]||(g[8]=p=>f("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"save"})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(elementPlus.ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:g[9]||(g[9]=p=>f("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$5,[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:24,class:"bt-Icon",onClick:g[10]||(g[10]=p=>vue.unref(i).right_nav=!vue.unref(i).right_nav),title:vue.unref(i).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(i).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$D,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(elementPlus.ElDialog),{modelValue:vue.unref(d),"onUpdate:modelValue":g[11]||(g[11]=p=>vue.isRef(d)?d.value=p:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$2,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$2,_hoisted_17$1,_hoisted_18$1,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22$1,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26$1,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32$1,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36$1]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc$1(_sfc_main$C,[["__scopeId","data-v-62907637"]]),_hoisted_1$g={class:"component-group flex flex-wrap"},_hoisted_2$d=["onDragstart","title"],_sfc_main$B=vue.defineComponent({__name:"left-panel",props:{customToolbar:{}},setup(r){const n=r,i=useGlobalStore(pinia),o=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:i.config_center),a=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),u=d=>{i.setCreateInfo(c(d))},c=d=>(d!=null&&d.props&&!lodashEs.isEmpty(d.props)&&Object.keys(d.props).forEach((h,v)=>{d.props[h].sort=String(v)}),d),f=d=>{var h;if(((h=d.dataTransfer)==null?void 0:h.dropEffect)!=="copy"){elementPlus.ElMessage.warning("请将组件拖到画布中!"),i.intention=EGlobalStoreIntention.None;return}};return(d,h)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(a),"onUpdate:modelValue":h[0]||(h[0]=v=>vue.isRef(a)?a.value=v:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:v.groupType,key:v.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(v.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$g,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.list,g=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:g.name,draggable:"true",onDragstart:p=>u(g),onDragend:f,title:g.title},[vue.createVNode(vue.unref(elementPlus.ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:g.name,props:vue.unref(prosToVBind)(g,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$d))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_8aba8565_lang="",LeftPanel=_export_sfc$1(_sfc_main$B,[["__scopeId","data-v-8aba8565"]]),calculateLeftTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate(n,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:u.x-a.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(r,n,i)=>{const o=getCenterPoint(r,n),a=calculateRotatedPointCoordinate(n,o,-i),u=calculateRotatedPointCoordinate(r,o,-i);return{width:a.x-u.x,height:u.y-a.y,is_old_width:!1,is_old_height:!1}},calculateTop=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateRight=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:o.x,y:a.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:1,height:Math.round(c),is_old_width:!0,is_old_height:!1}},calculateLeft=(r,n,i,o)=>{const a=calculateRotatedPointCoordinate(r,o,-i),u=calculateRotatedPointCoordinate({x:a.x,y:o.y},o,i),c=Math.sqrt((u.x-n.x)**2+(u.y-n.y)**2);return{width:Math.round(c),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$f={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$c=["fill","x","y"],_hoisted_3$b=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$4=["fill","x","y"],_hoisted_7$4=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$A=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(r){const n=r;vue.useCssVars(p=>({"5c831aea":vue.unref(c)}));const i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=vue.ref(4),c=vue.ref("#ab712e"),f=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],d=vue.computed(()=>n.itemInfo.config.can_zoom),h=(p,y)=>{console.log("handMousedown",y);const{clientX:_,clientY:b}=y;y.stopPropagation(),i.intention=EGlobalStoreIntention.Zoom;const A=Math.round((_-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),w=Math.round((b-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);i.mouse_info={state:EMouseInfoState.Down,position_x:A,position_y:w,now_position_x:A,now_position_y:w,new_position_x:0,new_position_y:0},i.scale_info={type:p,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:A+Math.abs(A-n.itemInfo.center_position.x)*2*(A>n.itemInfo.center_position.x?-1:1),y:w+Math.abs(w-n.itemInfo.center_position.y)*2*(w>n.itemInfo.center_position.y?-1:1)}}},v=p=>{const{clientX:y,clientY:_}=p,b=Math.round((y-a.canvasInfo.left)/o.svg.scale-a.center_offset.x),A=Math.round((_-a.canvasInfo.top)/o.svg.scale-a.center_offset.y);p.stopPropagation(),i.intention=EGlobalStoreIntention.Rotate,i.rotate_info={angle:n.itemInfo.rotate},i.mouse_info={state:EMouseInfoState.Down,position_x:b,position_y:A,now_position_x:b,now_position_y:A,new_position_x:0,new_position_y:0}},g=p=>{const y=(p+n.itemInfo.rotate)%360,_=f.find(b=>b.start<=y&&b.end>y);return _?{cursor:_.cursor+"-resize",type:_.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(p,y)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$f,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[0]||(y[0]=_=>h(vue.unref(EScaleInfoType).TopLeft,_))},null,44,_hoisted_2$c),[[vue.vShow,vue.unref(d)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:v},null,40,_hoisted_3$b),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref(c),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(u),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[1]||(y[1]=_=>h(vue.unref(EScaleInfoType).TopCenter,_))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(u)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[2]||(y[2]=_=>h(vue.unref(EScaleInfoType).TopRight,_))},null,44,_hoisted_6$4),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[3]||(y[3]=_=>h(vue.unref(EScaleInfoType).Left,_))},null,44,_hoisted_7$4),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[4]||(y[4]=_=>h(vue.unref(EScaleInfoType).Right,_))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[5]||(y[5]=_=>h(vue.unref(EScaleInfoType).BottomLeft,_))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[6]||(y[6]=_=>h(vue.unref(EScaleInfoType).BottomCenter,_))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(d)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref(c),style:vue.normalizeStyle({cursor:g(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(u)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(u)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:y[7]||(y[7]=_=>h(vue.unref(EScaleInfoType).BottomRight,_))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(d)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc$1(_sfc_main$A,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$e=["fill"],_hoisted_2$b=["cx","cy","r"],_hoisted_3$a=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$3=["cx","cy","r"],_hoisted_7$3=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$z=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(r){const n=r,i=vue.ref(4),o=vue.ref("#ab712e"),a=vue.ref(4),u=vue.ref(12),c=useGlobalStore(pinia),f=useSvgEditLayoutStore(pinia),d=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-i.value+a.value),h=vue.computed(()=>n.itemInfo.actual_bound.y-i.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),v=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),g=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),p=vue.computed(()=>n.itemInfo.actual_bound.x-i.value+n.itemInfo.actual_bound.width/2+a.value),y=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),_=vue.computed(()=>n.itemInfo.actual_bound.x-i.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+a.value),b=vue.computed(()=>n.itemInfo.actual_bound.y-i.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+a.value),A=(T,S)=>{var x;c.intention===EGlobalStoreIntention.SetConnectionLineNode&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&c.connection_line_node_info&&(c.connection_line_node_info.point_index===0?c.handle_svg_info.info.bind_anchors.start={type:S,target_id:n.itemInfo.id}:c.connection_line_node_info.point_index===c.handle_svg_info.info.props.point_position.val.length-1&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id}),c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},w=(T,S)=>{var x;c.intention===EGlobalStoreIntention.None?(createLine(T,S,n.itemInfo),c.handle_svg_info&&(c.handle_svg_info.info.props.point_position.val.length!==1?c.handle_svg_info.info.props.point_position.val.push({x:c.mouse_info.new_position_x-c.mouse_info.position_x-f.center_offset.x,y:c.mouse_info.new_position_y-c.mouse_info.position_y-f.center_offset.y}):c.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):c.intention===EGlobalStoreIntention.Connection&&(T.stopPropagation(),(x=c.handle_svg_info)!=null&&x.info.bind_anchors&&(c.handle_svg_info.info.bind_anchors.end={type:S,target_id:n.itemInfo.id},c.intention=EGlobalStoreIntention.None,c.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(T,S)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(o),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:S[0]||(S[0]=x=>w(x,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:S[1]||(S[1]=x=>A(x,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_2$b),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(d),cy:vue.unref(h),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_3$a)],32),vue.createElementVNode("g",{onMousedown:S[2]||(S[2]=x=>w(x,vue.unref(ELineBindAnchors).Right)),onMouseup:S[3]||(S[3]=x=>A(x,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(v),cy:vue.unref(g),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:S[4]||(S[4]=x=>w(x,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:S[5]||(S[5]=x=>A(x,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_6$3),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(p),cy:vue.unref(y),r:vue.unref(a),"pointer-events":"all"},null,8,_hoisted_7$3)],32),vue.createElementVNode("g",{onMousedown:S[6]||(S[6]=x=>w(x,vue.unref(ELineBindAnchors).Left)),onMouseup:S[7]||(S[7]=x=>A(x,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(u),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(_),cy:vue.unref(b),r:vue.unref(a),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$e))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc$1(_sfc_main$z,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$d=["d","stroke-width"],_hoisted_2$a=["d","stroke-width"],_hoisted_3$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$2=["from","to","dur","repeatCount"],_hoisted_7$2=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r","stroke-width"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$y=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(r){const n=r,i=useGlobalStore(pinia),o=useConfigStore(pinia),a=useSvgEditLayoutStore(pinia),u=(c,f,d,h)=>{if(i.intention===EGlobalStoreIntention.Connection)return;i.setHandleSvgInfo(n.itemInfo);const{clientX:v,clientY:g}=f;f.stopPropagation(),i.connection_line_node_info={init_pos:{x:d,y:h},point_index:c},i.intention=EGlobalStoreIntention.SetConnectionLineNode,i.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((v-a.canvasInfo.left)/o.svg.scale),position_y:Math.round((g-a.canvasInfo.top)/o.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return(c,f)=>{var d,h,v,g,p,y;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(i).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":Math.ceil(n.itemInfo.props["stroke-width"].val*1.2)+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$d),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((d=vue.unref(i).handle_svg_info)==null?void 0:d.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$a),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((h=n.itemInfo.animations)==null?void 0:h.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((v=n.itemInfo.animations)==null?void 0:v.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((g=n.itemInfo.animations)==null?void 0:g.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$9),((p=n.itemInfo.animations)==null?void 0:p.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_6$2)],8,_hoisted_5$3)):((y=n.itemInfo.animations)==null?void 0:y.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_8$1)],8,_hoisted_7$2)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>{var A;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":Math.ceil(n.itemInfo.props.point_r.val*.2)+1,stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((A=vue.unref(i).handle_svg_info)==null?void 0:A.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(_,b)=>(vue.openBlock(),vue.createElementBlock("circle",{key:b,cx:_.x,cy:_.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:A=>u(b,A,_.x,_.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$c={style:{position:"absolute",left:"0",top:"0",bottom:"0",right:"0"}},_hoisted_2$9={xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},_hoisted_3$8={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6$1=["stroke"],_hoisted_7$1=["stroke"],_hoisted_8={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_9=["transform"],_hoisted_10=["transform"],_hoisted_11=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_12$1=["xlink:href","width","height","id","transform"],_hoisted_13=["id"],_hoisted_14=["id","x1","y1","x2","y2"],_hoisted_15=["id"],_hoisted_16$1=["x","y","height","width"],_hoisted_17=["onClick"],_hoisted_18={class:"shortcut"},_sfc_main$x=vue.defineComponent({__name:"center-panel",props:{vueComp:{}},setup(r,{expose:n}){const i=r;vue.useCssVars(pe=>({"20fb3c82":vue.unref(g)}));const o=useGlobalStore(pinia),a=useConfigStore(pinia),u=useSvgEditLayoutStore(pinia),c=useEditPrivateStore(pinia),f=useContextMenuStore(pinia);componentsRegister(i.vueComp);const d=vue.ref(),h=vue.ref(),v={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},g=vue.computed(()=>Object.keys(v).indexOf(o.intention)>-1?v[o.intention]:"default"),p=vue.reactive({handle_panel:vue.computed(()=>o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Zoom||o.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),y=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),_=vue.computed(()=>o.intention===EGlobalStoreIntention.SelectArea&&y.value.b.x&&y.value.b.y?{with:Math.abs(y.value.b.x-y.value.a.x),height:Math.abs(y.value.b.y-y.value.a.y),x:y.value.a.x<y.value.b.x?y.value.a.x:y.value.b.x,y:y.value.a.y<y.value.b.y?y.value.a.y:y.value.b.y}:{with:0,height:0,x:0,y:0}),b=vue.computed(()=>{let pe=0;for(let Lt of o.done_json)Lt.selected&&pe++;return pe>0});let A=!1,w=!1;const T=pe=>{var Lt;if(o.intention!=EGlobalStoreIntention.None){if(o.intention==EGlobalStoreIntention.Create){if(!o.create_svg_info){console.error("要创建的数据获取失败");return}const _e=Math.floor(pe.offsetX/a.svg.scale-u.center_offset.x),Et=Math.floor(pe.offsetY/a.svg.scale-u.center_offset.y),Cn={id:randomString(),x:_e,y:Et,client:{x:_e,y:Et},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},selected:!1,...objectDeepClone(o.create_svg_info)};o.setDoneJson(Cn),o.setHandleSvgInfo(Cn,o.done_json.length),o.intention=EGlobalStoreIntention.None}(Lt=h.value)==null||Lt.focus()}},S=pe=>{pe.preventDefault()},x=pe=>{pe.preventDefault()},O=(pe,Lt,_e)=>{var Et,Cn,vn;if((Et=h.value)==null||Et.focus(),o.intention===EGlobalStoreIntention.Connection){_e.stopPropagation();return}if(_e.preventDefault(),_e.stopPropagation(),_e.ctrlKey&&_e.button===0)((Cn=o.handle_svg_info)!=null&&Cn.index||((vn=o.handle_svg_info)==null?void 0:vn.index)===0)&&(o.done_json[o.handle_svg_info.index].selected=!0,o.setHandleSvgInfo(null),o.intention=EGlobalStoreIntention.None),pe.selected=!pe.selected;else if(b.value){o.intention=EGlobalStoreIntention.GroupMove,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Dt of o.done_json)Dt.selected&&(Dt.old_position={x:Dt.x,y:Dt.y},Dt.point_coordinate_old=objectDeepClone(Dt.point_coordinate))}else o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0},pe.point_coordinate_old=objectDeepClone(pe.point_coordinate)},L=(pe,Lt,_e)=>{if(!(o.intention===EGlobalStoreIntention.Connection||o.mouse_info.state!=EMouseInfoState.Down)&&b.value&&!A&&["SelectArea","Move","Select"].indexOf(o.intention)<0){for(let Et of o.done_json)Et.selected=!1,Et.old_position={x:0,y:0},resetHandlePointOld(Et);o.intention=EGlobalStoreIntention.Select,o.setHandleSvgInfo(pe,Lt),o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((_e.clientX-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e.clientY-u.canvasInfo.top)/a.svg.scale),now_position_x:pe.x,now_position_y:pe.y,new_position_x:0,new_position_y:0}}},M=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),p.connection_panel=!0,p.connection_line=!0,!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.select_item.info=pe,p.select_item.index=Lt)},re=(pe,Lt,_e)=>{_e.preventDefault(),_e.stopPropagation(),!((o.intention===EGlobalStoreIntention.Connection||o.intention===EGlobalStoreIntention.SetConnectionLineNode)&&pe.type===EDoneJsonType.ConnectionLine)&&(p.connection_panel=!1,p.connection_line=!1,p.select_item.info=null,p.select_item.index=-1)},F=pe=>{var vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt,_n,ie;if(o.mouse_info.state!=EMouseInfoState.Down&&o.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Lt,clientY:_e}=pe;o.mouse_info.new_position_x=Math.round((Lt-u.canvasInfo.left)/a.svg.scale),o.mouse_info.new_position_y=Math.round((_e-u.canvasInfo.top)/a.svg.scale);const Et=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+o.mouse_info.now_position_x),Cn=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+o.mouse_info.now_position_y);if((vn=o.handle_svg_info)!=null&&vn.info&&(o.intention===EGlobalStoreIntention.Select||o.intention===EGlobalStoreIntention.Move)){if(o.handle_svg_info.info.x=Et,o.handle_svg_info.info.y=Cn,o.handle_svg_info.info.client={x:Et,y:Cn},o.intention=EGlobalStoreIntention.Move,moveHandlePoint(o.handle_svg_info.info),moveAnchors(o.handle_svg_info.info),o.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Dt=o.handle_svg_info.info.bind_anchors)!=null&&Dt.start){let ae=null;for(let Y of o.done_json)Y.id===((qe=(de=o.handle_svg_info.info.bind_anchors)==null?void 0:de.start)==null?void 0:qe.target_id)&&(ae=Y);ae&&moveAnchors(ae)}if((Pt=o.handle_svg_info.info.bind_anchors)!=null&&Pt.end){let ae=null;for(let Y of o.done_json)Y.id===(($e=(In=o.handle_svg_info.info.bind_anchors)==null?void 0:In.end)==null?void 0:$e.target_id)&&(ae=Y);ae&&moveAnchors(ae)}}}else if(o.intention===EGlobalStoreIntention.MoveCanvas)u.center_offset.x=Et,u.center_offset.y=Cn;else if(o.intention===EGlobalStoreIntention.SelectArea)y.value.b.x=o.mouse_info.new_position_x-u.center_offset.x,y.value.b.y=o.mouse_info.new_position_y-u.center_offset.y;else if(o.intention===EGlobalStoreIntention.GroupMove){A=!0;for(let ae of o.done_json)if(ae.selected&&ae.old_position){const Y=Math.round(o.mouse_info.new_position_x-o.mouse_info.position_x+ae.old_position.x),k=Math.round(o.mouse_info.new_position_y-o.mouse_info.position_y+ae.old_position.y);if(ae.x=Y,ae.y=k,ae.client={x:Y,y:k},moveHandlePoint(ae),moveAnchors(ae),ae.type===EDoneJsonType.ConnectionLine&&((Ce=ae.bind_anchors)!=null&&Ce.end)){let D=null;for(let oe of o.done_json)oe.id===((At=(ue=ae.bind_anchors)==null?void 0:ue.end)==null?void 0:At.target_id)&&(D=oe);D&&moveAnchors(D)}}}else if(o.intention===EGlobalStoreIntention.Zoom){if(!o.handle_svg_info)return;const ae={x:o.mouse_info.new_position_x-u.center_offset.x,y:o.mouse_info.new_position_y-u.center_offset.y};let Y={width:0,height:0,is_old_width:!1,is_old_height:!1};if(o.scale_info.type===EScaleInfoType.TopLeft?Y=calculateLeftTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopRight?Y=calculateRightTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomRight?Y=calculateRightBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.BottomLeft?Y=calculateLeftBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate):o.scale_info.type===EScaleInfoType.TopCenter?Y=calculateTop(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Right?Y=calculateRight(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.BottomCenter?Y=calculateBottom(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client):o.scale_info.type===EScaleInfoType.Left&&(Y=calculateLeft(ae,o.scale_info.symmetric_point,o.handle_svg_info.info.rotate,o.handle_svg_info.info.client)),o.handle_svg_info&&Y.width>0&&Y.height>0){const k=Y.is_old_width?1:parseFloat((Y.width/o.handle_svg_info.info.actual_bound.width).toFixed(3)),D=Y.is_old_height?1:parseFloat((Y.height/o.handle_svg_info.info.actual_bound.height).toFixed(3)),oe=getCenterPoint(ae,o.scale_info.symmetric_point);k>0&&o.scale_info.type!==EScaleInfoType.TopCenter&&o.scale_info.type!==EScaleInfoType.BottomCenter&&(o.handle_svg_info.info.scale_x=k,o.handle_svg_info.info.x=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.x,oe.x,o.handle_svg_info.info.client.x))),D>0&&o.scale_info.type!==EScaleInfoType.Left&&o.scale_info.type!==EScaleInfoType.Right&&(o.handle_svg_info.info.scale_y=D,o.handle_svg_info.info.y=Math.round(getSvgNowPosition(o.handle_svg_info.info.center_position.y,oe.y,o.handle_svg_info.info.client.y)))}}else if(o.intention===EGlobalStoreIntention.Rotate){if(!o.handle_svg_info)return;const ae=Math.atan2(o.mouse_info.position_y-o.handle_svg_info.info.y,o.mouse_info.position_x-o.handle_svg_info.info.x)/(Math.PI/180),Y=Math.atan2(o.mouse_info.new_position_y-u.center_offset.y-o.handle_svg_info.info.y,o.mouse_info.new_position_x-u.center_offset.x-o.handle_svg_info.info.x)/(Math.PI/180);o.handle_svg_info.info.rotate=parseFloat((o.rotate_info.angle+Y-ae).toFixed(2))}else if(o.intention===EGlobalStoreIntention.Connection&&o.handle_svg_info){const ae=(Ne=o.handle_svg_info)==null?void 0:Ne.info.props.point_position.val.length,Y=o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,k=o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y,D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((kt=(Oe=o.handle_svg_info)==null?void 0:Oe.info.props.point_r)==null?void 0:kt.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;pe.ctrlKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:D.x,y:k+ze}:pe.shiftKey?o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:D.y}:o.handle_svg_info.info.props.point_position.val[ae-1]={x:Y+xe,y:k+ze}}else if(o.intention===EGlobalStoreIntention.SetConnectionLineNode&&o.handle_svg_info){!w&&(o.connection_line_node_info.point_index===o.handle_svg_info.info.props.point_position.val.length-1||o.connection_line_node_info.point_index===0)&&(w=!0);const ae=(jt=o.handle_svg_info)==null?void 0:jt.info.props.point_position.val.length,Y=getSvgNowPosition(o.mouse_info.position_x,o.mouse_info.new_position_x,o.connection_line_node_info.init_pos.x),k=getSvgNowPosition(o.mouse_info.position_y,o.mouse_info.new_position_y,o.connection_line_node_info.init_pos.y),D=o.handle_svg_info.info.props.point_position.val[ae-2],oe=((ie=(_n=o.handle_svg_info)==null?void 0:_n.info.props.point_r)==null?void 0:ie.val)+2||4;let xe=D.x<Y?-oe:D.x>Y?oe:0,ze=D.y<k?-oe:D.y>k?oe:0;o.handle_svg_info.info.props.point_position.val[o.connection_line_node_info.point_index]={x:Y+xe,y:k+ze}}},j=()=>{var pe,Lt,_e,Et;if(o.mouse_info.state==EMouseInfoState.Down){if((pe=o.handle_svg_info)!=null&&pe.info&&o.intention==EGlobalStoreIntention.Move)setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.intention=EGlobalStoreIntention.None,o.setDoneJson(o.done_json);else if(o.intention==EGlobalStoreIntention.GroupMove)A&&(A=!1,o.intention=EGlobalStoreIntention.None);else if((Lt=o.handle_svg_info)!=null&&Lt.info&&o.intention==EGlobalStoreIntention.Zoom)o.handle_svg_info.info.client={x:o.handle_svg_info.info.x,y:o.handle_svg_info.info.y},o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json);else if(o.intention===EGlobalStoreIntention.Rotate&&((_e=o.handle_svg_info)!=null&&_e.info))setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setDoneJson(o.done_json),o.intention=EGlobalStoreIntention.None;else{if(o.intention===EGlobalStoreIntention.Connection)return;if(o.intention===EGlobalStoreIntention.SetConnectionLineNode)w&&((Et=o.handle_svg_info)!=null&&Et.info.bind_anchors)&&(o.connection_line_node_info.point_index===0?o.handle_svg_info.info.bind_anchors.start=null:o.handle_svg_info.info.bind_anchors.end=null),o.intention=EGlobalStoreIntention.None,w=!1;else if(o.intention===EGlobalStoreIntention.SelectArea){o.setHandleSvgInfo(null);for(let Cn of o.done_json){const vn=_.value;Cn.selected=Cn.x>vn.x&&Cn.x<vn.x+vn.with&&Cn.y>vn.y&&Cn.y<vn.y+vn.height}o.intention=EGlobalStoreIntention.None}else o.intention!=EGlobalStoreIntention.Select&&(o.intention=EGlobalStoreIntention.None)}o.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},f.display=!1}},V=pe=>{const{clientX:Lt,clientY:_e}=pe;if(o.intention===EGlobalStoreIntention.Connection){o.handle_svg_info||createLine(pe),o.handle_svg_info&&(pe.button===0?o.handle_svg_info.info.props.point_position.val.length!==1?o.handle_svg_info.info.props.point_position.val.push({x:o.mouse_info.new_position_x-o.mouse_info.position_x-u.center_offset.x,y:o.mouse_info.new_position_y-o.mouse_info.position_y-u.center_offset.y}):o.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):pe.button===2&&(o.intention=EGlobalStoreIntention.None,setSvgActualInfo(o.done_json[o.handle_svg_info.index]),o.setHandleSvgInfo(null)));return}pe.button===0?(o.intention=EGlobalStoreIntention.SelectArea,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale-u.center_offset.x),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale-u.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},y.value={a:{x:o.mouse_info.position_x,y:o.mouse_info.position_y},b:{x:0,y:0}}):pe.button===2&&(o.intention=EGlobalStoreIntention.MoveCanvas,o.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Lt-u.canvasInfo.left)/a.svg.scale),position_y:Math.round((_e-u.canvasInfo.top)/a.svg.scale),now_position_x:u.center_offset.x,now_position_y:u.center_offset.y,new_position_x:0,new_position_y:0})};function z(pe){pe!=null&&pe.wheelDelta&&(pe.wheelDelta>0?a.svg.scale=parseFloat((a.svg.scale+.1).toFixed(1)):a.svg.scale=parseFloat((a.svg.scale-.1).toFixed(1)))}const $=pe=>{pe.stopPropagation(),pe.preventDefault()},he=(pe,Lt,_e)=>{o.intention!==EGlobalStoreIntention.Connection&&d.value&&(o.intention=EGlobalStoreIntention.ContextMenu,o.setHandleSvgInfo(pe,Lt),d.value.style.left=_e.pageX+"px",d.value.style.top=_e.pageY+"px",f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!0,Lt===o.done_json.length-1&&(f.info.MoveUpOneLevel.enable=f.info.MoveUpTopLevel.enable=!1),Lt===0&&(f.info.MoveDownOneLevel.enable=f.info.MoveDownTopLevel.enable=!1),f.display=!0)},le=(pe,Lt,_e)=>({x:parseFloat((pe.x-pe.width/2*Lt+pe.width/2).toFixed(1)),y:parseFloat((pe.y-pe.height/2*_e+pe.height/2).toFixed(1)),width:parseFloat((pe.width*Lt).toFixed(1)),height:parseFloat((pe.height*_e).toFixed(1))}),Ie=pe=>{pe.preventDefault();let Lt=[];if(!pe.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(pe.key)>-1&&(b.value?Lt=o.done_json.map((_e,Et)=>({selected:_e.selected,i:Et})).filter(_e=>_e.selected).map(_e=>_e.i):o.handle_svg_info&&Lt.push(o.handle_svg_info.index)),!pe.ctrlKey&&pe.key=="ArrowUp"){for(let _e of Lt)o.done_json[_e].y-=1,o.done_json[_e].client.y-=1,moveHandlePoint(o.done_json[_e],0,-1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowDown"){for(let _e of Lt)o.done_json[_e].y+=1,o.done_json[_e].client.y+=1,moveHandlePoint(o.done_json[_e],0,1),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowLeft"){for(let _e of Lt)o.done_json[_e].x-=1,o.done_json[_e].client.x-=1,moveHandlePoint(o.done_json[_e],-1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else if(!pe.ctrlKey&&pe.key=="ArrowRight"){for(let _e of Lt)o.done_json[_e].x+=1,o.done_json[_e].client.x+=1,moveHandlePoint(o.done_json[_e],1,0),moveAnchors(o.done_json[_e]);useHistoryRecord(o.done_json)}else pe.ctrlKey&&pe.key.toLowerCase()=="c"?f.onContextMenuClick(EContextMenuInfoType.Copy):!pe.ctrlKey&&pe.key=="Delete"?b.value?(o.setDoneJson(o.done_json.filter(_e=>!_e.selected)),o.setHandleSvgInfo(o.done_json[o.done_json.length-1],o.done_json.length-1)):f.onContextMenuClick(EContextMenuInfoType.Delete):pe.ctrlKey&&pe.key=="ArrowUp"?f.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):pe.ctrlKey&&pe.key=="ArrowDown"?f.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):pe.ctrlKey&&pe.key=="ArrowLeft"?f.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):pe.ctrlKey&&pe.key=="ArrowRight"?f.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):pe.ctrlKey&&pe.shiftKey&&pe.key.toLowerCase()=="z"?c.topRedoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="z"?c.topUndoBtnClick():pe.ctrlKey&&pe.key.toLowerCase()=="delete"&&(o.done_json.length<=0||o.setDoneJson([]))},Fe=()=>{setSvgActualInfo(o.done_json[o.handle_svg_info.index],!0)};return vue.onMounted(()=>{var pe;(pe=h.value)==null||pe.focus(),vue.nextTick(function(){var _e;const Lt=(_e=h.value)==null?void 0:_e.getBoundingClientRect();u.canvasInfo={height:(Lt==null?void 0:Lt.height)||0,with:(Lt==null?void 0:Lt.width)||0,top:(Lt==null?void 0:Lt.top)||0,left:(Lt==null?void 0:Lt.left)||0}})}),n({onCanvasMouseUp:j}),(pe,Lt)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{ref_key:"canvasRef",ref:h,class:"canvas",style:vue.normalizeStyle({backgroundColor:vue.unref(a).svg.background_color,position:"relative"}),tabindex:"0",onDrop:T,onDragenter:S,onDragover:x,onMousedown:V,onMousemove:F,onMouseup:j,onContextmenu:$,onKeydown:Ie,onMousewheel:z},[vue.renderSlot(pe.$slots,"background",{},void 0,!0),vue.createElementVNode("div",_hoisted_1$c,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_2$9,[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_3$8,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_5$2),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_6$1),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(a).svg.grid_color},null,8,_hoisted_7$1)])]),vue.unref(a).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_8)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(u).center_offset.x*vue.unref(a).svg.scale},${vue.unref(u).center_offset.y*vue.unref(a).svg.scale})rotate(0)scale(${vue.unref(a).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o).done_json,(_e,Et)=>{var Cn,vn,Dt,de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:_e.id,transform:`translate(${_e.x},${_e.y})rotate(0)scale(1)`,onMousewheel:Lt[0]||(Lt[0]=(...jt)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...jt))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(_e)}`)},[vue.createElementVNode("g",{transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2})rotate(${_e.rotate}) scale(1) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`,onMousedown:jt=>O(_e,Et,jt),onMouseup:jt=>L(_e,Et,jt),onMouseenter:jt=>M(_e,Et,jt),onMouseleave:jt=>re(_e,Et,jt),onContextmenu:jt=>he(_e,Et,jt)},[_e.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":_e,"point-visible":vue.unref(p).connection_line&&((Cn=vue.unref(p).select_item.info)==null?void 0:Cn.id)==_e.id},null,8,["item-info","point-visible"])):_e.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${_e.name}`},vue.unref(prosToVBind)(_e,["height","width"]),{width:((Dt=(vn=_e.props)==null?void 0:vn.width)==null?void 0:Dt.val)??100,height:((qe=(de=_e.props)==null?void 0:de.height)==null?void 0:qe.val)??100,id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,_hoisted_12$1)):_e.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(_e,["height","width"]),{width:((In=(Pt=_e.props)==null?void 0:Pt.width)==null?void 0:In.val)??100,height:((Ce=($e=_e.props)==null?void 0:$e.height)==null?void 0:Ce.val)??100,id:_e.id,onResize:Fe,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),null,16,["width","height","id","transform"])):_e.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},le(_e.actual_bound,_e.scale_x,_e.scale_y),{id:`foreign-object${_e.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_e.tag),vue.mergeProps(vue.unref(prosToVBind)(_e),{id:_e.id,transform:`translate(${_e.actual_bound.x+_e.actual_bound.width/2},${_e.actual_bound.y+_e.actual_bound.height/2}) scale(${_e.scale_x},${_e.scale_y}) translate(${-(_e.actual_bound.x+_e.actual_bound.width/2)},${-(_e.actual_bound.y+_e.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(_e.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_13)):_e.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:_e.id,x1:_e.props.start_x.val,y1:_e.props.start_y.val,x2:_e.props.end_x.val,y2:_e.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_14)):vue.createCommentVNode("",!0),_e.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${_e.id}`,fill:"black","fill-opacity":"0"},le(_e.actual_bound,_e.scale_x,_e.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!_e.selected&&(vue.unref(o).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Move&&((ue=vue.unref(o).handle_svg_info)==null?void 0:ue.info.id)==_e.id,"svg-item-select":vue.unref(o).intention==vue.unref(EGlobalStoreIntention).Select&&((At=vue.unref(o).handle_svg_info)==null?void 0:At.info.id)==_e.id,"svg-item-in-group":_e.selected}}),null,16,_hoisted_15)):vue.createCommentVNode("",!0),((Ne=vue.unref(o).handle_svg_info)==null?void 0:Ne.info.id)===_e.id&&vue.unref(p).handle_panel&&_e.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0),!_e.selected&&((Oe=vue.unref(p).select_item.info)==null?void 0:Oe.id)==_e.id&&vue.unref(p).connection_panel&&_e.config.have_anchor&&vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(o).intention!==vue.unref(EGlobalStoreIntention).Select||_e.id!==((kt=vue.unref(o).handle_svg_info)==null?void 0:kt.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:$,"item-info":_e},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_11)],2)],40,_hoisted_10)),[[vue.vShow,_e.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(_).x,y:vue.unref(_).y,height:vue.unref(_).height,width:vue.unref(_).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_16$1)],8,_hoisted_9)]))])],36),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:d,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f).info,(_e,Et)=>(vue.openBlock(),vue.createElementBlock("li",{key:_e.title,onClick:Cn=>vue.unref(f).onContextMenuClick(Et)},[vue.createElementVNode("p",{class:vue.normalizeClass(_e.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(_e.title)+" ",1),vue.createElementVNode("span",_hoisted_18,vue.toDisplayString(_e.hot_key),1)],2)],8,_hoisted_17))),128))],512),[[vue.vShow,vue.unref(f).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_c77c0287_lang="",CenterPanel=_export_sfc$1(_sfc_main$x,[["__scopeId","data-v-c77c0287"]]);/*! Element Plus Icons Vue v2.1.0 */var export_helper_default=(r,n)=>{let i=r.__vccOpts||r;for(let[o,a]of n)i[o]=a;return i},aim_vue_vue_type_script_lang_default={name:"Aim"},_hoisted_12={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_22=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_32=vue.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32zm0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32zM96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32zm576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32z"},null,-1),_hoisted_42=[_hoisted_22,_hoisted_32];function _sfc_render2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_12,_hoisted_42)}var aim_default=export_helper_default(aim_vue_vue_type_script_lang_default,[["render",_sfc_render2],["__file","aim.vue"]]),arrow_down_vue_vue_type_script_lang_default={name:"ArrowDown"},_hoisted_16={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_26=vue.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null,-1),_hoisted_36=[_hoisted_26];function _sfc_render6(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_16,_hoisted_36)}var arrow_down_default=export_helper_default(arrow_down_vue_vue_type_script_lang_default,[["render",_sfc_render6],["__file","arrow-down.vue"]]),circle_check_vue_vue_type_script_lang_default={name:"CircleCheck"},_hoisted_149={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_249=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_348=vue.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"},null,-1),_hoisted_415=[_hoisted_249,_hoisted_348];function _sfc_render49(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_149,_hoisted_415)}var circle_check_default=export_helper_default(circle_check_vue_vue_type_script_lang_default,[["render",_sfc_render49],["__file","circle-check.vue"]]),circle_close_vue_vue_type_script_lang_default={name:"CircleClose"},_hoisted_151={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_251=vue.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"},null,-1),_hoisted_350=vue.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"},null,-1),_hoisted_416=[_hoisted_251,_hoisted_350];function _sfc_render51(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_151,_hoisted_416)}var circle_close_default=export_helper_default(circle_close_vue_vue_type_script_lang_default,[["render",_sfc_render51],["__file","circle-close.vue"]]),close_vue_vue_type_script_lang_default={name:"Close"},_hoisted_156={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_256=vue.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"},null,-1),_hoisted_355=[_hoisted_256];function _sfc_render56(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_156,_hoisted_355)}var close_default=export_helper_default(close_vue_vue_type_script_lang_default,[["render",_sfc_render56],["__file","close.vue"]]),hide_vue_vue_type_script_lang_default={name:"Hide"},_hoisted_1133={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2133=vue.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"},null,-1),_hoisted_3132=vue.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"},null,-1),_hoisted_438=[_hoisted_2133,_hoisted_3132];function _sfc_render133(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1133,_hoisted_438)}var hide_default=export_helper_default(hide_vue_vue_type_script_lang_default,[["render",_sfc_render133],["__file","hide.vue"]]),loading_vue_vue_type_script_lang_default={name:"Loading"},_hoisted_1150={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2150=vue.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),_hoisted_3149=[_hoisted_2150];function _sfc_render150(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1150,_hoisted_3149)}var loading_default=export_helper_default(loading_vue_vue_type_script_lang_default,[["render",_sfc_render150],["__file","loading.vue"]]),view_vue_vue_type_script_lang_default={name:"View"},_hoisted_1283={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},_hoisted_2283=vue.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),_hoisted_3282=[_hoisted_2283];function _sfc_render283(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1283,_hoisted_3282)}var view_default=export_helper_default(view_vue_vue_type_script_lang_default,[["render",_sfc_render283],["__file","view.vue"]]),MapShim=function(){if(typeof Map<"u")return Map;function r(n,i){var o=-1;return n.some(function(a,u){return a[0]===i?(o=u,!0):!1}),o}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(i){var o=r(this.__entries__,i),a=this.__entries__[o];return a&&a[1]},n.prototype.set=function(i,o){var a=r(this.__entries__,i);~a?this.__entries__[a][1]=o:this.__entries__.push([i,o])},n.prototype.delete=function(i){var o=this.__entries__,a=r(o,i);~a&&o.splice(a,1)},n.prototype.has=function(i){return!!~r(this.__entries__,i)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(i,o){o===void 0&&(o=null);for(var a=0,u=this.__entries__;a<u.length;a++){var c=u[a];i.call(o,c[1],c[0])}},n}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle(r,n){var i=!1,o=!1,a=0;function u(){i&&(i=!1,r()),o&&f()}function c(){requestAnimationFrame$1(u)}function f(){var d=Date.now();if(i){if(d-a<trailingTimeout)return;o=!0}else i=!0,o=!1,setTimeout(c,n);a=d}return f}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return r.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n),this.connected_||this.connect_()},r.prototype.removeObserver=function(n){var i=this.observers_,o=i.indexOf(n);~o&&i.splice(o,1),!i.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},r.prototype.updateObservers_=function(){var n=this.observers_.filter(function(i){return i.gatherActive(),i.hasActive()});return n.forEach(function(i){return i.broadcastActive()}),n.length>0},r.prototype.connect_=function(){!isBrowser||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!isBrowser||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(n){var i=n.propertyName,o=i===void 0?"":i,a=transitionKeys.some(function(u){return!!~o.indexOf(u)});a&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),defineConfigurable=function(r,n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];Object.defineProperty(r,a,{value:n[a],enumerable:!1,writable:!1,configurable:!0})}return r},getWindowOf=function(r){var n=r&&r.ownerDocument&&r.ownerDocument.defaultView;return n||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(r){return parseFloat(r)||0}function getBordersSize(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.reduce(function(o,a){var u=r["border-"+a+"-width"];return o+toFloat(u)},0)}function getPaddings(r){for(var n=["top","right","bottom","left"],i={},o=0,a=n;o<a.length;o++){var u=a[o],c=r["padding-"+u];i[u]=toFloat(c)}return i}function getSVGContentRect(r){var n=r.getBBox();return createRectInit(0,0,n.width,n.height)}function getHTMLElementContentRect(r){var n=r.clientWidth,i=r.clientHeight;if(!n&&!i)return emptyRect;var o=getWindowOf(r).getComputedStyle(r),a=getPaddings(o),u=a.left+a.right,c=a.top+a.bottom,f=toFloat(o.width),d=toFloat(o.height);if(o.boxSizing==="border-box"&&(Math.round(f+u)!==n&&(f-=getBordersSize(o,"left","right")+u),Math.round(d+c)!==i&&(d-=getBordersSize(o,"top","bottom")+c)),!isDocumentElement(r)){var h=Math.round(f+u)-n,v=Math.round(d+c)-i;Math.abs(h)!==1&&(f-=h),Math.abs(v)!==1&&(d-=v)}return createRectInit(a.left,a.top,f,d)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof getWindowOf(r).SVGGraphicsElement}:function(r){return r instanceof getWindowOf(r).SVGElement&&typeof r.getBBox=="function"}}();function isDocumentElement(r){return r===getWindowOf(r).document.documentElement}function getContentRect(r){return isBrowser?isSVGGraphicsElement(r)?getSVGContentRect(r):getHTMLElementContentRect(r):emptyRect}function createReadOnlyRect(r){var n=r.x,i=r.y,o=r.width,a=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(u.prototype);return defineConfigurable(c,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),c}function createRectInit(r,n,i,o){return{x:r,y:n,width:i,height:o}}var ResizeObservation=function(){function r(n){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=n}return r.prototype.isActive=function(){var n=getContentRect(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},r}(),ResizeObserverEntry=function(){function r(n,i){var o=createReadOnlyRect(i);defineConfigurable(this,{target:n,contentRect:o})}return r}(),ResizeObserverSPI=function(){function r(n,i,o){if(this.activeObservations_=[],this.observations_=new MapShim,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n,this.controller_=i,this.callbackCtx_=o}return r.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)||(i.set(n,new ResizeObservation(n)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof getWindowOf(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var i=this.observations_;i.has(n)&&(i.delete(n),i.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(i){i.isActive()&&n.activeObservations_.push(i)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,i=this.activeObservations_.map(function(o){return new ResizeObserverEntry(o.target,o.broadcastRect())});this.callback_.call(n,i,n),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function r(n){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ResizeObserverController.getInstance(),o=new ResizeObserverSPI(n,i,this);observers.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){ResizeObserver$1.prototype[r]=function(){var n;return(n=observers.get(this))[r].apply(n,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}();const Events=["blur","input","change","changeSelectionStyle","changeSession","copy","focus","paste"],VAceEditor=vue.defineComponent({props:{value:{type:String,required:!0},lang:{type:String,default:"text"},theme:{type:String,default:"chrome"},options:Object,placeholder:String,readonly:Boolean,wrap:Boolean,printMargin:{type:[Boolean,Number],default:!0},minLines:Number,maxLines:Number},emits:["update:value","init",...Events],render(){return vue.h("div")},mounted(){const r=this._editor=vue.markRaw(ace.edit(this.$el,{placeholder:this.placeholder,readOnly:this.readonly,value:this.value,mode:"ace/mode/"+this.lang,theme:"ace/theme/"+this.theme,wrap:this.wrap,printMargin:this.printMargin,useWorker:!1,minLines:this.minLines,maxLines:this.maxLines,...this.options}));this._contentBackup=this.value,this._isSettingContent=!1,r.on("change",()=>{if(this._isSettingContent)return;const n=r.getValue();this._contentBackup=n,this.$emit("update:value",n)}),Events.forEach(n=>{const i="on"+vue.capitalize(n);typeof this.$.vnode.props[i]=="function"&&r.on(n,this.$emit.bind(this,n))}),this._ro=new index$1(()=>r.resize()),this._ro.observe(this.$el),this.$emit("init",r)},beforeUnmount(){var r,n;(r=this._ro)===null||r===void 0||r.disconnect(),(n=this._editor)===null||n===void 0||n.destroy()},methods:{focus(){this._editor.focus()},blur(){this._editor.blur()},selectAll(){this._editor.selectAll()}},watch:{value(r){if(this._contentBackup!==r){try{this._isSettingContent=!0,this._editor.setValue(r,1)}finally{this._isSettingContent=!1}this._contentBackup=r}},theme(r){this._editor.setTheme("ace/theme/"+r)},options(r){this._editor.setOptions(r)},readonly(r){this._editor.setReadOnly(r)},placeholder(r){this._editor.setOption("placeholder",r)},wrap(r){this._editor.setWrapBehavioursEnabled(r)},printMargin(r){this._editor.setOption("printMargin",r)},lang(r){this._editor.setOption("mode","ace/mode/"+r)},minLines(r){this._editor.setOption("minLines",r)},maxLines(r){this._editor.setOption("maxLines",r)}}}),themeUrl2="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe21vZHVsZS5leHBvcnRzID0gIi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXIge1xuICBiYWNrZ3JvdW5kOiAjMWMxOTE3O1xuICBjb2xvcjogI0ZDRkZFMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfcHJpbnQtbWFyZ2luIHtcbiAgd2lkdGg6IDFweDtcbiAgYmFja2dyb3VuZDogIzFjMTkxN1xufVxuXG4uYWNlLWtyLXRoZW1lIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzBCMEEwOTtcbiAgY29sb3I6ICNGQ0ZGRTBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2N1cnNvciB7XG4gIGNvbG9yOiAjRkY5OTAwXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9tYXJrZXItbGF5ZXIgLmFjZV9zZWxlY3Rpb24ge1xuICBiYWNrZ3JvdW5kOiByZ2JhKDE3MCwgMCwgMjU1LCAwLjQ1KVxufVxuXG4uYWNlLWtyLXRoZW1lLmFjZV9tdWx0aXNlbGVjdCAuYWNlX3NlbGVjdGlvbi5hY2Vfc3RhcnQge1xuICBib3gtc2hhZG93OiAwIDAgM3B4IDBweCAjMEIwQTA5O1xufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2Vfc3RlcCB7XG4gIGJhY2tncm91bmQ6IHJnYigxMDIsIDgyLCAwKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2VfYnJhY2tldCB7XG4gIG1hcmdpbjogLTFweCAwIDAgLTFweDtcbiAgYm9yZGVyOiAxcHggc29saWQgcmdiYSgyNTUsIDE3NywgMTExLCAwLjMyKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2VfYWN0aXZlLWxpbmUge1xuICBiYWNrZ3JvdW5kOiAjMzg0MDNEXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9ndXR0ZXItYWN0aXZlLWxpbmUge1xuICBiYWNrZ3JvdW5kLWNvbG9yIDogIzM4NDAzRFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfbWFya2VyLWxheWVyIC5hY2Vfc2VsZWN0ZWQtd29yZCB7XG4gIGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMTcwLCAwLCAyNTUsIDAuNDUpXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9pbnZpc2libGUge1xuICBjb2xvcjogcmdiYSgyNTUsIDE3NywgMTExLCAwLjMyKVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2Vfa2V5d29yZCxcbi5hY2Uta3ItdGhlbWUgLmFjZV9tZXRhIHtcbiAgY29sb3I6ICM5NDlDOEJcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LFxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LmFjZV9jaGFyYWN0ZXIsXG4uYWNlLWtyLXRoZW1lIC5hY2VfY29uc3RhbnQuYWNlX2NoYXJhY3Rlci5hY2VfZXNjYXBlLFxuLmFjZS1rci10aGVtZSAuYWNlX2NvbnN0YW50LmFjZV9vdGhlciB7XG4gIGNvbG9yOiByZ2JhKDIxMCwgMTE3LCAyNCwgMC43Nilcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2ludmFsaWQge1xuICBjb2xvcjogI0Y4RjhGODtcbiAgYmFja2dyb3VuZC1jb2xvcjogI0E0MTMwMFxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2Vfc3VwcG9ydCB7XG4gIGNvbG9yOiAjOUZDMjhBXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdXBwb3J0LmFjZV9jb25zdGFudCB7XG4gIGNvbG9yOiAjQzI3RTY2XG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9mb2xkIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzk0OUM4QjtcbiAgYm9yZGVyLWNvbG9yOiAjRkNGRkUwXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdXBwb3J0LmFjZV9mdW5jdGlvbiB7XG4gIGNvbG9yOiAjODU4NzNBXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9zdG9yYWdlIHtcbiAgY29sb3I6ICNGRkVFODBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3N0cmluZyB7XG4gIGNvbG9yOiByZ2JhKDE2NCwgMTYxLCAxODEsIDAuOClcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3N0cmluZy5hY2VfcmVnZXhwIHtcbiAgY29sb3I6IHJnYmEoMTI1LCAyNTUsIDE5MiwgMC42NSlcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX2NvbW1lbnQge1xuICBmb250LXN0eWxlOiBpdGFsaWM7XG4gIGNvbG9yOiAjNzA2RDVCXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV92YXJpYWJsZSB7XG4gIGNvbG9yOiAjRDFBNzk2XG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9saXN0LFxuLmFjZS1rci10aGVtZSAuYWNlX21hcmt1cC5hY2VfbGlzdCB7XG4gIGJhY2tncm91bmQtY29sb3I6ICMwRjAwNDBcbn1cblxuLmFjZS1rci10aGVtZSAuYWNlX3ZhcmlhYmxlLmFjZV9sYW5ndWFnZSB7XG4gIGNvbG9yOiAjRkY4MEUxXG59XG5cbi5hY2Uta3ItdGhlbWUgLmFjZV9tZXRhLmFjZV90YWcge1xuICBjb2xvcjogI0JBQkQ5Q1xufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfaW5kZW50LWd1aWRlIHtcbiAgYmFja2dyb3VuZDogdXJsKGRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQUVBQUFBQ0NBWUFBQUNaZ2JZbkFBQUFFa2xFUVZRSW1XTmdZR0JnWUZCWFYvOFBBQUpvQVhYNGtUMkVBQUFBQUVsRlRrU3VRbUNDKSByaWdodCByZXBlYXQteVxufVxuXG4uYWNlLWtyLXRoZW1lIC5hY2VfaW5kZW50LWd1aWRlLWFjdGl2ZSB7XG4gIGJhY2tncm91bmQ6IHVybChcImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQUVBQUFBQ0NBWUFBQUNaZ2JZbkFBQUFDWEJJV1hNQUFBc1RBQUFMRXdFQW1wd1lBQUFBSUdOSVVrMEFBSG9sQUFDQWd3QUErZjhBQUlEcEFBQjFNQUFBNm1BQUFEcVlBQUFYYjVKZnhVWUFBQUFaU1VSQlZIamFZdmovLy85L2hpdkt5djhCQUFBQS8vOERBQ0xxQmhidmsrL2VBQUFBQUVsRlRrU3VRbUNDXCIpIHJpZ2h0IHJlcGVhdC15O1xufVxuIjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3RoZW1lL2tyX3RoZW1lIixbInJlcXVpcmUiLCJleHBvcnRzIiwibW9kdWxlIiwiYWNlL3RoZW1lL2tyX3RoZW1lLmNzcyIsImFjZS9saWIvZG9tIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7ZXhwb3J0cy5pc0RhcmsgPSB0cnVlOwpleHBvcnRzLmNzc0NsYXNzID0gImFjZS1rci10aGVtZSI7CmV4cG9ydHMuY3NzVGV4dCA9IHJlcXVpcmUoIi4va3JfdGhlbWUuY3NzIik7CnZhciBkb20gPSByZXF1aXJlKCIuLi9saWIvZG9tIik7CmRvbS5pbXBvcnRDc3NTdHJpbmcoZXhwb3J0cy5jc3NUZXh0LCBleHBvcnRzLmNzc0NsYXNzLCBmYWxzZSk7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL3RoZW1lL2tyX3RoZW1lIl0sIGZ1bmN0aW9uKG0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtb2R1bGUgPT0gIm9iamVjdCIgJiYgdHlwZW9mIGV4cG9ydHMgPT0gIm9iamVjdCIgJiYgbW9kdWxlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IG07CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICAgIA==",modeJsonUrl="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvbGliL29vcCIsImFjZS9tb2RlL3RleHRfaGlnaGxpZ2h0X3J1bGVzIl0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dEhpZ2hsaWdodFJ1bGVzID0gcmVxdWlyZSgiLi90ZXh0X2hpZ2hsaWdodF9ydWxlcyIpLlRleHRIaWdobGlnaHRSdWxlczsKdmFyIEpzb25IaWdobGlnaHRSdWxlcyA9IGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuJHJ1bGVzID0gewogICAgICAgICJzdGFydCI6IFsKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdG9rZW46ICJ2YXJpYWJsZSIsCiAgICAgICAgICAgICAgICByZWdleDogJ1siXSg/Oig/OlxcXFwuKXwoPzpbXiJcXFxcXSkpKj9bIl1cXHMqKD89OiknCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAic3RyaW5nIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAnIicsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RyaW5nIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lm51bWVyaWMiLAogICAgICAgICAgICAgICAgcmVnZXg6ICIwW3hYXVswLTlhLWZBLUZdK1xcYiIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJjb25zdGFudC5udW1lcmljIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAiWystXT9cXGQrKD86KD86XFwuXFxkKik/KD86W2VFXVsrLV0/XFxkKyk/KT9cXGIiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29uc3RhbnQubGFuZ3VhZ2UuYm9vbGVhbiIsCiAgICAgICAgICAgICAgICByZWdleDogIig/OnRydWV8ZmFsc2UpXFxiIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbJ10oPzooPzpcXFxcLil8KD86W14nXFxcXF0pKSo/WyddIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbW1lbnQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXC9cXC8uKiQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5zdGFydCIsCiAgICAgICAgICAgICAgICByZWdleDogIlxcL1xcKiIsCiAgICAgICAgICAgICAgICBuZXh0OiAiY29tbWVudCIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5scGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbWyh7XSIKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgdG9rZW46ICJwYXJlbi5ycGFyZW4iLAogICAgICAgICAgICAgICAgcmVnZXg6ICJbXFxdKX1dIgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInB1bmN0dWF0aW9uLm9wZXJhdG9yIiwKICAgICAgICAgICAgICAgIHJlZ2V4OiAvWyxdLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInRleHQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXHMrIgogICAgICAgICAgICB9CiAgICAgICAgXSwKICAgICAgICAic3RyaW5nIjogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0b2tlbjogImNvbnN0YW50Lmxhbmd1YWdlLmVzY2FwZSIsCiAgICAgICAgICAgICAgICByZWdleDogL1xcKD86eFswLTlhLWZBLUZdezJ9fHVbMC05YS1mQS1GXXs0fXxbIlxcXC9iZm5ydF0pLwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICB0b2tlbjogInN0cmluZyIsCiAgICAgICAgICAgICAgICByZWdleDogJyJ8JCcsCiAgICAgICAgICAgICAgICBuZXh0OiAic3RhcnQiCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIGRlZmF1bHRUb2tlbjogInN0cmluZyIKICAgICAgICAgICAgfQogICAgICAgIF0sCiAgICAgICAgImNvbW1lbnQiOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRva2VuOiAiY29tbWVudC5lbmQiLAogICAgICAgICAgICAgICAgcmVnZXg6ICJcXCpcXC8iLAogICAgICAgICAgICAgICAgbmV4dDogInN0YXJ0IgogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBkZWZhdWx0VG9rZW46ICJjb21tZW50IgogICAgICAgICAgICB9CiAgICAgICAgXQogICAgfTsKfTsKb29wLmluaGVyaXRzKEpzb25IaWdobGlnaHRSdWxlcywgVGV4dEhpZ2hsaWdodFJ1bGVzKTsKZXhwb3J0cy5Kc29uSGlnaGxpZ2h0UnVsZXMgPSBKc29uSGlnaGxpZ2h0UnVsZXM7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL21hdGNoaW5nX2JyYWNlX291dGRlbnQiLFsicmVxdWlyZSIsImV4cG9ydHMiLCJtb2R1bGUiLCJhY2UvcmFuZ2UiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uL3JhbmdlIikuUmFuZ2U7CnZhciBNYXRjaGluZ0JyYWNlT3V0ZGVudCA9IGZ1bmN0aW9uICgpIHsgfTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMuY2hlY2tPdXRkZW50ID0gZnVuY3Rpb24gKGxpbmUsIGlucHV0KSB7CiAgICAgICAgaWYgKCEvXlxzKyQvLnRlc3QobGluZSkpCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICByZXR1cm4gL15ccypcfS8udGVzdChpbnB1dCk7CiAgICB9OwogICAgdGhpcy5hdXRvT3V0ZGVudCA9IGZ1bmN0aW9uIChkb2MsIHJvdykgewogICAgICAgIHZhciBsaW5lID0gZG9jLmdldExpbmUocm93KTsKICAgICAgICB2YXIgbWF0Y2ggPSBsaW5lLm1hdGNoKC9eKFxzKlx9KS8pOwogICAgICAgIGlmICghbWF0Y2gpCiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIHZhciBjb2x1bW4gPSBtYXRjaFsxXS5sZW5ndGg7CiAgICAgICAgdmFyIG9wZW5CcmFjZVBvcyA9IGRvYy5maW5kTWF0Y2hpbmdCcmFja2V0KHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0pOwogICAgICAgIGlmICghb3BlbkJyYWNlUG9zIHx8IG9wZW5CcmFjZVBvcy5yb3cgPT0gcm93KQogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB2YXIgaW5kZW50ID0gdGhpcy4kZ2V0SW5kZW50KGRvYy5nZXRMaW5lKG9wZW5CcmFjZVBvcy5yb3cpKTsKICAgICAgICBkb2MucmVwbGFjZShuZXcgUmFuZ2Uocm93LCAwLCByb3csIGNvbHVtbiAtIDEpLCBpbmRlbnQpOwogICAgfTsKICAgIHRoaXMuJGdldEluZGVudCA9IGZ1bmN0aW9uIChsaW5lKSB7CiAgICAgICAgcmV0dXJuIGxpbmUubWF0Y2goL15ccyovKVswXTsKICAgIH07Cn0pLmNhbGwoTWF0Y2hpbmdCcmFjZU91dGRlbnQucHJvdG90eXBlKTsKZXhwb3J0cy5NYXRjaGluZ0JyYWNlT3V0ZGVudCA9IE1hdGNoaW5nQnJhY2VPdXRkZW50OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9mb2xkaW5nL2NzdHlsZSIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSIsImFjZS9saWIvb29wIiwiYWNlL3JhbmdlIiwiYWNlL21vZGUvZm9sZGluZy9mb2xkX21vZGUiXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuLi8uLi9saWIvb29wIik7CnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uLy4uL3JhbmdlIikuUmFuZ2U7CnZhciBCYXNlRm9sZE1vZGUgPSByZXF1aXJlKCIuL2ZvbGRfbW9kZSIpLkZvbGRNb2RlOwp2YXIgRm9sZE1vZGUgPSBleHBvcnRzLkZvbGRNb2RlID0gZnVuY3Rpb24gKGNvbW1lbnRSZWdleCkgewogICAgaWYgKGNvbW1lbnRSZWdleCkgewogICAgICAgIHRoaXMuZm9sZGluZ1N0YXJ0TWFya2VyID0gbmV3IFJlZ0V4cCh0aGlzLmZvbGRpbmdTdGFydE1hcmtlci5zb3VyY2UucmVwbGFjZSgvXHxbXnxdKj8kLywgInwiICsgY29tbWVudFJlZ2V4LnN0YXJ0KSk7CiAgICAgICAgdGhpcy5mb2xkaW5nU3RvcE1hcmtlciA9IG5ldyBSZWdFeHAodGhpcy5mb2xkaW5nU3RvcE1hcmtlci5zb3VyY2UucmVwbGFjZSgvXHxbXnxdKj8kLywgInwiICsgY29tbWVudFJlZ2V4LmVuZCkpOwogICAgfQp9Owpvb3AuaW5oZXJpdHMoRm9sZE1vZGUsIEJhc2VGb2xkTW9kZSk7CihmdW5jdGlvbiAoKSB7CiAgICB0aGlzLmZvbGRpbmdTdGFydE1hcmtlciA9IC8oW1x7XFtcKF0pW15cfVxdXCldKiR8XlxzKihcL1wqKS87CiAgICB0aGlzLmZvbGRpbmdTdG9wTWFya2VyID0gL15bXlxbXHtcKF0qKFtcfVxdXCldKXxeW1xzXCpdKihcKlwvKS87CiAgICB0aGlzLnNpbmdsZUxpbmVCbG9ja0NvbW1lbnRSZSA9IC9eXHMqKFwvXCopLipcKlwvXHMqJC87CiAgICB0aGlzLnRyaXBsZVN0YXJCbG9ja0NvbW1lbnRSZSA9IC9eXHMqKFwvXCpcKlwqKS4qXCpcL1xzKiQvOwogICAgdGhpcy5zdGFydFJlZ2lvblJlID0gL15ccyooXC9cKnxcL1wvKSM/cmVnaW9uXGIvOwogICAgdGhpcy5fZ2V0Rm9sZFdpZGdldEJhc2UgPSB0aGlzLmdldEZvbGRXaWRnZXQ7CiAgICB0aGlzLmdldEZvbGRXaWRnZXQgPSBmdW5jdGlvbiAoc2Vzc2lvbiwgZm9sZFN0eWxlLCByb3cpIHsKICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgIGlmICh0aGlzLnNpbmdsZUxpbmVCbG9ja0NvbW1lbnRSZS50ZXN0KGxpbmUpKSB7CiAgICAgICAgICAgIGlmICghdGhpcy5zdGFydFJlZ2lvblJlLnRlc3QobGluZSkgJiYgIXRoaXMudHJpcGxlU3RhckJsb2NrQ29tbWVudFJlLnRlc3QobGluZSkpCiAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgfQogICAgICAgIHZhciBmdyA9IHRoaXMuX2dldEZvbGRXaWRnZXRCYXNlKHNlc3Npb24sIGZvbGRTdHlsZSwgcm93KTsKICAgICAgICBpZiAoIWZ3ICYmIHRoaXMuc3RhcnRSZWdpb25SZS50ZXN0KGxpbmUpKQogICAgICAgICAgICByZXR1cm4gInN0YXJ0IjsgLy8gbGluZUNvbW1lbnRSZWdpb25TdGFydAogICAgICAgIHJldHVybiBmdzsKICAgIH07CiAgICB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZSA9IGZ1bmN0aW9uIChzZXNzaW9uLCBmb2xkU3R5bGUsIHJvdywgZm9yY2VNdWx0aWxpbmUpIHsKICAgICAgICB2YXIgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgIGlmICh0aGlzLnN0YXJ0UmVnaW9uUmUudGVzdChsaW5lKSkKICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0Q29tbWVudFJlZ2lvbkJsb2NrKHNlc3Npb24sIGxpbmUsIHJvdyk7CiAgICAgICAgdmFyIG1hdGNoID0gbGluZS5tYXRjaCh0aGlzLmZvbGRpbmdTdGFydE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm9wZW5pbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHZhciByYW5nZSA9IHNlc3Npb24uZ2V0Q29tbWVudEZvbGRSYW5nZShyb3csIGkgKyBtYXRjaFswXS5sZW5ndGgsIDEpOwogICAgICAgICAgICBpZiAocmFuZ2UgJiYgIXJhbmdlLmlzTXVsdGlMaW5lKCkpIHsKICAgICAgICAgICAgICAgIGlmIChmb3JjZU11bHRpbGluZSkgewogICAgICAgICAgICAgICAgICAgIHJhbmdlID0gdGhpcy5nZXRTZWN0aW9uUmFuZ2Uoc2Vzc2lvbiwgcm93KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbGRTdHlsZSAhPSAiYWxsIikKICAgICAgICAgICAgICAgICAgICByYW5nZSA9IG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJhbmdlOwogICAgICAgIH0KICAgICAgICBpZiAoZm9sZFN0eWxlID09PSAibWFya2JlZ2luIikKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIHZhciBtYXRjaCA9IGxpbmUubWF0Y2godGhpcy5mb2xkaW5nU3RvcE1hcmtlcik7CiAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgIHZhciBpID0gbWF0Y2guaW5kZXggKyBtYXRjaFswXS5sZW5ndGg7CiAgICAgICAgICAgIGlmIChtYXRjaFsxXSkKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsb3NpbmdCcmFja2V0QmxvY2soc2Vzc2lvbiwgbWF0Y2hbMV0sIHJvdywgaSk7CiAgICAgICAgICAgIHJldHVybiBzZXNzaW9uLmdldENvbW1lbnRGb2xkUmFuZ2Uocm93LCBpLCAtMSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuZ2V0U2VjdGlvblJhbmdlID0gZnVuY3Rpb24gKHNlc3Npb24sIHJvdykgewogICAgICAgIHZhciBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgdmFyIHN0YXJ0SW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gcm93OwogICAgICAgIHZhciBzdGFydENvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIHJvdyA9IHJvdyArIDE7CiAgICAgICAgdmFyIGVuZFJvdyA9IHJvdzsKICAgICAgICB2YXIgbWF4Um93ID0gc2Vzc2lvbi5nZXRMZW5ndGgoKTsKICAgICAgICB3aGlsZSAoKytyb3cgPCBtYXhSb3cpIHsKICAgICAgICAgICAgbGluZSA9IHNlc3Npb24uZ2V0TGluZShyb3cpOwogICAgICAgICAgICB2YXIgaW5kZW50ID0gbGluZS5zZWFyY2goL1xTLyk7CiAgICAgICAgICAgIGlmIChpbmRlbnQgPT09IC0xKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChzdGFydEluZGVudCA+IGluZGVudCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB2YXIgc3ViUmFuZ2UgPSB0aGlzLmdldEZvbGRXaWRnZXRSYW5nZShzZXNzaW9uLCAiYWxsIiwgcm93KTsKICAgICAgICAgICAgaWYgKHN1YlJhbmdlKSB7CiAgICAgICAgICAgICAgICBpZiAoc3ViUmFuZ2Uuc3RhcnQucm93IDw9IHN0YXJ0Um93KSB7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmIChzdWJSYW5nZS5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgICAgICAgICAgcm93ID0gc3ViUmFuZ2UuZW5kLnJvdzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKHN0YXJ0SW5kZW50ID09IGluZGVudCkgewogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVuZFJvdyA9IHJvdzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgc2Vzc2lvbi5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgIH07CiAgICB0aGlzLmdldENvbW1lbnRSZWdpb25CbG9jayA9IGZ1bmN0aW9uIChzZXNzaW9uLCBsaW5lLCByb3cpIHsKICAgICAgICB2YXIgc3RhcnRDb2x1bW4gPSBsaW5lLnNlYXJjaCgvXHMqJC8pOwogICAgICAgIHZhciBtYXhSb3cgPSBzZXNzaW9uLmdldExlbmd0aCgpOwogICAgICAgIHZhciBzdGFydFJvdyA9IHJvdzsKICAgICAgICB2YXIgcmUgPSAvXlxzKig/OlwvXCp8XC9cL3wtLSkjPyhlbmQpP3JlZ2lvblxiLzsKICAgICAgICB2YXIgZGVwdGggPSAxOwogICAgICAgIHdoaWxlICgrK3JvdyA8IG1heFJvdykgewogICAgICAgICAgICBsaW5lID0gc2Vzc2lvbi5nZXRMaW5lKHJvdyk7CiAgICAgICAgICAgIHZhciBtID0gcmUuZXhlYyhsaW5lKTsKICAgICAgICAgICAgaWYgKCFtKQogICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgIGlmIChtWzFdKQogICAgICAgICAgICAgICAgZGVwdGgtLTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgZGVwdGgrKzsKICAgICAgICAgICAgaWYgKCFkZXB0aCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICB2YXIgZW5kUm93ID0gcm93OwogICAgICAgIGlmIChlbmRSb3cgPiBzdGFydFJvdykgewogICAgICAgICAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBsaW5lLmxlbmd0aCk7CiAgICAgICAgfQogICAgfTsKfSkuY2FsbChGb2xkTW9kZS5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uIixbInJlcXVpcmUiLCJleHBvcnRzIiwibW9kdWxlIiwiYWNlL2xpYi9vb3AiLCJhY2UvbW9kZS90ZXh0IiwiYWNlL21vZGUvanNvbl9oaWdobGlnaHRfcnVsZXMiLCJhY2UvbW9kZS9tYXRjaGluZ19icmFjZV9vdXRkZW50IiwiYWNlL21vZGUvYmVoYXZpb3VyL2NzdHlsZSIsImFjZS9tb2RlL2ZvbGRpbmcvY3N0eWxlIiwiYWNlL3dvcmtlci93b3JrZXJfY2xpZW50Il0sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi4vbGliL29vcCIpOwp2YXIgVGV4dE1vZGUgPSByZXF1aXJlKCIuL3RleHQiKS5Nb2RlOwp2YXIgSGlnaGxpZ2h0UnVsZXMgPSByZXF1aXJlKCIuL2pzb25faGlnaGxpZ2h0X3J1bGVzIikuSnNvbkhpZ2hsaWdodFJ1bGVzOwp2YXIgTWF0Y2hpbmdCcmFjZU91dGRlbnQgPSByZXF1aXJlKCIuL21hdGNoaW5nX2JyYWNlX291dGRlbnQiKS5NYXRjaGluZ0JyYWNlT3V0ZGVudDsKdmFyIENzdHlsZUJlaGF2aW91ciA9IHJlcXVpcmUoIi4vYmVoYXZpb3VyL2NzdHlsZSIpLkNzdHlsZUJlaGF2aW91cjsKdmFyIENTdHlsZUZvbGRNb2RlID0gcmVxdWlyZSgiLi9mb2xkaW5nL2NzdHlsZSIpLkZvbGRNb2RlOwp2YXIgV29ya2VyQ2xpZW50ID0gcmVxdWlyZSgiLi4vd29ya2VyL3dvcmtlcl9jbGllbnQiKS5Xb3JrZXJDbGllbnQ7CnZhciBNb2RlID0gZnVuY3Rpb24gKCkgewogICAgdGhpcy5IaWdobGlnaHRSdWxlcyA9IEhpZ2hsaWdodFJ1bGVzOwogICAgdGhpcy4kb3V0ZGVudCA9IG5ldyBNYXRjaGluZ0JyYWNlT3V0ZGVudCgpOwogICAgdGhpcy4kYmVoYXZpb3VyID0gbmV3IENzdHlsZUJlaGF2aW91cigpOwogICAgdGhpcy5mb2xkaW5nUnVsZXMgPSBuZXcgQ1N0eWxlRm9sZE1vZGUoKTsKfTsKb29wLmluaGVyaXRzKE1vZGUsIFRleHRNb2RlKTsKKGZ1bmN0aW9uICgpIHsKICAgIHRoaXMubGluZUNvbW1lbnRTdGFydCA9ICIvLyI7CiAgICB0aGlzLmJsb2NrQ29tbWVudCA9IHsgc3RhcnQ6ICIvKiIsIGVuZDogIiovIiB9OwogICAgdGhpcy5nZXROZXh0TGluZUluZGVudCA9IGZ1bmN0aW9uIChzdGF0ZSwgbGluZSwgdGFiKSB7CiAgICAgICAgdmFyIGluZGVudCA9IHRoaXMuJGdldEluZGVudChsaW5lKTsKICAgICAgICBpZiAoc3RhdGUgPT0gInN0YXJ0IikgewogICAgICAgICAgICB2YXIgbWF0Y2ggPSBsaW5lLm1hdGNoKC9eLipbXHtcKFxbXVxzKiQvKTsKICAgICAgICAgICAgaWYgKG1hdGNoKSB7CiAgICAgICAgICAgICAgICBpbmRlbnQgKz0gdGFiOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBpbmRlbnQ7CiAgICB9OwogICAgdGhpcy5jaGVja091dGRlbnQgPSBmdW5jdGlvbiAoc3RhdGUsIGxpbmUsIGlucHV0KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJG91dGRlbnQuY2hlY2tPdXRkZW50KGxpbmUsIGlucHV0KTsKICAgIH07CiAgICB0aGlzLmF1dG9PdXRkZW50ID0gZnVuY3Rpb24gKHN0YXRlLCBkb2MsIHJvdykgewogICAgICAgIHRoaXMuJG91dGRlbnQuYXV0b091dGRlbnQoZG9jLCByb3cpOwogICAgfTsKICAgIHRoaXMuY3JlYXRlV29ya2VyID0gZnVuY3Rpb24gKHNlc3Npb24pIHsKICAgICAgICB2YXIgd29ya2VyID0gbmV3IFdvcmtlckNsaWVudChbImFjZSJdLCAiYWNlL21vZGUvanNvbl93b3JrZXIiLCAiSnNvbldvcmtlciIpOwogICAgICAgIHdvcmtlci5hdHRhY2hUb0RvY3VtZW50KHNlc3Npb24uZ2V0RG9jdW1lbnQoKSk7CiAgICAgICAgd29ya2VyLm9uKCJhbm5vdGF0ZSIsIGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgIHNlc3Npb24uc2V0QW5ub3RhdGlvbnMoZS5kYXRhKTsKICAgICAgICB9KTsKICAgICAgICB3b3JrZXIub24oInRlcm1pbmF0ZSIsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgc2Vzc2lvbi5jbGVhckFubm90YXRpb25zKCk7CiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHdvcmtlcjsKICAgIH07CiAgICB0aGlzLiRpZCA9ICJhY2UvbW9kZS9qc29uIjsKfSkuY2FsbChNb2RlLnByb3RvdHlwZSk7CmV4cG9ydHMuTW9kZSA9IE1vZGU7Cgp9KTsgICAgICAgICAgICAgICAgKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgICAgIGFjZS5yZXF1aXJlKFsiYWNlL21vZGUvanNvbiJdLCBmdW5jdGlvbihtKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgbW9kdWxlID09ICJvYmplY3QiICYmIHR5cGVvZiBleHBvcnRzID09ICJvYmplY3QiICYmIG1vZHVsZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBtOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9KSgpOwogICAgICAgICAgICA=",workerJsonUrl="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBjb21wYXJlUG9pbnRzID0gZnVuY3Rpb24gKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IGZ1bmN0aW9uIChzdGFydFJvdywgc3RhcnRDb2x1bW4sIGVuZFJvdywgZW5kQ29sdW1uKSB7CiAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgIHJvdzogc3RhcnRSb3csCiAgICAgICAgY29sdW1uOiBzdGFydENvbHVtbgogICAgfTsKICAgIHRoaXMuZW5kID0gewogICAgICAgIHJvdzogZW5kUm93LAogICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICB9Owp9OwooZnVuY3Rpb24gKCkgewogICAgdGhpcy5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIHRoaXMudG9TdHJpbmcgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuICgiUmFuZ2U6IFsiICsgdGhpcy5zdGFydC5yb3cgKyAiLyIgKyB0aGlzLnN0YXJ0LmNvbHVtbiArCiAgICAgICAgICAgICJdIC0+IFsiICsgdGhpcy5lbmQucm93ICsgIi8iICsgdGhpcy5lbmQuY29sdW1uICsgIl0iKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMDsKICAgIH07CiAgICB0aGlzLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlUG9pbnQgPSBmdW5jdGlvbiAocCkgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocC5yb3csIHAuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmNvbnRhaW5zUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlUG9pbnQocmFuZ2Uuc3RhcnQpID09IDAgJiYgdGhpcy5jb21wYXJlUG9pbnQocmFuZ2UuZW5kKSA9PSAwOwogICAgfTsKICAgIHRoaXMuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIHRoaXMuaXNFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuaXNTdGFydCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uOwogICAgfTsKICAgIHRoaXMuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5zZXRFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uOwogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3cucm93OwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5lbmQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuaW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuY29tcGFyZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICghdGhpcy5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gY29sdW1uIDwgdGhpcy5zdGFydC5jb2x1bW4gPyAtMSA6IChjb2x1bW4gPiB0aGlzLmVuZC5jb2x1bW4gPyAxIDogMCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuc3RhcnQucm93KQogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgaWYgKHJvdyA+IHRoaXMuZW5kLnJvdykKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09PSByb3cpCiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uIDw9IHRoaXMuZW5kLmNvbHVtbiA/IDAgOiAxOwogICAgICAgIHJldHVybiAwOwogICAgfTsKICAgIHRoaXMuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuY29tcGFyZUVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlSW5zaWRlID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAodGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5leHRlbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgY21wID0gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICBpZiAoY21wID09IDApCiAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgIGVsc2UgaWYgKGNtcCA9PSAtMSkKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHZhciBlbmQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5pc0VtcHR5ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgPT09IHRoaXMuZW5kLnJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PT0gdGhpcy5lbmQuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgdGhpcy5jbG9uZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gUmFuZ2UuZnJvbVBvaW50cyh0aGlzLnN0YXJ0LCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5jb2xsYXBzZVJvd3MgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLmNvbHVtbiA9PSAwKQogICAgICAgICAgICByZXR1cm4gbmV3IFJhbmdlKHRoaXMuc3RhcnQucm93LCAwLCBNYXRoLm1heCh0aGlzLnN0YXJ0LnJvdywgdGhpcy5lbmQucm93IC0gMSksIDApOwogICAgICAgIGVsc2UKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgdGhpcy5lbmQucm93LCAwKTsKICAgIH07CiAgICB0aGlzLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgdGhpcy5tb3ZlQnkgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0LnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gKz0gY29sdW1uOwogICAgICAgIHRoaXMuZW5kLnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5lbmQuY29sdW1uICs9IGNvbHVtbjsKICAgIH07Cn0pLmNhbGwoUmFuZ2UucHJvdG90eXBlKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7ClJhbmdlLmNvbXBhcmVQb2ludHMgPSBmdW5jdGlvbiAocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKZXhwb3J0cy5SYW5nZSA9IFJhbmdlOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvYW5jaG9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuL2xpYi9vb3AiKTsKdmFyIEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoIi4vbGliL2V2ZW50X2VtaXR0ZXIiKS5FdmVudEVtaXR0ZXI7CnZhciBBbmNob3IgPSBleHBvcnRzLkFuY2hvciA9IGZ1bmN0aW9uIChkb2MsIHJvdywgY29sdW1uKSB7CiAgICB0aGlzLiRvbkNoYW5nZSA9IHRoaXMub25DaGFuZ2UuYmluZCh0aGlzKTsKICAgIHRoaXMuYXR0YWNoKGRvYyk7CiAgICBpZiAodHlwZW9mIGNvbHVtbiA9PSAidW5kZWZpbmVkIikKICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdy5yb3csIHJvdy5jb2x1bW4pOwogICAgZWxzZQogICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LCBjb2x1bW4pOwp9OwooZnVuY3Rpb24gKCkgewogICAgb29wLmltcGxlbWVudCh0aGlzLCBFdmVudEVtaXR0ZXIpOwogICAgdGhpcy5nZXRQb3NpdGlvbiA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCh0aGlzLnJvdywgdGhpcy5jb2x1bW4pOwogICAgfTsKICAgIHRoaXMuZ2V0RG9jdW1lbnQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQ7CiAgICB9OwogICAgdGhpcy4kaW5zZXJ0UmlnaHQgPSBmYWxzZTsKICAgIHRoaXMub25DaGFuZ2UgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIHBvaW50ID0gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHsgcm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbiB9LCB0aGlzLiRpbnNlcnRSaWdodCk7CiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihwb2ludC5yb3csIHBvaW50LmNvbHVtbiwgdHJ1ZSk7CiAgICB9OwogICAgZnVuY3Rpb24gJHBvaW50c0luT3JkZXIocG9pbnQxLCBwb2ludDIsIGVxdWFsUG9pbnRzSW5PcmRlcikgewogICAgICAgIHZhciBiQ29sSXNBZnRlciA9IGVxdWFsUG9pbnRzSW5PcmRlciA/IHBvaW50MS5jb2x1bW4gPD0gcG9pbnQyLmNvbHVtbiA6IHBvaW50MS5jb2x1bW4gPCBwb2ludDIuY29sdW1uOwogICAgICAgIHJldHVybiAocG9pbnQxLnJvdyA8IHBvaW50Mi5yb3cpIHx8IChwb2ludDEucm93ID09IHBvaW50Mi5yb3cgJiYgYkNvbElzQWZ0ZXIpOwogICAgfQogICAgZnVuY3Rpb24gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHBvaW50LCBtb3ZlSWZFcXVhbCkgewogICAgICAgIHZhciBkZWx0YUlzSW5zZXJ0ID0gZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiOwogICAgICAgIHZhciBkZWx0YVJvd1NoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5yb3cgLSBkZWx0YS5zdGFydC5yb3cpOwogICAgICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgICAgIHZhciBkZWx0YVN0YXJ0ID0gZGVsdGEuc3RhcnQ7CiAgICAgICAgdmFyIGRlbHRhRW5kID0gZGVsdGFJc0luc2VydCA/IGRlbHRhU3RhcnQgOiBkZWx0YS5lbmQ7IC8vIENvbGxhcHNlIGluc2VydCByYW5nZS4KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgcm93OiBwb2ludC5yb3csCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICByb3c6IHBvaW50LnJvdyArIGRlbHRhUm93U2hpZnQsCiAgICAgICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogZGVsdGFTdGFydC5yb3csCiAgICAgICAgICAgIGNvbHVtbjogZGVsdGFTdGFydC5jb2x1bW4KICAgICAgICB9OwogICAgfQogICAgdGhpcy5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICB0aGlzLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIHRoaXMuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBwb3MgPSB7fTsKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KICAgICAgICBpZiAoY29sdW1uIDwgMCkKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgcmV0dXJuIHBvczsKICAgIH07Cn0pLmNhbGwoQW5jaG9yLnByb3RvdHlwZSk7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9kb2N1bWVudCIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi9saWIvb29wIik7CnZhciBhcHBseURlbHRhID0gcmVxdWlyZSgiLi9hcHBseV9kZWx0YSIpLmFwcGx5RGVsdGE7CnZhciBFdmVudEVtaXR0ZXIgPSByZXF1aXJlKCIuL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwp2YXIgUmFuZ2UgPSByZXF1aXJlKCIuL3JhbmdlIikuUmFuZ2U7CnZhciBBbmNob3IgPSByZXF1aXJlKCIuL2FuY2hvciIpLkFuY2hvcjsKdmFyIERvY3VtZW50ID0gZnVuY3Rpb24gKHRleHRPckxpbmVzKSB7CiAgICB0aGlzLiRsaW5lcyA9IFsiIl07CiAgICBpZiAodGV4dE9yTGluZXMubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgfQogICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheSh0ZXh0T3JMaW5lcykpIHsKICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiAwLCBjb2x1bW46IDAgfSwgdGV4dE9yTGluZXMpOwogICAgfQogICAgZWxzZSB7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICB9Cn07CihmdW5jdGlvbiAoKSB7CiAgICBvb3AuaW1wbGVtZW50KHRoaXMsIEV2ZW50RW1pdHRlcik7CiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbGVuID0gdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdGhpcy5yZW1vdmUobmV3IFJhbmdlKDAsIDAsIGxlbiwgdGhpcy5nZXRMaW5lKGxlbikubGVuZ3RoKSk7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0IHx8ICIiKTsKICAgIH07CiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldEFsbExpbmVzKCkuam9pbih0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIoKSk7CiAgICB9OwogICAgdGhpcy5jcmVhdGVBbmNob3IgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gbmV3IEFuY2hvcih0aGlzLCByb3csIGNvbHVtbik7CiAgICB9OwogICAgaWYgKCJhYWEiLnNwbGl0KC9hLykubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kc3BsaXQgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgICAgICByZXR1cm4gdGV4dC5yZXBsYWNlKC9cclxufFxyL2csICJcbiIpLnNwbGl0KCJcbiIpOwogICAgICAgIH07CiAgICB9CiAgICBlbHNlIHsKICAgICAgICB0aGlzLiRzcGxpdCA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgICAgIHJldHVybiB0ZXh0LnNwbGl0KC9cclxufFxyfFxuLyk7CiAgICAgICAgfTsKICAgIH0KICAgIHRoaXMuJGRldGVjdE5ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHZhciBtYXRjaCA9IHRleHQubWF0Y2goL14uKj8oXHJcbnxccnxcbikvbSk7CiAgICAgICAgdGhpcy4kYXV0b05ld0xpbmUgPSBtYXRjaCA/IG1hdGNoWzFdIDogIlxuIjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyID0gZnVuY3Rpb24gKCkgewogICAgICAgIHN3aXRjaCAodGhpcy4kbmV3TGluZU1vZGUpIHsKICAgICAgICAgICAgY2FzZSAid2luZG93cyI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxyXG4iOwogICAgICAgICAgICBjYXNlICJ1bml4IjoKICAgICAgICAgICAgICAgIHJldHVybiAiXG4iOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGF1dG9OZXdMaW5lIHx8ICJcbiI7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJGF1dG9OZXdMaW5lID0gIiI7CiAgICB0aGlzLiRuZXdMaW5lTW9kZSA9ICJhdXRvIjsKICAgIHRoaXMuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgdGhpcy5nZXROZXdMaW5lTW9kZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kbmV3TGluZU1vZGU7CiAgICB9OwogICAgdGhpcy5pc05ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHJldHVybiAodGV4dCA9PSAiXHJcbiIgfHwgdGV4dCA9PSAiXHIiIHx8IHRleHQgPT0gIlxuIik7CiAgICB9OwogICAgdGhpcy5nZXRMaW5lID0gZnVuY3Rpb24gKHJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lc1tyb3ddIHx8ICIiOwogICAgfTsKICAgIHRoaXMuZ2V0TGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICByZXR1cm4gdGhpcy4kbGluZXMuc2xpY2UoZmlyc3RSb3csIGxhc3RSb3cgKyAxKTsKICAgIH07CiAgICB0aGlzLmdldEFsbExpbmVzID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzKDAsIHRoaXMuZ2V0TGVuZ3RoKCkpOwogICAgfTsKICAgIHRoaXMuZ2V0TGVuZ3RoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICB9OwogICAgdGhpcy5nZXRUZXh0UmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHJhbmdlKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICB0aGlzLmdldExpbmVzRm9yUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgaWYgKHJhbmdlLnN0YXJ0LnJvdyA9PT0gcmFuZ2UuZW5kLnJvdykgewogICAgICAgICAgICBsaW5lcyA9IFt0aGlzLmdldExpbmUocmFuZ2Uuc3RhcnQucm93KS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uLCByYW5nZS5lbmQuY29sdW1uKV07CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IHRoaXMuZ2V0TGluZXMocmFuZ2Uuc3RhcnQucm93LCByYW5nZS5lbmQucm93KTsKICAgICAgICAgICAgbGluZXNbMF0gPSAobGluZXNbMF0gfHwgIiIpLnN1YnN0cmluZyhyYW5nZS5zdGFydC5jb2x1bW4pOwogICAgICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIDE7CiAgICAgICAgICAgIGlmIChyYW5nZS5lbmQucm93IC0gcmFuZ2Uuc3RhcnQucm93ID09IGwpCiAgICAgICAgICAgICAgICBsaW5lc1tsXSA9IGxpbmVzW2xdLnN1YnN0cmluZygwLCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGxpbmVzOwogICAgfTsKICAgIHRoaXMuaW5zZXJ0TGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUxpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQucmVtb3ZlTGluZXMgaXMgZGVwcmVjYXRlZC4gVXNlIHRoZSByZW1vdmVGdWxsTGluZXMgbWV0aG9kIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMucmVtb3ZlRnVsbExpbmVzKGZpcnN0Um93LCBsYXN0Um93KTsKICAgIH07CiAgICB0aGlzLmluc2VydE5ld0xpbmUgPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5pbnNlcnROZXdMaW5lIGlzIGRlcHJlY2F0ZWQuIFVzZSBpbnNlcnRNZXJnZWRMaW5lcyhwb3NpdGlvbiwgWycnLCAnJ10pIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsiIiwgIiJdKTsKICAgIH07CiAgICB0aGlzLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICB0aGlzLmluc2VydEluTGluZSA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMucG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uICsgdGV4dC5sZW5ndGgpOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBbdGV4dF0KICAgICAgICB9LCB0cnVlKTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMuY2xpcHBlZFBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcm93ID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93ID49IGxlbmd0aCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGggLSAxOwogICAgICAgICAgICBjb2x1bW4gPSB1bmRlZmluZWQ7CiAgICAgICAgfQogICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHJvdyk7CiAgICAgICAgaWYgKGNvbHVtbiA9PSB1bmRlZmluZWQpCiAgICAgICAgICAgIGNvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIGNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KGNvbHVtbiwgMCksIGxpbmUubGVuZ3RoKTsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgdGhpcy5wb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICB0aGlzLiRjbGlwUG9zaXRpb24gPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocG9zaXRpb24ucm93ID49IGxlbmd0aCkgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBsZW5ndGggLSAxKTsKICAgICAgICAgICAgcG9zaXRpb24uY29sdW1uID0gdGhpcy5nZXRMaW5lKGxlbmd0aCAtIDEpLmxlbmd0aDsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KHBvc2l0aW9uLmNvbHVtbiwgMCksIHRoaXMuZ2V0TGluZShwb3NpdGlvbi5yb3cpLmxlbmd0aCk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBwb3NpdGlvbjsKICAgIH07CiAgICB0aGlzLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzID0gZnVuY3Rpb24gKHBvc2l0aW9uLCBsaW5lcykgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHsKICAgICAgICAgICAgcm93OiBzdGFydC5yb3cgKyBsaW5lcy5sZW5ndGggLSAxLAogICAgICAgICAgICBjb2x1bW46IChsaW5lcy5sZW5ndGggPT0gMSA/IHN0YXJ0LmNvbHVtbiA6IDApICsgbGluZXNbbGluZXMubGVuZ3RoIC0gMV0ubGVuZ3RoCiAgICAgICAgfTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJpbnNlcnQiLAogICAgICAgICAgICBsaW5lczogbGluZXMKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhlbmQpOwogICAgfTsKICAgIHRoaXMucmVtb3ZlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLmVuZC5yb3csIHJhbmdlLmVuZC5jb2x1bW4pOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2UoeyBzdGFydDogc3RhcnQsIGVuZDogZW5kIH0pCiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3Moc3RhcnQpOwogICAgfTsKICAgIHRoaXMucmVtb3ZlSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGZpcnN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgZmlyc3RSb3cpLCB0aGlzLmdldExlbmd0aCgpIC0gMSk7CiAgICAgICAgbGFzdFJvdyA9IE1hdGgubWluKE1hdGgubWF4KDAsIGxhc3RSb3cpLCB0aGlzLmdldExlbmd0aCgpIC0gMSk7CiAgICAgICAgdmFyIGRlbGV0ZUZpcnN0TmV3TGluZSA9IGxhc3RSb3cgPT0gdGhpcy5nZXRMZW5ndGgoKSAtIDEgJiYgZmlyc3RSb3cgPiAwOwogICAgICAgIHZhciBkZWxldGVMYXN0TmV3TGluZSA9IGxhc3RSb3cgPCB0aGlzLmdldExlbmd0aCgpIC0gMTsKICAgICAgICB2YXIgc3RhcnRSb3cgPSAoZGVsZXRlRmlyc3ROZXdMaW5lID8gZmlyc3RSb3cgLSAxIDogZmlyc3RSb3cpOwogICAgICAgIHZhciBzdGFydENvbCA9IChkZWxldGVGaXJzdE5ld0xpbmUgPyB0aGlzLmdldExpbmUoc3RhcnRSb3cpLmxlbmd0aCA6IDApOwogICAgICAgIHZhciBlbmRSb3cgPSAoZGVsZXRlTGFzdE5ld0xpbmUgPyBsYXN0Um93ICsgMSA6IGxhc3RSb3cpOwogICAgICAgIHZhciBlbmRDb2wgPSAoZGVsZXRlTGFzdE5ld0xpbmUgPyAwIDogdGhpcy5nZXRMaW5lKGVuZFJvdykubGVuZ3RoKTsKICAgICAgICB2YXIgcmFuZ2UgPSBuZXcgUmFuZ2Uoc3RhcnRSb3csIHN0YXJ0Q29sLCBlbmRSb3csIGVuZENvbCk7CiAgICAgICAgdmFyIGRlbGV0ZWRMaW5lcyA9IHRoaXMuJGxpbmVzLnNsaWNlKGZpcnN0Um93LCBsYXN0Um93ICsgMSk7CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHJhbmdlLnN0YXJ0LAogICAgICAgICAgICBlbmQ6IHJhbmdlLmVuZCwKICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgbGluZXM6IHRoaXMuZ2V0TGluZXNGb3JSYW5nZShyYW5nZSkKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gZGVsZXRlZExpbmVzOwogICAgfTsKICAgIHRoaXMucmVtb3ZlTmV3TGluZSA9IGZ1bmN0aW9uIChyb3cpIHsKICAgICAgICBpZiAocm93IDwgdGhpcy5nZXRMZW5ndGgoKSAtIDEgJiYgcm93ID49IDApIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3csIHRoaXMuZ2V0TGluZShyb3cpLmxlbmd0aCksCiAgICAgICAgICAgICAgICBlbmQ6IHRoaXMucG9zKHJvdyArIDEsIDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgICAgIGxpbmVzOiBbIiIsICIiXQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7CiAgICAgICAgaWYgKCEocmFuZ2UgaW5zdGFuY2VvZiBSYW5nZSkpCiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhyYW5nZS5zdGFydCwgcmFuZ2UuZW5kKTsKICAgICAgICBpZiAodGV4dC5sZW5ndGggPT09IDAgJiYgcmFuZ2UuaXNFbXB0eSgpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgaWYgKHRleHQgPT0gdGhpcy5nZXRUZXh0UmFuZ2UocmFuZ2UpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2UuZW5kOwogICAgICAgIHRoaXMucmVtb3ZlKHJhbmdlKTsKICAgICAgICB2YXIgZW5kOwogICAgICAgIGlmICh0ZXh0KSB7CiAgICAgICAgICAgIGVuZCA9IHRoaXMuaW5zZXJ0KHJhbmdlLnN0YXJ0LCB0ZXh0KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGVuZCA9IHJhbmdlLnN0YXJ0OwogICAgICAgIH0KICAgICAgICByZXR1cm4gZW5kOwogICAgfTsKICAgIHRoaXMuYXBwbHlEZWx0YXMgPSBmdW5jdGlvbiAoZGVsdGFzKSB7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkZWx0YXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhc1tpXSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGFzID0gZnVuY3Rpb24gKGRlbHRhcykgewogICAgICAgIGZvciAodmFyIGkgPSBkZWx0YXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICAgICAgdGhpcy5yZXZlcnREZWx0YShkZWx0YXNbaV0pOwogICAgICAgIH0KICAgIH07CiAgICB0aGlzLmFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgICAgICB2YXIgaXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgaWYgKGlzSW5zZXJ0ID8gZGVsdGEubGluZXMubGVuZ3RoIDw9IDEgJiYgIWRlbHRhLmxpbmVzWzBdCiAgICAgICAgICAgIDogIVJhbmdlLmNvbXBhcmVQb2ludHMoZGVsdGEuc3RhcnQsIGRlbHRhLmVuZCkpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNJbnNlcnQgJiYgZGVsdGEubGluZXMubGVuZ3RoID4gMjAwMDApIHsKICAgICAgICAgICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEoZGVsdGEsIDIwMDAwKTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGFwcGx5RGVsdGEodGhpcy4kbGluZXMsIGRlbHRhLCBkb05vdFZhbGlkYXRlKTsKICAgICAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2UiLCBkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJHNhZmVBcHBseURlbHRhID0gZnVuY3Rpb24gKGRlbHRhKSB7CiAgICAgICAgdmFyIGRvY0xlbmd0aCA9IHRoaXMuJGxpbmVzLmxlbmd0aDsKICAgICAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmIGRlbHRhLnN0YXJ0LnJvdyA8IGRvY0xlbmd0aCAmJiBkZWx0YS5lbmQucm93IDwgZG9jTGVuZ3RoCiAgICAgICAgICAgIHx8IGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiAmJiBkZWx0YS5zdGFydC5yb3cgPD0gZG9jTGVuZ3RoKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuJHNwbGl0QW5kYXBwbHlMYXJnZURlbHRhID0gZnVuY3Rpb24gKGRlbHRhLCBNQVgpIHsKICAgICAgICB2YXIgbGluZXMgPSBkZWx0YS5saW5lczsKICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIE1BWCArIDE7CiAgICAgICAgdmFyIHJvdyA9IGRlbHRhLnN0YXJ0LnJvdzsKICAgICAgICB2YXIgY29sdW1uID0gZGVsdGEuc3RhcnQuY29sdW1uOwogICAgICAgIGZvciAodmFyIGZyb20gPSAwLCB0byA9IDA7IGZyb20gPCBsOyBmcm9tID0gdG8pIHsKICAgICAgICAgICAgdG8gKz0gTUFYIC0gMTsKICAgICAgICAgICAgdmFyIGNodW5rID0gbGluZXMuc2xpY2UoZnJvbSwgdG8pOwogICAgICAgICAgICBjaHVuay5wdXNoKCIiKTsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3cgKyBmcm9tLCBjb2x1bW4pLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyB0bywgY29sdW1uID0gMCksCiAgICAgICAgICAgICAgICBhY3Rpb246IGRlbHRhLmFjdGlvbiwKICAgICAgICAgICAgICAgIGxpbmVzOiBjaHVuawogICAgICAgICAgICB9LCB0cnVlKTsKICAgICAgICB9CiAgICAgICAgZGVsdGEubGluZXMgPSBsaW5lcy5zbGljZShmcm9tKTsKICAgICAgICBkZWx0YS5zdGFydC5yb3cgPSByb3cgKyBmcm9tOwogICAgICAgIGRlbHRhLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGEsIHRydWUpOwogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJyZW1vdmUiIDogImluc2VydCIpLAogICAgICAgICAgICBsaW5lczogZGVsdGEubGluZXMuc2xpY2UoKQogICAgICAgIH0pOwogICAgfTsKICAgIHRoaXMuaW5kZXhUb1Bvc2l0aW9uID0gZnVuY3Rpb24gKGluZGV4LCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICBmb3IgKHZhciBpID0gc3RhcnRSb3cgfHwgMCwgbCA9IGxpbmVzLmxlbmd0aDsgaSA8IGw7IGkrKykgewogICAgICAgICAgICBpbmRleCAtPSBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoOwogICAgICAgICAgICBpZiAoaW5kZXggPCAwKQogICAgICAgICAgICAgICAgcmV0dXJuIHsgcm93OiBpLCBjb2x1bW46IGluZGV4ICsgbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aCB9OwogICAgICAgIH0KICAgICAgICByZXR1cm4geyByb3c6IGwgLSAxLCBjb2x1bW46IGluZGV4ICsgbGluZXNbbCAtIDFdLmxlbmd0aCArIG5ld2xpbmVMZW5ndGggfTsKICAgIH07CiAgICB0aGlzLnBvc2l0aW9uVG9JbmRleCA9IGZ1bmN0aW9uIChwb3MsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIHZhciBpbmRleCA9IDA7CiAgICAgICAgdmFyIHJvdyA9IE1hdGgubWluKHBvcy5yb3csIGxpbmVzLmxlbmd0aCk7CiAgICAgICAgZm9yICh2YXIgaSA9IHN0YXJ0Um93IHx8IDA7IGkgPCByb3c7ICsraSkKICAgICAgICAgICAgaW5kZXggKz0gbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aDsKICAgICAgICByZXR1cm4gaW5kZXggKyBwb3MuY29sdW1uOwogICAgfTsKfSkuY2FsbChEb2N1bWVudC5wcm90b3R5cGUpOwpleHBvcnRzLkRvY3VtZW50ID0gRG9jdW1lbnQ7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvbGFuZyIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpleHBvcnRzLmxhc3QgPSBmdW5jdGlvbiAoYSkgewogICAgcmV0dXJuIGFbYS5sZW5ndGggLSAxXTsKfTsKZXhwb3J0cy5zdHJpbmdSZXZlcnNlID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5zcGxpdCgiIikucmV2ZXJzZSgpLmpvaW4oIiIpOwp9OwpleHBvcnRzLnN0cmluZ1JlcGVhdCA9IGZ1bmN0aW9uIChzdHJpbmcsIGNvdW50KSB7CiAgICB2YXIgcmVzdWx0ID0gJyc7CiAgICB3aGlsZSAoY291bnQgPiAwKSB7CiAgICAgICAgaWYgKGNvdW50ICYgMSkKICAgICAgICAgICAgcmVzdWx0ICs9IHN0cmluZzsKICAgICAgICBpZiAoY291bnQgPj49IDEpCiAgICAgICAgICAgIHN0cmluZyArPSBzdHJpbmc7CiAgICB9CiAgICByZXR1cm4gcmVzdWx0Owp9Owp2YXIgdHJpbUJlZ2luUmVnZXhwID0gL15cc1xzKi87CnZhciB0cmltRW5kUmVnZXhwID0gL1xzXHMqJC87CmV4cG9ydHMuc3RyaW5nVHJpbUxlZnQgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UodHJpbUJlZ2luUmVnZXhwLCAnJyk7Cn07CmV4cG9ydHMuc3RyaW5nVHJpbVJpZ2h0ID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKHRyaW1FbmRSZWdleHAsICcnKTsKfTsKZXhwb3J0cy5jb3B5T2JqZWN0ID0gZnVuY3Rpb24gKG9iaikgewogICAgdmFyIGNvcHkgPSB7fTsKICAgIGZvciAodmFyIGtleSBpbiBvYmopIHsKICAgICAgICBjb3B5W2tleV0gPSBvYmpba2V5XTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmNvcHlBcnJheSA9IGZ1bmN0aW9uIChhcnJheSkgewogICAgdmFyIGNvcHkgPSBbXTsKICAgIGZvciAodmFyIGkgPSAwLCBsID0gYXJyYXkubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgaWYgKGFycmF5W2ldICYmIHR5cGVvZiBhcnJheVtpXSA9PSAib2JqZWN0IikKICAgICAgICAgICAgY29weVtpXSA9IHRoaXMuY29weU9iamVjdChhcnJheVtpXSk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBjb3B5W2ldID0gYXJyYXlbaV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24gKGFycmF5LCB2YWx1ZSkgewogICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAodmFsdWUgPT09IGFycmF5W2ldKSB7CiAgICAgICAgICAgIGFycmF5LnNwbGljZShpLCAxKTsKICAgICAgICB9CiAgICB9Cn07CmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8oWy4qKz9eJHt9KCl8W1xdXC9cXF0pL2csICdcXCQxJyk7Cn07CmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHJldHVybiAoIiIgKyBzdHIpLnJlcGxhY2UoLyYvZywgIiYjMzg7IikucmVwbGFjZSgvIi9nLCAiJiMzNDsiKS5yZXBsYWNlKC8nL2csICImIzM5OyIpLnJlcGxhY2UoLzwvZywgIiYjNjA7Iik7Cn07CmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24gKHN0cmluZywgcmVnRXhwKSB7CiAgICB2YXIgbWF0Y2hlcyA9IFtdOwogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbiAoc3RyKSB7CiAgICAgICAgbWF0Y2hlcy5wdXNoKHsKICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwogICAgcmV0dXJuIG1hdGNoZXM7Cn07CmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBkZWZlcnJlZC5jYW5jZWwoKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgMCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gZGVmZXJyZWQ7Cn07CmV4cG9ydHMuZGVsYXllZENhbGwgPSBmdW5jdGlvbiAoZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBpZiAodGltZXIgPT0gbnVsbCkKICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGNhbGxiYWNrLCB0aW1lb3V0IHx8IGRlZmF1bHRUaW1lb3V0KTsKICAgIH07CiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uICh0aW1lb3V0KSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLnNjaGVkdWxlID0gX3NlbGY7CiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyICYmIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgfTsKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwogICAgcmV0dXJuIF9zZWxmOwp9OwoKfSk7CgphY2UuZGVmaW5lKCJhY2Uvd29ya2VyL21pcnJvciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSkgewoidXNlIHN0cmljdCI7Cgp2YXIgRG9jdW1lbnQgPSByZXF1aXJlKCIuLi9kb2N1bWVudCIpLkRvY3VtZW50Owp2YXIgbGFuZyA9IHJlcXVpcmUoIi4uL2xpYi9sYW5nIik7CiAgICAKdmFyIE1pcnJvciA9IGV4cG9ydHMuTWlycm9yID0gZnVuY3Rpb24oc2VuZGVyKSB7CiAgICB0aGlzLnNlbmRlciA9IHNlbmRlcjsKICAgIHZhciBkb2MgPSB0aGlzLmRvYyA9IG5ldyBEb2N1bWVudCgiIik7CiAgICAKICAgIHZhciBkZWZlcnJlZFVwZGF0ZSA9IHRoaXMuZGVmZXJyZWRVcGRhdGUgPSBsYW5nLmRlbGF5ZWRDYWxsKHRoaXMub25VcGRhdGUuYmluZCh0aGlzKSk7CiAgICAKICAgIHZhciBfc2VsZiA9IHRoaXM7CiAgICBzZW5kZXIub24oImNoYW5nZSIsIGZ1bmN0aW9uKGUpIHsKICAgICAgICB2YXIgZGF0YSA9IGUuZGF0YTsKICAgICAgICBpZiAoZGF0YVswXS5zdGFydCkgewogICAgICAgICAgICBkb2MuYXBwbHlEZWx0YXMoZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICB2YXIgZCwgZXJyOyAKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGFbaSsxXSkpIHsKICAgICAgICAgICAgICAgICAgICBkID0ge2FjdGlvbjogImluc2VydCIsIHN0YXJ0OiBkYXRhW2ldLCBsaW5lczogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJyZW1vdmUiLCBzdGFydDogZGF0YVtpXSwgZW5kOiBkYXRhW2krMV19OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoKGQuYWN0aW9uID09ICJpbnNlcnQiID8gZC5zdGFydCA6IGQuZW5kKS5yb3cgPj0gZG9jLiRsaW5lcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICBlcnIgPSBuZXcgRXJyb3IoIkludmFsaWQgZGVsdGEiKTsKICAgICAgICAgICAgICAgICAgICBlcnIuZGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogX3NlbGYuJHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzTGVuZ3RoOiBkb2MuJGxpbmVzLmxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGQuc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogZC5lbmQKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIHRocm93IGVycjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg==";ace.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl);const _sfc_main$w=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(r,{emit:n}){const i=r,o=vue.ref(!1),a=vue.computed({get(){return i.lang==="json"?JSON.stringify(i.modelValue,null,2):i.modelValue},set(u){i.lang==="json"?n("update:modelValue",JSON.parse(u)):n("update:modelValue",u)}});return(u,c)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:c[0]||(c[0]=f=>o.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(o),"onUpdate:modelValue":c[2]||(c[2]=f=>vue.isRef(o)?o.value=f:null),title:i.title,width:"60%",onClose:c[3]||(c[3]=f=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(a),"onUpdate:value":c[1]||(c[1]=f=>vue.isRef(a)?a.value=f:null),lang:i.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$b={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$8={key:1},_hoisted_3$7={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$v=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(r,{emit:n}){const i=r,o=vue.computed(()=>{var d;const u={};let c=0,f=[];for(let h of Object.keys(i.objInfo)){const v=(d=i.objInfo[h])==null?void 0:d.sort;if(v){const g=Number(v);g>c&&(c=g)}if(v)u[v]=h;else return Object.keys(i.objInfo).map(g=>({...i.objInfo[g],_key:g}))}for(let h=0;h<c+1;h++){const v=String(h);f.push({...i.objInfo[u[v]],_key:u[v]})}return f});function a(u){let c=window.setTimeout(function(){n("change",u),clearTimeout(c),c=null},200)}return(u,c)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),f=>(vue.openBlock(),vue.createElementBlock("div",{key:f._key},[i.code?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f._key))>78?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:String(f._key),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$b,vue.toDisplayString(f._key),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$8,vue.toDisplayString(f._key),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(f.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTooltip),{key:0,content:JSON.stringify(f.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$7,vue.toDisplayString(f.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString(f.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),i.hide.indexOf(String(f._key))<0?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:f.title,size:"small"},{default:vue.withCtx(()=>[f.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSelect),{key:0,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,placeholder:"Select",size:"small",disabled:!!(f!=null&&f.disabled),onChange:a},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(f.options,d=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInputNumber),{key:1,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:2,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElInput),{key:3,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,autosize:"",type:"textarea",disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElColorPicker),{key:4,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElSwitch),{key:5,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onChange:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):f.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$w,{key:6,modelValue:i.objInfo[f._key].val,"onUpdate:modelValue":d=>i.objInfo[f._key].val=d,disabled:!!(f!=null&&f.disabled),onClose:a},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_b2819020_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc$1(_sfc_main$v,[["__scopeId","data-v-b2819020"]]),_hoisted_1$a={style:{height:"100%"}},_hoisted_2$7={class:"flex flex-wrap"},_hoisted_3$6=["onMouseenter","onClick"],_sfc_main$u=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(r,{emit:n}){const i=r,o=vue.ref(i.val),a=vue.ref(!1),u=vue.ref("进入"),c=vue.ref(null),f=d=>{n("updateCommonAniVal",d),a.value=!1};return vue.watch(()=>i.val,d=>{o.value=d}),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.unref(o)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:0,closable:"",onClose:h[0]||(h[0]=v=>f("")),onClick:h[1]||(h[1]=v=>a.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var v;return[vue.createTextVNode(vue.toDisplayString((v=vue.unref(common_animate_list).map(g=>g.children).reduce((g,p)=>g.concat(p)).find(g=>g.value==vue.unref(o)))==null?void 0:v.label)+" ",1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:h[2]||(h[2]=v=>a.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(elementPlus.ElDrawer),{modelValue:vue.unref(a),"onUpdate:modelValue":h[5]||(h[5]=v=>vue.isRef(a)?a.value=v:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabs),{modelValue:vue.unref(u),"onUpdate:modelValue":h[4]||(h[4]=v=>vue.isRef(u)?u.value=v:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabPane),{label:v.label,name:v.label,key:v.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$7,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(v.children,(g,p)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:p,onMouseenter:y=>c.value=p,onMouseleave:h[3]||(h[3]=y=>c.value=null),onClick:y=>f(g.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref(c)==p?`animate__animated animate__${g.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(g.label),3)],40,_hoisted_3$6))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc$1(_sfc_main$u,[["__scopeId","data-v-2668f60c"]]),_sfc_main$t=vue.defineComponent({__name:"component-tree",setup(r){const n=useGlobalStore(pinia),i=vue.computed(()=>{var u;return((u=n.handle_svg_info)==null?void 0:u.info.id)??""}),o=u=>{for(let c of n.done_json)c.selected=!1,c.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(u)},a={children:"children",label:"title"};return(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:a,onNodeClick:o,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(i),"node-key":"id","current-node-key":vue.unref(i)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=r=>(vue.pushScopeId("data-v-98320511"),r=r(),vue.popScopeId(),r),_hoisted_1$9={class:"wall-l"},_hoisted_2$6={class:"head-l"},_hoisted_3$5=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$s=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=()=>{o.value.push({key:"",val:""})},u=c=>{o.value.splice(c,1)};return(c,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$6,[_hoisted_3$5,_hoisted_4$2,vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:a},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(o),(d,h)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.key,"onUpdate:modelValue":v=>d.key=v,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElInput),{class:"content-l",modelValue:d.val,"onUpdate:modelValue":v=>d.val=v,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:v=>u(h)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc$1(_sfc_main$s,[["__scopeId","data-v-98320511"]]),composeEventHandlers=(r,n,{checkForDefaultPrevented:i=!0}={})=>a=>{const u=r==null?void 0:r(a);if(i===!1||!u)return n==null?void 0:n(a)};var _a;const isClient=typeof window<"u",isString$1=r=>typeof r=="string",noop=()=>{},isIOS=isClient&&((_a=window==null?void 0:window.navigator)==null?void 0:_a.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function resolveUnref(r){return typeof r=="function"?r():vue.unref(r)}function createFilterWrapper(r,n){function i(...o){return new Promise((a,u)=>{Promise.resolve(r(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})).then(a).catch(u)})}return i}function debounceFilter(r,n={}){let i,o,a=noop;const u=f=>{clearTimeout(f),a(),a=noop};return f=>{const d=resolveUnref(r),h=resolveUnref(n.maxWait);return i&&u(i),d<=0||h!==void 0&&h<=0?(o&&(u(o),o=null),Promise.resolve(f())):new Promise((v,g)=>{a=n.rejectOnCancel?g:v,h&&!o&&(o=setTimeout(()=>{i&&u(i),o=null,v(f())},h)),i=setTimeout(()=>{o&&u(o),o=null,v(f())},d)})}}function identity(r){return r}function tryOnScopeDispose(r){return vue.getCurrentScope()?(vue.onScopeDispose(r),!0):!1}function useDebounceFn(r,n=200,i={}){return createFilterWrapper(debounceFilter(n,i),r)}function refDebounced(r,n=200,i={}){const o=vue.ref(r.value),a=useDebounceFn(()=>{o.value=r.value},n,i);return vue.watch(r,()=>a()),o}function tryOnMounted(r,n=!0){vue.getCurrentInstance()?vue.onMounted(r):n?r():vue.nextTick(r)}function unrefElement(r){var n;const i=resolveUnref(r);return(n=i==null?void 0:i.$el)!=null?n:i}const defaultWindow=isClient?window:void 0;function useEventListener(...r){let n,i,o,a;if(isString$1(r[0])||Array.isArray(r[0])?([i,o,a]=r,n=defaultWindow):[n,i,o,a]=r,!n)return noop;Array.isArray(i)||(i=[i]),Array.isArray(o)||(o=[o]);const u=[],c=()=>{u.forEach(v=>v()),u.length=0},f=(v,g,p,y)=>(v.addEventListener(g,p,y),()=>v.removeEventListener(g,p,y)),d=vue.watch(()=>[unrefElement(n),resolveUnref(a)],([v,g])=>{c(),v&&u.push(...i.flatMap(p=>o.map(y=>f(v,p,y,g))))},{immediate:!0,flush:"post"}),h=()=>{d(),c()};return tryOnScopeDispose(h),h}let _iOSWorkaround=!1;function onClickOutside(r,n,i={}){const{window:o=defaultWindow,ignore:a=[],capture:u=!0,detectIframe:c=!1}=i;if(!o)return;isIOS&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(o.document.body.children).forEach(p=>p.addEventListener("click",noop)));let f=!0;const d=p=>a.some(y=>{if(typeof y=="string")return Array.from(o.document.querySelectorAll(y)).some(_=>_===p.target||p.composedPath().includes(_));{const _=unrefElement(y);return _&&(p.target===_||p.composedPath().includes(_))}}),v=[useEventListener(o,"click",p=>{const y=unrefElement(r);if(!(!y||y===p.target||p.composedPath().includes(y))){if(p.detail===0&&(f=!d(p)),!f){f=!0;return}n(p)}},{passive:!0,capture:u}),useEventListener(o,"pointerdown",p=>{const y=unrefElement(r);y&&(f=!p.composedPath().includes(y)&&!d(p))},{passive:!0}),c&&useEventListener(o,"blur",p=>{var y;const _=unrefElement(r);((y=o.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&n(p)})].filter(Boolean);return()=>v.forEach(p=>p())}function useSupported(r,n=!1){const i=vue.ref(),o=()=>i.value=!!r();return o(),tryOnMounted(o,n),i}const _global=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},globalKey="__vueuse_ssr_handlers__";_global[globalKey]=_global[globalKey]||{};var __getOwnPropSymbols$g=Object.getOwnPropertySymbols,__hasOwnProp$g=Object.prototype.hasOwnProperty,__propIsEnum$g=Object.prototype.propertyIsEnumerable,__objRest$2=(r,n)=>{var i={};for(var o in r)__hasOwnProp$g.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&__getOwnPropSymbols$g)for(var o of __getOwnPropSymbols$g(r))n.indexOf(o)<0&&__propIsEnum$g.call(r,o)&&(i[o]=r[o]);return i};function useResizeObserver(r,n,i={}){const o=i,{window:a=defaultWindow}=o,u=__objRest$2(o,["window"]);let c;const f=useSupported(()=>a&&"ResizeObserver"in a),d=()=>{c&&(c.disconnect(),c=void 0)},h=vue.watch(()=>unrefElement(r),g=>{d(),f.value&&a&&g&&(c=new ResizeObserver(n),c.observe(g,u))},{immediate:!0,flush:"post"}),v=()=>{d(),h()};return tryOnScopeDispose(v),{isSupported:f,stop:v}}var SwipeDirection;(function(r){r.UP="UP",r.RIGHT="RIGHT",r.DOWN="DOWN",r.LEFT="LEFT",r.NONE="NONE"})(SwipeDirection||(SwipeDirection={}));var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,n,i)=>n in r?__defProp(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,__spreadValues=(r,n)=>{for(var i in n||(n={}))__hasOwnProp.call(n,i)&&__defNormalProp(r,i,n[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(n))__propIsEnum.call(n,i)&&__defNormalProp(r,i,n[i]);return r};const _TransitionPresets={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};__spreadValues({linear:identity},_TransitionPresets);const isFirefox=()=>isClient&&/firefox/i.test(window.navigator.userAgent);process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const NOOP=()=>{},hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(r,n)=>hasOwnProperty.call(r,n),isArray=Array.isArray,isFunction=r=>typeof r=="function",isString=r=>typeof r=="string",isObject=r=>r!==null&&typeof r=="object",objectToString=Object.prototype.toString,toTypeString=r=>objectToString.call(r),toRawType=r=>toTypeString(r).slice(8,-1),isUndefined=r=>r===void 0,isBoolean=r=>typeof r=="boolean",isNumber=r=>typeof r=="number",isElement=r=>typeof Element>"u"?!1:r instanceof Element,isStringNumber=r=>isString(r)?!Number.isNaN(Number(r)):!1,escapeStringRegexp=(r="")=>r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),getProp=(r,n,i)=>({get value(){return lodashEs.get(r,n,i)},set value(o){lodashEs.set(r,n,o)}});class ElementPlusError extends Error{constructor(n){super(n),this.name="ElementPlusError"}}function throwError(r,n){throw new ElementPlusError(`[${r}] ${n}`)}function debugWarn(r,n){if(process.env.NODE_ENV!=="production"){const i=isString(r)?new ElementPlusError(`[${r}] ${n}`):r;console.warn(i)}}const SCOPE$1="utils/dom/style";function addUnit(r,n="px"){if(!r)return"";if(isNumber(r)||isStringNumber(r))return`${r}${n}`;if(isString(r))return r;debugWarn(SCOPE$1,"binding value must be a string or number")}function scrollIntoView(r,n){if(!isClient)return;if(!n){r.scrollTop=0;return}const i=[];let o=n.offsetParent;for(;o!==null&&r!==o&&r.contains(o);)i.push(o),o=o.offsetParent;const a=n.offsetTop+i.reduce((d,h)=>d+h.offsetTop,0),u=a+n.offsetHeight,c=r.scrollTop,f=c+r.clientHeight;a<c?r.scrollTop=a:u>f&&(r.scrollTop=u-r.clientHeight)}const epPropKey="__epPropKey",definePropType=r=>r,isEpProp=r=>isObject(r)&&!!r[epPropKey],buildProp=(r,n)=>{if(!isObject(r)||isEpProp(r))return r;const{values:i,required:o,default:a,type:u,validator:c}=r,d={type:u,required:!!o,validator:i||c?h=>{let v=!1,g=[];if(i&&(g=Array.from(i),hasOwn(r,"default")&&g.push(a),v||(v=g.includes(h))),c&&(v||(v=c(h))),!v&&g.length>0){const p=[...new Set(g)].map(y=>JSON.stringify(y)).join(", ");vue.warn(`Invalid prop: validation failed${n?` for prop "${n}"`:""}. Expected one of [${p}], got value ${JSON.stringify(h)}.`)}return v}:void 0,[epPropKey]:!0};return hasOwn(r,"default")&&(d.default=a),d},buildProps=r=>lodashEs.fromPairs(Object.entries(r).map(([n,i])=>[n,buildProp(i,n)])),iconPropType=definePropType([String,Object,Function]),ValidateComponentsMap={validating:loading_default,success:circle_check_default,error:circle_close_default},withInstall=(r,n)=>{if(r.install=i=>{for(const o of[r,...Object.values(n??{})])i.component(o.name,o)},n)for(const[i,o]of Object.entries(n))r[i]=o;return r},withNoopInstall=r=>(r.install=NOOP,r),EVENT_CODE={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},UPDATE_MODEL_EVENT="update:modelValue",CHANGE_EVENT="change",componentSizes=["","default","small","large"],componentSizeMap={large:40,default:32,small:24},getComponentSize=r=>componentSizeMap[r||"default"],isValidComponentSize=r=>["",...componentSizes].includes(r),isKorean=r=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(r),mutable=r=>r,DEFAULT_EXCLUDE_KEYS=["class","style"],LISTENER_PREFIX=/^on[A-Z]/,useAttrs=(r={})=>{const{excludeListeners:n=!1,excludeKeys:i}=r,o=vue.computed(()=>((i==null?void 0:i.value)||[]).concat(DEFAULT_EXCLUDE_KEYS)),a=vue.getCurrentInstance();return a?vue.computed(()=>{var u;return lodashEs.fromPairs(Object.entries((u=a.proxy)==null?void 0:u.$attrs).filter(([c])=>!o.value.includes(c)&&!(n&&LISTENER_PREFIX.test(c))))}):(debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),vue.computed(()=>({})))},useDeprecated=({from:r,replacement:n,scope:i,version:o,ref:a,type:u="API"},c)=>{vue.watch(()=>vue.unref(c),f=>{f&&debugWarn(i,`[${u}] ${r} is about to be deprecated in version ${o}, please use ${n} instead.
|
245
245
|
For more detail, please visit: ${a}
|
246
246
|
`)},{immediate:!0})},useFocus=r=>({focus:()=>{var n,i;(i=(n=r.value)==null?void 0:n.focus)==null||i.call(n)}});var English={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const buildTranslator=r=>(n,i)=>translate(n,i,vue.unref(r)),translate=(r,n,i)=>lodashEs.get(i,r,r).replace(/\{(\w+)\}/g,(o,a)=>{var u;return`${(u=n==null?void 0:n[a])!=null?u:`{${a}}`}`}),buildLocaleContext=r=>{const n=vue.computed(()=>vue.unref(r).name),i=vue.isRef(r)?r:vue.ref(r);return{lang:n,locale:i,t:buildTranslator(r)}},localeContextKey=Symbol("localeContextKey"),useLocale=r=>{const n=r||vue.inject(localeContextKey,vue.ref());return buildLocaleContext(vue.computed(()=>n.value||English))},defaultNamespace="el",statePrefix="is-",_bem=(r,n,i,o,a)=>{let u=`${r}-${n}`;return i&&(u+=`-${i}`),o&&(u+=`__${o}`),a&&(u+=`--${a}`),u},namespaceContextKey=Symbol("namespaceContextKey"),useGetDerivedNamespace=r=>{const n=r||vue.inject(namespaceContextKey,vue.ref(defaultNamespace));return vue.computed(()=>vue.unref(n)||defaultNamespace)},useNamespace=(r,n)=>{const i=useGetDerivedNamespace(n);return{namespace:i,b:(b="")=>_bem(i.value,r,b,"",""),e:b=>b?_bem(i.value,r,"",b,""):"",m:b=>b?_bem(i.value,r,"","",b):"",be:(b,A)=>b&&A?_bem(i.value,r,b,A,""):"",em:(b,A)=>b&&A?_bem(i.value,r,"",b,A):"",bm:(b,A)=>b&&A?_bem(i.value,r,b,"",A):"",bem:(b,A,w)=>b&&A&&w?_bem(i.value,r,b,A,w):"",is:(b,...A)=>{const w=A.length>=1?A[0]:!0;return b&&w?`${statePrefix}${b}`:""},cssVar:b=>{const A={};for(const w in b)b[w]&&(A[`--${i.value}-${w}`]=b[w]);return A},cssVarName:b=>`--${i.value}-${b}`,cssVarBlock:b=>{const A={};for(const w in b)b[w]&&(A[`--${i.value}-${r}-${w}`]=b[w]);return A},cssVarBlockName:b=>`--${i.value}-${r}-${b}`}},_prop=buildProp({type:definePropType(Boolean),default:null}),_event=buildProp({type:definePropType(Function)}),createModelToggleComposable=r=>{const n=`update:${r}`,i=`onUpdate:${r}`,o=[n],a={[r]:_prop,[i]:_event};return{useModelToggle:({indicator:c,toggleReason:f,shouldHideWhenRouteChanges:d,shouldProceed:h,onShow:v,onHide:g})=>{const p=vue.getCurrentInstance(),{emit:y}=p,_=p.props,b=vue.computed(()=>isFunction(_[i])),A=vue.computed(()=>_[r]===null),w=M=>{c.value!==!0&&(c.value=!0,f&&(f.value=M),isFunction(v)&&v(M))},T=M=>{c.value!==!1&&(c.value=!1,f&&(f.value=M),isFunction(g)&&g(M))},S=M=>{if(_.disabled===!0||isFunction(h)&&!h())return;const re=b.value&&isClient;re&&y(n,!0),(A.value||!re)&&w(M)},x=M=>{if(_.disabled===!0||!isClient)return;const re=b.value&&isClient;re&&y(n,!1),(A.value||!re)&&T(M)},O=M=>{isBoolean(M)&&(_.disabled&&M?b.value&&y(n,!1):c.value!==M&&(M?w():T()))},L=()=>{c.value?x():S()};return vue.watch(()=>_[r],O),d&&p.appContext.config.globalProperties.$route!==void 0&&vue.watch(()=>({...p.proxy.$route}),()=>{d.value&&c.value&&x()}),vue.onMounted(()=>{O(_[r])}),{hide:x,show:S,toggle:L,hasUpdateHandler:b}},useModelToggleProps:a,useModelToggleEmits:o}};createModelToggleComposable("modelValue");const useProp=r=>{const n=vue.getCurrentInstance();return vue.computed(()=>{var i,o;return(o=(i=n==null?void 0:n.proxy)==null?void 0:i.$props)==null?void 0:o[r]})};var E="top",R="bottom",W="right",P="left",me="auto",G=[E,R,W,P],U="start",J="end",Xe="clippingParents",je="viewport",K="popper",Ye="reference",De=G.reduce(function(r,n){return r.concat([n+"-"+U,n+"-"+J])},[]),Ee=[].concat(G,[me]).reduce(function(r,n){return r.concat([n,n+"-"+U,n+"-"+J])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",nt="write",rt="afterWrite",ot=[Ge,Je,Ke,Qe,Ze,et,tt,nt,rt];function C(r){return r?(r.nodeName||"").toLowerCase():null}function H(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var n=r.ownerDocument;return n&&n.defaultView||window}return r}function Q(r){var n=H(r).Element;return r instanceof n||r instanceof Element}function B(r){var n=H(r).HTMLElement;return r instanceof n||r instanceof HTMLElement}function Pe(r){if(typeof ShadowRoot>"u")return!1;var n=H(r).ShadowRoot;return r instanceof n||r instanceof ShadowRoot}function Mt(r){var n=r.state;Object.keys(n.elements).forEach(function(i){var o=n.styles[i]||{},a=n.attributes[i]||{},u=n.elements[i];!B(u)||!C(u)||(Object.assign(u.style,o),Object.keys(a).forEach(function(c){var f=a[c];f===!1?u.removeAttribute(c):u.setAttribute(c,f===!0?"":f)}))})}function Rt(r){var n=r.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow),function(){Object.keys(n.elements).forEach(function(o){var a=n.elements[o],u=n.attributes[o]||{},c=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:i[o]),f=c.reduce(function(d,h){return d[h]="",d},{});!B(a)||!C(a)||(Object.assign(a.style,f),Object.keys(u).forEach(function(d){a.removeAttribute(d)}))})}}var Ae={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Rt,requires:["computeStyles"]};function q(r){return r.split("-")[0]}var X=Math.max,ve=Math.min,Z=Math.round;function ee(r,n){n===void 0&&(n=!1);var i=r.getBoundingClientRect(),o=1,a=1;if(B(r)&&n){var u=r.offsetHeight,c=r.offsetWidth;c>0&&(o=Z(i.width)/c||1),u>0&&(a=Z(i.height)/u||1)}return{width:i.width/o,height:i.height/a,top:i.top/a,right:i.right/o,bottom:i.bottom/a,left:i.left/o,x:i.left/o,y:i.top/a}}function ke(r){var n=ee(r),i=r.offsetWidth,o=r.offsetHeight;return Math.abs(n.width-i)<=1&&(i=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:r.offsetLeft,y:r.offsetTop,width:i,height:o}}function it(r,n){var i=n.getRootNode&&n.getRootNode();if(r.contains(n))return!0;if(i&&Pe(i)){var o=n;do{if(o&&r.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function N(r){return H(r).getComputedStyle(r)}function Wt(r){return["table","td","th"].indexOf(C(r))>=0}function I(r){return((Q(r)?r.ownerDocument:r.document)||window.document).documentElement}function ge(r){return C(r)==="html"?r:r.assignedSlot||r.parentNode||(Pe(r)?r.host:null)||I(r)}function at(r){return!B(r)||N(r).position==="fixed"?null:r.offsetParent}function Bt(r){var n=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&B(r)){var o=N(r);if(o.position==="fixed")return null}var a=ge(r);for(Pe(a)&&(a=a.host);B(a)&&["html","body"].indexOf(C(a))<0;){var u=N(a);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||n&&u.willChange==="filter"||n&&u.filter&&u.filter!=="none")return a;a=a.parentNode}return null}function se(r){for(var n=H(r),i=at(r);i&&Wt(i)&&N(i).position==="static";)i=at(i);return i&&(C(i)==="html"||C(i)==="body"&&N(i).position==="static")?n:i||Bt(r)||n}function Le(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function fe(r,n,i){return X(r,ve(n,i))}function St(r,n,i){var o=fe(r,n,i);return o>i?i:o}function st(){return{top:0,right:0,bottom:0,left:0}}function ft(r){return Object.assign({},st(),r)}function ct(r,n){return n.reduce(function(i,o){return i[o]=r,i},{})}var Tt=function(r,n){return r=typeof r=="function"?r(Object.assign({},n.rects,{placement:n.placement})):r,ft(typeof r!="number"?r:ct(r,G))};function Ht(r){var n,i=r.state,o=r.name,a=r.options,u=i.elements.arrow,c=i.modifiersData.popperOffsets,f=q(i.placement),d=Le(f),h=[P,W].indexOf(f)>=0,v=h?"height":"width";if(!(!u||!c)){var g=Tt(a.padding,i),p=ke(u),y=d==="y"?E:P,_=d==="y"?R:W,b=i.rects.reference[v]+i.rects.reference[d]-c[d]-i.rects.popper[v],A=c[d]-i.rects.reference[d],w=se(u),T=w?d==="y"?w.clientHeight||0:w.clientWidth||0:0,S=b/2-A/2,x=g[y],O=T-p[v]-g[_],L=T/2-p[v]/2+S,M=fe(x,L,O),re=d;i.modifiersData[o]=(n={},n[re]=M,n.centerOffset=M-L,n)}}function Ct(r){var n=r.state,i=r.options,o=i.element,a=o===void 0?"[data-popper-arrow]":o;a!=null&&(typeof a=="string"&&(a=n.elements.popper.querySelector(a),!a)||!it(n.elements.popper,a)||(n.elements.arrow=a))}var pt={name:"arrow",enabled:!0,phase:"main",fn:Ht,effect:Ct,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function te(r){return r.split("-")[1]}var qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vt(r){var n=r.x,i=r.y,o=window,a=o.devicePixelRatio||1;return{x:Z(n*a)/a||0,y:Z(i*a)/a||0}}function ut(r){var n,i=r.popper,o=r.popperRect,a=r.placement,u=r.variation,c=r.offsets,f=r.position,d=r.gpuAcceleration,h=r.adaptive,v=r.roundOffsets,g=r.isFixed,p=c.x,y=p===void 0?0:p,_=c.y,b=_===void 0?0:_,A=typeof v=="function"?v({x:y,y:b}):{x:y,y:b};y=A.x,b=A.y;var w=c.hasOwnProperty("x"),T=c.hasOwnProperty("y"),S=P,x=E,O=window;if(h){var L=se(i),M="clientHeight",re="clientWidth";if(L===H(i)&&(L=I(i),N(L).position!=="static"&&f==="absolute"&&(M="scrollHeight",re="scrollWidth")),L=L,a===E||(a===P||a===W)&&u===J){x=R;var F=g&&L===O&&O.visualViewport?O.visualViewport.height:L[M];b-=F-o.height,b*=d?1:-1}if(a===P||(a===E||a===R)&&u===J){S=W;var j=g&&L===O&&O.visualViewport?O.visualViewport.width:L[re];y-=j-o.width,y*=d?1:-1}}var V=Object.assign({position:f},h&&qt),z=v===!0?Vt({x:y,y:b}):{x:y,y:b};if(y=z.x,b=z.y,d){var $;return Object.assign({},V,($={},$[x]=T?"0":"",$[S]=w?"0":"",$.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",$))}return Object.assign({},V,(n={},n[x]=T?b+"px":"",n[S]=w?y+"px":"",n.transform="",n))}function Nt(r){var n=r.state,i=r.options,o=i.gpuAcceleration,a=o===void 0?!0:o,u=i.adaptive,c=u===void 0?!0:u,f=i.roundOffsets,d=f===void 0?!0:f,h={placement:q(n.placement),variation:te(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:a,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,ut(Object.assign({},h,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:c,roundOffsets:d})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,ut(Object.assign({},h,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}var Me={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Nt,data:{}},ye={passive:!0};function It(r){var n=r.state,i=r.instance,o=r.options,a=o.scroll,u=a===void 0?!0:a,c=o.resize,f=c===void 0?!0:c,d=H(n.elements.popper),h=[].concat(n.scrollParents.reference,n.scrollParents.popper);return u&&h.forEach(function(v){v.addEventListener("scroll",i.update,ye)}),f&&d.addEventListener("resize",i.update,ye),function(){u&&h.forEach(function(v){v.removeEventListener("scroll",i.update,ye)}),f&&d.removeEventListener("resize",i.update,ye)}}var Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:It,data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(r){return r.replace(/left|right|bottom|top/g,function(n){return _t[n]})}var zt={start:"end",end:"start"};function lt(r){return r.replace(/start|end/g,function(n){return zt[n]})}function We(r){var n=H(r),i=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:i,scrollTop:o}}function Be(r){return ee(I(r)).left+We(r).scrollLeft}function Ft(r){var n=H(r),i=I(r),o=n.visualViewport,a=i.clientWidth,u=i.clientHeight,c=0,f=0;return o&&(a=o.width,u=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(c=o.offsetLeft,f=o.offsetTop)),{width:a,height:u,x:c+Be(r),y:f}}function Ut(r){var n,i=I(r),o=We(r),a=(n=r.ownerDocument)==null?void 0:n.body,u=X(i.scrollWidth,i.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),c=X(i.scrollHeight,i.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),f=-o.scrollLeft+Be(r),d=-o.scrollTop;return N(a||i).direction==="rtl"&&(f+=X(i.clientWidth,a?a.clientWidth:0)-u),{width:u,height:c,x:f,y:d}}function Se(r){var n=N(r),i=n.overflow,o=n.overflowX,a=n.overflowY;return/auto|scroll|overlay|hidden/.test(i+a+o)}function dt(r){return["html","body","#document"].indexOf(C(r))>=0?r.ownerDocument.body:B(r)&&Se(r)?r:dt(ge(r))}function ce(r,n){var i;n===void 0&&(n=[]);var o=dt(r),a=o===((i=r.ownerDocument)==null?void 0:i.body),u=H(o),c=a?[u].concat(u.visualViewport||[],Se(o)?o:[]):o,f=n.concat(c);return a?f:f.concat(ce(ge(c)))}function Te(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function Xt(r){var n=ee(r);return n.top=n.top+r.clientTop,n.left=n.left+r.clientLeft,n.bottom=n.top+r.clientHeight,n.right=n.left+r.clientWidth,n.width=r.clientWidth,n.height=r.clientHeight,n.x=n.left,n.y=n.top,n}function ht(r,n){return n===je?Te(Ft(r)):Q(n)?Xt(n):Te(Ut(I(r)))}function Yt(r){var n=ce(ge(r)),i=["absolute","fixed"].indexOf(N(r).position)>=0,o=i&&B(r)?se(r):r;return Q(o)?n.filter(function(a){return Q(a)&&it(a,o)&&C(a)!=="body"}):[]}function Gt(r,n,i){var o=n==="clippingParents"?Yt(r):[].concat(n),a=[].concat(o,[i]),u=a[0],c=a.reduce(function(f,d){var h=ht(r,d);return f.top=X(h.top,f.top),f.right=ve(h.right,f.right),f.bottom=ve(h.bottom,f.bottom),f.left=X(h.left,f.left),f},ht(r,u));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function mt(r){var n=r.reference,i=r.element,o=r.placement,a=o?q(o):null,u=o?te(o):null,c=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d;switch(a){case E:d={x:c,y:n.y-i.height};break;case R:d={x:c,y:n.y+n.height};break;case W:d={x:n.x+n.width,y:f};break;case P:d={x:n.x-i.width,y:f};break;default:d={x:n.x,y:n.y}}var h=a?Le(a):null;if(h!=null){var v=h==="y"?"height":"width";switch(u){case U:d[h]=d[h]-(n[v]/2-i[v]/2);break;case J:d[h]=d[h]+(n[v]/2-i[v]/2);break}}return d}function ne(r,n){n===void 0&&(n={});var i=n,o=i.placement,a=o===void 0?r.placement:o,u=i.boundary,c=u===void 0?Xe:u,f=i.rootBoundary,d=f===void 0?je:f,h=i.elementContext,v=h===void 0?K:h,g=i.altBoundary,p=g===void 0?!1:g,y=i.padding,_=y===void 0?0:y,b=ft(typeof _!="number"?_:ct(_,G)),A=v===K?Ye:K,w=r.rects.popper,T=r.elements[p?A:v],S=Gt(Q(T)?T:T.contextElement||I(r.elements.popper),c,d),x=ee(r.elements.reference),O=mt({reference:x,element:w,strategy:"absolute",placement:a}),L=Te(Object.assign({},w,O)),M=v===K?L:x,re={top:S.top-M.top+b.top,bottom:M.bottom-S.bottom+b.bottom,left:S.left-M.left+b.left,right:M.right-S.right+b.right},F=r.modifiersData.offset;if(v===K&&F){var j=F[a];Object.keys(re).forEach(function(V){var z=[W,R].indexOf(V)>=0?1:-1,$=[E,R].indexOf(V)>=0?"y":"x";re[V]+=j[$]*z})}return re}function Jt(r,n){n===void 0&&(n={});var i=n,o=i.placement,a=i.boundary,u=i.rootBoundary,c=i.padding,f=i.flipVariations,d=i.allowedAutoPlacements,h=d===void 0?Ee:d,v=te(o),g=v?f?De:De.filter(function(_){return te(_)===v}):G,p=g.filter(function(_){return h.indexOf(_)>=0});p.length===0&&(p=g);var y=p.reduce(function(_,b){return _[b]=ne(r,{placement:b,boundary:a,rootBoundary:u,padding:c})[q(b)],_},{});return Object.keys(y).sort(function(_,b){return y[_]-y[b]})}function Kt(r){if(q(r)===me)return[];var n=be(r);return[lt(r),n,lt(n)]}function Qt(r){var n=r.state,i=r.options,o=r.name;if(!n.modifiersData[o]._skip){for(var a=i.mainAxis,u=a===void 0?!0:a,c=i.altAxis,f=c===void 0?!0:c,d=i.fallbackPlacements,h=i.padding,v=i.boundary,g=i.rootBoundary,p=i.altBoundary,y=i.flipVariations,_=y===void 0?!0:y,b=i.allowedAutoPlacements,A=n.options.placement,w=q(A),T=w===A,S=d||(T||!_?[be(A)]:Kt(A)),x=[A].concat(S).reduce(function(Dt,de){return Dt.concat(q(de)===me?Jt(n,{placement:de,boundary:v,rootBoundary:g,padding:h,flipVariations:_,allowedAutoPlacements:b}):de)},[]),O=n.rects.reference,L=n.rects.popper,M=new Map,re=!0,F=x[0],j=0;j<x.length;j++){var V=x[j],z=q(V),$=te(V)===U,he=[E,R].indexOf(z)>=0,le=he?"width":"height",Ie=ne(n,{placement:V,boundary:v,rootBoundary:g,altBoundary:p,padding:h}),Fe=he?$?W:P:$?R:E;O[le]>L[le]&&(Fe=be(Fe));var pe=be(Fe),Lt=[];if(u&&Lt.push(Ie[z]<=0),f&&Lt.push(Ie[Fe]<=0,Ie[pe]<=0),Lt.every(function(Dt){return Dt})){F=V,re=!1;break}M.set(V,Lt)}if(re)for(var _e=_?3:1,Et=function(Dt){var de=x.find(function(qe){var Pt=M.get(qe);if(Pt)return Pt.slice(0,Dt).every(function(In){return In})});if(de)return F=de,"break"},Cn=_e;Cn>0;Cn--){var vn=Et(Cn);if(vn==="break")break}n.placement!==F&&(n.modifiersData[o]._skip=!0,n.placement=F,n.reset=!0)}}var vt={name:"flip",enabled:!0,phase:"main",fn:Qt,requiresIfExists:["offset"],data:{_skip:!1}};function gt(r,n,i){return i===void 0&&(i={x:0,y:0}),{top:r.top-n.height-i.y,right:r.right-n.width+i.x,bottom:r.bottom-n.height+i.y,left:r.left-n.width-i.x}}function yt(r){return[E,W,R,P].some(function(n){return r[n]>=0})}function Zt(r){var n=r.state,i=r.name,o=n.rects.reference,a=n.rects.popper,u=n.modifiersData.preventOverflow,c=ne(n,{elementContext:"reference"}),f=ne(n,{altBoundary:!0}),d=gt(c,o),h=gt(f,a,u),v=yt(d),g=yt(h);n.modifiersData[i]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:v,hasPopperEscaped:g},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":v,"data-popper-escaped":g})}var bt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function en(r,n,i){var o=q(r),a=[P,E].indexOf(o)>=0?-1:1,u=typeof i=="function"?i(Object.assign({},n,{placement:r})):i,c=u[0],f=u[1];return c=c||0,f=(f||0)*a,[P,W].indexOf(o)>=0?{x:f,y:c}:{x:c,y:f}}function tn(r){var n=r.state,i=r.options,o=r.name,a=i.offset,u=a===void 0?[0,0]:a,c=Ee.reduce(function(v,g){return v[g]=en(g,n.rects,u),v},{}),f=c[n.placement],d=f.x,h=f.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=d,n.modifiersData.popperOffsets.y+=h),n.modifiersData[o]=c}var wt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tn};function nn(r){var n=r.state,i=r.name;n.modifiersData[i]=mt({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}var He={name:"popperOffsets",enabled:!0,phase:"read",fn:nn,data:{}};function rn(r){return r==="x"?"y":"x"}function on(r){var n=r.state,i=r.options,o=r.name,a=i.mainAxis,u=a===void 0?!0:a,c=i.altAxis,f=c===void 0?!1:c,d=i.boundary,h=i.rootBoundary,v=i.altBoundary,g=i.padding,p=i.tether,y=p===void 0?!0:p,_=i.tetherOffset,b=_===void 0?0:_,A=ne(n,{boundary:d,rootBoundary:h,padding:g,altBoundary:v}),w=q(n.placement),T=te(n.placement),S=!T,x=Le(w),O=rn(x),L=n.modifiersData.popperOffsets,M=n.rects.reference,re=n.rects.popper,F=typeof b=="function"?b(Object.assign({},n.rects,{placement:n.placement})):b,j=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),V=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,z={x:0,y:0};if(L){if(u){var $,he=x==="y"?E:P,le=x==="y"?R:W,Ie=x==="y"?"height":"width",Fe=L[x],pe=Fe+A[he],Lt=Fe-A[le],_e=y?-re[Ie]/2:0,Et=T===U?M[Ie]:re[Ie],Cn=T===U?-re[Ie]:-M[Ie],vn=n.elements.arrow,Dt=y&&vn?ke(vn):{width:0,height:0},de=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:st(),qe=de[he],Pt=de[le],In=fe(0,M[Ie],Dt[Ie]),$e=S?M[Ie]/2-_e-In-qe-j.mainAxis:Et-In-qe-j.mainAxis,Ce=S?-M[Ie]/2+_e+In+Pt+j.mainAxis:Cn+In+Pt+j.mainAxis,ue=n.elements.arrow&&se(n.elements.arrow),At=ue?x==="y"?ue.clientTop||0:ue.clientLeft||0:0,Ne=($=V==null?void 0:V[x])!=null?$:0,Oe=Fe+$e-Ne-At,kt=Fe+Ce-Ne,jt=fe(y?ve(pe,Oe):pe,Fe,y?X(Lt,kt):Lt);L[x]=jt,z[x]=jt-Fe}if(f){var _n,ie=x==="x"?E:P,ae=x==="x"?R:W,Y=L[O],k=O==="y"?"height":"width",D=Y+A[ie],oe=Y-A[ae],xe=[E,P].indexOf(w)!==-1,ze=(_n=V==null?void 0:V[O])!=null?_n:0,hn=xe?D:Y-M[k]-re[k]-ze+j.altAxis,An=xe?Y+M[k]+re[k]-ze-j.altAxis:oe,Tn=y&&xe?St(hn,Y,An):fe(y?hn:D,Y,y?An:oe);L[O]=Tn,z[O]=Tn-Y}n.modifiersData[o]=z}}var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:on,requiresIfExists:["offset"]};function an(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function sn(r){return r===H(r)||!B(r)?We(r):an(r)}function fn(r){var n=r.getBoundingClientRect(),i=Z(n.width)/r.offsetWidth||1,o=Z(n.height)/r.offsetHeight||1;return i!==1||o!==1}function cn(r,n,i){i===void 0&&(i=!1);var o=B(n),a=B(n)&&fn(n),u=I(n),c=ee(r,a),f={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!i)&&((C(n)!=="body"||Se(u))&&(f=sn(n)),B(n)?(d=ee(n,!0),d.x+=n.clientLeft,d.y+=n.clientTop):u&&(d.x=Be(u))),{x:c.left+f.scrollLeft-d.x,y:c.top+f.scrollTop-d.y,width:c.width,height:c.height}}function pn(r){var n=new Map,i=new Set,o=[];r.forEach(function(u){n.set(u.name,u)});function a(u){i.add(u.name);var c=[].concat(u.requires||[],u.requiresIfExists||[]);c.forEach(function(f){if(!i.has(f)){var d=n.get(f);d&&a(d)}}),o.push(u)}return r.forEach(function(u){i.has(u.name)||a(u)}),o}function un(r){var n=pn(r);return ot.reduce(function(i,o){return i.concat(n.filter(function(a){return a.phase===o}))},[])}function ln(r){var n;return function(){return n||(n=new Promise(function(i){Promise.resolve().then(function(){n=void 0,i(r())})})),n}}function dn(r){var n=r.reduce(function(i,o){var a=i[o.name];return i[o.name]=a?Object.assign({},a,o,{options:Object.assign({},a.options,o.options),data:Object.assign({},a.data,o.data)}):o,i},{});return Object.keys(n).map(function(i){return n[i]})}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function $t(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function we(r){r===void 0&&(r={});var n=r,i=n.defaultModifiers,o=i===void 0?[]:i,a=n.defaultOptions,u=a===void 0?Ot:a;return function(c,f,d){d===void 0&&(d=u);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,u),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},v=[],g=!1,p={state:h,setOptions:function(b){var A=typeof b=="function"?b(h.options):b;_(),h.options=Object.assign({},u,h.options,A),h.scrollParents={reference:Q(c)?ce(c):c.contextElement?ce(c.contextElement):[],popper:ce(f)};var w=un(dn([].concat(o,h.options.modifiers)));return h.orderedModifiers=w.filter(function(T){return T.enabled}),y(),p.update()},forceUpdate:function(){if(!g){var b=h.elements,A=b.reference,w=b.popper;if($t(A,w)){h.rects={reference:cn(A,se(w),h.options.strategy==="fixed"),popper:ke(w)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(re){return h.modifiersData[re.name]=Object.assign({},re.data)});for(var T=0;T<h.orderedModifiers.length;T++){if(h.reset===!0){h.reset=!1,T=-1;continue}var S=h.orderedModifiers[T],x=S.fn,O=S.options,L=O===void 0?{}:O,M=S.name;typeof x=="function"&&(h=x({state:h,options:L,name:M,instance:p})||h)}}}},update:ln(function(){return new Promise(function(b){p.forceUpdate(),b(h)})}),destroy:function(){_(),g=!0}};if(!$t(c,f))return p;p.setOptions(d).then(function(b){!g&&d.onFirstUpdate&&d.onFirstUpdate(b)});function y(){h.orderedModifiers.forEach(function(b){var A=b.name,w=b.options,T=w===void 0?{}:w,S=b.effect;if(typeof S=="function"){var x=S({state:h,name:A,instance:p,options:T}),O=function(){};v.push(x||O)}})}function _(){v.forEach(function(b){return b()}),v=[]}return p}}we();var mn=[Re,He,Me,Ae];we({defaultModifiers:mn});var gn=[Re,He,Me,Ae,wt,vt,xt,pt,bt],yn=we({defaultModifiers:gn});const usePopper=(r,n,i={})=>{const o={name:"updateState",enabled:!0,phase:"write",fn:({state:d})=>{const h=deriveState(d);Object.assign(c.value,h)},requires:["computeStyles"]},a=vue.computed(()=>{const{onFirstUpdate:d,placement:h,strategy:v,modifiers:g}=vue.unref(i);return{onFirstUpdate:d,placement:h||"bottom",strategy:v||"absolute",modifiers:[...g||[],o,{name:"applyStyles",enabled:!1}]}}),u=vue.shallowRef(),c=vue.ref({styles:{popper:{position:vue.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),f=()=>{u.value&&(u.value.destroy(),u.value=void 0)};return vue.watch(a,d=>{const h=vue.unref(u);h&&h.setOptions(d)},{deep:!0}),vue.watch([r,n],([d,h])=>{f(),!(!d||!h)&&(u.value=yn(d,h,vue.unref(a)))}),vue.onBeforeUnmount(()=>{f()}),{state:vue.computed(()=>{var d;return{...((d=vue.unref(u))==null?void 0:d.state)||{}}}),styles:vue.computed(()=>vue.unref(c).styles),attributes:vue.computed(()=>vue.unref(c).attributes),update:()=>{var d;return(d=vue.unref(u))==null?void 0:d.update()},forceUpdate:()=>{var d;return(d=vue.unref(u))==null?void 0:d.forceUpdate()},instanceRef:vue.computed(()=>vue.unref(u))}};function deriveState(r){const n=Object.keys(r.elements),i=lodashEs.fromPairs(n.map(a=>[a,r.styles[a]||{}])),o=lodashEs.fromPairs(n.map(a=>[a,r.attributes[a]]));return{styles:i,attributes:o}}function useTimeout(){let r;const n=(o,a)=>{i(),r=window.setTimeout(o,a)},i=()=>window.clearTimeout(r);return tryOnScopeDispose(()=>i()),{registerTimeout:n,cancelTimeout:i}}const defaultIdInjection={prefix:Math.floor(Math.random()*1e4),current:0},ID_INJECTION_KEY=Symbol("elIdInjection"),useIdInjection=()=>vue.getCurrentInstance()?vue.inject(ID_INJECTION_KEY,defaultIdInjection):defaultIdInjection,useId=r=>{const n=useIdInjection();!isClient&&n===defaultIdInjection&&debugWarn("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
247
247
|
usage: app.provide(ID_INJECTION_KEY, {
|
@@ -266,6 +266,6 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
266
266
|
z-index:-1000 !important;
|
267
267
|
top:0 !important;
|
268
268
|
right:0 !important;
|
269
|
-
`,CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function calculateNodeStyling(r){const n=window.getComputedStyle(r),i=n.getPropertyValue("box-sizing"),o=Number.parseFloat(n.getPropertyValue("padding-bottom"))+Number.parseFloat(n.getPropertyValue("padding-top")),a=Number.parseFloat(n.getPropertyValue("border-bottom-width"))+Number.parseFloat(n.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(c=>`${c}:${n.getPropertyValue(c)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:i}}function calcTextareaHeight(r,n=1,i){var o;hiddenTextarea||(hiddenTextarea=document.createElement("textarea"),document.body.appendChild(hiddenTextarea));const{paddingSize:a,borderSize:u,boxSizing:c,contextStyle:f}=calculateNodeStyling(r);hiddenTextarea.setAttribute("style",`${f};${HIDDEN_STYLE}`),hiddenTextarea.value=r.value||r.placeholder||"";let d=hiddenTextarea.scrollHeight;const h={};c==="border-box"?d=d+u:c==="content-box"&&(d=d-a),hiddenTextarea.value="";const v=hiddenTextarea.scrollHeight-a;if(isNumber(n)){let g=v*n;c==="border-box"&&(g=g+a+u),d=Math.max(g,d),h.minHeight=`${g}px`}if(isNumber(i)){let g=v*i;c==="border-box"&&(g=g+a+u),d=Math.min(g,d)}return h.height=`${d}px`,(o=hiddenTextarea.parentNode)==null||o.removeChild(hiddenTextarea),hiddenTextarea=void 0,h}const inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:Boolean,modelValue:{type:definePropType([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:definePropType([Object,Array,String]),default:()=>mutable({})}}),inputEmits={[UPDATE_MODEL_EVENT]:r=>isString(r),input:r=>isString(r),change:r=>isString(r),focus:r=>r instanceof FocusEvent,blur:r=>r instanceof FocusEvent,clear:()=>!0,mouseleave:r=>r instanceof MouseEvent,mouseenter:r=>r instanceof MouseEvent,keydown:r=>r instanceof Event,compositionstart:r=>r instanceof CompositionEvent,compositionupdate:r=>r instanceof CompositionEvent,compositionend:r=>r instanceof CompositionEvent},_hoisted_1$7=["role"],_hoisted_2$5=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],_hoisted_3$4=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],__default__$9=vue.defineComponent({name:"ElInput",inheritAttrs:!1}),_sfc_main$o=vue.defineComponent({...__default__$9,props:inputProps,emits:inputEmits,setup(r,{expose:n,emit:i}){const o=r,a=vue.useAttrs(),u=vue.useSlots(),c=vue.computed(()=>{const ze={};return o.containerRole==="combobox"&&(ze["aria-haspopup"]=a["aria-haspopup"],ze["aria-owns"]=a["aria-owns"],ze["aria-expanded"]=a["aria-expanded"]),ze}),f=vue.computed(()=>[o.type==="textarea"?A.b():b.b(),b.m(y.value),b.is("disabled",_.value),b.is("exceed",Dt.value),{[b.b("group")]:u.prepend||u.append,[b.bm("group","append")]:u.append,[b.bm("group","prepend")]:u.prepend,[b.m("prefix")]:u.prefix||o.prefixIcon,[b.m("suffix")]:u.suffix||o.suffixIcon||o.clearable||o.showPassword,[b.bm("suffix","password-clear")]:_e.value&&Et.value},a.class]),d=vue.computed(()=>[b.e("wrapper"),b.is("focus",j.value)]),h=useAttrs({excludeKeys:vue.computed(()=>Object.keys(c.value))}),{form:v,formItem:g}=useFormItem(),{inputId:p}=useFormItemInputId(o,{formItemContext:g}),y=useFormSize(),_=useFormDisabled(),b=useNamespace("input"),A=useNamespace("textarea"),w=vue.shallowRef(),T=vue.shallowRef(),S=vue.ref(!1),x=vue.ref(!1),O=vue.ref(!1),L=vue.ref(),M=vue.shallowRef(o.inputStyle),re=vue.computed(()=>w.value||T.value),{wrapperRef:F,isFocused:j,handleFocus:V,handleBlur:z}=useFocusController(re,{afterBlur(){var ze;o.validateEvent&&((ze=g==null?void 0:g.validate)==null||ze.call(g,"blur").catch(hn=>debugWarn(hn)))}}),$=vue.computed(()=>{var ze;return(ze=v==null?void 0:v.statusIcon)!=null?ze:!1}),he=vue.computed(()=>(g==null?void 0:g.validateState)||""),le=vue.computed(()=>he.value&&ValidateComponentsMap[he.value]),Ie=vue.computed(()=>O.value?view_default:hide_default),Fe=vue.computed(()=>[a.style,o.inputStyle]),pe=vue.computed(()=>[o.inputStyle,M.value,{resize:o.resize}]),Lt=vue.computed(()=>lodashEs.isNil(o.modelValue)?"":String(o.modelValue)),_e=vue.computed(()=>o.clearable&&!_.value&&!o.readonly&&!!Lt.value&&(j.value||S.value)),Et=vue.computed(()=>o.showPassword&&!_.value&&!o.readonly&&!!Lt.value&&(!!Lt.value||j.value)),Cn=vue.computed(()=>o.showWordLimit&&!!h.value.maxlength&&(o.type==="text"||o.type==="textarea")&&!_.value&&!o.readonly&&!o.showPassword),vn=vue.computed(()=>Lt.value.length),Dt=vue.computed(()=>!!Cn.value&&vn.value>Number(h.value.maxlength)),de=vue.computed(()=>!!u.suffix||!!o.suffixIcon||_e.value||o.showPassword||Cn.value||!!he.value&&$.value),[qe,Pt]=useCursor(w);useResizeObserver(T,ze=>{if(Ce(),!Cn.value||o.resize!=="both")return;const hn=ze[0],{width:An}=hn.contentRect;L.value={right:`calc(100% - ${An+15+6}px)`}});const In=()=>{const{type:ze,autosize:hn}=o;if(!(!isClient||ze!=="textarea"||!T.value))if(hn){const An=isObject(hn)?hn.minRows:void 0,Tn=isObject(hn)?hn.maxRows:void 0,Rn=calcTextareaHeight(T.value,An,Tn);M.value={overflowY:"hidden",...Rn},vue.nextTick(()=>{T.value.offsetHeight,M.value=Rn})}else M.value={minHeight:calcTextareaHeight(T.value).minHeight}},Ce=(ze=>{let hn=!1;return()=>{var An;if(hn||!o.autosize)return;((An=T.value)==null?void 0:An.offsetParent)===null||(ze(),hn=!0)}})(In),ue=()=>{const ze=re.value,hn=o.formatter?o.formatter(Lt.value):Lt.value;!ze||ze.value===hn||(ze.value=hn)},At=async ze=>{qe();let{value:hn}=ze.target;if(o.formatter&&(hn=o.parser?o.parser(hn):hn),!x.value){if(hn===Lt.value){ue();return}i(UPDATE_MODEL_EVENT,hn),i("input",hn),await vue.nextTick(),ue(),Pt()}},Ne=ze=>{i("change",ze.target.value)},Oe=ze=>{i("compositionstart",ze),x.value=!0},kt=ze=>{var hn;i("compositionupdate",ze);const An=(hn=ze.target)==null?void 0:hn.value,Tn=An[An.length-1]||"";x.value=!isKorean(Tn)},jt=ze=>{i("compositionend",ze),x.value&&(x.value=!1,At(ze))},_n=()=>{O.value=!O.value,ie()},ie=async()=>{var ze;await vue.nextTick(),(ze=re.value)==null||ze.focus()},ae=()=>{var ze;return(ze=re.value)==null?void 0:ze.blur()},Y=ze=>{S.value=!1,i("mouseleave",ze)},k=ze=>{S.value=!0,i("mouseenter",ze)},D=ze=>{i("keydown",ze)},oe=()=>{var ze;(ze=re.value)==null||ze.select()},xe=()=>{i(UPDATE_MODEL_EVENT,""),i("change",""),i("clear"),i("input","")};return vue.watch(()=>o.modelValue,()=>{var ze;vue.nextTick(()=>In()),o.validateEvent&&((ze=g==null?void 0:g.validate)==null||ze.call(g,"change").catch(hn=>debugWarn(hn)))}),vue.watch(Lt,()=>ue()),vue.watch(()=>o.type,async()=>{await vue.nextTick(),ue(),In()}),vue.onMounted(()=>{!o.formatter&&o.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),ue(),vue.nextTick(In)}),n({input:w,textarea:T,ref:re,textareaStyle:pe,autosize:vue.toRef(o,"autosize"),focus:ie,blur:ae,select:oe,clear:xe,resizeTextarea:In}),(ze,hn)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",vue.mergeProps(vue.unref(c),{class:vue.unref(f),style:vue.unref(Fe),role:ze.containerRole,onMouseenter:k,onMouseleave:Y}),[vue.createCommentVNode(" input "),ze.type!=="textarea"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createCommentVNode(" prepend slot "),ze.$slots.prepend?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(b).be("group","prepend"))},[vue.renderSlot(ze.$slots,"prepend")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref_key:"wrapperRef",ref:F,class:vue.normalizeClass(vue.unref(d))},[vue.createCommentVNode(" prefix slot "),ze.$slots.prefix||ze.prefixIcon?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(b).e("prefix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("prefix-inner"))},[vue.renderSlot(ze.$slots,"prefix"),ze.prefixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ze.prefixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("input",vue.mergeProps({id:vue.unref(p),ref_key:"input",ref:w,class:vue.unref(b).e("inner")},vue.unref(h),{type:ze.showPassword?O.value?"text":"password":ze.type,disabled:vue.unref(_),formatter:ze.formatter,parser:ze.parser,readonly:ze.readonly,autocomplete:ze.autocomplete,tabindex:ze.tabindex,"aria-label":ze.label,placeholder:ze.placeholder,style:ze.inputStyle,form:o.form,onCompositionstart:Oe,onCompositionupdate:kt,onCompositionend:jt,onInput:At,onFocus:hn[0]||(hn[0]=(...An)=>vue.unref(V)&&vue.unref(V)(...An)),onBlur:hn[1]||(hn[1]=(...An)=>vue.unref(z)&&vue.unref(z)(...An)),onChange:Ne,onKeydown:D}),null,16,_hoisted_2$5),vue.createCommentVNode(" suffix slot "),vue.unref(de)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(vue.unref(b).e("suffix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("suffix-inner"))},[!vue.unref(_e)||!vue.unref(Et)||!vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.renderSlot(ze.$slots,"suffix"),ze.suffixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ze.suffixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],64)):vue.createCommentVNode("v-if",!0),vue.unref(_e)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("clear")]),onMousedown:vue.withModifiers(vue.unref(NOOP),["prevent"]),onClick:xe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_close_default))]),_:1},8,["class","onMousedown"])):vue.createCommentVNode("v-if",!0),vue.unref(Et)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("password")]),onClick:_n},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(Ie))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock("span",{key:3,class:vue.normalizeClass(vue.unref(b).e("count"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("count-inner"))},vue.toDisplayString(vue.unref(vn))+" / "+vue.toDisplayString(vue.unref(h).maxlength),3)],2)):vue.createCommentVNode("v-if",!0),vue.unref(he)&&vue.unref(le)&&vue.unref($)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:4,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("validateIcon"),vue.unref(b).is("loading",vue.unref(he)==="validating")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(le))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0)],2),vue.createCommentVNode(" append slot "),ze.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(b).be("group","append"))},[vue.renderSlot(ze.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" textarea "),vue.createElementVNode("textarea",vue.mergeProps({id:vue.unref(p),ref_key:"textarea",ref:T,class:vue.unref(A).e("inner")},vue.unref(h),{tabindex:ze.tabindex,disabled:vue.unref(_),readonly:ze.readonly,autocomplete:ze.autocomplete,style:vue.unref(pe),"aria-label":ze.label,placeholder:ze.placeholder,form:o.form,onCompositionstart:Oe,onCompositionupdate:kt,onCompositionend:jt,onInput:At,onFocus:hn[2]||(hn[2]=(...An)=>vue.unref(V)&&vue.unref(V)(...An)),onBlur:hn[3]||(hn[3]=(...An)=>vue.unref(z)&&vue.unref(z)(...An)),onChange:Ne,onKeydown:D}),null,16,_hoisted_3$4),vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock("span",{key:0,style:vue.normalizeStyle(L.value),class:vue.normalizeClass(vue.unref(b).e("count"))},vue.toDisplayString(vue.unref(vn))+" / "+vue.toDisplayString(vue.unref(h).maxlength),7)):vue.createCommentVNode("v-if",!0)],64))],16,_hoisted_1$7)),[[vue.vShow,ze.type!=="hidden"]])}});var Input=_export_sfc(_sfc_main$o,[["__file","/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);const ElInput=withInstall(Input),GAP=4,BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},renderThumbStyle=({move:r,size:n,bar:i})=>({[i.size]:n,transform:`translate${i.axis}(${r}%)`}),scrollbarContextKey=Symbol("scrollbarContextKey"),thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),COMPONENT_NAME$2="Thumb",_sfc_main$n=vue.defineComponent({__name:"thumb",props:thumbProps,setup(r){const n=r,i=vue.inject(scrollbarContextKey),o=useNamespace("scrollbar");i||throwError(COMPONENT_NAME$2,"can not inject scrollbar context");const a=vue.ref(),u=vue.ref(),c=vue.ref({}),f=vue.ref(!1);let d=!1,h=!1,v=isClient?document.onselectstart:null;const g=vue.computed(()=>BAR_MAP[n.vertical?"vertical":"horizontal"]),p=vue.computed(()=>renderThumbStyle({size:n.size,move:n.move,bar:g.value})),y=vue.computed(()=>a.value[g.value.offset]**2/i.wrapElement[g.value.scrollSize]/n.ratio/u.value[g.value.offset]),_=L=>{var M;if(L.stopPropagation(),L.ctrlKey||[1,2].includes(L.button))return;(M=window.getSelection())==null||M.removeAllRanges(),A(L);const re=L.currentTarget;re&&(c.value[g.value.axis]=re[g.value.offset]-(L[g.value.client]-re.getBoundingClientRect()[g.value.direction]))},b=L=>{if(!u.value||!a.value||!i.wrapElement)return;const M=Math.abs(L.target.getBoundingClientRect()[g.value.direction]-L[g.value.client]),re=u.value[g.value.offset]/2,F=(M-re)*100*y.value/a.value[g.value.offset];i.wrapElement[g.value.scroll]=F*i.wrapElement[g.value.scrollSize]/100},A=L=>{L.stopImmediatePropagation(),d=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",T),v=document.onselectstart,document.onselectstart=()=>!1},w=L=>{if(!a.value||!u.value||d===!1)return;const M=c.value[g.value.axis];if(!M)return;const re=(a.value.getBoundingClientRect()[g.value.direction]-L[g.value.client])*-1,F=u.value[g.value.offset]-M,j=(re-F)*100*y.value/a.value[g.value.offset];i.wrapElement[g.value.scroll]=j*i.wrapElement[g.value.scrollSize]/100},T=()=>{d=!1,c.value[g.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T),O(),h&&(f.value=!1)},S=()=>{h=!1,f.value=!!n.size},x=()=>{h=!0,f.value=d};vue.onBeforeUnmount(()=>{O(),document.removeEventListener("mouseup",T)});const O=()=>{document.onselectstart!==v&&(document.onselectstart=v)};return useEventListener(vue.toRef(i,"scrollbarElement"),"mousemove",S),useEventListener(vue.toRef(i,"scrollbarElement"),"mouseleave",x),(L,M)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(o).b("fade"),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{ref_key:"instance",ref:a,class:vue.normalizeClass([vue.unref(o).e("bar"),vue.unref(o).is(vue.unref(g).key)]),onMousedown:b},[vue.createElementVNode("div",{ref_key:"thumb",ref:u,class:vue.normalizeClass(vue.unref(o).e("thumb")),style:vue.normalizeStyle(vue.unref(p)),onMousedown:_},null,38)],34),[[vue.vShow,L.always||f.value]])]),_:1},8,["name"]))}});var Thumb=_export_sfc(_sfc_main$n,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);const barProps=buildProps({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}}),_sfc_main$m=vue.defineComponent({__name:"bar",props:barProps,setup(r,{expose:n}){const i=r,o=vue.ref(0),a=vue.ref(0);return n({handleScroll:c=>{if(c){const f=c.offsetHeight-GAP,d=c.offsetWidth-GAP;a.value=c.scrollTop*100/f*i.ratioY,o.value=c.scrollLeft*100/d*i.ratioX}}}),(c,f)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(Thumb,{move:o.value,ratio:c.ratioX,size:c.width,always:c.always},null,8,["move","ratio","size","always"]),vue.createVNode(Thumb,{move:a.value,ratio:c.ratioY,size:c.height,vertical:"",always:c.always},null,8,["move","ratio","size","always"])],64))}});var Bar=_export_sfc(_sfc_main$m,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);const scrollbarProps=buildProps({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:definePropType([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20}}),scrollbarEmits={scroll:({scrollTop:r,scrollLeft:n})=>[r,n].every(isNumber)},COMPONENT_NAME$1="ElScrollbar",__default__$8=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$l=vue.defineComponent({...__default__$8,props:scrollbarProps,emits:scrollbarEmits,setup(r,{expose:n,emit:i}){const o=r,a=useNamespace("scrollbar");let u,c;const f=vue.ref(),d=vue.ref(),h=vue.ref(),v=vue.ref("0"),g=vue.ref("0"),p=vue.ref(),y=vue.ref(1),_=vue.ref(1),b=vue.computed(()=>{const M={};return o.height&&(M.height=addUnit(o.height)),o.maxHeight&&(M.maxHeight=addUnit(o.maxHeight)),[o.wrapStyle,M]}),A=vue.computed(()=>[o.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!o.native}]),w=vue.computed(()=>[a.e("view"),o.viewClass]),T=()=>{var M;d.value&&((M=p.value)==null||M.handleScroll(d.value),i("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function S(M,re){isObject(M)?d.value.scrollTo(M):isNumber(M)&&isNumber(re)&&d.value.scrollTo(M,re)}const x=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}d.value.scrollTop=M},O=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}d.value.scrollLeft=M},L=()=>{if(!d.value)return;const M=d.value.offsetHeight-GAP,re=d.value.offsetWidth-GAP,F=M**2/d.value.scrollHeight,j=re**2/d.value.scrollWidth,V=Math.max(F,o.minSize),z=Math.max(j,o.minSize);y.value=F/(M-F)/(V/(M-V)),_.value=j/(re-j)/(z/(re-z)),g.value=V+GAP<M?`${V}px`:"",v.value=z+GAP<re?`${z}px`:""};return vue.watch(()=>o.noresize,M=>{M?(u==null||u(),c==null||c()):({stop:u}=useResizeObserver(h,L),c=useEventListener("resize",L))},{immediate:!0}),vue.watch(()=>[o.maxHeight,o.height],()=>{o.native||vue.nextTick(()=>{var M;L(),d.value&&((M=p.value)==null||M.handleScroll(d.value))})}),vue.provide(scrollbarContextKey,vue.reactive({scrollbarElement:f,wrapElement:d})),vue.onMounted(()=>{o.native||vue.nextTick(()=>{L()})}),vue.onUpdated(()=>L()),n({wrapRef:d,update:L,scrollTo:S,setScrollTop:x,setScrollLeft:O,handleScroll:T}),(M,re)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"scrollbarRef",ref:f,class:vue.normalizeClass(vue.unref(a).b())},[vue.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:vue.normalizeClass(vue.unref(A)),style:vue.normalizeStyle(vue.unref(b)),onScroll:T},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(M.tag),{ref_key:"resizeRef",ref:h,class:vue.normalizeClass(vue.unref(w)),style:vue.normalizeStyle(M.viewStyle)},{default:vue.withCtx(()=>[vue.renderSlot(M.$slots,"default")]),_:3},8,["class","style"]))],38),M.native?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(Bar,{key:0,ref_key:"barRef",ref:p,height:g.value,width:v.value,always:M.always,"ratio-x":_.value,"ratio-y":y.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var Scrollbar=_export_sfc(_sfc_main$l,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);const ElScrollbar=withInstall(Scrollbar),POPPER_INJECTION_KEY=Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=Symbol("popperContent"),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),__default__$7=vue.defineComponent({name:"ElPopper",inheritAttrs:!1}),_sfc_main$k=vue.defineComponent({...__default__$7,props:popperProps,setup(r,{expose:n}){const i=r,o=vue.ref(),a=vue.ref(),u=vue.ref(),c=vue.ref(),f=vue.computed(()=>i.role),d={triggerRef:o,popperInstanceRef:a,contentRef:u,referenceRef:c,role:f};return n(d),vue.provide(POPPER_INJECTION_KEY,d),(h,v)=>vue.renderSlot(h.$slots,"default")}});var Popper=_export_sfc(_sfc_main$k,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/popper.vue"]]);const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),__default__$6=vue.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),_sfc_main$j=vue.defineComponent({...__default__$6,props:popperArrowProps,setup(r,{expose:n}){const i=r,o=useNamespace("popper"),{arrowOffset:a,arrowRef:u,arrowStyle:c}=vue.inject(POPPER_CONTENT_INJECTION_KEY,void 0);return vue.watch(()=>i.arrowOffset,f=>{a.value=f}),vue.onBeforeUnmount(()=>{u.value=void 0}),n({arrowRef:u}),(f,d)=>(vue.openBlock(),vue.createElementBlock("span",{ref_key:"arrowRef",ref:u,class:vue.normalizeClass(vue.unref(o).e("arrow")),style:vue.normalizeStyle(vue.unref(c)),"data-popper-arrow":""},null,6))}});var ElPopperArrow=_export_sfc(_sfc_main$j,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);const NAME="ElOnlyChild",OnlyChild=vue.defineComponent({name:NAME,setup(r,{slots:n,attrs:i}){var o;const a=vue.inject(FORWARD_REF_INJECTION_KEY),u=useForwardRefDirective((o=a==null?void 0:a.setForwardRef)!=null?o:NOOP);return()=>{var c;const f=(c=n.default)==null?void 0:c.call(n,i);if(!f)return null;if(f.length>1)return debugWarn(NAME,"requires exact only one valid child."),null;const d=findFirstLegitChild(f);return d?vue.withDirectives(vue.cloneVNode(d,i),[[u]]):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(r){if(!r)return null;const n=r;for(const i of n){if(isObject(i))switch(i.type){case vue.Comment:continue;case vue.Text:case"svg":return wrapTextContent(i);case vue.Fragment:return findFirstLegitChild(i.children);default:return i}return wrapTextContent(i)}return null}function wrapTextContent(r){const n=useNamespace("only-child");return vue.createVNode("span",{class:n.e("content")},[r])}const popperTriggerProps=buildProps({virtualRef:{type:definePropType(Object)},virtualTriggering:Boolean,onMouseenter:{type:definePropType(Function)},onMouseleave:{type:definePropType(Function)},onClick:{type:definePropType(Function)},onKeydown:{type:definePropType(Function)},onFocus:{type:definePropType(Function)},onBlur:{type:definePropType(Function)},onContextmenu:{type:definePropType(Function)},id:String,open:Boolean}),__default__$5=vue.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),_sfc_main$i=vue.defineComponent({...__default__$5,props:popperTriggerProps,setup(r,{expose:n}){const i=r,{role:o,triggerRef:a}=vue.inject(POPPER_INJECTION_KEY,void 0);useForwardRef(a);const u=vue.computed(()=>f.value?i.id:void 0),c=vue.computed(()=>{if(o&&o.value==="tooltip")return i.open&&i.id?i.id:void 0}),f=vue.computed(()=>{if(o&&o.value!=="tooltip")return o.value}),d=vue.computed(()=>f.value?`${i.open}`:void 0);let h;return vue.onMounted(()=>{vue.watch(()=>i.virtualRef,v=>{v&&(a.value=unrefElement(v))},{immediate:!0}),vue.watch(a,(v,g)=>{h==null||h(),h=void 0,isElement(v)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(p=>{var y;const _=i[p];_&&(v.addEventListener(p.slice(2).toLowerCase(),_),(y=g==null?void 0:g.removeEventListener)==null||y.call(g,p.slice(2).toLowerCase(),_))}),h=vue.watch([u,c,f,d],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((y,_)=>{lodashEs.isNil(p[_])?v.removeAttribute(y):v.setAttribute(y,p[_])})},{immediate:!0})),isElement(g)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>g.removeAttribute(p))},{immediate:!0})}),vue.onBeforeUnmount(()=>{h==null||h(),h=void 0}),n({triggerRef:a}),(v,g)=>v.virtualTriggering?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(OnlyChild),vue.mergeProps({key:0},v.$attrs,{"aria-controls":vue.unref(u),"aria-describedby":vue.unref(c),"aria-expanded":vue.unref(d),"aria-haspopup":vue.unref(f)}),{default:vue.withCtx(()=>[vue.renderSlot(v.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var ElPopperTrigger=_export_sfc(_sfc_main$i,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);const FOCUS_AFTER_TRAPPED="focus-trap.focus-after-trapped",FOCUS_AFTER_RELEASED="focus-trap.focus-after-released",FOCUSOUT_PREVENTED="focus-trap.focusout-prevented",FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},ON_TRAP_FOCUS_EVT="focusAfterTrapped",ON_RELEASE_FOCUS_EVT="focusAfterReleased",FOCUS_TRAP_INJECTION_KEY=Symbol("elFocusTrap"),focusReason=vue.ref(),lastUserFocusTimestamp=vue.ref(0),lastAutomatedFocusTimestamp=vue.ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=r=>{const n=[],i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n},getVisibleElement=(r,n)=>{for(const i of r)if(!isHidden(i,n))return i},isHidden=(r,n)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(n&&r===n)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1},getEdges=r=>{const n=obtainAllFocusableElements(r),i=getVisibleElement(n,r),o=getVisibleElement(n.reverse(),r);return[i,o]},isSelectable=r=>r instanceof HTMLInputElement&&"select"in r,tryFocus=(r,n)=>{if(r&&r.focus){const i=document.activeElement;r.focus({preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),r!==i&&isSelectable(r)&&n&&r.select()}};function removeFromStack(r,n){const i=[...r],o=r.indexOf(n);return o!==-1&&i.splice(o,1),i}const createFocusableStack=()=>{let r=[];return{push:o=>{const a=r[0];a&&o!==a&&a.pause(),r=removeFromStack(r,o),r.unshift(o)},remove:o=>{var a,u;r=removeFromStack(r,o),(u=(a=r[0])==null?void 0:a.resume)==null||u.call(a)}}},focusFirstDescendant=(r,n=!1)=>{const i=document.activeElement;for(const o of r)if(tryFocus(o,n),document.activeElement!==i)return},focusableStack=createFocusableStack(),isFocusCausedByUserEvent=()=>lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value,notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},useFocusReason=()=>(vue.onMounted(()=>{focusReasonUserCount===0&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),vue.onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason,lastUserFocusTimestamp,lastAutomatedFocusTimestamp}),createFocusOutPreventedEvent=r=>new CustomEvent(FOCUSOUT_PREVENTED,{...FOCUSOUT_PREVENTED_OPTS,detail:r}),_sfc_main$h=vue.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[ON_TRAP_FOCUS_EVT,ON_RELEASE_FOCUS_EVT,"focusin","focusout","focusout-prevented","release-requested"],setup(r,{emit:n}){const i=vue.ref();let o,a;const{focusReason:u}=useFocusReason();useEscapeKeydown(_=>{r.trapped&&!c.paused&&n("release-requested",_)});const c={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},f=_=>{if(!r.loop&&!r.trapped||c.paused)return;const{key:b,altKey:A,ctrlKey:w,metaKey:T,currentTarget:S,shiftKey:x}=_,{loop:O}=r,L=b===EVENT_CODE.tab&&!A&&!w&&!T,M=document.activeElement;if(L&&M){const re=S,[F,j]=getEdges(re);if(F&&j){if(!x&&M===j){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||(_.preventDefault(),O&&tryFocus(F,!0))}else if(x&&[F,re].includes(M)){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||(_.preventDefault(),O&&tryFocus(j,!0))}}else if(M===re){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||_.preventDefault()}}};vue.provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:i,onKeydown:f}),vue.watch(()=>r.focusTrapEl,_=>{_&&(i.value=_)},{immediate:!0}),vue.watch([i],([_],[b])=>{_&&(_.addEventListener("keydown",f),_.addEventListener("focusin",v),_.addEventListener("focusout",g)),b&&(b.removeEventListener("keydown",f),b.removeEventListener("focusin",v),b.removeEventListener("focusout",g))});const d=_=>{n(ON_TRAP_FOCUS_EVT,_)},h=_=>n(ON_RELEASE_FOCUS_EVT,_),v=_=>{const b=vue.unref(i);if(!b)return;const A=_.target,w=_.relatedTarget,T=A&&b.contains(A);r.trapped||w&&b.contains(w)||(o=w),T&&n("focusin",_),!c.paused&&r.trapped&&(T?a=A:tryFocus(a,!0))},g=_=>{const b=vue.unref(i);if(!(c.paused||!b))if(r.trapped){const A=_.relatedTarget;!lodashEs.isNil(A)&&!b.contains(A)&&setTimeout(()=>{if(!c.paused&&r.trapped){const w=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",w),w.defaultPrevented||tryFocus(a,!0)}},0)}else{const A=_.target;A&&b.contains(A)||n("focusout",_)}};async function p(){await vue.nextTick();const _=vue.unref(i);if(_){focusableStack.push(c);const b=_.contains(document.activeElement)?o:document.activeElement;if(o=b,!_.contains(b)){const w=new Event(FOCUS_AFTER_TRAPPED,FOCUS_AFTER_TRAPPED_OPTS);_.addEventListener(FOCUS_AFTER_TRAPPED,d),_.dispatchEvent(w),w.defaultPrevented||vue.nextTick(()=>{let T=r.focusStartEl;isString(T)||(tryFocus(T),document.activeElement!==T&&(T="first")),T==="first"&&focusFirstDescendant(obtainAllFocusableElements(_),!0),(document.activeElement===b||T==="container")&&tryFocus(_)})}}}function y(){const _=vue.unref(i);if(_){_.removeEventListener(FOCUS_AFTER_TRAPPED,d);const b=new CustomEvent(FOCUS_AFTER_RELEASED,{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:u.value}});_.addEventListener(FOCUS_AFTER_RELEASED,h),_.dispatchEvent(b),!b.defaultPrevented&&(u.value=="keyboard"||!isFocusCausedByUserEvent()||_.contains(document.activeElement))&&tryFocus(o??document.body),_.removeEventListener(FOCUS_AFTER_RELEASED,d),focusableStack.remove(c)}}return vue.onMounted(()=>{r.trapped&&p(),vue.watch(()=>r.trapped,_=>{_?p():y()})}),vue.onBeforeUnmount(()=>{r.trapped&&y()}),{onKeydown:f}}});function _sfc_render$4(r,n,i,o,a,u){return vue.renderSlot(r.$slots,"default",{handleKeydown:r.onKeydown})}var ElFocusTrap=_export_sfc(_sfc_main$h,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);const POSITIONING_STRATEGIES=["fixed","absolute"],popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:definePropType(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:definePropType(Object),default:()=>({})},strategy:{type:String,values:POSITIONING_STRATEGIES,default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,id:String,style:{type:definePropType([String,Array,Object])},className:{type:definePropType([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:definePropType([String,Array,Object])},popperStyle:{type:definePropType([String,Array,Object])},referenceEl:{type:definePropType(Object)},triggerTargetEl:{type:definePropType(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),popperContentEmits={mouseenter:r=>r instanceof MouseEvent,mouseleave:r=>r instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},buildPopperOptions=(r,n=[])=>{const{placement:i,strategy:o,popperOptions:a}=r,u={placement:i,strategy:o,...a,modifiers:[...genModifiers(r),...n]};return deriveExtraModifiers(u,a==null?void 0:a.modifiers),u},unwrapMeasurableEl=r=>{if(isClient)return unrefElement(r)};function genModifiers(r){const{offset:n,gpuAcceleration:i,fallbackPlacements:o}=r;return[{name:"offset",options:{offset:[0,n??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:o}},{name:"computeStyles",options:{gpuAcceleration:i}}]}function deriveExtraModifiers(r,n){n&&(r.modifiers=[...r.modifiers,...n??[]])}const DEFAULT_ARROW_OFFSET=0,usePopperContent=r=>{const{popperInstanceRef:n,contentRef:i,triggerRef:o,role:a}=vue.inject(POPPER_INJECTION_KEY,void 0),u=vue.ref(),c=vue.ref(),f=vue.computed(()=>({name:"eventListeners",enabled:!!r.visible})),d=vue.computed(()=>{var w;const T=vue.unref(u),S=(w=vue.unref(c))!=null?w:DEFAULT_ARROW_OFFSET;return{name:"arrow",enabled:!lodashEs.isUndefined(T),options:{element:T,padding:S}}}),h=vue.computed(()=>({onFirstUpdate:()=>{_()},...buildPopperOptions(r,[vue.unref(d),vue.unref(f)])})),v=vue.computed(()=>unwrapMeasurableEl(r.referenceEl)||vue.unref(o)),{attributes:g,state:p,styles:y,update:_,forceUpdate:b,instanceRef:A}=usePopper(v,i,h);return vue.watch(A,w=>n.value=w),vue.onMounted(()=>{vue.watch(()=>{var w;return(w=vue.unref(v))==null?void 0:w.getBoundingClientRect()},()=>{_()})}),{attributes:g,arrowRef:u,contentRef:i,instanceRef:A,state:p,styles:y,role:a,forceUpdate:b,update:_}},usePopperContentDOM=(r,{attributes:n,styles:i,role:o})=>{const{nextZIndex:a}=useZIndex(),u=useNamespace("popper"),c=vue.computed(()=>vue.unref(n).popper),f=vue.ref(r.zIndex||a()),d=vue.computed(()=>[u.b(),u.is("pure",r.pure),u.is(r.effect),r.popperClass]),h=vue.computed(()=>[{zIndex:vue.unref(f)},vue.unref(i).popper,r.popperStyle||{}]),v=vue.computed(()=>o.value==="dialog"?"false":void 0),g=vue.computed(()=>vue.unref(i).arrow||{});return{ariaModal:v,arrowStyle:g,contentAttrs:c,contentClass:d,contentStyle:h,contentZIndex:f,updateZIndex:()=>{f.value=r.zIndex||a()}}},usePopperContentFocusTrap=(r,n)=>{const i=vue.ref(!1),o=vue.ref();return{focusStartRef:o,trapped:i,onFocusAfterReleased:h=>{var v;((v=h.detail)==null?void 0:v.focusReason)!=="pointer"&&(o.value="first",n("blur"))},onFocusAfterTrapped:()=>{n("focus")},onFocusInTrap:h=>{r.visible&&!i.value&&(h.target&&(o.value=h.target),i.value=!0)},onFocusoutPrevented:h=>{r.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),i.value=!1)},onReleaseRequested:()=>{i.value=!1,n("close")}}},__default__$4=vue.defineComponent({name:"ElPopperContent"}),_sfc_main$g=vue.defineComponent({...__default__$4,props:popperContentProps,emits:popperContentEmits,setup(r,{expose:n,emit:i}){const o=r,{focusStartRef:a,trapped:u,onFocusAfterReleased:c,onFocusAfterTrapped:f,onFocusInTrap:d,onFocusoutPrevented:h,onReleaseRequested:v}=usePopperContentFocusTrap(o,i),{attributes:g,arrowRef:p,contentRef:y,styles:_,instanceRef:b,role:A,update:w}=usePopperContent(o),{ariaModal:T,arrowStyle:S,contentAttrs:x,contentClass:O,contentStyle:L,updateZIndex:M}=usePopperContentDOM(o,{styles:_,attributes:g,role:A}),re=vue.inject(formItemContextKey,void 0),F=vue.ref();vue.provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:S,arrowRef:p,arrowOffset:F}),re&&(re.addInputId||re.removeInputId)&&vue.provide(formItemContextKey,{...re,addInputId:NOOP,removeInputId:NOOP});let j;const V=($=!0)=>{w(),$&&M()},z=()=>{V(!1),o.visible&&o.focusOnShow?u.value=!0:o.visible===!1&&(u.value=!1)};return vue.onMounted(()=>{vue.watch(()=>o.triggerTargetEl,($,he)=>{j==null||j(),j=void 0;const le=vue.unref($||y.value),Ie=vue.unref(he||y.value);isElement(le)&&(j=vue.watch([A,()=>o.ariaLabel,T,()=>o.id],Fe=>{["role","aria-label","aria-modal","id"].forEach((pe,Lt)=>{lodashEs.isNil(Fe[Lt])?le.removeAttribute(pe):le.setAttribute(pe,Fe[Lt])})},{immediate:!0})),Ie!==le&&isElement(Ie)&&["role","aria-label","aria-modal","id"].forEach(Fe=>{Ie.removeAttribute(Fe)})},{immediate:!0}),vue.watch(()=>o.visible,z,{immediate:!0})}),vue.onBeforeUnmount(()=>{j==null||j(),j=void 0}),n({popperContentRef:y,popperInstanceRef:b,updatePopper:V,contentStyle:L}),($,he)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({ref_key:"contentRef",ref:y},vue.unref(x),{style:vue.unref(L),class:vue.unref(O),tabindex:"-1",onMouseenter:he[0]||(he[0]=le=>$.$emit("mouseenter",le)),onMouseleave:he[1]||(he[1]=le=>$.$emit("mouseleave",le))}),[vue.createVNode(vue.unref(ElFocusTrap),{trapped:vue.unref(u),"trap-on-focus-in":!0,"focus-trap-el":vue.unref(y),"focus-start-el":vue.unref(a),onFocusAfterTrapped:vue.unref(f),onFocusAfterReleased:vue.unref(c),onFocusin:vue.unref(d),onFocusoutPrevented:vue.unref(h),onReleaseRequested:vue.unref(v)},{default:vue.withCtx(()=>[vue.renderSlot($.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var ElPopperContent=_export_sfc(_sfc_main$g,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/content.vue"]]);const ElPopper=withInstall(Popper),TOOLTIP_INJECTION_KEY=Symbol("elTooltip"),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:definePropType([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:definePropType(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:definePropType([String,Array]),default:"hover"},triggerKeys:{type:definePropType(Array),default:()=>[EVENT_CODE.enter,EVENT_CODE.space]}}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=createModelToggleComposable("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],isTriggerType=(r,n)=>isArray(r)?r.includes(n):r===n,whenTrigger=(r,n,i)=>o=>{isTriggerType(vue.unref(r),n)&&i(o)},__default__$3=vue.defineComponent({name:"ElTooltipTrigger"}),_sfc_main$f=vue.defineComponent({...__default__$3,props:useTooltipTriggerProps,setup(r,{expose:n}){const i=r,o=useNamespace("tooltip"),{controlled:a,id:u,open:c,onOpen:f,onClose:d,onToggle:h}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),v=vue.ref(null),g=()=>{if(vue.unref(a)||i.disabled)return!0},p=vue.toRef(i,"trigger"),y=composeEventHandlers(g,whenTrigger(p,"hover",f)),_=composeEventHandlers(g,whenTrigger(p,"hover",d)),b=composeEventHandlers(g,whenTrigger(p,"click",x=>{x.button===0&&h(x)})),A=composeEventHandlers(g,whenTrigger(p,"focus",f)),w=composeEventHandlers(g,whenTrigger(p,"focus",d)),T=composeEventHandlers(g,whenTrigger(p,"contextmenu",x=>{x.preventDefault(),h(x)})),S=composeEventHandlers(g,x=>{const{code:O}=x;i.triggerKeys.includes(O)&&(x.preventDefault(),h(x))});return n({triggerRef:v}),(x,O)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopperTrigger),{id:vue.unref(u),"virtual-ref":x.virtualRef,open:vue.unref(c),"virtual-triggering":x.virtualTriggering,class:vue.normalizeClass(vue.unref(o).e("trigger")),onBlur:vue.unref(w),onClick:vue.unref(b),onContextmenu:vue.unref(T),onFocus:vue.unref(A),onMouseenter:vue.unref(y),onMouseleave:vue.unref(_),onKeydown:vue.unref(S)},{default:vue.withCtx(()=>[vue.renderSlot(x.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ElTooltipTrigger=_export_sfc(_sfc_main$f,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/trigger.vue"]]);const __default__$2=vue.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_sfc_main$e=vue.defineComponent({...__default__$2,props:useTooltipContentProps,setup(r,{expose:n}){const i=r,{selector:o}=usePopperContainerId(),a=useNamespace("tooltip"),u=vue.ref(null),c=vue.ref(!1),{controlled:f,id:d,open:h,trigger:v,onClose:g,onOpen:p,onShow:y,onHide:_,onBeforeShow:b,onBeforeHide:A}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),w=vue.computed(()=>i.transition||`${a.namespace.value}-fade-in-linear`),T=vue.computed(()=>process.env.NODE_ENV==="test"?!0:i.persistent);vue.onBeforeUnmount(()=>{c.value=!0});const S=vue.computed(()=>vue.unref(T)?!0:vue.unref(h)),x=vue.computed(()=>i.disabled?!1:vue.unref(h)),O=vue.computed(()=>i.appendTo||o.value),L=vue.computed(()=>{var Fe;return(Fe=i.style)!=null?Fe:{}}),M=vue.computed(()=>!vue.unref(h)),re=()=>{_()},F=()=>{if(vue.unref(f))return!0},j=composeEventHandlers(F,()=>{i.enterable&&vue.unref(v)==="hover"&&p()}),V=composeEventHandlers(F,()=>{vue.unref(v)==="hover"&&g()}),z=()=>{var Fe,pe;(pe=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||pe.call(Fe),b==null||b()},$=()=>{A==null||A()},he=()=>{y(),Ie=onClickOutside(vue.computed(()=>{var Fe;return(Fe=u.value)==null?void 0:Fe.popperContentRef}),()=>{if(vue.unref(f))return;vue.unref(v)!=="hover"&&g()})},le=()=>{i.virtualTriggering||g()};let Ie;return vue.watch(()=>vue.unref(h),Fe=>{Fe||Ie==null||Ie()},{flush:"post"}),vue.watch(()=>i.content,()=>{var Fe,pe;(pe=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||pe.call(Fe)}),n({contentRef:u}),(Fe,pe)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{disabled:!Fe.teleported,to:vue.unref(O)},[vue.createVNode(vue.Transition,{name:vue.unref(w),onAfterLeave:re,onBeforeEnter:z,onAfterEnter:he,onBeforeLeave:$},{default:vue.withCtx(()=>[vue.unref(S)?vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElPopperContent),vue.mergeProps({key:0,id:vue.unref(d),ref_key:"contentRef",ref:u},Fe.$attrs,{"aria-label":Fe.ariaLabel,"aria-hidden":vue.unref(M),"boundaries-padding":Fe.boundariesPadding,"fallback-placements":Fe.fallbackPlacements,"gpu-acceleration":Fe.gpuAcceleration,offset:Fe.offset,placement:Fe.placement,"popper-options":Fe.popperOptions,strategy:Fe.strategy,effect:Fe.effect,enterable:Fe.enterable,pure:Fe.pure,"popper-class":Fe.popperClass,"popper-style":[Fe.popperStyle,vue.unref(L)],"reference-el":Fe.referenceEl,"trigger-target-el":Fe.triggerTargetEl,visible:vue.unref(x),"z-index":Fe.zIndex,onMouseenter:vue.unref(j),onMouseleave:vue.unref(V),onBlur:le,onClose:vue.unref(g)}),{default:vue.withCtx(()=>[c.value?vue.createCommentVNode("v-if",!0):vue.renderSlot(Fe.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[vue.vShow,vue.unref(x)]]):vue.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var ElTooltipContent=_export_sfc(_sfc_main$e,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/content.vue"]]);const _hoisted_1$6=["innerHTML"],_hoisted_2$4={key:1},__default__$1=vue.defineComponent({name:"ElTooltip"}),_sfc_main$d=vue.defineComponent({...__default__$1,props:useTooltipProps,emits:tooltipEmits,setup(r,{expose:n,emit:i}){const o=r;usePopperContainer();const a=useId(),u=vue.ref(),c=vue.ref(),f=()=>{var w;const T=vue.unref(u);T&&((w=T.popperInstanceRef)==null||w.update())},d=vue.ref(!1),h=vue.ref(),{show:v,hide:g,hasUpdateHandler:p}=useTooltipModelToggle({indicator:d,toggleReason:h}),{onOpen:y,onClose:_}=useDelayedToggle({showAfter:vue.toRef(o,"showAfter"),hideAfter:vue.toRef(o,"hideAfter"),autoClose:vue.toRef(o,"autoClose"),open:v,close:g}),b=vue.computed(()=>isBoolean(o.visible)&&!p.value);vue.provide(TOOLTIP_INJECTION_KEY,{controlled:b,id:a,open:vue.readonly(d),trigger:vue.toRef(o,"trigger"),onOpen:w=>{y(w)},onClose:w=>{_(w)},onToggle:w=>{vue.unref(d)?_(w):y(w)},onShow:()=>{i("show",h.value)},onHide:()=>{i("hide",h.value)},onBeforeShow:()=>{i("before-show",h.value)},onBeforeHide:()=>{i("before-hide",h.value)},updatePopper:f}),vue.watch(()=>o.disabled,w=>{w&&d.value&&(d.value=!1)});const A=()=>{var w,T;const S=(T=(w=c.value)==null?void 0:w.contentRef)==null?void 0:T.popperContentRef;return S&&S.contains(document.activeElement)};return vue.onDeactivated(()=>d.value&&g()),n({popperRef:u,contentRef:c,isFocusInsideContent:A,updatePopper:f,onOpen:y,onClose:_,hide:g}),(w,T)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopper),{ref_key:"popperRef",ref:u,role:w.role},{default:vue.withCtx(()=>[vue.createVNode(ElTooltipTrigger,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:vue.withCtx(()=>[w.$slots.default?vue.renderSlot(w.$slots,"default",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),vue.createVNode(ElTooltipContent,{ref_key:"contentRef",ref:c,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:vue.withCtx(()=>[vue.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(vue.openBlock(),vue.createElementBlock("span",{key:0,innerHTML:w.content},null,8,_hoisted_1$6)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$4,vue.toDisplayString(w.content),1))]),w.showArrow?(vue.openBlock(),vue.createBlock(vue.unref(ElPopperArrow),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):vue.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Tooltip=_export_sfc(_sfc_main$d,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/tooltip.vue"]]);const ElTooltip=withInstall(Tooltip);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const nodeList=new Map;let startClick;isClient&&(document.addEventListener("mousedown",r=>startClick=r),document.addEventListener("mouseup",r=>{for(const n of nodeList.values())for(const{documentHandler:i}of n)i(r,startClick)}));function createDocumentHandler(r,n){let i=[];return Array.isArray(n.arg)?i=n.arg:isElement(n.arg)&&i.push(n.arg),function(o,a){const u=n.instance.popperRef,c=o.target,f=a==null?void 0:a.target,d=!n||!n.instance,h=!c||!f,v=r.contains(c)||r.contains(f),g=r===c,p=i.length&&i.some(_=>_==null?void 0:_.contains(c))||i.length&&i.includes(f),y=u&&(u.contains(c)||u.contains(f));d||h||v||g||p||y||n.value(o,a)}}const ClickOutside={beforeMount(r,n){nodeList.has(r)||nodeList.set(r,[]),nodeList.get(r).push({documentHandler:createDocumentHandler(r,n),bindingFn:n.value})},updated(r,n){nodeList.has(r)||nodeList.set(r,[]);const i=nodeList.get(r),o=i.findIndex(u=>u.bindingFn===n.oldValue),a={documentHandler:createDocumentHandler(r,n),bindingFn:n.value};o>=0?i.splice(o,1,a):i.push(a)},unmounted(r){nodeList.delete(r)}},tagProps=buildProps({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:componentSizes,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tagEmits={close:r=>r instanceof MouseEvent,click:r=>r instanceof MouseEvent},__default__=vue.defineComponent({name:"ElTag"}),_sfc_main$c=vue.defineComponent({...__default__,props:tagProps,emits:tagEmits,setup(r,{emit:n}){const i=r,o=useFormSize(),a=useNamespace("tag"),u=vue.computed(()=>{const{type:d,hit:h,effect:v,closable:g,round:p}=i;return[a.b(),a.is("closable",g),a.m(d),a.m(o.value),a.m(v),a.is("hit",h),a.is("round",p)]}),c=d=>{n("close",d)},f=d=>{n("click",d)};return(d,h)=>d.disableTransitions?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:d.color}),onClick:f},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(d.$slots,"default")],2),d.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,name:`${vue.unref(a).namespace.value}-zoom-in-center`,appear:""},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:d.color}),onClick:f},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(d.$slots,"default")],2),d.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Tag=_export_sfc(_sfc_main$c,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);const ElTag=withInstall(Tag),selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect");function useOption(r,n){const i=vue.inject(selectKey),o=vue.inject(selectGroupKey,{disabled:!1}),a=vue.computed(()=>Object.prototype.toString.call(r.value).toLowerCase()==="[object object]"),u=vue.computed(()=>i.props.multiple?g(i.props.modelValue,r.value):p(r.value,i.props.modelValue)),c=vue.computed(()=>{if(i.props.multiple){const b=i.props.modelValue||[];return!u.value&&b.length>=i.props.multipleLimit&&i.props.multipleLimit>0}else return!1}),f=vue.computed(()=>r.label||(a.value?"":r.value)),d=vue.computed(()=>r.value||r.label||""),h=vue.computed(()=>r.disabled||n.groupDisabled||c.value),v=vue.getCurrentInstance(),g=(b=[],A)=>{if(a.value){const w=i.props.valueKey;return b&&b.some(T=>vue.toRaw(lodashEs.get(T,w))===lodashEs.get(A,w))}else return b&&b.includes(A)},p=(b,A)=>{if(a.value){const{valueKey:w}=i.props;return lodashEs.get(b,w)===lodashEs.get(A,w)}else return b===A},y=()=>{!r.disabled&&!o.disabled&&(i.hoverIndex=i.optionsArray.indexOf(v.proxy))};vue.watch(()=>f.value,()=>{!r.created&&!i.props.remote&&i.setSelected()}),vue.watch(()=>r.value,(b,A)=>{const{remote:w,valueKey:T}=i.props;if(Object.is(b,A)||(i.onOptionDestroy(A,v.proxy),i.onOptionCreate(v.proxy)),!r.created&&!w){if(T&&typeof b=="object"&&typeof A=="object"&&b[T]===A[T])return;i.setSelected()}}),vue.watch(()=>o.disabled,()=>{n.groupDisabled=o.disabled},{immediate:!0});const{queryChange:_}=vue.toRaw(i);return vue.watch(_,b=>{const{query:A}=vue.unref(b),w=new RegExp(escapeStringRegexp(A),"i");n.visible=w.test(f.value)||r.created,n.visible||i.filteredOptionsCount--},{immediate:!0}),{select:i,currentLabel:f,currentValue:d,itemSelected:u,isDisabled:h,hoverItem:y}}const _sfc_main$b=vue.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},setup(r){const n=useNamespace("select"),i=vue.computed(()=>[n.be("dropdown","item"),n.is("disabled",vue.unref(c)),{selected:vue.unref(u),hover:vue.unref(v)}]),o=vue.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:a,itemSelected:u,isDisabled:c,select:f,hoverItem:d}=useOption(r,o),{visible:h,hover:v}=vue.toRefs(o),g=vue.getCurrentInstance().proxy;f.onOptionCreate(g),vue.onBeforeUnmount(()=>{const y=g.value,{selected:_}=f,A=(f.props.multiple?_:[_]).some(w=>w.value===g.value);vue.nextTick(()=>{f.cachedOptions.get(y)===g&&!A&&f.cachedOptions.delete(y)}),f.onOptionDestroy(y,g)});function p(){r.disabled!==!0&&o.groupDisabled!==!0&&f.handleOptionSelect(g)}return{ns:n,containerKls:i,currentLabel:a,itemSelected:u,isDisabled:c,select:f,hoverItem:d,visible:h,hover:v,selectOptionClick:p,states:o}}});function _sfc_render$3(r,n,i,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass(r.containerKls),onMouseenter:n[0]||(n[0]=(...c)=>r.hoverItem&&r.hoverItem(...c)),onClick:n[1]||(n[1]=vue.withModifiers((...c)=>r.selectOptionClick&&r.selectOptionClick(...c),["stop"]))},[vue.renderSlot(r.$slots,"default",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(r.currentLabel),1)])],34)),[[vue.vShow,r.visible]])}var Option=_export_sfc(_sfc_main$b,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);const _sfc_main$a=vue.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const r=vue.inject(selectKey),n=useNamespace("select"),i=vue.computed(()=>r.props.popperClass),o=vue.computed(()=>r.props.multiple),a=vue.computed(()=>r.props.fitInputWidth),u=vue.ref("");function c(){var f;u.value=`${(f=r.selectWrapper)==null?void 0:f.offsetWidth}px`}return vue.onMounted(()=>{c(),useResizeObserver(r.selectWrapper,c)}),{ns:n,minWidth:u,popperClass:i,isMultiple:o,isFitInputWidth:a}}});function _sfc_render$2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([r.ns.b("dropdown"),r.ns.is("multiple",r.isMultiple),r.popperClass]),style:vue.normalizeStyle({[r.isFitInputWidth?"width":"minWidth"]:r.minWidth})},[vue.renderSlot(r.$slots,"default")],6)}var ElSelectMenu=_export_sfc(_sfc_main$a,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);function useSelectStates(r){const{t:n}=useLocale();return vue.reactive({options:new Map,cachedOptions:new Map,createdLabel:null,createdSelected:!1,selected:r.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:n("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1})}let ignoreFocusEvent=!1;const useSelect=(r,n,i)=>{const{t:o}=useLocale(),a=useNamespace("select");useDeprecated({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},vue.computed(()=>r.suffixTransition===!1));const u=vue.ref(null),c=vue.ref(null),f=vue.ref(null),d=vue.ref(null),h=vue.ref(null),v=vue.ref(null),g=vue.ref(null),p=vue.ref(null),y=vue.ref(-1),_=vue.shallowRef({query:""}),b=vue.shallowRef(""),A=vue.ref([]);let w=0;const{form:T,formItem:S}=useFormItem(),x=vue.computed(()=>!r.filterable||r.multiple||!n.visible),O=vue.computed(()=>r.disabled||(T==null?void 0:T.disabled)),L=vue.computed(()=>{const bn=r.multiple?Array.isArray(r.modelValue)&&r.modelValue.length>0:r.modelValue!==void 0&&r.modelValue!==null&&r.modelValue!=="";return r.clearable&&!O.value&&n.inputHovering&&bn}),M=vue.computed(()=>r.remote&&r.filterable&&!r.remoteShowSuffix?"":r.suffixIcon),re=vue.computed(()=>a.is("reverse",M.value&&n.visible&&r.suffixTransition)),F=vue.computed(()=>r.remote?300:0),j=vue.computed(()=>r.loading?r.loadingText||o("el.select.loading"):r.remote&&n.query===""&&n.options.size===0?!1:r.filterable&&n.query&&n.options.size>0&&n.filteredOptionsCount===0?r.noMatchText||o("el.select.noMatch"):n.options.size===0?r.noDataText||o("el.select.noData"):null),V=vue.computed(()=>{const bn=Array.from(n.options.values()),wn=[];return A.value.forEach(Ln=>{const Bn=bn.findIndex(Mn=>Mn.currentLabel===Ln);Bn>-1&&wn.push(bn[Bn])}),wn.length?wn:bn}),z=vue.computed(()=>Array.from(n.cachedOptions.values())),$=vue.computed(()=>{const bn=V.value.filter(wn=>!wn.created).some(wn=>wn.currentLabel===n.query);return r.filterable&&r.allowCreate&&n.query!==""&&!bn}),he=useFormSize(),le=vue.computed(()=>["small"].includes(he.value)?"small":"default"),Ie=vue.computed({get(){return n.visible&&j.value!==!1},set(bn){n.visible=bn}});vue.watch([()=>O.value,()=>he.value,()=>T==null?void 0:T.size],()=>{vue.nextTick(()=>{Fe()})}),vue.watch(()=>r.placeholder,bn=>{n.cachedPlaceHolder=n.currentPlaceholder=bn,r.multiple&&Array.isArray(r.modelValue)&&r.modelValue.length>0&&(n.currentPlaceholder="")}),vue.watch(()=>r.modelValue,(bn,wn)=>{r.multiple&&(Fe(),bn&&bn.length>0||c.value&&n.query!==""?n.currentPlaceholder="":n.currentPlaceholder=n.cachedPlaceHolder,r.filterable&&!r.reserveKeyword&&(n.query="",pe(n.query))),Et(),r.filterable&&!r.multiple&&(n.inputLength=20),!lodashEs.isEqual(bn,wn)&&r.validateEvent&&(S==null||S.validate("change").catch(Ln=>debugWarn(Ln)))},{flush:"post",deep:!0}),vue.watch(()=>n.visible,bn=>{var wn,Ln,Bn,Mn,On;bn?((Ln=(wn=d.value)==null?void 0:wn.updatePopper)==null||Ln.call(wn),r.filterable&&(n.filteredOptionsCount=n.optionsCount,n.query=r.remote?"":n.selectedLabel,(Mn=(Bn=f.value)==null?void 0:Bn.focus)==null||Mn.call(Bn),r.multiple?(On=c.value)==null||On.focus():n.selectedLabel&&(n.currentPlaceholder=`${n.selectedLabel}`,n.selectedLabel=""),pe(n.query),!r.multiple&&!r.remote&&(_.value.query="",vue.triggerRef(_),vue.triggerRef(b)))):(r.filterable&&(isFunction(r.filterMethod)&&r.filterMethod(""),isFunction(r.remoteMethod)&&r.remoteMethod("")),c.value&&c.value.blur(),n.query="",n.previousQuery=null,n.selectedLabel="",n.inputLength=20,n.menuVisibleOnFocus=!1,vn(),vue.nextTick(()=>{c.value&&c.value.value===""&&n.selected.length===0&&(n.currentPlaceholder=n.cachedPlaceHolder)}),r.multiple||(n.selected&&(r.filterable&&r.allowCreate&&n.createdSelected&&n.createdLabel?n.selectedLabel=n.createdLabel:n.selectedLabel=n.selected.currentLabel,r.filterable&&(n.query=n.selectedLabel)),r.filterable&&(n.currentPlaceholder=n.cachedPlaceHolder))),i.emit("visible-change",bn)}),vue.watch(()=>n.options.entries(),()=>{var bn,wn,Ln;if(!isClient)return;(wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn),r.multiple&&Fe();const Bn=((Ln=g.value)==null?void 0:Ln.querySelectorAll("input"))||[];Array.from(Bn).includes(document.activeElement)||Et(),r.defaultFirstOption&&(r.filterable||r.remote)&&n.filteredOptionsCount&&_e()},{flush:"post"}),vue.watch(()=>n.hoverIndex,bn=>{isNumber(bn)&&bn>-1?y.value=V.value[bn]||{}:y.value={},V.value.forEach(wn=>{wn.hover=y.value===wn})});const Fe=()=>{vue.nextTick(()=>{var bn,wn;if(!u.value)return;const Ln=u.value.$el.querySelector("input");w=w||(Ln.clientHeight>0?Ln.clientHeight+2:0);const Bn=v.value,Mn=getComponentSize(he.value||(T==null?void 0:T.size)),On=he.value||Mn===w||w<=0?Mn:w;!(Ln.offsetParent===null)&&(Ln.style.height=`${(n.selected.length===0?On:Math.max(Bn?Bn.clientHeight+(Bn.clientHeight>On?6:0):0,On))-2}px`),n.visible&&j.value!==!1&&((wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn))})},pe=async bn=>{if(!(n.previousQuery===bn||n.isOnComposition)){if(n.previousQuery===null&&(isFunction(r.filterMethod)||isFunction(r.remoteMethod))){n.previousQuery=bn;return}n.previousQuery=bn,vue.nextTick(()=>{var wn,Ln;n.visible&&((Ln=(wn=d.value)==null?void 0:wn.updatePopper)==null||Ln.call(wn))}),n.hoverIndex=-1,r.multiple&&r.filterable&&vue.nextTick(()=>{const wn=c.value.value.length*15+20;n.inputLength=r.collapseTags?Math.min(50,wn):wn,Lt(),Fe()}),r.remote&&isFunction(r.remoteMethod)?(n.hoverIndex=-1,r.remoteMethod(bn)):isFunction(r.filterMethod)?(r.filterMethod(bn),vue.triggerRef(b)):(n.filteredOptionsCount=n.optionsCount,_.value.query=bn,vue.triggerRef(_),vue.triggerRef(b)),r.defaultFirstOption&&(r.filterable||r.remote)&&n.filteredOptionsCount&&(await vue.nextTick(),_e())}},Lt=()=>{n.currentPlaceholder!==""&&(n.currentPlaceholder=c.value.value?"":n.cachedPlaceHolder)},_e=()=>{const bn=V.value.filter(Bn=>Bn.visible&&!Bn.disabled&&!Bn.states.groupDisabled),wn=bn.find(Bn=>Bn.created),Ln=bn[0];n.hoverIndex=Oe(V.value,wn||Ln)},Et=()=>{var bn;if(r.multiple)n.selectedLabel="";else{const Ln=Cn(r.modelValue);(bn=Ln.props)!=null&&bn.created?(n.createdLabel=Ln.props.value,n.createdSelected=!0):n.createdSelected=!1,n.selectedLabel=Ln.currentLabel,n.selected=Ln,r.filterable&&(n.query=n.selectedLabel);return}const wn=[];Array.isArray(r.modelValue)&&r.modelValue.forEach(Ln=>{wn.push(Cn(Ln))}),n.selected=wn,vue.nextTick(()=>{Fe()})},Cn=bn=>{let wn;const Ln=toRawType(bn).toLowerCase()==="object",Bn=toRawType(bn).toLowerCase()==="null",Mn=toRawType(bn).toLowerCase()==="undefined";for(let Vn=n.cachedOptions.size-1;Vn>=0;Vn--){const Nn=z.value[Vn];if(Ln?lodashEs.get(Nn.value,r.valueKey)===lodashEs.get(bn,r.valueKey):Nn.value===bn){wn={value:bn,currentLabel:Nn.currentLabel,isDisabled:Nn.isDisabled};break}}if(wn)return wn;const On=Ln?bn.label:!Bn&&!Mn?bn:"",Gn={value:bn,currentLabel:On};return r.multiple&&(Gn.hitState=!1),Gn},vn=()=>{setTimeout(()=>{const bn=r.valueKey;r.multiple?n.selected.length>0?n.hoverIndex=Math.min.apply(null,n.selected.map(wn=>V.value.findIndex(Ln=>lodashEs.get(Ln,bn)===lodashEs.get(wn,bn)))):n.hoverIndex=-1:n.hoverIndex=V.value.findIndex(wn=>Ue(wn)===Ue(n.selected))},300)},Dt=()=>{var bn,wn;de(),(wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn),r.multiple&&Fe()},de=()=>{var bn;n.inputWidth=(bn=u.value)==null?void 0:bn.$el.offsetWidth},qe=()=>{r.filterable&&n.query!==n.selectedLabel&&(n.query=n.selectedLabel,pe(n.query))},Pt=lodashEs.debounce(()=>{qe()},F.value),In=lodashEs.debounce(bn=>{pe(bn.target.value)},F.value),$e=bn=>{lodashEs.isEqual(r.modelValue,bn)||i.emit(CHANGE_EVENT,bn)},Ce=bn=>{if(bn.code!==EVENT_CODE.delete){if(bn.target.value.length<=0&&!Y()){const wn=r.modelValue.slice();wn.pop(),i.emit(UPDATE_MODEL_EVENT,wn),$e(wn)}bn.target.value.length===1&&r.modelValue.length===0&&(n.currentPlaceholder=n.cachedPlaceHolder)}},ue=(bn,wn)=>{const Ln=n.selected.indexOf(wn);if(Ln>-1&&!O.value){const Bn=r.modelValue.slice();Bn.splice(Ln,1),i.emit(UPDATE_MODEL_EVENT,Bn),$e(Bn),i.emit("remove-tag",wn.value)}bn.stopPropagation()},At=bn=>{bn.stopPropagation();const wn=r.multiple?[]:"";if(!isString(wn))for(const Ln of n.selected)Ln.isDisabled&&wn.push(Ln.value);i.emit(UPDATE_MODEL_EVENT,wn),$e(wn),n.hoverIndex=-1,n.visible=!1,i.emit("clear")},Ne=bn=>{var wn;if(r.multiple){const Ln=(r.modelValue||[]).slice(),Bn=Oe(Ln,bn.value);Bn>-1?Ln.splice(Bn,1):(r.multipleLimit<=0||Ln.length<r.multipleLimit)&&Ln.push(bn.value),i.emit(UPDATE_MODEL_EVENT,Ln),$e(Ln),bn.created&&(n.query="",pe(""),n.inputLength=20),r.filterable&&((wn=c.value)==null||wn.focus())}else i.emit(UPDATE_MODEL_EVENT,bn.value),$e(bn.value),n.visible=!1;kt(),!n.visible&&vue.nextTick(()=>{jt(bn)})},Oe=(bn=[],wn)=>{if(!isObject(wn))return bn.indexOf(wn);const Ln=r.valueKey;let Bn=-1;return bn.some((Mn,On)=>vue.toRaw(lodashEs.get(Mn,Ln))===lodashEs.get(wn,Ln)?(Bn=On,!0):!1),Bn},kt=()=>{const bn=c.value||u.value;bn&&(bn==null||bn.focus())},jt=bn=>{var wn,Ln,Bn,Mn,On;const Gn=Array.isArray(bn)?bn[0]:bn;let Vn=null;if(Gn!=null&&Gn.value){const Nn=V.value.filter(Dn=>Dn.value===Gn.value);Nn.length>0&&(Vn=Nn[0].$el)}if(d.value&&Vn){const Nn=(Mn=(Bn=(Ln=(wn=d.value)==null?void 0:wn.popperRef)==null?void 0:Ln.contentRef)==null?void 0:Bn.querySelector)==null?void 0:Mn.call(Bn,`.${a.be("dropdown","wrap")}`);Nn&&scrollIntoView(Nn,Vn)}(On=p.value)==null||On.handleScroll()},_n=bn=>{n.optionsCount++,n.filteredOptionsCount++,n.options.set(bn.value,bn),n.cachedOptions.set(bn.value,bn)},ie=(bn,wn)=>{n.options.get(bn)===wn&&(n.optionsCount--,n.filteredOptionsCount--,n.options.delete(bn))},ae=bn=>{bn.code!==EVENT_CODE.backspace&&Y(!1),n.inputLength=c.value.value.length*15+20,Fe()},Y=bn=>{if(!Array.isArray(n.selected))return;const wn=n.selected[n.selected.length-1];if(wn)return bn===!0||bn===!1?(wn.hitState=bn,bn):(wn.hitState=!wn.hitState,wn.hitState)},k=bn=>{const wn=bn.target.value;if(bn.type==="compositionend")n.isOnComposition=!1,vue.nextTick(()=>pe(wn));else{const Ln=wn[wn.length-1]||"";n.isOnComposition=!isKorean(Ln)}},D=()=>{vue.nextTick(()=>jt(n.selected))},oe=bn=>{ignoreFocusEvent?ignoreFocusEvent=!1:((r.automaticDropdown||r.filterable)&&(r.filterable&&!n.visible&&(n.menuVisibleOnFocus=!0),n.visible=!0),i.emit("focus",bn))},xe=()=>{var bn,wn,Ln;n.visible=!1,(bn=u.value)==null||bn.blur(),(Ln=(wn=f.value)==null?void 0:wn.blur)==null||Ln.call(wn)},ze=bn=>{setTimeout(()=>{var wn;if((wn=d.value)!=null&&wn.isFocusInsideContent()){ignoreFocusEvent=!0;return}n.visible&&An(),i.emit("blur",bn)})},hn=bn=>{At(bn)},An=()=>{n.visible=!1},Tn=bn=>{n.visible&&(bn.preventDefault(),bn.stopPropagation(),n.visible=!1)},Rn=bn=>{var wn;bn&&!n.mouseEnter||O.value||(n.menuVisibleOnFocus?n.menuVisibleOnFocus=!1:(!d.value||!d.value.isFocusInsideContent())&&(n.visible=!n.visible),n.visible&&((wn=c.value||u.value)==null||wn.focus()))},Ve=()=>{n.visible?V.value[n.hoverIndex]&&Ne(V.value[n.hoverIndex]):Rn()},Ue=bn=>isObject(bn.value)?lodashEs.get(bn.value,r.valueKey):bn.value,En=vue.computed(()=>V.value.filter(bn=>bn.visible).every(bn=>bn.disabled)),Sn=vue.computed(()=>n.selected.slice(0,r.maxCollapseTags)),xn=vue.computed(()=>n.selected.slice(r.maxCollapseTags)),Pn=bn=>{if(!n.visible){n.visible=!0;return}if(!(n.options.size===0||n.filteredOptionsCount===0)&&!n.isOnComposition&&!En.value){bn==="next"?(n.hoverIndex++,n.hoverIndex===n.options.size&&(n.hoverIndex=0)):bn==="prev"&&(n.hoverIndex--,n.hoverIndex<0&&(n.hoverIndex=n.options.size-1));const wn=V.value[n.hoverIndex];(wn.disabled===!0||wn.states.groupDisabled===!0||!wn.visible)&&Pn(bn),vue.nextTick(()=>jt(y.value))}};return{optionList:A,optionsArray:V,selectSize:he,handleResize:Dt,debouncedOnInputChange:Pt,debouncedQueryChange:In,deletePrevTag:Ce,deleteTag:ue,deleteSelected:At,handleOptionSelect:Ne,scrollToOption:jt,readonly:x,resetInputHeight:Fe,showClose:L,iconComponent:M,iconReverse:re,showNewOption:$,collapseTagSize:le,setSelected:Et,managePlaceholder:Lt,selectDisabled:O,emptyText:j,toggleLastOptionHitState:Y,resetInputState:ae,handleComposition:k,onOptionCreate:_n,onOptionDestroy:ie,handleMenuEnter:D,handleFocus:oe,blur:xe,handleBlur:ze,handleClearClick:hn,handleClose:An,handleKeydownEscape:Tn,toggleMenu:Rn,selectOption:Ve,getValueKey:Ue,navigateOptions:Pn,handleDeleteTooltipTag:(bn,wn)=>{var Ln,Bn;ue(bn,wn),(Bn=(Ln=h.value)==null?void 0:Ln.updatePopper)==null||Bn.call(Ln)},dropMenuVisible:Ie,queryChange:_,groupQueryChange:b,showTagList:Sn,collapseTagList:xn,reference:u,input:c,iOSInput:f,tooltipRef:d,tagTooltipRef:h,tags:v,selectWrapper:g,scrollbar:p,handleMouseEnter:()=>{n.mouseEnter=!0},handleMouseLeave:()=>{n.mouseEnter=!1}}};var ElOptions=vue.defineComponent({name:"ElOptions",emits:["update-options"],setup(r,{slots:n,emit:i}){let o=[];function a(u,c){if(u.length!==c.length)return!1;for(const[f]of u.entries())if(u[f]!=c[f])return!1;return!0}return()=>{var u,c;const f=(u=n.default)==null?void 0:u.call(n),d=[];function h(v){Array.isArray(v)&&v.forEach(g=>{var p,y,_,b;const A=(p=(g==null?void 0:g.type)||{})==null?void 0:p.name;A==="ElOptionGroup"?h(!isString(g.children)&&!Array.isArray(g.children)&&isFunction((y=g.children)==null?void 0:y.default)?(_=g.children)==null?void 0:_.default():g.children):A==="ElOption"?d.push((b=g.props)==null?void 0:b.label):Array.isArray(g.children)&&h(g.children)})}return f.length&&h((c=f[0])==null?void 0:c.children),a(d,o)||(o=d,i("update-options",d)),f}}});const COMPONENT_NAME="ElSelect",_sfc_main$9=vue.defineComponent({name:COMPONENT_NAME,componentName:COMPONENT_NAME,components:{ElInput,ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:isValidComponentSize},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:{type:Boolean,default:!1},suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:Ee,default:"bottom-start"}},emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(r,n){const i=useNamespace("select"),o=useNamespace("input"),{t:a}=useLocale(),u=useSelectStates(r),{optionList:c,optionsArray:f,selectSize:d,readonly:h,handleResize:v,collapseTagSize:g,debouncedOnInputChange:p,debouncedQueryChange:y,deletePrevTag:_,deleteTag:b,deleteSelected:A,handleOptionSelect:w,scrollToOption:T,setSelected:S,resetInputHeight:x,managePlaceholder:O,showClose:L,selectDisabled:M,iconComponent:re,iconReverse:F,showNewOption:j,emptyText:V,toggleLastOptionHitState:z,resetInputState:$,handleComposition:he,onOptionCreate:le,onOptionDestroy:Ie,handleMenuEnter:Fe,handleFocus:pe,blur:Lt,handleBlur:_e,handleClearClick:Et,handleClose:Cn,handleKeydownEscape:vn,toggleMenu:Dt,selectOption:de,getValueKey:qe,navigateOptions:Pt,handleDeleteTooltipTag:In,dropMenuVisible:$e,reference:Ce,input:ue,iOSInput:At,tooltipRef:Ne,tagTooltipRef:Oe,tags:kt,selectWrapper:jt,scrollbar:_n,queryChange:ie,groupQueryChange:ae,handleMouseEnter:Y,handleMouseLeave:k,showTagList:D,collapseTagList:oe}=useSelect(r,u,n),{focus:xe}=useFocus(Ce),{inputWidth:ze,selected:hn,inputLength:An,filteredOptionsCount:Tn,visible:Rn,selectedLabel:Ve,hoverIndex:Ue,query:En,inputHovering:Sn,currentPlaceholder:xn,menuVisibleOnFocus:Pn,isOnComposition:kn,options:$n,cachedOptions:Wn,optionsCount:bn,prefixWidth:wn}=vue.toRefs(u),Ln=vue.computed(()=>{const Fn=[i.b()],Zn=vue.unref(d);return Zn&&Fn.push(i.m(Zn)),r.disabled&&Fn.push(i.m("disabled")),Fn}),Bn=vue.computed(()=>[i.e("tags"),i.is("disabled",vue.unref(M))]),Mn=vue.computed(()=>[i.b("tags-wrapper"),{"has-prefix":vue.unref(wn)&&vue.unref(hn).length}]),On=vue.computed(()=>[i.e("input"),i.is(vue.unref(d)),i.is("disabled",vue.unref(M))]),Gn=vue.computed(()=>[i.e("input"),i.is(vue.unref(d)),i.em("input","iOS")]),Vn=vue.computed(()=>[i.is("empty",!r.allowCreate&&!!vue.unref(En)&&vue.unref(Tn)===0)]),Nn=vue.computed(()=>({maxWidth:`${vue.unref(ze)-32}px`,width:"100%"})),Dn=vue.computed(()=>({maxWidth:`${vue.unref(ze)>123?vue.unref(ze)-123:vue.unref(ze)-75}px`})),Hn=vue.computed(()=>({marginLeft:`${vue.unref(wn)}px`,flexGrow:1,width:`${vue.unref(An)/(vue.unref(ze)-32)}%`,maxWidth:`${vue.unref(ze)-42}px`}));vue.provide(selectKey,vue.reactive({props:r,options:$n,optionsArray:f,cachedOptions:Wn,optionsCount:bn,filteredOptionsCount:Tn,hoverIndex:Ue,handleOptionSelect:w,onOptionCreate:le,onOptionDestroy:Ie,selectWrapper:jt,selected:hn,setSelected:S,queryChange:ie,groupQueryChange:ae})),vue.onMounted(()=>{u.cachedPlaceHolder=xn.value=r.placeholder||(()=>a("el.select.placeholder")),r.multiple&&Array.isArray(r.modelValue)&&r.modelValue.length>0&&(xn.value=""),useResizeObserver(jt,v),r.remote&&r.multiple&&x(),vue.nextTick(()=>{const Fn=Ce.value&&Ce.value.$el;if(Fn&&(ze.value=Fn.getBoundingClientRect().width,n.slots.prefix)){const Zn=Fn.querySelector(`.${o.e("prefix")}`);wn.value=Math.max(Zn.getBoundingClientRect().width+11,30)}}),S()}),r.multiple&&!Array.isArray(r.modelValue)&&n.emit(UPDATE_MODEL_EVENT,[]),!r.multiple&&Array.isArray(r.modelValue)&&n.emit(UPDATE_MODEL_EVENT,"");const zn=vue.computed(()=>{var Fn,Zn;return(Zn=(Fn=Ne.value)==null?void 0:Fn.popperRef)==null?void 0:Zn.contentRef});return{isIOS,onOptionsRendered:Fn=>{c.value=Fn},prefixWidth:wn,selectSize:d,readonly:h,handleResize:v,collapseTagSize:g,debouncedOnInputChange:p,debouncedQueryChange:y,deletePrevTag:_,deleteTag:b,handleDeleteTooltipTag:In,deleteSelected:A,handleOptionSelect:w,scrollToOption:T,inputWidth:ze,selected:hn,inputLength:An,filteredOptionsCount:Tn,visible:Rn,selectedLabel:Ve,hoverIndex:Ue,query:En,inputHovering:Sn,currentPlaceholder:xn,menuVisibleOnFocus:Pn,isOnComposition:kn,options:$n,resetInputHeight:x,managePlaceholder:O,showClose:L,selectDisabled:M,iconComponent:re,iconReverse:F,showNewOption:j,emptyText:V,toggleLastOptionHitState:z,resetInputState:$,handleComposition:he,handleMenuEnter:Fe,handleFocus:pe,blur:Lt,handleBlur:_e,handleClearClick:Et,handleClose:Cn,handleKeydownEscape:vn,toggleMenu:Dt,selectOption:de,getValueKey:qe,navigateOptions:Pt,dropMenuVisible:$e,focus:xe,reference:Ce,input:ue,iOSInput:At,tooltipRef:Ne,popperPaneRef:zn,tags:kt,selectWrapper:jt,scrollbar:_n,wrapperKls:Ln,tagsKls:Bn,tagWrapperKls:Mn,inputKls:On,iOSInputKls:Gn,scrollbarKls:Vn,selectTagsStyle:Nn,nsSelect:i,tagTextStyle:Dn,inputStyle:Hn,handleMouseEnter:Y,handleMouseLeave:k,showTagList:D,collapseTagList:oe,tagTooltipRef:Oe}}}),_hoisted_1$5=["disabled","autocomplete"],_hoisted_2$3=["disabled"],_hoisted_3$3={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function _sfc_render$1(r,n,i,o,a,u){const c=vue.resolveComponent("el-tag"),f=vue.resolveComponent("el-tooltip"),d=vue.resolveComponent("el-icon"),h=vue.resolveComponent("el-input"),v=vue.resolveComponent("el-option"),g=vue.resolveComponent("el-options"),p=vue.resolveComponent("el-scrollbar"),y=vue.resolveComponent("el-select-menu"),_=vue.resolveDirective("click-outside");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"selectWrapper",class:vue.normalizeClass(r.wrapperKls),onMouseenter:n[21]||(n[21]=(...b)=>r.handleMouseEnter&&r.handleMouseEnter(...b)),onMouseleave:n[22]||(n[22]=(...b)=>r.handleMouseLeave&&r.handleMouseLeave(...b)),onClick:n[23]||(n[23]=vue.withModifiers((...b)=>r.toggleMenu&&r.toggleMenu(...b),["stop"]))},[vue.createVNode(f,{ref:"tooltipRef",visible:r.dropMenuVisible,placement:r.placement,teleported:r.teleported,"popper-class":[r.nsSelect.e("popper"),r.popperClass],"popper-options":r.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:r.effect,pure:"",trigger:"click",transition:`${r.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:r.persistent,onShow:r.handleMenuEnter},{default:vue.withCtx(()=>[vue.createElementVNode("div",{class:"select-trigger",onMouseenter:n[19]||(n[19]=b=>r.inputHovering=!0),onMouseleave:n[20]||(n[20]=b=>r.inputHovering=!1)},[r.multiple?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"tags",class:vue.normalizeClass(r.tagsKls),style:vue.normalizeStyle(r.selectTagsStyle)},[r.collapseTags&&r.selected.length?(vue.openBlock(),vue.createBlock(vue.Transition,{key:0,onAfterLeave:r.resetInputHeight},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.tagWrapperKls)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.showTagList,b=>(vue.openBlock(),vue.createBlock(c,{key:r.getValueKey(b),closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",onClose:A=>r.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle(r.tagTextStyle)},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),r.selected.length>r.maxCollapseTags?(vue.openBlock(),vue.createBlock(c,{key:0,closable:!1,size:r.collapseTagSize,type:r.tagType,"disable-transitions":""},{default:vue.withCtx(()=>[r.collapseTagsTooltip?(vue.openBlock(),vue.createBlock(f,{key:0,ref:"tagTooltipRef",disabled:r.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:r.effect,placement:"bottom",teleported:r.teleported},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text"))},"+ "+vue.toDisplayString(r.selected.length-r.maxCollapseTags),3)]),content:vue.withCtx(()=>[vue.createElementVNode("div",{class:vue.normalizeClass(r.nsSelect.e("collapse-tags"))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.collapseTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:r.getValueKey(b),class:vue.normalizeClass(r.nsSelect.e("collapse-tag"))},[vue.createVNode(c,{class:"in-tooltip",closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:A=>r.handleDeleteTooltipTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle({maxWidth:r.inputWidth-75+"px"})},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(r.nsSelect.e("tags-text"))},"+ "+vue.toDisplayString(r.selected.length-r.maxCollapseTags),3))]),_:1},8,["size","type"])):vue.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):vue.createCommentVNode("v-if",!0),r.collapseTags?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,onAfterLeave:r.resetInputHeight},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.tagWrapperKls),style:vue.normalizeStyle(r.prefixWidth&&r.selected.length?{marginLeft:`${r.prefixWidth}px`}:"")},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.selected,b=>(vue.openBlock(),vue.createBlock(c,{key:r.getValueKey(b),closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",onClose:A=>r.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle({maxWidth:r.inputWidth-75+"px"})},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),r.filterable&&!r.selectDisabled?vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":n[0]||(n[0]=b=>r.query=b),type:"text",class:vue.normalizeClass(r.inputKls),disabled:r.selectDisabled,autocomplete:r.autocomplete,style:vue.normalizeStyle(r.inputStyle),onFocus:n[1]||(n[1]=(...b)=>r.handleFocus&&r.handleFocus(...b)),onBlur:n[2]||(n[2]=(...b)=>r.handleBlur&&r.handleBlur(...b)),onKeyup:n[3]||(n[3]=(...b)=>r.managePlaceholder&&r.managePlaceholder(...b)),onKeydown:[n[4]||(n[4]=(...b)=>r.resetInputState&&r.resetInputState(...b)),n[5]||(n[5]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("next"),["prevent"]),["down"])),n[6]||(n[6]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("prev"),["prevent"]),["up"])),n[7]||(n[7]=vue.withKeys((...b)=>r.handleKeydownEscape&&r.handleKeydownEscape(...b),["esc"])),n[8]||(n[8]=vue.withKeys(vue.withModifiers((...b)=>r.selectOption&&r.selectOption(...b),["stop","prevent"]),["enter"])),n[9]||(n[9]=vue.withKeys((...b)=>r.deletePrevTag&&r.deletePrevTag(...b),["delete"])),n[10]||(n[10]=vue.withKeys(b=>r.visible=!1,["tab"]))],onCompositionstart:n[11]||(n[11]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onCompositionupdate:n[12]||(n[12]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onCompositionend:n[13]||(n[13]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onInput:n[14]||(n[14]=(...b)=>r.debouncedQueryChange&&r.debouncedQueryChange(...b))},null,46,_hoisted_1$5)),[[vue.vModelText,r.query]]):vue.createCommentVNode("v-if",!0)],6)):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(" fix: https://github.com/element-plus/element-plus/issues/11415 "),r.isIOS&&!r.multiple&&r.filterable&&r.readonly?(vue.openBlock(),vue.createElementBlock("input",{key:1,ref:"iOSInput",class:vue.normalizeClass(r.iOSInputKls),disabled:r.selectDisabled,type:"text"},null,10,_hoisted_2$3)):vue.createCommentVNode("v-if",!0),vue.createVNode(h,{id:r.id,ref:"reference",modelValue:r.selectedLabel,"onUpdate:modelValue":n[15]||(n[15]=b=>r.selectedLabel=b),type:"text",placeholder:typeof r.currentPlaceholder=="function"?r.currentPlaceholder():r.currentPlaceholder,name:r.name,autocomplete:r.autocomplete,size:r.selectSize,disabled:r.selectDisabled,readonly:r.readonly,"validate-event":!1,class:vue.normalizeClass([r.nsSelect.is("focus",r.visible)]),tabindex:r.multiple&&r.filterable?-1:void 0,onFocus:r.handleFocus,onBlur:r.handleBlur,onInput:r.debouncedOnInputChange,onPaste:r.debouncedOnInputChange,onCompositionstart:r.handleComposition,onCompositionupdate:r.handleComposition,onCompositionend:r.handleComposition,onKeydown:[n[16]||(n[16]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("next"),["stop","prevent"]),["down"])),n[17]||(n[17]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("prev"),["stop","prevent"]),["up"])),vue.withKeys(vue.withModifiers(r.selectOption,["stop","prevent"]),["enter"]),vue.withKeys(r.handleKeydownEscape,["esc"]),n[18]||(n[18]=vue.withKeys(b=>r.visible=!1,["tab"]))]},vue.createSlots({suffix:vue.withCtx(()=>[r.iconComponent&&!r.showClose?(vue.openBlock(),vue.createBlock(d,{key:0,class:vue.normalizeClass([r.nsSelect.e("caret"),r.nsSelect.e("icon"),r.iconReverse])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),r.showClose&&r.clearIcon?(vue.openBlock(),vue.createBlock(d,{key:1,class:vue.normalizeClass([r.nsSelect.e("caret"),r.nsSelect.e("icon")]),onClick:r.handleClearClick},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.clearIcon)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)]),_:2},[r.$slots.prefix?{name:"prefix",fn:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$3,[vue.renderSlot(r.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]),content:vue.withCtx(()=>[vue.createVNode(y,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(p,{ref:"scrollbar",tag:"ul","wrap-class":r.nsSelect.be("dropdown","wrap"),"view-class":r.nsSelect.be("dropdown","list"),class:vue.normalizeClass(r.scrollbarKls)},{default:vue.withCtx(()=>[r.showNewOption?(vue.openBlock(),vue.createBlock(v,{key:0,value:r.query,created:!0},null,8,["value"])):vue.createCommentVNode("v-if",!0),vue.createVNode(g,{onUpdateOptions:r.onOptionsRendered},{default:vue.withCtx(()=>[vue.renderSlot(r.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["wrap-class","view-class","class"]),[[vue.vShow,r.options.size>0&&!r.loading]]),r.emptyText&&(!r.allowCreate||r.loading||r.allowCreate&&r.options.size===0)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[r.$slots.empty?vue.renderSlot(r.$slots,"empty",{key:0}):(vue.openBlock(),vue.createElementBlock("p",{key:1,class:vue.normalizeClass(r.nsSelect.be("dropdown","empty"))},vue.toDisplayString(r.emptyText),3))],64)):vue.createCommentVNode("v-if",!0)]),_:3})]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[_,r.handleClose,r.popperPaneRef]])}var Select=_export_sfc(_sfc_main$9,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);const _sfc_main$8=vue.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},setup(r){const n=useNamespace("select"),i=vue.ref(!0),o=vue.getCurrentInstance(),a=vue.ref([]);vue.provide(selectGroupKey,vue.reactive({...vue.toRefs(r)}));const u=vue.inject(selectKey);vue.onMounted(()=>{a.value=c(o.subTree)});const c=d=>{const h=[];return Array.isArray(d.children)&&d.children.forEach(v=>{var g;v.type&&v.type.name==="ElOption"&&v.component&&v.component.proxy?h.push(v.component.proxy):(g=v.children)!=null&&g.length&&h.push(...c(v))}),h},{groupQueryChange:f}=vue.toRaw(u);return vue.watch(f,()=>{i.value=a.value.some(d=>d.visible===!0)},{flush:"post"}),{visible:i,ns:n}}});function _sfc_render(r,n,i,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",{class:vue.normalizeClass(r.ns.be("group","wrap"))},[vue.createElementVNode("li",{class:vue.normalizeClass(r.ns.be("group","title"))},vue.toDisplayString(r.label),3),vue.createElementVNode("li",null,[vue.createElementVNode("ul",{class:vue.normalizeClass(r.ns.b("group"))},[vue.renderSlot(r.$slots,"default")],2)])],2)),[[vue.vShow,r.visible]])}var OptionGroup=_export_sfc(_sfc_main$8,[["render",_sfc_render],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const _hoisted_1$4={class:"c-wall-d"},_sfc_main$7=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],u=c=>{c!=="None"&&(o.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",o)};return(c,f)=>{var d,h;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(o).type,"onUpdate:modelValue":f[0]||(f[0]=v=>vue.unref(o).type=v),onChange:u},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.key,"onUpdate:modelValue":f[1]||(f[1]=v=>vue.unref(o).Relation.key=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(o).Relation.relation,"onUpdate:modelValue":f[2]||(f[2]=v=>vue.unref(o).Relation.relation=v)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(a,(v,g)=>vue.createVNode(vue.unref(ElOption),{value:v.val,label:v.label,key:"rop"+g},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.val,"onUpdate:modelValue":f[3]||(f[3]=v=>vue.unref(o).Relation.val=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"&&(((d=vue.unref(o).Relation)==null?void 0:d.relation)===">=,=<"||((h=vue.unref(o).Relation)==null?void 0:h.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.val2,"onUpdate:modelValue":f[4]||(f[4]=v=>vue.unref(o).Relation.val2=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=useGlobalStore(pinia),a=vue.computed({get(){return i.modelValue!==null},set(v){let g=null;v&&(g={target_id:"",type:""}),n("update:modelValue",g)}}),u=vue.computed({get(){var v;return((v=i.modelValue)==null?void 0:v.target_id)??void 0},set(v){let g=null;a.value&&(g={target_id:v,type:c.value}),n("update:modelValue",g)}}),c=vue.computed({get(){var v;return((v=i.modelValue)==null?void 0:v.type)??void 0},set(v){let g=null;a.value&&(g={target_id:u.value,type:v}),n("update:modelValue",g)}}),f=vue.computed(()=>o.done_json.filter(v=>v.type!==EDoneJsonType.ConnectionLine).map(v=>({label:v.title,value:v.id}))),d=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function h(){vue.nextTick(function(){var v,g;if(a.value&&((v=i.modelValue)!=null&&v.target_id)&&((g=i.modelValue)!=null&&g.type)&&o.handle_svg_info){let p=null;for(let y of o.done_json)y.id===i.modelValue.target_id&&(p=y);p&&(setSvgActualInfo(p),moveAnchors(p))}})}return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:i.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(a),"onUpdate:modelValue":g[0]||(g[0]=p=>vue.isRef(a)?a.value=p:null),onChange:h},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(a)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(u),"onUpdate:modelValue":g[1]||(g[1]=p=>vue.isRef(u)?u.value=p:null),onChange:h},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),p=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(c),"onUpdate:modelValue":g[2]||(g[2]=p=>vue.isRef(c)?c.value=p:null),onChange:h},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(d,p=>vue.createVNode(vue.unref(elementPlus.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=r=>(vue.pushScopeId("data-v-9b4c5da1"),r=r(),vue.popScopeId(),r),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={key:2},_hoisted_3$2={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(r){const n=useConfigStore(pinia),i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=vue.ref("page"),u=vue.ref("style"),c=(_,b)=>{_!=null&&_.common_animations&&(_.common_animations.val=b)};n.$subscribe((_,b)=>{_.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(b))});const f=vue.ref(numberArray(20)),d=vue.ref(["MQTT"]),h=vue.ref();h.value=()=>{var b,A;let _={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(A=(b=i.handle_svg_info)==null?void 0:b.info)==null||A.events.push(_)};const v=(_,b)=>{_==="ChangeAttr"?b.attrs=[{key:"",val:""}]:delete b.attrs},g=_=>{var b,A;(A=(b=i.handle_svg_info)==null?void 0:b.info)==null||A.events.splice(_,1)},p=()=>{o.center_offset={x:0,y:0}},y=(_,b,A)=>{vue.nextTick(function(){if(i.handle_svg_info){const w=i.done_json[i.handle_svg_info.index];A?setSvgActualInfo(w,A):setSvgActualInfo(w),moveAnchors(w)}})};return(_,b)=>vue.unref(i).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(a),"onUpdate:modelValue":b[13]||(b[13]=A=>vue.isRef(a)?a.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":b[0]||(b[0]=A=>vue.unref(n).svg.background_color=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",onClick:p,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.x,"onUpdate:modelValue":b[1]||(b[1]=A=>vue.unref(o).center_offset.x=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.y,"onUpdate:modelValue":b[2]||(b[2]=A=>vue.unref(o).center_offset.y=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":b[3]||(b[3]=A=>vue.unref(n).svg.scale=A),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":b[4]||(b[4]=A=>vue.unref(n).svg.ruler=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":b[5]||(b[5]=A=>vue.unref(n).svg.grid=A)},null,8,["modelValue"])]),_:1}),vue.unref(n).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(n).svg.grid_color,"onUpdate:modelValue":b[6]||(b[6]=A=>vue.unref(n).svg.grid_color=A)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:vue.unref(n).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).connection_line.animations.type.val,"onUpdate:modelValue":b[7]||(b[7]=A=>vue.unref(n).connection_line.animations.type.val=A),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).connection_line.animations.type.options,A=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(n).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(n).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(d),"onUpdate:modelValue":b[12]||(b[12]=A=>vue.isRef(d)?d.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":b[8]||(b[8]=A=>vue.unref(n).net.mqtt.url=A),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":b[9]||(b[9]=A=>vue.unref(n).net.mqtt.user=A),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":b[10]||(b[10]=A=>vue.unref(n).net.mqtt.pwd=A),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":b[11]||(b[11]=A=>vue.unref(n).net.mqtt.topics=A),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$t)]),_:1})]),_:1},8,["modelValue"])):vue.unref(i).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(i).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:vue.unref(u),"onUpdate:modelValue":b[34]||(b[34]=A=>vue.isRef(u)?u.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,T,S;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.title,"onUpdate:modelValue":b[14]||(b[14]=x=>vue.unref(i).handle_svg_info.info.title=x)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.x,"onUpdate:modelValue":b[15]||(b[15]=x=>vue.unref(i).handle_svg_info.info.x=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.y,"onUpdate:modelValue":b[16]||(b[16]=x=>vue.unref(i).handle_svg_info.info.y=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.scale_x,"onUpdate:modelValue":b[17]||(b[17]=x=>vue.unref(i).handle_svg_info.info.scale_x=x),onChange:y},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(w=(A=vue.unref(i).handle_svg_info)==null?void 0:A.info)==null?void 0:w.config.can_zoom]]),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.scale_y,"onUpdate:modelValue":b[18]||(b[18]=x=>vue.unref(i).handle_svg_info.info.scale_y=x),onChange:y},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(S=(T=vue.unref(i).handle_svg_info)==null?void 0:T.info)==null?void 0:S.config.can_zoom]]),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.rotate,"onUpdate:modelValue":b[19]||(b[19]=x=>vue.unref(i).handle_svg_info.info.rotate=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(i).handle_svg_info.info.display,"onUpdate:modelValue":b[20]||(b[20]=x=>vue.unref(i).handle_svg_info.info.display=x)},null,8,["modelValue"])]),_:1})]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,T,S,x,O,L,M;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.id,"onUpdate:modelValue":b[21]||(b[21]=re=>vue.unref(i).handle_svg_info.info.id=re)},null,8,["modelValue"])]),_:1}),(w=(A=vue.unref(i).handle_svg_info)==null?void 0:A.info)!=null&&w.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(i).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(S=(T=vue.unref(i).handle_svg_info)==null?void 0:T.info)!=null&&S.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.defaultState,"onUpdate:modelValue":b[22]||(b[22]=re=>vue.unref(i).handle_svg_info.info.defaultState=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.state,(re,F)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:"state"+String(F),label:re.label,value:F},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(x=vue.unref(i).handle_svg_info.info)!=null&&x.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$2,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(i).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.tag_slot,"onUpdate:modelValue":b[23]||(b[23]=re=>vue.unref(i).handle_svg_info.info.tag_slot=re),onInput:b[24]||(b[24]=re=>y(re,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(i).handle_svg_info.info.props,code:"",onChange:b[25]||(b[25]=re=>y(re,null,!0))},null,8,["obj-info"]),vue.unref(i).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:vue.unref(i).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":b[26]||(b[26]=re=>vue.unref(i).handle_svg_info.info.animations.type.val=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.animations.type.options,re=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:re.value,label:re.label,value:re.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((O=vue.unref(i).handle_svg_info.info.animations)==null?void 0:O.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(i).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((L=vue.unref(i).handle_svg_info)==null?void 0:L.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(i).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":b[27]||(b[27]=re=>vue.unref(i).handle_svg_info.info.bind_anchors.start=re),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((M=vue.unref(i).handle_svg_info)==null?void 0:M.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(i).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":b[28]||(b[28]=re=>vue.unref(i).handle_svg_info.info.bind_anchors.end=re),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(h)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(f),"onUpdate:modelValue":b[29]||(b[29]=A=>vue.isRef(f)?f.value=A:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.events,(A,w)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:w,key:"event"+w},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(w+1),1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(T=>g(w),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.type,"onUpdate:modelValue":T=>A.type=T},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.action,"onUpdate:modelValue":T=>A.action=T,onChange:T=>v(T,A)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:A.target,"onUpdate:modelValue":T=>A.target=T,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:A.attrs,"onUpdate:modelValue":T=>A.attrs=T},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),A.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$w,{modelValue:A.scripts,"onUpdate:modelValue":T=>A.scripts=T,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:A.condition,"onUpdate:modelValue":T=>A.condition=T},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var A;return[(A=vue.unref(i).handle_svg_info)!=null&&A.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(i).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(i).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:b[30]||(b[30]=w=>{var T;return c((T=vue.unref(i).handle_svg_info)==null?void 0:T.info,w)}),val:vue.unref(i).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":b[31]||(b[31]=w=>vue.unref(i).handle_svg_info.info.common_animations.delay=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":b[32]||(b[32]=w=>vue.unref(i).handle_svg_info.info.common_animations.speed=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":b[33]||(b[33]=w=>vue.unref(i).handle_svg_info.info.common_animations.repeat=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$t)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_9b4c5da1_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc$1(_sfc_main$5,[["__scopeId","data-v-9b4c5da1"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(r){const n=vue.ref(""),i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return vue.onMounted(()=>{const u={layout_center:o.center_offset,config:a.$state,done_json:i.done_json};n.value=JSON.stringify(u,null,2)}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":c[0]||(c[0]=f=>vue.isRef(n)?n.value=f:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"import-json",setup(r,{expose:n}){const i=vue.ref("");return n({setVal:u=>{i.value=u},onImportJson:()=>{useImportDataModel(i.value)&&elementPlus.ElMessage.success("导入成功")}}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(i),"onUpdate:value":c[0]||(c[0]=f=>vue.isRef(i)?i.value=f:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["onMousedown"],_hoisted_2$1=["onMousedown"],_hoisted_3$1=["title","onMousedown"],_hoisted_4$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(r,{emit:n}){const i=r,o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia),u=function(){return function($e,Ce,ue){$e&&Ce&&ue&&$e.addEventListener(Ce,ue,!1)}}(),c=function(){return function($e,Ce,ue){$e&&Ce&&$e.removeEventListener(Ce,ue,!1)}}();let f=18,d=vue.ref(0),h=vue.ref(0),v=vue.ref([]),g=vue.ref([]);const p=vue.ref([]);let y=vue.ref(!1),_="",b=vue.ref(-999),A=vue.ref(-999),w=18,T=18,S="";const x=vue.ref(null),O=vue.ref(null),L=vue.ref(null),M=vue.ref(null),re=vue.computed(()=>({width:d.value+"px",height:h.value+"px"})),F=vue.computed(()=>({padding:f+"px 0px 0px "+f+"px"})),j=vue.computed(()=>{let $e=0,Ce=0;return p.value.map(ue=>{const At=ue.type==="h";return{id:`${ue.type}_${At?$e++:Ce++}`,type:ue.type,title:ue.site.toFixed(0)+"px",[At?"top":"left"]:ue.site*a.svg.scale+f+o.center_offset[At?"y":"x"]*a.svg.scale}})});o.$subscribe($e=>{var Ce,ue,At,Ne;((ue=(Ce=$e.events)==null?void 0:Ce.target)!=null&&ue.hasOwnProperty("left_nav")||(Ne=(At=$e.events)==null?void 0:At.target)!=null&&Ne.hasOwnProperty("right_nav"))&&window.setTimeout(V,420)}),a.$subscribe($e=>{var Ce,ue;(ue=(Ce=$e.events)==null?void 0:Ce.target)!=null&&ue.hasOwnProperty("scale")&&Ie()}),vue.onMounted(()=>{u(document,"mousemove",pe),u(document,"mouseup",Et),V(),u(window,"resize",z)}),vue.onBeforeUnmount(()=>{c(document,"mousemove",pe),c(document,"mouseup",Et),c(window,"resize",z)});const V=()=>{le(),Ie()},z=()=>{v.value=[],g.value=[],V()},$=({type:$e,top:Ce,left:ue})=>$e==="h"?{top:Ce+"px"}:{left:ue+"px"},he=({type:$e,id:Ce})=>$e==="h"?qe(Ce):Pt(Ce),le=()=>{const $e=window.getComputedStyle(O.value.parentNode,null);d.value=parseInt($e.getPropertyValue("width")),h.value=parseInt($e.getPropertyValue("height")),w=L.value.clientWidth,T=M.value.clientHeight},Ie=()=>{Fe(v.value,d.value,o.center_offset.x),Fe(g.value,h.value,o.center_offset.y)},Fe=($e,Ce,ue)=>{if($e.length===0)for(let At=0;At<Ce;At+=i.stepLength)At%i.stepLength===0&&$e.push({id:Number((At/a.svg.scale-ue).toFixed(0))});else $e.forEach((At,Ne)=>{At.id=Number((Ne*i.stepLength/a.svg.scale-ue).toFixed(0))})},pe=$e=>{Ie(),Lt($e)},Lt=$e=>{if(!($e.layerX===$e.x||$e.layerY===$e.y))switch(_){case"x":y.value&&(A.value=$e.layerY);break;case"y":y.value&&(b.value=$e.layerX);break;case"h":y.value&&(A.value=$e.layerY);break;case"v":y.value&&(b.value=$e.layerX);break}},_e=$e=>{y.value=!0,_=$e},Et=$e=>{Cn($e)},Cn=$e=>{if(y.value){switch(y.value=!1,_){case"x":const Ce=Math.round(($e.layerY-f)/a.svg.scale-o.center_offset.y);if(Ce<=0){A.value=-999;return}p.value.push({type:"h",site:Ce});break;case"y":const ue=Math.round(($e.layerX-f)/a.svg.scale-o.center_offset.x);if(ue<=0){b.value=-999;return}p.value.push({type:"v",site:ue});break;case"h":vn(p.value,Math.round(($e.layerY-f)/a.svg.scale-o.center_offset.y),Math.round(T/a.svg.scale-o.center_offset.y),"h");break;case"v":vn(p.value,Math.round(($e.layerX-f)/a.svg.scale-o.center_offset.x),Math.round(w/a.svg.scale-o.center_offset.x),"v");break}A.value=b.value=-999}},vn=($e,Ce,ue,At)=>{if(Ce<ue){let Ne;j.value.forEach((Oe,kt)=>{Oe.id===S&&(Ne=kt)}),$e.splice(Ne,1)}else{let Ne;j.value.forEach((Oe,kt)=>{Oe.id===S&&(Ne=kt)}),$e.splice(Ne,1,{type:At,site:Ce})}},Dt=()=>{_e("x")},de=()=>{_e("y")},qe=$e=>{y.value=!0,_="h",S=$e},Pt=$e=>{y.value=!0,_="v",S=$e},In=()=>{n("onLineMouseUp")};return($e,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref(re)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:O},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:M,class:"vue-ruler-h",onMousedown:vue.withModifiers(Dt,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(v),(ue,At)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:At*$e.stepLength+"px"}),class:"n"},vue.toDisplayString(ue.id),5))),256))],40,_hoisted_1$2),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:L,class:"vue-ruler-v",onMousedown:vue.withModifiers(de,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(ue,At)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:At*$e.stepLength+"px"}),class:"n"},vue.toDisplayString(ue.id),5))),256))],40,_hoisted_2$1),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(A)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(A)-vue.unref(T))/vue.unref(a).svg.scale)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(b)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(b)-vue.unref(w))/vue.unref(a).svg.scale)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(j),ue=>(vue.openBlock(),vue.createElementBlock("div",{title:ue.title,style:vue.normalizeStyle($(ue)),key:ue.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ue.type}`),onMousedown:At=>he(ue),onMouseup:In,onContextmenu:Ce[0]||(Ce[0]=(...At)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...At))},null,46,_hoisted_3$1))),128))],512),[[vue.vShow,i.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:x,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(F))},[vue.renderSlot($e.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$1,null,512),[[vue.vShow,vue.unref(y)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(r,n=new Date(Date.now()).toLocaleString()){const i=JSON.stringify(r),o=new Blob([i]);let a=document.createElement("a");a.download=n+".json",a.style.display="none",a.href=URL.createObjectURL(o),document.body.appendChild(a),a.click(),document.body.removeChild(a)}function fileRead(r){return new Promise((n,i)=>{let o=new FileReader;o.readAsText(r,"UTF-8"),o.onload=function(a){a&&a.target?n(a.target.result):i("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},vueComp:{},data:{},saveFile:{type:Boolean,default:!1}},emits:["onReturn","onPreview","onSave"],setup(r,{expose:n,emit:i}){const o=r;setEditorLoadTime();const a=useGlobalStore(pinia),u=useSvgEditLayoutStore(pinia),c=useConfigStore(pinia),f=useEditPrivateStore(pinia),d=vue.ref(),h=vue.ref(),v=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),g=(S,x)=>{v[S]=x},p=vue.ref();p.value=()=>{h.value.onImportJson(),g(EVisibleConfKey.ImportJson,!1)};const y=S=>["text/plain","application/json"].indexOf(S.type)<0?(elementPlus.ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(S).then(x=>{h.value.setVal(x),elementPlus.ElMessage.success("文件读取成功!")}),!1),_=S=>{a.setDoneJson(S)};vue.onMounted(()=>{f.history_doneComponent=[],f.history_now_index=0,o.data?useImportDataModel(o.data):a.setDoneJson([]),a.intention=EGlobalStoreIntention.None});const{appContext:b}=vue.getCurrentInstance();function A(S){i("onReturn",{data:S,isChange:f.getTopBtnUndoStatus})}function w(S){o.saveFile?elementPlus.ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},b).then(x=>{fileWrite(S,x.value.trim()),i("onSave",S)}).catch(x=>{console.log(x)}):i("onSave",S)}function T(){d.value.onCanvasMouseUp()}return n({setGraphNodeJson:_}),(S,x)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:g,onOnReturn:A,onOnPreview:x[0]||(x[0]=O=>i("onPreview",O)),onOnSave:w})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(u).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":o.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref(c).svg.ruler,onOnLineMouseUp:T},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:d,vueComp:o.vueComp},null,8,["vueComp"])]),_:1},8,["visible"])])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(u).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(v).ImportJson,"onUpdate:modelValue":x[2]||(x[2]=O=>vue.unref(v).ImportJson=O),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElUpload),{beforeUpload:y,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:x[1]||(x[1]=O=>g(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:vue.unref(p)},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:h},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(v).ExportJson,"onUpdate:modelValue":x[3]||(x[3]=O=>vue.unref(v).ExportJson=O),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_75bc782f_lang="",index=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-75bc782f"]]);function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(r,n){(function(i){r.exports=i()})(function(){return function(){function i(o,a,u){function c(h,v){if(!a[h]){if(!o[h]){var g=typeof commonjsRequire=="function"&&commonjsRequire;if(!v&&g)return g(h,!0);if(f)return f(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var y=a[h]={exports:{}};o[h][0].call(y.exports,function(_){var b=o[h][1][_];return c(b||_)},y,y.exports,i,o,a,u)}return a[h].exports}for(var f=typeof commonjsRequire=="function"&&commonjsRequire,d=0;d<u.length;d++)c(u[d]);return c}return i}()({1:[function(i,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0}),a.TypedEventEmitter=void 0;const c=u(i("events")),f=i("./shared");class d{}a.TypedEventEmitter=d,(0,f.applyMixin)(d,c.default)},{"./shared":17,events:49}],2:[function(i,o,a){(function(u,c){(function(){var f=this&&this.__createBinding||(Object.create?function(V,z,$,he){he===void 0&&(he=$);var le=Object.getOwnPropertyDescriptor(z,$);(!le||("get"in le?!z.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return z[$]}}),Object.defineProperty(V,he,le)}:function(V,z,$,he){he===void 0&&(he=$),V[he]=z[$]}),d=this&&this.__setModuleDefault||(Object.create?function(V,z){Object.defineProperty(V,"default",{enumerable:!0,value:z})}:function(V,z){V.default=z}),h=this&&this.__importStar||function(V){if(V&&V.__esModule)return V;var z={};if(V!=null)for(var $ in V)$!=="default"&&Object.prototype.hasOwnProperty.call(V,$)&&f(z,V,$);return d(z,V),z},v=this&&this.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(a,"__esModule",{value:!0});const g=v(i("./topic-alias-recv")),p=v(i("mqtt-packet")),y=v(i("./default-message-id-provider")),_=i("readable-stream"),b=v(i("reinterval")),A=v(i("rfdc/default")),w=h(i("./validations")),T=v(i("debug")),S=v(i("./store")),x=v(i("./handlers")),O=i("./TypedEmitter"),L=u?u.nextTick:V=>{setTimeout(V,0)},M=c.setImmediate||((...V)=>{const z=V.shift();L(()=>{z(...V)})}),re={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},F=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class j extends O.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(z,$){super(),this.options=$||{};for(const he in re)typeof this.options[he]>"u"?this.options[he]=re[he]:this.options[he]=$[he];this.log=this.options.log||(0,T.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",$.protocol),this.log("MqttClient :: options.protocolVersion",$.protocolVersion),this.log("MqttClient :: options.username",$.username),this.log("MqttClient :: options.keepalive",$.keepalive),this.log("MqttClient :: options.reconnectPeriod",$.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",$.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",$.properties?$.properties.topicAliasMaximum:void 0),this.options.clientId=typeof $.clientId=="string"?$.clientId:j.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=$.protocolVersion===5&&$.customHandleAcks?$.customHandleAcks:(...he)=>{he[3](null,0)},this.options.writeCache||(p.default.writeToStream.cacheNumbers=!1),this.streamBuilder=z,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new y.default:this.options.messageIdProvider,this.outgoingStore=$.outgoingStore||new S.default,this.incomingStore=$.incomingStore||new S.default,this.queueQoSZero=$.queueQoSZero===void 0?!0:$.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,$.properties&&$.properties.topicAliasMaximum>0&&($.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default($.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:he}=this,le=()=>{const Ie=he.shift();this.log("deliver :: entry %o",Ie);let Fe=null;if(!Ie){this._resubscribe();return}Fe=Ie.packet,this.log("deliver :: call _sendPacket for %o",Fe);let pe=!0;Fe.messageId&&Fe.messageId!==0&&(this.messageIdProvider.register(Fe.messageId)||(pe=!1)),pe?this._sendPacket(Fe,Lt=>{Ie.cb&&Ie.cb(Lt),le()}):(this.log("messageId: %d has already used. The message is skipped and removed.",Fe.messageId),le())};this.log("connect :: sending queued packets"),le()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(z,$){$()}handleMessage(z,$){$()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var z;const $=new _.Writable,he=p.default.parser(this.options);let le=null;const Ie=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),he.on("packet",Et=>{this.log("parser :: on packet push to packets array."),Ie.push(Et)});const Fe=()=>{this.log("work :: getting next packet in queue");const Et=Ie.shift();if(Et)this.log("work :: packet pulled from queue"),(0,x.default)(this,Et,pe);else{this.log("work :: no packets in queue");const Cn=le;le=null,this.log("work :: done flag is %s",!!Cn),Cn&&Cn()}},pe=()=>{if(Ie.length)L(Fe);else{const Et=le;le=null,Et()}};$._write=(Et,Cn,vn)=>{le=vn,this.log("writable stream :: parsing buffer"),he.parse(Et),Fe()};const Lt=Et=>{this.log("streamErrorHandler :: error",Et.message),F.includes(Et.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",Et)):this.noop(Et)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe($),this.stream.on("error",Lt),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const _e={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(_e.will=Object.assign(Object.assign({},this.options.will),{payload:(z=this.options.will)===null||z===void 0?void 0:z.payload})),this.topicAliasRecv&&(_e.properties||(_e.properties={}),this.topicAliasRecv&&(_e.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(_e),he.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const Et=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(Et)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(z,$,he,le){this.log("publish :: message `%s` to topic `%s`",$,z);const{options:Ie}=this;typeof he=="function"&&(le=he,he=null),he=he||{},he=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),he);const{qos:pe,retain:Lt,dup:_e,properties:Et,cbStorePut:Cn}=he;if(this._checkDisconnecting(le))return this;const vn=()=>{let Dt=0;if((pe===1||pe===2)&&(Dt=this._nextId(),Dt===null))return this.log("No messageId left"),!1;const de={cmd:"publish",topic:z,payload:$,qos:pe,retain:Lt,messageId:Dt,dup:_e};switch(Ie.protocolVersion===5&&(de.properties=Et),this.log("publish :: qos",pe),pe){case 1:case 2:this.outgoing[de.messageId]={volatile:!1,cb:le||this.noop},this.log("MqttClient:publish: packet cmd: %s",de.cmd),this._sendPacket(de,void 0,Cn);break;default:this.log("MqttClient:publish: packet cmd: %s",de.cmd),this._sendPacket(de,le,Cn);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,cbStorePut:he.cbStorePut,callback:le}),this}publishAsync(z,$,he){return new Promise((le,Ie)=>{this.publish(z,$,he,(Fe,pe)=>{Fe?Ie(Fe):le(pe)})})}subscribe(z,$,he){const le=this.options.protocolVersion;typeof $=="function"&&(he=$),he=he||this.noop;let Ie=!1,Fe=[];typeof z=="string"?(z=[z],Fe=z):Array.isArray(z)?Fe=z:typeof z=="object"&&(Ie=z.resubscribe,delete z.resubscribe,Fe=Object.keys(z));const pe=w.validateTopics(Fe);if(pe!==null)return M(he,new Error(`Invalid topic ${pe}`)),this;if(this._checkDisconnecting(he))return this.log("subscribe: discconecting true"),this;const Lt={qos:0};le===5&&(Lt.nl=!1,Lt.rap=!1,Lt.rh=0),$=Object.assign(Object.assign({},Lt),$);const _e=$.properties,Et=[],Cn=(Dt,de)=>{if(de=de||$,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,Dt)||this._resubscribeTopics[Dt].qos<de.qos||Ie){const qe={topic:Dt,qos:de.qos};le===5&&(qe.nl=de.nl,qe.rap=de.rap,qe.rh=de.rh,qe.properties=_e),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",qe.topic,qe.qos),Et.push(qe)}};if(Array.isArray(z)?z.forEach(Dt=>{this.log("subscribe: array topic %s",Dt),Cn(Dt)}):Object.keys(z).forEach(Dt=>{this.log("subscribe: object topic %s, %o",Dt,z[Dt]),Cn(Dt,z[Dt])}),!Et.length)return he(null,[]),this;const vn=()=>{const Dt=this._nextId();if(Dt===null)return this.log("No messageId left"),!1;const de={cmd:"subscribe",subscriptions:Et,messageId:Dt};if(_e&&(de.properties=_e),this.options.resubscribe){this.log("subscribe :: resubscribe true");const qe=[];Et.forEach(Pt=>{if(this.options.reconnectPeriod>0){const In={qos:Pt.qos};le===5&&(In.nl=Pt.nl||!1,In.rap=Pt.rap||!1,In.rh=Pt.rh||0,In.properties=Pt.properties),this._resubscribeTopics[Pt.topic]=In,qe.push(Pt.topic)}}),this.messageIdToTopic[de.messageId]=qe}return this.outgoing[de.messageId]={volatile:!0,cb(qe,Pt){if(!qe){const{granted:In}=Pt;for(let $e=0;$e<In.length;$e+=1)Et[$e].qos=In[$e]}he(qe,Et)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(de),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,callback:he}),this}subscribeAsync(z,$){return new Promise((he,le)=>{this.subscribe(z,$,(Ie,Fe)=>{Ie?le(Ie):he(Fe)})})}unsubscribe(z,$,he){typeof z=="string"&&(z=[z]),typeof $=="function"&&(he=$),he=he||this.noop;const le=w.validateTopics(z);if(le!==null)return M(he,new Error(`Invalid topic ${le}`)),this;if(this._checkDisconnecting(he))return this;const Ie=()=>{const Fe=this._nextId();if(Fe===null)return this.log("No messageId left"),!1;const pe={cmd:"unsubscribe",messageId:Fe,unsubscriptions:[]};return typeof z=="string"?pe.unsubscriptions=[z]:Array.isArray(z)&&(pe.unsubscriptions=z),this.options.resubscribe&&pe.unsubscriptions.forEach(Lt=>{delete this._resubscribeTopics[Lt]}),typeof $=="object"&&$.properties&&(pe.properties=$.properties),this.outgoing[pe.messageId]={volatile:!0,cb:he},this.log("unsubscribe: call _sendPacket"),this._sendPacket(pe),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ie())&&this._storeProcessingQueue.push({invoke:Ie,callback:he}),this}unsubscribeAsync(z,$){return new Promise((he,le)=>{this.unsubscribe(z,$,(Ie,Fe)=>{Ie?le(Ie):he(Fe)})})}end(z,$,he){this.log("end :: (%s)",this.options.clientId),(z==null||typeof z!="boolean")&&(he=he||$,$=z,z=!1),typeof $!="object"&&(he=he||$,$=null),this.log("end :: cb? %s",!!he),(!he||typeof he!="function")&&(he=this.noop);const le=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(Fe=>{this.outgoingStore.close(pe=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),he){const Lt=Fe||pe;this.log("end :: closeStores: invoking callback with args"),he(Lt)}})}),this._deferredReconnect&&this._deferredReconnect()},Ie=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,z),this._cleanUp(z,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),L(le)},$)};return this.disconnecting?(he(),this):(this._clearReconnect(),this.disconnecting=!0,!z&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,Ie,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),Ie()),this)}endAsync(z,$){return new Promise((he,le)=>{this.end(z,$,Ie=>{Ie?le(Ie):he()})})}removeOutgoingMessage(z){if(this.outgoing[z]){const{cb:$}=this.outgoing[z];this._removeOutgoingAndStoreMessage(z,()=>{$(new Error("Message removed"))})}return this}reconnect(z){this.log("client reconnect");const $=()=>{z?(this.options.incomingStore=z.incomingStore,this.options.outgoingStore=z.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new S.default,this.outgoingStore=this.options.outgoingStore||new S.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=$:$(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(z=>{this.outgoing[z].volatile&&typeof this.outgoing[z].cb=="function"&&(this.outgoing[z].cb(new Error("Connection closed")),delete this.outgoing[z])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(z=>{typeof this.outgoing[z].cb=="function"&&(this.outgoing[z].cb(new Error("Connection closed")),delete this.outgoing[z])}))}_removeTopicAliasAndRecoverTopicName(z){let $;z.properties&&($=z.properties.topicAlias);let he=z.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",$,he),he.length===0){if(typeof $>"u")return new Error("Unregistered Topic Alias");if(he=this.topicAliasSend.getTopicByAlias($),typeof he>"u")return new Error("Unregistered Topic Alias");z.topic=he}$&&delete z.properties.topicAlias}_checkDisconnecting(z){return this.disconnecting&&(z&&z!==this.noop?z(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(z,$,he={}){if($&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",$)),this.log("_cleanUp :: forced? %s",z),z)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const le=Object.assign({cmd:"disconnect"},he);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(le,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),M(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),$&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",$),$())}_storeAndSend(z,$,he){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",z.cmd);let le=z,Ie;if(le.cmd==="publish"&&(le=(0,A.default)(z),Ie=this._removeTopicAliasAndRecoverTopicName(le),Ie))return $&&$(Ie);this.outgoingStore.put(le,Fe=>{if(Fe)return $&&$(Fe);he(),this._writePacket(z,$)})}_applyTopicAlias(z){if(this.options.protocolVersion===5&&z.cmd==="publish"){let $;z.properties&&($=z.properties.topicAlias);const he=z.topic.toString();if(this.topicAliasSend)if($){if(he.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",he,$),!this.topicAliasSend.put(he,$)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",he,$),new Error("Sending Topic Alias out of range")}else he.length!==0&&(this.options.autoAssignTopicAlias?($=this.topicAliasSend.getAliasByTopic(he),$?(z.topic="",z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",he,$)):($=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(he,$),z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",he,$))):this.options.autoUseTopicAlias&&($=this.topicAliasSend.getAliasByTopic(he),$&&(z.topic="",z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",he,$))));else if($)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",he,$),new Error("Sending Topic Alias out of range")}}_noop(z){this.log("noop ::",z)}_writePacket(z,$){this.log("_writePacket :: packet: %O",z),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",z),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const he=p.default.writeToStream(z,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",he),!he&&$&&$!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",$)):$&&(this.log("_writePacket :: invoking cb"),$())}_sendPacket(z,$,he,le){this.log("_sendPacket :: (%s) :: start",this.options.clientId),he=he||this.noop,$=$||this.noop;const Ie=this._applyTopicAlias(z);if(Ie){$(Ie);return}if(!this.connected){if(z.cmd==="auth"){this._writePacket(z,$);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(z,$,he);return}if(le){this._writePacket(z,$);return}switch(z.cmd){case"publish":break;case"pubrel":this._storeAndSend(z,$,he);return;default:this._writePacket(z,$);return}switch(z.qos){case 2:case 1:this._storeAndSend(z,$,he);break;case 0:default:this._writePacket(z,$);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(z,$,he){this.log("_storePacket :: packet: %o",z),this.log("_storePacket :: cb? %s",!!$),he=he||this.noop;let le=z;if(le.cmd==="publish"){le=(0,A.default)(z);const Fe=this._removeTopicAliasAndRecoverTopicName(le);if(Fe)return $&&$(Fe)}const Ie=le.qos||0;Ie===0&&this.queueQoSZero||le.cmd!=="publish"?this.queue.push({packet:le,cb:$}):Ie>0?($=this.outgoing[le.messageId]?this.outgoing[le.messageId].cb:null,this.outgoingStore.put(le,Fe=>{if(Fe)return $&&$(Fe);he()})):$&&$(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,b.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const z=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&z.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let $=0;$<z.length;$++){const he={};he[z[$]]=this._resubscribeTopics[z[$]],he.resubscribe=!0,this.subscribe(he,{properties:he[z[$]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(z){if(this.disconnected){this.emit("connect",z);return}this.connackPacket=z,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const $=()=>{let he=this.outgoingStore.createStream();const le=()=>{he.destroy(),he=null,this._flushStoreProcessingQueue(),Ie()},Ie=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",le),he.on("error",pe=>{Ie(),this._flushStoreProcessingQueue(),this.removeListener("close",le),this.emit("error",pe)});const Fe=()=>{if(!he)return;const pe=he.read(1);let Lt;if(!pe){he.once("readable",Fe);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[pe.messageId]){Fe();return}!this.disconnecting&&!this.reconnectTimer?(Lt=this.outgoing[pe.messageId]?this.outgoing[pe.messageId].cb:null,this.outgoing[pe.messageId]={volatile:!1,cb(_e,Et){Lt&&Lt(_e,Et),Fe()}},this._packetIdsDuringStoreProcessing[pe.messageId]=!0,this.messageIdProvider.register(pe.messageId)?this._sendPacket(pe,void 0,void 0,!0):this.log("messageId: %d has already used.",pe.messageId)):he.destroy&&he.destroy()};he.on("end",()=>{let pe=!0;for(const Lt in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[Lt]){pe=!1;break}pe?(Ie(),this.removeListener("close",le),this._invokeAllStoreProcessingQueue(),this.emit("connect",z)):$()}),Fe()};$()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const z=this._storeProcessingQueue[0];if(z&&z.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const z of this._storeProcessingQueue)z.cbStorePut&&z.cbStorePut(new Error("Connection closed")),z.callback&&z.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(z,$){delete this.outgoing[z],this.outgoingStore.del({messageId:z},(he,le)=>{$(he,le),this.messageIdProvider.deallocate(z),this._invokeStoreProcessingQueue()})}}a.default=j}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(i,o,a){var u=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=i("readable-stream"),d=u(i("duplexify"));let h,v,g,p=!1;function y(){const T=new f.Transform;return T._write=(S,x,O)=>{h.sendSocketMessage({data:S.buffer,success(){O()},fail(){O(new Error)}})},T._flush=S=>{h.closeSocket({success(){S()}})},T}function _(T){T.hostname||(T.hostname="localhost"),T.path||(T.path="/"),T.wsOptions||(T.wsOptions={})}function b(T,S){const x=T.protocol==="alis"?"wss":"ws";let O=`${x}://${T.hostname}${T.path}`;return T.port&&T.port!==80&&T.port!==443&&(O=`${x}://${T.hostname}:${T.port}${T.path}`),typeof T.transformWsUrl=="function"&&(O=T.transformWsUrl(O,T,S)),O}function A(){p||(p=!0,h.onSocketOpen(()=>{g.setReadable(v),g.setWritable(v),g.emit("connect")}),h.onSocketMessage(T=>{if(typeof T.data=="string"){const S=c.Buffer.from(T.data,"base64");v.push(S)}else{const S=new FileReader;S.addEventListener("load",()=>{let x=S.result;x instanceof ArrayBuffer?x=c.Buffer.from(x):x=c.Buffer.from(x,"utf8"),v.push(x)}),S.readAsArrayBuffer(T.data)}}),h.onSocketClose(()=>{g.end(),g.destroy()}),h.onSocketError(T=>{g.destroy(T)}))}const w=(T,S)=>{if(S.hostname=S.hostname||S.host,!S.hostname)throw new Error("Could not determine host. Specify host manually.");const x=S.protocolId==="MQIsdp"&&S.protocolVersion===3?"mqttv3.1":"mqtt";_(S);const O=b(S,T);return h=S.my,h.connectSocket({url:O,protocols:x}),v=y(),g=d.default.obj(),A(),g};a.default=w},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(i,o,a){var u=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(a,"__esModule",{value:!0}),a.connectAsync=void 0;const c=u(i("debug")),f=u(i("url")),d=u(i("../client")),h=u(i("../is-browser")),v=(0,c.default)("mqttjs"),g={};h.default?(g.wx=i("./wx").default,g.wxs=i("./wx").default,g.ali=i("./ali").default,g.alis=i("./ali").default):(g.mqtt=i("./tcp").default,g.tcp=i("./tcp").default,g.ssl=i("./tls").default,g.tls=g.ssl,g.mqtts=i("./tls").default),g.ws=i("./ws").default,g.wss=i("./ws").default;function p(b){let A;b.auth&&(A=b.auth.match(/^(.+):(.+)$/),A?(b.username=A[1],b.password=A[2]):b.username=b.auth)}function y(b,A){if(v("connecting to an MQTT broker..."),typeof b=="object"&&!A&&(A=b,b=""),A=A||{},b&&typeof b=="string"){const S=f.default.parse(b,!0);if(S.port!=null&&(S.port=Number(S.port)),A=Object.assign(Object.assign({},S),A),A.protocol===null)throw new Error("Missing protocol");A.protocol=A.protocol.replace(/:$/,"")}if(p(A),A.query&&typeof A.query.clientId=="string"&&(A.clientId=A.query.clientId),A.cert&&A.key)if(A.protocol){if(["mqtts","wss","wxs","alis"].indexOf(A.protocol)===-1)switch(A.protocol){case"mqtt":A.protocol="mqtts";break;case"ws":A.protocol="wss";break;case"wx":A.protocol="wxs";break;case"ali":A.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${A.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!g[A.protocol]){const S=["mqtts","wss"].indexOf(A.protocol)!==-1;A.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((x,O)=>S&&O%2===0?!1:typeof g[x]=="function")[0]}if(A.clean===!1&&!A.clientId)throw new Error("Missing clientId for unclean clients");A.protocol&&(A.defaultProtocol=A.protocol);function w(S){return A.servers&&((!S._reconnectCount||S._reconnectCount===A.servers.length)&&(S._reconnectCount=0),A.host=A.servers[S._reconnectCount].host,A.port=A.servers[S._reconnectCount].port,A.protocol=A.servers[S._reconnectCount].protocol?A.servers[S._reconnectCount].protocol:A.defaultProtocol,A.hostname=A.host,S._reconnectCount++),v("calling streambuilder for",A.protocol),g[A.protocol](S,A)}const T=new d.default(w,A);return T.on("error",()=>{}),T}function _(b,A,w=!0){return new Promise((T,S)=>{const x=y(b,A),O={connect:M=>{L(),T(x)},end:()=>{L(),T(x)},error:M=>{L(),x.end(),S(M)}};w===!1&&(O.close=()=>{O.error(new Error("Couldn't connect to server"))});function L(){Object.keys(O).forEach(M=>{x.off(M,O[M])})}Object.keys(O).forEach(M=>{x.on(M,O[M])})})}a.connectAsync=_,a.default=y},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(i,o,a){var u=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("net")),d=(0,u(i("debug")).default)("mqttjs:tcp"),h=(v,g)=>{g.port=g.port||1883,g.hostname=g.hostname||g.host||"localhost";const{port:p}=g,y=g.hostname;return d("port %d and host %s",p,y),c.default.createConnection(p,y)};a.default=h},{debug:30,net:26}],6:[function(i,o,a){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("tls")),f=u(i("net")),h=(0,u(i("debug")).default)("mqttjs:tls"),v=(g,p)=>{p.port=p.port||8883,p.host=p.hostname||p.host||"localhost",f.default.isIP(p.host)===0&&(p.servername=p.host),p.rejectUnauthorized=p.rejectUnauthorized!==!1,delete p.path,h("port %d host %s rejectUnauthorized %b",p.port,p.host,p.rejectUnauthorized);const y=c.default.connect(p);y.on("secureConnect",()=>{p.rejectUnauthorized&&!y.authorized?y.emit("error",new Error("TLS not authorized")):y.removeListener("error",_)});function _(b){p.rejectUnauthorized&&g.emit("error",b),y.end()}return y.on("error",_),y};a.default=v},{debug:30,net:26,tls:26}],7:[function(i,o,a){var u=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=u(i("ws")),d=u(i("debug")),h=u(i("duplexify")),v=i("readable-stream"),g=u(i("../is-browser")),p=(0,d.default)("mqttjs:ws"),y=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function _(O,L){let M=`${O.protocol}://${O.hostname}:${O.port}${O.path}`;return typeof O.transformWsUrl=="function"&&(M=O.transformWsUrl(M,O,L)),M}function b(O){const L=O;return O.hostname||(L.hostname="localhost"),O.port||(O.protocol==="wss"?L.port=443:L.port=80),O.path||(L.path="/"),O.wsOptions||(L.wsOptions={}),!g.default&&O.protocol==="wss"&&y.forEach(M=>{Object.prototype.hasOwnProperty.call(O,M)&&!Object.prototype.hasOwnProperty.call(O.wsOptions,M)&&(L.wsOptions[M]=O[M])}),L}function A(O){const L=b(O);if(L.hostname||(L.hostname=L.host),!L.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const M=new URL(document.URL);L.hostname=M.hostname,L.port||(L.port=Number(M.port))}return L.objectMode===void 0&&(L.objectMode=!(L.binary===!0||L.binary===void 0)),L}function w(O,L,M){p("createWebSocket"),p(`protocol: ${M.protocolId} ${M.protocolVersion}`);const re=M.protocolId==="MQIsdp"&&M.protocolVersion===3?"mqttv3.1":"mqtt";p(`creating new Websocket for url: ${L} and protocol: ${re}`);let F;return M.createWebsocket?F=M.createWebsocket(L,[re],M):F=new f.default(L,[re],M.wsOptions),F}function T(O,L){const M=L.protocolId==="MQIsdp"&&L.protocolVersion===3?"mqttv3.1":"mqtt",re=_(L,O);let F;return L.createWebsocket?F=L.createWebsocket(re,[M],L):F=new WebSocket(re,[M]),F.binaryType="arraybuffer",F}const S=(O,L)=>{p("streamBuilder");const M=b(L),re=_(M,O),F=w(O,re,M),j=f.default.createWebSocketStream(F,M.wsOptions);return j.url=re,F.on("close",()=>{j.destroy()}),j},x=(O,L)=>{p("browserStreamBuilder");let M;const F=A(L).browserBufferSize||1024*512,j=L.browserBufferTimeout||1e3,V=!L.objectMode,z=T(O,L),$=le(L,Et,Cn);L.objectMode||($._writev=_e),$.on("close",()=>{z.close()});const he=typeof z.addEventListener<"u";z.readyState===z.OPEN?M=$:(M=(0,h.default)(void 0,void 0,L),L.objectMode||(M._writev=_e),he?z.addEventListener("open",Ie):z.onopen=Ie),M.socket=z,he?(z.addEventListener("close",Fe),z.addEventListener("error",pe),z.addEventListener("message",Lt)):(z.onclose=Fe,z.onerror=pe,z.onmessage=Lt);function le(vn,Dt,de){const qe=new v.Transform({objectMode:vn.objectMode});return qe._write=Dt,qe._flush=de,qe}function Ie(){M.setReadable($),M.setWritable($),M.emit("connect")}function Fe(){M.end(),M.destroy()}function pe(vn){M.destroy(vn)}function Lt(vn){let{data:Dt}=vn;Dt instanceof ArrayBuffer?Dt=c.Buffer.from(Dt):Dt=c.Buffer.from(Dt,"utf8"),$.push(Dt)}function _e(vn,Dt){const de=new Array(vn.length);for(let qe=0;qe<vn.length;qe++)typeof vn[qe].chunk=="string"?de[qe]=c.Buffer.from(vn[qe],"utf8"):de[qe]=vn[qe].chunk;this._write(c.Buffer.concat(de),"binary",Dt)}function Et(vn,Dt,de){z.bufferedAmount>F&&setTimeout(Et,j,vn,Dt,de),V&&typeof vn=="string"&&(vn=c.Buffer.from(vn,"utf8"));try{z.send(vn)}catch(qe){return de(qe)}de()}function Cn(vn){z.close(),vn()}return M};a.default=g.default?x:S},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(i,o,a){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=i("readable-stream"),d=u(i("duplexify"));let h,v,g;function p(){const w=new f.Transform;return w._write=(T,S,x)=>{h.send({data:T.buffer,success(){x()},fail(O){x(new Error(O))}})},w._flush=T=>{h.close({success(){T()}})},w}function y(w){w.hostname||(w.hostname="localhost"),w.path||(w.path="/"),w.wsOptions||(w.wsOptions={})}function _(w,T){const S=w.protocol==="wxs"?"wss":"ws";let x=`${S}://${w.hostname}${w.path}`;return w.port&&w.port!==80&&w.port!==443&&(x=`${S}://${w.hostname}:${w.port}${w.path}`),typeof w.transformWsUrl=="function"&&(x=w.transformWsUrl(x,w,T)),x}function b(){h.onOpen(()=>{g.setReadable(v),g.setWritable(v),g.emit("connect")}),h.onMessage(w=>{let{data:T}=w;T instanceof ArrayBuffer?T=c.Buffer.from(T):T=c.Buffer.from(T,"utf8"),v.push(T)}),h.onClose(()=>{g.emit("close"),g.end(),g.destroy()}),h.onError(w=>{g.destroy(new Error(w.errMsg))})}const A=(w,T)=>{if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");const S=T.protocolId==="MQIsdp"&&T.protocolVersion===3?"mqttv3.1":"mqtt";y(T);const x=_(T,w);h=wx.connectSocket({url:x,protocols:[S]}),v=p(),g=d.default.obj(),g._destroy=(L,M)=>{h.close({success(){M&&M(L)}})};const O=g.destroy;return g.destroy=()=>{g.destroy=O,setTimeout(()=>{h.close({fail(){g._destroy(new Error)}})},0)},b(),g};a.default=A},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){const f=this.nextId++;return this.nextId===65536&&(this.nextId=1),f}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(f){return!0}deallocate(f){}clear(){}}a.default=u},{}],10:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=void 0,a.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};const u=(c,f)=>{const{messageId:d}=f,h=f.cmd;let v=null;const g=c.outgoing[d]?c.outgoing[d].cb:null;let p;if(!g){c.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(c.log("_handleAck :: packet type",h),h){case"pubcomp":case"puback":{const y=f.reasonCode;y&&y>0&&y!==16?(p=new Error(`Publish error: ${a.ReasonCodes[y]}`),p.code=y,c._removeOutgoingAndStoreMessage(d,()=>{g(p,f)})):c._removeOutgoingAndStoreMessage(d,g);break}case"pubrec":{v={cmd:"pubrel",qos:2,messageId:d};const y=f.reasonCode;y&&y>0&&y!==16?(p=new Error(`Publish error: ${a.ReasonCodes[y]}`),p.code=y,c._removeOutgoingAndStoreMessage(d,()=>{g(p,f)})):c._sendPacket(v);break}case"suback":{delete c.outgoing[d],c.messageIdProvider.deallocate(d);const y=f.granted;for(let _=0;_<y.length;_++)if(y[_]&128){const b=c.messageIdToTopic[d];b&&b.forEach(A=>{delete c._resubscribeTopics[A]})}delete c.messageIdToTopic[d],c._invokeStoreProcessingQueue(),g(null,f);break}case"unsuback":{delete c.outgoing[d],c.messageIdProvider.deallocate(d),c._invokeStoreProcessingQueue(),g(null);break}default:c.emit("error",new Error("unrecognized packet type"))}c.disconnecting&&Object.keys(c.outgoing).length===0&&c.emit("outgoingEmpty")};a.default=u},{}],11:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("../shared"),c=i("./ack"),f=(d,h)=>{const{options:v}=d,g=v.protocolVersion,p=g===5?h.reasonCode:h.returnCode;if(g!==5){const y=new u.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${g}`,p);d.emit("error",y);return}d.handleAuth(h,(y,_)=>{if(y){d.emit("error",y);return}if(p===24)d.reconnecting=!1,d._sendPacket(_);else{const b=new u.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[p]}`,p);d.emit("error",b)}})};a.default=f},{"../shared":17,"./ack":10}],12:[function(i,o,a){var u=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("./ack"),f=u(i("../topic-alias-send")),d=i("../shared"),h=(v,g)=>{v.log("_handleConnack");const{options:p}=v,_=p.protocolVersion===5?g.reasonCode:g.returnCode;if(clearTimeout(v.connackTimer),delete v.topicAliasSend,g.properties){if(g.properties.topicAliasMaximum){if(g.properties.topicAliasMaximum>65535){v.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}g.properties.topicAliasMaximum>0&&(v.topicAliasSend=new f.default(g.properties.topicAliasMaximum))}g.properties.serverKeepAlive&&p.keepalive&&(p.keepalive=g.properties.serverKeepAlive,v._shiftPingInterval()),g.properties.maximumPacketSize&&(p.properties||(p.properties={}),p.properties.maximumPacketSize=g.properties.maximumPacketSize)}if(_===0)v.reconnecting=!1,v._onConnect(g);else if(_>0){const b=new d.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[_]}`,_);v.emit("error",b)}};a.default=h},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(i,o,a){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("./publish")),f=u(i("./auth")),d=u(i("./connack")),h=u(i("./ack")),v=u(i("./pubrel")),g=(p,y,_)=>{const{options:b}=p;if(b.protocolVersion===5&&b.properties&&b.properties.maximumPacketSize&&b.properties.maximumPacketSize<y.length)return p.emit("error",new Error(`exceeding packets size ${y.cmd}`)),p.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),p;switch(p.log("_handlePacket :: emitting packetreceive"),p.emit("packetreceive",y),y.cmd){case"publish":(0,c.default)(p,y,_);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,h.default)(p,y),_();break;case"pubrel":(0,v.default)(p,y,_);break;case"connack":(0,d.default)(p,y),_();break;case"auth":(0,f.default)(p,y),_();break;case"pingresp":p.pingResp=!0,_();break;case"disconnect":p.emit("disconnect",y),_();break;default:p.log("_handlePacket :: unknown command"),_();break}};a.default=g},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=[0,16,128,131,135,144,145,151,153],c=(f,d,h)=>{f.log("handlePublish: packet %o",d),h=typeof h<"u"?h:f.noop;let v=d.topic.toString();const g=d.payload,{qos:p}=d,{messageId:y}=d,{options:_}=f;if(f.options.protocolVersion===5){let b;if(d.properties&&(b=d.properties.topicAlias),typeof b<"u")if(v.length===0)if(b>0&&b<=65535){const A=f.topicAliasRecv.getTopicByAlias(b);if(A)v=A,f.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",v,b);else{f.log("handlePublish :: unregistered topic alias. alias: %d",b),f.emit("error",new Error("Received unregistered Topic Alias"));return}}else{f.log("handlePublish :: topic alias out of range. alias: %d",b),f.emit("error",new Error("Received Topic Alias is out of range"));return}else if(f.topicAliasRecv.put(v,b))f.log("handlePublish :: registered topic: %s - alias: %d",v,b);else{f.log("handlePublish :: topic alias out of range. alias: %d",b),f.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(f.log("handlePublish: qos %d",p),p){case 2:{_.customHandleAcks(v,g,d,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return f.emit("error",b);if(u.indexOf(A)===-1)return f.emit("error",new Error("Wrong reason code for pubrec"));A?f._sendPacket({cmd:"pubrec",messageId:y,reasonCode:A},h):f.incomingStore.put(d,()=>{f._sendPacket({cmd:"pubrec",messageId:y},h)})});break}case 1:{_.customHandleAcks(v,g,d,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return f.emit("error",b);if(u.indexOf(A)===-1)return f.emit("error",new Error("Wrong reason code for puback"));A||f.emit("message",v,g,d),f.handleMessage(d,w=>{if(w)return h&&h(w);f._sendPacket({cmd:"puback",messageId:y,reasonCode:A},h)})});break}case 0:f.emit("message",v,g,d),f.handleMessage(d,h);break;default:f.log("handlePublish: unknown QoS. Doing nothing.");break}};a.default=c},{}],15:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=(c,f,d)=>{c.log("handling pubrel packet");const h=typeof d<"u"?d:c.noop,{messageId:v}=f,g={cmd:"pubcomp",messageId:v};c.incomingStore.get(f,(p,y)=>{p?c._sendPacket(g,h):(c.emit("message",y.topic,y.payload,y),c.handleMessage(y,_=>{if(_)return h(_);c.incomingStore.del(y,c.noop),c._sendPacket(g,h)}))})};a.default=u},{}],16:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=typeof window<"u"&&typeof window.document<"u"||typeof self<"u"&&typeof self.postMessage=="function";a.default=u},{}],17:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.applyMixin=a.ErrorWithReasonCode=void 0;class u extends Error{constructor(d,h){super(d),this.code=h,Object.setPrototypeOf(this,u.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}a.ErrorWithReasonCode=u;function c(f,d,h=!1){var v;const g=[d];for(;;){const p=g[0],y=Object.getPrototypeOf(p);if(y!=null&&y.prototype)g.unshift(y);else break}for(const p of g)for(const y of Object.getOwnPropertyNames(p.prototype))(h||y!=="constructor")&&Object.defineProperty(f.prototype,y,(v=Object.getOwnPropertyDescriptor(p.prototype,y))!==null&&v!==void 0?v:Object.create(null))}a.applyMixin=c},{}],18:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("readable-stream"),c={objectMode:!0},f={clean:!0};class d{constructor(v){this.options=v||{},this.options=Object.assign(Object.assign({},f),v),this._inflights=new Map}put(v,g){return this._inflights.set(v.messageId,v),g&&g(),this}createStream(){const v=new u.Readable(c),g=[];let p=!1,y=0;return this._inflights.forEach((_,b)=>{g.push(_)}),v._read=()=>{!p&&y<g.length?v.push(g[y++]):v.push(null)},v.destroy=_=>{if(!p)return p=!0,setTimeout(()=>{v.emit("close")},0),v},v}del(v,g){const p=this._inflights.get(v.messageId);return p?(this._inflights.delete(v.messageId),g(null,p)):g&&g(new Error("missing packet")),this}get(v,g){const p=this._inflights.get(v.messageId);return p?g(null,p):g&&g(new Error("missing packet")),this}close(v){this.options.clean&&(this._inflights=null),v&&v()}}a.default=d},{"readable-stream":125}],19:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(f){this.aliasToTopic={},this.max=f}put(f,d){return d===0||d>this.max?!1:(this.aliasToTopic[d]=f,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(f){return this.aliasToTopic[f]}clear(){this.aliasToTopic={}}}a.default=u},{}],20:[function(i,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("lru-cache")),f=i("number-allocator");class d{constructor(v){v>0&&(this.aliasToTopic=new c.default({max:v}),this.topicToAlias={},this.numberAllocator=new f.NumberAllocator(1,v),this.max=v,this.length=0)}put(v,g){if(g===0||g>this.max)return!1;const p=this.aliasToTopic.get(g);return p&&delete this.topicToAlias[p],this.aliasToTopic.set(g,v),this.topicToAlias[v]=g,this.numberAllocator.use(g),this.length=this.aliasToTopic.size,!0}getTopicByAlias(v){return this.aliasToTopic.get(v)}getAliasByTopic(v){const g=this.topicToAlias[v];return typeof g<"u"&&this.aliasToTopic.get(g),g}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const v=this.numberAllocator.firstVacant();return v||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}a.default=d},{"lru-cache":72,"number-allocator":98}],21:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("number-allocator");class c{constructor(){this.numberAllocator=new u.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(d){return this.numberAllocator.use(d)}deallocate(d){this.numberAllocator.free(d)}clear(){this.numberAllocator.clear()}}a.default=c},{"number-allocator":98}],22:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.validateTopics=a.validateTopic=void 0;function u(f){const d=f.split("/");for(let h=0;h<d.length;h++)if(d[h]!=="+"){if(d[h]==="#")return h===d.length-1;if(d[h].indexOf("+")!==-1||d[h].indexOf("#")!==-1)return!1}return!0}a.validateTopic=u;function c(f){if(f.length===0)return"empty_topic_list";for(let d=0;d<f.length;d++)if(!u(f[d]))return f[d];return null}a.validateTopics=c},{}],23:[function(i,o,a){var u=this&&this.__createBinding||(Object.create?function(A,w,T,S){S===void 0&&(S=T);var x=Object.getOwnPropertyDescriptor(w,T);(!x||("get"in x?!w.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return w[T]}}),Object.defineProperty(A,S,x)}:function(A,w,T,S){S===void 0&&(S=T),A[S]=w[T]}),c=this&&this.__setModuleDefault||(Object.create?function(A,w){Object.defineProperty(A,"default",{enumerable:!0,value:w})}:function(A,w){A.default=w}),f=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var w={};if(A!=null)for(var T in A)T!=="default"&&Object.prototype.hasOwnProperty.call(A,T)&&u(w,A,T);return c(w,A),w},d=this&&this.__exportStar||function(A,w){for(var T in A)T!=="default"&&!Object.prototype.hasOwnProperty.call(w,T)&&u(w,A,T)},h=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=a.UniqueMessageIdProvider=a.DefaultMessageIdProvider=a.Store=a.MqttClient=a.connectAsync=a.connect=a.Client=void 0;const v=h(i("./lib/client"));a.MqttClient=v.default;const g=h(i("./lib/default-message-id-provider"));a.DefaultMessageIdProvider=g.default;const p=h(i("./lib/unique-message-id-provider"));a.UniqueMessageIdProvider=p.default;const y=h(i("./lib/store"));a.Store=y.default;const _=f(i("./lib/connect"));a.connect=_.default,Object.defineProperty(a,"connectAsync",{enumerable:!0,get:function(){return _.connectAsync}}),a.Client=v.default,d(i("./lib/client"),a),d(i("./lib/shared"),a);var b=i("./lib/handlers/ack");Object.defineProperty(a,"ReasonCodes",{enumerable:!0,get:function(){return b.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(i,o,a){const{AbortController:u,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;o.exports=u,o.exports.AbortSignal=c,o.exports.default=u},{}],25:[function(i,o,a){a.byteLength=p,a.toByteArray=_,a.fromByteArray=w;for(var u=[],c=[],f=typeof Uint8Array<"u"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,v=d.length;h<v;++h)u[h]=d[h],c[d.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function g(T){var S=T.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=T.indexOf("=");x===-1&&(x=S);var O=x===S?0:4-x%4;return[x,O]}function p(T){var S=g(T),x=S[0],O=S[1];return(x+O)*3/4-O}function y(T,S,x){return(S+x)*3/4-x}function _(T){var S,x=g(T),O=x[0],L=x[1],M=new f(y(T,O,L)),re=0,F=L>0?O-4:O,j;for(j=0;j<F;j+=4)S=c[T.charCodeAt(j)]<<18|c[T.charCodeAt(j+1)]<<12|c[T.charCodeAt(j+2)]<<6|c[T.charCodeAt(j+3)],M[re++]=S>>16&255,M[re++]=S>>8&255,M[re++]=S&255;return L===2&&(S=c[T.charCodeAt(j)]<<2|c[T.charCodeAt(j+1)]>>4,M[re++]=S&255),L===1&&(S=c[T.charCodeAt(j)]<<10|c[T.charCodeAt(j+1)]<<4|c[T.charCodeAt(j+2)]>>2,M[re++]=S>>8&255,M[re++]=S&255),M}function b(T){return u[T>>18&63]+u[T>>12&63]+u[T>>6&63]+u[T&63]}function A(T,S,x){for(var O,L=[],M=S;M<x;M+=3)O=(T[M]<<16&16711680)+(T[M+1]<<8&65280)+(T[M+2]&255),L.push(b(O));return L.join("")}function w(T){for(var S,x=T.length,O=x%3,L=[],M=16383,re=0,F=x-O;re<F;re+=M)L.push(A(T,re,re+M>F?F:re+M));return O===1?(S=T[x-1],L.push(u[S>>2]+u[S<<4&63]+"==")):O===2&&(S=(T[x-2]<<8)+T[x-1],L.push(u[S>>10]+u[S>>4&63]+u[S<<2&63]+"=")),L.join("")}},{}],26:[function(i,o,a){},{}],27:[function(i,o,a){var u=i("buffer"),c=u.Buffer;function f(h,v){for(var g in h)v[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(f(u,a),a.Buffer=d);function d(h,v,g){return c(h,v,g)}f(c,d),d.from=function(h,v,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,v,g)},d.alloc=function(h,v,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return v!==void 0?typeof g=="string"?p.fill(v,g):p.fill(v):p.fill(0),p},d.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},d.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],28:[function(i,o,a){var u=i("safe-buffer").Buffer,c=u.isEncoding||function(L){switch(L=""+L,L&&L.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function f(L){if(!L)return"utf8";for(var M;;)switch(L){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return L;default:if(M)return;L=(""+L).toLowerCase(),M=!0}}function d(L){var M=f(L);if(typeof M!="string"&&(u.isEncoding===c||!c(L)))throw new Error("Unknown encoding: "+L);return M||L}a.StringDecoder=h;function h(L){this.encoding=d(L);var M;switch(this.encoding){case"utf16le":this.text=A,this.end=w,M=4;break;case"utf8":this.fillLast=y,M=4;break;case"base64":this.text=T,this.end=S,M=3;break;default:this.write=x,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(M)}h.prototype.write=function(L){if(L.length===0)return"";var M,re;if(this.lastNeed){if(M=this.fillLast(L),M===void 0)return"";re=this.lastNeed,this.lastNeed=0}else re=0;return re<L.length?M?M+this.text(L,re):this.text(L,re):M||""},h.prototype.end=b,h.prototype.text=_,h.prototype.fillLast=function(L){if(this.lastNeed<=L.length)return L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,L.length),this.lastNeed-=L.length};function v(L){return L<=127?0:L>>5===6?2:L>>4===14?3:L>>3===30?4:L>>6===2?-1:-2}function g(L,M,re){var F=M.length-1;if(F<re)return 0;var j=v(M[F]);return j>=0?(j>0&&(L.lastNeed=j-1),j):--F<re||j===-2?0:(j=v(M[F]),j>=0?(j>0&&(L.lastNeed=j-2),j):--F<re||j===-2?0:(j=v(M[F]),j>=0?(j>0&&(j===2?j=0:L.lastNeed=j-3),j):0))}function p(L,M,re){if((M[0]&192)!==128)return L.lastNeed=0,"�";if(L.lastNeed>1&&M.length>1){if((M[1]&192)!==128)return L.lastNeed=1,"�";if(L.lastNeed>2&&M.length>2&&(M[2]&192)!==128)return L.lastNeed=2,"�"}}function y(L){var M=this.lastTotal-this.lastNeed,re=p(this,L);if(re!==void 0)return re;if(this.lastNeed<=L.length)return L.copy(this.lastChar,M,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,M,0,L.length),this.lastNeed-=L.length}function _(L,M){var re=g(this,L,M);if(!this.lastNeed)return L.toString("utf8",M);this.lastTotal=re;var F=L.length-(re-this.lastNeed);return L.copy(this.lastChar,0,F),L.toString("utf8",M,F)}function b(L){var M=L&&L.length?this.write(L):"";return this.lastNeed?M+"�":M}function A(L,M){if((L.length-M)%2===0){var re=L.toString("utf16le",M);if(re){var F=re.charCodeAt(re.length-1);if(F>=55296&&F<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1],re.slice(0,-1)}return re}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=L[L.length-1],L.toString("utf16le",M,L.length-1)}function w(L){var M=L&&L.length?this.write(L):"";if(this.lastNeed){var re=this.lastTotal-this.lastNeed;return M+this.lastChar.toString("utf16le",0,re)}return M}function T(L,M){var re=(L.length-M)%3;return re===0?L.toString("base64",M):(this.lastNeed=3-re,this.lastTotal=3,re===1?this.lastChar[0]=L[L.length-1]:(this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1]),L.toString("base64",M,L.length-re))}function S(L){var M=L&&L.length?this.write(L):"";return this.lastNeed?M+this.lastChar.toString("base64",0,3-this.lastNeed):M}function x(L){return L.toString(this.encoding)}function O(L){return L&&L.length?this.write(L):""}},{"safe-buffer":27}],29:[function(i,o,a){(function(u){(function(){var c=i("base64-js"),f=i("ieee754");a.Buffer=g,a.SlowBuffer=O,a.INSPECT_MAX_BYTES=50;var d=2147483647;a.kMaxLength=d,g.TYPED_ARRAY_SUPPORT=h(),!g.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{var Y=new Uint8Array(1);return Y.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Y.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function v(Y){if(Y>d)throw new RangeError('The value "'+Y+'" is invalid for option "size"');var k=new Uint8Array(Y);return k.__proto__=g.prototype,k}function g(Y,k,D){if(typeof Y=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(Y)}return p(Y,k,D)}typeof Symbol<"u"&&Symbol.species!=null&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192;function p(Y,k,D){if(typeof Y=="string")return A(Y,k);if(ArrayBuffer.isView(Y))return w(Y);if(Y==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(ie(Y,ArrayBuffer)||Y&&ie(Y.buffer,ArrayBuffer))return T(Y,k,D);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var oe=Y.valueOf&&Y.valueOf();if(oe!=null&&oe!==Y)return g.from(oe,k,D);var xe=S(Y);if(xe)return xe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return g.from(Y[Symbol.toPrimitive]("string"),k,D);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}g.from=function(Y,k,D){return p(Y,k,D)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array;function y(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function _(Y,k,D){return y(Y),Y<=0?v(Y):k!==void 0?typeof D=="string"?v(Y).fill(k,D):v(Y).fill(k):v(Y)}g.alloc=function(Y,k,D){return _(Y,k,D)};function b(Y){return y(Y),v(Y<0?0:x(Y)|0)}g.allocUnsafe=function(Y){return b(Y)},g.allocUnsafeSlow=function(Y){return b(Y)};function A(Y,k){if((typeof k!="string"||k==="")&&(k="utf8"),!g.isEncoding(k))throw new TypeError("Unknown encoding: "+k);var D=L(Y,k)|0,oe=v(D),xe=oe.write(Y,k);return xe!==D&&(oe=oe.slice(0,xe)),oe}function w(Y){for(var k=Y.length<0?0:x(Y.length)|0,D=v(k),oe=0;oe<k;oe+=1)D[oe]=Y[oe]&255;return D}function T(Y,k,D){if(k<0||Y.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(Y.byteLength<k+(D||0))throw new RangeError('"length" is outside of buffer bounds');var oe;return k===void 0&&D===void 0?oe=new Uint8Array(Y):D===void 0?oe=new Uint8Array(Y,k):oe=new Uint8Array(Y,k,D),oe.__proto__=g.prototype,oe}function S(Y){if(g.isBuffer(Y)){var k=x(Y.length)|0,D=v(k);return D.length===0||Y.copy(D,0,0,k),D}if(Y.length!==void 0)return typeof Y.length!="number"||ae(Y.length)?v(0):w(Y);if(Y.type==="Buffer"&&Array.isArray(Y.data))return w(Y.data)}function x(Y){if(Y>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return Y|0}function O(Y){return+Y!=Y&&(Y=0),g.alloc(+Y)}g.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==g.prototype},g.compare=function(k,D){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),ie(D,Uint8Array)&&(D=g.from(D,D.offset,D.byteLength)),!g.isBuffer(k)||!g.isBuffer(D))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===D)return 0;for(var oe=k.length,xe=D.length,ze=0,hn=Math.min(oe,xe);ze<hn;++ze)if(k[ze]!==D[ze]){oe=k[ze],xe=D[ze];break}return oe<xe?-1:xe<oe?1:0},g.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(k,D){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return g.alloc(0);var oe;if(D===void 0)for(D=0,oe=0;oe<k.length;++oe)D+=k[oe].length;var xe=g.allocUnsafe(D),ze=0;for(oe=0;oe<k.length;++oe){var hn=k[oe];if(ie(hn,Uint8Array)&&(hn=g.from(hn)),!g.isBuffer(hn))throw new TypeError('"list" argument must be an Array of Buffers');hn.copy(xe,ze),ze+=hn.length}return xe};function L(Y,k){if(g.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||ie(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);var D=Y.length,oe=arguments.length>2&&arguments[2]===!0;if(!oe&&D===0)return 0;for(var xe=!1;;)switch(k){case"ascii":case"latin1":case"binary":return D;case"utf8":case"utf-8":return Ne(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D*2;case"hex":return D>>>1;case"base64":return jt(Y).length;default:if(xe)return oe?-1:Ne(Y).length;k=(""+k).toLowerCase(),xe=!0}}g.byteLength=L;function M(Y,k,D){var oe=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((D===void 0||D>this.length)&&(D=this.length),D<=0)||(D>>>=0,k>>>=0,D<=k))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return vn(this,k,D);case"utf8":case"utf-8":return pe(this,k,D);case"ascii":return Et(this,k,D);case"latin1":case"binary":return Cn(this,k,D);case"base64":return Fe(this,k,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,k,D);default:if(oe)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),oe=!0}}g.prototype._isBuffer=!0;function re(Y,k,D){var oe=Y[k];Y[k]=Y[D],Y[D]=oe}g.prototype.swap16=function(){var k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var D=0;D<k;D+=2)re(this,D,D+1);return this},g.prototype.swap32=function(){var k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var D=0;D<k;D+=4)re(this,D,D+3),re(this,D+1,D+2);return this},g.prototype.swap64=function(){var k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var D=0;D<k;D+=8)re(this,D,D+7),re(this,D+1,D+6),re(this,D+2,D+5),re(this,D+3,D+4);return this},g.prototype.toString=function(){var k=this.length;return k===0?"":arguments.length===0?pe(this,0,k):M.apply(this,arguments)},g.prototype.toLocaleString=g.prototype.toString,g.prototype.equals=function(k){if(!g.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:g.compare(this,k)===0},g.prototype.inspect=function(){var k="",D=a.INSPECT_MAX_BYTES;return k=this.toString("hex",0,D).replace(/(.{2})/g,"$1 ").trim(),this.length>D&&(k+=" ... "),"<Buffer "+k+">"},g.prototype.compare=function(k,D,oe,xe,ze){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),!g.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(D===void 0&&(D=0),oe===void 0&&(oe=k?k.length:0),xe===void 0&&(xe=0),ze===void 0&&(ze=this.length),D<0||oe>k.length||xe<0||ze>this.length)throw new RangeError("out of range index");if(xe>=ze&&D>=oe)return 0;if(xe>=ze)return-1;if(D>=oe)return 1;if(D>>>=0,oe>>>=0,xe>>>=0,ze>>>=0,this===k)return 0;for(var hn=ze-xe,An=oe-D,Tn=Math.min(hn,An),Rn=this.slice(xe,ze),Ve=k.slice(D,oe),Ue=0;Ue<Tn;++Ue)if(Rn[Ue]!==Ve[Ue]){hn=Rn[Ue],An=Ve[Ue];break}return hn<An?-1:An<hn?1:0};function F(Y,k,D,oe,xe){if(Y.length===0)return-1;if(typeof D=="string"?(oe=D,D=0):D>2147483647?D=2147483647:D<-2147483648&&(D=-2147483648),D=+D,ae(D)&&(D=xe?0:Y.length-1),D<0&&(D=Y.length+D),D>=Y.length){if(xe)return-1;D=Y.length-1}else if(D<0)if(xe)D=0;else return-1;if(typeof k=="string"&&(k=g.from(k,oe)),g.isBuffer(k))return k.length===0?-1:j(Y,k,D,oe,xe);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?xe?Uint8Array.prototype.indexOf.call(Y,k,D):Uint8Array.prototype.lastIndexOf.call(Y,k,D):j(Y,[k],D,oe,xe);throw new TypeError("val must be string, number or Buffer")}function j(Y,k,D,oe,xe){var ze=1,hn=Y.length,An=k.length;if(oe!==void 0&&(oe=String(oe).toLowerCase(),oe==="ucs2"||oe==="ucs-2"||oe==="utf16le"||oe==="utf-16le")){if(Y.length<2||k.length<2)return-1;ze=2,hn/=2,An/=2,D/=2}function Tn(Sn,xn){return ze===1?Sn[xn]:Sn.readUInt16BE(xn*ze)}var Rn;if(xe){var Ve=-1;for(Rn=D;Rn<hn;Rn++)if(Tn(Y,Rn)===Tn(k,Ve===-1?0:Rn-Ve)){if(Ve===-1&&(Ve=Rn),Rn-Ve+1===An)return Ve*ze}else Ve!==-1&&(Rn-=Rn-Ve),Ve=-1}else for(D+An>hn&&(D=hn-An),Rn=D;Rn>=0;Rn--){for(var Ue=!0,En=0;En<An;En++)if(Tn(Y,Rn+En)!==Tn(k,En)){Ue=!1;break}if(Ue)return Rn}return-1}g.prototype.includes=function(k,D,oe){return this.indexOf(k,D,oe)!==-1},g.prototype.indexOf=function(k,D,oe){return F(this,k,D,oe,!0)},g.prototype.lastIndexOf=function(k,D,oe){return F(this,k,D,oe,!1)};function V(Y,k,D,oe){D=Number(D)||0;var xe=Y.length-D;oe?(oe=Number(oe),oe>xe&&(oe=xe)):oe=xe;var ze=k.length;oe>ze/2&&(oe=ze/2);for(var hn=0;hn<oe;++hn){var An=parseInt(k.substr(hn*2,2),16);if(ae(An))return hn;Y[D+hn]=An}return hn}function z(Y,k,D,oe){return _n(Ne(k,Y.length-D),Y,D,oe)}function $(Y,k,D,oe){return _n(Oe(k),Y,D,oe)}function he(Y,k,D,oe){return $(Y,k,D,oe)}function le(Y,k,D,oe){return _n(jt(k),Y,D,oe)}function Ie(Y,k,D,oe){return _n(kt(k,Y.length-D),Y,D,oe)}g.prototype.write=function(k,D,oe,xe){if(D===void 0)xe="utf8",oe=this.length,D=0;else if(oe===void 0&&typeof D=="string")xe=D,oe=this.length,D=0;else if(isFinite(D))D=D>>>0,isFinite(oe)?(oe=oe>>>0,xe===void 0&&(xe="utf8")):(xe=oe,oe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ze=this.length-D;if((oe===void 0||oe>ze)&&(oe=ze),k.length>0&&(oe<0||D<0)||D>this.length)throw new RangeError("Attempt to write outside buffer bounds");xe||(xe="utf8");for(var hn=!1;;)switch(xe){case"hex":return V(this,k,D,oe);case"utf8":case"utf-8":return z(this,k,D,oe);case"ascii":return $(this,k,D,oe);case"latin1":case"binary":return he(this,k,D,oe);case"base64":return le(this,k,D,oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,k,D,oe);default:if(hn)throw new TypeError("Unknown encoding: "+xe);xe=(""+xe).toLowerCase(),hn=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fe(Y,k,D){return k===0&&D===Y.length?c.fromByteArray(Y):c.fromByteArray(Y.slice(k,D))}function pe(Y,k,D){D=Math.min(Y.length,D);for(var oe=[],xe=k;xe<D;){var ze=Y[xe],hn=null,An=ze>239?4:ze>223?3:ze>191?2:1;if(xe+An<=D){var Tn,Rn,Ve,Ue;switch(An){case 1:ze<128&&(hn=ze);break;case 2:Tn=Y[xe+1],(Tn&192)===128&&(Ue=(ze&31)<<6|Tn&63,Ue>127&&(hn=Ue));break;case 3:Tn=Y[xe+1],Rn=Y[xe+2],(Tn&192)===128&&(Rn&192)===128&&(Ue=(ze&15)<<12|(Tn&63)<<6|Rn&63,Ue>2047&&(Ue<55296||Ue>57343)&&(hn=Ue));break;case 4:Tn=Y[xe+1],Rn=Y[xe+2],Ve=Y[xe+3],(Tn&192)===128&&(Rn&192)===128&&(Ve&192)===128&&(Ue=(ze&15)<<18|(Tn&63)<<12|(Rn&63)<<6|Ve&63,Ue>65535&&Ue<1114112&&(hn=Ue))}}hn===null?(hn=65533,An=1):hn>65535&&(hn-=65536,oe.push(hn>>>10&1023|55296),hn=56320|hn&1023),oe.push(hn),xe+=An}return _e(oe)}var Lt=4096;function _e(Y){var k=Y.length;if(k<=Lt)return String.fromCharCode.apply(String,Y);for(var D="",oe=0;oe<k;)D+=String.fromCharCode.apply(String,Y.slice(oe,oe+=Lt));return D}function Et(Y,k,D){var oe="";D=Math.min(Y.length,D);for(var xe=k;xe<D;++xe)oe+=String.fromCharCode(Y[xe]&127);return oe}function Cn(Y,k,D){var oe="";D=Math.min(Y.length,D);for(var xe=k;xe<D;++xe)oe+=String.fromCharCode(Y[xe]);return oe}function vn(Y,k,D){var oe=Y.length;(!k||k<0)&&(k=0),(!D||D<0||D>oe)&&(D=oe);for(var xe="",ze=k;ze<D;++ze)xe+=At(Y[ze]);return xe}function Dt(Y,k,D){for(var oe=Y.slice(k,D),xe="",ze=0;ze<oe.length;ze+=2)xe+=String.fromCharCode(oe[ze]+oe[ze+1]*256);return xe}g.prototype.slice=function(k,D){var oe=this.length;k=~~k,D=D===void 0?oe:~~D,k<0?(k+=oe,k<0&&(k=0)):k>oe&&(k=oe),D<0?(D+=oe,D<0&&(D=0)):D>oe&&(D=oe),D<k&&(D=k);var xe=this.subarray(k,D);return xe.__proto__=g.prototype,xe};function de(Y,k,D){if(Y%1!==0||Y<0)throw new RangeError("offset is not uint");if(Y+k>D)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUIntLE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k],ze=1,hn=0;++hn<D&&(ze*=256);)xe+=this[k+hn]*ze;return xe},g.prototype.readUIntBE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k+--D],ze=1;D>0&&(ze*=256);)xe+=this[k+--D]*ze;return xe},g.prototype.readUInt8=function(k,D){return k=k>>>0,D||de(k,1,this.length),this[k]},g.prototype.readUInt16LE=function(k,D){return k=k>>>0,D||de(k,2,this.length),this[k]|this[k+1]<<8},g.prototype.readUInt16BE=function(k,D){return k=k>>>0,D||de(k,2,this.length),this[k]<<8|this[k+1]},g.prototype.readUInt32LE=function(k,D){return k=k>>>0,D||de(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},g.prototype.readUInt32BE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},g.prototype.readIntLE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k],ze=1,hn=0;++hn<D&&(ze*=256);)xe+=this[k+hn]*ze;return ze*=128,xe>=ze&&(xe-=Math.pow(2,8*D)),xe},g.prototype.readIntBE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=D,ze=1,hn=this[k+--xe];xe>0&&(ze*=256);)hn+=this[k+--xe]*ze;return ze*=128,hn>=ze&&(hn-=Math.pow(2,8*D)),hn},g.prototype.readInt8=function(k,D){return k=k>>>0,D||de(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},g.prototype.readInt16LE=function(k,D){k=k>>>0,D||de(k,2,this.length);var oe=this[k]|this[k+1]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt16BE=function(k,D){k=k>>>0,D||de(k,2,this.length);var oe=this[k+1]|this[k]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt32LE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},g.prototype.readInt32BE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},g.prototype.readFloatLE=function(k,D){return k=k>>>0,D||de(k,4,this.length),f.read(this,k,!0,23,4)},g.prototype.readFloatBE=function(k,D){return k=k>>>0,D||de(k,4,this.length),f.read(this,k,!1,23,4)},g.prototype.readDoubleLE=function(k,D){return k=k>>>0,D||de(k,8,this.length),f.read(this,k,!0,52,8)},g.prototype.readDoubleBE=function(k,D){return k=k>>>0,D||de(k,8,this.length),f.read(this,k,!1,52,8)};function qe(Y,k,D,oe,xe,ze){if(!g.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>xe||k<ze)throw new RangeError('"value" argument is out of bounds');if(D+oe>Y.length)throw new RangeError("Index out of range")}g.prototype.writeUIntLE=function(k,D,oe,xe){if(k=+k,D=D>>>0,oe=oe>>>0,!xe){var ze=Math.pow(2,8*oe)-1;qe(this,k,D,oe,ze,0)}var hn=1,An=0;for(this[D]=k&255;++An<oe&&(hn*=256);)this[D+An]=k/hn&255;return D+oe},g.prototype.writeUIntBE=function(k,D,oe,xe){if(k=+k,D=D>>>0,oe=oe>>>0,!xe){var ze=Math.pow(2,8*oe)-1;qe(this,k,D,oe,ze,0)}var hn=oe-1,An=1;for(this[D+hn]=k&255;--hn>=0&&(An*=256);)this[D+hn]=k/An&255;return D+oe},g.prototype.writeUInt8=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,1,255,0),this[D]=k&255,D+1},g.prototype.writeUInt16LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,65535,0),this[D]=k&255,this[D+1]=k>>>8,D+2},g.prototype.writeUInt16BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,65535,0),this[D]=k>>>8,this[D+1]=k&255,D+2},g.prototype.writeUInt32LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,4294967295,0),this[D+3]=k>>>24,this[D+2]=k>>>16,this[D+1]=k>>>8,this[D]=k&255,D+4},g.prototype.writeUInt32BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,4294967295,0),this[D]=k>>>24,this[D+1]=k>>>16,this[D+2]=k>>>8,this[D+3]=k&255,D+4},g.prototype.writeIntLE=function(k,D,oe,xe){if(k=+k,D=D>>>0,!xe){var ze=Math.pow(2,8*oe-1);qe(this,k,D,oe,ze-1,-ze)}var hn=0,An=1,Tn=0;for(this[D]=k&255;++hn<oe&&(An*=256);)k<0&&Tn===0&&this[D+hn-1]!==0&&(Tn=1),this[D+hn]=(k/An>>0)-Tn&255;return D+oe},g.prototype.writeIntBE=function(k,D,oe,xe){if(k=+k,D=D>>>0,!xe){var ze=Math.pow(2,8*oe-1);qe(this,k,D,oe,ze-1,-ze)}var hn=oe-1,An=1,Tn=0;for(this[D+hn]=k&255;--hn>=0&&(An*=256);)k<0&&Tn===0&&this[D+hn+1]!==0&&(Tn=1),this[D+hn]=(k/An>>0)-Tn&255;return D+oe},g.prototype.writeInt8=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,1,127,-128),k<0&&(k=255+k+1),this[D]=k&255,D+1},g.prototype.writeInt16LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,32767,-32768),this[D]=k&255,this[D+1]=k>>>8,D+2},g.prototype.writeInt16BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,32767,-32768),this[D]=k>>>8,this[D+1]=k&255,D+2},g.prototype.writeInt32LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,2147483647,-2147483648),this[D]=k&255,this[D+1]=k>>>8,this[D+2]=k>>>16,this[D+3]=k>>>24,D+4},g.prototype.writeInt32BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[D]=k>>>24,this[D+1]=k>>>16,this[D+2]=k>>>8,this[D+3]=k&255,D+4};function Pt(Y,k,D,oe,xe,ze){if(D+oe>Y.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("Index out of range")}function In(Y,k,D,oe,xe){return k=+k,D=D>>>0,xe||Pt(Y,k,D,4),f.write(Y,k,D,oe,23,4),D+4}g.prototype.writeFloatLE=function(k,D,oe){return In(this,k,D,!0,oe)},g.prototype.writeFloatBE=function(k,D,oe){return In(this,k,D,!1,oe)};function $e(Y,k,D,oe,xe){return k=+k,D=D>>>0,xe||Pt(Y,k,D,8),f.write(Y,k,D,oe,52,8),D+8}g.prototype.writeDoubleLE=function(k,D,oe){return $e(this,k,D,!0,oe)},g.prototype.writeDoubleBE=function(k,D,oe){return $e(this,k,D,!1,oe)},g.prototype.copy=function(k,D,oe,xe){if(!g.isBuffer(k))throw new TypeError("argument should be a Buffer");if(oe||(oe=0),!xe&&xe!==0&&(xe=this.length),D>=k.length&&(D=k.length),D||(D=0),xe>0&&xe<oe&&(xe=oe),xe===oe||k.length===0||this.length===0)return 0;if(D<0)throw new RangeError("targetStart out of bounds");if(oe<0||oe>=this.length)throw new RangeError("Index out of range");if(xe<0)throw new RangeError("sourceEnd out of bounds");xe>this.length&&(xe=this.length),k.length-D<xe-oe&&(xe=k.length-D+oe);var ze=xe-oe;if(this===k&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(D,oe,xe);else if(this===k&&oe<D&&D<xe)for(var hn=ze-1;hn>=0;--hn)k[hn+D]=this[hn+oe];else Uint8Array.prototype.set.call(k,this.subarray(oe,xe),D);return ze},g.prototype.fill=function(k,D,oe,xe){if(typeof k=="string"){if(typeof D=="string"?(xe=D,D=0,oe=this.length):typeof oe=="string"&&(xe=oe,oe=this.length),xe!==void 0&&typeof xe!="string")throw new TypeError("encoding must be a string");if(typeof xe=="string"&&!g.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);if(k.length===1){var ze=k.charCodeAt(0);(xe==="utf8"&&ze<128||xe==="latin1")&&(k=ze)}}else typeof k=="number"&&(k=k&255);if(D<0||this.length<D||this.length<oe)throw new RangeError("Out of range index");if(oe<=D)return this;D=D>>>0,oe=oe===void 0?this.length:oe>>>0,k||(k=0);var hn;if(typeof k=="number")for(hn=D;hn<oe;++hn)this[hn]=k;else{var An=g.isBuffer(k)?k:g.from(k,xe),Tn=An.length;if(Tn===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(hn=0;hn<oe-D;++hn)this[hn+D]=An[hn%Tn]}return this};var Ce=/[^+/0-9A-Za-z-_]/g;function ue(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ce,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function At(Y){return Y<16?"0"+Y.toString(16):Y.toString(16)}function Ne(Y,k){k=k||1/0;for(var D,oe=Y.length,xe=null,ze=[],hn=0;hn<oe;++hn){if(D=Y.charCodeAt(hn),D>55295&&D<57344){if(!xe){if(D>56319){(k-=3)>-1&&ze.push(239,191,189);continue}else if(hn+1===oe){(k-=3)>-1&&ze.push(239,191,189);continue}xe=D;continue}if(D<56320){(k-=3)>-1&&ze.push(239,191,189),xe=D;continue}D=(xe-55296<<10|D-56320)+65536}else xe&&(k-=3)>-1&&ze.push(239,191,189);if(xe=null,D<128){if((k-=1)<0)break;ze.push(D)}else if(D<2048){if((k-=2)<0)break;ze.push(D>>6|192,D&63|128)}else if(D<65536){if((k-=3)<0)break;ze.push(D>>12|224,D>>6&63|128,D&63|128)}else if(D<1114112){if((k-=4)<0)break;ze.push(D>>18|240,D>>12&63|128,D>>6&63|128,D&63|128)}else throw new Error("Invalid code point")}return ze}function Oe(Y){for(var k=[],D=0;D<Y.length;++D)k.push(Y.charCodeAt(D)&255);return k}function kt(Y,k){for(var D,oe,xe,ze=[],hn=0;hn<Y.length&&!((k-=2)<0);++hn)D=Y.charCodeAt(hn),oe=D>>8,xe=D%256,ze.push(xe),ze.push(oe);return ze}function jt(Y){return c.toByteArray(ue(Y))}function _n(Y,k,D,oe){for(var xe=0;xe<oe&&!(xe+D>=k.length||xe>=Y.length);++xe)k[xe+D]=Y[xe];return xe}function ie(Y,k){return Y instanceof k||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===k.name}function ae(Y){return Y!==Y}}).call(this)}).call(this,i("buffer").Buffer)},{"base64-js":25,buffer:29,ieee754:50}],30:[function(i,o,a){(function(u){(function(){a.formatArgs=f,a.save=d,a.load=h,a.useColors=c,a.storage=v(),a.destroy=(()=>{let p=!1;return()=>{p||(p=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function c(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),!this.useColors)return;const y="color: "+this.color;p.splice(1,0,y,"color: inherit");let _=0,b=0;p[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(_++,A==="%c"&&(b=_))}),p.splice(b,0,y)}a.log=console.debug||console.log||(()=>{});function d(p){try{p?a.storage.setItem("debug",p):a.storage.removeItem("debug")}catch{}}function h(){let p;try{p=a.storage.getItem("debug")}catch{}return!p&&typeof u<"u"&&"env"in u&&(p=u.env.DEBUG),p}function v(){try{return localStorage}catch{}}o.exports=i("./common")(a);const{formatters:g}=o.exports;g.j=function(p){try{return JSON.stringify(p)}catch(y){return"[UnexpectedJSONParseError]: "+y.message}}}).call(this)}).call(this,i("_process"))},{"./common":31,_process:102}],31:[function(i,o,a){function u(c){d.debug=d,d.default=d,d.coerce=_,d.disable=g,d.enable=v,d.enabled=p,d.humanize=i("ms"),d.destroy=b,Object.keys(c).forEach(A=>{d[A]=c[A]}),d.names=[],d.skips=[],d.formatters={};function f(A){let w=0;for(let T=0;T<A.length;T++)w=(w<<5)-w+A.charCodeAt(T),w|=0;return d.colors[Math.abs(w)%d.colors.length]}d.selectColor=f;function d(A){let w,T=null,S,x;function O(...L){if(!O.enabled)return;const M=O,re=Number(new Date),F=re-(w||re);M.diff=F,M.prev=w,M.curr=re,w=re,L[0]=d.coerce(L[0]),typeof L[0]!="string"&&L.unshift("%O");let j=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(z,$)=>{if(z==="%%")return"%";j++;const he=d.formatters[$];if(typeof he=="function"){const le=L[j];z=he.call(M,le),L.splice(j,1),j--}return z}),d.formatArgs.call(M,L),(M.log||d.log).apply(M,L)}return O.namespace=A,O.useColors=d.useColors(),O.color=d.selectColor(A),O.extend=h,O.destroy=d.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>T!==null?T:(S!==d.namespaces&&(S=d.namespaces,x=d.enabled(A)),x),set:L=>{T=L}}),typeof d.init=="function"&&d.init(O),O}function h(A,w){const T=d(this.namespace+(typeof w>"u"?":":w)+A);return T.log=this.log,T}function v(A){d.save(A),d.namespaces=A,d.names=[],d.skips=[];let w;const T=(typeof A=="string"?A:"").split(/[\s,]+/),S=T.length;for(w=0;w<S;w++)T[w]&&(A=T[w].replace(/\*/g,".*?"),A[0]==="-"?d.skips.push(new RegExp("^"+A.slice(1)+"$")):d.names.push(new RegExp("^"+A+"$")))}function g(){const A=[...d.names.map(y),...d.skips.map(y).map(w=>"-"+w)].join(",");return d.enable(""),A}function p(A){if(A[A.length-1]==="*")return!0;let w,T;for(w=0,T=d.skips.length;w<T;w++)if(d.skips[w].test(A))return!1;for(w=0,T=d.names.length;w<T;w++)if(d.names[w].test(A))return!0;return!1}function y(A){return A.toString().substring(2,A.toString().length-2).replace(/\.\*\?$/,"*")}function _(A){return A instanceof Error?A.stack||A.message:A}function b(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}o.exports=u},{ms:97}],32:[function(i,o,a){(function(u,c){(function(){var f=i("readable-stream"),d=i("end-of-stream"),h=i("inherits"),v=i("stream-shift"),g=c.from&&c.from!==Uint8Array.from?c.from([0]):new c([0]),p=function(S,x){S._corked?S.once("uncork",x):x()},y=function(S,x){S._autoDestroy&&S.destroy(x)},_=function(S,x){return function(O){O?y(S,O.message==="premature close"?null:O):x&&!S._ended&&S.end()}},b=function(S,x){if(!S||S._writableState&&S._writableState.finished)return x();if(S._writableState)return S.end(x);S.end(),x()},A=function(){},w=function(S){return new f.Readable({objectMode:!0,highWaterMark:16}).wrap(S)},T=function(S,x,O){if(!(this instanceof T))return new T(S,x,O);f.Duplex.call(this,O),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!O||O.autoDestroy!==!1,this._forwardDestroy=!O||O.destroy!==!1,this._forwardEnd=!O||O.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,S&&this.setWritable(S),x&&this.setReadable(x)};h(T,f.Duplex),T.obj=function(S,x,O){return O||(O={}),O.objectMode=!0,O.highWaterMark=16,new T(S,x,O)},T.prototype.cork=function(){++this._corked===1&&this.emit("cork")},T.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},T.prototype.setWritable=function(S){if(this._unwrite&&this._unwrite(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.end();return}var x=this,O=d(S,{writable:!0,readable:!1},_(this,this._forwardEnd)),L=function(){var re=x._ondrain;x._ondrain=null,re&&re()},M=function(){x._writable.removeListener("drain",L),O()};this._unwrite&&u.nextTick(L),this._writable=S,this._writable.on("drain",L),this._unwrite=M,this.uncork()},T.prototype.setReadable=function(S){if(this._unread&&this._unread(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.push(null),this.resume();return}var x=this,O=d(S,{writable:!1,readable:!0},_(this)),L=function(){x._forward()},M=function(){x.push(null)},re=function(){x._readable2.removeListener("readable",L),x._readable2.removeListener("end",M),O()};this._drained=!0,this._readable=S,this._readable2=S._readableState?S:w(S),this._readable2.on("readable",L),this._readable2.on("end",M),this._unread=re,this._forward()},T.prototype._read=function(){this._drained=!0,this._forward()},T.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var S;this._drained&&(S=v(this._readable2))!==null;)this.destroyed||(this._drained=this.push(S));this._forwarding=!1}},T.prototype.destroy=function(S,x){if(x||(x=A),this.destroyed)return x(null);this.destroyed=!0;var O=this;u.nextTick(function(){O._destroy(S),x(null)})},T.prototype._destroy=function(S){if(S){var x=this._ondrain;this._ondrain=null,x?x(S):this.emit("error",S)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},T.prototype._write=function(S,x,O){if(!this.destroyed){if(this._corked)return p(this,this._write.bind(this,S,x,O));if(S===g)return this._finish(O);if(!this._writable)return O();this._writable.write(S)===!1?this._ondrain=O:this.destroyed||O()}},T.prototype._finish=function(S){var x=this;this.emit("preend"),p(this,function(){b(x._forwardEnd&&x._writable,function(){x._writableState.prefinished===!1&&(x._writableState.prefinished=!0),x.emit("prefinish"),p(x,S)})})},T.prototype.end=function(S,x,O){return typeof S=="function"?this.end(null,null,S):typeof x=="function"?this.end(S,null,x):(this._ended=!0,S&&this.write(S),!this._writableState.ending&&!this._writableState.destroyed&&this.write(g),f.Writable.prototype.end.call(this,O))},o.exports=T}).call(this)}).call(this,i("_process"),i("buffer").Buffer)},{_process:102,buffer:29,"end-of-stream":48,inherits:51,"readable-stream":47,"stream-shift":135}],33:[function(i,o,a){function u(p,y){p.prototype=Object.create(y.prototype),p.prototype.constructor=p,p.__proto__=y}var c={};function f(p,y,_){_||(_=Error);function b(w,T,S){return typeof y=="string"?y:y(w,T,S)}var A=function(w){u(T,w);function T(S,x,O){return w.call(this,b(S,x,O))||this}return T}(_);A.prototype.name=_.name,A.prototype.code=p,c[p]=A}function d(p,y){if(Array.isArray(p)){var _=p.length;return p=p.map(function(b){return String(b)}),_>2?"one of ".concat(y," ").concat(p.slice(0,_-1).join(", "),", or ")+p[_-1]:_===2?"one of ".concat(y," ").concat(p[0]," or ").concat(p[1]):"of ".concat(y," ").concat(p[0])}else return"of ".concat(y," ").concat(String(p))}function h(p,y,_){return p.substr(!_||_<0?0:+_,y.length)===y}function v(p,y,_){return(_===void 0||_>p.length)&&(_=p.length),p.substring(_-y.length,_)===y}function g(p,y,_){return typeof _!="number"&&(_=0),_+y.length>p.length?!1:p.indexOf(y,_)!==-1}f("ERR_INVALID_OPT_VALUE",function(p,y){return'The value "'+y+'" is invalid for option "'+p+'"'},TypeError),f("ERR_INVALID_ARG_TYPE",function(p,y,_){var b;typeof y=="string"&&h(y,"not ")?(b="must not be",y=y.replace(/^not /,"")):b="must be";var A;if(v(p," argument"))A="The ".concat(p," ").concat(b," ").concat(d(y,"type"));else{var w=g(p,".")?"property":"argument";A='The "'.concat(p,'" ').concat(w," ").concat(b," ").concat(d(y,"type"))}return A+=". Received type ".concat(typeof _),A},TypeError),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),f("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),f("ERR_STREAM_PREMATURE_CLOSE","Premature close"),f("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),f("ERR_STREAM_WRITE_AFTER_END","write after end"),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=c},{}],34:[function(i,o,a){(function(u){(function(){var c=Object.keys||function(b){var A=[];for(var w in b)A.push(w);return A};o.exports=p;var f=i("./_stream_readable"),d=i("./_stream_writable");i("inherits")(p,f);for(var h=c(d.prototype),v=0;v<h.length;v++){var g=h[v];p.prototype[g]||(p.prototype[g]=d.prototype[g])}function p(b){if(!(this instanceof p))return new p(b);f.call(this,b),d.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",y)))}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function y(){this._writableState.ended||u.nextTick(_,this)}function _(b){b.end()}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(A){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=A,this._writableState.destroyed=A)}})}).call(this)}).call(this,i("_process"))},{"./_stream_readable":36,"./_stream_writable":38,_process:102,inherits:51}],35:[function(i,o,a){o.exports=c;var u=i("./_stream_transform");i("inherits")(c,u);function c(f){if(!(this instanceof c))return new c(f);u.call(this,f)}c.prototype._transform=function(f,d,h){h(null,f)}},{"./_stream_transform":37,inherits:51}],36:[function(i,o,a){(function(u,c){(function(){o.exports=Ie;var f;Ie.ReadableState=le,i("events").EventEmitter;var d=function(ae,Y){return ae.listeners(Y).length},h=i("./internal/streams/stream"),v=i("buffer").Buffer,g=c.Uint8Array||function(){};function p(ie){return v.from(ie)}function y(ie){return v.isBuffer(ie)||ie instanceof g}var _=i("util"),b;_&&_.debuglog?b=_.debuglog("stream"):b=function(){};var A=i("./internal/streams/buffer_list"),w=i("./internal/streams/destroy"),T=i("./internal/streams/state"),S=T.getHighWaterMark,x=i("../errors").codes,O=x.ERR_INVALID_ARG_TYPE,L=x.ERR_STREAM_PUSH_AFTER_EOF,M=x.ERR_METHOD_NOT_IMPLEMENTED,re=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,F,j,V;i("inherits")(Ie,h);var z=w.errorOrDestroy,$=["error","close","destroy","pause","resume"];function he(ie,ae,Y){if(typeof ie.prependListener=="function")return ie.prependListener(ae,Y);!ie._events||!ie._events[ae]?ie.on(ae,Y):Array.isArray(ie._events[ae])?ie._events[ae].unshift(Y):ie._events[ae]=[Y,ie._events[ae]]}function le(ie,ae,Y){f=f||i("./_stream_duplex"),ie=ie||{},typeof Y!="boolean"&&(Y=ae instanceof f),this.objectMode=!!ie.objectMode,Y&&(this.objectMode=this.objectMode||!!ie.readableObjectMode),this.highWaterMark=S(this,ie,"readableHighWaterMark",Y),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ie.emitClose!==!1,this.autoDestroy=!!ie.autoDestroy,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(F||(F=i("string_decoder/").StringDecoder),this.decoder=new F(ie.encoding),this.encoding=ie.encoding)}function Ie(ie){if(f=f||i("./_stream_duplex"),!(this instanceof Ie))return new Ie(ie);var ae=this instanceof f;this._readableState=new le(ie,this,ae),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),h.call(this)}Object.defineProperty(Ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ae){this._readableState&&(this._readableState.destroyed=ae)}}),Ie.prototype.destroy=w.destroy,Ie.prototype._undestroy=w.undestroy,Ie.prototype._destroy=function(ie,ae){ae(ie)},Ie.prototype.push=function(ie,ae){var Y=this._readableState,k;return Y.objectMode?k=!0:typeof ie=="string"&&(ae=ae||Y.defaultEncoding,ae!==Y.encoding&&(ie=v.from(ie,ae),ae=""),k=!0),Fe(this,ie,ae,!1,k)},Ie.prototype.unshift=function(ie){return Fe(this,ie,null,!0,!1)};function Fe(ie,ae,Y,k,D){b("readableAddChunk",ae);var oe=ie._readableState;if(ae===null)oe.reading=!1,vn(ie,oe);else{var xe;if(D||(xe=Lt(oe,ae)),xe)z(ie,xe);else if(oe.objectMode||ae&&ae.length>0)if(typeof ae!="string"&&!oe.objectMode&&Object.getPrototypeOf(ae)!==v.prototype&&(ae=p(ae)),k)oe.endEmitted?z(ie,new re):pe(ie,oe,ae,!0);else if(oe.ended)z(ie,new L);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!Y?(ae=oe.decoder.write(ae),oe.objectMode||ae.length!==0?pe(ie,oe,ae,!1):qe(ie,oe)):pe(ie,oe,ae,!1)}else k||(oe.reading=!1,qe(ie,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function pe(ie,ae,Y,k){ae.flowing&&ae.length===0&&!ae.sync?(ae.awaitDrain=0,ie.emit("data",Y)):(ae.length+=ae.objectMode?1:Y.length,k?ae.buffer.unshift(Y):ae.buffer.push(Y),ae.needReadable&&Dt(ie)),qe(ie,ae)}function Lt(ie,ae){var Y;return!y(ae)&&typeof ae!="string"&&ae!==void 0&&!ie.objectMode&&(Y=new O("chunk",["string","Buffer","Uint8Array"],ae)),Y}Ie.prototype.isPaused=function(){return this._readableState.flowing===!1},Ie.prototype.setEncoding=function(ie){F||(F=i("string_decoder/").StringDecoder);var ae=new F(ie);this._readableState.decoder=ae,this._readableState.encoding=this._readableState.decoder.encoding;for(var Y=this._readableState.buffer.head,k="";Y!==null;)k+=ae.write(Y.data),Y=Y.next;return this._readableState.buffer.clear(),k!==""&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var _e=1073741824;function Et(ie){return ie>=_e?ie=_e:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function Cn(ie,ae){return ie<=0||ae.length===0&&ae.ended?0:ae.objectMode?1:ie!==ie?ae.flowing&&ae.length?ae.buffer.head.data.length:ae.length:(ie>ae.highWaterMark&&(ae.highWaterMark=Et(ie)),ie<=ae.length?ie:ae.ended?ae.length:(ae.needReadable=!0,0))}Ie.prototype.read=function(ie){b("read",ie),ie=parseInt(ie,10);var ae=this._readableState,Y=ie;if(ie!==0&&(ae.emittedReadable=!1),ie===0&&ae.needReadable&&((ae.highWaterMark!==0?ae.length>=ae.highWaterMark:ae.length>0)||ae.ended))return b("read: emitReadable",ae.length,ae.ended),ae.length===0&&ae.ended?kt(this):Dt(this),null;if(ie=Cn(ie,ae),ie===0&&ae.ended)return ae.length===0&&kt(this),null;var k=ae.needReadable;b("need readable",k),(ae.length===0||ae.length-ie<ae.highWaterMark)&&(k=!0,b("length less than watermark",k)),ae.ended||ae.reading?(k=!1,b("reading or ended",k)):k&&(b("do read"),ae.reading=!0,ae.sync=!0,ae.length===0&&(ae.needReadable=!0),this._read(ae.highWaterMark),ae.sync=!1,ae.reading||(ie=Cn(Y,ae)));var D;return ie>0?D=Oe(ie,ae):D=null,D===null?(ae.needReadable=ae.length<=ae.highWaterMark,ie=0):(ae.length-=ie,ae.awaitDrain=0),ae.length===0&&(ae.ended||(ae.needReadable=!0),Y!==ie&&ae.ended&&kt(this)),D!==null&&this.emit("data",D),D};function vn(ie,ae){if(b("onEofChunk"),!ae.ended){if(ae.decoder){var Y=ae.decoder.end();Y&&Y.length&&(ae.buffer.push(Y),ae.length+=ae.objectMode?1:Y.length)}ae.ended=!0,ae.sync?Dt(ie):(ae.needReadable=!1,ae.emittedReadable||(ae.emittedReadable=!0,de(ie)))}}function Dt(ie){var ae=ie._readableState;b("emitReadable",ae.needReadable,ae.emittedReadable),ae.needReadable=!1,ae.emittedReadable||(b("emitReadable",ae.flowing),ae.emittedReadable=!0,u.nextTick(de,ie))}function de(ie){var ae=ie._readableState;b("emitReadable_",ae.destroyed,ae.length,ae.ended),!ae.destroyed&&(ae.length||ae.ended)&&(ie.emit("readable"),ae.emittedReadable=!1),ae.needReadable=!ae.flowing&&!ae.ended&&ae.length<=ae.highWaterMark,Ne(ie)}function qe(ie,ae){ae.readingMore||(ae.readingMore=!0,u.nextTick(Pt,ie,ae))}function Pt(ie,ae){for(;!ae.reading&&!ae.ended&&(ae.length<ae.highWaterMark||ae.flowing&&ae.length===0);){var Y=ae.length;if(b("maybeReadMore read 0"),ie.read(0),Y===ae.length)break}ae.readingMore=!1}Ie.prototype._read=function(ie){z(this,new M("_read()"))},Ie.prototype.pipe=function(ie,ae){var Y=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=ie;break;case 1:k.pipes=[k.pipes,ie];break;default:k.pipes.push(ie);break}k.pipesCount+=1,b("pipe count=%d opts=%j",k.pipesCount,ae);var D=(!ae||ae.end!==!1)&&ie!==u.stdout&&ie!==u.stderr,oe=D?ze:Sn;k.endEmitted?u.nextTick(oe):Y.once("end",oe),ie.on("unpipe",xe);function xe(xn,Pn){b("onunpipe"),xn===Y&&Pn&&Pn.hasUnpiped===!1&&(Pn.hasUnpiped=!0,Tn())}function ze(){b("onend"),ie.end()}var hn=In(Y);ie.on("drain",hn);var An=!1;function Tn(){b("cleanup"),ie.removeListener("close",Ue),ie.removeListener("finish",En),ie.removeListener("drain",hn),ie.removeListener("error",Ve),ie.removeListener("unpipe",xe),Y.removeListener("end",ze),Y.removeListener("end",Sn),Y.removeListener("data",Rn),An=!0,k.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&hn()}Y.on("data",Rn);function Rn(xn){b("ondata");var Pn=ie.write(xn);b("dest.write",Pn),Pn===!1&&((k.pipesCount===1&&k.pipes===ie||k.pipesCount>1&&_n(k.pipes,ie)!==-1)&&!An&&(b("false write response, pause",k.awaitDrain),k.awaitDrain++),Y.pause())}function Ve(xn){b("onerror",xn),Sn(),ie.removeListener("error",Ve),d(ie,"error")===0&&z(ie,xn)}he(ie,"error",Ve);function Ue(){ie.removeListener("finish",En),Sn()}ie.once("close",Ue);function En(){b("onfinish"),ie.removeListener("close",Ue),Sn()}ie.once("finish",En);function Sn(){b("unpipe"),Y.unpipe(ie)}return ie.emit("pipe",Y),k.flowing||(b("pipe resume"),Y.resume()),ie};function In(ie){return function(){var Y=ie._readableState;b("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&d(ie,"data")&&(Y.flowing=!0,Ne(ie))}}Ie.prototype.unpipe=function(ie){var ae=this._readableState,Y={hasUnpiped:!1};if(ae.pipesCount===0)return this;if(ae.pipesCount===1)return ie&&ie!==ae.pipes?this:(ie||(ie=ae.pipes),ae.pipes=null,ae.pipesCount=0,ae.flowing=!1,ie&&ie.emit("unpipe",this,Y),this);if(!ie){var k=ae.pipes,D=ae.pipesCount;ae.pipes=null,ae.pipesCount=0,ae.flowing=!1;for(var oe=0;oe<D;oe++)k[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var xe=_n(ae.pipes,ie);return xe===-1?this:(ae.pipes.splice(xe,1),ae.pipesCount-=1,ae.pipesCount===1&&(ae.pipes=ae.pipes[0]),ie.emit("unpipe",this,Y),this)},Ie.prototype.on=function(ie,ae){var Y=h.prototype.on.call(this,ie,ae),k=this._readableState;return ie==="data"?(k.readableListening=this.listenerCount("readable")>0,k.flowing!==!1&&this.resume()):ie==="readable"&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,b("on readable",k.length,k.reading),k.length?Dt(this):k.reading||u.nextTick(Ce,this)),Y},Ie.prototype.addListener=Ie.prototype.on,Ie.prototype.removeListener=function(ie,ae){var Y=h.prototype.removeListener.call(this,ie,ae);return ie==="readable"&&u.nextTick($e,this),Y},Ie.prototype.removeAllListeners=function(ie){var ae=h.prototype.removeAllListeners.apply(this,arguments);return(ie==="readable"||ie===void 0)&&u.nextTick($e,this),ae};function $e(ie){var ae=ie._readableState;ae.readableListening=ie.listenerCount("readable")>0,ae.resumeScheduled&&!ae.paused?ae.flowing=!0:ie.listenerCount("data")>0&&ie.resume()}function Ce(ie){b("readable nexttick read 0"),ie.read(0)}Ie.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(b("resume"),ie.flowing=!ie.readableListening,ue(this,ie)),ie.paused=!1,this};function ue(ie,ae){ae.resumeScheduled||(ae.resumeScheduled=!0,u.nextTick(At,ie,ae))}function At(ie,ae){b("resume",ae.reading),ae.reading||ie.read(0),ae.resumeScheduled=!1,ie.emit("resume"),Ne(ie),ae.flowing&&!ae.reading&&ie.read(0)}Ie.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ne(ie){var ae=ie._readableState;for(b("flow",ae.flowing);ae.flowing&&ie.read()!==null;);}Ie.prototype.wrap=function(ie){var ae=this,Y=this._readableState,k=!1;ie.on("end",function(){if(b("wrapped end"),Y.decoder&&!Y.ended){var xe=Y.decoder.end();xe&&xe.length&&ae.push(xe)}ae.push(null)}),ie.on("data",function(xe){if(b("wrapped data"),Y.decoder&&(xe=Y.decoder.write(xe)),!(Y.objectMode&&xe==null)&&!(!Y.objectMode&&(!xe||!xe.length))){var ze=ae.push(xe);ze||(k=!0,ie.pause())}});for(var D in ie)this[D]===void 0&&typeof ie[D]=="function"&&(this[D]=function(ze){return function(){return ie[ze].apply(ie,arguments)}}(D));for(var oe=0;oe<$.length;oe++)ie.on($[oe],this.emit.bind(this,$[oe]));return this._read=function(xe){b("wrapped _read",xe),k&&(k=!1,ie.resume())},this},typeof Symbol=="function"&&(Ie.prototype[Symbol.asyncIterator]=function(){return j===void 0&&(j=i("./internal/streams/async_iterator")),j(this)}),Object.defineProperty(Ie.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Ie.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Ie.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ae){this._readableState&&(this._readableState.flowing=ae)}}),Ie._fromList=Oe,Object.defineProperty(Ie.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Oe(ie,ae){if(ae.length===0)return null;var Y;return ae.objectMode?Y=ae.buffer.shift():!ie||ie>=ae.length?(ae.decoder?Y=ae.buffer.join(""):ae.buffer.length===1?Y=ae.buffer.first():Y=ae.buffer.concat(ae.length),ae.buffer.clear()):Y=ae.buffer.consume(ie,ae.decoder),Y}function kt(ie){var ae=ie._readableState;b("endReadable",ae.endEmitted),ae.endEmitted||(ae.ended=!0,u.nextTick(jt,ae,ie))}function jt(ie,ae){if(b("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ae.readable=!1,ae.emit("end"),ie.autoDestroy)){var Y=ae._writableState;(!Y||Y.autoDestroy&&Y.finished)&&ae.destroy()}}typeof Symbol=="function"&&(Ie.from=function(ie,ae){return V===void 0&&(V=i("./internal/streams/from")),V(Ie,ie,ae)});function _n(ie,ae){for(var Y=0,k=ie.length;Y<k;Y++)if(ie[Y]===ae)return Y;return-1}}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/async_iterator":39,"./internal/streams/buffer_list":40,"./internal/streams/destroy":41,"./internal/streams/from":43,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,events:49,inherits:51,"string_decoder/":136,util:26}],37:[function(i,o,a){o.exports=p;var u=i("../errors").codes,c=u.ERR_METHOD_NOT_IMPLEMENTED,f=u.ERR_MULTIPLE_CALLBACK,d=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,h=u.ERR_TRANSFORM_WITH_LENGTH_0,v=i("./_stream_duplex");i("inherits")(p,v);function g(b,A){var w=this._transformState;w.transforming=!1;var T=w.writecb;if(T===null)return this.emit("error",new f);w.writechunk=null,w.writecb=null,A!=null&&this.push(A),T(b);var S=this._readableState;S.reading=!1,(S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}function p(b){if(!(this instanceof p))return new p(b);v.call(this,b),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",y)}function y(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(A,w){_(b,A,w)}):_(this,null,null)}p.prototype.push=function(b,A){return this._transformState.needTransform=!1,v.prototype.push.call(this,b,A)},p.prototype._transform=function(b,A,w){w(new c("_transform()"))},p.prototype._write=function(b,A,w){var T=this._transformState;if(T.writecb=w,T.writechunk=b,T.writeencoding=A,!T.transforming){var S=this._readableState;(T.needTransform||S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}},p.prototype._read=function(b){var A=this._transformState;A.writechunk!==null&&!A.transforming?(A.transforming=!0,this._transform(A.writechunk,A.writeencoding,A.afterTransform)):A.needTransform=!0},p.prototype._destroy=function(b,A){v.prototype._destroy.call(this,b,function(w){A(w)})};function _(b,A,w){if(A)return b.emit("error",A);if(w!=null&&b.push(w),b._writableState.length)throw new h;if(b._transformState.transforming)throw new d;return b.push(null)}},{"../errors":33,"./_stream_duplex":34,inherits:51}],38:[function(i,o,a){(function(u,c){(function(){o.exports=le;function f(Ne){var Oe=this;this.next=null,this.entry=null,this.finish=function(){At(Oe,Ne)}}var d;le.WritableState=$;var h={deprecate:i("util-deprecate")},v=i("./internal/streams/stream"),g=i("buffer").Buffer,p=c.Uint8Array||function(){};function y(Ne){return g.from(Ne)}function _(Ne){return g.isBuffer(Ne)||Ne instanceof p}var b=i("./internal/streams/destroy"),A=i("./internal/streams/state"),w=A.getHighWaterMark,T=i("../errors").codes,S=T.ERR_INVALID_ARG_TYPE,x=T.ERR_METHOD_NOT_IMPLEMENTED,O=T.ERR_MULTIPLE_CALLBACK,L=T.ERR_STREAM_CANNOT_PIPE,M=T.ERR_STREAM_DESTROYED,re=T.ERR_STREAM_NULL_VALUES,F=T.ERR_STREAM_WRITE_AFTER_END,j=T.ERR_UNKNOWN_ENCODING,V=b.errorOrDestroy;i("inherits")(le,v);function z(){}function $(Ne,Oe,kt){d=d||i("./_stream_duplex"),Ne=Ne||{},typeof kt!="boolean"&&(kt=Oe instanceof d),this.objectMode=!!Ne.objectMode,kt&&(this.objectMode=this.objectMode||!!Ne.writableObjectMode),this.highWaterMark=w(this,Ne,"writableHighWaterMark",kt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var jt=Ne.decodeStrings===!1;this.decodeStrings=!jt,this.defaultEncoding=Ne.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(_n){vn(Oe,_n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ne.emitClose!==!1,this.autoDestroy=!!Ne.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}$.prototype.getBuffer=function(){for(var Oe=this.bufferedRequest,kt=[];Oe;)kt.push(Oe),Oe=Oe.next;return kt},function(){try{Object.defineProperty($.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var he;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(he=Function.prototype[Symbol.hasInstance],Object.defineProperty(le,Symbol.hasInstance,{value:function(Oe){return he.call(this,Oe)?!0:this!==le?!1:Oe&&Oe._writableState instanceof $}})):he=function(Oe){return Oe instanceof this};function le(Ne){d=d||i("./_stream_duplex");var Oe=this instanceof d;if(!Oe&&!he.call(le,this))return new le(Ne);this._writableState=new $(Ne,this,Oe),this.writable=!0,Ne&&(typeof Ne.write=="function"&&(this._write=Ne.write),typeof Ne.writev=="function"&&(this._writev=Ne.writev),typeof Ne.destroy=="function"&&(this._destroy=Ne.destroy),typeof Ne.final=="function"&&(this._final=Ne.final)),v.call(this)}le.prototype.pipe=function(){V(this,new L)};function Ie(Ne,Oe){var kt=new F;V(Ne,kt),u.nextTick(Oe,kt)}function Fe(Ne,Oe,kt,jt){var _n;return kt===null?_n=new re:typeof kt!="string"&&!Oe.objectMode&&(_n=new S("chunk",["string","Buffer"],kt)),_n?(V(Ne,_n),u.nextTick(jt,_n),!1):!0}le.prototype.write=function(Ne,Oe,kt){var jt=this._writableState,_n=!1,ie=!jt.objectMode&&_(Ne);return ie&&!g.isBuffer(Ne)&&(Ne=y(Ne)),typeof Oe=="function"&&(kt=Oe,Oe=null),ie?Oe="buffer":Oe||(Oe=jt.defaultEncoding),typeof kt!="function"&&(kt=z),jt.ending?Ie(this,kt):(ie||Fe(this,jt,Ne,kt))&&(jt.pendingcb++,_n=Lt(this,jt,ie,Ne,Oe,kt)),_n},le.prototype.cork=function(){this._writableState.corked++},le.prototype.uncork=function(){var Ne=this._writableState;Ne.corked&&(Ne.corked--,!Ne.writing&&!Ne.corked&&!Ne.bufferProcessing&&Ne.bufferedRequest&&qe(this,Ne))},le.prototype.setDefaultEncoding=function(Oe){if(typeof Oe=="string"&&(Oe=Oe.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Oe+"").toLowerCase())>-1))throw new j(Oe);return this._writableState.defaultEncoding=Oe,this},Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function pe(Ne,Oe,kt){return!Ne.objectMode&&Ne.decodeStrings!==!1&&typeof Oe=="string"&&(Oe=g.from(Oe,kt)),Oe}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Lt(Ne,Oe,kt,jt,_n,ie){if(!kt){var ae=pe(Oe,jt,_n);jt!==ae&&(kt=!0,_n="buffer",jt=ae)}var Y=Oe.objectMode?1:jt.length;Oe.length+=Y;var k=Oe.length<Oe.highWaterMark;if(k||(Oe.needDrain=!0),Oe.writing||Oe.corked){var D=Oe.lastBufferedRequest;Oe.lastBufferedRequest={chunk:jt,encoding:_n,isBuf:kt,callback:ie,next:null},D?D.next=Oe.lastBufferedRequest:Oe.bufferedRequest=Oe.lastBufferedRequest,Oe.bufferedRequestCount+=1}else _e(Ne,Oe,!1,Y,jt,_n,ie);return k}function _e(Ne,Oe,kt,jt,_n,ie,ae){Oe.writelen=jt,Oe.writecb=ae,Oe.writing=!0,Oe.sync=!0,Oe.destroyed?Oe.onwrite(new M("write")):kt?Ne._writev(_n,Oe.onwrite):Ne._write(_n,ie,Oe.onwrite),Oe.sync=!1}function Et(Ne,Oe,kt,jt,_n){--Oe.pendingcb,kt?(u.nextTick(_n,jt),u.nextTick(Ce,Ne,Oe),Ne._writableState.errorEmitted=!0,V(Ne,jt)):(_n(jt),Ne._writableState.errorEmitted=!0,V(Ne,jt),Ce(Ne,Oe))}function Cn(Ne){Ne.writing=!1,Ne.writecb=null,Ne.length-=Ne.writelen,Ne.writelen=0}function vn(Ne,Oe){var kt=Ne._writableState,jt=kt.sync,_n=kt.writecb;if(typeof _n!="function")throw new O;if(Cn(kt),Oe)Et(Ne,kt,jt,Oe,_n);else{var ie=Pt(kt)||Ne.destroyed;!ie&&!kt.corked&&!kt.bufferProcessing&&kt.bufferedRequest&&qe(Ne,kt),jt?u.nextTick(Dt,Ne,kt,ie,_n):Dt(Ne,kt,ie,_n)}}function Dt(Ne,Oe,kt,jt){kt||de(Ne,Oe),Oe.pendingcb--,jt(),Ce(Ne,Oe)}function de(Ne,Oe){Oe.length===0&&Oe.needDrain&&(Oe.needDrain=!1,Ne.emit("drain"))}function qe(Ne,Oe){Oe.bufferProcessing=!0;var kt=Oe.bufferedRequest;if(Ne._writev&&kt&&kt.next){var jt=Oe.bufferedRequestCount,_n=new Array(jt),ie=Oe.corkedRequestsFree;ie.entry=kt;for(var ae=0,Y=!0;kt;)_n[ae]=kt,kt.isBuf||(Y=!1),kt=kt.next,ae+=1;_n.allBuffers=Y,_e(Ne,Oe,!0,Oe.length,_n,"",ie.finish),Oe.pendingcb++,Oe.lastBufferedRequest=null,ie.next?(Oe.corkedRequestsFree=ie.next,ie.next=null):Oe.corkedRequestsFree=new f(Oe),Oe.bufferedRequestCount=0}else{for(;kt;){var k=kt.chunk,D=kt.encoding,oe=kt.callback,xe=Oe.objectMode?1:k.length;if(_e(Ne,Oe,!1,xe,k,D,oe),kt=kt.next,Oe.bufferedRequestCount--,Oe.writing)break}kt===null&&(Oe.lastBufferedRequest=null)}Oe.bufferedRequest=kt,Oe.bufferProcessing=!1}le.prototype._write=function(Ne,Oe,kt){kt(new x("_write()"))},le.prototype._writev=null,le.prototype.end=function(Ne,Oe,kt){var jt=this._writableState;return typeof Ne=="function"?(kt=Ne,Ne=null,Oe=null):typeof Oe=="function"&&(kt=Oe,Oe=null),Ne!=null&&this.write(Ne,Oe),jt.corked&&(jt.corked=1,this.uncork()),jt.ending||ue(this,jt,kt),this},Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Pt(Ne){return Ne.ending&&Ne.length===0&&Ne.bufferedRequest===null&&!Ne.finished&&!Ne.writing}function In(Ne,Oe){Ne._final(function(kt){Oe.pendingcb--,kt&&V(Ne,kt),Oe.prefinished=!0,Ne.emit("prefinish"),Ce(Ne,Oe)})}function $e(Ne,Oe){!Oe.prefinished&&!Oe.finalCalled&&(typeof Ne._final=="function"&&!Oe.destroyed?(Oe.pendingcb++,Oe.finalCalled=!0,u.nextTick(In,Ne,Oe)):(Oe.prefinished=!0,Ne.emit("prefinish")))}function Ce(Ne,Oe){var kt=Pt(Oe);if(kt&&($e(Ne,Oe),Oe.pendingcb===0&&(Oe.finished=!0,Ne.emit("finish"),Oe.autoDestroy))){var jt=Ne._readableState;(!jt||jt.autoDestroy&&jt.endEmitted)&&Ne.destroy()}return kt}function ue(Ne,Oe,kt){Oe.ending=!0,Ce(Ne,Oe),kt&&(Oe.finished?u.nextTick(kt):Ne.once("finish",kt)),Oe.ended=!0,Ne.writable=!1}function At(Ne,Oe,kt){var jt=Ne.entry;for(Ne.entry=null;jt;){var _n=jt.callback;Oe.pendingcb--,_n(kt),jt=jt.next}Oe.corkedRequestsFree.next=Ne}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Oe){this._writableState&&(this._writableState.destroyed=Oe)}}),le.prototype.destroy=b.destroy,le.prototype._undestroy=b.undestroy,le.prototype._destroy=function(Ne,Oe){Oe(Ne)}}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/destroy":41,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,inherits:51,"util-deprecate":139}],39:[function(i,o,a){(function(u){(function(){var c;function f(M,re,F){return re in M?Object.defineProperty(M,re,{value:F,enumerable:!0,configurable:!0,writable:!0}):M[re]=F,M}var d=i("./end-of-stream"),h=Symbol("lastResolve"),v=Symbol("lastReject"),g=Symbol("error"),p=Symbol("ended"),y=Symbol("lastPromise"),_=Symbol("handlePromise"),b=Symbol("stream");function A(M,re){return{value:M,done:re}}function w(M){var re=M[h];if(re!==null){var F=M[b].read();F!==null&&(M[y]=null,M[h]=null,M[v]=null,re(A(F,!1)))}}function T(M){u.nextTick(w,M)}function S(M,re){return function(F,j){M.then(function(){if(re[p]){F(A(void 0,!0));return}re[_](F,j)},j)}}var x=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((c={get stream(){return this[b]},next:function(){var re=this,F=this[g];if(F!==null)return Promise.reject(F);if(this[p])return Promise.resolve(A(void 0,!0));if(this[b].destroyed)return new Promise(function($,he){u.nextTick(function(){re[g]?he(re[g]):$(A(void 0,!0))})});var j=this[y],V;if(j)V=new Promise(S(j,this));else{var z=this[b].read();if(z!==null)return Promise.resolve(A(z,!1));V=new Promise(this[_])}return this[y]=V,V}},f(c,Symbol.asyncIterator,function(){return this}),f(c,"return",function(){var re=this;return new Promise(function(F,j){re[b].destroy(null,function(V){if(V){j(V);return}F(A(void 0,!0))})})}),c),x),L=function(re){var F,j=Object.create(O,(F={},f(F,b,{value:re,writable:!0}),f(F,h,{value:null,writable:!0}),f(F,v,{value:null,writable:!0}),f(F,g,{value:null,writable:!0}),f(F,p,{value:re._readableState.endEmitted,writable:!0}),f(F,_,{value:function(z,$){var he=j[b].read();he?(j[y]=null,j[h]=null,j[v]=null,z(A(he,!1))):(j[h]=z,j[v]=$)},writable:!0}),F));return j[y]=null,d(re,function(V){if(V&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"){var z=j[v];z!==null&&(j[y]=null,j[h]=null,j[v]=null,z(V)),j[g]=V;return}var $=j[h];$!==null&&(j[y]=null,j[h]=null,j[v]=null,$(A(void 0,!0))),j[p]=!0}),re.on("readable",T.bind(null,j)),j};o.exports=L}).call(this)}).call(this,i("_process"))},{"./end-of-stream":42,_process:102}],40:[function(i,o,a){function u(w,T){var S=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);T&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(w,O).enumerable})),S.push.apply(S,x)}return S}function c(w){for(var T=1;T<arguments.length;T++){var S=arguments[T]!=null?arguments[T]:{};T%2?u(Object(S),!0).forEach(function(x){f(w,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):u(Object(S)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(S,x))})}return w}function f(w,T,S){return T in w?Object.defineProperty(w,T,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[T]=S,w}function d(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function h(w,T){for(var S=0;S<T.length;S++){var x=T[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}function v(w,T,S){return T&&h(w.prototype,T),S&&h(w,S),w}var g=i("buffer"),p=g.Buffer,y=i("util"),_=y.inspect,b=_&&_.custom||"inspect";function A(w,T,S){p.prototype.copy.call(w,T,S)}o.exports=function(){function w(){d(this,w),this.head=null,this.tail=null,this.length=0}return v(w,[{key:"push",value:function(S){var x={data:S,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(S){var x={data:S,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var x=this.head,O=""+x.data;x=x.next;)O+=S+x.data;return O}},{key:"concat",value:function(S){if(this.length===0)return p.alloc(0);for(var x=p.allocUnsafe(S>>>0),O=this.head,L=0;O;)A(O.data,x,L),L+=O.data.length,O=O.next;return x}},{key:"consume",value:function(S,x){var O;return S<this.head.data.length?(O=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?O=this.shift():O=x?this._getString(S):this._getBuffer(S),O}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var x=this.head,O=1,L=x.data;for(S-=L.length;x=x.next;){var M=x.data,re=S>M.length?M.length:S;if(re===M.length?L+=M:L+=M.slice(0,S),S-=re,S===0){re===M.length?(++O,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=M.slice(re));break}++O}return this.length-=O,L}},{key:"_getBuffer",value:function(S){var x=p.allocUnsafe(S),O=this.head,L=1;for(O.data.copy(x),S-=O.data.length;O=O.next;){var M=O.data,re=S>M.length?M.length:S;if(M.copy(x,x.length-S,0,re),S-=re,S===0){re===M.length?(++L,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=M.slice(re));break}++L}return this.length-=L,x}},{key:b,value:function(S,x){return _(this,c({},x,{depth:0,customInspect:!1}))}}]),w}()},{buffer:29,util:26}],41:[function(i,o,a){(function(u){(function(){function c(p,y){var _=this,b=this._readableState&&this._readableState.destroyed,A=this._writableState&&this._writableState.destroyed;return b||A?(y?y(p):p&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(v,this,p)):u.nextTick(v,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(w){!y&&w?_._writableState?_._writableState.errorEmitted?u.nextTick(d,_):(_._writableState.errorEmitted=!0,u.nextTick(f,_,w)):u.nextTick(f,_,w):y?(u.nextTick(d,_),y(w)):u.nextTick(d,_)}),this)}function f(p,y){v(p,y),d(p)}function d(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function h(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(p,y){p.emit("error",y)}function g(p,y){var _=p._readableState,b=p._writableState;_&&_.autoDestroy||b&&b.autoDestroy?p.destroy(y):p.emit("error",y)}o.exports={destroy:c,undestroy:h,errorOrDestroy:g}}).call(this)}).call(this,i("_process"))},{_process:102}],42:[function(i,o,a){var u=i("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function c(v){var g=!1;return function(){if(!g){g=!0;for(var p=arguments.length,y=new Array(p),_=0;_<p;_++)y[_]=arguments[_];v.apply(this,y)}}}function f(){}function d(v){return v.setHeader&&typeof v.abort=="function"}function h(v,g,p){if(typeof g=="function")return h(v,null,g);g||(g={}),p=c(p||f);var y=g.readable||g.readable!==!1&&v.readable,_=g.writable||g.writable!==!1&&v.writable,b=function(){v.writable||w()},A=v._writableState&&v._writableState.finished,w=function(){_=!1,A=!0,y||p.call(v)},T=v._readableState&&v._readableState.endEmitted,S=function(){y=!1,T=!0,_||p.call(v)},x=function(re){p.call(v,re)},O=function(){var re;if(y&&!T)return(!v._readableState||!v._readableState.ended)&&(re=new u),p.call(v,re);if(_&&!A)return(!v._writableState||!v._writableState.ended)&&(re=new u),p.call(v,re)},L=function(){v.req.on("finish",w)};return d(v)?(v.on("complete",w),v.on("abort",O),v.req?L():v.on("request",L)):_&&!v._writableState&&(v.on("end",b),v.on("close",b)),v.on("end",S),v.on("finish",w),g.error!==!1&&v.on("error",x),v.on("close",O),function(){v.removeListener("complete",w),v.removeListener("abort",O),v.removeListener("request",L),v.req&&v.req.removeListener("finish",w),v.removeListener("end",b),v.removeListener("close",b),v.removeListener("finish",w),v.removeListener("end",S),v.removeListener("error",x),v.removeListener("close",O)}}o.exports=h},{"../../../errors":33}],43:[function(i,o,a){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],44:[function(i,o,a){var u;function c(w){var T=!1;return function(){T||(T=!0,w.apply(void 0,arguments))}}var f=i("../../../errors").codes,d=f.ERR_MISSING_ARGS,h=f.ERR_STREAM_DESTROYED;function v(w){if(w)throw w}function g(w){return w.setHeader&&typeof w.abort=="function"}function p(w,T,S,x){x=c(x);var O=!1;w.on("close",function(){O=!0}),u===void 0&&(u=i("./end-of-stream")),u(w,{readable:T,writable:S},function(M){if(M)return x(M);O=!0,x()});var L=!1;return function(M){if(!O&&!L){if(L=!0,g(w))return w.abort();if(typeof w.destroy=="function")return w.destroy();x(M||new h("pipe"))}}}function y(w){w()}function _(w,T){return w.pipe(T)}function b(w){return!w.length||typeof w[w.length-1]!="function"?v:w.pop()}function A(){for(var w=arguments.length,T=new Array(w),S=0;S<w;S++)T[S]=arguments[S];var x=b(T);if(Array.isArray(T[0])&&(T=T[0]),T.length<2)throw new d("streams");var O,L=T.map(function(M,re){var F=re<T.length-1,j=re>0;return p(M,F,j,function(V){O||(O=V),V&&L.forEach(y),!F&&(L.forEach(y),x(O))})});return T.reduce(_)}o.exports=A},{"../../../errors":33,"./end-of-stream":42}],45:[function(i,o,a){var u=i("../../../errors").codes.ERR_INVALID_OPT_VALUE;function c(d,h,v){return d.highWaterMark!=null?d.highWaterMark:h?d[v]:null}function f(d,h,v,g){var p=c(h,g,v);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var y=g?v:"highWaterMark";throw new u(y,p)}return Math.floor(p)}return d.objectMode?16:16*1024}o.exports={getHighWaterMark:f}},{"../../../errors":33}],46:[function(i,o,a){o.exports=i("events").EventEmitter},{events:49}],47:[function(i,o,a){a=o.exports=i("./lib/_stream_readable.js"),a.Stream=a,a.Readable=a,a.Writable=i("./lib/_stream_writable.js"),a.Duplex=i("./lib/_stream_duplex.js"),a.Transform=i("./lib/_stream_transform.js"),a.PassThrough=i("./lib/_stream_passthrough.js"),a.finished=i("./lib/internal/streams/end-of-stream.js"),a.pipeline=i("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":34,"./lib/_stream_passthrough.js":35,"./lib/_stream_readable.js":36,"./lib/_stream_transform.js":37,"./lib/_stream_writable.js":38,"./lib/internal/streams/end-of-stream.js":42,"./lib/internal/streams/pipeline.js":44}],48:[function(i,o,a){(function(u){(function(){var c=i("once"),f=function(){},d=function(g){return g.setHeader&&typeof g.abort=="function"},h=function(g){return g.stdio&&Array.isArray(g.stdio)&&g.stdio.length===3},v=function(g,p,y){if(typeof p=="function")return v(g,null,p);p||(p={}),y=c(y||f);var _=g._writableState,b=g._readableState,A=p.readable||p.readable!==!1&&g.readable,w=p.writable||p.writable!==!1&&g.writable,T=!1,S=function(){g.writable||x()},x=function(){w=!1,A||y.call(g)},O=function(){A=!1,w||y.call(g)},L=function(V){y.call(g,V?new Error("exited with error code: "+V):null)},M=function(V){y.call(g,V)},re=function(){u.nextTick(F)},F=function(){if(!T){if(A&&!(b&&b.ended&&!b.destroyed))return y.call(g,new Error("premature close"));if(w&&!(_&&_.ended&&!_.destroyed))return y.call(g,new Error("premature close"))}},j=function(){g.req.on("finish",x)};return d(g)?(g.on("complete",x),g.on("abort",re),g.req?j():g.on("request",j)):w&&!_&&(g.on("end",S),g.on("close",S)),h(g)&&g.on("exit",L),g.on("end",O),g.on("finish",x),p.error!==!1&&g.on("error",M),g.on("close",re),function(){T=!0,g.removeListener("complete",x),g.removeListener("abort",re),g.removeListener("request",j),g.req&&g.req.removeListener("finish",x),g.removeListener("end",S),g.removeListener("close",S),g.removeListener("finish",x),g.removeListener("exit",L),g.removeListener("end",O),g.removeListener("error",M),g.removeListener("close",re)}};o.exports=v}).call(this)}).call(this,i("_process"))},{_process:102,once:100}],49:[function(i,o,a){var u=typeof Reflect=="object"?Reflect:null,c=u&&typeof u.apply=="function"?u.apply:function(j,V,z){return Function.prototype.apply.call(j,V,z)},f;u&&typeof u.ownKeys=="function"?f=u.ownKeys:Object.getOwnPropertySymbols?f=function(j){return Object.getOwnPropertyNames(j).concat(Object.getOwnPropertySymbols(j))}:f=function(j){return Object.getOwnPropertyNames(j)};function d(F){console&&console.warn&&console.warn(F)}var h=Number.isNaN||function(j){return j!==j};function v(){v.init.call(this)}o.exports=v,o.exports.once=L,v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var g=10;function p(F){if(typeof F!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof F)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(F){if(typeof F!="number"||F<0||h(F))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+F+".");g=F}}),v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(j){if(typeof j!="number"||j<0||h(j))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+j+".");return this._maxListeners=j,this};function y(F){return F._maxListeners===void 0?v.defaultMaxListeners:F._maxListeners}v.prototype.getMaxListeners=function(){return y(this)},v.prototype.emit=function(j){for(var V=[],z=1;z<arguments.length;z++)V.push(arguments[z]);var $=j==="error",he=this._events;if(he!==void 0)$=$&&he.error===void 0;else if(!$)return!1;if($){var le;if(V.length>0&&(le=V[0]),le instanceof Error)throw le;var Ie=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw Ie.context=le,Ie}var Fe=he[j];if(Fe===void 0)return!1;if(typeof Fe=="function")c(Fe,this,V);else for(var pe=Fe.length,Lt=S(Fe,pe),z=0;z<pe;++z)c(Lt[z],this,V);return!0};function _(F,j,V,z){var $,he,le;if(p(V),he=F._events,he===void 0?(he=F._events=Object.create(null),F._eventsCount=0):(he.newListener!==void 0&&(F.emit("newListener",j,V.listener?V.listener:V),he=F._events),le=he[j]),le===void 0)le=he[j]=V,++F._eventsCount;else if(typeof le=="function"?le=he[j]=z?[V,le]:[le,V]:z?le.unshift(V):le.push(V),$=y(F),$>0&&le.length>$&&!le.warned){le.warned=!0;var Ie=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ie.name="MaxListenersExceededWarning",Ie.emitter=F,Ie.type=j,Ie.count=le.length,d(Ie)}return F}v.prototype.addListener=function(j,V){return _(this,j,V,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(j,V){return _(this,j,V,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(F,j,V){var z={fired:!1,wrapFn:void 0,target:F,type:j,listener:V},$=b.bind(z);return $.listener=V,z.wrapFn=$,$}v.prototype.once=function(j,V){return p(V),this.on(j,A(this,j,V)),this},v.prototype.prependOnceListener=function(j,V){return p(V),this.prependListener(j,A(this,j,V)),this},v.prototype.removeListener=function(j,V){var z,$,he,le,Ie;if(p(V),$=this._events,$===void 0)return this;if(z=$[j],z===void 0)return this;if(z===V||z.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete $[j],$.removeListener&&this.emit("removeListener",j,z.listener||V));else if(typeof z!="function"){for(he=-1,le=z.length-1;le>=0;le--)if(z[le]===V||z[le].listener===V){Ie=z[le].listener,he=le;break}if(he<0)return this;he===0?z.shift():x(z,he),z.length===1&&($[j]=z[0]),$.removeListener!==void 0&&this.emit("removeListener",j,Ie||V)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(j){var V,z,$;if(z=this._events,z===void 0)return this;if(z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):z[j]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete z[j]),this;if(arguments.length===0){var he=Object.keys(z),le;for($=0;$<he.length;++$)le=he[$],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=z[j],typeof V=="function")this.removeListener(j,V);else if(V!==void 0)for($=V.length-1;$>=0;$--)this.removeListener(j,V[$]);return this};function w(F,j,V){var z=F._events;if(z===void 0)return[];var $=z[j];return $===void 0?[]:typeof $=="function"?V?[$.listener||$]:[$]:V?O($):S($,$.length)}v.prototype.listeners=function(j){return w(this,j,!0)},v.prototype.rawListeners=function(j){return w(this,j,!1)},v.listenerCount=function(F,j){return typeof F.listenerCount=="function"?F.listenerCount(j):T.call(F,j)},v.prototype.listenerCount=T;function T(F){var j=this._events;if(j!==void 0){var V=j[F];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function S(F,j){for(var V=new Array(j),z=0;z<j;++z)V[z]=F[z];return V}function x(F,j){for(;j+1<F.length;j++)F[j]=F[j+1];F.pop()}function O(F){for(var j=new Array(F.length),V=0;V<j.length;++V)j[V]=F[V].listener||F[V];return j}function L(F,j){return new Promise(function(V,z){function $(le){F.removeListener(j,he),z(le)}function he(){typeof F.removeListener=="function"&&F.removeListener("error",$),V([].slice.call(arguments))}re(F,j,he,{once:!0}),j!=="error"&&M(F,$,{once:!0})})}function M(F,j,V){typeof F.on=="function"&&re(F,"error",j,V)}function re(F,j,V,z){if(typeof F.on=="function")z.once?F.once(j,V):F.on(j,V);else if(typeof F.addEventListener=="function")F.addEventListener(j,function $(he){z.once&&F.removeEventListener(j,$),V(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof F)}},{}],50:[function(i,o,a){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */a.read=function(u,c,f,d,h){var v,g,p=h*8-d-1,y=(1<<p)-1,_=y>>1,b=-7,A=f?h-1:0,w=f?-1:1,T=u[c+A];for(A+=w,v=T&(1<<-b)-1,T>>=-b,b+=p;b>0;v=v*256+u[c+A],A+=w,b-=8);for(g=v&(1<<-b)-1,v>>=-b,b+=d;b>0;g=g*256+u[c+A],A+=w,b-=8);if(v===0)v=1-_;else{if(v===y)return g?NaN:(T?-1:1)*(1/0);g=g+Math.pow(2,d),v=v-_}return(T?-1:1)*g*Math.pow(2,v-d)},a.write=function(u,c,f,d,h,v){var g,p,y,_=v*8-h-1,b=(1<<_)-1,A=b>>1,w=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=d?0:v-1,S=d?1:-1,x=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(p=isNaN(c)?1:0,g=b):(g=Math.floor(Math.log(c)/Math.LN2),c*(y=Math.pow(2,-g))<1&&(g--,y*=2),g+A>=1?c+=w/y:c+=w*Math.pow(2,1-A),c*y>=2&&(g++,y/=2),g+A>=b?(p=0,g=b):g+A>=1?(p=(c*y-1)*Math.pow(2,h),g=g+A):(p=c*Math.pow(2,A-1)*Math.pow(2,h),g=0));h>=8;u[f+T]=p&255,T+=S,p/=256,h-=8);for(g=g<<h|p,_+=h;_>0;u[f+T]=g&255,T+=S,g/=256,_-=8);u[f+T-S]|=x*128}},{}],51:[function(i,o,a){typeof Object.create=="function"?o.exports=function(c,f){f&&(c.super_=f,c.prototype=Object.create(f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(c,f){if(f){c.super_=f;var d=function(){};d.prototype=f.prototype,c.prototype=new d,c.prototype.constructor=c}}},{}],52:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.ContainerIterator=a.Container=a.Base=void 0;class u{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}}a.ContainerIterator=u;class c{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}a.Base=c;class f extends c{}a.Container=f},{}],53:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.HashContainerIterator=a.HashContainer=void 0;var u=i("../../ContainerBase"),c=d(i("../../../utils/checkObject")),f=i("../../../utils/throwError");function d(g){return g&&g.t?g:{default:g}}class h extends u.ContainerIterator{constructor(p,y,_){super(_),this.o=p,this.h=y,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this})}}a.HashContainerIterator=h;class v extends u.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(p){const{L:y,B:_}=p;y.B=_,_.L=y,p===this.p&&(this.p=_),p===this._&&(this._=y),this.i-=1}M(p,y,_){_===void 0&&(_=(0,c.default)(p));let b;if(_){const A=p[this.HASH_TAG];if(A!==void 0)return this.H[A].l=y,this.i;Object.defineProperty(p,this.HASH_TAG,{value:this.H.length,configurable:!0}),b={u:p,l:y,L:this._,B:this.h},this.H.push(b)}else{const A=this.g[p];if(A)return A.l=y,this.i;b={u:p,l:y,L:this._,B:this.h},this.g[p]=b}return this.i===0?(this.p=b,this.h.B=b):this._.B=b,this._=b,this.h.L=b,++this.i}I(p,y){if(y===void 0&&(y=(0,c.default)(p)),y){const _=p[this.HASH_TAG];return _===void 0?this.h:this.H[_]}else return this.g[p]||this.h}clear(){const p=this.HASH_TAG;this.H.forEach(function(y){delete y.u[p]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(p,y){let _;if(y===void 0&&(y=(0,c.default)(p)),y){const b=p[this.HASH_TAG];if(b===void 0)return!1;delete p[this.HASH_TAG],_=this.H[b],delete this.H[b]}else{if(_=this.g[p],_===void 0)return!1;delete this.g[p]}return this.V(_),!0}eraseElementByIterator(p){const y=p.o;return y===this.h&&(0,f.throwIteratorAccessError)(),this.V(y),p.next()}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;let y=this.p;for(;p--;)y=y.B;return this.V(y),this.i}}a.HashContainer=v},{"../../../utils/checkObject":70,"../../../utils/throwError":71,"../../ContainerBase":52}],54:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./Base"),c=d(i("../../utils/checkObject")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends u.HashContainerIterator{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){this.o===this.h&&(0,f.throwIteratorAccessError)();const y=this;return new Proxy([],{get(_,b){if(b==="0")return y.o.u;if(b==="1")return y.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return y.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.HashContainer{constructor(y=[]){super();const _=this;y.forEach(function(b){_.setElement(b[0],b[1])})}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(y,_,b){return this.M(y,_,b)}getElementByKey(y,_){if(_===void 0&&(_=(0,c.default)(y)),_){const A=y[this.HASH_TAG];return A!==void 0?this.H[A].l:void 0}const b=this.g[y];return b?b.l:void 0}getElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return[_.u,_.l]}find(y,_){const b=this.I(y,_);return new h(b,this.h,this)}forEach(y){let _=0,b=this.p;for(;b!==this.h;)y([b.u,b.l],_++,this),b=b.B}[Symbol.iterator](){return function*(){let y=this.p;for(;y!==this.h;)yield[y.u,y.l],y=y.B}.bind(this)()}}var g=v;a.default=g},{"../../utils/checkObject":70,"../../utils/throwError":71,"./Base":53}],55:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./Base"),c=i("../../utils/throwError");class f extends u.HashContainerIterator{constructor(g,p,y,_){super(g,p,_),this.container=y}get pointer(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o.u}copy(){return new f(this.o,this.h,this.container,this.iteratorType)}}class d extends u.HashContainer{constructor(g=[]){super();const p=this;g.forEach(function(y){p.insert(y)})}begin(){return new f(this.p,this.h,this)}end(){return new f(this.h,this.h,this)}rBegin(){return new f(this._,this.h,this,1)}rEnd(){return new f(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(g,p){return this.M(g,void 0,p)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=this.p;for(;g--;)p=p.B;return p.u}find(g,p){const y=this.I(g,p);return new f(y,this.h,this)}forEach(g){let p=0,y=this.p;for(;y!==this.h;)g(y.u,p++,this),y=y.B}[Symbol.iterator](){return function*(){let g=this.p;for(;g!==this.h;)yield g.u,g=g.B}.bind(this)()}}var h=d;a.default=h},{"../../utils/throwError":71,"./Base":53}],56:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[],v=function(p,y){return p>y?-1:p<y?1:0},g=!0){if(super(),this.v=v,Array.isArray(h))this.C=g?[...h]:h;else{this.C=[];const y=this;h.forEach(function(_){y.C.push(_)})}this.i=this.C.length;const p=this.i>>1;for(let y=this.i-1>>1;y>=0;--y)this.k(y,p)}m(h){const v=this.C[h];for(;h>0;){const g=h-1>>1,p=this.C[g];if(this.v(p,v)<=0)break;this.C[h]=p,h=g}this.C[h]=v}k(h,v){const g=this.C[h];for(;h<v;){let p=h<<1|1;const y=p+1;let _=this.C[p];if(y<this.i&&this.v(_,this.C[y])>0&&(p=y,_=this.C[y]),this.v(_,g)>=0)break;this.C[h]=_,h=p}this.C[h]=g}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;const h=this.C[0],v=this.C.pop();return this.i-=1,this.i&&(this.C[0]=v,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){const v=this.C.indexOf(h);return v<0?!1:(v===0?this.pop():v===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(v,1,this.C.pop()),this.i-=1,this.m(v),this.k(v,this.i>>1)),!0)}updateItem(h){const v=this.C.indexOf(h);return v<0?!1:(this.m(v),this.k(v,this.i>>1),!0)}toArray(){return[...this.C]}}var f=c;a.default=f},{"../ContainerBase":52}],57:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.j=0,this.q=[];const v=this;h.forEach(function(g){v.push(g)})}clear(){this.q=[],this.i=this.j=0}push(h){const v=this.q.length;if(this.j/v>.5&&this.j+this.i>=v&&v>4096){const g=this.i;for(let p=0;p<g;++p)this.q[p]=this.q[this.j+p];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;const h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}}var f=c;a.default=f},{"../ContainerBase":52}],58:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.S=[];const v=this;h.forEach(function(g){v.push(g)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}}var f=c;a.default=f},{"../ContainerBase":52}],59:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.RandomIterator=void 0;var u=i("../../ContainerBase"),c=i("../../../utils/throwError");class f extends u.ContainerIterator{constructor(h,v){super(v),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,c.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,c.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,c.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,c.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}}a.RandomIterator=f},{"../../../utils/throwError":71,"../../ContainerBase":52}],60:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../../ContainerBase");class c extends u.Container{}var f=c;a.default=f},{"../../ContainerBase":52}],61:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(i("./Base")),c=i("./Base/RandomIterator");function f(g){return g&&g.t?g:{default:g}}class d extends c.RandomIterator{constructor(p,y,_){super(p,_),this.container=y}copy(){return new d(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],y=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];const _=(()=>{if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size;if(typeof p.size=="function")return p.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=y,this.P=Math.max(Math.ceil(_/this.F),1);for(let w=0;w<this.P;++w)this.A.push(new Array(this.F));const b=Math.ceil(_/this.F);this.j=this.R=(this.P>>1)-(b>>1),this.D=this.N=this.F-_%this.F>>1;const A=this;p.forEach(function(w){A.pushBack(w)})}T(){const p=[],y=Math.max(this.P>>1,1);for(let _=0;_<y;++_)p[_]=new Array(this.F);for(let _=this.j;_<this.P;++_)p[p.length]=this.A[_];for(let _=0;_<this.R;++_)p[p.length]=this.A[_];p[p.length]=[...this.A[this.R]],this.j=y,this.R=p.length-1;for(let _=0;_<y;++_)p[p.length]=new Array(this.F);this.A=p,this.P=p.length}O(p){const y=this.D+p+1,_=y%this.F;let b=_-1,A=this.j+(y-_)/this.F;return _===0&&(A-=1),A%=this.P,b<0&&(b+=this.F),{curNodeBucketIndex:A,curNodePointerIndex:b}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new d(0,this)}end(){return new d(this.i,this)}rBegin(){return new d(this.i-1,this,1)}rEnd(){return new d(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(p){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=p,this.i}popBack(){if(this.i===0)return;const p=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,p}pushFront(p){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=p,this.i}popFront(){if(this.i===0)return;const p=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,p}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:y,curNodePointerIndex:_}=this.O(p);return this.A[y][_]}setElementByPos(p,y){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:_,curNodePointerIndex:b}=this.O(p);this.A[_][b]=y}insert(p,y,_=1){if(p<0||p>this.i)throw new RangeError;if(p===0)for(;_--;)this.pushFront(y);else if(p===this.i)for(;_--;)this.pushBack(y);else{const b=[];for(let A=p;A<this.i;++A)b.push(this.getElementByPos(A));this.cut(p-1);for(let A=0;A<_;++A)this.pushBack(y);for(let A=0;A<b.length;++A)this.pushBack(b[A])}return this.i}cut(p){if(p<0)return this.clear(),0;const{curNodeBucketIndex:y,curNodePointerIndex:_}=this.O(p);return this.R=y,this.N=_,this.i=p+1,this.i}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;if(p===0)this.popFront();else if(p===this.i-1)this.popBack();else{const y=[];for(let b=p+1;b<this.i;++b)y.push(this.getElementByPos(b));this.cut(p),this.popBack();const _=this;y.forEach(function(b){_.pushBack(b)})}return this.i}eraseElementByValue(p){if(this.i===0)return 0;const y=[];for(let b=0;b<this.i;++b){const A=this.getElementByPos(b);A!==p&&y.push(A)}const _=y.length;for(let b=0;b<_;++b)this.setElementByPos(b,y[b]);return this.cut(_-1)}eraseElementByIterator(p){const y=p.o;return this.eraseElementByPos(y),p=p.next(),p}find(p){for(let y=0;y<this.i;++y)if(this.getElementByPos(y)===p)return new d(y,this);return this.end()}reverse(){let p=0,y=this.i-1;for(;p<y;){const _=this.getElementByPos(p);this.setElementByPos(p,this.getElementByPos(y)),this.setElementByPos(y,_),p+=1,y-=1}}unique(){if(this.i<=1)return this.i;let p=1,y=this.getElementByPos(0);for(let _=1;_<this.i;++_){const b=this.getElementByPos(_);b!==y&&(y=b,this.setElementByPos(p++,b))}for(;this.i>p;)this.popBack();return this.i}sort(p){const y=[];for(let _=0;_<this.i;++_)y.push(this.getElementByPos(_));y.sort(p);for(let _=0;_<this.i;++_)this.setElementByPos(_,y[_])}shrinkToFit(){if(this.i===0)return;const p=[];this.forEach(function(y){p.push(y)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let y=0;y<this.P;++y)this.A.push(new Array(this.F));for(let y=0;y<p.length;++y)this.pushBack(p[y])}forEach(p){for(let y=0;y<this.i;++y)p(this.getElementByPos(y),y,this)}[Symbol.iterator](){return function*(){for(let p=0;p<this.i;++p)yield this.getElementByPos(p)}.bind(this)()}}var v=h;a.default=v},{"./Base":60,"./Base/RandomIterator":59}],62:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=i("../ContainerBase"),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.ContainerIterator{constructor(y,_,b,A){super(A),this.o=y,this.h=_,this.container=b,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.l}set pointer(y){this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.l=y}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;const _=this;y.forEach(function(b){_.pushBack(b)})}V(y){const{L:_,B:b}=y;_.B=b,b.L=_,y===this.p&&(this.p=b),y===this._&&(this._=_),this.i-=1}G(y,_){const b=_.B,A={l:y,L:_,B:b};_.B=A,b.L=A,_===this.h&&(this.p=A),b===this.h&&(this._=A),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return _.l}eraseElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return this.V(_),this.i}eraseElementByValue(y){let _=this.p;for(;_!==this.h;)_.l===y&&this.V(_),_=_.B;return this.i}eraseElementByIterator(y){const _=y.o;return _===this.h&&(0,f.throwIteratorAccessError)(),y=y.next(),this.V(_),y}pushBack(y){return this.G(y,this._),this.i}popBack(){if(this.i===0)return;const y=this._.l;return this.V(this._),y}pushFront(y){return this.G(y,this.h),this.i}popFront(){if(this.i===0)return;const y=this.p.l;return this.V(this.p),y}setElementByPos(y,_){if(y<0||y>this.i-1)throw new RangeError;let b=this.p;for(;y--;)b=b.B;b.l=_}insert(y,_,b=1){if(y<0||y>this.i)throw new RangeError;if(b<=0)return this.i;if(y===0)for(;b--;)this.pushFront(_);else if(y===this.i)for(;b--;)this.pushBack(_);else{let A=this.p;for(let T=1;T<y;++T)A=A.B;const w=A.B;for(this.i+=b;b--;)A.B={l:_,L:A},A.B.L=A,A=A.B;A.B=w,w.L=A}return this.i}find(y){let _=this.p;for(;_!==this.h;){if(_.l===y)return new h(_,this.h,this);_=_.B}return this.end()}reverse(){if(this.i<=1)return;let y=this.p,_=this._,b=0;for(;b<<1<this.i;){const A=y.l;y.l=_.l,_.l=A,y=y.B,_=_.L,b+=1}}unique(){if(this.i<=1)return this.i;let y=this.p;for(;y!==this.h;){let _=y;for(;_.B!==this.h&&_.l===_.B.l;)_=_.B,this.i-=1;y.B=_.B,y.B.L=y,y=y.B}return this.i}sort(y){if(this.i<=1)return;const _=[];this.forEach(function(A){_.push(A)}),_.sort(y);let b=this.p;_.forEach(function(A){b.l=A,b=b.B})}merge(y){const _=this;if(this.i===0)y.forEach(function(b){_.pushBack(b)});else{let b=this.p;y.forEach(function(A){for(;b!==_.h&&b.l<=A;)b=b.B;_.G(A,b.L)})}return this.i}forEach(y){let _=this.p,b=0;for(;_!==this.h;)y(_.l,b++,this),_=_.B}[Symbol.iterator](){return function*(){if(this.i===0)return;let y=this.p;for(;y!==this.h;)yield y.l,y=y.B}.bind(this)()}}var g=v;a.default=g},{"../../utils/throwError":71,"../ContainerBase":52,"./Base":60}],63:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(i("./Base")),c=i("./Base/RandomIterator");function f(g){return g&&g.t?g:{default:g}}class d extends c.RandomIterator{constructor(p,y,_){super(p,_),this.container=y}copy(){return new d(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],y=!0){if(super(),Array.isArray(p))this.J=y?[...p]:p,this.i=p.length;else{this.J=[];const _=this;p.forEach(function(b){_.pushBack(b)})}}clear(){this.i=0,this.J.length=0}begin(){return new d(0,this)}end(){return new d(this.i,this)}rBegin(){return new d(this.i-1,this,1)}rEnd(){return new d(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J[p]}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J.splice(p,1),this.i-=1,this.i}eraseElementByValue(p){let y=0;for(let _=0;_<this.i;++_)this.J[_]!==p&&(this.J[y++]=this.J[_]);return this.i=this.J.length=y,this.i}eraseElementByIterator(p){const y=p.o;return p=p.next(),this.eraseElementByPos(y),p}pushBack(p){return this.J.push(p),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(p,y){if(p<0||p>this.i-1)throw new RangeError;this.J[p]=y}insert(p,y,_=1){if(p<0||p>this.i)throw new RangeError;return this.J.splice(p,0,...new Array(_).fill(y)),this.i+=_,this.i}find(p){for(let y=0;y<this.i;++y)if(this.J[y]===p)return new d(y,this);return this.end()}reverse(){this.J.reverse()}unique(){let p=1;for(let y=1;y<this.i;++y)this.J[y]!==this.J[y-1]&&(this.J[p++]=this.J[y]);return this.i=this.J.length=p,this.i}sort(p){this.J.sort(p)}forEach(p){for(let y=0;y<this.i;++y)p(this.J[y],y,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}}var v=h;a.default=v},{"./Base":60,"./Base/RandomIterator":59}],64:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../../ContainerBase"),c=i("../../../utils/throwError");class f extends u.ContainerIterator{constructor(v,g,p){super(p),this.o=v,this.h=g,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let v=this.o;const g=this.h.tt;if(v===this.h)return g?g.rt-1:0;let p=0;for(v.U&&(p+=v.U.rt);v!==g;){const y=v.tt;v===y.W&&(p+=1,y.U&&(p+=y.U.rt)),v=y}return p}}var d=f;a.default=d},{"../../../utils/throwError":71,"../../ContainerBase":52}],65:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.TreeNodeEnableIndex=a.TreeNode=void 0;class u{constructor(d,h){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=d,this.l=h}L(){let d=this;if(d.ee===1&&d.tt.tt===d)d=d.W;else if(d.U)for(d=d.U;d.W;)d=d.W;else{let h=d.tt;for(;h.U===d;)d=h,h=d.tt;d=h}return d}B(){let d=this;if(d.W){for(d=d.W;d.U;)d=d.U;return d}else{let h=d.tt;for(;h.W===d;)d=h,h=d.tt;return d.W!==h?h:d}}te(){const d=this.tt,h=this.W,v=h.U;return d.tt===this?d.tt=h:d.U===this?d.U=h:d.W=h,h.tt=d,h.U=this,this.tt=h,this.W=v,v&&(v.tt=this),h}se(){const d=this.tt,h=this.U,v=h.W;return d.tt===this?d.tt=h:d.U===this?d.U=h:d.W=h,h.tt=d,h.W=this,this.tt=h,this.U=v,v&&(v.tt=this),h}}a.TreeNode=u;class c extends u{constructor(){super(...arguments),this.rt=1}te(){const d=super.te();return this.ie(),d.ie(),d}se(){const d=super.se();return this.ie(),d.ie(),d}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}a.TreeNodeEnableIndex=c},{}],66:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./TreeNode"),c=i("../../ContainerBase"),f=i("../../../utils/throwError");class d extends c.Container{constructor(g=function(y,_){return y<_?-1:y>_?1:0},p=!1){super(),this.Y=void 0,this.v=g,p?(this.re=u.TreeNodeEnableIndex,this.M=function(y,_,b){const A=this.ne(y,_,b);if(A){let w=A.tt;for(;w!==this.h;)w.rt+=1,w=w.tt;const T=this.he(A);if(T){const{parentNode:S,grandParent:x,curNode:O}=T;S.ie(),x.ie(),O.ie()}}return this.i},this.V=function(y){let _=this.fe(y);for(;_!==this.h;)_.rt-=1,_=_.tt}):(this.re=u.TreeNode,this.M=function(y,_,b){const A=this.ne(y,_,b);return A&&this.he(A),this.i},this.V=this.fe),this.h=new this.re}X(g,p){let y=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)g=g.W;else if(_>0)y=g,g=g.U;else return g}return y}Z(g,p){let y=this.h;for(;g;)this.v(g.u,p)<=0?g=g.W:(y=g,g=g.U);return y}$(g,p){let y=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)y=g,g=g.W;else if(_>0)g=g.U;else return g}return y}rr(g,p){let y=this.h;for(;g;)this.v(g.u,p)<0?(y=g,g=g.W):g=g.U;return y}ue(g){for(;;){const p=g.tt;if(p===this.h)return;if(g.ee===1){g.ee=0;return}if(g===p.U){const y=p.W;if(y.ee===1)y.ee=0,p.ee=1,p===this.Y?this.Y=p.te():p.te();else if(y.W&&y.W.ee===1){y.ee=p.ee,p.ee=0,y.W.ee=0,p===this.Y?this.Y=p.te():p.te();return}else y.U&&y.U.ee===1?(y.ee=1,y.U.ee=0,y.se()):(y.ee=1,g=p)}else{const y=p.U;if(y.ee===1)y.ee=0,p.ee=1,p===this.Y?this.Y=p.se():p.se();else if(y.U&&y.U.ee===1){y.ee=p.ee,p.ee=0,y.U.ee=0,p===this.Y?this.Y=p.se():p.se();return}else y.W&&y.W.ee===1?(y.ee=1,y.W.ee=0,y.te()):(y.ee=1,g=p)}}}fe(g){if(this.i===1)return this.clear(),this.h;let p=g;for(;p.U||p.W;){if(p.W)for(p=p.W;p.U;)p=p.U;else p=p.U;[g.u,p.u]=[p.u,g.u],[g.l,p.l]=[p.l,g.l],g=p}this.h.U===p?this.h.U=p.tt:this.h.W===p&&(this.h.W=p.tt),this.ue(p);const y=p.tt;return p===y.U?y.U=void 0:y.W=void 0,this.i-=1,this.Y.ee=0,y}oe(g,p){return g===void 0?!1:this.oe(g.U,p)||p(g)?!0:this.oe(g.W,p)}he(g){for(;;){const p=g.tt;if(p.ee===0)return;const y=p.tt;if(p===y.U){const _=y.W;if(_&&_.ee===1){if(_.ee=p.ee=0,y===this.Y)return;y.ee=1,g=y;continue}else if(g===p.W){if(g.ee=0,g.U&&(g.U.tt=p),g.W&&(g.W.tt=y),p.W=g.U,y.U=g.W,g.U=p,g.W=y,y===this.Y)this.Y=g,this.h.tt=g;else{const b=y.tt;b.U===y?b.U=g:b.W=g}return g.tt=y.tt,p.tt=g,y.tt=g,y.ee=1,{parentNode:p,grandParent:y,curNode:g}}else p.ee=0,y===this.Y?this.Y=y.se():y.se(),y.ee=1}else{const _=y.U;if(_&&_.ee===1){if(_.ee=p.ee=0,y===this.Y)return;y.ee=1,g=y;continue}else if(g===p.U){if(g.ee=0,g.U&&(g.U.tt=y),g.W&&(g.W.tt=p),y.W=g.U,p.U=g.W,g.U=y,g.W=p,y===this.Y)this.Y=g,this.h.tt=g;else{const b=y.tt;b.U===y?b.U=g:b.W=g}return g.tt=y.tt,p.tt=g,y.tt=g,y.ee=1,{parentNode:p,grandParent:y,curNode:g}}else p.ee=0,y===this.Y?this.Y=y.te():y.te(),y.ee=1}return}}ne(g,p,y){if(this.Y===void 0){this.i+=1,this.Y=new this.re(g,p),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let _;const b=this.h.U,A=this.v(b.u,g);if(A===0){b.l=p;return}else if(A>0)b.U=new this.re(g,p),b.U.tt=b,_=b.U,this.h.U=_;else{const w=this.h.W,T=this.v(w.u,g);if(T===0){w.l=p;return}else if(T<0)w.W=new this.re(g,p),w.W.tt=w,_=w.W,this.h.W=_;else{if(y!==void 0){const S=y.o;if(S!==this.h){const x=this.v(S.u,g);if(x===0){S.l=p;return}else if(x>0){const O=S.L(),L=this.v(O.u,g);if(L===0){O.l=p;return}else L<0&&(_=new this.re(g,p),O.W===void 0?(O.W=_,_.tt=O):(S.U=_,_.tt=S))}}}if(_===void 0)for(_=this.Y;;){const S=this.v(_.u,g);if(S>0){if(_.U===void 0){_.U=new this.re(g,p),_.U.tt=_,_=_.U;break}_=_.U}else if(S<0){if(_.W===void 0){_.W=new this.re(g,p),_.W.tt=_,_=_.W;break}_=_.W}else{_.l=p;return}}}}return this.i+=1,_}I(g,p){for(;g;){const y=this.v(g.u,p);if(y<0)g=g.W;else if(y>0)g=g.U;else return g}return g||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(g,p){const y=g.o;if(y===this.h&&(0,f.throwIteratorAccessError)(),this.i===1)return y.u=p,!0;if(y===this.h.U)return this.v(y.B().u,p)>0?(y.u=p,!0):!1;if(y===this.h.W)return this.v(y.L().u,p)<0?(y.u=p,!0):!1;const _=y.L().u;if(this.v(_,p)>=0)return!1;const b=y.B().u;return this.v(b,p)<=0?!1:(y.u=p,!0)}eraseElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=0;const y=this;return this.oe(this.Y,function(_){return g===p?(y.V(_),!0):(p+=1,!1)}),this.i}eraseElementByKey(g){if(this.i===0)return!1;const p=this.I(this.Y,g);return p===this.h?!1:(this.V(p),!0)}eraseElementByIterator(g){const p=g.o;p===this.h&&(0,f.throwIteratorAccessError)();const y=p.W===void 0;return g.iteratorType===0?y&&g.next():(!y||p.U===void 0)&&g.next(),this.V(p),g}forEach(g){let p=0;for(const y of this)g(y,p++,this)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p,y=0;for(const _ of this){if(y===g){p=_;break}y+=1}return p}getHeight(){if(this.i===0)return 0;const g=function(p){return p?Math.max(g(p.U),g(p.W))+1:0};return g(this.Y)}}var h=d;a.default=h},{"../../../utils/throwError":71,"../../ContainerBase":52,"./TreeNode":65}],67:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=d(i("./Base/TreeIterator")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){this.o===this.h&&(0,f.throwIteratorAccessError)();const y=this;return new Proxy([],{get(_,b){if(b==="0")return y.o.u;if(b==="1")return y.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return y.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[],_,b){super(_,b);const A=this;y.forEach(function(w){A.setElement(w[0],w[1])})}*K(y){y!==void 0&&(yield*this.K(y.U),yield[y.u,y.l],yield*this.K(y.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i===0)return;const y=this.h.U;return[y.u,y.l]}back(){if(this.i===0)return;const y=this.h.W;return[y.u,y.l]}lowerBound(y){const _=this.X(this.Y,y);return new h(_,this.h,this)}upperBound(y){const _=this.Z(this.Y,y);return new h(_,this.h,this)}reverseLowerBound(y){const _=this.$(this.Y,y);return new h(_,this.h,this)}reverseUpperBound(y){const _=this.rr(this.Y,y);return new h(_,this.h,this)}setElement(y,_,b){return this.M(y,_,b)}find(y){const _=this.I(this.Y,y);return new h(_,this.h,this)}getElementByKey(y){return this.I(this.Y,y).l}union(y){const _=this;return y.forEach(function(b){_.setElement(b[0],b[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=v;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],68:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=d(i("./Base/TreeIterator")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.u}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[],_,b){super(_,b);const A=this;y.forEach(function(w){A.insert(w)})}*K(y){y!==void 0&&(yield*this.K(y.U),yield y.u,yield*this.K(y.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(y,_){return this.M(y,void 0,_)}find(y){const _=this.I(this.Y,y);return new h(_,this.h,this)}lowerBound(y){const _=this.X(this.Y,y);return new h(_,this.h,this)}upperBound(y){const _=this.Z(this.Y,y);return new h(_,this.h,this)}reverseLowerBound(y){const _=this.$(this.Y,y);return new h(_,this.h,this)}reverseUpperBound(y){const _=this.rr(this.Y,y);return new h(_,this.h,this)}union(y){const _=this;return y.forEach(function(b){_.insert(b)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=v;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],69:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),Object.defineProperty(a,"Deque",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(a,"HashMap",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(a,"HashSet",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(a,"LinkList",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(a,"OrderedMap",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(a,"OrderedSet",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(a,"PriorityQueue",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(a,"Queue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(a,"Stack",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(a,"Vector",{enumerable:!0,get:function(){return d.default}});var u=b(i("./container/OtherContainer/Stack")),c=b(i("./container/OtherContainer/Queue")),f=b(i("./container/OtherContainer/PriorityQueue")),d=b(i("./container/SequentialContainer/Vector")),h=b(i("./container/SequentialContainer/LinkList")),v=b(i("./container/SequentialContainer/Deque")),g=b(i("./container/TreeContainer/OrderedSet")),p=b(i("./container/TreeContainer/OrderedMap")),y=b(i("./container/HashContainer/HashSet")),_=b(i("./container/HashContainer/HashMap"));function b(A){return A&&A.t?A:{default:A}}},{"./container/HashContainer/HashMap":54,"./container/HashContainer/HashSet":55,"./container/OtherContainer/PriorityQueue":56,"./container/OtherContainer/Queue":57,"./container/OtherContainer/Stack":58,"./container/SequentialContainer/Deque":61,"./container/SequentialContainer/LinkList":62,"./container/SequentialContainer/Vector":63,"./container/TreeContainer/OrderedMap":67,"./container/TreeContainer/OrderedSet":68}],70:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=u;function u(c){const f=typeof c;return f==="object"&&c!==null||f==="function"}},{}],71:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.throwIteratorAccessError=u;function u(){throw new RangeError("Iterator access denied!")}},{}],72:[function(i,o,a){(function(u){(function(){const c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,d=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(F=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||F,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},h=typeof AbortSignal=="function",v=typeof d.AbortSignal=="function",g=h?AbortSignal:v?d.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(F){F.type==="abort"&&(this.aborted=!0,this.onabort(F),this._listeners.forEach(j=>j(F),this))}onabort(){}addEventListener(F,j){F==="abort"&&this._listeners.push(j)}removeEventListener(F,j){F==="abort"&&(this._listeners=this._listeners.filter(V=>V!==j))}},p=new Set,y=(re,F)=>{const j=`LRU_CACHE_OPTION_${re}`;w(j)&&T(j,`${re} option`,`options.${F}`,M)},_=(re,F)=>{const j=`LRU_CACHE_METHOD_${re}`;if(w(j)){const{prototype:V}=M,{get:z}=Object.getOwnPropertyDescriptor(V,re);T(j,`${re} method`,`cache.${F}()`,z)}},b=(re,F)=>{const j=`LRU_CACHE_PROPERTY_${re}`;if(w(j)){const{prototype:V}=M,{get:z}=Object.getOwnPropertyDescriptor(V,re);T(j,`${re} property`,`cache.${F}`,z)}},A=(...re)=>{typeof u=="object"&&u&&typeof u.emitWarning=="function"?u.emitWarning(...re):console.error(...re)},w=re=>!p.has(re),T=(re,F,j,V)=>{p.add(re);const z=`The ${F} is deprecated. Please use ${j} instead.`;A(z,"DeprecationWarning",re,V)},S=re=>re&&re===Math.floor(re)&&re>0&&isFinite(re),x=re=>S(re)?re<=Math.pow(2,8)?Uint8Array:re<=Math.pow(2,16)?Uint16Array:re<=Math.pow(2,32)?Uint32Array:re<=Number.MAX_SAFE_INTEGER?O:null:null;class O extends Array{constructor(F){super(F),this.fill(0)}}class L{constructor(F){if(F===0)return[];const j=x(F);this.heap=new j(F),this.length=0}push(F){this.heap[this.length++]=F}pop(){return this.heap[--this.length]}}class M{constructor(F={}){const{max:j=0,ttl:V,ttlResolution:z=1,ttlAutopurge:$,updateAgeOnGet:he,updateAgeOnHas:le,allowStale:Ie,dispose:Fe,disposeAfter:pe,noDisposeOnSet:Lt,noUpdateTTL:_e,maxSize:Et=0,maxEntrySize:Cn=0,sizeCalculation:vn,fetchMethod:Dt,fetchContext:de,noDeleteOnFetchRejection:qe,noDeleteOnStaleGet:Pt,allowStaleOnFetchRejection:In,allowStaleOnFetchAbort:$e,ignoreFetchAbort:Ce}=F,{length:ue,maxAge:At,stale:Ne}=F instanceof M?{}:F;if(j!==0&&!S(j))throw new TypeError("max option must be a nonnegative integer");const Oe=j?x(j):Array;if(!Oe)throw new Error("invalid max value: "+j);if(this.max=j,this.maxSize=Et,this.maxEntrySize=Cn||this.maxSize,this.sizeCalculation=vn||ue,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=Dt||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=de,!this.fetchMethod&&de!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(j).fill(null),this.valList=new Array(j).fill(null),this.next=new Oe(j),this.prev=new Oe(j),this.head=0,this.tail=0,this.free=new L(j),this.initialFill=1,this.size=0,typeof Fe=="function"&&(this.dispose=Fe),typeof pe=="function"?(this.disposeAfter=pe,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!Lt,this.noUpdateTTL=!!_e,this.noDeleteOnFetchRejection=!!qe,this.allowStaleOnFetchRejection=!!In,this.allowStaleOnFetchAbort=!!$e,this.ignoreFetchAbort=!!Ce,this.maxEntrySize!==0){if(this.maxSize!==0&&!S(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!S(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!Ie||!!Ne,this.noDeleteOnStaleGet=!!Pt,this.updateAgeOnGet=!!he,this.updateAgeOnHas=!!le,this.ttlResolution=S(z)||z===0?z:1,this.ttlAutopurge=!!$,this.ttl=V||At||0,this.ttl){if(!S(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const kt="LRU_CACHE_UNBOUNDED";w(kt)&&(p.add(kt),A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",kt,M))}Ne&&y("stale","allowStale"),At&&y("maxAge","ttl"),ue&&y("length","sizeCalculation")}getRemainingTTL(F){return this.has(F,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new O(this.max),this.starts=new O(this.max),this.setItemTTL=(V,z,$=c.now())=>{if(this.starts[V]=z!==0?$:0,this.ttls[V]=z,z!==0&&this.ttlAutopurge){const he=setTimeout(()=>{this.isStale(V)&&this.delete(this.keyList[V])},z+1);he.unref&&he.unref()}},this.updateItemAge=V=>{this.starts[V]=this.ttls[V]!==0?c.now():0},this.statusTTL=(V,z)=>{V&&(V.ttl=this.ttls[z],V.start=this.starts[z],V.now=F||j(),V.remainingTTL=V.now+V.ttl-V.start)};let F=0;const j=()=>{const V=c.now();if(this.ttlResolution>0){F=V;const z=setTimeout(()=>F=0,this.ttlResolution);z.unref&&z.unref()}return V};this.getRemainingTTL=V=>{const z=this.keyMap.get(V);return z===void 0?0:this.ttls[z]===0||this.starts[z]===0?1/0:this.starts[z]+this.ttls[z]-(F||j())},this.isStale=V=>this.ttls[V]!==0&&this.starts[V]!==0&&(F||j())-this.starts[V]>this.ttls[V]}updateItemAge(F){}statusTTL(F,j){}setItemTTL(F,j,V){}isStale(F){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new O(this.max),this.removeItemSize=F=>{this.calculatedSize-=this.sizes[F],this.sizes[F]=0},this.requireSize=(F,j,V,z)=>{if(this.isBackgroundFetch(j))return 0;if(!S(V))if(z){if(typeof z!="function")throw new TypeError("sizeCalculation must be a function");if(V=z(j,F),!S(V))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V},this.addItemSize=(F,j,V)=>{if(this.sizes[F]=j,this.maxSize){const z=this.maxSize-this.sizes[F];for(;this.calculatedSize>z;)this.evict(!0)}this.calculatedSize+=this.sizes[F],V&&(V.entrySize=j,V.totalCalculatedSize=this.calculatedSize)}}removeItemSize(F){}addItemSize(F,j){}requireSize(F,j,V,z){if(V||z)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:F=this.allowStale}={}){if(this.size)for(let j=this.tail;!(!this.isValidIndex(j)||((F||!this.isStale(j))&&(yield j),j===this.head));)j=this.prev[j]}*rindexes({allowStale:F=this.allowStale}={}){if(this.size)for(let j=this.head;!(!this.isValidIndex(j)||((F||!this.isStale(j))&&(yield j),j===this.tail));)j=this.next[j]}isValidIndex(F){return F!==void 0&&this.keyMap.get(this.keyList[F])===F}*entries(){for(const F of this.indexes())this.valList[F]!==void 0&&this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield[this.keyList[F],this.valList[F]])}*rentries(){for(const F of this.rindexes())this.valList[F]!==void 0&&this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield[this.keyList[F],this.valList[F]])}*keys(){for(const F of this.indexes())this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.keyList[F])}*rkeys(){for(const F of this.rindexes())this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.keyList[F])}*values(){for(const F of this.indexes())this.valList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.valList[F])}*rvalues(){for(const F of this.rindexes())this.valList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.valList[F])}[Symbol.iterator](){return this.entries()}find(F,j){for(const V of this.indexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;if($!==void 0&&F($,this.keyList[V],this))return this.get(this.keyList[V],j)}}forEach(F,j=this){for(const V of this.indexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;$!==void 0&&F.call(j,$,this.keyList[V],this)}}rforEach(F,j=this){for(const V of this.rindexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;$!==void 0&&F.call(j,$,this.keyList[V],this)}}get prune(){return _("prune","purgeStale"),this.purgeStale}purgeStale(){let F=!1;for(const j of this.rindexes({allowStale:!0}))this.isStale(j)&&(this.delete(this.keyList[j]),F=!0);return F}dump(){const F=[];for(const j of this.indexes({allowStale:!0})){const V=this.keyList[j],z=this.valList[j],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;if($===void 0)continue;const he={value:$};if(this.ttls){he.ttl=this.ttls[j];const le=c.now()-this.starts[j];he.start=Math.floor(Date.now()-le)}this.sizes&&(he.size=this.sizes[j]),F.unshift([V,he])}return F}load(F){this.clear();for(const[j,V]of F){if(V.start){const z=Date.now()-V.start;V.start=c.now()-z}this.set(j,V.value,V)}}dispose(F,j,V){}set(F,j,{ttl:V=this.ttl,start:z,noDisposeOnSet:$=this.noDisposeOnSet,size:he=0,sizeCalculation:le=this.sizeCalculation,noUpdateTTL:Ie=this.noUpdateTTL,status:Fe}={}){if(he=this.requireSize(F,j,he,le),this.maxEntrySize&&he>this.maxEntrySize)return Fe&&(Fe.set="miss",Fe.maxEntrySizeExceeded=!0),this.delete(F),this;let pe=this.size===0?void 0:this.keyMap.get(F);if(pe===void 0)pe=this.newIndex(),this.keyList[pe]=F,this.valList[pe]=j,this.keyMap.set(F,pe),this.next[this.tail]=pe,this.prev[pe]=this.tail,this.tail=pe,this.size++,this.addItemSize(pe,he,Fe),Fe&&(Fe.set="add"),Ie=!1;else{this.moveToTail(pe);const Lt=this.valList[pe];if(j!==Lt){if(this.isBackgroundFetch(Lt)?Lt.__abortController.abort(new Error("replaced")):$||(this.dispose(Lt,F,"set"),this.disposeAfter&&this.disposed.push([Lt,F,"set"])),this.removeItemSize(pe),this.valList[pe]=j,this.addItemSize(pe,he,Fe),Fe){Fe.set="replace";const _e=Lt&&this.isBackgroundFetch(Lt)?Lt.__staleWhileFetching:Lt;_e!==void 0&&(Fe.oldValue=_e)}}else Fe&&(Fe.set="update")}if(V!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),Ie||this.setItemTTL(pe,V,z),this.statusTTL(Fe,pe),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const F=this.valList[this.head];return this.evict(!0),F}}evict(F){const j=this.head,V=this.keyList[j],z=this.valList[j];return this.isBackgroundFetch(z)?z.__abortController.abort(new Error("evicted")):(this.dispose(z,V,"evict"),this.disposeAfter&&this.disposed.push([z,V,"evict"])),this.removeItemSize(j),F&&(this.keyList[j]=null,this.valList[j]=null,this.free.push(j)),this.head=this.next[j],this.keyMap.delete(V),this.size--,j}has(F,{updateAgeOnHas:j=this.updateAgeOnHas,status:V}={}){const z=this.keyMap.get(F);if(z!==void 0)if(this.isStale(z))V&&(V.has="stale",this.statusTTL(V,z));else return j&&this.updateItemAge(z),V&&(V.has="hit"),this.statusTTL(V,z),!0;else V&&(V.has="miss");return!1}peek(F,{allowStale:j=this.allowStale}={}){const V=this.keyMap.get(F);if(V!==void 0&&(j||!this.isStale(V))){const z=this.valList[V];return this.isBackgroundFetch(z)?z.__staleWhileFetching:z}}backgroundFetch(F,j,V,z){const $=j===void 0?void 0:this.valList[j];if(this.isBackgroundFetch($))return $;const he=new d;V.signal&&V.signal.addEventListener("abort",()=>he.abort(V.signal.reason));const le={signal:he.signal,options:V,context:z},Ie=(Et,Cn=!1)=>{const{aborted:vn}=he.signal,Dt=V.ignoreFetchAbort&&Et!==void 0;return V.status&&(vn&&!Cn?(V.status.fetchAborted=!0,V.status.fetchError=he.signal.reason,Dt&&(V.status.fetchAbortIgnored=!0)):V.status.fetchResolved=!0),vn&&!Dt&&!Cn?pe(he.signal.reason):(this.valList[j]===_e&&(Et===void 0?_e.__staleWhileFetching?this.valList[j]=_e.__staleWhileFetching:this.delete(F):(V.status&&(V.status.fetchUpdated=!0),this.set(F,Et,le.options))),Et)},Fe=Et=>(V.status&&(V.status.fetchRejected=!0,V.status.fetchError=Et),pe(Et)),pe=Et=>{const{aborted:Cn}=he.signal,vn=Cn&&V.allowStaleOnFetchAbort,Dt=vn||V.allowStaleOnFetchRejection,de=Dt||V.noDeleteOnFetchRejection;if(this.valList[j]===_e&&(!de||_e.__staleWhileFetching===void 0?this.delete(F):vn||(this.valList[j]=_e.__staleWhileFetching)),Dt)return V.status&&_e.__staleWhileFetching!==void 0&&(V.status.returnedStale=!0),_e.__staleWhileFetching;if(_e.__returned===_e)throw Et},Lt=(Et,Cn)=>{this.fetchMethod(F,$,le).then(vn=>Et(vn),Cn),he.signal.addEventListener("abort",()=>{(!V.ignoreFetchAbort||V.allowStaleOnFetchAbort)&&(Et(),V.allowStaleOnFetchAbort&&(Et=vn=>Ie(vn,!0)))})};V.status&&(V.status.fetchDispatched=!0);const _e=new Promise(Lt).then(Ie,Fe);return _e.__abortController=he,_e.__staleWhileFetching=$,_e.__returned=null,j===void 0?(this.set(F,_e,{...le.options,status:void 0}),j=this.keyMap.get(F)):this.valList[j]=_e,_e}isBackgroundFetch(F){return F&&typeof F=="object"&&typeof F.then=="function"&&Object.prototype.hasOwnProperty.call(F,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(F,"__returned")&&(F.__returned===F||F.__returned===null)}async fetch(F,{allowStale:j=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,ttl:$=this.ttl,noDisposeOnSet:he=this.noDisposeOnSet,size:le=0,sizeCalculation:Ie=this.sizeCalculation,noUpdateTTL:Fe=this.noUpdateTTL,noDeleteOnFetchRejection:pe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Lt=this.allowStaleOnFetchRejection,ignoreFetchAbort:_e=this.ignoreFetchAbort,allowStaleOnFetchAbort:Et=this.allowStaleOnFetchAbort,fetchContext:Cn=this.fetchContext,forceRefresh:vn=!1,status:Dt,signal:de}={}){if(!this.fetchMethod)return Dt&&(Dt.fetch="get"),this.get(F,{allowStale:j,updateAgeOnGet:V,noDeleteOnStaleGet:z,status:Dt});const qe={allowStale:j,updateAgeOnGet:V,noDeleteOnStaleGet:z,ttl:$,noDisposeOnSet:he,size:le,sizeCalculation:Ie,noUpdateTTL:Fe,noDeleteOnFetchRejection:pe,allowStaleOnFetchRejection:Lt,allowStaleOnFetchAbort:Et,ignoreFetchAbort:_e,status:Dt,signal:de};let Pt=this.keyMap.get(F);if(Pt===void 0){Dt&&(Dt.fetch="miss");const In=this.backgroundFetch(F,Pt,qe,Cn);return In.__returned=In}else{const In=this.valList[Pt];if(this.isBackgroundFetch(In)){const Ne=j&&In.__staleWhileFetching!==void 0;return Dt&&(Dt.fetch="inflight",Ne&&(Dt.returnedStale=!0)),Ne?In.__staleWhileFetching:In.__returned=In}const $e=this.isStale(Pt);if(!vn&&!$e)return Dt&&(Dt.fetch="hit"),this.moveToTail(Pt),V&&this.updateItemAge(Pt),this.statusTTL(Dt,Pt),In;const Ce=this.backgroundFetch(F,Pt,qe,Cn),ue=Ce.__staleWhileFetching!==void 0,At=ue&&j;return Dt&&(Dt.fetch=ue&&$e?"stale":"refresh",At&&$e&&(Dt.returnedStale=!0)),At?Ce.__staleWhileFetching:Ce.__returned=Ce}}get(F,{allowStale:j=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,status:$}={}){const he=this.keyMap.get(F);if(he!==void 0){const le=this.valList[he],Ie=this.isBackgroundFetch(le);return this.statusTTL($,he),this.isStale(he)?($&&($.get="stale"),Ie?($&&($.returnedStale=j&&le.__staleWhileFetching!==void 0),j?le.__staleWhileFetching:void 0):(z||this.delete(F),$&&($.returnedStale=j),j?le:void 0)):($&&($.get="hit"),Ie?le.__staleWhileFetching:(this.moveToTail(he),V&&this.updateItemAge(he),le))}else $&&($.get="miss")}connect(F,j){this.prev[j]=F,this.next[F]=j}moveToTail(F){F!==this.tail&&(F===this.head?this.head=this.next[F]:this.connect(this.prev[F],this.next[F]),this.connect(this.tail,F),this.tail=F)}get del(){return _("del","delete"),this.delete}delete(F){let j=!1;if(this.size!==0){const V=this.keyMap.get(F);if(V!==void 0)if(j=!0,this.size===1)this.clear();else{this.removeItemSize(V);const z=this.valList[V];this.isBackgroundFetch(z)?z.__abortController.abort(new Error("deleted")):(this.dispose(z,F,"delete"),this.disposeAfter&&this.disposed.push([z,F,"delete"])),this.keyMap.delete(F),this.keyList[V]=null,this.valList[V]=null,V===this.tail?this.tail=this.prev[V]:V===this.head?this.head=this.next[V]:(this.next[this.prev[V]]=this.next[V],this.prev[this.next[V]]=this.prev[V]),this.size--,this.free.push(V)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return j}clear(){for(const F of this.rindexes({allowStale:!0})){const j=this.valList[F];if(this.isBackgroundFetch(j))j.__abortController.abort(new Error("deleted"));else{const V=this.keyList[F];this.dispose(j,V,"delete"),this.disposeAfter&&this.disposed.push([j,V,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return _("reset","clear"),this.clear}get length(){return b("length","size"),this.size}static get AbortController(){return d}static get AbortSignal(){return g}}o.exports=M}).call(this)}).call(this,i("_process"))},{_process:102}],73:[function(i,o,a){const u=o.exports,{Buffer:c}=i("buffer");u.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},u.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},u.requiredHeaderFlagsErrors={};for(const d in u.requiredHeaderFlags){const h=u.requiredHeaderFlags[d];u.requiredHeaderFlagsErrors[d]="Invalid header flag bits, must be 0x"+h.toString(16)+" for "+u.types[d]+" packet"}u.codes={};for(const d in u.types){const h=u.types[d];u.codes[h]=d}u.CMD_SHIFT=4,u.CMD_MASK=240,u.DUP_MASK=8,u.QOS_MASK=3,u.QOS_SHIFT=1,u.RETAIN_MASK=1,u.VARBYTEINT_MASK=127,u.VARBYTEINT_FIN_MASK=128,u.VARBYTEINT_MAX=268435455,u.SESSIONPRESENT_MASK=1,u.SESSIONPRESENT_HEADER=c.from([u.SESSIONPRESENT_MASK]),u.CONNACK_HEADER=c.from([u.codes.connack<<u.CMD_SHIFT]),u.USERNAME_MASK=128,u.PASSWORD_MASK=64,u.WILL_RETAIN_MASK=32,u.WILL_QOS_MASK=24,u.WILL_QOS_SHIFT=3,u.WILL_FLAG_MASK=4,u.CLEAN_SESSION_MASK=2,u.CONNECT_HEADER=c.from([u.codes.connect<<u.CMD_SHIFT]),u.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},u.propertiesCodes={};for(const d in u.properties){const h=u.properties[d];u.propertiesCodes[h]=d}u.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function f(d){return[0,1,2].map(h=>[0,1].map(v=>[0,1].map(g=>{const p=c.alloc(1);return p.writeUInt8(u.codes[d]<<u.CMD_SHIFT|(v?u.DUP_MASK:0)|h<<u.QOS_SHIFT|g,0,!0),p})))}u.PUBLISH_HEADER=f("publish"),u.SUBSCRIBE_HEADER=f("subscribe"),u.SUBSCRIBE_OPTIONS_QOS_MASK=3,u.SUBSCRIBE_OPTIONS_NL_MASK=1,u.SUBSCRIBE_OPTIONS_NL_SHIFT=2,u.SUBSCRIBE_OPTIONS_RAP_MASK=1,u.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,u.SUBSCRIBE_OPTIONS_RH_MASK=3,u.SUBSCRIBE_OPTIONS_RH_SHIFT=4,u.SUBSCRIBE_OPTIONS_RH=[0,16,32],u.SUBSCRIBE_OPTIONS_NL=4,u.SUBSCRIBE_OPTIONS_RAP=8,u.SUBSCRIBE_OPTIONS_QOS=[0,1,2],u.UNSUBSCRIBE_HEADER=f("unsubscribe"),u.ACKS={unsuback:f("unsuback"),puback:f("puback"),pubcomp:f("pubcomp"),pubrel:f("pubrel"),pubrec:f("pubrec")},u.SUBACK_HEADER=c.from([u.codes.suback<<u.CMD_SHIFT]),u.VERSION3=c.from([3]),u.VERSION4=c.from([4]),u.VERSION5=c.from([5]),u.VERSION131=c.from([131]),u.VERSION132=c.from([132]),u.QOS=[0,1,2].map(d=>c.from([d])),u.EMPTY={pingreq:c.from([u.codes.pingreq<<4,0]),pingresp:c.from([u.codes.pingresp<<4,0]),disconnect:c.from([u.codes.disconnect<<4,0])},u.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},u.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},u.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},u.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},{buffer:29}],74:[function(i,o,a){const u=i("./writeToStream"),c=i("events"),{Buffer:f}=i("buffer");function d(v,g){const p=new h;return u(v,p,g),p.concat()}class h extends c{constructor(){super(),this._array=new Array(20),this._i=0}write(g){return this._array[this._i++]=g,!0}concat(){let g=0;const p=new Array(this._array.length),y=this._array;let _=0,b;for(b=0;b<y.length&&y[b]!==void 0;b++)typeof y[b]!="string"?p[b]=y[b].length:p[b]=f.byteLength(y[b]),g+=p[b];const A=f.allocUnsafe(g);for(b=0;b<y.length&&y[b]!==void 0;b++)typeof y[b]!="string"?(y[b].copy(A,_),_+=p[b]):(A.write(y[b],_),_+=p[b]);return A}destroy(g){g&&this.emit("error",g)}}o.exports=d},{"./writeToStream":96,buffer:29,events:49}],75:[function(i,o,a){a.parser=i("./parser").parser,a.generate=i("./generate"),a.writeToStream=i("./writeToStream")},{"./generate":74,"./parser":95,"./writeToStream":96}],76:[function(i,o,a){const{Buffer:u}=i("buffer"),c=Symbol.for("BufferList");function f(d){if(!(this instanceof f))return new f(d);f._init.call(this,d)}f._init=function(h){Object.defineProperty(this,c,{value:!0}),this._bufs=[],this.length=0,h&&this.append(h)},f.prototype._new=function(h){return new f(h)},f.prototype._offset=function(h){if(h===0)return[0,0];let v=0;for(let g=0;g<this._bufs.length;g++){const p=v+this._bufs[g].length;if(h<p||g===this._bufs.length-1)return[g,h-v];v=p}},f.prototype._reverseOffset=function(d){const h=d[0];let v=d[1];for(let g=0;g<h;g++)v+=this._bufs[g].length;return v},f.prototype.get=function(h){if(h>this.length||h<0)return;const v=this._offset(h);return this._bufs[v[0]][v[1]]},f.prototype.slice=function(h,v){return typeof h=="number"&&h<0&&(h+=this.length),typeof v=="number"&&v<0&&(v+=this.length),this.copy(null,0,h,v)},f.prototype.copy=function(h,v,g,p){if((typeof g!="number"||g<0)&&(g=0),(typeof p!="number"||p>this.length)&&(p=this.length),g>=this.length||p<=0)return h||u.alloc(0);const y=!!h,_=this._offset(g),b=p-g;let A=b,w=y&&v||0,T=_[1];if(g===0&&p===this.length){if(!y)return this._bufs.length===1?this._bufs[0]:u.concat(this._bufs,this.length);for(let S=0;S<this._bufs.length;S++)this._bufs[S].copy(h,w),w+=this._bufs[S].length;return h}if(A<=this._bufs[_[0]].length-T)return y?this._bufs[_[0]].copy(h,v,T,T+A):this._bufs[_[0]].slice(T,T+A);y||(h=u.allocUnsafe(b));for(let S=_[0];S<this._bufs.length;S++){const x=this._bufs[S].length-T;if(A>x)this._bufs[S].copy(h,w,T),w+=x;else{this._bufs[S].copy(h,w,T,T+A),w+=x;break}A-=x,T&&(T=0)}return h.length>w?h.slice(0,w):h},f.prototype.shallowSlice=function(h,v){if(h=h||0,v=typeof v!="number"?this.length:v,h<0&&(h+=this.length),v<0&&(v+=this.length),h===v)return this._new();const g=this._offset(h),p=this._offset(v),y=this._bufs.slice(g[0],p[0]+1);return p[1]===0?y.pop():y[y.length-1]=y[y.length-1].slice(0,p[1]),g[1]!==0&&(y[0]=y[0].slice(g[1])),this._new(y)},f.prototype.toString=function(h,v,g){return this.slice(v,g).toString(h)},f.prototype.consume=function(h){if(h=Math.trunc(h),Number.isNaN(h)||h<=0)return this;for(;this._bufs.length;)if(h>=this._bufs[0].length)h-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(h),this.length-=h;break}return this},f.prototype.duplicate=function(){const h=this._new();for(let v=0;v<this._bufs.length;v++)h.append(this._bufs[v]);return h},f.prototype.append=function(h){if(h==null)return this;if(h.buffer)this._appendBuffer(u.from(h.buffer,h.byteOffset,h.byteLength));else if(Array.isArray(h))for(let v=0;v<h.length;v++)this.append(h[v]);else if(this._isBufferList(h))for(let v=0;v<h._bufs.length;v++)this.append(h._bufs[v]);else typeof h=="number"&&(h=h.toString()),this._appendBuffer(u.from(h));return this},f.prototype._appendBuffer=function(h){this._bufs.push(h),this.length+=h.length},f.prototype.indexOf=function(d,h,v){if(v===void 0&&typeof h=="string"&&(v=h,h=void 0),typeof d=="function"||Array.isArray(d))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof d=="number"?d=u.from([d]):typeof d=="string"?d=u.from(d,v):this._isBufferList(d)?d=d.slice():Array.isArray(d.buffer)?d=u.from(d.buffer,d.byteOffset,d.byteLength):u.isBuffer(d)||(d=u.from(d)),h=Number(h||0),isNaN(h)&&(h=0),h<0&&(h=this.length+h),h<0&&(h=0),d.length===0)return h>this.length?this.length:h;const g=this._offset(h);let p=g[0],y=g[1];for(;p<this._bufs.length;p++){const _=this._bufs[p];for(;y<_.length;)if(_.length-y>=d.length){const A=_.indexOf(d,y);if(A!==-1)return this._reverseOffset([p,A]);y=_.length-d.length+1}else{const A=this._reverseOffset([p,y]);if(this._match(A,d))return A;y++}y=0}return-1},f.prototype._match=function(d,h){if(this.length-d<h.length)return!1;for(let v=0;v<h.length;v++)if(this.get(d+v)!==h[v])return!1;return!0},function(){const d={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const h in d)(function(v){d[v]===null?f.prototype[v]=function(g,p){return this.slice(g,g+p)[v](0,p)}:f.prototype[v]=function(g=0){return this.slice(g,g+d[v])[v](0)}})(h)}(),f.prototype._isBufferList=function(h){return h instanceof f||f.isBufferList(h)},f.isBufferList=function(h){return h!=null&&h[c]},o.exports=f},{buffer:29}],77:[function(i,o,a){const u=i("readable-stream").Duplex,c=i("inherits"),f=i("./BufferList");function d(h){if(!(this instanceof d))return new d(h);if(typeof h=="function"){this._callback=h;const v=function(p){this._callback&&(this._callback(p),this._callback=null)}.bind(this);this.on("pipe",function(p){p.on("error",v)}),this.on("unpipe",function(p){p.removeListener("error",v)}),h=null}f._init.call(this,h),u.call(this)}c(d,u),Object.assign(d.prototype,f.prototype),d.prototype._new=function(v){return new d(v)},d.prototype._write=function(v,g,p){this._appendBuffer(v),typeof p=="function"&&p()},d.prototype._read=function(v){if(!this.length)return this.push(null);v=Math.min(v,this.length),this.push(this.slice(0,v)),this.consume(v)},d.prototype.end=function(v){u.prototype.end.call(this,v),this._callback&&(this._callback(null,this.slice()),this._callback=null)},d.prototype._destroy=function(v,g){this._bufs.length=0,this.length=0,g(v)},d.prototype._isBufferList=function(v){return v instanceof d||v instanceof f||d.isBufferList(v)},d.isBufferList=f.isBufferList,o.exports=d,o.exports.BufferListStream=d,o.exports.BufferList=f},{"./BufferList":76,inherits:51,"readable-stream":92}],78:[function(i,o,a){arguments[4][33][0].apply(a,arguments)},{dup:33}],79:[function(i,o,a){arguments[4][34][0].apply(a,arguments)},{"./_stream_readable":81,"./_stream_writable":83,_process:102,dup:34,inherits:51}],80:[function(i,o,a){arguments[4][35][0].apply(a,arguments)},{"./_stream_transform":82,dup:35,inherits:51}],81:[function(i,o,a){arguments[4][36][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/async_iterator":84,"./internal/streams/buffer_list":85,"./internal/streams/destroy":86,"./internal/streams/from":88,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:36,events:49,inherits:51,"string_decoder/":136,util:26}],82:[function(i,o,a){arguments[4][37][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,dup:37,inherits:51}],83:[function(i,o,a){arguments[4][38][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:38,inherits:51,"util-deprecate":139}],84:[function(i,o,a){arguments[4][39][0].apply(a,arguments)},{"./end-of-stream":87,_process:102,dup:39}],85:[function(i,o,a){arguments[4][40][0].apply(a,arguments)},{buffer:29,dup:40,util:26}],86:[function(i,o,a){arguments[4][41][0].apply(a,arguments)},{_process:102,dup:41}],87:[function(i,o,a){arguments[4][42][0].apply(a,arguments)},{"../../../errors":78,dup:42}],88:[function(i,o,a){arguments[4][43][0].apply(a,arguments)},{dup:43}],89:[function(i,o,a){arguments[4][44][0].apply(a,arguments)},{"../../../errors":78,"./end-of-stream":87,dup:44}],90:[function(i,o,a){arguments[4][45][0].apply(a,arguments)},{"../../../errors":78,dup:45}],91:[function(i,o,a){arguments[4][46][0].apply(a,arguments)},{dup:46,events:49}],92:[function(i,o,a){arguments[4][47][0].apply(a,arguments)},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89,dup:47}],93:[function(i,o,a){const{Buffer:u}=i("buffer"),c=65536,f={},d=u.isBuffer(u.from([1,2]).subarray(0,1));function h(y){const _=u.allocUnsafe(2);return _.writeUInt8(y>>8,0),_.writeUInt8(y&255,0+1),_}function v(){for(let y=0;y<c;y++)f[y]=h(y)}function g(y){let b=0,A=0;const w=u.allocUnsafe(4);do b=y%128|0,y=y/128|0,y>0&&(b=b|128),w.writeUInt8(b,A++);while(y>0&&A<4);return y>0&&(A=0),d?w.subarray(0,A):w.slice(0,A)}function p(y){const _=u.allocUnsafe(4);return _.writeUInt32BE(y,0),_}o.exports={cache:f,generateCache:v,generateNumber:h,genBufVariableByteInt:g,generate4ByteBuffer:p}},{buffer:29}],94:[function(i,o,a){class u{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}o.exports=u},{}],95:[function(i,o,a){const u=i("bl"),c=i("events"),f=i("./packet"),d=i("./constants"),h=i("debug")("mqtt-packet:parser");class v extends c{constructor(){super(),this.parser=this.constructor.parser}static parser(p){return this instanceof v?(this.settings=p||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new v().parser(p)}_resetState(){h("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new f,this.error=null,this._list=u(),this._stateCounter=0}parse(p){for(this.error&&this._resetState(),this._list.append(p),h("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,h("parse: state complete. _stateCounter is now: %d",this._stateCounter),h("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return h("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const p=this._list.readUInt8(0),y=p>>d.CMD_SHIFT;this.packet.cmd=d.types[y];const _=p&15,b=d.requiredHeaderFlags[y];return b!=null&&_!==b?this._emitError(new Error(d.requiredHeaderFlagsErrors[y])):(this.packet.retain=(p&d.RETAIN_MASK)!==0,this.packet.qos=p>>d.QOS_SHIFT&d.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(p&d.DUP_MASK)!==0,h("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const p=this._parseVarByteNum(!0);return p&&(this.packet.length=p.value,this._list.consume(p.bytes)),h("_parseLength %d",p.value),!!p}_parsePayload(){h("_parsePayload: payload %O",this._list);let p=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}p=!0}return h("_parsePayload complete result: %s",p),p}_parseConnect(){h("_parseConnect");let p,y,_,b;const A={},w=this.packet,T=this._parseString();if(T===null)return this._emitError(new Error("Cannot parse protocolId"));if(T!=="MQTT"&&T!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(w.protocolId=T,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(w.protocolVersion=this._list.readUInt8(this._pos),w.protocolVersion>=128&&(w.bridgeMode=!0,w.protocolVersion=w.protocolVersion-128),w.protocolVersion!==3&&w.protocolVersion!==4&&w.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));A.username=this._list.readUInt8(this._pos)&d.USERNAME_MASK,A.password=this._list.readUInt8(this._pos)&d.PASSWORD_MASK,A.will=this._list.readUInt8(this._pos)&d.WILL_FLAG_MASK;const S=!!(this._list.readUInt8(this._pos)&d.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&d.WILL_QOS_MASK)>>d.WILL_QOS_SHIFT;if(A.will)w.will={},w.will.retain=S,w.will.qos=x;else{if(S)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(w.clean=(this._list.readUInt8(this._pos)&d.CLEAN_SESSION_MASK)!==0,this._pos++,w.keepalive=this._parseNum(),w.keepalive===-1)return this._emitError(new Error("Packet too short"));if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.properties=L)}const O=this._parseString();if(O===null)return this._emitError(new Error("Packet too short"));if(w.clientId=O,h("_parseConnect: packet.clientId: %s",w.clientId),A.will){if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.will.properties=L)}if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse will topic"));if(w.will.topic=p,h("_parseConnect: packet.will.topic: %s",w.will.topic),y=this._parseBuffer(),y===null)return this._emitError(new Error("Cannot parse will payload"));w.will.payload=y,h("_parseConnect: packet.will.paylaod: %s",w.will.payload)}if(A.username){if(b=this._parseString(),b===null)return this._emitError(new Error("Cannot parse username"));w.username=b,h("_parseConnect: packet.username: %s",w.username)}if(A.password){if(_=this._parseBuffer(),_===null)return this._emitError(new Error("Cannot parse password"));w.password=_}return this.settings=w,h("_parseConnect: complete"),w}_parseConnack(){h("_parseConnack");const p=this.packet;if(this._list.length<1)return null;const y=this._list.readUInt8(this._pos++);if(y>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(p.sessionPresent=!!(y&d.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?p.reasonCode=this._list.readUInt8(this._pos++):p.reasonCode=0;else{if(this._list.length<2)return null;p.returnCode=this._list.readUInt8(this._pos++)}if(p.returnCode===-1||p.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(p.properties=_)}h("_parseConnack: complete")}_parsePublish(){h("_parsePublish");const p=this.packet;if(p.topic=this._parseString(),p.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(p.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}p.payload=this._list.slice(this._pos,p.length),h("_parsePublish: payload from buffer list: %o",p.payload)}}_parseSubscribe(){h("_parseSubscribe");const p=this.packet;let y,_,b,A,w,T,S;if(p.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(p.properties=x)}if(p.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<p.length;){if(y=this._parseString(),y===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=p.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(_=this._parseByte(),this.settings.protocolVersion===5){if(_&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(_&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(b=_&d.SUBSCRIBE_OPTIONS_QOS_MASK,b>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(T=(_>>d.SUBSCRIBE_OPTIONS_NL_SHIFT&d.SUBSCRIBE_OPTIONS_NL_MASK)!==0,w=(_>>d.SUBSCRIBE_OPTIONS_RAP_SHIFT&d.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,A=_>>d.SUBSCRIBE_OPTIONS_RH_SHIFT&d.SUBSCRIBE_OPTIONS_RH_MASK,A>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));S={topic:y,qos:b},this.settings.protocolVersion===5?(S.nl=T,S.rap=w,S.rh=A):this.settings.bridgeMode&&(S.rh=0,S.rap=!0,S.nl=!0),h("_parseSubscribe: push subscription `%s` to subscription",S),p.subscriptions.push(S)}}}_parseSuback(){h("_parseSuback");const p=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}if(p.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const y=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!d.MQTT5_SUBACK_CODES[y])return this._emitError(new Error("Invalid suback code"))}else if(y>2&&y!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(y)}}}_parseUnsubscribe(){h("_parseUnsubscribe");const p=this.packet;if(p.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}if(p.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<p.length;){const y=this._parseString();if(y===null)return this._emitError(new Error("Cannot parse topic"));h("_parseUnsubscribe: push topic `%s` to unsubscriptions",y),p.unsubscriptions.push(y)}}}_parseUnsuback(){h("_parseUnsuback");const p=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&p.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(p.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){const y=this._parseProperties();for(Object.getOwnPropertyNames(y).length&&(p.properties=y),p.granted=[];this._pos<this.packet.length;){const _=this._list.readUInt8(this._pos++);if(!d.MQTT5_UNSUBACK_CODES[_])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(_)}}}_parseConfirmation(){h("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const p=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(p.length>2){switch(p.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!d.MQTT5_PUBACK_PUBREC_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!d.MQTT5_PUBREL_PUBCOMP_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}h("_parseConfirmation: packet.reasonCode `%d`",p.reasonCode)}else p.reasonCode=0;if(p.length>3){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}}return!0}_parseDisconnect(){const p=this.packet;if(h("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(p.reasonCode=this._parseByte(),d.MQTT5_DISCONNECT_CODES[p.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):p.reasonCode=0;const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}return h("_parseDisconnect result: true"),!0}_parseAuth(){h("_parseAuth");const p=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(p.reasonCode=this._parseByte(),!d.MQTT5_AUTH_CODES[p.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const y=this._parseProperties();return Object.getOwnPropertyNames(y).length&&(p.properties=y),h("_parseAuth: result: true"),!0}_parseMessageId(){const p=this.packet;return p.messageId=this._parseNum(),p.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(h("_parseMessageId: packet.messageId %d",p.messageId),!0)}_parseString(p){const y=this._parseNum(),_=y+this._pos;if(y===-1||_>this._list.length||_>this.packet.length)return null;const b=this._list.toString("utf8",this._pos,_);return this._pos+=y,h("_parseString: result: %s",b),b}_parseStringPair(){return h("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const p=this._parseNum(),y=p+this._pos;if(p===-1||y>this._list.length||y>this.packet.length)return null;const _=this._list.slice(this._pos,y);return this._pos+=p,h("_parseBuffer: result: %o",_),_}_parseNum(){if(this._list.length-this._pos<2)return-1;const p=this._list.readUInt16BE(this._pos);return this._pos+=2,h("_parseNum: result: %s",p),p}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const p=this._list.readUInt32BE(this._pos);return this._pos+=4,h("_parse4ByteNum: result: %s",p),p}_parseVarByteNum(p){h("_parseVarByteNum");const y=4;let _=0,b=1,A=0,w=!1,T;const S=this._pos?this._pos:0;for(;_<y&&S+_<this._list.length;){if(T=this._list.readUInt8(S+_++),A+=b*(T&d.VARBYTEINT_MASK),b*=128,!(T&d.VARBYTEINT_FIN_MASK)){w=!0;break}if(this._list.length<=_)break}return!w&&_===y&&this._list.length>=_&&this._emitError(new Error("Invalid variable byte integer")),S&&(this._pos+=_),w?p?w={bytes:_,value:A}:w=A:w=!1,h("_parseVarByteNum: result: %o",w),w}_parseByte(){let p;return this._pos<this._list.length&&(p=this._list.readUInt8(this._pos),this._pos++),h("_parseByte: result: %o",p),p}_parseByType(p){switch(h("_parseByType: type: %s",p),p){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){h("_parseProperties");const p=this._parseVarByteNum(),_=this._pos+p,b={};for(;this._pos<_;){const A=this._parseByte();if(!A)return this._emitError(new Error("Cannot parse property code type")),!1;const w=d.propertiesCodes[A];if(!w)return this._emitError(new Error("Unknown property")),!1;if(w==="userProperties"){b[w]||(b[w]=Object.create(null));const T=this._parseByType(d.propertiesTypes[w]);if(b[w][T.name])if(Array.isArray(b[w][T.name]))b[w][T.name].push(T.value);else{const S=b[w][T.name];b[w][T.name]=[S],b[w][T.name].push(T.value)}else b[w][T.name]=T.value;continue}b[w]?Array.isArray(b[w])?b[w].push(this._parseByType(d.propertiesTypes[w])):(b[w]=[b[w]],b[w].push(this._parseByType(d.propertiesTypes[w]))):b[w]=this._parseByType(d.propertiesTypes[w])}return b}_newPacket(){return h("_newPacket"),this.packet&&(this._list.consume(this.packet.length),h("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),h("_newPacket: new packet"),this.packet=new f,this._pos=0,!0}_emitError(p){h("_emitError",p),this.error=p,this.emit("error",p)}}o.exports=v},{"./constants":73,"./packet":94,bl:77,debug:30,events:49}],96:[function(i,o,a){const u=i("./constants"),{Buffer:c}=i("buffer"),f=c.allocUnsafe(0),d=c.from([0]),h=i("./numbers"),v=i("process-nextick-args").nextTick,g=i("debug")("mqtt-packet:writeToStream"),p=h.cache,y=h.generateNumber,_=h.generateCache,b=h.genBufVariableByteInt,A=h.generate4ByteBuffer;let w=_e,T=!0;function S(Ce,ue,At){switch(g("generate called"),ue.cork&&(ue.cork(),v(x,ue)),T&&(T=!1,_()),g("generate: packet.cmd: %s",Ce.cmd),Ce.cmd){case"connect":return O(Ce,ue);case"connack":return L(Ce,ue,At);case"publish":return M(Ce,ue,At);case"puback":case"pubrec":case"pubrel":case"pubcomp":return re(Ce,ue,At);case"subscribe":return F(Ce,ue,At);case"suback":return j(Ce,ue,At);case"unsubscribe":return V(Ce,ue,At);case"unsuback":return z(Ce,ue,At);case"pingreq":case"pingresp":return $(Ce,ue);case"disconnect":return he(Ce,ue,At);case"auth":return le(Ce,ue,At);default:return ue.destroy(new Error("Unknown command")),!1}}Object.defineProperty(S,"cacheNumbers",{get(){return w===_e},set(Ce){Ce?((!p||Object.keys(p).length===0)&&(T=!0),w=_e):(T=!1,w=Et)}});function x(Ce){Ce.uncork()}function O(Ce,ue,At){const Ne=Ce||{},Oe=Ne.protocolId||"MQTT";let kt=Ne.protocolVersion||4;const jt=Ne.will;let _n=Ne.clean;const ie=Ne.keepalive||0,ae=Ne.clientId||"",Y=Ne.username,k=Ne.password,D=Ne.properties;_n===void 0&&(_n=!0);let oe=0;if(!Oe||typeof Oe!="string"&&!c.isBuffer(Oe))return ue.destroy(new Error("Invalid protocolId")),!1;if(oe+=Oe.length+2,kt!==3&&kt!==4&&kt!==5)return ue.destroy(new Error("Invalid protocol version")),!1;if(oe+=1,(typeof ae=="string"||c.isBuffer(ae))&&(ae||kt>=4)&&(ae||_n))oe+=c.byteLength(ae)+2;else{if(kt<4)return ue.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(_n*1===0)return ue.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof ie!="number"||ie<0||ie>65535||ie%1!==0)return ue.destroy(new Error("Invalid keepalive")),!1;oe+=2,oe+=1;let xe,ze;if(kt===5){if(xe=Dt(ue,D),!xe)return!1;oe+=xe.length}if(jt){if(typeof jt!="object")return ue.destroy(new Error("Invalid will")),!1;if(!jt.topic||typeof jt.topic!="string")return ue.destroy(new Error("Invalid will topic")),!1;if(oe+=c.byteLength(jt.topic)+2,oe+=2,jt.payload)if(jt.payload.length>=0)typeof jt.payload=="string"?oe+=c.byteLength(jt.payload):oe+=jt.payload.length;else return ue.destroy(new Error("Invalid will payload")),!1;if(ze={},kt===5){if(ze=Dt(ue,jt.properties),!ze)return!1;oe+=ze.length}}let hn=!1;if(Y!=null)if($e(Y))hn=!0,oe+=c.byteLength(Y)+2;else return ue.destroy(new Error("Invalid username")),!1;if(k!=null){if(!hn)return ue.destroy(new Error("Username is required to use password")),!1;if($e(k))oe+=In(k)+2;else return ue.destroy(new Error("Invalid password")),!1}ue.write(u.CONNECT_HEADER),Fe(ue,oe),vn(ue,Oe),Ne.bridgeMode&&(kt+=128),ue.write(kt===131?u.VERSION131:kt===132?u.VERSION132:kt===4?u.VERSION4:kt===5?u.VERSION5:u.VERSION3);let An=0;return An|=Y!=null?u.USERNAME_MASK:0,An|=k!=null?u.PASSWORD_MASK:0,An|=jt&&jt.retain?u.WILL_RETAIN_MASK:0,An|=jt&&jt.qos?jt.qos<<u.WILL_QOS_SHIFT:0,An|=jt?u.WILL_FLAG_MASK:0,An|=_n?u.CLEAN_SESSION_MASK:0,ue.write(c.from([An])),w(ue,ie),kt===5&&xe.write(),vn(ue,ae),jt&&(kt===5&&ze.write(),pe(ue,jt.topic),vn(ue,jt.payload)),Y!=null&&vn(ue,Y),k!=null&&vn(ue,k),!0}function L(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Ne===5?Oe.reasonCode:Oe.returnCode,jt=Oe.properties;let _n=2;if(typeof kt!="number")return ue.destroy(new Error("Invalid return code")),!1;let ie=null;if(Ne===5){if(ie=Dt(ue,jt),!ie)return!1;_n+=ie.length}return ue.write(u.CONNACK_HEADER),Fe(ue,_n),ue.write(Oe.sessionPresent?u.SESSIONPRESENT_HEADER:d),ue.write(c.from([kt])),ie!=null&&ie.write(),!0}function M(Ce,ue,At){g("publish: packet: %o",Ce);const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.qos||0,jt=Oe.retain?u.RETAIN_MASK:0,_n=Oe.topic,ie=Oe.payload||f,ae=Oe.messageId,Y=Oe.properties;let k=0;if(typeof _n=="string")k+=c.byteLength(_n)+2;else if(c.isBuffer(_n))k+=_n.length+2;else return ue.destroy(new Error("Invalid topic")),!1;if(c.isBuffer(ie)?k+=ie.length:k+=c.byteLength(ie),kt&&typeof ae!="number")return ue.destroy(new Error("Invalid messageId")),!1;kt&&(k+=2);let D=null;if(Ne===5){if(D=Dt(ue,Y),!D)return!1;k+=D.length}return ue.write(u.PUBLISH_HEADER[kt][Oe.dup?1:0][jt?1:0]),Fe(ue,k),w(ue,In(_n)),ue.write(_n),kt>0&&w(ue,ae),D!=null&&D.write(),g("publish: payload: %o",ie),ue.write(ie)}function re(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.cmd||"puback",jt=Oe.messageId,_n=Oe.dup&&kt==="pubrel"?u.DUP_MASK:0;let ie=0;const ae=Oe.reasonCode,Y=Oe.properties;let k=Ne===5?3:2;if(kt==="pubrel"&&(ie=1),typeof jt!="number")return ue.destroy(new Error("Invalid messageId")),!1;let D=null;if(Ne===5&&typeof Y=="object"){if(D=de(ue,Y,At,k),!D)return!1;k+=D.length}return ue.write(u.ACKS[kt][ie][_n][0]),k===3&&(k+=ae!==0?1:-1),Fe(ue,k),w(ue,jt),Ne===5&&k!==2&&ue.write(c.from([ae])),D!==null?D.write():k===4&&ue.write(c.from([0])),!0}function F(Ce,ue,At){g("subscribe: packet: ");const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.dup?u.DUP_MASK:0,jt=Oe.messageId,_n=Oe.subscriptions,ie=Oe.properties;let ae=0;if(typeof jt!="number")return ue.destroy(new Error("Invalid messageId")),!1;ae+=2;let Y=null;if(Ne===5){if(Y=Dt(ue,ie),!Y)return!1;ae+=Y.length}if(typeof _n=="object"&&_n.length)for(let D=0;D<_n.length;D+=1){const oe=_n[D].topic,xe=_n[D].qos;if(typeof oe!="string")return ue.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof xe!="number")return ue.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(Ne===5){if(typeof(_n[D].nl||!1)!="boolean")return ue.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(_n[D].rap||!1)!="boolean")return ue.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const An=_n[D].rh||0;if(typeof An!="number"||An>2)return ue.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}ae+=c.byteLength(oe)+2+1}else return ue.destroy(new Error("Invalid subscriptions")),!1;g("subscribe: writing to stream: %o",u.SUBSCRIBE_HEADER),ue.write(u.SUBSCRIBE_HEADER[1][kt?1:0][0]),Fe(ue,ae),w(ue,jt),Y!==null&&Y.write();let k=!0;for(const D of _n){const oe=D.topic,xe=D.qos,ze=+D.nl,hn=+D.rap,An=D.rh;let Tn;pe(ue,oe),Tn=u.SUBSCRIBE_OPTIONS_QOS[xe],Ne===5&&(Tn|=ze?u.SUBSCRIBE_OPTIONS_NL:0,Tn|=hn?u.SUBSCRIBE_OPTIONS_RAP:0,Tn|=An?u.SUBSCRIBE_OPTIONS_RH[An]:0),k=ue.write(c.from([Tn]))}return k}function j(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.granted,_n=Oe.properties;let ie=0;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(ie+=2,typeof jt=="object"&&jt.length)for(let Y=0;Y<jt.length;Y+=1){if(typeof jt[Y]!="number")return ue.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return ue.destroy(new Error("Invalid qos vector")),!1;let ae=null;if(Ne===5){if(ae=de(ue,_n,At,ie),!ae)return!1;ie+=ae.length}return ue.write(u.SUBACK_HEADER),Fe(ue,ie),w(ue,kt),ae!==null&&ae.write(),ue.write(c.from(jt))}function V(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.dup?u.DUP_MASK:0,_n=Oe.unsubscriptions,ie=Oe.properties;let ae=0;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(ae+=2,typeof _n=="object"&&_n.length)for(let D=0;D<_n.length;D+=1){if(typeof _n[D]!="string")return ue.destroy(new Error("Invalid unsubscriptions")),!1;ae+=c.byteLength(_n[D])+2}else return ue.destroy(new Error("Invalid unsubscriptions")),!1;let Y=null;if(Ne===5){if(Y=Dt(ue,ie),!Y)return!1;ae+=Y.length}ue.write(u.UNSUBSCRIBE_HEADER[1][jt?1:0][0]),Fe(ue,ae),w(ue,kt),Y!==null&&Y.write();let k=!0;for(let D=0;D<_n.length;D++)k=pe(ue,_n[D]);return k}function z(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.dup?u.DUP_MASK:0,_n=Oe.granted,ie=Oe.properties,ae=Oe.cmd,Y=0;let k=2;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(Ne===5)if(typeof _n=="object"&&_n.length)for(let oe=0;oe<_n.length;oe+=1){if(typeof _n[oe]!="number")return ue.destroy(new Error("Invalid qos vector")),!1;k+=1}else return ue.destroy(new Error("Invalid qos vector")),!1;let D=null;if(Ne===5){if(D=de(ue,ie,At,k),!D)return!1;k+=D.length}return ue.write(u.ACKS[ae][Y][jt][0]),Fe(ue,k),w(ue,kt),D!==null&&D.write(),Ne===5&&ue.write(c.from(_n)),!0}function $(Ce,ue,At){return ue.write(u.EMPTY[Ce.cmd])}function he(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.reasonCode,jt=Oe.properties;let _n=Ne===5?1:0,ie=null;if(Ne===5){if(ie=de(ue,jt,At,_n),!ie)return!1;_n+=ie.length}return ue.write(c.from([u.codes.disconnect<<4])),Fe(ue,_n),Ne===5&&ue.write(c.from([kt])),ie!==null&&ie.write(),!0}function le(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.reasonCode,jt=Oe.properties;let _n=Ne===5?1:0;Ne!==5&&ue.destroy(new Error("Invalid mqtt version for auth packet"));const ie=de(ue,jt,At,_n);return ie?(_n+=ie.length,ue.write(c.from([u.codes.auth<<4])),Fe(ue,_n),ue.write(c.from([kt])),ie!==null&&ie.write(),!0):!1}const Ie={};function Fe(Ce,ue){if(ue>u.VARBYTEINT_MAX)return Ce.destroy(new Error(`Invalid variable byte integer: ${ue}`)),!1;let At=Ie[ue];return At||(At=b(ue),ue<16384&&(Ie[ue]=At)),g("writeVarByteInt: writing to stream: %o",At),Ce.write(At)}function pe(Ce,ue){const At=c.byteLength(ue);return w(Ce,At),g("writeString: %s",ue),Ce.write(ue,"utf8")}function Lt(Ce,ue,At){pe(Ce,ue),pe(Ce,At)}function _e(Ce,ue){return g("writeNumberCached: number: %d",ue),g("writeNumberCached: %o",p[ue]),Ce.write(p[ue])}function Et(Ce,ue){const At=y(ue);return g("writeNumberGenerated: %o",At),Ce.write(At)}function Cn(Ce,ue){const At=A(ue);return g("write4ByteNumber: %o",At),Ce.write(At)}function vn(Ce,ue){typeof ue=="string"?pe(Ce,ue):ue?(w(Ce,ue.length),Ce.write(ue)):w(Ce,0)}function Dt(Ce,ue){if(typeof ue!="object"||ue.length!=null)return{length:1,write(){Pt(Ce,{},0)}};let At=0;function Ne(kt,jt){const _n=u.propertiesTypes[kt];let ie=0;switch(_n){case"byte":{if(typeof jt!="boolean")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+1;break}case"int8":{if(typeof jt!="number"||jt<0||jt>255)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+1;break}case"binary":{if(jt&&jt===null)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+c.byteLength(jt)+2;break}case"int16":{if(typeof jt!="number"||jt<0||jt>65535)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+2;break}case"int32":{if(typeof jt!="number"||jt<0||jt>4294967295)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+4;break}case"var":{if(typeof jt!="number"||jt<0||jt>268435455)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+c.byteLength(b(jt));break}case"string":{if(typeof jt!="string")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+2+c.byteLength(jt.toString());break}case"pair":{if(typeof jt!="object")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=Object.getOwnPropertyNames(jt).reduce((ae,Y)=>{const k=jt[Y];return Array.isArray(k)?ae+=k.reduce((D,oe)=>(D+=1+2+c.byteLength(Y.toString())+2+c.byteLength(oe.toString()),D),0):ae+=1+2+c.byteLength(Y.toString())+2+c.byteLength(jt[Y].toString()),ae},0);break}default:return Ce.destroy(new Error(`Invalid property ${kt}: ${jt}`)),!1}return ie}if(ue)for(const kt in ue){let jt=0,_n=0;const ie=ue[kt];if(Array.isArray(ie))for(let ae=0;ae<ie.length;ae++){if(_n=Ne(kt,ie[ae]),!_n)return!1;jt+=_n}else{if(_n=Ne(kt,ie),!_n)return!1;jt=_n}if(!jt)return!1;At+=jt}return{length:c.byteLength(b(At))+At,write(){Pt(Ce,ue,At)}}}function de(Ce,ue,At,Ne){const Oe=["reasonString","userProperties"],kt=At&&At.properties&&At.properties.maximumPacketSize?At.properties.maximumPacketSize:0;let jt=Dt(Ce,ue);if(kt)for(;Ne+jt.length>kt;){const _n=Oe.shift();if(_n&&ue[_n])delete ue[_n],jt=Dt(Ce,ue);else return!1}return jt}function qe(Ce,ue,At){switch(u.propertiesTypes[ue]){case"byte":{Ce.write(c.from([u.properties[ue]])),Ce.write(c.from([+At]));break}case"int8":{Ce.write(c.from([u.properties[ue]])),Ce.write(c.from([At]));break}case"binary":{Ce.write(c.from([u.properties[ue]])),vn(Ce,At);break}case"int16":{Ce.write(c.from([u.properties[ue]])),w(Ce,At);break}case"int32":{Ce.write(c.from([u.properties[ue]])),Cn(Ce,At);break}case"var":{Ce.write(c.from([u.properties[ue]])),Fe(Ce,At);break}case"string":{Ce.write(c.from([u.properties[ue]])),pe(Ce,At);break}case"pair":{Object.getOwnPropertyNames(At).forEach(Oe=>{const kt=At[Oe];Array.isArray(kt)?kt.forEach(jt=>{Ce.write(c.from([u.properties[ue]])),Lt(Ce,Oe.toString(),jt.toString())}):(Ce.write(c.from([u.properties[ue]])),Lt(Ce,Oe.toString(),kt.toString()))});break}default:return Ce.destroy(new Error(`Invalid property ${ue} value: ${At}`)),!1}}function Pt(Ce,ue,At){Fe(Ce,At);for(const Ne in ue)if(Object.prototype.hasOwnProperty.call(ue,Ne)&&ue[Ne]!==null){const Oe=ue[Ne];if(Array.isArray(Oe))for(let kt=0;kt<Oe.length;kt++)qe(Ce,Ne,Oe[kt]);else qe(Ce,Ne,Oe)}}function In(Ce){return Ce?Ce instanceof c?Ce.length:c.byteLength(Ce):0}function $e(Ce){return typeof Ce=="string"||Ce instanceof c}o.exports=S},{"./constants":73,"./numbers":93,buffer:29,debug:30,"process-nextick-args":101}],97:[function(i,o,a){var u=1e3,c=u*60,f=c*60,d=f*24,h=d*7,v=d*365.25;o.exports=function(b,A){A=A||{};var w=typeof b;if(w==="string"&&b.length>0)return g(b);if(w==="number"&&isFinite(b))return A.long?y(b):p(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function g(b){if(b=String(b),!(b.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(A){var w=parseFloat(A[1]),T=(A[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return w*v;case"weeks":case"week":case"w":return w*h;case"days":case"day":case"d":return w*d;case"hours":case"hour":case"hrs":case"hr":case"h":return w*f;case"minutes":case"minute":case"mins":case"min":case"m":return w*c;case"seconds":case"second":case"secs":case"sec":case"s":return w*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function p(b){var A=Math.abs(b);return A>=d?Math.round(b/d)+"d":A>=f?Math.round(b/f)+"h":A>=c?Math.round(b/c)+"m":A>=u?Math.round(b/u)+"s":b+"ms"}function y(b){var A=Math.abs(b);return A>=d?_(b,A,d,"day"):A>=f?_(b,A,f,"hour"):A>=c?_(b,A,c,"minute"):A>=u?_(b,A,u,"second"):b+" ms"}function _(b,A,w,T){var S=A>=w*1.5;return Math.round(b/w)+" "+T+(S?"s":"")}},{}],98:[function(i,o,a){const u=i("./lib/number-allocator.js");o.exports.NumberAllocator=u},{"./lib/number-allocator.js":99}],99:[function(i,o,a){const u=i("js-sdsl").OrderedSet,c=i("debug")("number-allocator:trace"),f=i("debug")("number-allocator:error");function d(v,g){this.low=v,this.high=g}d.prototype.equals=function(v){return this.low===v.low&&this.high===v.high},d.prototype.compare=function(v){return this.low<v.low&&this.high<v.low?-1:v.low<this.low&&v.high<this.low?1:0};function h(v,g){if(!(this instanceof h))return new h(v,g);this.min=v,this.max=g,this.ss=new u([],(p,y)=>p.compare(y)),c("Create"),this.clear()}h.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},h.prototype.alloc=function(){if(this.ss.size()===0)return c("alloc():empty"),null;const v=this.ss.begin(),g=v.pointer.low,p=v.pointer.high,y=g;return y+1<=p?this.ss.updateKeyByIterator(v,new d(g+1,p)):this.ss.eraseElementByPos(0),c("alloc():"+y),y},h.prototype.use=function(v){const g=new d(v,v),p=this.ss.lowerBound(g);if(!p.equals(this.ss.end())){const y=p.pointer.low,_=p.pointer.high;return p.pointer.equals(g)?(this.ss.eraseElementByIterator(p),c("use():"+v),!0):y>v?!1:y===v?(this.ss.updateKeyByIterator(p,new d(y+1,_)),c("use():"+v),!0):_===v?(this.ss.updateKeyByIterator(p,new d(y,_-1)),c("use():"+v),!0):(this.ss.updateKeyByIterator(p,new d(v+1,_)),this.ss.insert(new d(y,v-1)),c("use():"+v),!0)}return c("use():failed"),!1},h.prototype.free=function(v){if(v<this.min||v>this.max){f("free():"+v+" is out of range");return}const g=new d(v,v),p=this.ss.upperBound(g);if(p.equals(this.ss.end())){if(p.equals(this.ss.begin())){this.ss.insert(g);return}p.pre();const y=p.pointer.high;p.pointer.high+1===v?this.ss.updateKeyByIterator(p,new d(y,v)):this.ss.insert(g)}else if(p.equals(this.ss.begin()))if(v+1===p.pointer.low){const y=p.pointer.high;this.ss.updateKeyByIterator(p,new d(v,y))}else this.ss.insert(g);else{const y=p.pointer.low,_=p.pointer.high;p.pre();const b=p.pointer.low;p.pointer.high+1===v?v+1===y?(this.ss.eraseElementByIterator(p),this.ss.updateKeyByIterator(p,new d(b,_))):this.ss.updateKeyByIterator(p,new d(b,v)):v+1===y?(this.ss.eraseElementByIterator(p.next()),this.ss.insert(new d(v,_))):this.ss.insert(g)}c("free():"+v)},h.prototype.clear=function(){c("clear()"),this.ss.clear(),this.ss.insert(new d(this.min,this.max))},h.prototype.intervalCount=function(){return this.ss.size()},h.prototype.dump=function(){console.log("length:"+this.ss.size());for(const v of this.ss)console.log(v)},o.exports=h},{debug:30,"js-sdsl":69}],100:[function(i,o,a){var u=i("wrappy");o.exports=u(c),o.exports.strict=u(f),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return f(this)},configurable:!0})});function c(d){var h=function(){return h.called?h.value:(h.called=!0,h.value=d.apply(this,arguments))};return h.called=!1,h}function f(d){var h=function(){if(h.called)throw new Error(h.onceError);return h.called=!0,h.value=d.apply(this,arguments)},v=d.name||"Function wrapped with `once`";return h.onceError=v+" shouldn't be called more than once",h.called=!1,h}},{wrappy:140}],101:[function(i,o,a){(function(u){(function(){typeof u>"u"||!u.version||u.version.indexOf("v0.")===0||u.version.indexOf("v1.")===0&&u.version.indexOf("v1.8.")!==0?o.exports={nextTick:c}:o.exports=u;function c(f,d,h,v){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,p,y;switch(g){case 0:case 1:return u.nextTick(f);case 2:return u.nextTick(function(){f.call(null,d)});case 3:return u.nextTick(function(){f.call(null,d,h)});case 4:return u.nextTick(function(){f.call(null,d,h,v)});default:for(p=new Array(g-1),y=0;y<p.length;)p[y++]=arguments[y];return u.nextTick(function(){f.apply(null,p)})}}}).call(this)}).call(this,i("_process"))},{_process:102}],102:[function(i,o,a){var u=o.exports={},c,f;function d(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?c=setTimeout:c=d}catch{c=d}try{typeof clearTimeout=="function"?f=clearTimeout:f=h}catch{f=h}})();function v(x){if(c===setTimeout)return setTimeout(x,0);if((c===d||!c)&&setTimeout)return c=setTimeout,setTimeout(x,0);try{return c(x,0)}catch{try{return c.call(null,x,0)}catch{return c.call(this,x,0)}}}function g(x){if(f===clearTimeout)return clearTimeout(x);if((f===h||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(x);try{return f(x)}catch{try{return f.call(null,x)}catch{return f.call(this,x)}}}var p=[],y=!1,_,b=-1;function A(){!y||!_||(y=!1,_.length?p=_.concat(p):b=-1,p.length&&w())}function w(){if(!y){var x=v(A);y=!0;for(var O=p.length;O;){for(_=p,p=[];++b<O;)_&&_[b].run();b=-1,O=p.length}_=null,y=!1,g(x)}}u.nextTick=function(x){var O=new Array(arguments.length-1);if(arguments.length>1)for(var L=1;L<arguments.length;L++)O[L-1]=arguments[L];p.push(new T(x,O)),p.length===1&&!y&&v(w)};function T(x,O){this.fun=x,this.array=O}T.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={};function S(){}u.on=S,u.addListener=S,u.once=S,u.off=S,u.removeListener=S,u.removeAllListeners=S,u.emit=S,u.prependListener=S,u.prependOnceListener=S,u.listeners=function(x){return[]},u.binding=function(x){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(x){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],103:[function(i,o,a){(function(u){(function(){(function(c){var f=typeof a=="object"&&a&&!a.nodeType&&a,d=typeof o=="object"&&o&&!o.nodeType&&o,h=typeof u=="object"&&u;(h.global===h||h.window===h||h.self===h)&&(c=h);var v,g=2147483647,p=36,y=1,_=26,b=38,A=700,w=72,T=128,S="-",x=/^xn--/,O=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},re=p-y,F=Math.floor,j=String.fromCharCode,V;function z(Dt){throw new RangeError(M[Dt])}function $(Dt,de){for(var qe=Dt.length,Pt=[];qe--;)Pt[qe]=de(Dt[qe]);return Pt}function he(Dt,de){var qe=Dt.split("@"),Pt="";qe.length>1&&(Pt=qe[0]+"@",Dt=qe[1]),Dt=Dt.replace(L,".");var In=Dt.split("."),$e=$(In,de).join(".");return Pt+$e}function le(Dt){for(var de=[],qe=0,Pt=Dt.length,In,$e;qe<Pt;)In=Dt.charCodeAt(qe++),In>=55296&&In<=56319&&qe<Pt?($e=Dt.charCodeAt(qe++),($e&64512)==56320?de.push(((In&1023)<<10)+($e&1023)+65536):(de.push(In),qe--)):de.push(In);return de}function Ie(Dt){return $(Dt,function(de){var qe="";return de>65535&&(de-=65536,qe+=j(de>>>10&1023|55296),de=56320|de&1023),qe+=j(de),qe}).join("")}function Fe(Dt){return Dt-48<10?Dt-22:Dt-65<26?Dt-65:Dt-97<26?Dt-97:p}function pe(Dt,de){return Dt+22+75*(Dt<26)-((de!=0)<<5)}function Lt(Dt,de,qe){var Pt=0;for(Dt=qe?F(Dt/A):Dt>>1,Dt+=F(Dt/de);Dt>re*_>>1;Pt+=p)Dt=F(Dt/re);return F(Pt+(re+1)*Dt/(Dt+b))}function _e(Dt){var de=[],qe=Dt.length,Pt,In=0,$e=T,Ce=w,ue,At,Ne,Oe,kt,jt,_n,ie,ae;for(ue=Dt.lastIndexOf(S),ue<0&&(ue=0),At=0;At<ue;++At)Dt.charCodeAt(At)>=128&&z("not-basic"),de.push(Dt.charCodeAt(At));for(Ne=ue>0?ue+1:0;Ne<qe;){for(Oe=In,kt=1,jt=p;Ne>=qe&&z("invalid-input"),_n=Fe(Dt.charCodeAt(Ne++)),(_n>=p||_n>F((g-In)/kt))&&z("overflow"),In+=_n*kt,ie=jt<=Ce?y:jt>=Ce+_?_:jt-Ce,!(_n<ie);jt+=p)ae=p-ie,kt>F(g/ae)&&z("overflow"),kt*=ae;Pt=de.length+1,Ce=Lt(In-Oe,Pt,Oe==0),F(In/Pt)>g-$e&&z("overflow"),$e+=F(In/Pt),In%=Pt,de.splice(In++,0,$e)}return Ie(de)}function Et(Dt){var de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt=[],_n,ie,ae,Y;for(Dt=le(Dt),_n=Dt.length,de=T,qe=0,$e=w,Ce=0;Ce<_n;++Ce)kt=Dt[Ce],kt<128&&jt.push(j(kt));for(Pt=In=jt.length,In&&jt.push(S);Pt<_n;){for(ue=g,Ce=0;Ce<_n;++Ce)kt=Dt[Ce],kt>=de&&kt<ue&&(ue=kt);for(ie=Pt+1,ue-de>F((g-qe)/ie)&&z("overflow"),qe+=(ue-de)*ie,de=ue,Ce=0;Ce<_n;++Ce)if(kt=Dt[Ce],kt<de&&++qe>g&&z("overflow"),kt==de){for(At=qe,Ne=p;Oe=Ne<=$e?y:Ne>=$e+_?_:Ne-$e,!(At<Oe);Ne+=p)Y=At-Oe,ae=p-Oe,jt.push(j(pe(Oe+Y%ae,0))),At=F(Y/ae);jt.push(j(pe(At,0))),$e=Lt(qe,ie,Pt==In),qe=0,++Pt}++qe,++de}return jt.join("")}function Cn(Dt){return he(Dt,function(de){return x.test(de)?_e(de.slice(4).toLowerCase()):de})}function vn(Dt){return he(Dt,function(de){return O.test(de)?"xn--"+Et(de):de})}if(v={version:"1.4.1",ucs2:{decode:le,encode:Ie},decode:_e,encode:Et,toASCII:vn,toUnicode:Cn},f&&d)if(o.exports==f)d.exports=v;else for(V in v)v.hasOwnProperty(V)&&(f[V]=v[V]);else c.punycode=v})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],104:[function(i,o,a){function u(f,d){return Object.prototype.hasOwnProperty.call(f,d)}o.exports=function(f,d,h,v){d=d||"&",h=h||"=";var g={};if(typeof f!="string"||f.length===0)return g;var p=/\+/g;f=f.split(d);var y=1e3;v&&typeof v.maxKeys=="number"&&(y=v.maxKeys);var _=f.length;y>0&&_>y&&(_=y);for(var b=0;b<_;++b){var A=f[b].replace(p,"%20"),w=A.indexOf(h),T,S,x,O;w>=0?(T=A.substr(0,w),S=A.substr(w+1)):(T=A,S=""),x=decodeURIComponent(T),O=decodeURIComponent(S),u(g,x)?c(g[x])?g[x].push(O):g[x]=[g[x],O]:g[x]=O}return g};var c=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],105:[function(i,o,a){var u=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};o.exports=function(h,v,g,p){return v=v||"&",g=g||"=",h===null&&(h=void 0),typeof h=="object"?f(d(h),function(y){var _=encodeURIComponent(u(y))+g;return c(h[y])?f(h[y],function(b){return _+encodeURIComponent(u(b))}).join(v):_+encodeURIComponent(u(h[y]))}).join(v):p?encodeURIComponent(u(p))+g+encodeURIComponent(u(h)):""};var c=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function f(h,v){if(h.map)return h.map(v);for(var g=[],p=0;p<h.length;p++)g.push(v(h[p],p));return g}var d=Object.keys||function(h){var v=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&v.push(g);return v}},{}],106:[function(i,o,a){a.decode=a.parse=i("./decode"),a.encode=a.stringify=i("./encode")},{"./decode":104,"./encode":105}],107:[function(i,o,a){const{AbortError:u,codes:c}=i("../../ours/errors"),{isNodeStream:f,isWebStream:d,kControllerErrorFunction:h}=i("./utils"),v=i("./end-of-stream"),{ERR_INVALID_ARG_TYPE:g}=c,p=(y,_)=>{if(typeof y!="object"||!("aborted"in y))throw new g(_,"AbortSignal",y)};o.exports.addAbortSignal=function(_,b){if(p(_,"signal"),!f(b)&&!d(b))throw new g("stream",["ReadableStream","WritableStream","Stream"],b);return o.exports.addAbortSignalNoValidate(_,b)},o.exports.addAbortSignalNoValidate=function(y,_){if(typeof y!="object"||!("aborted"in y))return _;const b=f(_)?()=>{_.destroy(new u(void 0,{cause:y.reason}))}:()=>{_[h](new u(void 0,{cause:y.reason}))};return y.aborted?b():(y.addEventListener("abort",b),v(_,()=>y.removeEventListener("abort",b))),_}},{"../../ours/errors":126,"./end-of-stream":113,"./utils":122}],108:[function(i,o,a){const{StringPrototypeSlice:u,SymbolIterator:c,TypedArrayPrototypeSet:f,Uint8Array:d}=i("../../ours/primordials"),{Buffer:h}=i("buffer"),{inspect:v}=i("../../ours/util");o.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const y={data:p,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}unshift(p){const y={data:p,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let y=this.head,_=""+y.data;for(;(y=y.next)!==null;)_+=p+y.data;return _}concat(p){if(this.length===0)return h.alloc(0);const y=h.allocUnsafe(p>>>0);let _=this.head,b=0;for(;_;)f(y,_.data,b),b+=_.data.length,_=_.next;return y}consume(p,y){const _=this.head.data;if(p<_.length){const b=_.slice(0,p);return this.head.data=_.slice(p),b}return p===_.length?this.shift():y?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[c](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let y="",_=this.head,b=0;do{const A=_.data;if(p>A.length)y+=A,p-=A.length;else{p===A.length?(y+=A,++b,_.next?this.head=_.next:this.head=this.tail=null):(y+=u(A,0,p),this.head=_,_.data=u(A,p));break}++b}while((_=_.next)!==null);return this.length-=b,y}_getBuffer(p){const y=h.allocUnsafe(p),_=p;let b=this.head,A=0;do{const w=b.data;if(p>w.length)f(y,w,_-p),p-=w.length;else{p===w.length?(f(y,w,_-p),++A,b.next?this.head=b.next:this.head=this.tail=null):(f(y,new d(w.buffer,w.byteOffset,p),_-p),this.head=b,b.data=w.slice(p));break}++A}while((b=b.next)!==null);return this.length-=A,y}[Symbol.for("nodejs.util.inspect.custom")](p,y){return v(this,{...y,depth:0,customInspect:!1})}}},{"../../ours/primordials":127,"../../ours/util":128,buffer:29}],109:[function(i,o,a){const{pipeline:u}=i("./pipeline"),c=i("./duplex"),{destroyer:f}=i("./destroy"),{isNodeStream:d,isReadable:h,isWritable:v,isWebStream:g,isTransformStream:p,isWritableStream:y,isReadableStream:_}=i("./utils"),{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:A,ERR_MISSING_ARGS:w}}=i("../../ours/errors"),T=i("./end-of-stream");o.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return c.from(x[0]);const O=[...x];if(typeof x[0]=="function"&&(x[0]=c.from(x[0])),typeof x[x.length-1]=="function"){const Ie=x.length-1;x[Ie]=c.from(x[Ie])}for(let Ie=0;Ie<x.length;++Ie)if(!(!d(x[Ie])&&!g(x[Ie]))){if(Ie<x.length-1&&!(h(x[Ie])||_(x[Ie])||p(x[Ie])))throw new A(`streams[${Ie}]`,O[Ie],"must be readable");if(Ie>0&&!(v(x[Ie])||y(x[Ie])||p(x[Ie])))throw new A(`streams[${Ie}]`,O[Ie],"must be writable")}let L,M,re,F,j;function V(Ie){const Fe=F;F=null,Fe?Fe(Ie):Ie?j.destroy(Ie):!le&&!he&&j.destroy()}const z=x[0],$=u(x,V),he=!!(v(z)||y(z)||p(z)),le=!!(h($)||_($)||p($));if(j=new c({writableObjectMode:!!(z!=null&&z.writableObjectMode),readableObjectMode:!!($!=null&&$.writableObjectMode),writable:he,readable:le}),he){if(d(z))j._write=function(Fe,pe,Lt){z.write(Fe,pe)?Lt():L=Lt},j._final=function(Fe){z.end(),M=Fe},z.on("drain",function(){if(L){const Fe=L;L=null,Fe()}});else if(g(z)){const pe=(p(z)?z.writable:z).getWriter();j._write=async function(Lt,_e,Et){try{await pe.ready,pe.write(Lt).catch(()=>{}),Et()}catch(Cn){Et(Cn)}},j._final=async function(Lt){try{await pe.ready,pe.close().catch(()=>{}),M=Lt}catch(_e){Lt(_e)}}}const Ie=p($)?$.readable:$;T(Ie,()=>{if(M){const Fe=M;M=null,Fe()}})}if(le){if(d($))$.on("readable",function(){if(re){const Ie=re;re=null,Ie()}}),$.on("end",function(){j.push(null)}),j._read=function(){for(;;){const Ie=$.read();if(Ie===null){re=j._read;return}if(!j.push(Ie))return}};else if(g($)){const Fe=(p($)?$.readable:$).getReader();j._read=async function(){for(;;)try{const{value:pe,done:Lt}=await Fe.read();if(!j.push(pe))return;if(Lt){j.push(null);return}}catch{return}}}}return j._destroy=function(Ie,Fe){!Ie&&F!==null&&(Ie=new b),re=null,L=null,M=null,F===null?Fe(Ie):(F=Fe,d($)&&f($,Ie))},j}},{"../../ours/errors":126,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./pipeline":118,"./utils":122}],110:[function(i,o,a){const u=i("process/"),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:f},AbortError:d}=i("../../ours/errors"),{Symbol:h}=i("../../ours/primordials"),{kDestroyed:v,isDestroyed:g,isFinished:p,isServerRequest:y}=i("./utils"),_=h("kDestroy"),b=h("kConstruct");function A(le,Ie,Fe){le&&(le.stack,Ie&&!Ie.errored&&(Ie.errored=le),Fe&&!Fe.errored&&(Fe.errored=le))}function w(le,Ie){const Fe=this._readableState,pe=this._writableState,Lt=pe||Fe;return pe!=null&&pe.destroyed||Fe!=null&&Fe.destroyed?(typeof Ie=="function"&&Ie(),this):(A(le,pe,Fe),pe&&(pe.destroyed=!0),Fe&&(Fe.destroyed=!0),Lt.constructed?T(this,le,Ie):this.once(_,function(_e){T(this,c(_e,le),Ie)}),this)}function T(le,Ie,Fe){let pe=!1;function Lt(_e){if(pe)return;pe=!0;const Et=le._readableState,Cn=le._writableState;A(_e,Cn,Et),Cn&&(Cn.closed=!0),Et&&(Et.closed=!0),typeof Fe=="function"&&Fe(_e),_e?u.nextTick(S,le,_e):u.nextTick(x,le)}try{le._destroy(Ie||null,Lt)}catch(_e){Lt(_e)}}function S(le,Ie){O(le,Ie),x(le)}function x(le){const Ie=le._readableState,Fe=le._writableState;Fe&&(Fe.closeEmitted=!0),Ie&&(Ie.closeEmitted=!0),(Fe!=null&&Fe.emitClose||Ie!=null&&Ie.emitClose)&&le.emit("close")}function O(le,Ie){const Fe=le._readableState,pe=le._writableState;pe!=null&&pe.errorEmitted||Fe!=null&&Fe.errorEmitted||(pe&&(pe.errorEmitted=!0),Fe&&(Fe.errorEmitted=!0),le.emit("error",Ie))}function L(){const le=this._readableState,Ie=this._writableState;le&&(le.constructed=!0,le.closed=!1,le.closeEmitted=!1,le.destroyed=!1,le.errored=null,le.errorEmitted=!1,le.reading=!1,le.ended=le.readable===!1,le.endEmitted=le.readable===!1),Ie&&(Ie.constructed=!0,Ie.destroyed=!1,Ie.closed=!1,Ie.closeEmitted=!1,Ie.errored=null,Ie.errorEmitted=!1,Ie.finalCalled=!1,Ie.prefinished=!1,Ie.ended=Ie.writable===!1,Ie.ending=Ie.writable===!1,Ie.finished=Ie.writable===!1)}function M(le,Ie,Fe){const pe=le._readableState,Lt=le._writableState;if(Lt!=null&&Lt.destroyed||pe!=null&&pe.destroyed)return this;pe!=null&&pe.autoDestroy||Lt!=null&&Lt.autoDestroy?le.destroy(Ie):Ie&&(Ie.stack,Lt&&!Lt.errored&&(Lt.errored=Ie),pe&&!pe.errored&&(pe.errored=Ie),Fe?u.nextTick(O,le,Ie):O(le,Ie))}function re(le,Ie){if(typeof le._construct!="function")return;const Fe=le._readableState,pe=le._writableState;Fe&&(Fe.constructed=!1),pe&&(pe.constructed=!1),le.once(b,Ie),!(le.listenerCount(b)>1)&&u.nextTick(F,le)}function F(le){let Ie=!1;function Fe(pe){if(Ie){M(le,pe??new f);return}Ie=!0;const Lt=le._readableState,_e=le._writableState,Et=_e||Lt;Lt&&(Lt.constructed=!0),_e&&(_e.constructed=!0),Et.destroyed?le.emit(_,pe):pe?M(le,pe,!0):u.nextTick(j,le)}try{le._construct(pe=>{u.nextTick(Fe,pe)})}catch(pe){u.nextTick(Fe,pe)}}function j(le){le.emit(b)}function V(le){return(le==null?void 0:le.setHeader)&&typeof le.abort=="function"}function z(le){le.emit("close")}function $(le,Ie){le.emit("error",Ie),u.nextTick(z,le)}function he(le,Ie){!le||g(le)||(!Ie&&!p(le)&&(Ie=new d),y(le)?(le.socket=null,le.destroy(Ie)):V(le)?le.abort():V(le.req)?le.req.abort():typeof le.destroy=="function"?le.destroy(Ie):typeof le.close=="function"?le.close():Ie?u.nextTick($,le,Ie):u.nextTick(z,le),le.destroyed||(le[v]=!0))}o.exports={construct:re,destroyer:he,destroy:w,undestroy:L,errorOrDestroy:M}},{"../../ours/errors":126,"../../ours/primordials":127,"./utils":122,"process/":102}],111:[function(i,o,a){const{ObjectDefineProperties:u,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:f,ObjectSetPrototypeOf:d}=i("../../ours/primordials");o.exports=g;const h=i("./readable"),v=i("./writable");d(g.prototype,h.prototype),d(g,h);{const b=f(v.prototype);for(let A=0;A<b.length;A++){const w=b[A];g.prototype[w]||(g.prototype[w]=v.prototype[w])}}function g(b){if(!(this instanceof g))return new g(b);h.call(this,b),v.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}u(g.prototype,{writable:{__proto__:null,...c(v.prototype,"writable")},writableHighWaterMark:{__proto__:null,...c(v.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...c(v.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...c(v.prototype,"writableBuffer")},writableLength:{__proto__:null,...c(v.prototype,"writableLength")},writableFinished:{__proto__:null,...c(v.prototype,"writableFinished")},writableCorked:{__proto__:null,...c(v.prototype,"writableCorked")},writableEnded:{__proto__:null,...c(v.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...c(v.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let p;function y(){return p===void 0&&(p={}),p}g.fromWeb=function(b,A){return y().newStreamDuplexFromReadableWritablePair(b,A)},g.toWeb=function(b){return y().newReadableWritablePairFromDuplex(b)};let _;g.from=function(b){return _||(_=i("./duplexify")),_(b,"body")}},{"../../ours/primordials":127,"./duplexify":112,"./readable":119,"./writable":123}],112:[function(i,o,a){const u=i("process/"),c=i("buffer"),{isReadable:f,isWritable:d,isIterable:h,isNodeStream:v,isReadableNodeStream:g,isWritableNodeStream:p,isDuplexNodeStream:y}=i("./utils"),_=i("./end-of-stream"),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:w}}=i("../../ours/errors"),{destroyer:T}=i("./destroy"),S=i("./duplex"),x=i("./readable"),{createDeferredPromise:O}=i("../../ours/util"),L=i("./from"),M=globalThis.Blob||c.Blob,re=typeof M<"u"?function(le){return le instanceof M}:function(le){return!1},F=globalThis.AbortController||i("abort-controller").AbortController,{FunctionPrototypeCall:j}=i("../../ours/primordials");class V extends S{constructor(le){super(le),(le==null?void 0:le.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(le==null?void 0:le.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}o.exports=function he(le,Ie){if(y(le))return le;if(g(le))return $({readable:le});if(p(le))return $({writable:le});if(v(le))return $({writable:!1,readable:!1});if(typeof le=="function"){const{value:pe,write:Lt,final:_e,destroy:Et}=z(le);if(h(pe))return L(V,pe,{objectMode:!0,write:Lt,final:_e,destroy:Et});const Cn=pe==null?void 0:pe.then;if(typeof Cn=="function"){let vn;const Dt=j(Cn,pe,de=>{if(de!=null)throw new w("nully","body",de)},de=>{T(vn,de)});return vn=new V({objectMode:!0,readable:!1,write:Lt,final(de){_e(async()=>{try{await Dt,u.nextTick(de,null)}catch(qe){u.nextTick(de,qe)}})},destroy:Et})}throw new w("Iterable, AsyncIterable or AsyncFunction",Ie,pe)}if(re(le))return he(le.arrayBuffer());if(h(le))return L(V,le,{objectMode:!0,writable:!1});if(typeof(le==null?void 0:le.writable)=="object"||typeof(le==null?void 0:le.readable)=="object"){const pe=le!=null&&le.readable?g(le==null?void 0:le.readable)?le==null?void 0:le.readable:he(le.readable):void 0,Lt=le!=null&&le.writable?p(le==null?void 0:le.writable)?le==null?void 0:le.writable:he(le.writable):void 0;return $({readable:pe,writable:Lt})}const Fe=le==null?void 0:le.then;if(typeof Fe=="function"){let pe;return j(Fe,le,Lt=>{Lt!=null&&pe.push(Lt),pe.push(null)},Lt=>{T(pe,Lt)}),pe=new V({objectMode:!0,writable:!1,read(){}})}throw new A(Ie,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],le)};function z(he){let{promise:le,resolve:Ie}=O();const Fe=new F,pe=Fe.signal;return{value:he(async function*(){for(;;){const _e=le;le=null;const{chunk:Et,done:Cn,cb:vn}=await _e;if(u.nextTick(vn),Cn)return;if(pe.aborted)throw new b(void 0,{cause:pe.reason});({promise:le,resolve:Ie}=O()),yield Et}}(),{signal:pe}),write(_e,Et,Cn){const vn=Ie;Ie=null,vn({chunk:_e,done:!1,cb:Cn})},final(_e){const Et=Ie;Ie=null,Et({done:!0,cb:_e})},destroy(_e,Et){Fe.abort(),Et(_e)}}}function $(he){const le=he.readable&&typeof he.readable.read!="function"?x.wrap(he.readable):he.readable,Ie=he.writable;let Fe=!!f(le),pe=!!d(Ie),Lt,_e,Et,Cn,vn;function Dt(de){const qe=Cn;Cn=null,qe?qe(de):de&&vn.destroy(de)}return vn=new V({readableObjectMode:!!(le!=null&&le.readableObjectMode),writableObjectMode:!!(Ie!=null&&Ie.writableObjectMode),readable:Fe,writable:pe}),pe&&(_(Ie,de=>{pe=!1,de&&T(le,de),Dt(de)}),vn._write=function(de,qe,Pt){Ie.write(de,qe)?Pt():Lt=Pt},vn._final=function(de){Ie.end(),_e=de},Ie.on("drain",function(){if(Lt){const de=Lt;Lt=null,de()}}),Ie.on("finish",function(){if(_e){const de=_e;_e=null,de()}})),Fe&&(_(le,de=>{Fe=!1,de&&T(le,de),Dt(de)}),le.on("readable",function(){if(Et){const de=Et;Et=null,de()}}),le.on("end",function(){vn.push(null)}),vn._read=function(){for(;;){const de=le.read();if(de===null){Et=vn._read;return}if(!vn.push(de))return}}),vn._destroy=function(de,qe){!de&&Cn!==null&&(de=new b),Et=null,Lt=null,_e=null,Cn===null?qe(de):(Cn=qe,T(Ie,de),T(le,de))},vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./readable":119,"./utils":122,"abort-controller":24,buffer:29,"process/":102}],113:[function(i,o,a){const u=i("process/"),{AbortError:c,codes:f}=i("../../ours/errors"),{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:h}=f,{kEmptyObject:v,once:g}=i("../../ours/util"),{validateAbortSignal:p,validateFunction:y,validateObject:_,validateBoolean:b}=i("../validators"),{Promise:A,PromisePrototypeThen:w}=i("../../ours/primordials"),{isClosed:T,isReadable:S,isReadableNodeStream:x,isReadableStream:O,isReadableFinished:L,isReadableErrored:M,isWritable:re,isWritableNodeStream:F,isWritableStream:j,isWritableFinished:V,isWritableErrored:z,isNodeStream:$,willEmitClose:he,kIsClosedPromise:le}=i("./utils");function Ie(Et){return Et.setHeader&&typeof Et.abort=="function"}const Fe=()=>{};function pe(Et,Cn,vn){var Dt,de;if(arguments.length===2?(vn=Cn,Cn=v):Cn==null?Cn=v:_(Cn,"options"),y(vn,"callback"),p(Cn.signal,"options.signal"),vn=g(vn),O(Et)||j(Et))return Lt(Et,Cn,vn);if(!$(Et))throw new d("stream",["ReadableStream","WritableStream","Stream"],Et);const qe=(Dt=Cn.readable)!==null&&Dt!==void 0?Dt:x(Et),Pt=(de=Cn.writable)!==null&&de!==void 0?de:F(Et),In=Et._writableState,$e=Et._readableState,Ce=()=>{Et.writable||Ne()};let ue=he(Et)&&x(Et)===qe&&F(Et)===Pt,At=V(Et,!1);const Ne=()=>{At=!0,Et.destroyed&&(ue=!1),!(ue&&(!Et.readable||qe))&&(!qe||Oe)&&vn.call(Et)};let Oe=L(Et,!1);const kt=()=>{Oe=!0,Et.destroyed&&(ue=!1),!(ue&&(!Et.writable||Pt))&&(!Pt||At)&&vn.call(Et)},jt=D=>{vn.call(Et,D)};let _n=T(Et);const ie=()=>{_n=!0;const D=z(Et)||M(Et);if(D&&typeof D!="boolean")return vn.call(Et,D);if(qe&&!Oe&&x(Et,!0)&&!L(Et,!1))return vn.call(Et,new h);if(Pt&&!At&&!V(Et,!1))return vn.call(Et,new h);vn.call(Et)},ae=()=>{_n=!0;const D=z(Et)||M(Et);if(D&&typeof D!="boolean")return vn.call(Et,D);vn.call(Et)},Y=()=>{Et.req.on("finish",Ne)};Ie(Et)?(Et.on("complete",Ne),ue||Et.on("abort",ie),Et.req?Y():Et.on("request",Y)):Pt&&!In&&(Et.on("end",Ce),Et.on("close",Ce)),!ue&&typeof Et.aborted=="boolean"&&Et.on("aborted",ie),Et.on("end",kt),Et.on("finish",Ne),Cn.error!==!1&&Et.on("error",jt),Et.on("close",ie),_n?u.nextTick(ie):In!=null&&In.errorEmitted||$e!=null&&$e.errorEmitted?ue||u.nextTick(ae):(!qe&&(!ue||S(Et))&&(At||re(Et)===!1)||!Pt&&(!ue||re(Et))&&(Oe||S(Et)===!1)||$e&&Et.req&&Et.aborted)&&u.nextTick(ae);const k=()=>{vn=Fe,Et.removeListener("aborted",ie),Et.removeListener("complete",Ne),Et.removeListener("abort",ie),Et.removeListener("request",Y),Et.req&&Et.req.removeListener("finish",Ne),Et.removeListener("end",Ce),Et.removeListener("close",Ce),Et.removeListener("finish",Ne),Et.removeListener("end",kt),Et.removeListener("error",jt),Et.removeListener("close",ie)};if(Cn.signal&&!_n){const D=()=>{const oe=vn;k(),oe.call(Et,new c(void 0,{cause:Cn.signal.reason}))};if(Cn.signal.aborted)u.nextTick(D);else{const oe=vn;vn=g((...xe)=>{Cn.signal.removeEventListener("abort",D),oe.apply(Et,xe)}),Cn.signal.addEventListener("abort",D)}}return k}function Lt(Et,Cn,vn){let Dt=!1,de=Fe;if(Cn.signal)if(de=()=>{Dt=!0,vn.call(Et,new c(void 0,{cause:Cn.signal.reason}))},Cn.signal.aborted)u.nextTick(de);else{const Pt=vn;vn=g((...In)=>{Cn.signal.removeEventListener("abort",de),Pt.apply(Et,In)}),Cn.signal.addEventListener("abort",de)}const qe=(...Pt)=>{Dt||u.nextTick(()=>vn.apply(Et,Pt))};return w(Et[le].promise,qe,qe),Fe}function _e(Et,Cn){var vn;let Dt=!1;return Cn===null&&(Cn=v),(vn=Cn)!==null&&vn!==void 0&&vn.cleanup&&(b(Cn.cleanup,"cleanup"),Dt=Cn.cleanup),new A((de,qe)=>{const Pt=pe(Et,Cn,In=>{Dt&&Pt(),In?qe(In):de()})})}o.exports=pe,o.exports.finished=_e},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./utils":122,"process/":102}],114:[function(i,o,a){const u=i("process/"),{PromisePrototypeThen:c,SymbolAsyncIterator:f,SymbolIterator:d}=i("../../ours/primordials"),{Buffer:h}=i("buffer"),{ERR_INVALID_ARG_TYPE:v,ERR_STREAM_NULL_VALUES:g}=i("../../ours/errors").codes;function p(y,_,b){let A;if(typeof _=="string"||_ instanceof h)return new y({objectMode:!0,...b,read(){this.push(_),this.push(null)}});let w;if(_&&_[f])w=!0,A=_[f]();else if(_&&_[d])w=!1,A=_[d]();else throw new v("iterable",["Iterable"],_);const T=new y({objectMode:!0,highWaterMark:1,...b});let S=!1;T._read=function(){S||(S=!0,O())},T._destroy=function(L,M){c(x(L),()=>u.nextTick(M,L),re=>u.nextTick(M,re||L))};async function x(L){const M=L!=null,re=typeof A.throw=="function";if(M&&re){const{value:F,done:j}=await A.throw(L);if(await F,j)return}if(typeof A.return=="function"){const{value:F}=await A.return();await F}}async function O(){for(;;){try{const{value:L,done:M}=w?await A.next():A.next();if(M)T.push(null);else{const re=L&&typeof L.then=="function"?await L:L;if(re===null)throw S=!1,new g;if(T.push(re))continue;S=!1}}catch(L){T.destroy(L)}break}}return T}o.exports=p},{"../../ours/errors":126,"../../ours/primordials":127,buffer:29,"process/":102}],115:[function(i,o,a){const{ArrayIsArray:u,ObjectSetPrototypeOf:c}=i("../../ours/primordials"),{EventEmitter:f}=i("events");function d(v){f.call(this,v)}c(d.prototype,f.prototype),c(d,f),d.prototype.pipe=function(v,g){const p=this;function y(x){v.writable&&v.write(x)===!1&&p.pause&&p.pause()}p.on("data",y);function _(){p.readable&&p.resume&&p.resume()}v.on("drain",_),!v._isStdio&&(!g||g.end!==!1)&&(p.on("end",A),p.on("close",w));let b=!1;function A(){b||(b=!0,v.end())}function w(){b||(b=!0,typeof v.destroy=="function"&&v.destroy())}function T(x){S(),f.listenerCount(this,"error")===0&&this.emit("error",x)}h(p,"error",T),h(v,"error",T);function S(){p.removeListener("data",y),v.removeListener("drain",_),p.removeListener("end",A),p.removeListener("close",w),p.removeListener("error",T),v.removeListener("error",T),p.removeListener("end",S),p.removeListener("close",S),v.removeListener("close",S)}return p.on("end",S),p.on("close",S),v.on("close",S),v.emit("pipe",p),v};function h(v,g,p){if(typeof v.prependListener=="function")return v.prependListener(g,p);!v._events||!v._events[g]?v.on(g,p):u(v._events[g])?v._events[g].unshift(p):v._events[g]=[p,v._events[g]]}o.exports={Stream:d,prependListener:h}},{"../../ours/primordials":127,events:49}],116:[function(i,o,a){const u=globalThis.AbortController||i("abort-controller").AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:f,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:h},AbortError:v}=i("../../ours/errors"),{validateAbortSignal:g,validateInteger:p,validateObject:y}=i("../validators"),_=i("../../ours/primordials").Symbol("kWeak"),{finished:b}=i("./end-of-stream"),A=i("./compose"),{addAbortSignalNoValidate:w}=i("./add-abort-signal"),{isWritable:T,isNodeStream:S}=i("./utils"),{ArrayPrototypePush:x,MathFloor:O,Number:L,NumberIsNaN:M,Promise:re,PromiseReject:F,PromisePrototypeThen:j,Symbol:V}=i("../../ours/primordials"),z=V("kEmpty"),$=V("kEof");function he($e,Ce){if(Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),S($e)&&!T($e))throw new c("stream",$e,"must be writable");const ue=A(this,$e);return Ce!=null&&Ce.signal&&w(Ce.signal,ue),ue}function le($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal");let ue=1;return(Ce==null?void 0:Ce.concurrency)!=null&&(ue=O(Ce.concurrency)),p(ue,"concurrency",1),async function*(){var Ne,Oe;const kt=new u,jt=this,_n=[],ie=kt.signal,ae={signal:ie},Y=()=>kt.abort();Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted&&Y(),Ce==null||(Oe=Ce.signal)===null||Oe===void 0||Oe.addEventListener("abort",Y);let k,D,oe=!1;function xe(){oe=!0}async function ze(){try{for await(let Tn of jt){var hn;if(oe)return;if(ie.aborted)throw new v;try{Tn=$e(Tn,ae)}catch(Rn){Tn=F(Rn)}Tn!==z&&(typeof((hn=Tn)===null||hn===void 0?void 0:hn.catch)=="function"&&Tn.catch(xe),_n.push(Tn),k&&(k(),k=null),!oe&&_n.length&&_n.length>=ue&&await new re(Rn=>{D=Rn}))}_n.push($)}catch(Tn){const Rn=F(Tn);j(Rn,void 0,xe),_n.push(Rn)}finally{var An;oe=!0,k&&(k(),k=null),Ce==null||(An=Ce.signal)===null||An===void 0||An.removeEventListener("abort",Y)}}ze();try{for(;;){for(;_n.length>0;){const hn=await _n[0];if(hn===$)return;if(ie.aborted)throw new v;hn!==z&&(yield hn),_n.shift(),D&&(D(),D=null)}await new re(hn=>{k=hn})}}finally{kt.abort(),oe=!0,D&&(D(),D=null)}}.call(this)}function Ie($e=void 0){return $e!=null&&y($e,"options"),($e==null?void 0:$e.signal)!=null&&g($e.signal,"options.signal"),async function*(){let ue=0;for await(const Ne of this){var At;if($e!=null&&(At=$e.signal)!==null&&At!==void 0&&At.aborted)throw new v({cause:$e.signal.reason});yield[ue++,Ne]}}.call(this)}async function Fe($e,Ce=void 0){for await(const ue of Et.call(this,$e,Ce))return!0;return!1}async function pe($e,Ce=void 0){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);return!await Fe.call(this,async(...ue)=>!await $e(...ue),Ce)}async function Lt($e,Ce){for await(const ue of Et.call(this,$e,Ce))return ue}async function _e($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);async function ue(At,Ne){return await $e(At,Ne),z}for await(const At of le.call(this,ue,Ce));}function Et($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);async function ue(At,Ne){return await $e(At,Ne)?At:z}return le.call(this,ue,Ce)}class Cn extends d{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function vn($e,Ce,ue){var At;if(typeof $e!="function")throw new f("reducer",["Function","AsyncFunction"],$e);ue!=null&&y(ue,"options"),(ue==null?void 0:ue.signal)!=null&&g(ue.signal,"options.signal");let Ne=arguments.length>1;if(ue!=null&&(At=ue.signal)!==null&&At!==void 0&&At.aborted){const ie=new v(void 0,{cause:ue.signal.reason});throw this.once("error",()=>{}),await b(this.destroy(ie)),ie}const Oe=new u,kt=Oe.signal;if(ue!=null&&ue.signal){const ie={once:!0,[_]:this};ue.signal.addEventListener("abort",()=>Oe.abort(),ie)}let jt=!1;try{for await(const ie of this){var _n;if(jt=!0,ue!=null&&(_n=ue.signal)!==null&&_n!==void 0&&_n.aborted)throw new v;Ne?Ce=await $e(Ce,ie,{signal:kt}):(Ce=ie,Ne=!0)}if(!jt&&!Ne)throw new Cn}finally{Oe.abort()}return Ce}async function Dt($e){$e!=null&&y($e,"options"),($e==null?void 0:$e.signal)!=null&&g($e.signal,"options.signal");const Ce=[];for await(const At of this){var ue;if($e!=null&&(ue=$e.signal)!==null&&ue!==void 0&&ue.aborted)throw new v(void 0,{cause:$e.signal.reason});x(Ce,At)}return Ce}function de($e,Ce){const ue=le.call(this,$e,Ce);return async function*(){for await(const Ne of ue)yield*Ne}.call(this)}function qe($e){if($e=L($e),M($e))return 0;if($e<0)throw new h("number",">= 0",$e);return $e}function Pt($e,Ce=void 0){return Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),$e=qe($e),async function*(){var At;if(Ce!=null&&(At=Ce.signal)!==null&&At!==void 0&&At.aborted)throw new v;for await(const Oe of this){var Ne;if(Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted)throw new v;$e--<=0&&(yield Oe)}}.call(this)}function In($e,Ce=void 0){return Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),$e=qe($e),async function*(){var At;if(Ce!=null&&(At=Ce.signal)!==null&&At!==void 0&&At.aborted)throw new v;for await(const Oe of this){var Ne;if(Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted)throw new v;if($e-- >0)yield Oe;else return}}.call(this)}o.exports.streamReturningOperators={asIndexedPairs:Ie,drop:Pt,filter:Et,flatMap:de,map:le,take:In,compose:he},o.exports.promiseReturningOperators={every:pe,forEach:_e,reduce:vn,toArray:Dt,some:Fe,find:Lt}},{"../../ours/errors":126,"../../ours/primordials":127,"../validators":124,"./add-abort-signal":107,"./compose":109,"./end-of-stream":113,"./utils":122,"abort-controller":24}],117:[function(i,o,a){const{ObjectSetPrototypeOf:u}=i("../../ours/primordials");o.exports=f;const c=i("./transform");u(f.prototype,c.prototype),u(f,c);function f(d){if(!(this instanceof f))return new f(d);c.call(this,d)}f.prototype._transform=function(d,h,v){v(null,d)}},{"../../ours/primordials":127,"./transform":121}],118:[function(i,o,a){const u=i("process/"),{ArrayIsArray:c,Promise:f,SymbolAsyncIterator:d}=i("../../ours/primordials"),h=i("./end-of-stream"),{once:v}=i("../../ours/util"),g=i("./destroy"),p=i("./duplex"),{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:T},AbortError:S}=i("../../ours/errors"),{validateFunction:x,validateAbortSignal:O}=i("../validators"),{isIterable:L,isReadable:M,isReadableNodeStream:re,isNodeStream:F,isTransformStream:j,isWebStream:V,isReadableStream:z,isReadableEnded:$}=i("./utils"),he=globalThis.AbortController||i("abort-controller").AbortController;let le,Ie;function Fe(qe,Pt,In){let $e=!1;qe.on("close",()=>{$e=!0});const Ce=h(qe,{readable:Pt,writable:In},ue=>{$e=!ue});return{destroy:ue=>{$e||($e=!0,g.destroyer(qe,ue||new w("pipe")))},cleanup:Ce}}function pe(qe){return x(qe[qe.length-1],"streams[stream.length - 1]"),qe.pop()}function Lt(qe){if(L(qe))return qe;if(re(qe))return _e(qe);throw new _("val",["Readable","Iterable","AsyncIterable"],qe)}async function*_e(qe){Ie||(Ie=i("./readable")),yield*Ie.prototype[d].call(qe)}async function Et(qe,Pt,In,{end:$e}){let Ce,ue=null;const At=kt=>{if(kt&&(Ce=kt),ue){const jt=ue;ue=null,jt()}},Ne=()=>new f((kt,jt)=>{Ce?jt(Ce):ue=()=>{Ce?jt(Ce):kt()}});Pt.on("drain",At);const Oe=h(Pt,{readable:!1},At);try{Pt.writableNeedDrain&&await Ne();for await(const kt of qe)Pt.write(kt)||await Ne();$e&&Pt.end(),await Ne(),In()}catch(kt){In(Ce!==kt?y(Ce,kt):kt)}finally{Oe(),Pt.off("drain",At)}}async function Cn(qe,Pt,In,{end:$e}){j(Pt)&&(Pt=Pt.writable);const Ce=Pt.getWriter();try{for await(const ue of qe)await Ce.ready,Ce.write(ue).catch(()=>{});await Ce.ready,$e&&await Ce.close(),In()}catch(ue){try{await Ce.abort(ue),In(ue)}catch(At){In(At)}}}function vn(...qe){return Dt(qe,v(pe(qe)))}function Dt(qe,Pt,In){if(qe.length===1&&c(qe[0])&&(qe=qe[0]),qe.length<2)throw new A("streams");const $e=new he,Ce=$e.signal,ue=In==null?void 0:In.signal,At=[];O(ue,"options.signal");function Ne(){ae(new S)}ue==null||ue.addEventListener("abort",Ne);let Oe,kt;const jt=[];let _n=0;function ie(oe){ae(oe,--_n===0)}function ae(oe,xe){if(oe&&(!Oe||Oe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Oe=oe),!(!Oe&&!xe)){for(;jt.length;)jt.shift()(Oe);ue==null||ue.removeEventListener("abort",Ne),$e.abort(),xe&&(Oe||At.forEach(ze=>ze()),u.nextTick(Pt,Oe,kt))}}let Y;for(let oe=0;oe<qe.length;oe++){const xe=qe[oe],ze=oe<qe.length-1,hn=oe>0,An=ze||(In==null?void 0:In.end)!==!1,Tn=oe===qe.length-1;if(F(xe)){let Rn=function(Ve){Ve&&Ve.name!=="AbortError"&&Ve.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ie(Ve)};if(An){const{destroy:Ve,cleanup:Ue}=Fe(xe,ze,hn);jt.push(Ve),M(xe)&&Tn&&At.push(Ue)}xe.on("error",Rn),M(xe)&&Tn&&At.push(()=>{xe.removeListener("error",Rn)})}if(oe===0)if(typeof xe=="function"){if(Y=xe({signal:Ce}),!L(Y))throw new b("Iterable, AsyncIterable or Stream","source",Y)}else L(xe)||re(xe)||j(xe)?Y=xe:Y=p.from(xe);else if(typeof xe=="function"){if(j(Y)){var k;Y=Lt((k=Y)===null||k===void 0?void 0:k.readable)}else Y=Lt(Y);if(Y=xe(Y,{signal:Ce}),ze){if(!L(Y,!0))throw new b("AsyncIterable",`transform[${oe-1}]`,Y)}else{var D;le||(le=i("./passthrough"));const Rn=new le({objectMode:!0}),Ve=(D=Y)===null||D===void 0?void 0:D.then;if(typeof Ve=="function")_n++,Ve.call(Y,Sn=>{kt=Sn,Sn!=null&&Rn.write(Sn),An&&Rn.end(),u.nextTick(ie)},Sn=>{Rn.destroy(Sn),u.nextTick(ie,Sn)});else if(L(Y,!0))_n++,Et(Y,Rn,ie,{end:An});else if(z(Y)||j(Y)){const Sn=Y.readable||Y;_n++,Et(Sn,Rn,ie,{end:An})}else throw new b("AsyncIterable or Promise","destination",Y);Y=Rn;const{destroy:Ue,cleanup:En}=Fe(Y,!1,!0);jt.push(Ue),Tn&&At.push(En)}}else if(F(xe)){if(re(Y)){_n+=2;const Rn=de(Y,xe,ie,{end:An});M(xe)&&Tn&&At.push(Rn)}else if(j(Y)||z(Y)){const Rn=Y.readable||Y;_n++,Et(Rn,xe,ie,{end:An})}else if(L(Y))_n++,Et(Y,xe,ie,{end:An});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=xe}else if(V(xe)){if(re(Y))_n++,Cn(Lt(Y),xe,ie,{end:An});else if(z(Y)||L(Y))_n++,Cn(Y,xe,ie,{end:An});else if(j(Y))_n++,Cn(Y.readable,xe,ie,{end:An});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=xe}else Y=p.from(xe)}return(Ce!=null&&Ce.aborted||ue!=null&&ue.aborted)&&u.nextTick(Ne),Y}function de(qe,Pt,In,{end:$e}){let Ce=!1;if(Pt.on("close",()=>{Ce||In(new T)}),qe.pipe(Pt,{end:!1}),$e){let ue=function(){Ce=!0,Pt.end()};$(qe)?u.nextTick(ue):qe.once("end",ue)}else In();return h(qe,{readable:!0,writable:!1},ue=>{const At=qe._readableState;ue&&ue.code==="ERR_STREAM_PREMATURE_CLOSE"&&At&&At.ended&&!At.errored&&!At.errorEmitted?qe.once("end",In).once("error",In):In(ue)}),h(Pt,{readable:!1,writable:!0},In)}o.exports={pipelineImpl:Dt,pipeline:vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./passthrough":117,"./readable":119,"./utils":122,"abort-controller":24,"process/":102}],119:[function(i,o,a){const u=i("process/"),{ArrayPrototypeIndexOf:c,NumberIsInteger:f,NumberIsNaN:d,NumberParseInt:h,ObjectDefineProperties:v,ObjectKeys:g,ObjectSetPrototypeOf:p,Promise:y,SafeSet:_,SymbolAsyncIterator:b,Symbol:A}=i("../../ours/primordials");o.exports=de,de.ReadableState=Dt;const{EventEmitter:w}=i("events"),{Stream:T,prependListener:S}=i("./legacy"),{Buffer:x}=i("buffer"),{addAbortSignal:O}=i("./add-abort-signal"),L=i("./end-of-stream");let M=i("../../ours/util").debuglog("stream",Ve=>{M=Ve});const re=i("./buffer_list"),F=i("./destroy"),{getHighWaterMark:j,getDefaultHighWaterMark:V}=i("./state"),{aggregateTwoErrors:z,codes:{ERR_INVALID_ARG_TYPE:$,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:le,ERR_STREAM_PUSH_AFTER_EOF:Ie,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Fe}}=i("../../ours/errors"),{validateObject:pe}=i("../validators"),Lt=A("kPaused"),{StringDecoder:_e}=i("string_decoder"),Et=i("./from");p(de.prototype,T.prototype),p(de,T);const Cn=()=>{},{errorOrDestroy:vn}=F;function Dt(Ve,Ue,En){typeof En!="boolean"&&(En=Ue instanceof i("./duplex")),this.objectMode=!!(Ve&&Ve.objectMode),En&&(this.objectMode=this.objectMode||!!(Ve&&Ve.readableObjectMode)),this.highWaterMark=Ve?j(this,Ve,"readableHighWaterMark",En):V(!1),this.buffer=new re,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Lt]=null,this.errorEmitted=!1,this.emitClose=!Ve||Ve.emitClose!==!1,this.autoDestroy=!Ve||Ve.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=Ve&&Ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,Ve&&Ve.encoding&&(this.decoder=new _e(Ve.encoding),this.encoding=Ve.encoding)}function de(Ve){if(!(this instanceof de))return new de(Ve);const Ue=this instanceof i("./duplex");this._readableState=new Dt(Ve,this,Ue),Ve&&(typeof Ve.read=="function"&&(this._read=Ve.read),typeof Ve.destroy=="function"&&(this._destroy=Ve.destroy),typeof Ve.construct=="function"&&(this._construct=Ve.construct),Ve.signal&&!Ue&&O(Ve.signal,this)),T.call(this,Ve),F.construct(this,()=>{this._readableState.needReadable&&Oe(this,this._readableState)})}de.prototype.destroy=F.destroy,de.prototype._undestroy=F.undestroy,de.prototype._destroy=function(Ve,Ue){Ue(Ve)},de.prototype[w.captureRejectionSymbol]=function(Ve){this.destroy(Ve)},de.prototype.push=function(Ve,Ue){return qe(this,Ve,Ue,!1)},de.prototype.unshift=function(Ve,Ue){return qe(this,Ve,Ue,!0)};function qe(Ve,Ue,En,Sn){M("readableAddChunk",Ue);const xn=Ve._readableState;let Pn;if(xn.objectMode||(typeof Ue=="string"?(En=En||xn.defaultEncoding,xn.encoding!==En&&(Sn&&xn.encoding?Ue=x.from(Ue,En).toString(xn.encoding):(Ue=x.from(Ue,En),En=""))):Ue instanceof x?En="":T._isUint8Array(Ue)?(Ue=T._uint8ArrayToBuffer(Ue),En=""):Ue!=null&&(Pn=new $("chunk",["string","Buffer","Uint8Array"],Ue))),Pn)vn(Ve,Pn);else if(Ue===null)xn.reading=!1,ue(Ve,xn);else if(xn.objectMode||Ue&&Ue.length>0)if(Sn)if(xn.endEmitted)vn(Ve,new Fe);else{if(xn.destroyed||xn.errored)return!1;Pt(Ve,xn,Ue,!0)}else if(xn.ended)vn(Ve,new Ie);else{if(xn.destroyed||xn.errored)return!1;xn.reading=!1,xn.decoder&&!En?(Ue=xn.decoder.write(Ue),xn.objectMode||Ue.length!==0?Pt(Ve,xn,Ue,!1):Oe(Ve,xn)):Pt(Ve,xn,Ue,!1)}else Sn||(xn.reading=!1,Oe(Ve,xn));return!xn.ended&&(xn.length<xn.highWaterMark||xn.length===0)}function Pt(Ve,Ue,En,Sn){Ue.flowing&&Ue.length===0&&!Ue.sync&&Ve.listenerCount("data")>0?(Ue.multiAwaitDrain?Ue.awaitDrainWriters.clear():Ue.awaitDrainWriters=null,Ue.dataEmitted=!0,Ve.emit("data",En)):(Ue.length+=Ue.objectMode?1:En.length,Sn?Ue.buffer.unshift(En):Ue.buffer.push(En),Ue.needReadable&&At(Ve)),Oe(Ve,Ue)}de.prototype.isPaused=function(){const Ve=this._readableState;return Ve[Lt]===!0||Ve.flowing===!1},de.prototype.setEncoding=function(Ve){const Ue=new _e(Ve);this._readableState.decoder=Ue,this._readableState.encoding=this._readableState.decoder.encoding;const En=this._readableState.buffer;let Sn="";for(const xn of En)Sn+=Ue.write(xn);return En.clear(),Sn!==""&&En.push(Sn),this._readableState.length=Sn.length,this};const In=1073741824;function $e(Ve){if(Ve>In)throw new le("size","<= 1GiB",Ve);return Ve--,Ve|=Ve>>>1,Ve|=Ve>>>2,Ve|=Ve>>>4,Ve|=Ve>>>8,Ve|=Ve>>>16,Ve++,Ve}function Ce(Ve,Ue){return Ve<=0||Ue.length===0&&Ue.ended?0:Ue.objectMode?1:d(Ve)?Ue.flowing&&Ue.length?Ue.buffer.first().length:Ue.length:Ve<=Ue.length?Ve:Ue.ended?Ue.length:0}de.prototype.read=function(Ve){M("read",Ve),Ve===void 0?Ve=NaN:f(Ve)||(Ve=h(Ve,10));const Ue=this._readableState,En=Ve;if(Ve>Ue.highWaterMark&&(Ue.highWaterMark=$e(Ve)),Ve!==0&&(Ue.emittedReadable=!1),Ve===0&&Ue.needReadable&&((Ue.highWaterMark!==0?Ue.length>=Ue.highWaterMark:Ue.length>0)||Ue.ended))return M("read: emitReadable",Ue.length,Ue.ended),Ue.length===0&&Ue.ended?ze(this):At(this),null;if(Ve=Ce(Ve,Ue),Ve===0&&Ue.ended)return Ue.length===0&&ze(this),null;let Sn=Ue.needReadable;if(M("need readable",Sn),(Ue.length===0||Ue.length-Ve<Ue.highWaterMark)&&(Sn=!0,M("length less than watermark",Sn)),Ue.ended||Ue.reading||Ue.destroyed||Ue.errored||!Ue.constructed)Sn=!1,M("reading, ended or constructing",Sn);else if(Sn){M("do read"),Ue.reading=!0,Ue.sync=!0,Ue.length===0&&(Ue.needReadable=!0);try{this._read(Ue.highWaterMark)}catch(Pn){vn(this,Pn)}Ue.sync=!1,Ue.reading||(Ve=Ce(En,Ue))}let xn;return Ve>0?xn=xe(Ve,Ue):xn=null,xn===null?(Ue.needReadable=Ue.length<=Ue.highWaterMark,Ve=0):(Ue.length-=Ve,Ue.multiAwaitDrain?Ue.awaitDrainWriters.clear():Ue.awaitDrainWriters=null),Ue.length===0&&(Ue.ended||(Ue.needReadable=!0),En!==Ve&&Ue.ended&&ze(this)),xn!==null&&!Ue.errorEmitted&&!Ue.closeEmitted&&(Ue.dataEmitted=!0,this.emit("data",xn)),xn};function ue(Ve,Ue){if(M("onEofChunk"),!Ue.ended){if(Ue.decoder){const En=Ue.decoder.end();En&&En.length&&(Ue.buffer.push(En),Ue.length+=Ue.objectMode?1:En.length)}Ue.ended=!0,Ue.sync?At(Ve):(Ue.needReadable=!1,Ue.emittedReadable=!0,Ne(Ve))}}function At(Ve){const Ue=Ve._readableState;M("emitReadable",Ue.needReadable,Ue.emittedReadable),Ue.needReadable=!1,Ue.emittedReadable||(M("emitReadable",Ue.flowing),Ue.emittedReadable=!0,u.nextTick(Ne,Ve))}function Ne(Ve){const Ue=Ve._readableState;M("emitReadable_",Ue.destroyed,Ue.length,Ue.ended),!Ue.destroyed&&!Ue.errored&&(Ue.length||Ue.ended)&&(Ve.emit("readable"),Ue.emittedReadable=!1),Ue.needReadable=!Ue.flowing&&!Ue.ended&&Ue.length<=Ue.highWaterMark,k(Ve)}function Oe(Ve,Ue){!Ue.readingMore&&Ue.constructed&&(Ue.readingMore=!0,u.nextTick(kt,Ve,Ue))}function kt(Ve,Ue){for(;!Ue.reading&&!Ue.ended&&(Ue.length<Ue.highWaterMark||Ue.flowing&&Ue.length===0);){const En=Ue.length;if(M("maybeReadMore read 0"),Ve.read(0),En===Ue.length)break}Ue.readingMore=!1}de.prototype._read=function(Ve){throw new he("_read()")},de.prototype.pipe=function(Ve,Ue){const En=this,Sn=this._readableState;Sn.pipes.length===1&&(Sn.multiAwaitDrain||(Sn.multiAwaitDrain=!0,Sn.awaitDrainWriters=new _(Sn.awaitDrainWriters?[Sn.awaitDrainWriters]:[]))),Sn.pipes.push(Ve),M("pipe count=%d opts=%j",Sn.pipes.length,Ue);const Pn=(!Ue||Ue.end!==!1)&&Ve!==u.stdout&&Ve!==u.stderr?$n:Vn;Sn.endEmitted?u.nextTick(Pn):En.once("end",Pn),Ve.on("unpipe",kn);function kn(Nn,Dn){M("onunpipe"),Nn===En&&Dn&&Dn.hasUnpiped===!1&&(Dn.hasUnpiped=!0,wn())}function $n(){M("onend"),Ve.end()}let Wn,bn=!1;function wn(){M("cleanup"),Ve.removeListener("close",On),Ve.removeListener("finish",Gn),Wn&&Ve.removeListener("drain",Wn),Ve.removeListener("error",Mn),Ve.removeListener("unpipe",kn),En.removeListener("end",$n),En.removeListener("end",Vn),En.removeListener("data",Bn),bn=!0,Wn&&Sn.awaitDrainWriters&&(!Ve._writableState||Ve._writableState.needDrain)&&Wn()}function Ln(){bn||(Sn.pipes.length===1&&Sn.pipes[0]===Ve?(M("false write response, pause",0),Sn.awaitDrainWriters=Ve,Sn.multiAwaitDrain=!1):Sn.pipes.length>1&&Sn.pipes.includes(Ve)&&(M("false write response, pause",Sn.awaitDrainWriters.size),Sn.awaitDrainWriters.add(Ve)),En.pause()),Wn||(Wn=jt(En,Ve),Ve.on("drain",Wn))}En.on("data",Bn);function Bn(Nn){M("ondata");const Dn=Ve.write(Nn);M("dest.write",Dn),Dn===!1&&Ln()}function Mn(Nn){if(M("onerror",Nn),Vn(),Ve.removeListener("error",Mn),Ve.listenerCount("error")===0){const Dn=Ve._writableState||Ve._readableState;Dn&&!Dn.errorEmitted?vn(Ve,Nn):Ve.emit("error",Nn)}}S(Ve,"error",Mn);function On(){Ve.removeListener("finish",Gn),Vn()}Ve.once("close",On);function Gn(){M("onfinish"),Ve.removeListener("close",On),Vn()}Ve.once("finish",Gn);function Vn(){M("unpipe"),En.unpipe(Ve)}return Ve.emit("pipe",En),Ve.writableNeedDrain===!0?Sn.flowing&&Ln():Sn.flowing||(M("pipe resume"),En.resume()),Ve};function jt(Ve,Ue){return function(){const Sn=Ve._readableState;Sn.awaitDrainWriters===Ue?(M("pipeOnDrain",1),Sn.awaitDrainWriters=null):Sn.multiAwaitDrain&&(M("pipeOnDrain",Sn.awaitDrainWriters.size),Sn.awaitDrainWriters.delete(Ue)),(!Sn.awaitDrainWriters||Sn.awaitDrainWriters.size===0)&&Ve.listenerCount("data")&&Ve.resume()}}de.prototype.unpipe=function(Ve){const Ue=this._readableState,En={hasUnpiped:!1};if(Ue.pipes.length===0)return this;if(!Ve){const xn=Ue.pipes;Ue.pipes=[],this.pause();for(let Pn=0;Pn<xn.length;Pn++)xn[Pn].emit("unpipe",this,{hasUnpiped:!1});return this}const Sn=c(Ue.pipes,Ve);return Sn===-1?this:(Ue.pipes.splice(Sn,1),Ue.pipes.length===0&&this.pause(),Ve.emit("unpipe",this,En),this)},de.prototype.on=function(Ve,Ue){const En=T.prototype.on.call(this,Ve,Ue),Sn=this._readableState;return Ve==="data"?(Sn.readableListening=this.listenerCount("readable")>0,Sn.flowing!==!1&&this.resume()):Ve==="readable"&&!Sn.endEmitted&&!Sn.readableListening&&(Sn.readableListening=Sn.needReadable=!0,Sn.flowing=!1,Sn.emittedReadable=!1,M("on readable",Sn.length,Sn.reading),Sn.length?At(this):Sn.reading||u.nextTick(ie,this)),En},de.prototype.addListener=de.prototype.on,de.prototype.removeListener=function(Ve,Ue){const En=T.prototype.removeListener.call(this,Ve,Ue);return Ve==="readable"&&u.nextTick(_n,this),En},de.prototype.off=de.prototype.removeListener,de.prototype.removeAllListeners=function(Ve){const Ue=T.prototype.removeAllListeners.apply(this,arguments);return(Ve==="readable"||Ve===void 0)&&u.nextTick(_n,this),Ue};function _n(Ve){const Ue=Ve._readableState;Ue.readableListening=Ve.listenerCount("readable")>0,Ue.resumeScheduled&&Ue[Lt]===!1?Ue.flowing=!0:Ve.listenerCount("data")>0?Ve.resume():Ue.readableListening||(Ue.flowing=null)}function ie(Ve){M("readable nexttick read 0"),Ve.read(0)}de.prototype.resume=function(){const Ve=this._readableState;return Ve.flowing||(M("resume"),Ve.flowing=!Ve.readableListening,ae(this,Ve)),Ve[Lt]=!1,this};function ae(Ve,Ue){Ue.resumeScheduled||(Ue.resumeScheduled=!0,u.nextTick(Y,Ve,Ue))}function Y(Ve,Ue){M("resume",Ue.reading),Ue.reading||Ve.read(0),Ue.resumeScheduled=!1,Ve.emit("resume"),k(Ve),Ue.flowing&&!Ue.reading&&Ve.read(0)}de.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Lt]=!0,this};function k(Ve){const Ue=Ve._readableState;for(M("flow",Ue.flowing);Ue.flowing&&Ve.read()!==null;);}de.prototype.wrap=function(Ve){let Ue=!1;Ve.on("data",Sn=>{!this.push(Sn)&&Ve.pause&&(Ue=!0,Ve.pause())}),Ve.on("end",()=>{this.push(null)}),Ve.on("error",Sn=>{vn(this,Sn)}),Ve.on("close",()=>{this.destroy()}),Ve.on("destroy",()=>{this.destroy()}),this._read=()=>{Ue&&Ve.resume&&(Ue=!1,Ve.resume())};const En=g(Ve);for(let Sn=1;Sn<En.length;Sn++){const xn=En[Sn];this[xn]===void 0&&typeof Ve[xn]=="function"&&(this[xn]=Ve[xn].bind(Ve))}return this},de.prototype[b]=function(){return D(this)},de.prototype.iterator=function(Ve){return Ve!==void 0&&pe(Ve,"options"),D(this,Ve)};function D(Ve,Ue){typeof Ve.read!="function"&&(Ve=de.wrap(Ve,{objectMode:!0}));const En=oe(Ve,Ue);return En.stream=Ve,En}async function*oe(Ve,Ue){let En=Cn;function Sn(kn){this===Ve?(En(),En=Cn):En=kn}Ve.on("readable",Sn);let xn;const Pn=L(Ve,{writable:!1},kn=>{xn=kn?z(xn,kn):null,En(),En=Cn});try{for(;;){const kn=Ve.destroyed?null:Ve.read();if(kn!==null)yield kn;else{if(xn)throw xn;if(xn===null)return;await new y(Sn)}}}catch(kn){throw xn=z(xn,kn),xn}finally{(xn||(Ue==null?void 0:Ue.destroyOnReturn)!==!1)&&(xn===void 0||Ve._readableState.autoDestroy)?F.destroyer(Ve,null):(Ve.off("readable",Sn),Pn())}}v(de.prototype,{readable:{__proto__:null,get(){const Ve=this._readableState;return!!Ve&&Ve.readable!==!1&&!Ve.destroyed&&!Ve.errorEmitted&&!Ve.endEmitted},set(Ve){this._readableState&&(this._readableState.readable=!!Ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ve){this._readableState&&(this._readableState.flowing=Ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Ve){this._readableState&&(this._readableState.destroyed=Ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),v(Dt.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Lt]!==!1},set(Ve){this[Lt]=!!Ve}}}),de._fromList=xe;function xe(Ve,Ue){if(Ue.length===0)return null;let En;return Ue.objectMode?En=Ue.buffer.shift():!Ve||Ve>=Ue.length?(Ue.decoder?En=Ue.buffer.join(""):Ue.buffer.length===1?En=Ue.buffer.first():En=Ue.buffer.concat(Ue.length),Ue.buffer.clear()):En=Ue.buffer.consume(Ve,Ue.decoder),En}function ze(Ve){const Ue=Ve._readableState;M("endReadable",Ue.endEmitted),Ue.endEmitted||(Ue.ended=!0,u.nextTick(hn,Ue,Ve))}function hn(Ve,Ue){if(M("endReadableNT",Ve.endEmitted,Ve.length),!Ve.errored&&!Ve.closeEmitted&&!Ve.endEmitted&&Ve.length===0){if(Ve.endEmitted=!0,Ue.emit("end"),Ue.writable&&Ue.allowHalfOpen===!1)u.nextTick(An,Ue);else if(Ve.autoDestroy){const En=Ue._writableState;(!En||En.autoDestroy&&(En.finished||En.writable===!1))&&Ue.destroy()}}}function An(Ve){Ve.writable&&!Ve.writableEnded&&!Ve.destroyed&&Ve.end()}de.from=function(Ve,Ue){return Et(de,Ve,Ue)};let Tn;function Rn(){return Tn===void 0&&(Tn={}),Tn}de.fromWeb=function(Ve,Ue){return Rn().newStreamReadableFromReadableStream(Ve,Ue)},de.toWeb=function(Ve,Ue){return Rn().newReadableStreamFromStreamReadable(Ve,Ue)},de.wrap=function(Ve,Ue){var En,Sn;return new de({objectMode:(En=(Sn=Ve.readableObjectMode)!==null&&Sn!==void 0?Sn:Ve.objectMode)!==null&&En!==void 0?En:!0,...Ue,destroy(xn,Pn){F.destroyer(Ve,xn),Pn(xn)}}).wrap(Ve)}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./add-abort-signal":107,"./buffer_list":108,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102,string_decoder:28}],120:[function(i,o,a){const{MathFloor:u,NumberIsInteger:c}=i("../../ours/primordials"),{ERR_INVALID_ARG_VALUE:f}=i("../../ours/errors").codes;function d(g,p,y){return g.highWaterMark!=null?g.highWaterMark:p?g[y]:null}function h(g){return g?16:16*1024}function v(g,p,y,_){const b=d(p,_,y);if(b!=null){if(!c(b)||b<0){const A=_?`options.${y}`:"options.highWaterMark";throw new f(A,b)}return u(b)}return h(g.objectMode)}o.exports={getHighWaterMark:v,getDefaultHighWaterMark:h}},{"../../ours/errors":126,"../../ours/primordials":127}],121:[function(i,o,a){const{ObjectSetPrototypeOf:u,Symbol:c}=i("../../ours/primordials");o.exports=g;const{ERR_METHOD_NOT_IMPLEMENTED:f}=i("../../ours/errors").codes,d=i("./duplex"),{getHighWaterMark:h}=i("./state");u(g.prototype,d.prototype),u(g,d);const v=c("kCallback");function g(_){if(!(this instanceof g))return new g(_);const b=_?h(this,_,"readableHighWaterMark",!0):null;b===0&&(_={..._,highWaterMark:null,readableHighWaterMark:b,writableHighWaterMark:_.writableHighWaterMark||0}),d.call(this,_),this._readableState.sync=!1,this[v]=null,_&&(typeof _.transform=="function"&&(this._transform=_.transform),typeof _.flush=="function"&&(this._flush=_.flush)),this.on("prefinish",y)}function p(_){typeof this._flush=="function"&&!this.destroyed?this._flush((b,A)=>{if(b){_?_(b):this.destroy(b);return}A!=null&&this.push(A),this.push(null),_&&_()}):(this.push(null),_&&_())}function y(){this._final!==p&&p.call(this)}g.prototype._final=p,g.prototype._transform=function(_,b,A){throw new f("_transform()")},g.prototype._write=function(_,b,A){const w=this._readableState,T=this._writableState,S=w.length;this._transform(_,b,(x,O)=>{if(x){A(x);return}O!=null&&this.push(O),T.ended||S===w.length||w.length<w.highWaterMark?A():this[v]=A})},g.prototype._read=function(){if(this[v]){const _=this[v];this[v]=null,_()}}},{"../../ours/errors":126,"../../ours/primordials":127,"./duplex":111,"./state":120}],122:[function(i,o,a){const{Symbol:u,SymbolAsyncIterator:c,SymbolIterator:f,SymbolFor:d}=i("../../ours/primordials"),h=u("kDestroyed"),v=u("kIsErrored"),g=u("kIsReadable"),p=u("kIsDisturbed"),y=d("nodejs.webstream.isClosedPromise"),_=d("nodejs.webstream.controllerErrorFunction");function b(de,qe=!1){var Pt;return!!(de&&typeof de.pipe=="function"&&typeof de.on=="function"&&(!qe||typeof de.pause=="function"&&typeof de.resume=="function")&&(!de._writableState||((Pt=de._readableState)===null||Pt===void 0?void 0:Pt.readable)!==!1)&&(!de._writableState||de._readableState))}function A(de){var qe;return!!(de&&typeof de.write=="function"&&typeof de.on=="function"&&(!de._readableState||((qe=de._writableState)===null||qe===void 0?void 0:qe.writable)!==!1))}function w(de){return!!(de&&typeof de.pipe=="function"&&de._readableState&&typeof de.on=="function"&&typeof de.write=="function")}function T(de){return de&&(de._readableState||de._writableState||typeof de.write=="function"&&typeof de.on=="function"||typeof de.pipe=="function"&&typeof de.on=="function")}function S(de){return!!(de&&!T(de)&&typeof de.pipeThrough=="function"&&typeof de.getReader=="function"&&typeof de.cancel=="function")}function x(de){return!!(de&&!T(de)&&typeof de.getWriter=="function"&&typeof de.abort=="function")}function O(de){return!!(de&&!T(de)&&typeof de.readable=="object"&&typeof de.writable=="object")}function L(de){return S(de)||x(de)||O(de)}function M(de,qe){return de==null?!1:qe===!0?typeof de[c]=="function":qe===!1?typeof de[f]=="function":typeof de[c]=="function"||typeof de[f]=="function"}function re(de){if(!T(de))return null;const qe=de._writableState,Pt=de._readableState,In=qe||Pt;return!!(de.destroyed||de[h]||In!=null&&In.destroyed)}function F(de){if(!A(de))return null;if(de.writableEnded===!0)return!0;const qe=de._writableState;return qe!=null&&qe.errored?!1:typeof(qe==null?void 0:qe.ended)!="boolean"?null:qe.ended}function j(de,qe){if(!A(de))return null;if(de.writableFinished===!0)return!0;const Pt=de._writableState;return Pt!=null&&Pt.errored?!1:typeof(Pt==null?void 0:Pt.finished)!="boolean"?null:!!(Pt.finished||qe===!1&&Pt.ended===!0&&Pt.length===0)}function V(de){if(!b(de))return null;if(de.readableEnded===!0)return!0;const qe=de._readableState;return!qe||qe.errored?!1:typeof(qe==null?void 0:qe.ended)!="boolean"?null:qe.ended}function z(de,qe){if(!b(de))return null;const Pt=de._readableState;return Pt!=null&&Pt.errored?!1:typeof(Pt==null?void 0:Pt.endEmitted)!="boolean"?null:!!(Pt.endEmitted||qe===!1&&Pt.ended===!0&&Pt.length===0)}function $(de){return de&&de[g]!=null?de[g]:typeof(de==null?void 0:de.readable)!="boolean"?null:re(de)?!1:b(de)&&de.readable&&!z(de)}function he(de){return typeof(de==null?void 0:de.writable)!="boolean"?null:re(de)?!1:A(de)&&de.writable&&!F(de)}function le(de,qe){return T(de)?re(de)?!0:!((qe==null?void 0:qe.readable)!==!1&&$(de)||(qe==null?void 0:qe.writable)!==!1&&he(de)):null}function Ie(de){var qe,Pt;return T(de)?de.writableErrored?de.writableErrored:(qe=(Pt=de._writableState)===null||Pt===void 0?void 0:Pt.errored)!==null&&qe!==void 0?qe:null:null}function Fe(de){var qe,Pt;return T(de)?de.readableErrored?de.readableErrored:(qe=(Pt=de._readableState)===null||Pt===void 0?void 0:Pt.errored)!==null&&qe!==void 0?qe:null:null}function pe(de){if(!T(de))return null;if(typeof de.closed=="boolean")return de.closed;const qe=de._writableState,Pt=de._readableState;return typeof(qe==null?void 0:qe.closed)=="boolean"||typeof(Pt==null?void 0:Pt.closed)=="boolean"?(qe==null?void 0:qe.closed)||(Pt==null?void 0:Pt.closed):typeof de._closed=="boolean"&&Lt(de)?de._closed:null}function Lt(de){return typeof de._closed=="boolean"&&typeof de._defaultKeepAlive=="boolean"&&typeof de._removedConnection=="boolean"&&typeof de._removedContLen=="boolean"}function _e(de){return typeof de._sent100=="boolean"&&Lt(de)}function Et(de){var qe;return typeof de._consuming=="boolean"&&typeof de._dumped=="boolean"&&((qe=de.req)===null||qe===void 0?void 0:qe.upgradeOrConnect)===void 0}function Cn(de){if(!T(de))return null;const qe=de._writableState,Pt=de._readableState,In=qe||Pt;return!In&&_e(de)||!!(In&&In.autoDestroy&&In.emitClose&&In.closed===!1)}function vn(de){var qe;return!!(de&&((qe=de[p])!==null&&qe!==void 0?qe:de.readableDidRead||de.readableAborted))}function Dt(de){var qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return!!(de&&((qe=(Pt=(In=($e=(Ce=(ue=de[v])!==null&&ue!==void 0?ue:de.readableErrored)!==null&&Ce!==void 0?Ce:de.writableErrored)!==null&&$e!==void 0?$e:(At=de._readableState)===null||At===void 0?void 0:At.errorEmitted)!==null&&In!==void 0?In:(Ne=de._writableState)===null||Ne===void 0?void 0:Ne.errorEmitted)!==null&&Pt!==void 0?Pt:(Oe=de._readableState)===null||Oe===void 0?void 0:Oe.errored)!==null&&qe!==void 0?qe:!((kt=de._writableState)===null||kt===void 0)&&kt.errored))}o.exports={kDestroyed:h,isDisturbed:vn,kIsDisturbed:p,isErrored:Dt,kIsErrored:v,isReadable:$,kIsReadable:g,kIsClosedPromise:y,kControllerErrorFunction:_,isClosed:pe,isDestroyed:re,isDuplexNodeStream:w,isFinished:le,isIterable:M,isReadableNodeStream:b,isReadableStream:S,isReadableEnded:V,isReadableFinished:z,isReadableErrored:Fe,isNodeStream:T,isWebStream:L,isWritable:he,isWritableNodeStream:A,isWritableStream:x,isWritableEnded:F,isWritableFinished:j,isWritableErrored:Ie,isServerRequest:Et,isServerResponse:_e,willEmitClose:Cn,isTransformStream:O}},{"../../ours/primordials":127}],123:[function(i,o,a){const u=i("process/"),{ArrayPrototypeSlice:c,Error:f,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:h,ObjectDefineProperties:v,ObjectSetPrototypeOf:g,StringPrototypeToLowerCase:p,Symbol:y,SymbolHasInstance:_}=i("../../ours/primordials");o.exports=_e,_e.WritableState=pe;const{EventEmitter:b}=i("events"),A=i("./legacy").Stream,{Buffer:w}=i("buffer"),T=i("./destroy"),{addAbortSignal:S}=i("./add-abort-signal"),{getHighWaterMark:x,getDefaultHighWaterMark:O}=i("./state"),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_MULTIPLE_CALLBACK:re,ERR_STREAM_CANNOT_PIPE:F,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:V,ERR_STREAM_NULL_VALUES:z,ERR_STREAM_WRITE_AFTER_END:$,ERR_UNKNOWN_ENCODING:he}=i("../../ours/errors").codes,{errorOrDestroy:le}=T;g(_e.prototype,A.prototype),g(_e,A);function Ie(){}const Fe=y("kOnFinished");function pe(ie,ae,Y){typeof Y!="boolean"&&(Y=ae instanceof i("./duplex")),this.objectMode=!!(ie&&ie.objectMode),Y&&(this.objectMode=this.objectMode||!!(ie&&ie.writableObjectMode)),this.highWaterMark=ie?x(this,ie,"writableHighWaterMark",Y):O(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const k=!!(ie&&ie.decodeStrings===!1);this.decodeStrings=!k,this.defaultEncoding=ie&&ie.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=de.bind(void 0,ae),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Lt(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ie||ie.emitClose!==!1,this.autoDestroy=!ie||ie.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fe]=[]}function Lt(ie){ie.buffered=[],ie.bufferedIndex=0,ie.allBuffers=!0,ie.allNoop=!0}pe.prototype.getBuffer=function(){return c(this.buffered,this.bufferedIndex)},h(pe.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function _e(ie){const ae=this instanceof i("./duplex");if(!ae&&!d(_e,this))return new _e(ie);this._writableState=new pe(ie,this,ae),ie&&(typeof ie.write=="function"&&(this._write=ie.write),typeof ie.writev=="function"&&(this._writev=ie.writev),typeof ie.destroy=="function"&&(this._destroy=ie.destroy),typeof ie.final=="function"&&(this._final=ie.final),typeof ie.construct=="function"&&(this._construct=ie.construct),ie.signal&&S(ie.signal,this)),A.call(this,ie),T.construct(this,()=>{const Y=this._writableState;Y.writing||$e(this,Y),Ne(this,Y)})}h(_e,_,{__proto__:null,value:function(ie){return d(this,ie)?!0:this!==_e?!1:ie&&ie._writableState instanceof pe}}),_e.prototype.pipe=function(){le(this,new F)};function Et(ie,ae,Y,k){const D=ie._writableState;if(typeof Y=="function")k=Y,Y=D.defaultEncoding;else{if(!Y)Y=D.defaultEncoding;else if(Y!=="buffer"&&!w.isEncoding(Y))throw new he(Y);typeof k!="function"&&(k=Ie)}if(ae===null)throw new z;if(!D.objectMode)if(typeof ae=="string")D.decodeStrings!==!1&&(ae=w.from(ae,Y),Y="buffer");else if(ae instanceof w)Y="buffer";else if(A._isUint8Array(ae))ae=A._uint8ArrayToBuffer(ae),Y="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],ae);let oe;return D.ending?oe=new $:D.destroyed&&(oe=new j("write")),oe?(u.nextTick(k,oe),le(ie,oe,!0),oe):(D.pendingcb++,Cn(ie,D,ae,Y,k))}_e.prototype.write=function(ie,ae,Y){return Et(this,ie,ae,Y)===!0},_e.prototype.cork=function(){this._writableState.corked++},_e.prototype.uncork=function(){const ie=this._writableState;ie.corked&&(ie.corked--,ie.writing||$e(this,ie))},_e.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=p(ae)),!w.isEncoding(ae))throw new he(ae);return this._writableState.defaultEncoding=ae,this};function Cn(ie,ae,Y,k,D){const oe=ae.objectMode?1:Y.length;ae.length+=oe;const xe=ae.length<ae.highWaterMark;return xe||(ae.needDrain=!0),ae.writing||ae.corked||ae.errored||!ae.constructed?(ae.buffered.push({chunk:Y,encoding:k,callback:D}),ae.allBuffers&&k!=="buffer"&&(ae.allBuffers=!1),ae.allNoop&&D!==Ie&&(ae.allNoop=!1)):(ae.writelen=oe,ae.writecb=D,ae.writing=!0,ae.sync=!0,ie._write(Y,k,ae.onwrite),ae.sync=!1),xe&&!ae.errored&&!ae.destroyed}function vn(ie,ae,Y,k,D,oe,xe){ae.writelen=k,ae.writecb=xe,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new j("write")):Y?ie._writev(D,ae.onwrite):ie._write(D,oe,ae.onwrite),ae.sync=!1}function Dt(ie,ae,Y,k){--ae.pendingcb,k(Y),In(ae),le(ie,Y)}function de(ie,ae){const Y=ie._writableState,k=Y.sync,D=Y.writecb;if(typeof D!="function"){le(ie,new re);return}Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ae?(ae.stack,Y.errored||(Y.errored=ae),ie._readableState&&!ie._readableState.errored&&(ie._readableState.errored=ae),k?u.nextTick(Dt,ie,Y,ae,D):Dt(ie,Y,ae,D)):(Y.buffered.length>Y.bufferedIndex&&$e(ie,Y),k?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===D?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:D,stream:ie,state:Y},u.nextTick(qe,Y.afterWriteTickInfo)):Pt(ie,Y,1,D))}function qe({stream:ie,state:ae,count:Y,cb:k}){return ae.afterWriteTickInfo=null,Pt(ie,ae,Y,k)}function Pt(ie,ae,Y,k){for(!ae.ending&&!ie.destroyed&&ae.length===0&&ae.needDrain&&(ae.needDrain=!1,ie.emit("drain"));Y-- >0;)ae.pendingcb--,k();ae.destroyed&&In(ae),Ne(ie,ae)}function In(ie){if(ie.writing)return;for(let D=ie.bufferedIndex;D<ie.buffered.length;++D){var ae;const{chunk:oe,callback:xe}=ie.buffered[D],ze=ie.objectMode?1:oe.length;ie.length-=ze,xe((ae=ie.errored)!==null&&ae!==void 0?ae:new j("write"))}const Y=ie[Fe].splice(0);for(let D=0;D<Y.length;D++){var k;Y[D]((k=ie.errored)!==null&&k!==void 0?k:new j("end"))}Lt(ie)}function $e(ie,ae){if(ae.corked||ae.bufferProcessing||ae.destroyed||!ae.constructed)return;const{buffered:Y,bufferedIndex:k,objectMode:D}=ae,oe=Y.length-k;if(!oe)return;let xe=k;if(ae.bufferProcessing=!0,oe>1&&ie._writev){ae.pendingcb-=oe-1;const ze=ae.allNoop?Ie:An=>{for(let Tn=xe;Tn<Y.length;++Tn)Y[Tn].callback(An)},hn=ae.allNoop&&xe===0?Y:c(Y,xe);hn.allBuffers=ae.allBuffers,vn(ie,ae,!0,ae.length,hn,"",ze),Lt(ae)}else{do{const{chunk:ze,encoding:hn,callback:An}=Y[xe];Y[xe++]=null;const Tn=D?1:ze.length;vn(ie,ae,!1,Tn,ze,hn,An)}while(xe<Y.length&&!ae.writing);xe===Y.length?Lt(ae):xe>256?(Y.splice(0,xe),ae.bufferedIndex=0):ae.bufferedIndex=xe}ae.bufferProcessing=!1}_e.prototype._write=function(ie,ae,Y){if(this._writev)this._writev([{chunk:ie,encoding:ae}],Y);else throw new M("_write()")},_e.prototype._writev=null,_e.prototype.end=function(ie,ae,Y){const k=this._writableState;typeof ie=="function"?(Y=ie,ie=null,ae=null):typeof ae=="function"&&(Y=ae,ae=null);let D;if(ie!=null){const oe=Et(this,ie,ae);oe instanceof f&&(D=oe)}return k.corked&&(k.corked=1,this.uncork()),D||(!k.errored&&!k.ending?(k.ending=!0,Ne(this,k,!0),k.ended=!0):k.finished?D=new V("end"):k.destroyed&&(D=new j("end"))),typeof Y=="function"&&(D||k.finished?u.nextTick(Y,D):k[Fe].push(Y)),this};function Ce(ie){return ie.ending&&!ie.destroyed&&ie.constructed&&ie.length===0&&!ie.errored&&ie.buffered.length===0&&!ie.finished&&!ie.writing&&!ie.errorEmitted&&!ie.closeEmitted}function ue(ie,ae){let Y=!1;function k(D){if(Y){le(ie,D??re());return}if(Y=!0,ae.pendingcb--,D){const oe=ae[Fe].splice(0);for(let xe=0;xe<oe.length;xe++)oe[xe](D);le(ie,D,ae.sync)}else Ce(ae)&&(ae.prefinished=!0,ie.emit("prefinish"),ae.pendingcb++,u.nextTick(Oe,ie,ae))}ae.sync=!0,ae.pendingcb++;try{ie._final(k)}catch(D){k(D)}ae.sync=!1}function At(ie,ae){!ae.prefinished&&!ae.finalCalled&&(typeof ie._final=="function"&&!ae.destroyed?(ae.finalCalled=!0,ue(ie,ae)):(ae.prefinished=!0,ie.emit("prefinish")))}function Ne(ie,ae,Y){Ce(ae)&&(At(ie,ae),ae.pendingcb===0&&(Y?(ae.pendingcb++,u.nextTick((k,D)=>{Ce(D)?Oe(k,D):D.pendingcb--},ie,ae)):Ce(ae)&&(ae.pendingcb++,Oe(ie,ae))))}function Oe(ie,ae){ae.pendingcb--,ae.finished=!0;const Y=ae[Fe].splice(0);for(let k=0;k<Y.length;k++)Y[k]();if(ie.emit("finish"),ae.autoDestroy){const k=ie._readableState;(!k||k.autoDestroy&&(k.endEmitted||k.readable===!1))&&ie.destroy()}}v(_e.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ie){this._writableState&&(this._writableState.destroyed=ie)}},writable:{__proto__:null,get(){const ie=this._writableState;return!!ie&&ie.writable!==!1&&!ie.destroyed&&!ie.errored&&!ie.ending&&!ie.ended},set(ie){this._writableState&&(this._writableState.writable=!!ie)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ie=this._writableState;return ie?!ie.destroyed&&!ie.ending&&ie.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const kt=T.destroy;_e.prototype.destroy=function(ie,ae){const Y=this._writableState;return!Y.destroyed&&(Y.bufferedIndex<Y.buffered.length||Y[Fe].length)&&u.nextTick(In,Y),kt.call(this,ie,ae),this},_e.prototype._undestroy=T.undestroy,_e.prototype._destroy=function(ie,ae){ae(ie)},_e.prototype[b.captureRejectionSymbol]=function(ie){this.destroy(ie)};let jt;function _n(){return jt===void 0&&(jt={}),jt}_e.fromWeb=function(ie,ae){return _n().newStreamWritableFromWritableStream(ie,ae)},_e.toWeb=function(ie){return _n().newWritableStreamFromStreamWritable(ie)}},{"../../ours/errors":126,"../../ours/primordials":127,"./add-abort-signal":107,"./destroy":110,"./duplex":111,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102}],124:[function(i,o,a){const{ArrayIsArray:u,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:f,ArrayPrototypeMap:d,NumberIsInteger:h,NumberIsNaN:v,NumberMAX_SAFE_INTEGER:g,NumberMIN_SAFE_INTEGER:p,NumberParseInt:y,ObjectPrototypeHasOwnProperty:_,RegExpPrototypeExec:b,String:A,StringPrototypeToUpperCase:w,StringPrototypeTrim:T}=i("../ours/primordials"),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:O,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:M,ERR_UNKNOWN_SIGNAL:re}}=i("../ours/errors"),{normalizeEncoding:F}=i("../ours/util"),{isAsyncFunction:j,isArrayBufferView:V}=i("../ours/util").types,z={};function $(oe){return oe===(oe|0)}function he(oe){return oe===oe>>>0}const le=/^[0-7]+$/,Ie="must be a 32-bit unsigned integer or an octal string";function Fe(oe,xe,ze){if(typeof oe>"u"&&(oe=ze),typeof oe=="string"){if(b(le,oe)===null)throw new L(xe,oe,Ie);oe=y(oe,8)}return _e(oe,xe),oe}const pe=S((oe,xe,ze=p,hn=g)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);if(oe<ze||oe>hn)throw new M(xe,`>= ${ze} && <= ${hn}`,oe)}),Lt=S((oe,xe,ze=-2147483648,hn=2147483647)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);if(oe<ze||oe>hn)throw new M(xe,`>= ${ze} && <= ${hn}`,oe)}),_e=S((oe,xe,ze=!1)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);const hn=ze?1:0,An=4294967295;if(oe<hn||oe>An)throw new M(xe,`>= ${hn} && <= ${An}`,oe)});function Et(oe,xe){if(typeof oe!="string")throw new O(xe,"string",oe)}function Cn(oe,xe,ze=void 0,hn){if(typeof oe!="number")throw new O(xe,"number",oe);if(ze!=null&&oe<ze||hn!=null&&oe>hn||(ze!=null||hn!=null)&&v(oe))throw new M(xe,`${ze!=null?`>= ${ze}`:""}${ze!=null&&hn!=null?" && ":""}${hn!=null?`<= ${hn}`:""}`,oe)}const vn=S((oe,xe,ze)=>{if(!c(ze,oe)){const An="must be one of: "+f(d(ze,Tn=>typeof Tn=="string"?`'${Tn}'`:A(Tn)),", ");throw new L(xe,oe,An)}});function Dt(oe,xe){if(typeof oe!="boolean")throw new O(xe,"boolean",oe)}function de(oe,xe,ze){return oe==null||!_(oe,xe)?ze:oe[xe]}const qe=S((oe,xe,ze=null)=>{const hn=de(ze,"allowArray",!1),An=de(ze,"allowFunction",!1);if(!de(ze,"nullable",!1)&&oe===null||!hn&&u(oe)||typeof oe!="object"&&(!An||typeof oe!="function"))throw new O(xe,"Object",oe)}),Pt=S((oe,xe)=>{if(oe!=null&&typeof oe!="object"&&typeof oe!="function")throw new O(xe,"a dictionary",oe)}),In=S((oe,xe,ze=0)=>{if(!u(oe))throw new O(xe,"Array",oe);if(oe.length<ze){const hn=`must be longer than ${ze}`;throw new L(xe,oe,hn)}});function $e(oe,xe){In(oe,xe);for(let ze=0;ze<oe.length;ze++)Et(oe[ze],`${xe}[${ze}]`)}function Ce(oe,xe){In(oe,xe);for(let ze=0;ze<oe.length;ze++)Dt(oe[ze],`${xe}[${ze}]`)}function ue(oe,xe="signal"){if(Et(oe,xe),z[oe]===void 0)throw z[w(oe)]!==void 0?new re(oe+" (signals must use all capital letters)"):new re(oe)}const At=S((oe,xe="buffer")=>{if(!V(oe))throw new O(xe,["Buffer","TypedArray","DataView"],oe)});function Ne(oe,xe){const ze=F(xe),hn=oe.length;if(ze==="hex"&&hn%2!==0)throw new L("encoding",xe,`is invalid for data of length ${hn}`)}function Oe(oe,xe="Port",ze=!0){if(typeof oe!="number"&&typeof oe!="string"||typeof oe=="string"&&T(oe).length===0||+oe!==+oe>>>0||oe>65535||oe===0&&!ze)throw new x(xe,oe,ze);return oe|0}const kt=S((oe,xe)=>{if(oe!==void 0&&(oe===null||typeof oe!="object"||!("aborted"in oe)))throw new O(xe,"AbortSignal",oe)}),jt=S((oe,xe)=>{if(typeof oe!="function")throw new O(xe,"Function",oe)}),_n=S((oe,xe)=>{if(typeof oe!="function"||j(oe))throw new O(xe,"Function",oe)}),ie=S((oe,xe)=>{if(oe!==void 0)throw new O(xe,"undefined",oe)});function ae(oe,xe,ze){if(!c(ze,oe))throw new O(xe,`('${f(ze,"|")}')`,oe)}const Y=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function k(oe,xe){if(typeof oe>"u"||!b(Y,oe))throw new L(xe,oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function D(oe){if(typeof oe=="string")return k(oe,"hints"),oe;if(u(oe)){const xe=oe.length;let ze="";if(xe===0)return ze;for(let hn=0;hn<xe;hn++){const An=oe[hn];k(An,"hints"),ze+=An,hn!==xe-1&&(ze+=", ")}return ze}throw new L("hints",oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o.exports={isInt32:$,isUint32:he,parseFileMode:Fe,validateArray:In,validateStringArray:$e,validateBooleanArray:Ce,validateBoolean:Dt,validateBuffer:At,validateDictionary:Pt,validateEncoding:Ne,validateFunction:jt,validateInt32:Lt,validateInteger:pe,validateNumber:Cn,validateObject:qe,validateOneOf:vn,validatePlainFunction:_n,validatePort:Oe,validateSignalName:ue,validateString:Et,validateUint32:_e,validateUndefined:ie,validateUnion:ae,validateAbortSignal:kt,validateLinkHeaderValue:D}},{"../ours/errors":126,"../ours/primordials":127,"../ours/util":128}],125:[function(i,o,a){const u=i("../stream"),c=i("../stream/promises"),f=u.Readable.destroy;o.exports=u.Readable,o.exports._uint8ArrayToBuffer=u._uint8ArrayToBuffer,o.exports._isUint8Array=u._isUint8Array,o.exports.isDisturbed=u.isDisturbed,o.exports.isErrored=u.isErrored,o.exports.isReadable=u.isReadable,o.exports.Readable=u.Readable,o.exports.Writable=u.Writable,o.exports.Duplex=u.Duplex,o.exports.Transform=u.Transform,o.exports.PassThrough=u.PassThrough,o.exports.addAbortSignal=u.addAbortSignal,o.exports.finished=u.finished,o.exports.destroy=u.destroy,o.exports.destroy=f,o.exports.pipeline=u.pipeline,o.exports.compose=u.compose,Object.defineProperty(u,"promises",{configurable:!0,enumerable:!0,get(){return c}}),o.exports.Stream=u.Stream,o.exports.default=o.exports},{"../stream":129,"../stream/promises":130}],126:[function(i,o,a){const{format:u,inspect:c,AggregateError:f}=i("./util"),d=globalThis.AggregateError||f,h=Symbol("kIsNodeError"),v=["string","function","number","object","Function","Object","boolean","bigint","symbol"],g=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",y={};function _(O,L){if(!O)throw new y.ERR_INTERNAL_ASSERTION(L)}function b(O){let L="",M=O.length;const re=O[0]==="-"?1:0;for(;M>=re+4;M-=3)L=`_${O.slice(M-3,M)}${L}`;return`${O.slice(0,M)}${L}`}function A(O,L,M){if(typeof L=="function")return _(L.length<=M.length,`Code: ${O}; The provided arguments length (${M.length}) does not match the required ones (${L.length}).`),L(...M);const re=(L.match(/%[dfijoOs]/g)||[]).length;return _(re===M.length,`Code: ${O}; The provided arguments length (${M.length}) does not match the required ones (${re}).`),M.length===0?L:u(L,...M)}function w(O,L,M){M||(M=Error);class re extends M{constructor(...j){super(A(O,L,j))}toString(){return`${this.name} [${O}]: ${this.message}`}}Object.defineProperties(re.prototype,{name:{value:M.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${O}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),re.prototype.code=O,re.prototype[h]=!0,y[O]=re}function T(O){const L=p+O.name;return Object.defineProperty(O,"name",{value:L}),O}function S(O,L){if(O&&L&&O!==L){if(Array.isArray(L.errors))return L.errors.push(O),L;const M=new d([L,O],L.message);return M.code=L.code,M}return O||L}class x extends Error{constructor(L="The operation was aborted",M=void 0){if(M!==void 0&&typeof M!="object")throw new y.ERR_INVALID_ARG_TYPE("options","Object",M);super(L,M),this.code="ABORT_ERR",this.name="AbortError"}}w("ERR_ASSERTION","%s",Error),w("ERR_INVALID_ARG_TYPE",(O,L,M)=>{_(typeof O=="string","'name' must be a string"),Array.isArray(L)||(L=[L]);let re="The ";O.endsWith(" argument")?re+=`${O} `:re+=`"${O}" ${O.includes(".")?"property":"argument"} `,re+="must be ";const F=[],j=[],V=[];for(const $ of L)_(typeof $=="string","All expected entries have to be of type string"),v.includes($)?F.push($.toLowerCase()):g.test($)?j.push($):(_($!=="object",'The value "object" should be written as "Object"'),V.push($));if(j.length>0){const $=F.indexOf("object");$!==-1&&(F.splice(F,$,1),j.push("Object"))}if(F.length>0){switch(F.length){case 1:re+=`of type ${F[0]}`;break;case 2:re+=`one of type ${F[0]} or ${F[1]}`;break;default:{const $=F.pop();re+=`one of type ${F.join(", ")}, or ${$}`}}(j.length>0||V.length>0)&&(re+=" or ")}if(j.length>0){switch(j.length){case 1:re+=`an instance of ${j[0]}`;break;case 2:re+=`an instance of ${j[0]} or ${j[1]}`;break;default:{const $=j.pop();re+=`an instance of ${j.join(", ")}, or ${$}`}}V.length>0&&(re+=" or ")}switch(V.length){case 0:break;case 1:V[0].toLowerCase()!==V[0]&&(re+="an "),re+=`${V[0]}`;break;case 2:re+=`one of ${V[0]} or ${V[1]}`;break;default:{const $=V.pop();re+=`one of ${V.join(", ")}, or ${$}`}}if(M==null)re+=`. Received ${M}`;else if(typeof M=="function"&&M.name)re+=`. Received function ${M.name}`;else if(typeof M=="object"){var z;if((z=M.constructor)!==null&&z!==void 0&&z.name)re+=`. Received an instance of ${M.constructor.name}`;else{const $=c(M,{depth:-1});re+=`. Received ${$}`}}else{let $=c(M,{colors:!1});$.length>25&&($=`${$.slice(0,25)}...`),re+=`. Received type ${typeof M} (${$})`}return re},TypeError),w("ERR_INVALID_ARG_VALUE",(O,L,M="is invalid")=>{let re=c(L);return re.length>128&&(re=re.slice(0,128)+"..."),`The ${O.includes(".")?"property":"argument"} '${O}' ${M}. Received ${re}`},TypeError),w("ERR_INVALID_RETURN_VALUE",(O,L,M)=>{var re;const F=M!=null&&(re=M.constructor)!==null&&re!==void 0&&re.name?`instance of ${M.constructor.name}`:`type ${typeof M}`;return`Expected ${O} to be returned from the "${L}" function but got ${F}.`},TypeError),w("ERR_MISSING_ARGS",(...O)=>{_(O.length>0,"At least one arg needs to be specified");let L;const M=O.length;switch(O=(Array.isArray(O)?O:[O]).map(re=>`"${re}"`).join(" or "),M){case 1:L+=`The ${O[0]} argument`;break;case 2:L+=`The ${O[0]} and ${O[1]} arguments`;break;default:{const re=O.pop();L+=`The ${O.join(", ")}, and ${re} arguments`}break}return`${L} must be specified`},TypeError),w("ERR_OUT_OF_RANGE",(O,L,M)=>{_(L,'Missing "range" argument');let re;return Number.isInteger(M)&&Math.abs(M)>2**32?re=b(String(M)):typeof M=="bigint"?(re=String(M),(M>2n**32n||M<-(2n**32n))&&(re=b(re)),re+="n"):re=c(M),`The value of "${O}" is out of range. It must be ${L}. Received ${re}`},RangeError),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),w("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),w("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),w("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),w("ERR_STREAM_WRITE_AFTER_END","write after end",Error),w("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),o.exports={AbortError:x,aggregateTwoErrors:T(S),hideStackFrames:T,codes:y}},{"./util":128}],127:[function(i,o,a){o.exports={ArrayIsArray(u){return Array.isArray(u)},ArrayPrototypeIncludes(u,c){return u.includes(c)},ArrayPrototypeIndexOf(u,c){return u.indexOf(c)},ArrayPrototypeJoin(u,c){return u.join(c)},ArrayPrototypeMap(u,c){return u.map(c)},ArrayPrototypePop(u,c){return u.pop(c)},ArrayPrototypePush(u,c){return u.push(c)},ArrayPrototypeSlice(u,c,f){return u.slice(c,f)},Error,FunctionPrototypeCall(u,c,...f){return u.call(c,...f)},FunctionPrototypeSymbolHasInstance(u,c){return Function.prototype[Symbol.hasInstance].call(u,c)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(u,c){return Object.defineProperties(u,c)},ObjectDefineProperty(u,c,f){return Object.defineProperty(u,c,f)},ObjectGetOwnPropertyDescriptor(u,c){return Object.getOwnPropertyDescriptor(u,c)},ObjectKeys(u){return Object.keys(u)},ObjectSetPrototypeOf(u,c){return Object.setPrototypeOf(u,c)},Promise,PromisePrototypeCatch(u,c){return u.catch(c)},PromisePrototypeThen(u,c,f){return u.then(c,f)},PromiseReject(u){return Promise.reject(u)},ReflectApply:Reflect.apply,RegExpPrototypeTest(u,c){return u.test(c)},SafeSet:Set,String,StringPrototypeSlice(u,c,f){return u.slice(c,f)},StringPrototypeToLowerCase(u){return u.toLowerCase()},StringPrototypeToUpperCase(u){return u.toUpperCase()},StringPrototypeTrim(u){return u.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(u,c,f){return u.set(c,f)},Uint8Array}},{}],128:[function(i,o,a){const u=i("buffer"),c=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||u.Blob,d=typeof f<"u"?function(g){return g instanceof f}:function(g){return!1};class h extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let p="";for(let y=0;y<g.length;y++)p+=` ${g[y].stack}
|
269
|
+
`,CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function calculateNodeStyling(r){const n=window.getComputedStyle(r),i=n.getPropertyValue("box-sizing"),o=Number.parseFloat(n.getPropertyValue("padding-bottom"))+Number.parseFloat(n.getPropertyValue("padding-top")),a=Number.parseFloat(n.getPropertyValue("border-bottom-width"))+Number.parseFloat(n.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(c=>`${c}:${n.getPropertyValue(c)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:i}}function calcTextareaHeight(r,n=1,i){var o;hiddenTextarea||(hiddenTextarea=document.createElement("textarea"),document.body.appendChild(hiddenTextarea));const{paddingSize:a,borderSize:u,boxSizing:c,contextStyle:f}=calculateNodeStyling(r);hiddenTextarea.setAttribute("style",`${f};${HIDDEN_STYLE}`),hiddenTextarea.value=r.value||r.placeholder||"";let d=hiddenTextarea.scrollHeight;const h={};c==="border-box"?d=d+u:c==="content-box"&&(d=d-a),hiddenTextarea.value="";const v=hiddenTextarea.scrollHeight-a;if(isNumber(n)){let g=v*n;c==="border-box"&&(g=g+a+u),d=Math.max(g,d),h.minHeight=`${g}px`}if(isNumber(i)){let g=v*i;c==="border-box"&&(g=g+a+u),d=Math.min(g,d)}return h.height=`${d}px`,(o=hiddenTextarea.parentNode)==null||o.removeChild(hiddenTextarea),hiddenTextarea=void 0,h}const inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:Boolean,modelValue:{type:definePropType([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:definePropType([Object,Array,String]),default:()=>mutable({})}}),inputEmits={[UPDATE_MODEL_EVENT]:r=>isString(r),input:r=>isString(r),change:r=>isString(r),focus:r=>r instanceof FocusEvent,blur:r=>r instanceof FocusEvent,clear:()=>!0,mouseleave:r=>r instanceof MouseEvent,mouseenter:r=>r instanceof MouseEvent,keydown:r=>r instanceof Event,compositionstart:r=>r instanceof CompositionEvent,compositionupdate:r=>r instanceof CompositionEvent,compositionend:r=>r instanceof CompositionEvent},_hoisted_1$7=["role"],_hoisted_2$5=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],_hoisted_3$4=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],__default__$9=vue.defineComponent({name:"ElInput",inheritAttrs:!1}),_sfc_main$o=vue.defineComponent({...__default__$9,props:inputProps,emits:inputEmits,setup(r,{expose:n,emit:i}){const o=r,a=vue.useAttrs(),u=vue.useSlots(),c=vue.computed(()=>{const ze={};return o.containerRole==="combobox"&&(ze["aria-haspopup"]=a["aria-haspopup"],ze["aria-owns"]=a["aria-owns"],ze["aria-expanded"]=a["aria-expanded"]),ze}),f=vue.computed(()=>[o.type==="textarea"?A.b():b.b(),b.m(y.value),b.is("disabled",_.value),b.is("exceed",Dt.value),{[b.b("group")]:u.prepend||u.append,[b.bm("group","append")]:u.append,[b.bm("group","prepend")]:u.prepend,[b.m("prefix")]:u.prefix||o.prefixIcon,[b.m("suffix")]:u.suffix||o.suffixIcon||o.clearable||o.showPassword,[b.bm("suffix","password-clear")]:_e.value&&Et.value},a.class]),d=vue.computed(()=>[b.e("wrapper"),b.is("focus",j.value)]),h=useAttrs({excludeKeys:vue.computed(()=>Object.keys(c.value))}),{form:v,formItem:g}=useFormItem(),{inputId:p}=useFormItemInputId(o,{formItemContext:g}),y=useFormSize(),_=useFormDisabled(),b=useNamespace("input"),A=useNamespace("textarea"),w=vue.shallowRef(),T=vue.shallowRef(),S=vue.ref(!1),x=vue.ref(!1),O=vue.ref(!1),L=vue.ref(),M=vue.shallowRef(o.inputStyle),re=vue.computed(()=>w.value||T.value),{wrapperRef:F,isFocused:j,handleFocus:V,handleBlur:z}=useFocusController(re,{afterBlur(){var ze;o.validateEvent&&((ze=g==null?void 0:g.validate)==null||ze.call(g,"blur").catch(hn=>debugWarn(hn)))}}),$=vue.computed(()=>{var ze;return(ze=v==null?void 0:v.statusIcon)!=null?ze:!1}),he=vue.computed(()=>(g==null?void 0:g.validateState)||""),le=vue.computed(()=>he.value&&ValidateComponentsMap[he.value]),Ie=vue.computed(()=>O.value?view_default:hide_default),Fe=vue.computed(()=>[a.style,o.inputStyle]),pe=vue.computed(()=>[o.inputStyle,M.value,{resize:o.resize}]),Lt=vue.computed(()=>lodashEs.isNil(o.modelValue)?"":String(o.modelValue)),_e=vue.computed(()=>o.clearable&&!_.value&&!o.readonly&&!!Lt.value&&(j.value||S.value)),Et=vue.computed(()=>o.showPassword&&!_.value&&!o.readonly&&!!Lt.value&&(!!Lt.value||j.value)),Cn=vue.computed(()=>o.showWordLimit&&!!h.value.maxlength&&(o.type==="text"||o.type==="textarea")&&!_.value&&!o.readonly&&!o.showPassword),vn=vue.computed(()=>Lt.value.length),Dt=vue.computed(()=>!!Cn.value&&vn.value>Number(h.value.maxlength)),de=vue.computed(()=>!!u.suffix||!!o.suffixIcon||_e.value||o.showPassword||Cn.value||!!he.value&&$.value),[qe,Pt]=useCursor(w);useResizeObserver(T,ze=>{if(Ce(),!Cn.value||o.resize!=="both")return;const hn=ze[0],{width:An}=hn.contentRect;L.value={right:`calc(100% - ${An+15+6}px)`}});const In=()=>{const{type:ze,autosize:hn}=o;if(!(!isClient||ze!=="textarea"||!T.value))if(hn){const An=isObject(hn)?hn.minRows:void 0,Tn=isObject(hn)?hn.maxRows:void 0,Rn=calcTextareaHeight(T.value,An,Tn);M.value={overflowY:"hidden",...Rn},vue.nextTick(()=>{T.value.offsetHeight,M.value=Rn})}else M.value={minHeight:calcTextareaHeight(T.value).minHeight}},Ce=(ze=>{let hn=!1;return()=>{var An;if(hn||!o.autosize)return;((An=T.value)==null?void 0:An.offsetParent)===null||(ze(),hn=!0)}})(In),ue=()=>{const ze=re.value,hn=o.formatter?o.formatter(Lt.value):Lt.value;!ze||ze.value===hn||(ze.value=hn)},At=async ze=>{qe();let{value:hn}=ze.target;if(o.formatter&&(hn=o.parser?o.parser(hn):hn),!x.value){if(hn===Lt.value){ue();return}i(UPDATE_MODEL_EVENT,hn),i("input",hn),await vue.nextTick(),ue(),Pt()}},Ne=ze=>{i("change",ze.target.value)},Oe=ze=>{i("compositionstart",ze),x.value=!0},kt=ze=>{var hn;i("compositionupdate",ze);const An=(hn=ze.target)==null?void 0:hn.value,Tn=An[An.length-1]||"";x.value=!isKorean(Tn)},jt=ze=>{i("compositionend",ze),x.value&&(x.value=!1,At(ze))},_n=()=>{O.value=!O.value,ie()},ie=async()=>{var ze;await vue.nextTick(),(ze=re.value)==null||ze.focus()},ae=()=>{var ze;return(ze=re.value)==null?void 0:ze.blur()},Y=ze=>{S.value=!1,i("mouseleave",ze)},k=ze=>{S.value=!0,i("mouseenter",ze)},D=ze=>{i("keydown",ze)},oe=()=>{var ze;(ze=re.value)==null||ze.select()},xe=()=>{i(UPDATE_MODEL_EVENT,""),i("change",""),i("clear"),i("input","")};return vue.watch(()=>o.modelValue,()=>{var ze;vue.nextTick(()=>In()),o.validateEvent&&((ze=g==null?void 0:g.validate)==null||ze.call(g,"change").catch(hn=>debugWarn(hn)))}),vue.watch(Lt,()=>ue()),vue.watch(()=>o.type,async()=>{await vue.nextTick(),ue(),In()}),vue.onMounted(()=>{!o.formatter&&o.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),ue(),vue.nextTick(In)}),n({input:w,textarea:T,ref:re,textareaStyle:pe,autosize:vue.toRef(o,"autosize"),focus:ie,blur:ae,select:oe,clear:xe,resizeTextarea:In}),(ze,hn)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",vue.mergeProps(vue.unref(c),{class:vue.unref(f),style:vue.unref(Fe),role:ze.containerRole,onMouseenter:k,onMouseleave:Y}),[vue.createCommentVNode(" input "),ze.type!=="textarea"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createCommentVNode(" prepend slot "),ze.$slots.prepend?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(b).be("group","prepend"))},[vue.renderSlot(ze.$slots,"prepend")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref_key:"wrapperRef",ref:F,class:vue.normalizeClass(vue.unref(d))},[vue.createCommentVNode(" prefix slot "),ze.$slots.prefix||ze.prefixIcon?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(b).e("prefix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("prefix-inner"))},[vue.renderSlot(ze.$slots,"prefix"),ze.prefixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ze.prefixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("input",vue.mergeProps({id:vue.unref(p),ref_key:"input",ref:w,class:vue.unref(b).e("inner")},vue.unref(h),{type:ze.showPassword?O.value?"text":"password":ze.type,disabled:vue.unref(_),formatter:ze.formatter,parser:ze.parser,readonly:ze.readonly,autocomplete:ze.autocomplete,tabindex:ze.tabindex,"aria-label":ze.label,placeholder:ze.placeholder,style:ze.inputStyle,form:o.form,onCompositionstart:Oe,onCompositionupdate:kt,onCompositionend:jt,onInput:At,onFocus:hn[0]||(hn[0]=(...An)=>vue.unref(V)&&vue.unref(V)(...An)),onBlur:hn[1]||(hn[1]=(...An)=>vue.unref(z)&&vue.unref(z)(...An)),onChange:Ne,onKeydown:D}),null,16,_hoisted_2$5),vue.createCommentVNode(" suffix slot "),vue.unref(de)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(vue.unref(b).e("suffix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("suffix-inner"))},[!vue.unref(_e)||!vue.unref(Et)||!vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.renderSlot(ze.$slots,"suffix"),ze.suffixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ze.suffixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],64)):vue.createCommentVNode("v-if",!0),vue.unref(_e)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("clear")]),onMousedown:vue.withModifiers(vue.unref(NOOP),["prevent"]),onClick:xe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_close_default))]),_:1},8,["class","onMousedown"])):vue.createCommentVNode("v-if",!0),vue.unref(Et)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("password")]),onClick:_n},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(Ie))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock("span",{key:3,class:vue.normalizeClass(vue.unref(b).e("count"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("count-inner"))},vue.toDisplayString(vue.unref(vn))+" / "+vue.toDisplayString(vue.unref(h).maxlength),3)],2)):vue.createCommentVNode("v-if",!0),vue.unref(he)&&vue.unref(le)&&vue.unref($)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:4,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("validateIcon"),vue.unref(b).is("loading",vue.unref(he)==="validating")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(le))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0)],2),vue.createCommentVNode(" append slot "),ze.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(b).be("group","append"))},[vue.renderSlot(ze.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" textarea "),vue.createElementVNode("textarea",vue.mergeProps({id:vue.unref(p),ref_key:"textarea",ref:T,class:vue.unref(A).e("inner")},vue.unref(h),{tabindex:ze.tabindex,disabled:vue.unref(_),readonly:ze.readonly,autocomplete:ze.autocomplete,style:vue.unref(pe),"aria-label":ze.label,placeholder:ze.placeholder,form:o.form,onCompositionstart:Oe,onCompositionupdate:kt,onCompositionend:jt,onInput:At,onFocus:hn[2]||(hn[2]=(...An)=>vue.unref(V)&&vue.unref(V)(...An)),onBlur:hn[3]||(hn[3]=(...An)=>vue.unref(z)&&vue.unref(z)(...An)),onChange:Ne,onKeydown:D}),null,16,_hoisted_3$4),vue.unref(Cn)?(vue.openBlock(),vue.createElementBlock("span",{key:0,style:vue.normalizeStyle(L.value),class:vue.normalizeClass(vue.unref(b).e("count"))},vue.toDisplayString(vue.unref(vn))+" / "+vue.toDisplayString(vue.unref(h).maxlength),7)):vue.createCommentVNode("v-if",!0)],64))],16,_hoisted_1$7)),[[vue.vShow,ze.type!=="hidden"]])}});var Input=_export_sfc(_sfc_main$o,[["__file","/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);const ElInput=withInstall(Input),GAP=4,BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},renderThumbStyle=({move:r,size:n,bar:i})=>({[i.size]:n,transform:`translate${i.axis}(${r}%)`}),scrollbarContextKey=Symbol("scrollbarContextKey"),thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),COMPONENT_NAME$2="Thumb",_sfc_main$n=vue.defineComponent({__name:"thumb",props:thumbProps,setup(r){const n=r,i=vue.inject(scrollbarContextKey),o=useNamespace("scrollbar");i||throwError(COMPONENT_NAME$2,"can not inject scrollbar context");const a=vue.ref(),u=vue.ref(),c=vue.ref({}),f=vue.ref(!1);let d=!1,h=!1,v=isClient?document.onselectstart:null;const g=vue.computed(()=>BAR_MAP[n.vertical?"vertical":"horizontal"]),p=vue.computed(()=>renderThumbStyle({size:n.size,move:n.move,bar:g.value})),y=vue.computed(()=>a.value[g.value.offset]**2/i.wrapElement[g.value.scrollSize]/n.ratio/u.value[g.value.offset]),_=L=>{var M;if(L.stopPropagation(),L.ctrlKey||[1,2].includes(L.button))return;(M=window.getSelection())==null||M.removeAllRanges(),A(L);const re=L.currentTarget;re&&(c.value[g.value.axis]=re[g.value.offset]-(L[g.value.client]-re.getBoundingClientRect()[g.value.direction]))},b=L=>{if(!u.value||!a.value||!i.wrapElement)return;const M=Math.abs(L.target.getBoundingClientRect()[g.value.direction]-L[g.value.client]),re=u.value[g.value.offset]/2,F=(M-re)*100*y.value/a.value[g.value.offset];i.wrapElement[g.value.scroll]=F*i.wrapElement[g.value.scrollSize]/100},A=L=>{L.stopImmediatePropagation(),d=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",T),v=document.onselectstart,document.onselectstart=()=>!1},w=L=>{if(!a.value||!u.value||d===!1)return;const M=c.value[g.value.axis];if(!M)return;const re=(a.value.getBoundingClientRect()[g.value.direction]-L[g.value.client])*-1,F=u.value[g.value.offset]-M,j=(re-F)*100*y.value/a.value[g.value.offset];i.wrapElement[g.value.scroll]=j*i.wrapElement[g.value.scrollSize]/100},T=()=>{d=!1,c.value[g.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",T),O(),h&&(f.value=!1)},S=()=>{h=!1,f.value=!!n.size},x=()=>{h=!0,f.value=d};vue.onBeforeUnmount(()=>{O(),document.removeEventListener("mouseup",T)});const O=()=>{document.onselectstart!==v&&(document.onselectstart=v)};return useEventListener(vue.toRef(i,"scrollbarElement"),"mousemove",S),useEventListener(vue.toRef(i,"scrollbarElement"),"mouseleave",x),(L,M)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(o).b("fade"),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{ref_key:"instance",ref:a,class:vue.normalizeClass([vue.unref(o).e("bar"),vue.unref(o).is(vue.unref(g).key)]),onMousedown:b},[vue.createElementVNode("div",{ref_key:"thumb",ref:u,class:vue.normalizeClass(vue.unref(o).e("thumb")),style:vue.normalizeStyle(vue.unref(p)),onMousedown:_},null,38)],34),[[vue.vShow,L.always||f.value]])]),_:1},8,["name"]))}});var Thumb=_export_sfc(_sfc_main$n,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);const barProps=buildProps({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}}),_sfc_main$m=vue.defineComponent({__name:"bar",props:barProps,setup(r,{expose:n}){const i=r,o=vue.ref(0),a=vue.ref(0);return n({handleScroll:c=>{if(c){const f=c.offsetHeight-GAP,d=c.offsetWidth-GAP;a.value=c.scrollTop*100/f*i.ratioY,o.value=c.scrollLeft*100/d*i.ratioX}}}),(c,f)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(Thumb,{move:o.value,ratio:c.ratioX,size:c.width,always:c.always},null,8,["move","ratio","size","always"]),vue.createVNode(Thumb,{move:a.value,ratio:c.ratioY,size:c.height,vertical:"",always:c.always},null,8,["move","ratio","size","always"])],64))}});var Bar=_export_sfc(_sfc_main$m,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);const scrollbarProps=buildProps({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:definePropType([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20}}),scrollbarEmits={scroll:({scrollTop:r,scrollLeft:n})=>[r,n].every(isNumber)},COMPONENT_NAME$1="ElScrollbar",__default__$8=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$l=vue.defineComponent({...__default__$8,props:scrollbarProps,emits:scrollbarEmits,setup(r,{expose:n,emit:i}){const o=r,a=useNamespace("scrollbar");let u,c;const f=vue.ref(),d=vue.ref(),h=vue.ref(),v=vue.ref("0"),g=vue.ref("0"),p=vue.ref(),y=vue.ref(1),_=vue.ref(1),b=vue.computed(()=>{const M={};return o.height&&(M.height=addUnit(o.height)),o.maxHeight&&(M.maxHeight=addUnit(o.maxHeight)),[o.wrapStyle,M]}),A=vue.computed(()=>[o.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!o.native}]),w=vue.computed(()=>[a.e("view"),o.viewClass]),T=()=>{var M;d.value&&((M=p.value)==null||M.handleScroll(d.value),i("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function S(M,re){isObject(M)?d.value.scrollTo(M):isNumber(M)&&isNumber(re)&&d.value.scrollTo(M,re)}const x=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}d.value.scrollTop=M},O=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}d.value.scrollLeft=M},L=()=>{if(!d.value)return;const M=d.value.offsetHeight-GAP,re=d.value.offsetWidth-GAP,F=M**2/d.value.scrollHeight,j=re**2/d.value.scrollWidth,V=Math.max(F,o.minSize),z=Math.max(j,o.minSize);y.value=F/(M-F)/(V/(M-V)),_.value=j/(re-j)/(z/(re-z)),g.value=V+GAP<M?`${V}px`:"",v.value=z+GAP<re?`${z}px`:""};return vue.watch(()=>o.noresize,M=>{M?(u==null||u(),c==null||c()):({stop:u}=useResizeObserver(h,L),c=useEventListener("resize",L))},{immediate:!0}),vue.watch(()=>[o.maxHeight,o.height],()=>{o.native||vue.nextTick(()=>{var M;L(),d.value&&((M=p.value)==null||M.handleScroll(d.value))})}),vue.provide(scrollbarContextKey,vue.reactive({scrollbarElement:f,wrapElement:d})),vue.onMounted(()=>{o.native||vue.nextTick(()=>{L()})}),vue.onUpdated(()=>L()),n({wrapRef:d,update:L,scrollTo:S,setScrollTop:x,setScrollLeft:O,handleScroll:T}),(M,re)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"scrollbarRef",ref:f,class:vue.normalizeClass(vue.unref(a).b())},[vue.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:vue.normalizeClass(vue.unref(A)),style:vue.normalizeStyle(vue.unref(b)),onScroll:T},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(M.tag),{ref_key:"resizeRef",ref:h,class:vue.normalizeClass(vue.unref(w)),style:vue.normalizeStyle(M.viewStyle)},{default:vue.withCtx(()=>[vue.renderSlot(M.$slots,"default")]),_:3},8,["class","style"]))],38),M.native?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(Bar,{key:0,ref_key:"barRef",ref:p,height:g.value,width:v.value,always:M.always,"ratio-x":_.value,"ratio-y":y.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var Scrollbar=_export_sfc(_sfc_main$l,[["__file","/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);const ElScrollbar=withInstall(Scrollbar),POPPER_INJECTION_KEY=Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=Symbol("popperContent"),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),__default__$7=vue.defineComponent({name:"ElPopper",inheritAttrs:!1}),_sfc_main$k=vue.defineComponent({...__default__$7,props:popperProps,setup(r,{expose:n}){const i=r,o=vue.ref(),a=vue.ref(),u=vue.ref(),c=vue.ref(),f=vue.computed(()=>i.role),d={triggerRef:o,popperInstanceRef:a,contentRef:u,referenceRef:c,role:f};return n(d),vue.provide(POPPER_INJECTION_KEY,d),(h,v)=>vue.renderSlot(h.$slots,"default")}});var Popper=_export_sfc(_sfc_main$k,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/popper.vue"]]);const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),__default__$6=vue.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),_sfc_main$j=vue.defineComponent({...__default__$6,props:popperArrowProps,setup(r,{expose:n}){const i=r,o=useNamespace("popper"),{arrowOffset:a,arrowRef:u,arrowStyle:c}=vue.inject(POPPER_CONTENT_INJECTION_KEY,void 0);return vue.watch(()=>i.arrowOffset,f=>{a.value=f}),vue.onBeforeUnmount(()=>{u.value=void 0}),n({arrowRef:u}),(f,d)=>(vue.openBlock(),vue.createElementBlock("span",{ref_key:"arrowRef",ref:u,class:vue.normalizeClass(vue.unref(o).e("arrow")),style:vue.normalizeStyle(vue.unref(c)),"data-popper-arrow":""},null,6))}});var ElPopperArrow=_export_sfc(_sfc_main$j,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);const NAME="ElOnlyChild",OnlyChild=vue.defineComponent({name:NAME,setup(r,{slots:n,attrs:i}){var o;const a=vue.inject(FORWARD_REF_INJECTION_KEY),u=useForwardRefDirective((o=a==null?void 0:a.setForwardRef)!=null?o:NOOP);return()=>{var c;const f=(c=n.default)==null?void 0:c.call(n,i);if(!f)return null;if(f.length>1)return debugWarn(NAME,"requires exact only one valid child."),null;const d=findFirstLegitChild(f);return d?vue.withDirectives(vue.cloneVNode(d,i),[[u]]):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(r){if(!r)return null;const n=r;for(const i of n){if(isObject(i))switch(i.type){case vue.Comment:continue;case vue.Text:case"svg":return wrapTextContent(i);case vue.Fragment:return findFirstLegitChild(i.children);default:return i}return wrapTextContent(i)}return null}function wrapTextContent(r){const n=useNamespace("only-child");return vue.createVNode("span",{class:n.e("content")},[r])}const popperTriggerProps=buildProps({virtualRef:{type:definePropType(Object)},virtualTriggering:Boolean,onMouseenter:{type:definePropType(Function)},onMouseleave:{type:definePropType(Function)},onClick:{type:definePropType(Function)},onKeydown:{type:definePropType(Function)},onFocus:{type:definePropType(Function)},onBlur:{type:definePropType(Function)},onContextmenu:{type:definePropType(Function)},id:String,open:Boolean}),__default__$5=vue.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),_sfc_main$i=vue.defineComponent({...__default__$5,props:popperTriggerProps,setup(r,{expose:n}){const i=r,{role:o,triggerRef:a}=vue.inject(POPPER_INJECTION_KEY,void 0);useForwardRef(a);const u=vue.computed(()=>f.value?i.id:void 0),c=vue.computed(()=>{if(o&&o.value==="tooltip")return i.open&&i.id?i.id:void 0}),f=vue.computed(()=>{if(o&&o.value!=="tooltip")return o.value}),d=vue.computed(()=>f.value?`${i.open}`:void 0);let h;return vue.onMounted(()=>{vue.watch(()=>i.virtualRef,v=>{v&&(a.value=unrefElement(v))},{immediate:!0}),vue.watch(a,(v,g)=>{h==null||h(),h=void 0,isElement(v)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(p=>{var y;const _=i[p];_&&(v.addEventListener(p.slice(2).toLowerCase(),_),(y=g==null?void 0:g.removeEventListener)==null||y.call(g,p.slice(2).toLowerCase(),_))}),h=vue.watch([u,c,f,d],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((y,_)=>{lodashEs.isNil(p[_])?v.removeAttribute(y):v.setAttribute(y,p[_])})},{immediate:!0})),isElement(g)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>g.removeAttribute(p))},{immediate:!0})}),vue.onBeforeUnmount(()=>{h==null||h(),h=void 0}),n({triggerRef:a}),(v,g)=>v.virtualTriggering?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(OnlyChild),vue.mergeProps({key:0},v.$attrs,{"aria-controls":vue.unref(u),"aria-describedby":vue.unref(c),"aria-expanded":vue.unref(d),"aria-haspopup":vue.unref(f)}),{default:vue.withCtx(()=>[vue.renderSlot(v.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var ElPopperTrigger=_export_sfc(_sfc_main$i,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);const FOCUS_AFTER_TRAPPED="focus-trap.focus-after-trapped",FOCUS_AFTER_RELEASED="focus-trap.focus-after-released",FOCUSOUT_PREVENTED="focus-trap.focusout-prevented",FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},ON_TRAP_FOCUS_EVT="focusAfterTrapped",ON_RELEASE_FOCUS_EVT="focusAfterReleased",FOCUS_TRAP_INJECTION_KEY=Symbol("elFocusTrap"),focusReason=vue.ref(),lastUserFocusTimestamp=vue.ref(0),lastAutomatedFocusTimestamp=vue.ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=r=>{const n=[],i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n},getVisibleElement=(r,n)=>{for(const i of r)if(!isHidden(i,n))return i},isHidden=(r,n)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(n&&r===n)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1},getEdges=r=>{const n=obtainAllFocusableElements(r),i=getVisibleElement(n,r),o=getVisibleElement(n.reverse(),r);return[i,o]},isSelectable=r=>r instanceof HTMLInputElement&&"select"in r,tryFocus=(r,n)=>{if(r&&r.focus){const i=document.activeElement;r.focus({preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),r!==i&&isSelectable(r)&&n&&r.select()}};function removeFromStack(r,n){const i=[...r],o=r.indexOf(n);return o!==-1&&i.splice(o,1),i}const createFocusableStack=()=>{let r=[];return{push:o=>{const a=r[0];a&&o!==a&&a.pause(),r=removeFromStack(r,o),r.unshift(o)},remove:o=>{var a,u;r=removeFromStack(r,o),(u=(a=r[0])==null?void 0:a.resume)==null||u.call(a)}}},focusFirstDescendant=(r,n=!1)=>{const i=document.activeElement;for(const o of r)if(tryFocus(o,n),document.activeElement!==i)return},focusableStack=createFocusableStack(),isFocusCausedByUserEvent=()=>lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value,notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},useFocusReason=()=>(vue.onMounted(()=>{focusReasonUserCount===0&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),vue.onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason,lastUserFocusTimestamp,lastAutomatedFocusTimestamp}),createFocusOutPreventedEvent=r=>new CustomEvent(FOCUSOUT_PREVENTED,{...FOCUSOUT_PREVENTED_OPTS,detail:r}),_sfc_main$h=vue.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[ON_TRAP_FOCUS_EVT,ON_RELEASE_FOCUS_EVT,"focusin","focusout","focusout-prevented","release-requested"],setup(r,{emit:n}){const i=vue.ref();let o,a;const{focusReason:u}=useFocusReason();useEscapeKeydown(_=>{r.trapped&&!c.paused&&n("release-requested",_)});const c={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},f=_=>{if(!r.loop&&!r.trapped||c.paused)return;const{key:b,altKey:A,ctrlKey:w,metaKey:T,currentTarget:S,shiftKey:x}=_,{loop:O}=r,L=b===EVENT_CODE.tab&&!A&&!w&&!T,M=document.activeElement;if(L&&M){const re=S,[F,j]=getEdges(re);if(F&&j){if(!x&&M===j){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||(_.preventDefault(),O&&tryFocus(F,!0))}else if(x&&[F,re].includes(M)){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||(_.preventDefault(),O&&tryFocus(j,!0))}}else if(M===re){const z=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",z),z.defaultPrevented||_.preventDefault()}}};vue.provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:i,onKeydown:f}),vue.watch(()=>r.focusTrapEl,_=>{_&&(i.value=_)},{immediate:!0}),vue.watch([i],([_],[b])=>{_&&(_.addEventListener("keydown",f),_.addEventListener("focusin",v),_.addEventListener("focusout",g)),b&&(b.removeEventListener("keydown",f),b.removeEventListener("focusin",v),b.removeEventListener("focusout",g))});const d=_=>{n(ON_TRAP_FOCUS_EVT,_)},h=_=>n(ON_RELEASE_FOCUS_EVT,_),v=_=>{const b=vue.unref(i);if(!b)return;const A=_.target,w=_.relatedTarget,T=A&&b.contains(A);r.trapped||w&&b.contains(w)||(o=w),T&&n("focusin",_),!c.paused&&r.trapped&&(T?a=A:tryFocus(a,!0))},g=_=>{const b=vue.unref(i);if(!(c.paused||!b))if(r.trapped){const A=_.relatedTarget;!lodashEs.isNil(A)&&!b.contains(A)&&setTimeout(()=>{if(!c.paused&&r.trapped){const w=createFocusOutPreventedEvent({focusReason:u.value});n("focusout-prevented",w),w.defaultPrevented||tryFocus(a,!0)}},0)}else{const A=_.target;A&&b.contains(A)||n("focusout",_)}};async function p(){await vue.nextTick();const _=vue.unref(i);if(_){focusableStack.push(c);const b=_.contains(document.activeElement)?o:document.activeElement;if(o=b,!_.contains(b)){const w=new Event(FOCUS_AFTER_TRAPPED,FOCUS_AFTER_TRAPPED_OPTS);_.addEventListener(FOCUS_AFTER_TRAPPED,d),_.dispatchEvent(w),w.defaultPrevented||vue.nextTick(()=>{let T=r.focusStartEl;isString(T)||(tryFocus(T),document.activeElement!==T&&(T="first")),T==="first"&&focusFirstDescendant(obtainAllFocusableElements(_),!0),(document.activeElement===b||T==="container")&&tryFocus(_)})}}}function y(){const _=vue.unref(i);if(_){_.removeEventListener(FOCUS_AFTER_TRAPPED,d);const b=new CustomEvent(FOCUS_AFTER_RELEASED,{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:u.value}});_.addEventListener(FOCUS_AFTER_RELEASED,h),_.dispatchEvent(b),!b.defaultPrevented&&(u.value=="keyboard"||!isFocusCausedByUserEvent()||_.contains(document.activeElement))&&tryFocus(o??document.body),_.removeEventListener(FOCUS_AFTER_RELEASED,d),focusableStack.remove(c)}}return vue.onMounted(()=>{r.trapped&&p(),vue.watch(()=>r.trapped,_=>{_?p():y()})}),vue.onBeforeUnmount(()=>{r.trapped&&y()}),{onKeydown:f}}});function _sfc_render$4(r,n,i,o,a,u){return vue.renderSlot(r.$slots,"default",{handleKeydown:r.onKeydown})}var ElFocusTrap=_export_sfc(_sfc_main$h,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);const POSITIONING_STRATEGIES=["fixed","absolute"],popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:definePropType(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:definePropType(Object),default:()=>({})},strategy:{type:String,values:POSITIONING_STRATEGIES,default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,id:String,style:{type:definePropType([String,Array,Object])},className:{type:definePropType([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:definePropType([String,Array,Object])},popperStyle:{type:definePropType([String,Array,Object])},referenceEl:{type:definePropType(Object)},triggerTargetEl:{type:definePropType(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),popperContentEmits={mouseenter:r=>r instanceof MouseEvent,mouseleave:r=>r instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},buildPopperOptions=(r,n=[])=>{const{placement:i,strategy:o,popperOptions:a}=r,u={placement:i,strategy:o,...a,modifiers:[...genModifiers(r),...n]};return deriveExtraModifiers(u,a==null?void 0:a.modifiers),u},unwrapMeasurableEl=r=>{if(isClient)return unrefElement(r)};function genModifiers(r){const{offset:n,gpuAcceleration:i,fallbackPlacements:o}=r;return[{name:"offset",options:{offset:[0,n??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:o}},{name:"computeStyles",options:{gpuAcceleration:i}}]}function deriveExtraModifiers(r,n){n&&(r.modifiers=[...r.modifiers,...n??[]])}const DEFAULT_ARROW_OFFSET=0,usePopperContent=r=>{const{popperInstanceRef:n,contentRef:i,triggerRef:o,role:a}=vue.inject(POPPER_INJECTION_KEY,void 0),u=vue.ref(),c=vue.ref(),f=vue.computed(()=>({name:"eventListeners",enabled:!!r.visible})),d=vue.computed(()=>{var w;const T=vue.unref(u),S=(w=vue.unref(c))!=null?w:DEFAULT_ARROW_OFFSET;return{name:"arrow",enabled:!lodashEs.isUndefined(T),options:{element:T,padding:S}}}),h=vue.computed(()=>({onFirstUpdate:()=>{_()},...buildPopperOptions(r,[vue.unref(d),vue.unref(f)])})),v=vue.computed(()=>unwrapMeasurableEl(r.referenceEl)||vue.unref(o)),{attributes:g,state:p,styles:y,update:_,forceUpdate:b,instanceRef:A}=usePopper(v,i,h);return vue.watch(A,w=>n.value=w),vue.onMounted(()=>{vue.watch(()=>{var w;return(w=vue.unref(v))==null?void 0:w.getBoundingClientRect()},()=>{_()})}),{attributes:g,arrowRef:u,contentRef:i,instanceRef:A,state:p,styles:y,role:a,forceUpdate:b,update:_}},usePopperContentDOM=(r,{attributes:n,styles:i,role:o})=>{const{nextZIndex:a}=useZIndex(),u=useNamespace("popper"),c=vue.computed(()=>vue.unref(n).popper),f=vue.ref(r.zIndex||a()),d=vue.computed(()=>[u.b(),u.is("pure",r.pure),u.is(r.effect),r.popperClass]),h=vue.computed(()=>[{zIndex:vue.unref(f)},vue.unref(i).popper,r.popperStyle||{}]),v=vue.computed(()=>o.value==="dialog"?"false":void 0),g=vue.computed(()=>vue.unref(i).arrow||{});return{ariaModal:v,arrowStyle:g,contentAttrs:c,contentClass:d,contentStyle:h,contentZIndex:f,updateZIndex:()=>{f.value=r.zIndex||a()}}},usePopperContentFocusTrap=(r,n)=>{const i=vue.ref(!1),o=vue.ref();return{focusStartRef:o,trapped:i,onFocusAfterReleased:h=>{var v;((v=h.detail)==null?void 0:v.focusReason)!=="pointer"&&(o.value="first",n("blur"))},onFocusAfterTrapped:()=>{n("focus")},onFocusInTrap:h=>{r.visible&&!i.value&&(h.target&&(o.value=h.target),i.value=!0)},onFocusoutPrevented:h=>{r.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),i.value=!1)},onReleaseRequested:()=>{i.value=!1,n("close")}}},__default__$4=vue.defineComponent({name:"ElPopperContent"}),_sfc_main$g=vue.defineComponent({...__default__$4,props:popperContentProps,emits:popperContentEmits,setup(r,{expose:n,emit:i}){const o=r,{focusStartRef:a,trapped:u,onFocusAfterReleased:c,onFocusAfterTrapped:f,onFocusInTrap:d,onFocusoutPrevented:h,onReleaseRequested:v}=usePopperContentFocusTrap(o,i),{attributes:g,arrowRef:p,contentRef:y,styles:_,instanceRef:b,role:A,update:w}=usePopperContent(o),{ariaModal:T,arrowStyle:S,contentAttrs:x,contentClass:O,contentStyle:L,updateZIndex:M}=usePopperContentDOM(o,{styles:_,attributes:g,role:A}),re=vue.inject(formItemContextKey,void 0),F=vue.ref();vue.provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:S,arrowRef:p,arrowOffset:F}),re&&(re.addInputId||re.removeInputId)&&vue.provide(formItemContextKey,{...re,addInputId:NOOP,removeInputId:NOOP});let j;const V=($=!0)=>{w(),$&&M()},z=()=>{V(!1),o.visible&&o.focusOnShow?u.value=!0:o.visible===!1&&(u.value=!1)};return vue.onMounted(()=>{vue.watch(()=>o.triggerTargetEl,($,he)=>{j==null||j(),j=void 0;const le=vue.unref($||y.value),Ie=vue.unref(he||y.value);isElement(le)&&(j=vue.watch([A,()=>o.ariaLabel,T,()=>o.id],Fe=>{["role","aria-label","aria-modal","id"].forEach((pe,Lt)=>{lodashEs.isNil(Fe[Lt])?le.removeAttribute(pe):le.setAttribute(pe,Fe[Lt])})},{immediate:!0})),Ie!==le&&isElement(Ie)&&["role","aria-label","aria-modal","id"].forEach(Fe=>{Ie.removeAttribute(Fe)})},{immediate:!0}),vue.watch(()=>o.visible,z,{immediate:!0})}),vue.onBeforeUnmount(()=>{j==null||j(),j=void 0}),n({popperContentRef:y,popperInstanceRef:b,updatePopper:V,contentStyle:L}),($,he)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({ref_key:"contentRef",ref:y},vue.unref(x),{style:vue.unref(L),class:vue.unref(O),tabindex:"-1",onMouseenter:he[0]||(he[0]=le=>$.$emit("mouseenter",le)),onMouseleave:he[1]||(he[1]=le=>$.$emit("mouseleave",le))}),[vue.createVNode(vue.unref(ElFocusTrap),{trapped:vue.unref(u),"trap-on-focus-in":!0,"focus-trap-el":vue.unref(y),"focus-start-el":vue.unref(a),onFocusAfterTrapped:vue.unref(f),onFocusAfterReleased:vue.unref(c),onFocusin:vue.unref(d),onFocusoutPrevented:vue.unref(h),onReleaseRequested:vue.unref(v)},{default:vue.withCtx(()=>[vue.renderSlot($.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var ElPopperContent=_export_sfc(_sfc_main$g,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popper/src/content.vue"]]);const ElPopper=withInstall(Popper),TOOLTIP_INJECTION_KEY=Symbol("elTooltip"),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:definePropType([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:definePropType(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:definePropType([String,Array]),default:"hover"},triggerKeys:{type:definePropType(Array),default:()=>[EVENT_CODE.enter,EVENT_CODE.space]}}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=createModelToggleComposable("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],isTriggerType=(r,n)=>isArray(r)?r.includes(n):r===n,whenTrigger=(r,n,i)=>o=>{isTriggerType(vue.unref(r),n)&&i(o)},__default__$3=vue.defineComponent({name:"ElTooltipTrigger"}),_sfc_main$f=vue.defineComponent({...__default__$3,props:useTooltipTriggerProps,setup(r,{expose:n}){const i=r,o=useNamespace("tooltip"),{controlled:a,id:u,open:c,onOpen:f,onClose:d,onToggle:h}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),v=vue.ref(null),g=()=>{if(vue.unref(a)||i.disabled)return!0},p=vue.toRef(i,"trigger"),y=composeEventHandlers(g,whenTrigger(p,"hover",f)),_=composeEventHandlers(g,whenTrigger(p,"hover",d)),b=composeEventHandlers(g,whenTrigger(p,"click",x=>{x.button===0&&h(x)})),A=composeEventHandlers(g,whenTrigger(p,"focus",f)),w=composeEventHandlers(g,whenTrigger(p,"focus",d)),T=composeEventHandlers(g,whenTrigger(p,"contextmenu",x=>{x.preventDefault(),h(x)})),S=composeEventHandlers(g,x=>{const{code:O}=x;i.triggerKeys.includes(O)&&(x.preventDefault(),h(x))});return n({triggerRef:v}),(x,O)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopperTrigger),{id:vue.unref(u),"virtual-ref":x.virtualRef,open:vue.unref(c),"virtual-triggering":x.virtualTriggering,class:vue.normalizeClass(vue.unref(o).e("trigger")),onBlur:vue.unref(w),onClick:vue.unref(b),onContextmenu:vue.unref(T),onFocus:vue.unref(A),onMouseenter:vue.unref(y),onMouseleave:vue.unref(_),onKeydown:vue.unref(S)},{default:vue.withCtx(()=>[vue.renderSlot(x.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ElTooltipTrigger=_export_sfc(_sfc_main$f,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/trigger.vue"]]);const __default__$2=vue.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_sfc_main$e=vue.defineComponent({...__default__$2,props:useTooltipContentProps,setup(r,{expose:n}){const i=r,{selector:o}=usePopperContainerId(),a=useNamespace("tooltip"),u=vue.ref(null),c=vue.ref(!1),{controlled:f,id:d,open:h,trigger:v,onClose:g,onOpen:p,onShow:y,onHide:_,onBeforeShow:b,onBeforeHide:A}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),w=vue.computed(()=>i.transition||`${a.namespace.value}-fade-in-linear`),T=vue.computed(()=>process.env.NODE_ENV==="test"?!0:i.persistent);vue.onBeforeUnmount(()=>{c.value=!0});const S=vue.computed(()=>vue.unref(T)?!0:vue.unref(h)),x=vue.computed(()=>i.disabled?!1:vue.unref(h)),O=vue.computed(()=>i.appendTo||o.value),L=vue.computed(()=>{var Fe;return(Fe=i.style)!=null?Fe:{}}),M=vue.computed(()=>!vue.unref(h)),re=()=>{_()},F=()=>{if(vue.unref(f))return!0},j=composeEventHandlers(F,()=>{i.enterable&&vue.unref(v)==="hover"&&p()}),V=composeEventHandlers(F,()=>{vue.unref(v)==="hover"&&g()}),z=()=>{var Fe,pe;(pe=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||pe.call(Fe),b==null||b()},$=()=>{A==null||A()},he=()=>{y(),Ie=onClickOutside(vue.computed(()=>{var Fe;return(Fe=u.value)==null?void 0:Fe.popperContentRef}),()=>{if(vue.unref(f))return;vue.unref(v)!=="hover"&&g()})},le=()=>{i.virtualTriggering||g()};let Ie;return vue.watch(()=>vue.unref(h),Fe=>{Fe||Ie==null||Ie()},{flush:"post"}),vue.watch(()=>i.content,()=>{var Fe,pe;(pe=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||pe.call(Fe)}),n({contentRef:u}),(Fe,pe)=>(vue.openBlock(),vue.createBlock(vue.Teleport,{disabled:!Fe.teleported,to:vue.unref(O)},[vue.createVNode(vue.Transition,{name:vue.unref(w),onAfterLeave:re,onBeforeEnter:z,onAfterEnter:he,onBeforeLeave:$},{default:vue.withCtx(()=>[vue.unref(S)?vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElPopperContent),vue.mergeProps({key:0,id:vue.unref(d),ref_key:"contentRef",ref:u},Fe.$attrs,{"aria-label":Fe.ariaLabel,"aria-hidden":vue.unref(M),"boundaries-padding":Fe.boundariesPadding,"fallback-placements":Fe.fallbackPlacements,"gpu-acceleration":Fe.gpuAcceleration,offset:Fe.offset,placement:Fe.placement,"popper-options":Fe.popperOptions,strategy:Fe.strategy,effect:Fe.effect,enterable:Fe.enterable,pure:Fe.pure,"popper-class":Fe.popperClass,"popper-style":[Fe.popperStyle,vue.unref(L)],"reference-el":Fe.referenceEl,"trigger-target-el":Fe.triggerTargetEl,visible:vue.unref(x),"z-index":Fe.zIndex,onMouseenter:vue.unref(j),onMouseleave:vue.unref(V),onBlur:le,onClose:vue.unref(g)}),{default:vue.withCtx(()=>[c.value?vue.createCommentVNode("v-if",!0):vue.renderSlot(Fe.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[vue.vShow,vue.unref(x)]]):vue.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var ElTooltipContent=_export_sfc(_sfc_main$e,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/content.vue"]]);const _hoisted_1$6=["innerHTML"],_hoisted_2$4={key:1},__default__$1=vue.defineComponent({name:"ElTooltip"}),_sfc_main$d=vue.defineComponent({...__default__$1,props:useTooltipProps,emits:tooltipEmits,setup(r,{expose:n,emit:i}){const o=r;usePopperContainer();const a=useId(),u=vue.ref(),c=vue.ref(),f=()=>{var w;const T=vue.unref(u);T&&((w=T.popperInstanceRef)==null||w.update())},d=vue.ref(!1),h=vue.ref(),{show:v,hide:g,hasUpdateHandler:p}=useTooltipModelToggle({indicator:d,toggleReason:h}),{onOpen:y,onClose:_}=useDelayedToggle({showAfter:vue.toRef(o,"showAfter"),hideAfter:vue.toRef(o,"hideAfter"),autoClose:vue.toRef(o,"autoClose"),open:v,close:g}),b=vue.computed(()=>isBoolean(o.visible)&&!p.value);vue.provide(TOOLTIP_INJECTION_KEY,{controlled:b,id:a,open:vue.readonly(d),trigger:vue.toRef(o,"trigger"),onOpen:w=>{y(w)},onClose:w=>{_(w)},onToggle:w=>{vue.unref(d)?_(w):y(w)},onShow:()=>{i("show",h.value)},onHide:()=>{i("hide",h.value)},onBeforeShow:()=>{i("before-show",h.value)},onBeforeHide:()=>{i("before-hide",h.value)},updatePopper:f}),vue.watch(()=>o.disabled,w=>{w&&d.value&&(d.value=!1)});const A=()=>{var w,T;const S=(T=(w=c.value)==null?void 0:w.contentRef)==null?void 0:T.popperContentRef;return S&&S.contains(document.activeElement)};return vue.onDeactivated(()=>d.value&&g()),n({popperRef:u,contentRef:c,isFocusInsideContent:A,updatePopper:f,onOpen:y,onClose:_,hide:g}),(w,T)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopper),{ref_key:"popperRef",ref:u,role:w.role},{default:vue.withCtx(()=>[vue.createVNode(ElTooltipTrigger,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:vue.withCtx(()=>[w.$slots.default?vue.renderSlot(w.$slots,"default",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),vue.createVNode(ElTooltipContent,{ref_key:"contentRef",ref:c,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:vue.withCtx(()=>[vue.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(vue.openBlock(),vue.createElementBlock("span",{key:0,innerHTML:w.content},null,8,_hoisted_1$6)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$4,vue.toDisplayString(w.content),1))]),w.showArrow?(vue.openBlock(),vue.createBlock(vue.unref(ElPopperArrow),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):vue.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Tooltip=_export_sfc(_sfc_main$d,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/tooltip.vue"]]);const ElTooltip=withInstall(Tooltip);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const nodeList=new Map;let startClick;isClient&&(document.addEventListener("mousedown",r=>startClick=r),document.addEventListener("mouseup",r=>{for(const n of nodeList.values())for(const{documentHandler:i}of n)i(r,startClick)}));function createDocumentHandler(r,n){let i=[];return Array.isArray(n.arg)?i=n.arg:isElement(n.arg)&&i.push(n.arg),function(o,a){const u=n.instance.popperRef,c=o.target,f=a==null?void 0:a.target,d=!n||!n.instance,h=!c||!f,v=r.contains(c)||r.contains(f),g=r===c,p=i.length&&i.some(_=>_==null?void 0:_.contains(c))||i.length&&i.includes(f),y=u&&(u.contains(c)||u.contains(f));d||h||v||g||p||y||n.value(o,a)}}const ClickOutside={beforeMount(r,n){nodeList.has(r)||nodeList.set(r,[]),nodeList.get(r).push({documentHandler:createDocumentHandler(r,n),bindingFn:n.value})},updated(r,n){nodeList.has(r)||nodeList.set(r,[]);const i=nodeList.get(r),o=i.findIndex(u=>u.bindingFn===n.oldValue),a={documentHandler:createDocumentHandler(r,n),bindingFn:n.value};o>=0?i.splice(o,1,a):i.push(a)},unmounted(r){nodeList.delete(r)}},tagProps=buildProps({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:componentSizes,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tagEmits={close:r=>r instanceof MouseEvent,click:r=>r instanceof MouseEvent},__default__=vue.defineComponent({name:"ElTag"}),_sfc_main$c=vue.defineComponent({...__default__,props:tagProps,emits:tagEmits,setup(r,{emit:n}){const i=r,o=useFormSize(),a=useNamespace("tag"),u=vue.computed(()=>{const{type:d,hit:h,effect:v,closable:g,round:p}=i;return[a.b(),a.is("closable",g),a.m(d),a.m(o.value),a.m(v),a.is("hit",h),a.is("round",p)]}),c=d=>{n("close",d)},f=d=>{n("click",d)};return(d,h)=>d.disableTransitions?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:d.color}),onClick:f},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(d.$slots,"default")],2),d.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,name:`${vue.unref(a).namespace.value}-zoom-in-center`,appear:""},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:d.color}),onClick:f},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(d.$slots,"default")],2),d.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Tag=_export_sfc(_sfc_main$c,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);const ElTag=withInstall(Tag),selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect");function useOption(r,n){const i=vue.inject(selectKey),o=vue.inject(selectGroupKey,{disabled:!1}),a=vue.computed(()=>Object.prototype.toString.call(r.value).toLowerCase()==="[object object]"),u=vue.computed(()=>i.props.multiple?g(i.props.modelValue,r.value):p(r.value,i.props.modelValue)),c=vue.computed(()=>{if(i.props.multiple){const b=i.props.modelValue||[];return!u.value&&b.length>=i.props.multipleLimit&&i.props.multipleLimit>0}else return!1}),f=vue.computed(()=>r.label||(a.value?"":r.value)),d=vue.computed(()=>r.value||r.label||""),h=vue.computed(()=>r.disabled||n.groupDisabled||c.value),v=vue.getCurrentInstance(),g=(b=[],A)=>{if(a.value){const w=i.props.valueKey;return b&&b.some(T=>vue.toRaw(lodashEs.get(T,w))===lodashEs.get(A,w))}else return b&&b.includes(A)},p=(b,A)=>{if(a.value){const{valueKey:w}=i.props;return lodashEs.get(b,w)===lodashEs.get(A,w)}else return b===A},y=()=>{!r.disabled&&!o.disabled&&(i.hoverIndex=i.optionsArray.indexOf(v.proxy))};vue.watch(()=>f.value,()=>{!r.created&&!i.props.remote&&i.setSelected()}),vue.watch(()=>r.value,(b,A)=>{const{remote:w,valueKey:T}=i.props;if(Object.is(b,A)||(i.onOptionDestroy(A,v.proxy),i.onOptionCreate(v.proxy)),!r.created&&!w){if(T&&typeof b=="object"&&typeof A=="object"&&b[T]===A[T])return;i.setSelected()}}),vue.watch(()=>o.disabled,()=>{n.groupDisabled=o.disabled},{immediate:!0});const{queryChange:_}=vue.toRaw(i);return vue.watch(_,b=>{const{query:A}=vue.unref(b),w=new RegExp(escapeStringRegexp(A),"i");n.visible=w.test(f.value)||r.created,n.visible||i.filteredOptionsCount--},{immediate:!0}),{select:i,currentLabel:f,currentValue:d,itemSelected:u,isDisabled:h,hoverItem:y}}const _sfc_main$b=vue.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},setup(r){const n=useNamespace("select"),i=vue.computed(()=>[n.be("dropdown","item"),n.is("disabled",vue.unref(c)),{selected:vue.unref(u),hover:vue.unref(v)}]),o=vue.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:a,itemSelected:u,isDisabled:c,select:f,hoverItem:d}=useOption(r,o),{visible:h,hover:v}=vue.toRefs(o),g=vue.getCurrentInstance().proxy;f.onOptionCreate(g),vue.onBeforeUnmount(()=>{const y=g.value,{selected:_}=f,A=(f.props.multiple?_:[_]).some(w=>w.value===g.value);vue.nextTick(()=>{f.cachedOptions.get(y)===g&&!A&&f.cachedOptions.delete(y)}),f.onOptionDestroy(y,g)});function p(){r.disabled!==!0&&o.groupDisabled!==!0&&f.handleOptionSelect(g)}return{ns:n,containerKls:i,currentLabel:a,itemSelected:u,isDisabled:c,select:f,hoverItem:d,visible:h,hover:v,selectOptionClick:p,states:o}}});function _sfc_render$3(r,n,i,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("li",{class:vue.normalizeClass(r.containerKls),onMouseenter:n[0]||(n[0]=(...c)=>r.hoverItem&&r.hoverItem(...c)),onClick:n[1]||(n[1]=vue.withModifiers((...c)=>r.selectOptionClick&&r.selectOptionClick(...c),["stop"]))},[vue.renderSlot(r.$slots,"default",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(r.currentLabel),1)])],34)),[[vue.vShow,r.visible]])}var Option=_export_sfc(_sfc_main$b,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);const _sfc_main$a=vue.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const r=vue.inject(selectKey),n=useNamespace("select"),i=vue.computed(()=>r.props.popperClass),o=vue.computed(()=>r.props.multiple),a=vue.computed(()=>r.props.fitInputWidth),u=vue.ref("");function c(){var f;u.value=`${(f=r.selectWrapper)==null?void 0:f.offsetWidth}px`}return vue.onMounted(()=>{c(),useResizeObserver(r.selectWrapper,c)}),{ns:n,minWidth:u,popperClass:i,isMultiple:o,isFitInputWidth:a}}});function _sfc_render$2(r,n,i,o,a,u){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([r.ns.b("dropdown"),r.ns.is("multiple",r.isMultiple),r.popperClass]),style:vue.normalizeStyle({[r.isFitInputWidth?"width":"minWidth"]:r.minWidth})},[vue.renderSlot(r.$slots,"default")],6)}var ElSelectMenu=_export_sfc(_sfc_main$a,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);function useSelectStates(r){const{t:n}=useLocale();return vue.reactive({options:new Map,cachedOptions:new Map,createdLabel:null,createdSelected:!1,selected:r.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:n("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1})}let ignoreFocusEvent=!1;const useSelect=(r,n,i)=>{const{t:o}=useLocale(),a=useNamespace("select");useDeprecated({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},vue.computed(()=>r.suffixTransition===!1));const u=vue.ref(null),c=vue.ref(null),f=vue.ref(null),d=vue.ref(null),h=vue.ref(null),v=vue.ref(null),g=vue.ref(null),p=vue.ref(null),y=vue.ref(-1),_=vue.shallowRef({query:""}),b=vue.shallowRef(""),A=vue.ref([]);let w=0;const{form:T,formItem:S}=useFormItem(),x=vue.computed(()=>!r.filterable||r.multiple||!n.visible),O=vue.computed(()=>r.disabled||(T==null?void 0:T.disabled)),L=vue.computed(()=>{const bn=r.multiple?Array.isArray(r.modelValue)&&r.modelValue.length>0:r.modelValue!==void 0&&r.modelValue!==null&&r.modelValue!=="";return r.clearable&&!O.value&&n.inputHovering&&bn}),M=vue.computed(()=>r.remote&&r.filterable&&!r.remoteShowSuffix?"":r.suffixIcon),re=vue.computed(()=>a.is("reverse",M.value&&n.visible&&r.suffixTransition)),F=vue.computed(()=>r.remote?300:0),j=vue.computed(()=>r.loading?r.loadingText||o("el.select.loading"):r.remote&&n.query===""&&n.options.size===0?!1:r.filterable&&n.query&&n.options.size>0&&n.filteredOptionsCount===0?r.noMatchText||o("el.select.noMatch"):n.options.size===0?r.noDataText||o("el.select.noData"):null),V=vue.computed(()=>{const bn=Array.from(n.options.values()),wn=[];return A.value.forEach(Ln=>{const Bn=bn.findIndex(Mn=>Mn.currentLabel===Ln);Bn>-1&&wn.push(bn[Bn])}),wn.length?wn:bn}),z=vue.computed(()=>Array.from(n.cachedOptions.values())),$=vue.computed(()=>{const bn=V.value.filter(wn=>!wn.created).some(wn=>wn.currentLabel===n.query);return r.filterable&&r.allowCreate&&n.query!==""&&!bn}),he=useFormSize(),le=vue.computed(()=>["small"].includes(he.value)?"small":"default"),Ie=vue.computed({get(){return n.visible&&j.value!==!1},set(bn){n.visible=bn}});vue.watch([()=>O.value,()=>he.value,()=>T==null?void 0:T.size],()=>{vue.nextTick(()=>{Fe()})}),vue.watch(()=>r.placeholder,bn=>{n.cachedPlaceHolder=n.currentPlaceholder=bn,r.multiple&&Array.isArray(r.modelValue)&&r.modelValue.length>0&&(n.currentPlaceholder="")}),vue.watch(()=>r.modelValue,(bn,wn)=>{r.multiple&&(Fe(),bn&&bn.length>0||c.value&&n.query!==""?n.currentPlaceholder="":n.currentPlaceholder=n.cachedPlaceHolder,r.filterable&&!r.reserveKeyword&&(n.query="",pe(n.query))),Et(),r.filterable&&!r.multiple&&(n.inputLength=20),!lodashEs.isEqual(bn,wn)&&r.validateEvent&&(S==null||S.validate("change").catch(Ln=>debugWarn(Ln)))},{flush:"post",deep:!0}),vue.watch(()=>n.visible,bn=>{var wn,Ln,Bn,Mn,On;bn?((Ln=(wn=d.value)==null?void 0:wn.updatePopper)==null||Ln.call(wn),r.filterable&&(n.filteredOptionsCount=n.optionsCount,n.query=r.remote?"":n.selectedLabel,(Mn=(Bn=f.value)==null?void 0:Bn.focus)==null||Mn.call(Bn),r.multiple?(On=c.value)==null||On.focus():n.selectedLabel&&(n.currentPlaceholder=`${n.selectedLabel}`,n.selectedLabel=""),pe(n.query),!r.multiple&&!r.remote&&(_.value.query="",vue.triggerRef(_),vue.triggerRef(b)))):(r.filterable&&(isFunction(r.filterMethod)&&r.filterMethod(""),isFunction(r.remoteMethod)&&r.remoteMethod("")),c.value&&c.value.blur(),n.query="",n.previousQuery=null,n.selectedLabel="",n.inputLength=20,n.menuVisibleOnFocus=!1,vn(),vue.nextTick(()=>{c.value&&c.value.value===""&&n.selected.length===0&&(n.currentPlaceholder=n.cachedPlaceHolder)}),r.multiple||(n.selected&&(r.filterable&&r.allowCreate&&n.createdSelected&&n.createdLabel?n.selectedLabel=n.createdLabel:n.selectedLabel=n.selected.currentLabel,r.filterable&&(n.query=n.selectedLabel)),r.filterable&&(n.currentPlaceholder=n.cachedPlaceHolder))),i.emit("visible-change",bn)}),vue.watch(()=>n.options.entries(),()=>{var bn,wn,Ln;if(!isClient)return;(wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn),r.multiple&&Fe();const Bn=((Ln=g.value)==null?void 0:Ln.querySelectorAll("input"))||[];Array.from(Bn).includes(document.activeElement)||Et(),r.defaultFirstOption&&(r.filterable||r.remote)&&n.filteredOptionsCount&&_e()},{flush:"post"}),vue.watch(()=>n.hoverIndex,bn=>{isNumber(bn)&&bn>-1?y.value=V.value[bn]||{}:y.value={},V.value.forEach(wn=>{wn.hover=y.value===wn})});const Fe=()=>{vue.nextTick(()=>{var bn,wn;if(!u.value)return;const Ln=u.value.$el.querySelector("input");w=w||(Ln.clientHeight>0?Ln.clientHeight+2:0);const Bn=v.value,Mn=getComponentSize(he.value||(T==null?void 0:T.size)),On=he.value||Mn===w||w<=0?Mn:w;!(Ln.offsetParent===null)&&(Ln.style.height=`${(n.selected.length===0?On:Math.max(Bn?Bn.clientHeight+(Bn.clientHeight>On?6:0):0,On))-2}px`),n.visible&&j.value!==!1&&((wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn))})},pe=async bn=>{if(!(n.previousQuery===bn||n.isOnComposition)){if(n.previousQuery===null&&(isFunction(r.filterMethod)||isFunction(r.remoteMethod))){n.previousQuery=bn;return}n.previousQuery=bn,vue.nextTick(()=>{var wn,Ln;n.visible&&((Ln=(wn=d.value)==null?void 0:wn.updatePopper)==null||Ln.call(wn))}),n.hoverIndex=-1,r.multiple&&r.filterable&&vue.nextTick(()=>{const wn=c.value.value.length*15+20;n.inputLength=r.collapseTags?Math.min(50,wn):wn,Lt(),Fe()}),r.remote&&isFunction(r.remoteMethod)?(n.hoverIndex=-1,r.remoteMethod(bn)):isFunction(r.filterMethod)?(r.filterMethod(bn),vue.triggerRef(b)):(n.filteredOptionsCount=n.optionsCount,_.value.query=bn,vue.triggerRef(_),vue.triggerRef(b)),r.defaultFirstOption&&(r.filterable||r.remote)&&n.filteredOptionsCount&&(await vue.nextTick(),_e())}},Lt=()=>{n.currentPlaceholder!==""&&(n.currentPlaceholder=c.value.value?"":n.cachedPlaceHolder)},_e=()=>{const bn=V.value.filter(Bn=>Bn.visible&&!Bn.disabled&&!Bn.states.groupDisabled),wn=bn.find(Bn=>Bn.created),Ln=bn[0];n.hoverIndex=Oe(V.value,wn||Ln)},Et=()=>{var bn;if(r.multiple)n.selectedLabel="";else{const Ln=Cn(r.modelValue);(bn=Ln.props)!=null&&bn.created?(n.createdLabel=Ln.props.value,n.createdSelected=!0):n.createdSelected=!1,n.selectedLabel=Ln.currentLabel,n.selected=Ln,r.filterable&&(n.query=n.selectedLabel);return}const wn=[];Array.isArray(r.modelValue)&&r.modelValue.forEach(Ln=>{wn.push(Cn(Ln))}),n.selected=wn,vue.nextTick(()=>{Fe()})},Cn=bn=>{let wn;const Ln=toRawType(bn).toLowerCase()==="object",Bn=toRawType(bn).toLowerCase()==="null",Mn=toRawType(bn).toLowerCase()==="undefined";for(let Vn=n.cachedOptions.size-1;Vn>=0;Vn--){const Nn=z.value[Vn];if(Ln?lodashEs.get(Nn.value,r.valueKey)===lodashEs.get(bn,r.valueKey):Nn.value===bn){wn={value:bn,currentLabel:Nn.currentLabel,isDisabled:Nn.isDisabled};break}}if(wn)return wn;const On=Ln?bn.label:!Bn&&!Mn?bn:"",Gn={value:bn,currentLabel:On};return r.multiple&&(Gn.hitState=!1),Gn},vn=()=>{setTimeout(()=>{const bn=r.valueKey;r.multiple?n.selected.length>0?n.hoverIndex=Math.min.apply(null,n.selected.map(wn=>V.value.findIndex(Ln=>lodashEs.get(Ln,bn)===lodashEs.get(wn,bn)))):n.hoverIndex=-1:n.hoverIndex=V.value.findIndex(wn=>Ue(wn)===Ue(n.selected))},300)},Dt=()=>{var bn,wn;de(),(wn=(bn=d.value)==null?void 0:bn.updatePopper)==null||wn.call(bn),r.multiple&&Fe()},de=()=>{var bn;n.inputWidth=(bn=u.value)==null?void 0:bn.$el.offsetWidth},qe=()=>{r.filterable&&n.query!==n.selectedLabel&&(n.query=n.selectedLabel,pe(n.query))},Pt=lodashEs.debounce(()=>{qe()},F.value),In=lodashEs.debounce(bn=>{pe(bn.target.value)},F.value),$e=bn=>{lodashEs.isEqual(r.modelValue,bn)||i.emit(CHANGE_EVENT,bn)},Ce=bn=>{if(bn.code!==EVENT_CODE.delete){if(bn.target.value.length<=0&&!Y()){const wn=r.modelValue.slice();wn.pop(),i.emit(UPDATE_MODEL_EVENT,wn),$e(wn)}bn.target.value.length===1&&r.modelValue.length===0&&(n.currentPlaceholder=n.cachedPlaceHolder)}},ue=(bn,wn)=>{const Ln=n.selected.indexOf(wn);if(Ln>-1&&!O.value){const Bn=r.modelValue.slice();Bn.splice(Ln,1),i.emit(UPDATE_MODEL_EVENT,Bn),$e(Bn),i.emit("remove-tag",wn.value)}bn.stopPropagation()},At=bn=>{bn.stopPropagation();const wn=r.multiple?[]:"";if(!isString(wn))for(const Ln of n.selected)Ln.isDisabled&&wn.push(Ln.value);i.emit(UPDATE_MODEL_EVENT,wn),$e(wn),n.hoverIndex=-1,n.visible=!1,i.emit("clear")},Ne=bn=>{var wn;if(r.multiple){const Ln=(r.modelValue||[]).slice(),Bn=Oe(Ln,bn.value);Bn>-1?Ln.splice(Bn,1):(r.multipleLimit<=0||Ln.length<r.multipleLimit)&&Ln.push(bn.value),i.emit(UPDATE_MODEL_EVENT,Ln),$e(Ln),bn.created&&(n.query="",pe(""),n.inputLength=20),r.filterable&&((wn=c.value)==null||wn.focus())}else i.emit(UPDATE_MODEL_EVENT,bn.value),$e(bn.value),n.visible=!1;kt(),!n.visible&&vue.nextTick(()=>{jt(bn)})},Oe=(bn=[],wn)=>{if(!isObject(wn))return bn.indexOf(wn);const Ln=r.valueKey;let Bn=-1;return bn.some((Mn,On)=>vue.toRaw(lodashEs.get(Mn,Ln))===lodashEs.get(wn,Ln)?(Bn=On,!0):!1),Bn},kt=()=>{const bn=c.value||u.value;bn&&(bn==null||bn.focus())},jt=bn=>{var wn,Ln,Bn,Mn,On;const Gn=Array.isArray(bn)?bn[0]:bn;let Vn=null;if(Gn!=null&&Gn.value){const Nn=V.value.filter(Dn=>Dn.value===Gn.value);Nn.length>0&&(Vn=Nn[0].$el)}if(d.value&&Vn){const Nn=(Mn=(Bn=(Ln=(wn=d.value)==null?void 0:wn.popperRef)==null?void 0:Ln.contentRef)==null?void 0:Bn.querySelector)==null?void 0:Mn.call(Bn,`.${a.be("dropdown","wrap")}`);Nn&&scrollIntoView(Nn,Vn)}(On=p.value)==null||On.handleScroll()},_n=bn=>{n.optionsCount++,n.filteredOptionsCount++,n.options.set(bn.value,bn),n.cachedOptions.set(bn.value,bn)},ie=(bn,wn)=>{n.options.get(bn)===wn&&(n.optionsCount--,n.filteredOptionsCount--,n.options.delete(bn))},ae=bn=>{bn.code!==EVENT_CODE.backspace&&Y(!1),n.inputLength=c.value.value.length*15+20,Fe()},Y=bn=>{if(!Array.isArray(n.selected))return;const wn=n.selected[n.selected.length-1];if(wn)return bn===!0||bn===!1?(wn.hitState=bn,bn):(wn.hitState=!wn.hitState,wn.hitState)},k=bn=>{const wn=bn.target.value;if(bn.type==="compositionend")n.isOnComposition=!1,vue.nextTick(()=>pe(wn));else{const Ln=wn[wn.length-1]||"";n.isOnComposition=!isKorean(Ln)}},D=()=>{vue.nextTick(()=>jt(n.selected))},oe=bn=>{ignoreFocusEvent?ignoreFocusEvent=!1:((r.automaticDropdown||r.filterable)&&(r.filterable&&!n.visible&&(n.menuVisibleOnFocus=!0),n.visible=!0),i.emit("focus",bn))},xe=()=>{var bn,wn,Ln;n.visible=!1,(bn=u.value)==null||bn.blur(),(Ln=(wn=f.value)==null?void 0:wn.blur)==null||Ln.call(wn)},ze=bn=>{setTimeout(()=>{var wn;if((wn=d.value)!=null&&wn.isFocusInsideContent()){ignoreFocusEvent=!0;return}n.visible&&An(),i.emit("blur",bn)})},hn=bn=>{At(bn)},An=()=>{n.visible=!1},Tn=bn=>{n.visible&&(bn.preventDefault(),bn.stopPropagation(),n.visible=!1)},Rn=bn=>{var wn;bn&&!n.mouseEnter||O.value||(n.menuVisibleOnFocus?n.menuVisibleOnFocus=!1:(!d.value||!d.value.isFocusInsideContent())&&(n.visible=!n.visible),n.visible&&((wn=c.value||u.value)==null||wn.focus()))},Ve=()=>{n.visible?V.value[n.hoverIndex]&&Ne(V.value[n.hoverIndex]):Rn()},Ue=bn=>isObject(bn.value)?lodashEs.get(bn.value,r.valueKey):bn.value,En=vue.computed(()=>V.value.filter(bn=>bn.visible).every(bn=>bn.disabled)),Sn=vue.computed(()=>n.selected.slice(0,r.maxCollapseTags)),xn=vue.computed(()=>n.selected.slice(r.maxCollapseTags)),Pn=bn=>{if(!n.visible){n.visible=!0;return}if(!(n.options.size===0||n.filteredOptionsCount===0)&&!n.isOnComposition&&!En.value){bn==="next"?(n.hoverIndex++,n.hoverIndex===n.options.size&&(n.hoverIndex=0)):bn==="prev"&&(n.hoverIndex--,n.hoverIndex<0&&(n.hoverIndex=n.options.size-1));const wn=V.value[n.hoverIndex];(wn.disabled===!0||wn.states.groupDisabled===!0||!wn.visible)&&Pn(bn),vue.nextTick(()=>jt(y.value))}};return{optionList:A,optionsArray:V,selectSize:he,handleResize:Dt,debouncedOnInputChange:Pt,debouncedQueryChange:In,deletePrevTag:Ce,deleteTag:ue,deleteSelected:At,handleOptionSelect:Ne,scrollToOption:jt,readonly:x,resetInputHeight:Fe,showClose:L,iconComponent:M,iconReverse:re,showNewOption:$,collapseTagSize:le,setSelected:Et,managePlaceholder:Lt,selectDisabled:O,emptyText:j,toggleLastOptionHitState:Y,resetInputState:ae,handleComposition:k,onOptionCreate:_n,onOptionDestroy:ie,handleMenuEnter:D,handleFocus:oe,blur:xe,handleBlur:ze,handleClearClick:hn,handleClose:An,handleKeydownEscape:Tn,toggleMenu:Rn,selectOption:Ve,getValueKey:Ue,navigateOptions:Pn,handleDeleteTooltipTag:(bn,wn)=>{var Ln,Bn;ue(bn,wn),(Bn=(Ln=h.value)==null?void 0:Ln.updatePopper)==null||Bn.call(Ln)},dropMenuVisible:Ie,queryChange:_,groupQueryChange:b,showTagList:Sn,collapseTagList:xn,reference:u,input:c,iOSInput:f,tooltipRef:d,tagTooltipRef:h,tags:v,selectWrapper:g,scrollbar:p,handleMouseEnter:()=>{n.mouseEnter=!0},handleMouseLeave:()=>{n.mouseEnter=!1}}};var ElOptions=vue.defineComponent({name:"ElOptions",emits:["update-options"],setup(r,{slots:n,emit:i}){let o=[];function a(u,c){if(u.length!==c.length)return!1;for(const[f]of u.entries())if(u[f]!=c[f])return!1;return!0}return()=>{var u,c;const f=(u=n.default)==null?void 0:u.call(n),d=[];function h(v){Array.isArray(v)&&v.forEach(g=>{var p,y,_,b;const A=(p=(g==null?void 0:g.type)||{})==null?void 0:p.name;A==="ElOptionGroup"?h(!isString(g.children)&&!Array.isArray(g.children)&&isFunction((y=g.children)==null?void 0:y.default)?(_=g.children)==null?void 0:_.default():g.children):A==="ElOption"?d.push((b=g.props)==null?void 0:b.label):Array.isArray(g.children)&&h(g.children)})}return f.length&&h((c=f[0])==null?void 0:c.children),a(d,o)||(o=d,i("update-options",d)),f}}});const COMPONENT_NAME="ElSelect",_sfc_main$9=vue.defineComponent({name:COMPONENT_NAME,componentName:COMPONENT_NAME,components:{ElInput,ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:isValidComponentSize},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:{type:Boolean,default:!1},suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:Ee,default:"bottom-start"}},emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(r,n){const i=useNamespace("select"),o=useNamespace("input"),{t:a}=useLocale(),u=useSelectStates(r),{optionList:c,optionsArray:f,selectSize:d,readonly:h,handleResize:v,collapseTagSize:g,debouncedOnInputChange:p,debouncedQueryChange:y,deletePrevTag:_,deleteTag:b,deleteSelected:A,handleOptionSelect:w,scrollToOption:T,setSelected:S,resetInputHeight:x,managePlaceholder:O,showClose:L,selectDisabled:M,iconComponent:re,iconReverse:F,showNewOption:j,emptyText:V,toggleLastOptionHitState:z,resetInputState:$,handleComposition:he,onOptionCreate:le,onOptionDestroy:Ie,handleMenuEnter:Fe,handleFocus:pe,blur:Lt,handleBlur:_e,handleClearClick:Et,handleClose:Cn,handleKeydownEscape:vn,toggleMenu:Dt,selectOption:de,getValueKey:qe,navigateOptions:Pt,handleDeleteTooltipTag:In,dropMenuVisible:$e,reference:Ce,input:ue,iOSInput:At,tooltipRef:Ne,tagTooltipRef:Oe,tags:kt,selectWrapper:jt,scrollbar:_n,queryChange:ie,groupQueryChange:ae,handleMouseEnter:Y,handleMouseLeave:k,showTagList:D,collapseTagList:oe}=useSelect(r,u,n),{focus:xe}=useFocus(Ce),{inputWidth:ze,selected:hn,inputLength:An,filteredOptionsCount:Tn,visible:Rn,selectedLabel:Ve,hoverIndex:Ue,query:En,inputHovering:Sn,currentPlaceholder:xn,menuVisibleOnFocus:Pn,isOnComposition:kn,options:$n,cachedOptions:Wn,optionsCount:bn,prefixWidth:wn}=vue.toRefs(u),Ln=vue.computed(()=>{const Fn=[i.b()],Zn=vue.unref(d);return Zn&&Fn.push(i.m(Zn)),r.disabled&&Fn.push(i.m("disabled")),Fn}),Bn=vue.computed(()=>[i.e("tags"),i.is("disabled",vue.unref(M))]),Mn=vue.computed(()=>[i.b("tags-wrapper"),{"has-prefix":vue.unref(wn)&&vue.unref(hn).length}]),On=vue.computed(()=>[i.e("input"),i.is(vue.unref(d)),i.is("disabled",vue.unref(M))]),Gn=vue.computed(()=>[i.e("input"),i.is(vue.unref(d)),i.em("input","iOS")]),Vn=vue.computed(()=>[i.is("empty",!r.allowCreate&&!!vue.unref(En)&&vue.unref(Tn)===0)]),Nn=vue.computed(()=>({maxWidth:`${vue.unref(ze)-32}px`,width:"100%"})),Dn=vue.computed(()=>({maxWidth:`${vue.unref(ze)>123?vue.unref(ze)-123:vue.unref(ze)-75}px`})),Hn=vue.computed(()=>({marginLeft:`${vue.unref(wn)}px`,flexGrow:1,width:`${vue.unref(An)/(vue.unref(ze)-32)}%`,maxWidth:`${vue.unref(ze)-42}px`}));vue.provide(selectKey,vue.reactive({props:r,options:$n,optionsArray:f,cachedOptions:Wn,optionsCount:bn,filteredOptionsCount:Tn,hoverIndex:Ue,handleOptionSelect:w,onOptionCreate:le,onOptionDestroy:Ie,selectWrapper:jt,selected:hn,setSelected:S,queryChange:ie,groupQueryChange:ae})),vue.onMounted(()=>{u.cachedPlaceHolder=xn.value=r.placeholder||(()=>a("el.select.placeholder")),r.multiple&&Array.isArray(r.modelValue)&&r.modelValue.length>0&&(xn.value=""),useResizeObserver(jt,v),r.remote&&r.multiple&&x(),vue.nextTick(()=>{const Fn=Ce.value&&Ce.value.$el;if(Fn&&(ze.value=Fn.getBoundingClientRect().width,n.slots.prefix)){const Zn=Fn.querySelector(`.${o.e("prefix")}`);wn.value=Math.max(Zn.getBoundingClientRect().width+11,30)}}),S()}),r.multiple&&!Array.isArray(r.modelValue)&&n.emit(UPDATE_MODEL_EVENT,[]),!r.multiple&&Array.isArray(r.modelValue)&&n.emit(UPDATE_MODEL_EVENT,"");const zn=vue.computed(()=>{var Fn,Zn;return(Zn=(Fn=Ne.value)==null?void 0:Fn.popperRef)==null?void 0:Zn.contentRef});return{isIOS,onOptionsRendered:Fn=>{c.value=Fn},prefixWidth:wn,selectSize:d,readonly:h,handleResize:v,collapseTagSize:g,debouncedOnInputChange:p,debouncedQueryChange:y,deletePrevTag:_,deleteTag:b,handleDeleteTooltipTag:In,deleteSelected:A,handleOptionSelect:w,scrollToOption:T,inputWidth:ze,selected:hn,inputLength:An,filteredOptionsCount:Tn,visible:Rn,selectedLabel:Ve,hoverIndex:Ue,query:En,inputHovering:Sn,currentPlaceholder:xn,menuVisibleOnFocus:Pn,isOnComposition:kn,options:$n,resetInputHeight:x,managePlaceholder:O,showClose:L,selectDisabled:M,iconComponent:re,iconReverse:F,showNewOption:j,emptyText:V,toggleLastOptionHitState:z,resetInputState:$,handleComposition:he,handleMenuEnter:Fe,handleFocus:pe,blur:Lt,handleBlur:_e,handleClearClick:Et,handleClose:Cn,handleKeydownEscape:vn,toggleMenu:Dt,selectOption:de,getValueKey:qe,navigateOptions:Pt,dropMenuVisible:$e,focus:xe,reference:Ce,input:ue,iOSInput:At,tooltipRef:Ne,popperPaneRef:zn,tags:kt,selectWrapper:jt,scrollbar:_n,wrapperKls:Ln,tagsKls:Bn,tagWrapperKls:Mn,inputKls:On,iOSInputKls:Gn,scrollbarKls:Vn,selectTagsStyle:Nn,nsSelect:i,tagTextStyle:Dn,inputStyle:Hn,handleMouseEnter:Y,handleMouseLeave:k,showTagList:D,collapseTagList:oe,tagTooltipRef:Oe}}}),_hoisted_1$5=["disabled","autocomplete"],_hoisted_2$3=["disabled"],_hoisted_3$3={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function _sfc_render$1(r,n,i,o,a,u){const c=vue.resolveComponent("el-tag"),f=vue.resolveComponent("el-tooltip"),d=vue.resolveComponent("el-icon"),h=vue.resolveComponent("el-input"),v=vue.resolveComponent("el-option"),g=vue.resolveComponent("el-options"),p=vue.resolveComponent("el-scrollbar"),y=vue.resolveComponent("el-select-menu"),_=vue.resolveDirective("click-outside");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"selectWrapper",class:vue.normalizeClass(r.wrapperKls),onMouseenter:n[21]||(n[21]=(...b)=>r.handleMouseEnter&&r.handleMouseEnter(...b)),onMouseleave:n[22]||(n[22]=(...b)=>r.handleMouseLeave&&r.handleMouseLeave(...b)),onClick:n[23]||(n[23]=vue.withModifiers((...b)=>r.toggleMenu&&r.toggleMenu(...b),["stop"]))},[vue.createVNode(f,{ref:"tooltipRef",visible:r.dropMenuVisible,placement:r.placement,teleported:r.teleported,"popper-class":[r.nsSelect.e("popper"),r.popperClass],"popper-options":r.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:r.effect,pure:"",trigger:"click",transition:`${r.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:r.persistent,onShow:r.handleMenuEnter},{default:vue.withCtx(()=>[vue.createElementVNode("div",{class:"select-trigger",onMouseenter:n[19]||(n[19]=b=>r.inputHovering=!0),onMouseleave:n[20]||(n[20]=b=>r.inputHovering=!1)},[r.multiple?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"tags",class:vue.normalizeClass(r.tagsKls),style:vue.normalizeStyle(r.selectTagsStyle)},[r.collapseTags&&r.selected.length?(vue.openBlock(),vue.createBlock(vue.Transition,{key:0,onAfterLeave:r.resetInputHeight},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.tagWrapperKls)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.showTagList,b=>(vue.openBlock(),vue.createBlock(c,{key:r.getValueKey(b),closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",onClose:A=>r.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle(r.tagTextStyle)},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),r.selected.length>r.maxCollapseTags?(vue.openBlock(),vue.createBlock(c,{key:0,closable:!1,size:r.collapseTagSize,type:r.tagType,"disable-transitions":""},{default:vue.withCtx(()=>[r.collapseTagsTooltip?(vue.openBlock(),vue.createBlock(f,{key:0,ref:"tagTooltipRef",disabled:r.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:r.effect,placement:"bottom",teleported:r.teleported},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text"))},"+ "+vue.toDisplayString(r.selected.length-r.maxCollapseTags),3)]),content:vue.withCtx(()=>[vue.createElementVNode("div",{class:vue.normalizeClass(r.nsSelect.e("collapse-tags"))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.collapseTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:r.getValueKey(b),class:vue.normalizeClass(r.nsSelect.e("collapse-tag"))},[vue.createVNode(c,{class:"in-tooltip",closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:A=>r.handleDeleteTooltipTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle({maxWidth:r.inputWidth-75+"px"})},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(r.nsSelect.e("tags-text"))},"+ "+vue.toDisplayString(r.selected.length-r.maxCollapseTags),3))]),_:1},8,["size","type"])):vue.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):vue.createCommentVNode("v-if",!0),r.collapseTags?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,onAfterLeave:r.resetInputHeight},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.tagWrapperKls),style:vue.normalizeStyle(r.prefixWidth&&r.selected.length?{marginLeft:`${r.prefixWidth}px`}:"")},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.selected,b=>(vue.openBlock(),vue.createBlock(c,{key:r.getValueKey(b),closable:!r.selectDisabled&&!b.isDisabled,size:r.collapseTagSize,hit:b.hitState,type:r.tagType,"disable-transitions":"",onClose:A=>r.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(r.nsSelect.e("tags-text")),style:vue.normalizeStyle({maxWidth:r.inputWidth-75+"px"})},vue.toDisplayString(b.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),r.filterable&&!r.selectDisabled?vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":n[0]||(n[0]=b=>r.query=b),type:"text",class:vue.normalizeClass(r.inputKls),disabled:r.selectDisabled,autocomplete:r.autocomplete,style:vue.normalizeStyle(r.inputStyle),onFocus:n[1]||(n[1]=(...b)=>r.handleFocus&&r.handleFocus(...b)),onBlur:n[2]||(n[2]=(...b)=>r.handleBlur&&r.handleBlur(...b)),onKeyup:n[3]||(n[3]=(...b)=>r.managePlaceholder&&r.managePlaceholder(...b)),onKeydown:[n[4]||(n[4]=(...b)=>r.resetInputState&&r.resetInputState(...b)),n[5]||(n[5]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("next"),["prevent"]),["down"])),n[6]||(n[6]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("prev"),["prevent"]),["up"])),n[7]||(n[7]=vue.withKeys((...b)=>r.handleKeydownEscape&&r.handleKeydownEscape(...b),["esc"])),n[8]||(n[8]=vue.withKeys(vue.withModifiers((...b)=>r.selectOption&&r.selectOption(...b),["stop","prevent"]),["enter"])),n[9]||(n[9]=vue.withKeys((...b)=>r.deletePrevTag&&r.deletePrevTag(...b),["delete"])),n[10]||(n[10]=vue.withKeys(b=>r.visible=!1,["tab"]))],onCompositionstart:n[11]||(n[11]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onCompositionupdate:n[12]||(n[12]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onCompositionend:n[13]||(n[13]=(...b)=>r.handleComposition&&r.handleComposition(...b)),onInput:n[14]||(n[14]=(...b)=>r.debouncedQueryChange&&r.debouncedQueryChange(...b))},null,46,_hoisted_1$5)),[[vue.vModelText,r.query]]):vue.createCommentVNode("v-if",!0)],6)):vue.createCommentVNode("v-if",!0),vue.createCommentVNode(" fix: https://github.com/element-plus/element-plus/issues/11415 "),r.isIOS&&!r.multiple&&r.filterable&&r.readonly?(vue.openBlock(),vue.createElementBlock("input",{key:1,ref:"iOSInput",class:vue.normalizeClass(r.iOSInputKls),disabled:r.selectDisabled,type:"text"},null,10,_hoisted_2$3)):vue.createCommentVNode("v-if",!0),vue.createVNode(h,{id:r.id,ref:"reference",modelValue:r.selectedLabel,"onUpdate:modelValue":n[15]||(n[15]=b=>r.selectedLabel=b),type:"text",placeholder:typeof r.currentPlaceholder=="function"?r.currentPlaceholder():r.currentPlaceholder,name:r.name,autocomplete:r.autocomplete,size:r.selectSize,disabled:r.selectDisabled,readonly:r.readonly,"validate-event":!1,class:vue.normalizeClass([r.nsSelect.is("focus",r.visible)]),tabindex:r.multiple&&r.filterable?-1:void 0,onFocus:r.handleFocus,onBlur:r.handleBlur,onInput:r.debouncedOnInputChange,onPaste:r.debouncedOnInputChange,onCompositionstart:r.handleComposition,onCompositionupdate:r.handleComposition,onCompositionend:r.handleComposition,onKeydown:[n[16]||(n[16]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("next"),["stop","prevent"]),["down"])),n[17]||(n[17]=vue.withKeys(vue.withModifiers(b=>r.navigateOptions("prev"),["stop","prevent"]),["up"])),vue.withKeys(vue.withModifiers(r.selectOption,["stop","prevent"]),["enter"]),vue.withKeys(r.handleKeydownEscape,["esc"]),n[18]||(n[18]=vue.withKeys(b=>r.visible=!1,["tab"]))]},vue.createSlots({suffix:vue.withCtx(()=>[r.iconComponent&&!r.showClose?(vue.openBlock(),vue.createBlock(d,{key:0,class:vue.normalizeClass([r.nsSelect.e("caret"),r.nsSelect.e("icon"),r.iconReverse])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),r.showClose&&r.clearIcon?(vue.openBlock(),vue.createBlock(d,{key:1,class:vue.normalizeClass([r.nsSelect.e("caret"),r.nsSelect.e("icon")]),onClick:r.handleClearClick},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.clearIcon)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)]),_:2},[r.$slots.prefix?{name:"prefix",fn:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$3,[vue.renderSlot(r.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]),content:vue.withCtx(()=>[vue.createVNode(y,null,{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(p,{ref:"scrollbar",tag:"ul","wrap-class":r.nsSelect.be("dropdown","wrap"),"view-class":r.nsSelect.be("dropdown","list"),class:vue.normalizeClass(r.scrollbarKls)},{default:vue.withCtx(()=>[r.showNewOption?(vue.openBlock(),vue.createBlock(v,{key:0,value:r.query,created:!0},null,8,["value"])):vue.createCommentVNode("v-if",!0),vue.createVNode(g,{onUpdateOptions:r.onOptionsRendered},{default:vue.withCtx(()=>[vue.renderSlot(r.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["wrap-class","view-class","class"]),[[vue.vShow,r.options.size>0&&!r.loading]]),r.emptyText&&(!r.allowCreate||r.loading||r.allowCreate&&r.options.size===0)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[r.$slots.empty?vue.renderSlot(r.$slots,"empty",{key:0}):(vue.openBlock(),vue.createElementBlock("p",{key:1,class:vue.normalizeClass(r.nsSelect.be("dropdown","empty"))},vue.toDisplayString(r.emptyText),3))],64)):vue.createCommentVNode("v-if",!0)]),_:3})]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[_,r.handleClose,r.popperPaneRef]])}var Select=_export_sfc(_sfc_main$9,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);const _sfc_main$8=vue.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},setup(r){const n=useNamespace("select"),i=vue.ref(!0),o=vue.getCurrentInstance(),a=vue.ref([]);vue.provide(selectGroupKey,vue.reactive({...vue.toRefs(r)}));const u=vue.inject(selectKey);vue.onMounted(()=>{a.value=c(o.subTree)});const c=d=>{const h=[];return Array.isArray(d.children)&&d.children.forEach(v=>{var g;v.type&&v.type.name==="ElOption"&&v.component&&v.component.proxy?h.push(v.component.proxy):(g=v.children)!=null&&g.length&&h.push(...c(v))}),h},{groupQueryChange:f}=vue.toRaw(u);return vue.watch(f,()=>{i.value=a.value.some(d=>d.visible===!0)},{flush:"post"}),{visible:i,ns:n}}});function _sfc_render(r,n,i,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",{class:vue.normalizeClass(r.ns.be("group","wrap"))},[vue.createElementVNode("li",{class:vue.normalizeClass(r.ns.be("group","title"))},vue.toDisplayString(r.label),3),vue.createElementVNode("li",null,[vue.createElementVNode("ul",{class:vue.normalizeClass(r.ns.b("group"))},[vue.renderSlot(r.$slots,"default")],2)])],2)),[[vue.vShow,r.visible]])}var OptionGroup=_export_sfc(_sfc_main$8,[["render",_sfc_render],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const _hoisted_1$4={class:"c-wall-d"},_sfc_main$7=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=vue.computed({get(){return i.modelValue},set(c){n("update:modelValue",c)}}),a=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],u=c=>{c!=="None"&&(o.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",o)};return(c,f)=>{var d,h;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(o).type,"onUpdate:modelValue":f[0]||(f[0]=v=>vue.unref(o).type=v),onChange:u},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.key,"onUpdate:modelValue":f[1]||(f[1]=v=>vue.unref(o).Relation.key=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(o).Relation.relation,"onUpdate:modelValue":f[2]||(f[2]=v=>vue.unref(o).Relation.relation=v)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(a,(v,g)=>vue.createVNode(vue.unref(ElOption),{value:v.val,label:v.label,key:"rop"+g},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.val,"onUpdate:modelValue":f[3]||(f[3]=v=>vue.unref(o).Relation.val=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(o).type==="Relation"&&(((d=vue.unref(o).Relation)==null?void 0:d.relation)===">=,=<"||((h=vue.unref(o).Relation)==null?void 0:h.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(o).Relation.val2,"onUpdate:modelValue":f[4]||(f[4]=v=>vue.unref(o).Relation.val2=v)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(r,{emit:n}){const i=r,o=useGlobalStore(pinia),a=vue.computed({get(){return i.modelValue!==null},set(v){let g=null;v&&(g={target_id:"",type:""}),n("update:modelValue",g)}}),u=vue.computed({get(){var v;return((v=i.modelValue)==null?void 0:v.target_id)??void 0},set(v){let g=null;a.value&&(g={target_id:v,type:c.value}),n("update:modelValue",g)}}),c=vue.computed({get(){var v;return((v=i.modelValue)==null?void 0:v.type)??void 0},set(v){let g=null;a.value&&(g={target_id:u.value,type:v}),n("update:modelValue",g)}}),f=vue.computed(()=>o.done_json.filter(v=>v.type!==EDoneJsonType.ConnectionLine).map(v=>({label:v.title,value:v.id}))),d=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function h(){vue.nextTick(function(){var v,g;if(a.value&&((v=i.modelValue)!=null&&v.target_id)&&((g=i.modelValue)!=null&&g.type)&&o.handle_svg_info){let p=null;for(let y of o.done_json)y.id===i.modelValue.target_id&&(p=y);p&&(setSvgActualInfo(p),moveAnchors(p))}})}return(v,g)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:i.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(a),"onUpdate:modelValue":g[0]||(g[0]=p=>vue.isRef(a)?a.value=p:null),onChange:h},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(a)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(u),"onUpdate:modelValue":g[1]||(g[1]=p=>vue.isRef(u)?u.value=p:null),onChange:h},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),p=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(c),"onUpdate:modelValue":g[2]||(g[2]=p=>vue.isRef(c)?c.value=p:null),onChange:h},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(d,p=>vue.createVNode(vue.unref(elementPlus.ElOption),{key:p.value,label:p.label,value:p.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=r=>(vue.pushScopeId("data-v-9b4c5da1"),r=r(),vue.popScopeId(),r),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={key:2},_hoisted_3$2={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(r){const n=useConfigStore(pinia),i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=vue.ref("page"),u=vue.ref("style"),c=(_,b)=>{_!=null&&_.common_animations&&(_.common_animations.val=b)};n.$subscribe((_,b)=>{_.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(b))});const f=vue.ref(numberArray(20)),d=vue.ref(["MQTT"]),h=vue.ref();h.value=()=>{var b,A;let _={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(A=(b=i.handle_svg_info)==null?void 0:b.info)==null||A.events.push(_)};const v=(_,b)=>{_==="ChangeAttr"?b.attrs=[{key:"",val:""}]:delete b.attrs},g=_=>{var b,A;(A=(b=i.handle_svg_info)==null?void 0:b.info)==null||A.events.splice(_,1)},p=()=>{o.center_offset={x:0,y:0}},y=(_,b,A)=>{vue.nextTick(function(){if(i.handle_svg_info){const w=i.done_json[i.handle_svg_info.index];A?setSvgActualInfo(w,A):setSvgActualInfo(w),moveAnchors(w)}})};return(_,b)=>vue.unref(i).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(a),"onUpdate:modelValue":b[13]||(b[13]=A=>vue.isRef(a)?a.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":b[0]||(b[0]=A=>vue.unref(n).svg.background_color=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",onClick:p,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.x,"onUpdate:modelValue":b[1]||(b[1]=A=>vue.unref(o).center_offset.x=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.y,"onUpdate:modelValue":b[2]||(b[2]=A=>vue.unref(o).center_offset.y=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":b[3]||(b[3]=A=>vue.unref(n).svg.scale=A),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":b[4]||(b[4]=A=>vue.unref(n).svg.ruler=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":b[5]||(b[5]=A=>vue.unref(n).svg.grid=A)},null,8,["modelValue"])]),_:1}),vue.unref(n).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(n).svg.grid_color,"onUpdate:modelValue":b[6]||(b[6]=A=>vue.unref(n).svg.grid_color=A)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:vue.unref(n).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).connection_line.animations.type.val,"onUpdate:modelValue":b[7]||(b[7]=A=>vue.unref(n).connection_line.animations.type.val=A),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).connection_line.animations.type.options,A=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(n).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(n).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(d),"onUpdate:modelValue":b[12]||(b[12]=A=>vue.isRef(d)?d.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":b[8]||(b[8]=A=>vue.unref(n).net.mqtt.url=A),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":b[9]||(b[9]=A=>vue.unref(n).net.mqtt.user=A),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":b[10]||(b[10]=A=>vue.unref(n).net.mqtt.pwd=A),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":b[11]||(b[11]=A=>vue.unref(n).net.mqtt.topics=A),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$t)]),_:1})]),_:1},8,["modelValue"])):vue.unref(i).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(i).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:vue.unref(u),"onUpdate:modelValue":b[34]||(b[34]=A=>vue.isRef(u)?u.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,T,S;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.title,"onUpdate:modelValue":b[14]||(b[14]=x=>vue.unref(i).handle_svg_info.info.title=x)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.x,"onUpdate:modelValue":b[15]||(b[15]=x=>vue.unref(i).handle_svg_info.info.x=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.y,"onUpdate:modelValue":b[16]||(b[16]=x=>vue.unref(i).handle_svg_info.info.y=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.scale_x,"onUpdate:modelValue":b[17]||(b[17]=x=>vue.unref(i).handle_svg_info.info.scale_x=x),onChange:y},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(w=(A=vue.unref(i).handle_svg_info)==null?void 0:A.info)==null?void 0:w.config.can_zoom]]),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.scale_y,"onUpdate:modelValue":b[18]||(b[18]=x=>vue.unref(i).handle_svg_info.info.scale_y=x),onChange:y},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(S=(T=vue.unref(i).handle_svg_info)==null?void 0:T.info)==null?void 0:S.config.can_zoom]]),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(i).handle_svg_info.info.rotate,"onUpdate:modelValue":b[19]||(b[19]=x=>vue.unref(i).handle_svg_info.info.rotate=x),onChange:y},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(i).handle_svg_info.info.display,"onUpdate:modelValue":b[20]||(b[20]=x=>vue.unref(i).handle_svg_info.info.display=x)},null,8,["modelValue"])]),_:1})]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,T,S,x,O,L,M;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.id,"onUpdate:modelValue":b[21]||(b[21]=re=>vue.unref(i).handle_svg_info.info.id=re)},null,8,["modelValue"])]),_:1}),(w=(A=vue.unref(i).handle_svg_info)==null?void 0:A.info)!=null&&w.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(i).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(S=(T=vue.unref(i).handle_svg_info)==null?void 0:T.info)!=null&&S.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.defaultState,"onUpdate:modelValue":b[22]||(b[22]=re=>vue.unref(i).handle_svg_info.info.defaultState=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.state,(re,F)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:"state"+String(F),label:re.label,value:F},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(x=vue.unref(i).handle_svg_info.info)!=null&&x.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$2,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(i).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(i).handle_svg_info.info.tag_slot,"onUpdate:modelValue":b[23]||(b[23]=re=>vue.unref(i).handle_svg_info.info.tag_slot=re),onInput:b[24]||(b[24]=re=>y(re,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(i).handle_svg_info.info.props,code:"",onChange:b[25]||(b[25]=re=>y(re,null,!0))},null,8,["obj-info"]),vue.unref(i).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:vue.unref(i).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":b[26]||(b[26]=re=>vue.unref(i).handle_svg_info.info.animations.type.val=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.animations.type.options,re=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:re.value,label:re.label,value:re.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((O=vue.unref(i).handle_svg_info.info.animations)==null?void 0:O.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(i).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((L=vue.unref(i).handle_svg_info)==null?void 0:L.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(i).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":b[27]||(b[27]=re=>vue.unref(i).handle_svg_info.info.bind_anchors.start=re),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((M=vue.unref(i).handle_svg_info)==null?void 0:M.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(i).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":b[28]||(b[28]=re=>vue.unref(i).handle_svg_info.info.bind_anchors.end=re),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(h)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(f),"onUpdate:modelValue":b[29]||(b[29]=A=>vue.isRef(f)?f.value=A:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(i).handle_svg_info.info.events,(A,w)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:w,key:"event"+w},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(w+1),1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(T=>g(w),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$D,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.type,"onUpdate:modelValue":T=>A.type=T},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.action,"onUpdate:modelValue":T=>A.action=T,onChange:T=>v(T,A)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:A.target,"onUpdate:modelValue":T=>A.target=T,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:A.attrs,"onUpdate:modelValue":T=>A.attrs=T},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),A.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$w,{modelValue:A.scripts,"onUpdate:modelValue":T=>A.scripts=T,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:A.condition,"onUpdate:modelValue":T=>A.condition=T},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var A;return[(A=vue.unref(i).handle_svg_info)!=null&&A.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(i).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(i).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:b[30]||(b[30]=w=>{var T;return c((T=vue.unref(i).handle_svg_info)==null?void 0:T.info,w)}),val:vue.unref(i).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":b[31]||(b[31]=w=>vue.unref(i).handle_svg_info.info.common_animations.delay=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":b[32]||(b[32]=w=>vue.unref(i).handle_svg_info.info.common_animations.speed=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(i).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":b[33]||(b[33]=w=>vue.unref(i).handle_svg_info.info.common_animations.repeat=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$t)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_9b4c5da1_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc$1(_sfc_main$5,[["__scopeId","data-v-9b4c5da1"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(r){const n=vue.ref(""),i=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return vue.onMounted(()=>{const u={layout_center:o.center_offset,config:a.$state,done_json:i.done_json};n.value=JSON.stringify(u,null,2)}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":c[0]||(c[0]=f=>vue.isRef(n)?n.value=f:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"import-json",setup(r,{expose:n}){const i=vue.ref("");return n({setVal:u=>{i.value=u},onImportJson:()=>{useImportDataModel(i.value)&&elementPlus.ElMessage.success("导入成功")}}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(i),"onUpdate:value":c[0]||(c[0]=f=>vue.isRef(i)?i.value=f:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["onMousedown"],_hoisted_2$1=["onMousedown"],_hoisted_3$1=["title","onMousedown"],_hoisted_4$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(r,{emit:n}){const i=r,o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia),u=function(){return function($e,Ce,ue){$e&&Ce&&ue&&$e.addEventListener(Ce,ue,!1)}}(),c=function(){return function($e,Ce,ue){$e&&Ce&&$e.removeEventListener(Ce,ue,!1)}}();let f=18,d=vue.ref(0),h=vue.ref(0),v=vue.ref([]),g=vue.ref([]);const p=vue.ref([]);let y=vue.ref(!1),_="",b=vue.ref(-999),A=vue.ref(-999),w=18,T=18,S="";const x=vue.ref(null),O=vue.ref(null),L=vue.ref(null),M=vue.ref(null),re=vue.computed(()=>({width:d.value+"px",height:h.value+"px"})),F=vue.computed(()=>({padding:f+"px 0px 0px "+f+"px"})),j=vue.computed(()=>{let $e=0,Ce=0;return p.value.map(ue=>{const At=ue.type==="h";return{id:`${ue.type}_${At?$e++:Ce++}`,type:ue.type,title:ue.site.toFixed(0)+"px",[At?"top":"left"]:ue.site*a.svg.scale+f+o.center_offset[At?"y":"x"]*a.svg.scale}})});o.$subscribe($e=>{var Ce,ue,At,Ne;((ue=(Ce=$e.events)==null?void 0:Ce.target)!=null&&ue.hasOwnProperty("left_nav")||(Ne=(At=$e.events)==null?void 0:At.target)!=null&&Ne.hasOwnProperty("right_nav"))&&window.setTimeout(V,420)}),a.$subscribe($e=>{var Ce,ue;(ue=(Ce=$e.events)==null?void 0:Ce.target)!=null&&ue.hasOwnProperty("scale")&&Ie()}),vue.onMounted(()=>{u(document,"mousemove",pe),u(document,"mouseup",Et),V(),u(window,"resize",z)}),vue.onBeforeUnmount(()=>{c(document,"mousemove",pe),c(document,"mouseup",Et),c(window,"resize",z)});const V=()=>{le(),Ie()},z=()=>{v.value=[],g.value=[],V()},$=({type:$e,top:Ce,left:ue})=>$e==="h"?{top:Ce+"px"}:{left:ue+"px"},he=({type:$e,id:Ce})=>$e==="h"?qe(Ce):Pt(Ce),le=()=>{const $e=window.getComputedStyle(O.value.parentNode,null);d.value=parseInt($e.getPropertyValue("width")),h.value=parseInt($e.getPropertyValue("height")),w=L.value.clientWidth,T=M.value.clientHeight},Ie=()=>{Fe(v.value,d.value,o.center_offset.x),Fe(g.value,h.value,o.center_offset.y)},Fe=($e,Ce,ue)=>{if($e.length===0)for(let At=0;At<Ce;At+=i.stepLength)At%i.stepLength===0&&$e.push({id:Number((At/a.svg.scale-ue).toFixed(0))});else $e.forEach((At,Ne)=>{At.id=Number((Ne*i.stepLength/a.svg.scale-ue).toFixed(0))})},pe=$e=>{Ie(),Lt($e)},Lt=$e=>{if(!($e.layerX===$e.x||$e.layerY===$e.y))switch(_){case"x":y.value&&(A.value=$e.layerY);break;case"y":y.value&&(b.value=$e.layerX);break;case"h":y.value&&(A.value=$e.layerY);break;case"v":y.value&&(b.value=$e.layerX);break}},_e=$e=>{y.value=!0,_=$e},Et=$e=>{Cn($e)},Cn=$e=>{if(y.value){switch(y.value=!1,_){case"x":const Ce=Math.round(($e.layerY-f)/a.svg.scale-o.center_offset.y);if(Ce<=0){A.value=-999;return}p.value.push({type:"h",site:Ce});break;case"y":const ue=Math.round(($e.layerX-f)/a.svg.scale-o.center_offset.x);if(ue<=0){b.value=-999;return}p.value.push({type:"v",site:ue});break;case"h":vn(p.value,Math.round(($e.layerY-f)/a.svg.scale-o.center_offset.y),Math.round(T/a.svg.scale-o.center_offset.y),"h");break;case"v":vn(p.value,Math.round(($e.layerX-f)/a.svg.scale-o.center_offset.x),Math.round(w/a.svg.scale-o.center_offset.x),"v");break}A.value=b.value=-999}},vn=($e,Ce,ue,At)=>{if(Ce<ue){let Ne;j.value.forEach((Oe,kt)=>{Oe.id===S&&(Ne=kt)}),$e.splice(Ne,1)}else{let Ne;j.value.forEach((Oe,kt)=>{Oe.id===S&&(Ne=kt)}),$e.splice(Ne,1,{type:At,site:Ce})}},Dt=()=>{_e("x")},de=()=>{_e("y")},qe=$e=>{y.value=!0,_="h",S=$e},Pt=$e=>{y.value=!0,_="v",S=$e},In=()=>{n("onLineMouseUp")};return($e,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref(re)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:O},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:M,class:"vue-ruler-h",onMousedown:vue.withModifiers(Dt,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(v),(ue,At)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:At*$e.stepLength+"px"}),class:"n"},vue.toDisplayString(ue.id),5))),256))],40,_hoisted_1$2),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:L,class:"vue-ruler-v",onMousedown:vue.withModifiers(de,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(ue,At)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:At*$e.stepLength+"px"}),class:"n"},vue.toDisplayString(ue.id),5))),256))],40,_hoisted_2$1),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(A)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(A)-vue.unref(T))/vue.unref(a).svg.scale)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(b)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(b)-vue.unref(w))/vue.unref(a).svg.scale)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(j),ue=>(vue.openBlock(),vue.createElementBlock("div",{title:ue.title,style:vue.normalizeStyle($(ue)),key:ue.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ue.type}`),onMousedown:At=>he(ue),onMouseup:In,onContextmenu:Ce[0]||(Ce[0]=(...At)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...At))},null,46,_hoisted_3$1))),128))],512),[[vue.vShow,i.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:x,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(F))},[vue.renderSlot($e.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$1,null,512),[[vue.vShow,vue.unref(y)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(r,n=new Date(Date.now()).toLocaleString()){const i=JSON.stringify(r),o=new Blob([i]);let a=document.createElement("a");a.download=n+".json",a.style.display="none",a.href=URL.createObjectURL(o),document.body.appendChild(a),a.click(),document.body.removeChild(a)}function fileRead(r){return new Promise((n,i)=>{let o=new FileReader;o.readAsText(r,"UTF-8"),o.onload=function(a){a&&a.target?n(a.target.result):i("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},vueComp:{},data:{},saveFile:{type:Boolean,default:!1}},emits:["onReturn","onPreview","onSave"],setup(r,{expose:n,emit:i}){const o=r;setEditorLoadTime();const a=useGlobalStore(pinia),u=useSvgEditLayoutStore(pinia),c=useConfigStore(pinia),f=useEditPrivateStore(pinia),d=vue.ref(),h=vue.ref(),v=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),g=(S,x)=>{v[S]=x},p=vue.ref();p.value=()=>{h.value.onImportJson(),g(EVisibleConfKey.ImportJson,!1)};const y=S=>["text/plain","application/json"].indexOf(S.type)<0?(elementPlus.ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(S).then(x=>{h.value.setVal(x),elementPlus.ElMessage.success("文件读取成功!")}),!1),_=S=>{a.setDoneJson(S)};vue.onMounted(()=>{f.history_doneComponent=[],f.history_now_index=0,o.data?useImportDataModel(o.data):a.setDoneJson([]),a.intention=EGlobalStoreIntention.None});const{appContext:b}=vue.getCurrentInstance();function A(S){i("onReturn",{data:S,isChange:f.getTopBtnUndoStatus})}function w(S){o.saveFile?elementPlus.ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},b).then(x=>{fileWrite(S,x.value.trim()),i("onSave",S)}).catch(x=>{console.log(x)}):i("onSave",S)}function T(){d.value.onCanvasMouseUp()}return n({setGraphNodeJson:_}),(S,x)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:g,onOnReturn:A,onOnPreview:x[0]||(x[0]=O=>i("onPreview",O)),onOnSave:w})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(u).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":o.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref(c).svg.ruler,onOnLineMouseUp:T},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:d,vueComp:o.vueComp},{background:vue.withCtx(()=>[vue.renderSlot(S.$slots,"background",{},void 0,!0)]),_:3},8,["vueComp"])]),_:3},8,["visible"])])]),_:3}),vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(u).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:3})]),_:3}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(v).ImportJson,"onUpdate:modelValue":x[2]||(x[2]=O=>vue.unref(v).ImportJson=O),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElUpload),{beforeUpload:y,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:x[1]||(x[1]=O=>g(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:vue.unref(p)},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:h},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(v).ExportJson,"onUpdate:modelValue":x[3]||(x[3]=O=>vue.unref(v).ExportJson=O),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_ed6b1a90_lang="",index=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-ed6b1a90"]]);function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(r,n){(function(i){r.exports=i()})(function(){return function(){function i(o,a,u){function c(h,v){if(!a[h]){if(!o[h]){var g=typeof commonjsRequire=="function"&&commonjsRequire;if(!v&&g)return g(h,!0);if(f)return f(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var y=a[h]={exports:{}};o[h][0].call(y.exports,function(_){var b=o[h][1][_];return c(b||_)},y,y.exports,i,o,a,u)}return a[h].exports}for(var f=typeof commonjsRequire=="function"&&commonjsRequire,d=0;d<u.length;d++)c(u[d]);return c}return i}()({1:[function(i,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0}),a.TypedEventEmitter=void 0;const c=u(i("events")),f=i("./shared");class d{}a.TypedEventEmitter=d,(0,f.applyMixin)(d,c.default)},{"./shared":17,events:49}],2:[function(i,o,a){(function(u,c){(function(){var f=this&&this.__createBinding||(Object.create?function(V,z,$,he){he===void 0&&(he=$);var le=Object.getOwnPropertyDescriptor(z,$);(!le||("get"in le?!z.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return z[$]}}),Object.defineProperty(V,he,le)}:function(V,z,$,he){he===void 0&&(he=$),V[he]=z[$]}),d=this&&this.__setModuleDefault||(Object.create?function(V,z){Object.defineProperty(V,"default",{enumerable:!0,value:z})}:function(V,z){V.default=z}),h=this&&this.__importStar||function(V){if(V&&V.__esModule)return V;var z={};if(V!=null)for(var $ in V)$!=="default"&&Object.prototype.hasOwnProperty.call(V,$)&&f(z,V,$);return d(z,V),z},v=this&&this.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(a,"__esModule",{value:!0});const g=v(i("./topic-alias-recv")),p=v(i("mqtt-packet")),y=v(i("./default-message-id-provider")),_=i("readable-stream"),b=v(i("reinterval")),A=v(i("rfdc/default")),w=h(i("./validations")),T=v(i("debug")),S=v(i("./store")),x=v(i("./handlers")),O=i("./TypedEmitter"),L=u?u.nextTick:V=>{setTimeout(V,0)},M=c.setImmediate||((...V)=>{const z=V.shift();L(()=>{z(...V)})}),re={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},F=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class j extends O.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(z,$){super(),this.options=$||{};for(const he in re)typeof this.options[he]>"u"?this.options[he]=re[he]:this.options[he]=$[he];this.log=this.options.log||(0,T.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",$.protocol),this.log("MqttClient :: options.protocolVersion",$.protocolVersion),this.log("MqttClient :: options.username",$.username),this.log("MqttClient :: options.keepalive",$.keepalive),this.log("MqttClient :: options.reconnectPeriod",$.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",$.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",$.properties?$.properties.topicAliasMaximum:void 0),this.options.clientId=typeof $.clientId=="string"?$.clientId:j.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=$.protocolVersion===5&&$.customHandleAcks?$.customHandleAcks:(...he)=>{he[3](null,0)},this.options.writeCache||(p.default.writeToStream.cacheNumbers=!1),this.streamBuilder=z,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new y.default:this.options.messageIdProvider,this.outgoingStore=$.outgoingStore||new S.default,this.incomingStore=$.incomingStore||new S.default,this.queueQoSZero=$.queueQoSZero===void 0?!0:$.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,$.properties&&$.properties.topicAliasMaximum>0&&($.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default($.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:he}=this,le=()=>{const Ie=he.shift();this.log("deliver :: entry %o",Ie);let Fe=null;if(!Ie){this._resubscribe();return}Fe=Ie.packet,this.log("deliver :: call _sendPacket for %o",Fe);let pe=!0;Fe.messageId&&Fe.messageId!==0&&(this.messageIdProvider.register(Fe.messageId)||(pe=!1)),pe?this._sendPacket(Fe,Lt=>{Ie.cb&&Ie.cb(Lt),le()}):(this.log("messageId: %d has already used. The message is skipped and removed.",Fe.messageId),le())};this.log("connect :: sending queued packets"),le()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(z,$){$()}handleMessage(z,$){$()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var z;const $=new _.Writable,he=p.default.parser(this.options);let le=null;const Ie=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),he.on("packet",Et=>{this.log("parser :: on packet push to packets array."),Ie.push(Et)});const Fe=()=>{this.log("work :: getting next packet in queue");const Et=Ie.shift();if(Et)this.log("work :: packet pulled from queue"),(0,x.default)(this,Et,pe);else{this.log("work :: no packets in queue");const Cn=le;le=null,this.log("work :: done flag is %s",!!Cn),Cn&&Cn()}},pe=()=>{if(Ie.length)L(Fe);else{const Et=le;le=null,Et()}};$._write=(Et,Cn,vn)=>{le=vn,this.log("writable stream :: parsing buffer"),he.parse(Et),Fe()};const Lt=Et=>{this.log("streamErrorHandler :: error",Et.message),F.includes(Et.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",Et)):this.noop(Et)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe($),this.stream.on("error",Lt),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const _e={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(_e.will=Object.assign(Object.assign({},this.options.will),{payload:(z=this.options.will)===null||z===void 0?void 0:z.payload})),this.topicAliasRecv&&(_e.properties||(_e.properties={}),this.topicAliasRecv&&(_e.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(_e),he.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const Et=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(Et)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(z,$,he,le){this.log("publish :: message `%s` to topic `%s`",$,z);const{options:Ie}=this;typeof he=="function"&&(le=he,he=null),he=he||{},he=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),he);const{qos:pe,retain:Lt,dup:_e,properties:Et,cbStorePut:Cn}=he;if(this._checkDisconnecting(le))return this;const vn=()=>{let Dt=0;if((pe===1||pe===2)&&(Dt=this._nextId(),Dt===null))return this.log("No messageId left"),!1;const de={cmd:"publish",topic:z,payload:$,qos:pe,retain:Lt,messageId:Dt,dup:_e};switch(Ie.protocolVersion===5&&(de.properties=Et),this.log("publish :: qos",pe),pe){case 1:case 2:this.outgoing[de.messageId]={volatile:!1,cb:le||this.noop},this.log("MqttClient:publish: packet cmd: %s",de.cmd),this._sendPacket(de,void 0,Cn);break;default:this.log("MqttClient:publish: packet cmd: %s",de.cmd),this._sendPacket(de,le,Cn);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,cbStorePut:he.cbStorePut,callback:le}),this}publishAsync(z,$,he){return new Promise((le,Ie)=>{this.publish(z,$,he,(Fe,pe)=>{Fe?Ie(Fe):le(pe)})})}subscribe(z,$,he){const le=this.options.protocolVersion;typeof $=="function"&&(he=$),he=he||this.noop;let Ie=!1,Fe=[];typeof z=="string"?(z=[z],Fe=z):Array.isArray(z)?Fe=z:typeof z=="object"&&(Ie=z.resubscribe,delete z.resubscribe,Fe=Object.keys(z));const pe=w.validateTopics(Fe);if(pe!==null)return M(he,new Error(`Invalid topic ${pe}`)),this;if(this._checkDisconnecting(he))return this.log("subscribe: discconecting true"),this;const Lt={qos:0};le===5&&(Lt.nl=!1,Lt.rap=!1,Lt.rh=0),$=Object.assign(Object.assign({},Lt),$);const _e=$.properties,Et=[],Cn=(Dt,de)=>{if(de=de||$,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,Dt)||this._resubscribeTopics[Dt].qos<de.qos||Ie){const qe={topic:Dt,qos:de.qos};le===5&&(qe.nl=de.nl,qe.rap=de.rap,qe.rh=de.rh,qe.properties=_e),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",qe.topic,qe.qos),Et.push(qe)}};if(Array.isArray(z)?z.forEach(Dt=>{this.log("subscribe: array topic %s",Dt),Cn(Dt)}):Object.keys(z).forEach(Dt=>{this.log("subscribe: object topic %s, %o",Dt,z[Dt]),Cn(Dt,z[Dt])}),!Et.length)return he(null,[]),this;const vn=()=>{const Dt=this._nextId();if(Dt===null)return this.log("No messageId left"),!1;const de={cmd:"subscribe",subscriptions:Et,messageId:Dt};if(_e&&(de.properties=_e),this.options.resubscribe){this.log("subscribe :: resubscribe true");const qe=[];Et.forEach(Pt=>{if(this.options.reconnectPeriod>0){const In={qos:Pt.qos};le===5&&(In.nl=Pt.nl||!1,In.rap=Pt.rap||!1,In.rh=Pt.rh||0,In.properties=Pt.properties),this._resubscribeTopics[Pt.topic]=In,qe.push(Pt.topic)}}),this.messageIdToTopic[de.messageId]=qe}return this.outgoing[de.messageId]={volatile:!0,cb(qe,Pt){if(!qe){const{granted:In}=Pt;for(let $e=0;$e<In.length;$e+=1)Et[$e].qos=In[$e]}he(qe,Et)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(de),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,callback:he}),this}subscribeAsync(z,$){return new Promise((he,le)=>{this.subscribe(z,$,(Ie,Fe)=>{Ie?le(Ie):he(Fe)})})}unsubscribe(z,$,he){typeof z=="string"&&(z=[z]),typeof $=="function"&&(he=$),he=he||this.noop;const le=w.validateTopics(z);if(le!==null)return M(he,new Error(`Invalid topic ${le}`)),this;if(this._checkDisconnecting(he))return this;const Ie=()=>{const Fe=this._nextId();if(Fe===null)return this.log("No messageId left"),!1;const pe={cmd:"unsubscribe",messageId:Fe,unsubscriptions:[]};return typeof z=="string"?pe.unsubscriptions=[z]:Array.isArray(z)&&(pe.unsubscriptions=z),this.options.resubscribe&&pe.unsubscriptions.forEach(Lt=>{delete this._resubscribeTopics[Lt]}),typeof $=="object"&&$.properties&&(pe.properties=$.properties),this.outgoing[pe.messageId]={volatile:!0,cb:he},this.log("unsubscribe: call _sendPacket"),this._sendPacket(pe),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ie())&&this._storeProcessingQueue.push({invoke:Ie,callback:he}),this}unsubscribeAsync(z,$){return new Promise((he,le)=>{this.unsubscribe(z,$,(Ie,Fe)=>{Ie?le(Ie):he(Fe)})})}end(z,$,he){this.log("end :: (%s)",this.options.clientId),(z==null||typeof z!="boolean")&&(he=he||$,$=z,z=!1),typeof $!="object"&&(he=he||$,$=null),this.log("end :: cb? %s",!!he),(!he||typeof he!="function")&&(he=this.noop);const le=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(Fe=>{this.outgoingStore.close(pe=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),he){const Lt=Fe||pe;this.log("end :: closeStores: invoking callback with args"),he(Lt)}})}),this._deferredReconnect&&this._deferredReconnect()},Ie=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,z),this._cleanUp(z,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),L(le)},$)};return this.disconnecting?(he(),this):(this._clearReconnect(),this.disconnecting=!0,!z&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,Ie,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),Ie()),this)}endAsync(z,$){return new Promise((he,le)=>{this.end(z,$,Ie=>{Ie?le(Ie):he()})})}removeOutgoingMessage(z){if(this.outgoing[z]){const{cb:$}=this.outgoing[z];this._removeOutgoingAndStoreMessage(z,()=>{$(new Error("Message removed"))})}return this}reconnect(z){this.log("client reconnect");const $=()=>{z?(this.options.incomingStore=z.incomingStore,this.options.outgoingStore=z.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new S.default,this.outgoingStore=this.options.outgoingStore||new S.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=$:$(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(z=>{this.outgoing[z].volatile&&typeof this.outgoing[z].cb=="function"&&(this.outgoing[z].cb(new Error("Connection closed")),delete this.outgoing[z])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(z=>{typeof this.outgoing[z].cb=="function"&&(this.outgoing[z].cb(new Error("Connection closed")),delete this.outgoing[z])}))}_removeTopicAliasAndRecoverTopicName(z){let $;z.properties&&($=z.properties.topicAlias);let he=z.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",$,he),he.length===0){if(typeof $>"u")return new Error("Unregistered Topic Alias");if(he=this.topicAliasSend.getTopicByAlias($),typeof he>"u")return new Error("Unregistered Topic Alias");z.topic=he}$&&delete z.properties.topicAlias}_checkDisconnecting(z){return this.disconnecting&&(z&&z!==this.noop?z(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(z,$,he={}){if($&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",$)),this.log("_cleanUp :: forced? %s",z),z)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const le=Object.assign({cmd:"disconnect"},he);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(le,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),M(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),$&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",$),$())}_storeAndSend(z,$,he){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",z.cmd);let le=z,Ie;if(le.cmd==="publish"&&(le=(0,A.default)(z),Ie=this._removeTopicAliasAndRecoverTopicName(le),Ie))return $&&$(Ie);this.outgoingStore.put(le,Fe=>{if(Fe)return $&&$(Fe);he(),this._writePacket(z,$)})}_applyTopicAlias(z){if(this.options.protocolVersion===5&&z.cmd==="publish"){let $;z.properties&&($=z.properties.topicAlias);const he=z.topic.toString();if(this.topicAliasSend)if($){if(he.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",he,$),!this.topicAliasSend.put(he,$)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",he,$),new Error("Sending Topic Alias out of range")}else he.length!==0&&(this.options.autoAssignTopicAlias?($=this.topicAliasSend.getAliasByTopic(he),$?(z.topic="",z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",he,$)):($=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(he,$),z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",he,$))):this.options.autoUseTopicAlias&&($=this.topicAliasSend.getAliasByTopic(he),$&&(z.topic="",z.properties=Object.assign(Object.assign({},z.properties),{topicAlias:$}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",he,$))));else if($)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",he,$),new Error("Sending Topic Alias out of range")}}_noop(z){this.log("noop ::",z)}_writePacket(z,$){this.log("_writePacket :: packet: %O",z),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",z),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const he=p.default.writeToStream(z,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",he),!he&&$&&$!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",$)):$&&(this.log("_writePacket :: invoking cb"),$())}_sendPacket(z,$,he,le){this.log("_sendPacket :: (%s) :: start",this.options.clientId),he=he||this.noop,$=$||this.noop;const Ie=this._applyTopicAlias(z);if(Ie){$(Ie);return}if(!this.connected){if(z.cmd==="auth"){this._writePacket(z,$);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(z,$,he);return}if(le){this._writePacket(z,$);return}switch(z.cmd){case"publish":break;case"pubrel":this._storeAndSend(z,$,he);return;default:this._writePacket(z,$);return}switch(z.qos){case 2:case 1:this._storeAndSend(z,$,he);break;case 0:default:this._writePacket(z,$);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(z,$,he){this.log("_storePacket :: packet: %o",z),this.log("_storePacket :: cb? %s",!!$),he=he||this.noop;let le=z;if(le.cmd==="publish"){le=(0,A.default)(z);const Fe=this._removeTopicAliasAndRecoverTopicName(le);if(Fe)return $&&$(Fe)}const Ie=le.qos||0;Ie===0&&this.queueQoSZero||le.cmd!=="publish"?this.queue.push({packet:le,cb:$}):Ie>0?($=this.outgoing[le.messageId]?this.outgoing[le.messageId].cb:null,this.outgoingStore.put(le,Fe=>{if(Fe)return $&&$(Fe);he()})):$&&$(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,b.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const z=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&z.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let $=0;$<z.length;$++){const he={};he[z[$]]=this._resubscribeTopics[z[$]],he.resubscribe=!0,this.subscribe(he,{properties:he[z[$]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(z){if(this.disconnected){this.emit("connect",z);return}this.connackPacket=z,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const $=()=>{let he=this.outgoingStore.createStream();const le=()=>{he.destroy(),he=null,this._flushStoreProcessingQueue(),Ie()},Ie=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",le),he.on("error",pe=>{Ie(),this._flushStoreProcessingQueue(),this.removeListener("close",le),this.emit("error",pe)});const Fe=()=>{if(!he)return;const pe=he.read(1);let Lt;if(!pe){he.once("readable",Fe);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[pe.messageId]){Fe();return}!this.disconnecting&&!this.reconnectTimer?(Lt=this.outgoing[pe.messageId]?this.outgoing[pe.messageId].cb:null,this.outgoing[pe.messageId]={volatile:!1,cb(_e,Et){Lt&&Lt(_e,Et),Fe()}},this._packetIdsDuringStoreProcessing[pe.messageId]=!0,this.messageIdProvider.register(pe.messageId)?this._sendPacket(pe,void 0,void 0,!0):this.log("messageId: %d has already used.",pe.messageId)):he.destroy&&he.destroy()};he.on("end",()=>{let pe=!0;for(const Lt in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[Lt]){pe=!1;break}pe?(Ie(),this.removeListener("close",le),this._invokeAllStoreProcessingQueue(),this.emit("connect",z)):$()}),Fe()};$()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const z=this._storeProcessingQueue[0];if(z&&z.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const z of this._storeProcessingQueue)z.cbStorePut&&z.cbStorePut(new Error("Connection closed")),z.callback&&z.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(z,$){delete this.outgoing[z],this.outgoingStore.del({messageId:z},(he,le)=>{$(he,le),this.messageIdProvider.deallocate(z),this._invokeStoreProcessingQueue()})}}a.default=j}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(i,o,a){var u=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=i("readable-stream"),d=u(i("duplexify"));let h,v,g,p=!1;function y(){const T=new f.Transform;return T._write=(S,x,O)=>{h.sendSocketMessage({data:S.buffer,success(){O()},fail(){O(new Error)}})},T._flush=S=>{h.closeSocket({success(){S()}})},T}function _(T){T.hostname||(T.hostname="localhost"),T.path||(T.path="/"),T.wsOptions||(T.wsOptions={})}function b(T,S){const x=T.protocol==="alis"?"wss":"ws";let O=`${x}://${T.hostname}${T.path}`;return T.port&&T.port!==80&&T.port!==443&&(O=`${x}://${T.hostname}:${T.port}${T.path}`),typeof T.transformWsUrl=="function"&&(O=T.transformWsUrl(O,T,S)),O}function A(){p||(p=!0,h.onSocketOpen(()=>{g.setReadable(v),g.setWritable(v),g.emit("connect")}),h.onSocketMessage(T=>{if(typeof T.data=="string"){const S=c.Buffer.from(T.data,"base64");v.push(S)}else{const S=new FileReader;S.addEventListener("load",()=>{let x=S.result;x instanceof ArrayBuffer?x=c.Buffer.from(x):x=c.Buffer.from(x,"utf8"),v.push(x)}),S.readAsArrayBuffer(T.data)}}),h.onSocketClose(()=>{g.end(),g.destroy()}),h.onSocketError(T=>{g.destroy(T)}))}const w=(T,S)=>{if(S.hostname=S.hostname||S.host,!S.hostname)throw new Error("Could not determine host. Specify host manually.");const x=S.protocolId==="MQIsdp"&&S.protocolVersion===3?"mqttv3.1":"mqtt";_(S);const O=b(S,T);return h=S.my,h.connectSocket({url:O,protocols:x}),v=y(),g=d.default.obj(),A(),g};a.default=w},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(i,o,a){var u=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(a,"__esModule",{value:!0}),a.connectAsync=void 0;const c=u(i("debug")),f=u(i("url")),d=u(i("../client")),h=u(i("../is-browser")),v=(0,c.default)("mqttjs"),g={};h.default?(g.wx=i("./wx").default,g.wxs=i("./wx").default,g.ali=i("./ali").default,g.alis=i("./ali").default):(g.mqtt=i("./tcp").default,g.tcp=i("./tcp").default,g.ssl=i("./tls").default,g.tls=g.ssl,g.mqtts=i("./tls").default),g.ws=i("./ws").default,g.wss=i("./ws").default;function p(b){let A;b.auth&&(A=b.auth.match(/^(.+):(.+)$/),A?(b.username=A[1],b.password=A[2]):b.username=b.auth)}function y(b,A){if(v("connecting to an MQTT broker..."),typeof b=="object"&&!A&&(A=b,b=""),A=A||{},b&&typeof b=="string"){const S=f.default.parse(b,!0);if(S.port!=null&&(S.port=Number(S.port)),A=Object.assign(Object.assign({},S),A),A.protocol===null)throw new Error("Missing protocol");A.protocol=A.protocol.replace(/:$/,"")}if(p(A),A.query&&typeof A.query.clientId=="string"&&(A.clientId=A.query.clientId),A.cert&&A.key)if(A.protocol){if(["mqtts","wss","wxs","alis"].indexOf(A.protocol)===-1)switch(A.protocol){case"mqtt":A.protocol="mqtts";break;case"ws":A.protocol="wss";break;case"wx":A.protocol="wxs";break;case"ali":A.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${A.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!g[A.protocol]){const S=["mqtts","wss"].indexOf(A.protocol)!==-1;A.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((x,O)=>S&&O%2===0?!1:typeof g[x]=="function")[0]}if(A.clean===!1&&!A.clientId)throw new Error("Missing clientId for unclean clients");A.protocol&&(A.defaultProtocol=A.protocol);function w(S){return A.servers&&((!S._reconnectCount||S._reconnectCount===A.servers.length)&&(S._reconnectCount=0),A.host=A.servers[S._reconnectCount].host,A.port=A.servers[S._reconnectCount].port,A.protocol=A.servers[S._reconnectCount].protocol?A.servers[S._reconnectCount].protocol:A.defaultProtocol,A.hostname=A.host,S._reconnectCount++),v("calling streambuilder for",A.protocol),g[A.protocol](S,A)}const T=new d.default(w,A);return T.on("error",()=>{}),T}function _(b,A,w=!0){return new Promise((T,S)=>{const x=y(b,A),O={connect:M=>{L(),T(x)},end:()=>{L(),T(x)},error:M=>{L(),x.end(),S(M)}};w===!1&&(O.close=()=>{O.error(new Error("Couldn't connect to server"))});function L(){Object.keys(O).forEach(M=>{x.off(M,O[M])})}Object.keys(O).forEach(M=>{x.on(M,O[M])})})}a.connectAsync=_,a.default=y},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(i,o,a){var u=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("net")),d=(0,u(i("debug")).default)("mqttjs:tcp"),h=(v,g)=>{g.port=g.port||1883,g.hostname=g.hostname||g.host||"localhost";const{port:p}=g,y=g.hostname;return d("port %d and host %s",p,y),c.default.createConnection(p,y)};a.default=h},{debug:30,net:26}],6:[function(i,o,a){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("tls")),f=u(i("net")),h=(0,u(i("debug")).default)("mqttjs:tls"),v=(g,p)=>{p.port=p.port||8883,p.host=p.hostname||p.host||"localhost",f.default.isIP(p.host)===0&&(p.servername=p.host),p.rejectUnauthorized=p.rejectUnauthorized!==!1,delete p.path,h("port %d host %s rejectUnauthorized %b",p.port,p.host,p.rejectUnauthorized);const y=c.default.connect(p);y.on("secureConnect",()=>{p.rejectUnauthorized&&!y.authorized?y.emit("error",new Error("TLS not authorized")):y.removeListener("error",_)});function _(b){p.rejectUnauthorized&&g.emit("error",b),y.end()}return y.on("error",_),y};a.default=v},{debug:30,net:26,tls:26}],7:[function(i,o,a){var u=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=u(i("ws")),d=u(i("debug")),h=u(i("duplexify")),v=i("readable-stream"),g=u(i("../is-browser")),p=(0,d.default)("mqttjs:ws"),y=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function _(O,L){let M=`${O.protocol}://${O.hostname}:${O.port}${O.path}`;return typeof O.transformWsUrl=="function"&&(M=O.transformWsUrl(M,O,L)),M}function b(O){const L=O;return O.hostname||(L.hostname="localhost"),O.port||(O.protocol==="wss"?L.port=443:L.port=80),O.path||(L.path="/"),O.wsOptions||(L.wsOptions={}),!g.default&&O.protocol==="wss"&&y.forEach(M=>{Object.prototype.hasOwnProperty.call(O,M)&&!Object.prototype.hasOwnProperty.call(O.wsOptions,M)&&(L.wsOptions[M]=O[M])}),L}function A(O){const L=b(O);if(L.hostname||(L.hostname=L.host),!L.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const M=new URL(document.URL);L.hostname=M.hostname,L.port||(L.port=Number(M.port))}return L.objectMode===void 0&&(L.objectMode=!(L.binary===!0||L.binary===void 0)),L}function w(O,L,M){p("createWebSocket"),p(`protocol: ${M.protocolId} ${M.protocolVersion}`);const re=M.protocolId==="MQIsdp"&&M.protocolVersion===3?"mqttv3.1":"mqtt";p(`creating new Websocket for url: ${L} and protocol: ${re}`);let F;return M.createWebsocket?F=M.createWebsocket(L,[re],M):F=new f.default(L,[re],M.wsOptions),F}function T(O,L){const M=L.protocolId==="MQIsdp"&&L.protocolVersion===3?"mqttv3.1":"mqtt",re=_(L,O);let F;return L.createWebsocket?F=L.createWebsocket(re,[M],L):F=new WebSocket(re,[M]),F.binaryType="arraybuffer",F}const S=(O,L)=>{p("streamBuilder");const M=b(L),re=_(M,O),F=w(O,re,M),j=f.default.createWebSocketStream(F,M.wsOptions);return j.url=re,F.on("close",()=>{j.destroy()}),j},x=(O,L)=>{p("browserStreamBuilder");let M;const F=A(L).browserBufferSize||1024*512,j=L.browserBufferTimeout||1e3,V=!L.objectMode,z=T(O,L),$=le(L,Et,Cn);L.objectMode||($._writev=_e),$.on("close",()=>{z.close()});const he=typeof z.addEventListener<"u";z.readyState===z.OPEN?M=$:(M=(0,h.default)(void 0,void 0,L),L.objectMode||(M._writev=_e),he?z.addEventListener("open",Ie):z.onopen=Ie),M.socket=z,he?(z.addEventListener("close",Fe),z.addEventListener("error",pe),z.addEventListener("message",Lt)):(z.onclose=Fe,z.onerror=pe,z.onmessage=Lt);function le(vn,Dt,de){const qe=new v.Transform({objectMode:vn.objectMode});return qe._write=Dt,qe._flush=de,qe}function Ie(){M.setReadable($),M.setWritable($),M.emit("connect")}function Fe(){M.end(),M.destroy()}function pe(vn){M.destroy(vn)}function Lt(vn){let{data:Dt}=vn;Dt instanceof ArrayBuffer?Dt=c.Buffer.from(Dt):Dt=c.Buffer.from(Dt,"utf8"),$.push(Dt)}function _e(vn,Dt){const de=new Array(vn.length);for(let qe=0;qe<vn.length;qe++)typeof vn[qe].chunk=="string"?de[qe]=c.Buffer.from(vn[qe],"utf8"):de[qe]=vn[qe].chunk;this._write(c.Buffer.concat(de),"binary",Dt)}function Et(vn,Dt,de){z.bufferedAmount>F&&setTimeout(Et,j,vn,Dt,de),V&&typeof vn=="string"&&(vn=c.Buffer.from(vn,"utf8"));try{z.send(vn)}catch(qe){return de(qe)}de()}function Cn(vn){z.close(),vn()}return M};a.default=g.default?x:S},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(i,o,a){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("buffer"),f=i("readable-stream"),d=u(i("duplexify"));let h,v,g;function p(){const w=new f.Transform;return w._write=(T,S,x)=>{h.send({data:T.buffer,success(){x()},fail(O){x(new Error(O))}})},w._flush=T=>{h.close({success(){T()}})},w}function y(w){w.hostname||(w.hostname="localhost"),w.path||(w.path="/"),w.wsOptions||(w.wsOptions={})}function _(w,T){const S=w.protocol==="wxs"?"wss":"ws";let x=`${S}://${w.hostname}${w.path}`;return w.port&&w.port!==80&&w.port!==443&&(x=`${S}://${w.hostname}:${w.port}${w.path}`),typeof w.transformWsUrl=="function"&&(x=w.transformWsUrl(x,w,T)),x}function b(){h.onOpen(()=>{g.setReadable(v),g.setWritable(v),g.emit("connect")}),h.onMessage(w=>{let{data:T}=w;T instanceof ArrayBuffer?T=c.Buffer.from(T):T=c.Buffer.from(T,"utf8"),v.push(T)}),h.onClose(()=>{g.emit("close"),g.end(),g.destroy()}),h.onError(w=>{g.destroy(new Error(w.errMsg))})}const A=(w,T)=>{if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");const S=T.protocolId==="MQIsdp"&&T.protocolVersion===3?"mqttv3.1":"mqtt";y(T);const x=_(T,w);h=wx.connectSocket({url:x,protocols:[S]}),v=p(),g=d.default.obj(),g._destroy=(L,M)=>{h.close({success(){M&&M(L)}})};const O=g.destroy;return g.destroy=()=>{g.destroy=O,setTimeout(()=>{h.close({fail(){g._destroy(new Error)}})},0)},b(),g};a.default=A},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){const f=this.nextId++;return this.nextId===65536&&(this.nextId=1),f}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(f){return!0}deallocate(f){}clear(){}}a.default=u},{}],10:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=void 0,a.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};const u=(c,f)=>{const{messageId:d}=f,h=f.cmd;let v=null;const g=c.outgoing[d]?c.outgoing[d].cb:null;let p;if(!g){c.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(c.log("_handleAck :: packet type",h),h){case"pubcomp":case"puback":{const y=f.reasonCode;y&&y>0&&y!==16?(p=new Error(`Publish error: ${a.ReasonCodes[y]}`),p.code=y,c._removeOutgoingAndStoreMessage(d,()=>{g(p,f)})):c._removeOutgoingAndStoreMessage(d,g);break}case"pubrec":{v={cmd:"pubrel",qos:2,messageId:d};const y=f.reasonCode;y&&y>0&&y!==16?(p=new Error(`Publish error: ${a.ReasonCodes[y]}`),p.code=y,c._removeOutgoingAndStoreMessage(d,()=>{g(p,f)})):c._sendPacket(v);break}case"suback":{delete c.outgoing[d],c.messageIdProvider.deallocate(d);const y=f.granted;for(let _=0;_<y.length;_++)if(y[_]&128){const b=c.messageIdToTopic[d];b&&b.forEach(A=>{delete c._resubscribeTopics[A]})}delete c.messageIdToTopic[d],c._invokeStoreProcessingQueue(),g(null,f);break}case"unsuback":{delete c.outgoing[d],c.messageIdProvider.deallocate(d),c._invokeStoreProcessingQueue(),g(null);break}default:c.emit("error",new Error("unrecognized packet type"))}c.disconnecting&&Object.keys(c.outgoing).length===0&&c.emit("outgoingEmpty")};a.default=u},{}],11:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("../shared"),c=i("./ack"),f=(d,h)=>{const{options:v}=d,g=v.protocolVersion,p=g===5?h.reasonCode:h.returnCode;if(g!==5){const y=new u.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${g}`,p);d.emit("error",y);return}d.handleAuth(h,(y,_)=>{if(y){d.emit("error",y);return}if(p===24)d.reconnecting=!1,d._sendPacket(_);else{const b=new u.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[p]}`,p);d.emit("error",b)}})};a.default=f},{"../shared":17,"./ack":10}],12:[function(i,o,a){var u=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(a,"__esModule",{value:!0});const c=i("./ack"),f=u(i("../topic-alias-send")),d=i("../shared"),h=(v,g)=>{v.log("_handleConnack");const{options:p}=v,_=p.protocolVersion===5?g.reasonCode:g.returnCode;if(clearTimeout(v.connackTimer),delete v.topicAliasSend,g.properties){if(g.properties.topicAliasMaximum){if(g.properties.topicAliasMaximum>65535){v.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}g.properties.topicAliasMaximum>0&&(v.topicAliasSend=new f.default(g.properties.topicAliasMaximum))}g.properties.serverKeepAlive&&p.keepalive&&(p.keepalive=g.properties.serverKeepAlive,v._shiftPingInterval()),g.properties.maximumPacketSize&&(p.properties||(p.properties={}),p.properties.maximumPacketSize=g.properties.maximumPacketSize)}if(_===0)v.reconnecting=!1,v._onConnect(g);else if(_>0){const b=new d.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[_]}`,_);v.emit("error",b)}};a.default=h},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(i,o,a){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("./publish")),f=u(i("./auth")),d=u(i("./connack")),h=u(i("./ack")),v=u(i("./pubrel")),g=(p,y,_)=>{const{options:b}=p;if(b.protocolVersion===5&&b.properties&&b.properties.maximumPacketSize&&b.properties.maximumPacketSize<y.length)return p.emit("error",new Error(`exceeding packets size ${y.cmd}`)),p.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),p;switch(p.log("_handlePacket :: emitting packetreceive"),p.emit("packetreceive",y),y.cmd){case"publish":(0,c.default)(p,y,_);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,h.default)(p,y),_();break;case"pubrel":(0,v.default)(p,y,_);break;case"connack":(0,d.default)(p,y),_();break;case"auth":(0,f.default)(p,y),_();break;case"pingresp":p.pingResp=!0,_();break;case"disconnect":p.emit("disconnect",y),_();break;default:p.log("_handlePacket :: unknown command"),_();break}};a.default=g},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=[0,16,128,131,135,144,145,151,153],c=(f,d,h)=>{f.log("handlePublish: packet %o",d),h=typeof h<"u"?h:f.noop;let v=d.topic.toString();const g=d.payload,{qos:p}=d,{messageId:y}=d,{options:_}=f;if(f.options.protocolVersion===5){let b;if(d.properties&&(b=d.properties.topicAlias),typeof b<"u")if(v.length===0)if(b>0&&b<=65535){const A=f.topicAliasRecv.getTopicByAlias(b);if(A)v=A,f.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",v,b);else{f.log("handlePublish :: unregistered topic alias. alias: %d",b),f.emit("error",new Error("Received unregistered Topic Alias"));return}}else{f.log("handlePublish :: topic alias out of range. alias: %d",b),f.emit("error",new Error("Received Topic Alias is out of range"));return}else if(f.topicAliasRecv.put(v,b))f.log("handlePublish :: registered topic: %s - alias: %d",v,b);else{f.log("handlePublish :: topic alias out of range. alias: %d",b),f.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(f.log("handlePublish: qos %d",p),p){case 2:{_.customHandleAcks(v,g,d,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return f.emit("error",b);if(u.indexOf(A)===-1)return f.emit("error",new Error("Wrong reason code for pubrec"));A?f._sendPacket({cmd:"pubrec",messageId:y,reasonCode:A},h):f.incomingStore.put(d,()=>{f._sendPacket({cmd:"pubrec",messageId:y},h)})});break}case 1:{_.customHandleAcks(v,g,d,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return f.emit("error",b);if(u.indexOf(A)===-1)return f.emit("error",new Error("Wrong reason code for puback"));A||f.emit("message",v,g,d),f.handleMessage(d,w=>{if(w)return h&&h(w);f._sendPacket({cmd:"puback",messageId:y,reasonCode:A},h)})});break}case 0:f.emit("message",v,g,d),f.handleMessage(d,h);break;default:f.log("handlePublish: unknown QoS. Doing nothing.");break}};a.default=c},{}],15:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=(c,f,d)=>{c.log("handling pubrel packet");const h=typeof d<"u"?d:c.noop,{messageId:v}=f,g={cmd:"pubcomp",messageId:v};c.incomingStore.get(f,(p,y)=>{p?c._sendPacket(g,h):(c.emit("message",y.topic,y.payload,y),c.handleMessage(y,_=>{if(_)return h(_);c.incomingStore.del(y,c.noop),c._sendPacket(g,h)}))})};a.default=u},{}],16:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=typeof window<"u"&&typeof window.document<"u"||typeof self<"u"&&typeof self.postMessage=="function";a.default=u},{}],17:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.applyMixin=a.ErrorWithReasonCode=void 0;class u extends Error{constructor(d,h){super(d),this.code=h,Object.setPrototypeOf(this,u.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}a.ErrorWithReasonCode=u;function c(f,d,h=!1){var v;const g=[d];for(;;){const p=g[0],y=Object.getPrototypeOf(p);if(y!=null&&y.prototype)g.unshift(y);else break}for(const p of g)for(const y of Object.getOwnPropertyNames(p.prototype))(h||y!=="constructor")&&Object.defineProperty(f.prototype,y,(v=Object.getOwnPropertyDescriptor(p.prototype,y))!==null&&v!==void 0?v:Object.create(null))}a.applyMixin=c},{}],18:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("readable-stream"),c={objectMode:!0},f={clean:!0};class d{constructor(v){this.options=v||{},this.options=Object.assign(Object.assign({},f),v),this._inflights=new Map}put(v,g){return this._inflights.set(v.messageId,v),g&&g(),this}createStream(){const v=new u.Readable(c),g=[];let p=!1,y=0;return this._inflights.forEach((_,b)=>{g.push(_)}),v._read=()=>{!p&&y<g.length?v.push(g[y++]):v.push(null)},v.destroy=_=>{if(!p)return p=!0,setTimeout(()=>{v.emit("close")},0),v},v}del(v,g){const p=this._inflights.get(v.messageId);return p?(this._inflights.delete(v.messageId),g(null,p)):g&&g(new Error("missing packet")),this}get(v,g){const p=this._inflights.get(v.messageId);return p?g(null,p):g&&g(new Error("missing packet")),this}close(v){this.options.clean&&(this._inflights=null),v&&v()}}a.default=d},{"readable-stream":125}],19:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(f){this.aliasToTopic={},this.max=f}put(f,d){return d===0||d>this.max?!1:(this.aliasToTopic[d]=f,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(f){return this.aliasToTopic[f]}clear(){this.aliasToTopic={}}}a.default=u},{}],20:[function(i,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(i("lru-cache")),f=i("number-allocator");class d{constructor(v){v>0&&(this.aliasToTopic=new c.default({max:v}),this.topicToAlias={},this.numberAllocator=new f.NumberAllocator(1,v),this.max=v,this.length=0)}put(v,g){if(g===0||g>this.max)return!1;const p=this.aliasToTopic.get(g);return p&&delete this.topicToAlias[p],this.aliasToTopic.set(g,v),this.topicToAlias[v]=g,this.numberAllocator.use(g),this.length=this.aliasToTopic.size,!0}getTopicByAlias(v){return this.aliasToTopic.get(v)}getAliasByTopic(v){const g=this.topicToAlias[v];return typeof g<"u"&&this.aliasToTopic.get(g),g}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const v=this.numberAllocator.firstVacant();return v||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}a.default=d},{"lru-cache":72,"number-allocator":98}],21:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=i("number-allocator");class c{constructor(){this.numberAllocator=new u.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(d){return this.numberAllocator.use(d)}deallocate(d){this.numberAllocator.free(d)}clear(){this.numberAllocator.clear()}}a.default=c},{"number-allocator":98}],22:[function(i,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.validateTopics=a.validateTopic=void 0;function u(f){const d=f.split("/");for(let h=0;h<d.length;h++)if(d[h]!=="+"){if(d[h]==="#")return h===d.length-1;if(d[h].indexOf("+")!==-1||d[h].indexOf("#")!==-1)return!1}return!0}a.validateTopic=u;function c(f){if(f.length===0)return"empty_topic_list";for(let d=0;d<f.length;d++)if(!u(f[d]))return f[d];return null}a.validateTopics=c},{}],23:[function(i,o,a){var u=this&&this.__createBinding||(Object.create?function(A,w,T,S){S===void 0&&(S=T);var x=Object.getOwnPropertyDescriptor(w,T);(!x||("get"in x?!w.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return w[T]}}),Object.defineProperty(A,S,x)}:function(A,w,T,S){S===void 0&&(S=T),A[S]=w[T]}),c=this&&this.__setModuleDefault||(Object.create?function(A,w){Object.defineProperty(A,"default",{enumerable:!0,value:w})}:function(A,w){A.default=w}),f=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var w={};if(A!=null)for(var T in A)T!=="default"&&Object.prototype.hasOwnProperty.call(A,T)&&u(w,A,T);return c(w,A),w},d=this&&this.__exportStar||function(A,w){for(var T in A)T!=="default"&&!Object.prototype.hasOwnProperty.call(w,T)&&u(w,A,T)},h=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=a.UniqueMessageIdProvider=a.DefaultMessageIdProvider=a.Store=a.MqttClient=a.connectAsync=a.connect=a.Client=void 0;const v=h(i("./lib/client"));a.MqttClient=v.default;const g=h(i("./lib/default-message-id-provider"));a.DefaultMessageIdProvider=g.default;const p=h(i("./lib/unique-message-id-provider"));a.UniqueMessageIdProvider=p.default;const y=h(i("./lib/store"));a.Store=y.default;const _=f(i("./lib/connect"));a.connect=_.default,Object.defineProperty(a,"connectAsync",{enumerable:!0,get:function(){return _.connectAsync}}),a.Client=v.default,d(i("./lib/client"),a),d(i("./lib/shared"),a);var b=i("./lib/handlers/ack");Object.defineProperty(a,"ReasonCodes",{enumerable:!0,get:function(){return b.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(i,o,a){const{AbortController:u,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;o.exports=u,o.exports.AbortSignal=c,o.exports.default=u},{}],25:[function(i,o,a){a.byteLength=p,a.toByteArray=_,a.fromByteArray=w;for(var u=[],c=[],f=typeof Uint8Array<"u"?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,v=d.length;h<v;++h)u[h]=d[h],c[d.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function g(T){var S=T.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=T.indexOf("=");x===-1&&(x=S);var O=x===S?0:4-x%4;return[x,O]}function p(T){var S=g(T),x=S[0],O=S[1];return(x+O)*3/4-O}function y(T,S,x){return(S+x)*3/4-x}function _(T){var S,x=g(T),O=x[0],L=x[1],M=new f(y(T,O,L)),re=0,F=L>0?O-4:O,j;for(j=0;j<F;j+=4)S=c[T.charCodeAt(j)]<<18|c[T.charCodeAt(j+1)]<<12|c[T.charCodeAt(j+2)]<<6|c[T.charCodeAt(j+3)],M[re++]=S>>16&255,M[re++]=S>>8&255,M[re++]=S&255;return L===2&&(S=c[T.charCodeAt(j)]<<2|c[T.charCodeAt(j+1)]>>4,M[re++]=S&255),L===1&&(S=c[T.charCodeAt(j)]<<10|c[T.charCodeAt(j+1)]<<4|c[T.charCodeAt(j+2)]>>2,M[re++]=S>>8&255,M[re++]=S&255),M}function b(T){return u[T>>18&63]+u[T>>12&63]+u[T>>6&63]+u[T&63]}function A(T,S,x){for(var O,L=[],M=S;M<x;M+=3)O=(T[M]<<16&16711680)+(T[M+1]<<8&65280)+(T[M+2]&255),L.push(b(O));return L.join("")}function w(T){for(var S,x=T.length,O=x%3,L=[],M=16383,re=0,F=x-O;re<F;re+=M)L.push(A(T,re,re+M>F?F:re+M));return O===1?(S=T[x-1],L.push(u[S>>2]+u[S<<4&63]+"==")):O===2&&(S=(T[x-2]<<8)+T[x-1],L.push(u[S>>10]+u[S>>4&63]+u[S<<2&63]+"=")),L.join("")}},{}],26:[function(i,o,a){},{}],27:[function(i,o,a){var u=i("buffer"),c=u.Buffer;function f(h,v){for(var g in h)v[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(f(u,a),a.Buffer=d);function d(h,v,g){return c(h,v,g)}f(c,d),d.from=function(h,v,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,v,g)},d.alloc=function(h,v,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return v!==void 0?typeof g=="string"?p.fill(v,g):p.fill(v):p.fill(0),p},d.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},d.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],28:[function(i,o,a){var u=i("safe-buffer").Buffer,c=u.isEncoding||function(L){switch(L=""+L,L&&L.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function f(L){if(!L)return"utf8";for(var M;;)switch(L){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return L;default:if(M)return;L=(""+L).toLowerCase(),M=!0}}function d(L){var M=f(L);if(typeof M!="string"&&(u.isEncoding===c||!c(L)))throw new Error("Unknown encoding: "+L);return M||L}a.StringDecoder=h;function h(L){this.encoding=d(L);var M;switch(this.encoding){case"utf16le":this.text=A,this.end=w,M=4;break;case"utf8":this.fillLast=y,M=4;break;case"base64":this.text=T,this.end=S,M=3;break;default:this.write=x,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(M)}h.prototype.write=function(L){if(L.length===0)return"";var M,re;if(this.lastNeed){if(M=this.fillLast(L),M===void 0)return"";re=this.lastNeed,this.lastNeed=0}else re=0;return re<L.length?M?M+this.text(L,re):this.text(L,re):M||""},h.prototype.end=b,h.prototype.text=_,h.prototype.fillLast=function(L){if(this.lastNeed<=L.length)return L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,L.length),this.lastNeed-=L.length};function v(L){return L<=127?0:L>>5===6?2:L>>4===14?3:L>>3===30?4:L>>6===2?-1:-2}function g(L,M,re){var F=M.length-1;if(F<re)return 0;var j=v(M[F]);return j>=0?(j>0&&(L.lastNeed=j-1),j):--F<re||j===-2?0:(j=v(M[F]),j>=0?(j>0&&(L.lastNeed=j-2),j):--F<re||j===-2?0:(j=v(M[F]),j>=0?(j>0&&(j===2?j=0:L.lastNeed=j-3),j):0))}function p(L,M,re){if((M[0]&192)!==128)return L.lastNeed=0,"�";if(L.lastNeed>1&&M.length>1){if((M[1]&192)!==128)return L.lastNeed=1,"�";if(L.lastNeed>2&&M.length>2&&(M[2]&192)!==128)return L.lastNeed=2,"�"}}function y(L){var M=this.lastTotal-this.lastNeed,re=p(this,L);if(re!==void 0)return re;if(this.lastNeed<=L.length)return L.copy(this.lastChar,M,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,M,0,L.length),this.lastNeed-=L.length}function _(L,M){var re=g(this,L,M);if(!this.lastNeed)return L.toString("utf8",M);this.lastTotal=re;var F=L.length-(re-this.lastNeed);return L.copy(this.lastChar,0,F),L.toString("utf8",M,F)}function b(L){var M=L&&L.length?this.write(L):"";return this.lastNeed?M+"�":M}function A(L,M){if((L.length-M)%2===0){var re=L.toString("utf16le",M);if(re){var F=re.charCodeAt(re.length-1);if(F>=55296&&F<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1],re.slice(0,-1)}return re}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=L[L.length-1],L.toString("utf16le",M,L.length-1)}function w(L){var M=L&&L.length?this.write(L):"";if(this.lastNeed){var re=this.lastTotal-this.lastNeed;return M+this.lastChar.toString("utf16le",0,re)}return M}function T(L,M){var re=(L.length-M)%3;return re===0?L.toString("base64",M):(this.lastNeed=3-re,this.lastTotal=3,re===1?this.lastChar[0]=L[L.length-1]:(this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1]),L.toString("base64",M,L.length-re))}function S(L){var M=L&&L.length?this.write(L):"";return this.lastNeed?M+this.lastChar.toString("base64",0,3-this.lastNeed):M}function x(L){return L.toString(this.encoding)}function O(L){return L&&L.length?this.write(L):""}},{"safe-buffer":27}],29:[function(i,o,a){(function(u){(function(){var c=i("base64-js"),f=i("ieee754");a.Buffer=g,a.SlowBuffer=O,a.INSPECT_MAX_BYTES=50;var d=2147483647;a.kMaxLength=d,g.TYPED_ARRAY_SUPPORT=h(),!g.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function h(){try{var Y=new Uint8Array(1);return Y.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Y.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function v(Y){if(Y>d)throw new RangeError('The value "'+Y+'" is invalid for option "size"');var k=new Uint8Array(Y);return k.__proto__=g.prototype,k}function g(Y,k,D){if(typeof Y=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(Y)}return p(Y,k,D)}typeof Symbol<"u"&&Symbol.species!=null&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192;function p(Y,k,D){if(typeof Y=="string")return A(Y,k);if(ArrayBuffer.isView(Y))return w(Y);if(Y==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(ie(Y,ArrayBuffer)||Y&&ie(Y.buffer,ArrayBuffer))return T(Y,k,D);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var oe=Y.valueOf&&Y.valueOf();if(oe!=null&&oe!==Y)return g.from(oe,k,D);var xe=S(Y);if(xe)return xe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return g.from(Y[Symbol.toPrimitive]("string"),k,D);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}g.from=function(Y,k,D){return p(Y,k,D)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array;function y(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function _(Y,k,D){return y(Y),Y<=0?v(Y):k!==void 0?typeof D=="string"?v(Y).fill(k,D):v(Y).fill(k):v(Y)}g.alloc=function(Y,k,D){return _(Y,k,D)};function b(Y){return y(Y),v(Y<0?0:x(Y)|0)}g.allocUnsafe=function(Y){return b(Y)},g.allocUnsafeSlow=function(Y){return b(Y)};function A(Y,k){if((typeof k!="string"||k==="")&&(k="utf8"),!g.isEncoding(k))throw new TypeError("Unknown encoding: "+k);var D=L(Y,k)|0,oe=v(D),xe=oe.write(Y,k);return xe!==D&&(oe=oe.slice(0,xe)),oe}function w(Y){for(var k=Y.length<0?0:x(Y.length)|0,D=v(k),oe=0;oe<k;oe+=1)D[oe]=Y[oe]&255;return D}function T(Y,k,D){if(k<0||Y.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(Y.byteLength<k+(D||0))throw new RangeError('"length" is outside of buffer bounds');var oe;return k===void 0&&D===void 0?oe=new Uint8Array(Y):D===void 0?oe=new Uint8Array(Y,k):oe=new Uint8Array(Y,k,D),oe.__proto__=g.prototype,oe}function S(Y){if(g.isBuffer(Y)){var k=x(Y.length)|0,D=v(k);return D.length===0||Y.copy(D,0,0,k),D}if(Y.length!==void 0)return typeof Y.length!="number"||ae(Y.length)?v(0):w(Y);if(Y.type==="Buffer"&&Array.isArray(Y.data))return w(Y.data)}function x(Y){if(Y>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return Y|0}function O(Y){return+Y!=Y&&(Y=0),g.alloc(+Y)}g.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==g.prototype},g.compare=function(k,D){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),ie(D,Uint8Array)&&(D=g.from(D,D.offset,D.byteLength)),!g.isBuffer(k)||!g.isBuffer(D))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===D)return 0;for(var oe=k.length,xe=D.length,ze=0,hn=Math.min(oe,xe);ze<hn;++ze)if(k[ze]!==D[ze]){oe=k[ze],xe=D[ze];break}return oe<xe?-1:xe<oe?1:0},g.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(k,D){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return g.alloc(0);var oe;if(D===void 0)for(D=0,oe=0;oe<k.length;++oe)D+=k[oe].length;var xe=g.allocUnsafe(D),ze=0;for(oe=0;oe<k.length;++oe){var hn=k[oe];if(ie(hn,Uint8Array)&&(hn=g.from(hn)),!g.isBuffer(hn))throw new TypeError('"list" argument must be an Array of Buffers');hn.copy(xe,ze),ze+=hn.length}return xe};function L(Y,k){if(g.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||ie(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);var D=Y.length,oe=arguments.length>2&&arguments[2]===!0;if(!oe&&D===0)return 0;for(var xe=!1;;)switch(k){case"ascii":case"latin1":case"binary":return D;case"utf8":case"utf-8":return Ne(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D*2;case"hex":return D>>>1;case"base64":return jt(Y).length;default:if(xe)return oe?-1:Ne(Y).length;k=(""+k).toLowerCase(),xe=!0}}g.byteLength=L;function M(Y,k,D){var oe=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((D===void 0||D>this.length)&&(D=this.length),D<=0)||(D>>>=0,k>>>=0,D<=k))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return vn(this,k,D);case"utf8":case"utf-8":return pe(this,k,D);case"ascii":return Et(this,k,D);case"latin1":case"binary":return Cn(this,k,D);case"base64":return Fe(this,k,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,k,D);default:if(oe)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),oe=!0}}g.prototype._isBuffer=!0;function re(Y,k,D){var oe=Y[k];Y[k]=Y[D],Y[D]=oe}g.prototype.swap16=function(){var k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var D=0;D<k;D+=2)re(this,D,D+1);return this},g.prototype.swap32=function(){var k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var D=0;D<k;D+=4)re(this,D,D+3),re(this,D+1,D+2);return this},g.prototype.swap64=function(){var k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var D=0;D<k;D+=8)re(this,D,D+7),re(this,D+1,D+6),re(this,D+2,D+5),re(this,D+3,D+4);return this},g.prototype.toString=function(){var k=this.length;return k===0?"":arguments.length===0?pe(this,0,k):M.apply(this,arguments)},g.prototype.toLocaleString=g.prototype.toString,g.prototype.equals=function(k){if(!g.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:g.compare(this,k)===0},g.prototype.inspect=function(){var k="",D=a.INSPECT_MAX_BYTES;return k=this.toString("hex",0,D).replace(/(.{2})/g,"$1 ").trim(),this.length>D&&(k+=" ... "),"<Buffer "+k+">"},g.prototype.compare=function(k,D,oe,xe,ze){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),!g.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(D===void 0&&(D=0),oe===void 0&&(oe=k?k.length:0),xe===void 0&&(xe=0),ze===void 0&&(ze=this.length),D<0||oe>k.length||xe<0||ze>this.length)throw new RangeError("out of range index");if(xe>=ze&&D>=oe)return 0;if(xe>=ze)return-1;if(D>=oe)return 1;if(D>>>=0,oe>>>=0,xe>>>=0,ze>>>=0,this===k)return 0;for(var hn=ze-xe,An=oe-D,Tn=Math.min(hn,An),Rn=this.slice(xe,ze),Ve=k.slice(D,oe),Ue=0;Ue<Tn;++Ue)if(Rn[Ue]!==Ve[Ue]){hn=Rn[Ue],An=Ve[Ue];break}return hn<An?-1:An<hn?1:0};function F(Y,k,D,oe,xe){if(Y.length===0)return-1;if(typeof D=="string"?(oe=D,D=0):D>2147483647?D=2147483647:D<-2147483648&&(D=-2147483648),D=+D,ae(D)&&(D=xe?0:Y.length-1),D<0&&(D=Y.length+D),D>=Y.length){if(xe)return-1;D=Y.length-1}else if(D<0)if(xe)D=0;else return-1;if(typeof k=="string"&&(k=g.from(k,oe)),g.isBuffer(k))return k.length===0?-1:j(Y,k,D,oe,xe);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?xe?Uint8Array.prototype.indexOf.call(Y,k,D):Uint8Array.prototype.lastIndexOf.call(Y,k,D):j(Y,[k],D,oe,xe);throw new TypeError("val must be string, number or Buffer")}function j(Y,k,D,oe,xe){var ze=1,hn=Y.length,An=k.length;if(oe!==void 0&&(oe=String(oe).toLowerCase(),oe==="ucs2"||oe==="ucs-2"||oe==="utf16le"||oe==="utf-16le")){if(Y.length<2||k.length<2)return-1;ze=2,hn/=2,An/=2,D/=2}function Tn(Sn,xn){return ze===1?Sn[xn]:Sn.readUInt16BE(xn*ze)}var Rn;if(xe){var Ve=-1;for(Rn=D;Rn<hn;Rn++)if(Tn(Y,Rn)===Tn(k,Ve===-1?0:Rn-Ve)){if(Ve===-1&&(Ve=Rn),Rn-Ve+1===An)return Ve*ze}else Ve!==-1&&(Rn-=Rn-Ve),Ve=-1}else for(D+An>hn&&(D=hn-An),Rn=D;Rn>=0;Rn--){for(var Ue=!0,En=0;En<An;En++)if(Tn(Y,Rn+En)!==Tn(k,En)){Ue=!1;break}if(Ue)return Rn}return-1}g.prototype.includes=function(k,D,oe){return this.indexOf(k,D,oe)!==-1},g.prototype.indexOf=function(k,D,oe){return F(this,k,D,oe,!0)},g.prototype.lastIndexOf=function(k,D,oe){return F(this,k,D,oe,!1)};function V(Y,k,D,oe){D=Number(D)||0;var xe=Y.length-D;oe?(oe=Number(oe),oe>xe&&(oe=xe)):oe=xe;var ze=k.length;oe>ze/2&&(oe=ze/2);for(var hn=0;hn<oe;++hn){var An=parseInt(k.substr(hn*2,2),16);if(ae(An))return hn;Y[D+hn]=An}return hn}function z(Y,k,D,oe){return _n(Ne(k,Y.length-D),Y,D,oe)}function $(Y,k,D,oe){return _n(Oe(k),Y,D,oe)}function he(Y,k,D,oe){return $(Y,k,D,oe)}function le(Y,k,D,oe){return _n(jt(k),Y,D,oe)}function Ie(Y,k,D,oe){return _n(kt(k,Y.length-D),Y,D,oe)}g.prototype.write=function(k,D,oe,xe){if(D===void 0)xe="utf8",oe=this.length,D=0;else if(oe===void 0&&typeof D=="string")xe=D,oe=this.length,D=0;else if(isFinite(D))D=D>>>0,isFinite(oe)?(oe=oe>>>0,xe===void 0&&(xe="utf8")):(xe=oe,oe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ze=this.length-D;if((oe===void 0||oe>ze)&&(oe=ze),k.length>0&&(oe<0||D<0)||D>this.length)throw new RangeError("Attempt to write outside buffer bounds");xe||(xe="utf8");for(var hn=!1;;)switch(xe){case"hex":return V(this,k,D,oe);case"utf8":case"utf-8":return z(this,k,D,oe);case"ascii":return $(this,k,D,oe);case"latin1":case"binary":return he(this,k,D,oe);case"base64":return le(this,k,D,oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,k,D,oe);default:if(hn)throw new TypeError("Unknown encoding: "+xe);xe=(""+xe).toLowerCase(),hn=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fe(Y,k,D){return k===0&&D===Y.length?c.fromByteArray(Y):c.fromByteArray(Y.slice(k,D))}function pe(Y,k,D){D=Math.min(Y.length,D);for(var oe=[],xe=k;xe<D;){var ze=Y[xe],hn=null,An=ze>239?4:ze>223?3:ze>191?2:1;if(xe+An<=D){var Tn,Rn,Ve,Ue;switch(An){case 1:ze<128&&(hn=ze);break;case 2:Tn=Y[xe+1],(Tn&192)===128&&(Ue=(ze&31)<<6|Tn&63,Ue>127&&(hn=Ue));break;case 3:Tn=Y[xe+1],Rn=Y[xe+2],(Tn&192)===128&&(Rn&192)===128&&(Ue=(ze&15)<<12|(Tn&63)<<6|Rn&63,Ue>2047&&(Ue<55296||Ue>57343)&&(hn=Ue));break;case 4:Tn=Y[xe+1],Rn=Y[xe+2],Ve=Y[xe+3],(Tn&192)===128&&(Rn&192)===128&&(Ve&192)===128&&(Ue=(ze&15)<<18|(Tn&63)<<12|(Rn&63)<<6|Ve&63,Ue>65535&&Ue<1114112&&(hn=Ue))}}hn===null?(hn=65533,An=1):hn>65535&&(hn-=65536,oe.push(hn>>>10&1023|55296),hn=56320|hn&1023),oe.push(hn),xe+=An}return _e(oe)}var Lt=4096;function _e(Y){var k=Y.length;if(k<=Lt)return String.fromCharCode.apply(String,Y);for(var D="",oe=0;oe<k;)D+=String.fromCharCode.apply(String,Y.slice(oe,oe+=Lt));return D}function Et(Y,k,D){var oe="";D=Math.min(Y.length,D);for(var xe=k;xe<D;++xe)oe+=String.fromCharCode(Y[xe]&127);return oe}function Cn(Y,k,D){var oe="";D=Math.min(Y.length,D);for(var xe=k;xe<D;++xe)oe+=String.fromCharCode(Y[xe]);return oe}function vn(Y,k,D){var oe=Y.length;(!k||k<0)&&(k=0),(!D||D<0||D>oe)&&(D=oe);for(var xe="",ze=k;ze<D;++ze)xe+=At(Y[ze]);return xe}function Dt(Y,k,D){for(var oe=Y.slice(k,D),xe="",ze=0;ze<oe.length;ze+=2)xe+=String.fromCharCode(oe[ze]+oe[ze+1]*256);return xe}g.prototype.slice=function(k,D){var oe=this.length;k=~~k,D=D===void 0?oe:~~D,k<0?(k+=oe,k<0&&(k=0)):k>oe&&(k=oe),D<0?(D+=oe,D<0&&(D=0)):D>oe&&(D=oe),D<k&&(D=k);var xe=this.subarray(k,D);return xe.__proto__=g.prototype,xe};function de(Y,k,D){if(Y%1!==0||Y<0)throw new RangeError("offset is not uint");if(Y+k>D)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUIntLE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k],ze=1,hn=0;++hn<D&&(ze*=256);)xe+=this[k+hn]*ze;return xe},g.prototype.readUIntBE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k+--D],ze=1;D>0&&(ze*=256);)xe+=this[k+--D]*ze;return xe},g.prototype.readUInt8=function(k,D){return k=k>>>0,D||de(k,1,this.length),this[k]},g.prototype.readUInt16LE=function(k,D){return k=k>>>0,D||de(k,2,this.length),this[k]|this[k+1]<<8},g.prototype.readUInt16BE=function(k,D){return k=k>>>0,D||de(k,2,this.length),this[k]<<8|this[k+1]},g.prototype.readUInt32LE=function(k,D){return k=k>>>0,D||de(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},g.prototype.readUInt32BE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},g.prototype.readIntLE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=this[k],ze=1,hn=0;++hn<D&&(ze*=256);)xe+=this[k+hn]*ze;return ze*=128,xe>=ze&&(xe-=Math.pow(2,8*D)),xe},g.prototype.readIntBE=function(k,D,oe){k=k>>>0,D=D>>>0,oe||de(k,D,this.length);for(var xe=D,ze=1,hn=this[k+--xe];xe>0&&(ze*=256);)hn+=this[k+--xe]*ze;return ze*=128,hn>=ze&&(hn-=Math.pow(2,8*D)),hn},g.prototype.readInt8=function(k,D){return k=k>>>0,D||de(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},g.prototype.readInt16LE=function(k,D){k=k>>>0,D||de(k,2,this.length);var oe=this[k]|this[k+1]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt16BE=function(k,D){k=k>>>0,D||de(k,2,this.length);var oe=this[k+1]|this[k]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt32LE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},g.prototype.readInt32BE=function(k,D){return k=k>>>0,D||de(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},g.prototype.readFloatLE=function(k,D){return k=k>>>0,D||de(k,4,this.length),f.read(this,k,!0,23,4)},g.prototype.readFloatBE=function(k,D){return k=k>>>0,D||de(k,4,this.length),f.read(this,k,!1,23,4)},g.prototype.readDoubleLE=function(k,D){return k=k>>>0,D||de(k,8,this.length),f.read(this,k,!0,52,8)},g.prototype.readDoubleBE=function(k,D){return k=k>>>0,D||de(k,8,this.length),f.read(this,k,!1,52,8)};function qe(Y,k,D,oe,xe,ze){if(!g.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>xe||k<ze)throw new RangeError('"value" argument is out of bounds');if(D+oe>Y.length)throw new RangeError("Index out of range")}g.prototype.writeUIntLE=function(k,D,oe,xe){if(k=+k,D=D>>>0,oe=oe>>>0,!xe){var ze=Math.pow(2,8*oe)-1;qe(this,k,D,oe,ze,0)}var hn=1,An=0;for(this[D]=k&255;++An<oe&&(hn*=256);)this[D+An]=k/hn&255;return D+oe},g.prototype.writeUIntBE=function(k,D,oe,xe){if(k=+k,D=D>>>0,oe=oe>>>0,!xe){var ze=Math.pow(2,8*oe)-1;qe(this,k,D,oe,ze,0)}var hn=oe-1,An=1;for(this[D+hn]=k&255;--hn>=0&&(An*=256);)this[D+hn]=k/An&255;return D+oe},g.prototype.writeUInt8=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,1,255,0),this[D]=k&255,D+1},g.prototype.writeUInt16LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,65535,0),this[D]=k&255,this[D+1]=k>>>8,D+2},g.prototype.writeUInt16BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,65535,0),this[D]=k>>>8,this[D+1]=k&255,D+2},g.prototype.writeUInt32LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,4294967295,0),this[D+3]=k>>>24,this[D+2]=k>>>16,this[D+1]=k>>>8,this[D]=k&255,D+4},g.prototype.writeUInt32BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,4294967295,0),this[D]=k>>>24,this[D+1]=k>>>16,this[D+2]=k>>>8,this[D+3]=k&255,D+4},g.prototype.writeIntLE=function(k,D,oe,xe){if(k=+k,D=D>>>0,!xe){var ze=Math.pow(2,8*oe-1);qe(this,k,D,oe,ze-1,-ze)}var hn=0,An=1,Tn=0;for(this[D]=k&255;++hn<oe&&(An*=256);)k<0&&Tn===0&&this[D+hn-1]!==0&&(Tn=1),this[D+hn]=(k/An>>0)-Tn&255;return D+oe},g.prototype.writeIntBE=function(k,D,oe,xe){if(k=+k,D=D>>>0,!xe){var ze=Math.pow(2,8*oe-1);qe(this,k,D,oe,ze-1,-ze)}var hn=oe-1,An=1,Tn=0;for(this[D+hn]=k&255;--hn>=0&&(An*=256);)k<0&&Tn===0&&this[D+hn+1]!==0&&(Tn=1),this[D+hn]=(k/An>>0)-Tn&255;return D+oe},g.prototype.writeInt8=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,1,127,-128),k<0&&(k=255+k+1),this[D]=k&255,D+1},g.prototype.writeInt16LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,32767,-32768),this[D]=k&255,this[D+1]=k>>>8,D+2},g.prototype.writeInt16BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,2,32767,-32768),this[D]=k>>>8,this[D+1]=k&255,D+2},g.prototype.writeInt32LE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,2147483647,-2147483648),this[D]=k&255,this[D+1]=k>>>8,this[D+2]=k>>>16,this[D+3]=k>>>24,D+4},g.prototype.writeInt32BE=function(k,D,oe){return k=+k,D=D>>>0,oe||qe(this,k,D,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[D]=k>>>24,this[D+1]=k>>>16,this[D+2]=k>>>8,this[D+3]=k&255,D+4};function Pt(Y,k,D,oe,xe,ze){if(D+oe>Y.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("Index out of range")}function In(Y,k,D,oe,xe){return k=+k,D=D>>>0,xe||Pt(Y,k,D,4),f.write(Y,k,D,oe,23,4),D+4}g.prototype.writeFloatLE=function(k,D,oe){return In(this,k,D,!0,oe)},g.prototype.writeFloatBE=function(k,D,oe){return In(this,k,D,!1,oe)};function $e(Y,k,D,oe,xe){return k=+k,D=D>>>0,xe||Pt(Y,k,D,8),f.write(Y,k,D,oe,52,8),D+8}g.prototype.writeDoubleLE=function(k,D,oe){return $e(this,k,D,!0,oe)},g.prototype.writeDoubleBE=function(k,D,oe){return $e(this,k,D,!1,oe)},g.prototype.copy=function(k,D,oe,xe){if(!g.isBuffer(k))throw new TypeError("argument should be a Buffer");if(oe||(oe=0),!xe&&xe!==0&&(xe=this.length),D>=k.length&&(D=k.length),D||(D=0),xe>0&&xe<oe&&(xe=oe),xe===oe||k.length===0||this.length===0)return 0;if(D<0)throw new RangeError("targetStart out of bounds");if(oe<0||oe>=this.length)throw new RangeError("Index out of range");if(xe<0)throw new RangeError("sourceEnd out of bounds");xe>this.length&&(xe=this.length),k.length-D<xe-oe&&(xe=k.length-D+oe);var ze=xe-oe;if(this===k&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(D,oe,xe);else if(this===k&&oe<D&&D<xe)for(var hn=ze-1;hn>=0;--hn)k[hn+D]=this[hn+oe];else Uint8Array.prototype.set.call(k,this.subarray(oe,xe),D);return ze},g.prototype.fill=function(k,D,oe,xe){if(typeof k=="string"){if(typeof D=="string"?(xe=D,D=0,oe=this.length):typeof oe=="string"&&(xe=oe,oe=this.length),xe!==void 0&&typeof xe!="string")throw new TypeError("encoding must be a string");if(typeof xe=="string"&&!g.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);if(k.length===1){var ze=k.charCodeAt(0);(xe==="utf8"&&ze<128||xe==="latin1")&&(k=ze)}}else typeof k=="number"&&(k=k&255);if(D<0||this.length<D||this.length<oe)throw new RangeError("Out of range index");if(oe<=D)return this;D=D>>>0,oe=oe===void 0?this.length:oe>>>0,k||(k=0);var hn;if(typeof k=="number")for(hn=D;hn<oe;++hn)this[hn]=k;else{var An=g.isBuffer(k)?k:g.from(k,xe),Tn=An.length;if(Tn===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(hn=0;hn<oe-D;++hn)this[hn+D]=An[hn%Tn]}return this};var Ce=/[^+/0-9A-Za-z-_]/g;function ue(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ce,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function At(Y){return Y<16?"0"+Y.toString(16):Y.toString(16)}function Ne(Y,k){k=k||1/0;for(var D,oe=Y.length,xe=null,ze=[],hn=0;hn<oe;++hn){if(D=Y.charCodeAt(hn),D>55295&&D<57344){if(!xe){if(D>56319){(k-=3)>-1&&ze.push(239,191,189);continue}else if(hn+1===oe){(k-=3)>-1&&ze.push(239,191,189);continue}xe=D;continue}if(D<56320){(k-=3)>-1&&ze.push(239,191,189),xe=D;continue}D=(xe-55296<<10|D-56320)+65536}else xe&&(k-=3)>-1&&ze.push(239,191,189);if(xe=null,D<128){if((k-=1)<0)break;ze.push(D)}else if(D<2048){if((k-=2)<0)break;ze.push(D>>6|192,D&63|128)}else if(D<65536){if((k-=3)<0)break;ze.push(D>>12|224,D>>6&63|128,D&63|128)}else if(D<1114112){if((k-=4)<0)break;ze.push(D>>18|240,D>>12&63|128,D>>6&63|128,D&63|128)}else throw new Error("Invalid code point")}return ze}function Oe(Y){for(var k=[],D=0;D<Y.length;++D)k.push(Y.charCodeAt(D)&255);return k}function kt(Y,k){for(var D,oe,xe,ze=[],hn=0;hn<Y.length&&!((k-=2)<0);++hn)D=Y.charCodeAt(hn),oe=D>>8,xe=D%256,ze.push(xe),ze.push(oe);return ze}function jt(Y){return c.toByteArray(ue(Y))}function _n(Y,k,D,oe){for(var xe=0;xe<oe&&!(xe+D>=k.length||xe>=Y.length);++xe)k[xe+D]=Y[xe];return xe}function ie(Y,k){return Y instanceof k||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===k.name}function ae(Y){return Y!==Y}}).call(this)}).call(this,i("buffer").Buffer)},{"base64-js":25,buffer:29,ieee754:50}],30:[function(i,o,a){(function(u){(function(){a.formatArgs=f,a.save=d,a.load=h,a.useColors=c,a.storage=v(),a.destroy=(()=>{let p=!1;return()=>{p||(p=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function c(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function f(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),!this.useColors)return;const y="color: "+this.color;p.splice(1,0,y,"color: inherit");let _=0,b=0;p[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(_++,A==="%c"&&(b=_))}),p.splice(b,0,y)}a.log=console.debug||console.log||(()=>{});function d(p){try{p?a.storage.setItem("debug",p):a.storage.removeItem("debug")}catch{}}function h(){let p;try{p=a.storage.getItem("debug")}catch{}return!p&&typeof u<"u"&&"env"in u&&(p=u.env.DEBUG),p}function v(){try{return localStorage}catch{}}o.exports=i("./common")(a);const{formatters:g}=o.exports;g.j=function(p){try{return JSON.stringify(p)}catch(y){return"[UnexpectedJSONParseError]: "+y.message}}}).call(this)}).call(this,i("_process"))},{"./common":31,_process:102}],31:[function(i,o,a){function u(c){d.debug=d,d.default=d,d.coerce=_,d.disable=g,d.enable=v,d.enabled=p,d.humanize=i("ms"),d.destroy=b,Object.keys(c).forEach(A=>{d[A]=c[A]}),d.names=[],d.skips=[],d.formatters={};function f(A){let w=0;for(let T=0;T<A.length;T++)w=(w<<5)-w+A.charCodeAt(T),w|=0;return d.colors[Math.abs(w)%d.colors.length]}d.selectColor=f;function d(A){let w,T=null,S,x;function O(...L){if(!O.enabled)return;const M=O,re=Number(new Date),F=re-(w||re);M.diff=F,M.prev=w,M.curr=re,w=re,L[0]=d.coerce(L[0]),typeof L[0]!="string"&&L.unshift("%O");let j=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(z,$)=>{if(z==="%%")return"%";j++;const he=d.formatters[$];if(typeof he=="function"){const le=L[j];z=he.call(M,le),L.splice(j,1),j--}return z}),d.formatArgs.call(M,L),(M.log||d.log).apply(M,L)}return O.namespace=A,O.useColors=d.useColors(),O.color=d.selectColor(A),O.extend=h,O.destroy=d.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>T!==null?T:(S!==d.namespaces&&(S=d.namespaces,x=d.enabled(A)),x),set:L=>{T=L}}),typeof d.init=="function"&&d.init(O),O}function h(A,w){const T=d(this.namespace+(typeof w>"u"?":":w)+A);return T.log=this.log,T}function v(A){d.save(A),d.namespaces=A,d.names=[],d.skips=[];let w;const T=(typeof A=="string"?A:"").split(/[\s,]+/),S=T.length;for(w=0;w<S;w++)T[w]&&(A=T[w].replace(/\*/g,".*?"),A[0]==="-"?d.skips.push(new RegExp("^"+A.slice(1)+"$")):d.names.push(new RegExp("^"+A+"$")))}function g(){const A=[...d.names.map(y),...d.skips.map(y).map(w=>"-"+w)].join(",");return d.enable(""),A}function p(A){if(A[A.length-1]==="*")return!0;let w,T;for(w=0,T=d.skips.length;w<T;w++)if(d.skips[w].test(A))return!1;for(w=0,T=d.names.length;w<T;w++)if(d.names[w].test(A))return!0;return!1}function y(A){return A.toString().substring(2,A.toString().length-2).replace(/\.\*\?$/,"*")}function _(A){return A instanceof Error?A.stack||A.message:A}function b(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}o.exports=u},{ms:97}],32:[function(i,o,a){(function(u,c){(function(){var f=i("readable-stream"),d=i("end-of-stream"),h=i("inherits"),v=i("stream-shift"),g=c.from&&c.from!==Uint8Array.from?c.from([0]):new c([0]),p=function(S,x){S._corked?S.once("uncork",x):x()},y=function(S,x){S._autoDestroy&&S.destroy(x)},_=function(S,x){return function(O){O?y(S,O.message==="premature close"?null:O):x&&!S._ended&&S.end()}},b=function(S,x){if(!S||S._writableState&&S._writableState.finished)return x();if(S._writableState)return S.end(x);S.end(),x()},A=function(){},w=function(S){return new f.Readable({objectMode:!0,highWaterMark:16}).wrap(S)},T=function(S,x,O){if(!(this instanceof T))return new T(S,x,O);f.Duplex.call(this,O),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!O||O.autoDestroy!==!1,this._forwardDestroy=!O||O.destroy!==!1,this._forwardEnd=!O||O.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,S&&this.setWritable(S),x&&this.setReadable(x)};h(T,f.Duplex),T.obj=function(S,x,O){return O||(O={}),O.objectMode=!0,O.highWaterMark=16,new T(S,x,O)},T.prototype.cork=function(){++this._corked===1&&this.emit("cork")},T.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},T.prototype.setWritable=function(S){if(this._unwrite&&this._unwrite(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.end();return}var x=this,O=d(S,{writable:!0,readable:!1},_(this,this._forwardEnd)),L=function(){var re=x._ondrain;x._ondrain=null,re&&re()},M=function(){x._writable.removeListener("drain",L),O()};this._unwrite&&u.nextTick(L),this._writable=S,this._writable.on("drain",L),this._unwrite=M,this.uncork()},T.prototype.setReadable=function(S){if(this._unread&&this._unread(),this.destroyed){S&&S.destroy&&S.destroy();return}if(S===null||S===!1){this.push(null),this.resume();return}var x=this,O=d(S,{writable:!1,readable:!0},_(this)),L=function(){x._forward()},M=function(){x.push(null)},re=function(){x._readable2.removeListener("readable",L),x._readable2.removeListener("end",M),O()};this._drained=!0,this._readable=S,this._readable2=S._readableState?S:w(S),this._readable2.on("readable",L),this._readable2.on("end",M),this._unread=re,this._forward()},T.prototype._read=function(){this._drained=!0,this._forward()},T.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var S;this._drained&&(S=v(this._readable2))!==null;)this.destroyed||(this._drained=this.push(S));this._forwarding=!1}},T.prototype.destroy=function(S,x){if(x||(x=A),this.destroyed)return x(null);this.destroyed=!0;var O=this;u.nextTick(function(){O._destroy(S),x(null)})},T.prototype._destroy=function(S){if(S){var x=this._ondrain;this._ondrain=null,x?x(S):this.emit("error",S)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},T.prototype._write=function(S,x,O){if(!this.destroyed){if(this._corked)return p(this,this._write.bind(this,S,x,O));if(S===g)return this._finish(O);if(!this._writable)return O();this._writable.write(S)===!1?this._ondrain=O:this.destroyed||O()}},T.prototype._finish=function(S){var x=this;this.emit("preend"),p(this,function(){b(x._forwardEnd&&x._writable,function(){x._writableState.prefinished===!1&&(x._writableState.prefinished=!0),x.emit("prefinish"),p(x,S)})})},T.prototype.end=function(S,x,O){return typeof S=="function"?this.end(null,null,S):typeof x=="function"?this.end(S,null,x):(this._ended=!0,S&&this.write(S),!this._writableState.ending&&!this._writableState.destroyed&&this.write(g),f.Writable.prototype.end.call(this,O))},o.exports=T}).call(this)}).call(this,i("_process"),i("buffer").Buffer)},{_process:102,buffer:29,"end-of-stream":48,inherits:51,"readable-stream":47,"stream-shift":135}],33:[function(i,o,a){function u(p,y){p.prototype=Object.create(y.prototype),p.prototype.constructor=p,p.__proto__=y}var c={};function f(p,y,_){_||(_=Error);function b(w,T,S){return typeof y=="string"?y:y(w,T,S)}var A=function(w){u(T,w);function T(S,x,O){return w.call(this,b(S,x,O))||this}return T}(_);A.prototype.name=_.name,A.prototype.code=p,c[p]=A}function d(p,y){if(Array.isArray(p)){var _=p.length;return p=p.map(function(b){return String(b)}),_>2?"one of ".concat(y," ").concat(p.slice(0,_-1).join(", "),", or ")+p[_-1]:_===2?"one of ".concat(y," ").concat(p[0]," or ").concat(p[1]):"of ".concat(y," ").concat(p[0])}else return"of ".concat(y," ").concat(String(p))}function h(p,y,_){return p.substr(!_||_<0?0:+_,y.length)===y}function v(p,y,_){return(_===void 0||_>p.length)&&(_=p.length),p.substring(_-y.length,_)===y}function g(p,y,_){return typeof _!="number"&&(_=0),_+y.length>p.length?!1:p.indexOf(y,_)!==-1}f("ERR_INVALID_OPT_VALUE",function(p,y){return'The value "'+y+'" is invalid for option "'+p+'"'},TypeError),f("ERR_INVALID_ARG_TYPE",function(p,y,_){var b;typeof y=="string"&&h(y,"not ")?(b="must not be",y=y.replace(/^not /,"")):b="must be";var A;if(v(p," argument"))A="The ".concat(p," ").concat(b," ").concat(d(y,"type"));else{var w=g(p,".")?"property":"argument";A='The "'.concat(p,'" ').concat(w," ").concat(b," ").concat(d(y,"type"))}return A+=". Received type ".concat(typeof _),A},TypeError),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),f("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),f("ERR_STREAM_PREMATURE_CLOSE","Premature close"),f("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),f("ERR_STREAM_WRITE_AFTER_END","write after end"),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=c},{}],34:[function(i,o,a){(function(u){(function(){var c=Object.keys||function(b){var A=[];for(var w in b)A.push(w);return A};o.exports=p;var f=i("./_stream_readable"),d=i("./_stream_writable");i("inherits")(p,f);for(var h=c(d.prototype),v=0;v<h.length;v++){var g=h[v];p.prototype[g]||(p.prototype[g]=d.prototype[g])}function p(b){if(!(this instanceof p))return new p(b);f.call(this,b),d.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",y)))}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function y(){this._writableState.ended||u.nextTick(_,this)}function _(b){b.end()}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(A){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=A,this._writableState.destroyed=A)}})}).call(this)}).call(this,i("_process"))},{"./_stream_readable":36,"./_stream_writable":38,_process:102,inherits:51}],35:[function(i,o,a){o.exports=c;var u=i("./_stream_transform");i("inherits")(c,u);function c(f){if(!(this instanceof c))return new c(f);u.call(this,f)}c.prototype._transform=function(f,d,h){h(null,f)}},{"./_stream_transform":37,inherits:51}],36:[function(i,o,a){(function(u,c){(function(){o.exports=Ie;var f;Ie.ReadableState=le,i("events").EventEmitter;var d=function(ae,Y){return ae.listeners(Y).length},h=i("./internal/streams/stream"),v=i("buffer").Buffer,g=c.Uint8Array||function(){};function p(ie){return v.from(ie)}function y(ie){return v.isBuffer(ie)||ie instanceof g}var _=i("util"),b;_&&_.debuglog?b=_.debuglog("stream"):b=function(){};var A=i("./internal/streams/buffer_list"),w=i("./internal/streams/destroy"),T=i("./internal/streams/state"),S=T.getHighWaterMark,x=i("../errors").codes,O=x.ERR_INVALID_ARG_TYPE,L=x.ERR_STREAM_PUSH_AFTER_EOF,M=x.ERR_METHOD_NOT_IMPLEMENTED,re=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,F,j,V;i("inherits")(Ie,h);var z=w.errorOrDestroy,$=["error","close","destroy","pause","resume"];function he(ie,ae,Y){if(typeof ie.prependListener=="function")return ie.prependListener(ae,Y);!ie._events||!ie._events[ae]?ie.on(ae,Y):Array.isArray(ie._events[ae])?ie._events[ae].unshift(Y):ie._events[ae]=[Y,ie._events[ae]]}function le(ie,ae,Y){f=f||i("./_stream_duplex"),ie=ie||{},typeof Y!="boolean"&&(Y=ae instanceof f),this.objectMode=!!ie.objectMode,Y&&(this.objectMode=this.objectMode||!!ie.readableObjectMode),this.highWaterMark=S(this,ie,"readableHighWaterMark",Y),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ie.emitClose!==!1,this.autoDestroy=!!ie.autoDestroy,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(F||(F=i("string_decoder/").StringDecoder),this.decoder=new F(ie.encoding),this.encoding=ie.encoding)}function Ie(ie){if(f=f||i("./_stream_duplex"),!(this instanceof Ie))return new Ie(ie);var ae=this instanceof f;this._readableState=new le(ie,this,ae),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),h.call(this)}Object.defineProperty(Ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ae){this._readableState&&(this._readableState.destroyed=ae)}}),Ie.prototype.destroy=w.destroy,Ie.prototype._undestroy=w.undestroy,Ie.prototype._destroy=function(ie,ae){ae(ie)},Ie.prototype.push=function(ie,ae){var Y=this._readableState,k;return Y.objectMode?k=!0:typeof ie=="string"&&(ae=ae||Y.defaultEncoding,ae!==Y.encoding&&(ie=v.from(ie,ae),ae=""),k=!0),Fe(this,ie,ae,!1,k)},Ie.prototype.unshift=function(ie){return Fe(this,ie,null,!0,!1)};function Fe(ie,ae,Y,k,D){b("readableAddChunk",ae);var oe=ie._readableState;if(ae===null)oe.reading=!1,vn(ie,oe);else{var xe;if(D||(xe=Lt(oe,ae)),xe)z(ie,xe);else if(oe.objectMode||ae&&ae.length>0)if(typeof ae!="string"&&!oe.objectMode&&Object.getPrototypeOf(ae)!==v.prototype&&(ae=p(ae)),k)oe.endEmitted?z(ie,new re):pe(ie,oe,ae,!0);else if(oe.ended)z(ie,new L);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!Y?(ae=oe.decoder.write(ae),oe.objectMode||ae.length!==0?pe(ie,oe,ae,!1):qe(ie,oe)):pe(ie,oe,ae,!1)}else k||(oe.reading=!1,qe(ie,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function pe(ie,ae,Y,k){ae.flowing&&ae.length===0&&!ae.sync?(ae.awaitDrain=0,ie.emit("data",Y)):(ae.length+=ae.objectMode?1:Y.length,k?ae.buffer.unshift(Y):ae.buffer.push(Y),ae.needReadable&&Dt(ie)),qe(ie,ae)}function Lt(ie,ae){var Y;return!y(ae)&&typeof ae!="string"&&ae!==void 0&&!ie.objectMode&&(Y=new O("chunk",["string","Buffer","Uint8Array"],ae)),Y}Ie.prototype.isPaused=function(){return this._readableState.flowing===!1},Ie.prototype.setEncoding=function(ie){F||(F=i("string_decoder/").StringDecoder);var ae=new F(ie);this._readableState.decoder=ae,this._readableState.encoding=this._readableState.decoder.encoding;for(var Y=this._readableState.buffer.head,k="";Y!==null;)k+=ae.write(Y.data),Y=Y.next;return this._readableState.buffer.clear(),k!==""&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var _e=1073741824;function Et(ie){return ie>=_e?ie=_e:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function Cn(ie,ae){return ie<=0||ae.length===0&&ae.ended?0:ae.objectMode?1:ie!==ie?ae.flowing&&ae.length?ae.buffer.head.data.length:ae.length:(ie>ae.highWaterMark&&(ae.highWaterMark=Et(ie)),ie<=ae.length?ie:ae.ended?ae.length:(ae.needReadable=!0,0))}Ie.prototype.read=function(ie){b("read",ie),ie=parseInt(ie,10);var ae=this._readableState,Y=ie;if(ie!==0&&(ae.emittedReadable=!1),ie===0&&ae.needReadable&&((ae.highWaterMark!==0?ae.length>=ae.highWaterMark:ae.length>0)||ae.ended))return b("read: emitReadable",ae.length,ae.ended),ae.length===0&&ae.ended?kt(this):Dt(this),null;if(ie=Cn(ie,ae),ie===0&&ae.ended)return ae.length===0&&kt(this),null;var k=ae.needReadable;b("need readable",k),(ae.length===0||ae.length-ie<ae.highWaterMark)&&(k=!0,b("length less than watermark",k)),ae.ended||ae.reading?(k=!1,b("reading or ended",k)):k&&(b("do read"),ae.reading=!0,ae.sync=!0,ae.length===0&&(ae.needReadable=!0),this._read(ae.highWaterMark),ae.sync=!1,ae.reading||(ie=Cn(Y,ae)));var D;return ie>0?D=Oe(ie,ae):D=null,D===null?(ae.needReadable=ae.length<=ae.highWaterMark,ie=0):(ae.length-=ie,ae.awaitDrain=0),ae.length===0&&(ae.ended||(ae.needReadable=!0),Y!==ie&&ae.ended&&kt(this)),D!==null&&this.emit("data",D),D};function vn(ie,ae){if(b("onEofChunk"),!ae.ended){if(ae.decoder){var Y=ae.decoder.end();Y&&Y.length&&(ae.buffer.push(Y),ae.length+=ae.objectMode?1:Y.length)}ae.ended=!0,ae.sync?Dt(ie):(ae.needReadable=!1,ae.emittedReadable||(ae.emittedReadable=!0,de(ie)))}}function Dt(ie){var ae=ie._readableState;b("emitReadable",ae.needReadable,ae.emittedReadable),ae.needReadable=!1,ae.emittedReadable||(b("emitReadable",ae.flowing),ae.emittedReadable=!0,u.nextTick(de,ie))}function de(ie){var ae=ie._readableState;b("emitReadable_",ae.destroyed,ae.length,ae.ended),!ae.destroyed&&(ae.length||ae.ended)&&(ie.emit("readable"),ae.emittedReadable=!1),ae.needReadable=!ae.flowing&&!ae.ended&&ae.length<=ae.highWaterMark,Ne(ie)}function qe(ie,ae){ae.readingMore||(ae.readingMore=!0,u.nextTick(Pt,ie,ae))}function Pt(ie,ae){for(;!ae.reading&&!ae.ended&&(ae.length<ae.highWaterMark||ae.flowing&&ae.length===0);){var Y=ae.length;if(b("maybeReadMore read 0"),ie.read(0),Y===ae.length)break}ae.readingMore=!1}Ie.prototype._read=function(ie){z(this,new M("_read()"))},Ie.prototype.pipe=function(ie,ae){var Y=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=ie;break;case 1:k.pipes=[k.pipes,ie];break;default:k.pipes.push(ie);break}k.pipesCount+=1,b("pipe count=%d opts=%j",k.pipesCount,ae);var D=(!ae||ae.end!==!1)&&ie!==u.stdout&&ie!==u.stderr,oe=D?ze:Sn;k.endEmitted?u.nextTick(oe):Y.once("end",oe),ie.on("unpipe",xe);function xe(xn,Pn){b("onunpipe"),xn===Y&&Pn&&Pn.hasUnpiped===!1&&(Pn.hasUnpiped=!0,Tn())}function ze(){b("onend"),ie.end()}var hn=In(Y);ie.on("drain",hn);var An=!1;function Tn(){b("cleanup"),ie.removeListener("close",Ue),ie.removeListener("finish",En),ie.removeListener("drain",hn),ie.removeListener("error",Ve),ie.removeListener("unpipe",xe),Y.removeListener("end",ze),Y.removeListener("end",Sn),Y.removeListener("data",Rn),An=!0,k.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&hn()}Y.on("data",Rn);function Rn(xn){b("ondata");var Pn=ie.write(xn);b("dest.write",Pn),Pn===!1&&((k.pipesCount===1&&k.pipes===ie||k.pipesCount>1&&_n(k.pipes,ie)!==-1)&&!An&&(b("false write response, pause",k.awaitDrain),k.awaitDrain++),Y.pause())}function Ve(xn){b("onerror",xn),Sn(),ie.removeListener("error",Ve),d(ie,"error")===0&&z(ie,xn)}he(ie,"error",Ve);function Ue(){ie.removeListener("finish",En),Sn()}ie.once("close",Ue);function En(){b("onfinish"),ie.removeListener("close",Ue),Sn()}ie.once("finish",En);function Sn(){b("unpipe"),Y.unpipe(ie)}return ie.emit("pipe",Y),k.flowing||(b("pipe resume"),Y.resume()),ie};function In(ie){return function(){var Y=ie._readableState;b("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&d(ie,"data")&&(Y.flowing=!0,Ne(ie))}}Ie.prototype.unpipe=function(ie){var ae=this._readableState,Y={hasUnpiped:!1};if(ae.pipesCount===0)return this;if(ae.pipesCount===1)return ie&&ie!==ae.pipes?this:(ie||(ie=ae.pipes),ae.pipes=null,ae.pipesCount=0,ae.flowing=!1,ie&&ie.emit("unpipe",this,Y),this);if(!ie){var k=ae.pipes,D=ae.pipesCount;ae.pipes=null,ae.pipesCount=0,ae.flowing=!1;for(var oe=0;oe<D;oe++)k[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var xe=_n(ae.pipes,ie);return xe===-1?this:(ae.pipes.splice(xe,1),ae.pipesCount-=1,ae.pipesCount===1&&(ae.pipes=ae.pipes[0]),ie.emit("unpipe",this,Y),this)},Ie.prototype.on=function(ie,ae){var Y=h.prototype.on.call(this,ie,ae),k=this._readableState;return ie==="data"?(k.readableListening=this.listenerCount("readable")>0,k.flowing!==!1&&this.resume()):ie==="readable"&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,b("on readable",k.length,k.reading),k.length?Dt(this):k.reading||u.nextTick(Ce,this)),Y},Ie.prototype.addListener=Ie.prototype.on,Ie.prototype.removeListener=function(ie,ae){var Y=h.prototype.removeListener.call(this,ie,ae);return ie==="readable"&&u.nextTick($e,this),Y},Ie.prototype.removeAllListeners=function(ie){var ae=h.prototype.removeAllListeners.apply(this,arguments);return(ie==="readable"||ie===void 0)&&u.nextTick($e,this),ae};function $e(ie){var ae=ie._readableState;ae.readableListening=ie.listenerCount("readable")>0,ae.resumeScheduled&&!ae.paused?ae.flowing=!0:ie.listenerCount("data")>0&&ie.resume()}function Ce(ie){b("readable nexttick read 0"),ie.read(0)}Ie.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(b("resume"),ie.flowing=!ie.readableListening,ue(this,ie)),ie.paused=!1,this};function ue(ie,ae){ae.resumeScheduled||(ae.resumeScheduled=!0,u.nextTick(At,ie,ae))}function At(ie,ae){b("resume",ae.reading),ae.reading||ie.read(0),ae.resumeScheduled=!1,ie.emit("resume"),Ne(ie),ae.flowing&&!ae.reading&&ie.read(0)}Ie.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ne(ie){var ae=ie._readableState;for(b("flow",ae.flowing);ae.flowing&&ie.read()!==null;);}Ie.prototype.wrap=function(ie){var ae=this,Y=this._readableState,k=!1;ie.on("end",function(){if(b("wrapped end"),Y.decoder&&!Y.ended){var xe=Y.decoder.end();xe&&xe.length&&ae.push(xe)}ae.push(null)}),ie.on("data",function(xe){if(b("wrapped data"),Y.decoder&&(xe=Y.decoder.write(xe)),!(Y.objectMode&&xe==null)&&!(!Y.objectMode&&(!xe||!xe.length))){var ze=ae.push(xe);ze||(k=!0,ie.pause())}});for(var D in ie)this[D]===void 0&&typeof ie[D]=="function"&&(this[D]=function(ze){return function(){return ie[ze].apply(ie,arguments)}}(D));for(var oe=0;oe<$.length;oe++)ie.on($[oe],this.emit.bind(this,$[oe]));return this._read=function(xe){b("wrapped _read",xe),k&&(k=!1,ie.resume())},this},typeof Symbol=="function"&&(Ie.prototype[Symbol.asyncIterator]=function(){return j===void 0&&(j=i("./internal/streams/async_iterator")),j(this)}),Object.defineProperty(Ie.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Ie.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Ie.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ae){this._readableState&&(this._readableState.flowing=ae)}}),Ie._fromList=Oe,Object.defineProperty(Ie.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Oe(ie,ae){if(ae.length===0)return null;var Y;return ae.objectMode?Y=ae.buffer.shift():!ie||ie>=ae.length?(ae.decoder?Y=ae.buffer.join(""):ae.buffer.length===1?Y=ae.buffer.first():Y=ae.buffer.concat(ae.length),ae.buffer.clear()):Y=ae.buffer.consume(ie,ae.decoder),Y}function kt(ie){var ae=ie._readableState;b("endReadable",ae.endEmitted),ae.endEmitted||(ae.ended=!0,u.nextTick(jt,ae,ie))}function jt(ie,ae){if(b("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ae.readable=!1,ae.emit("end"),ie.autoDestroy)){var Y=ae._writableState;(!Y||Y.autoDestroy&&Y.finished)&&ae.destroy()}}typeof Symbol=="function"&&(Ie.from=function(ie,ae){return V===void 0&&(V=i("./internal/streams/from")),V(Ie,ie,ae)});function _n(ie,ae){for(var Y=0,k=ie.length;Y<k;Y++)if(ie[Y]===ae)return Y;return-1}}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/async_iterator":39,"./internal/streams/buffer_list":40,"./internal/streams/destroy":41,"./internal/streams/from":43,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,events:49,inherits:51,"string_decoder/":136,util:26}],37:[function(i,o,a){o.exports=p;var u=i("../errors").codes,c=u.ERR_METHOD_NOT_IMPLEMENTED,f=u.ERR_MULTIPLE_CALLBACK,d=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,h=u.ERR_TRANSFORM_WITH_LENGTH_0,v=i("./_stream_duplex");i("inherits")(p,v);function g(b,A){var w=this._transformState;w.transforming=!1;var T=w.writecb;if(T===null)return this.emit("error",new f);w.writechunk=null,w.writecb=null,A!=null&&this.push(A),T(b);var S=this._readableState;S.reading=!1,(S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}function p(b){if(!(this instanceof p))return new p(b);v.call(this,b),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",y)}function y(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(A,w){_(b,A,w)}):_(this,null,null)}p.prototype.push=function(b,A){return this._transformState.needTransform=!1,v.prototype.push.call(this,b,A)},p.prototype._transform=function(b,A,w){w(new c("_transform()"))},p.prototype._write=function(b,A,w){var T=this._transformState;if(T.writecb=w,T.writechunk=b,T.writeencoding=A,!T.transforming){var S=this._readableState;(T.needTransform||S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}},p.prototype._read=function(b){var A=this._transformState;A.writechunk!==null&&!A.transforming?(A.transforming=!0,this._transform(A.writechunk,A.writeencoding,A.afterTransform)):A.needTransform=!0},p.prototype._destroy=function(b,A){v.prototype._destroy.call(this,b,function(w){A(w)})};function _(b,A,w){if(A)return b.emit("error",A);if(w!=null&&b.push(w),b._writableState.length)throw new h;if(b._transformState.transforming)throw new d;return b.push(null)}},{"../errors":33,"./_stream_duplex":34,inherits:51}],38:[function(i,o,a){(function(u,c){(function(){o.exports=le;function f(Ne){var Oe=this;this.next=null,this.entry=null,this.finish=function(){At(Oe,Ne)}}var d;le.WritableState=$;var h={deprecate:i("util-deprecate")},v=i("./internal/streams/stream"),g=i("buffer").Buffer,p=c.Uint8Array||function(){};function y(Ne){return g.from(Ne)}function _(Ne){return g.isBuffer(Ne)||Ne instanceof p}var b=i("./internal/streams/destroy"),A=i("./internal/streams/state"),w=A.getHighWaterMark,T=i("../errors").codes,S=T.ERR_INVALID_ARG_TYPE,x=T.ERR_METHOD_NOT_IMPLEMENTED,O=T.ERR_MULTIPLE_CALLBACK,L=T.ERR_STREAM_CANNOT_PIPE,M=T.ERR_STREAM_DESTROYED,re=T.ERR_STREAM_NULL_VALUES,F=T.ERR_STREAM_WRITE_AFTER_END,j=T.ERR_UNKNOWN_ENCODING,V=b.errorOrDestroy;i("inherits")(le,v);function z(){}function $(Ne,Oe,kt){d=d||i("./_stream_duplex"),Ne=Ne||{},typeof kt!="boolean"&&(kt=Oe instanceof d),this.objectMode=!!Ne.objectMode,kt&&(this.objectMode=this.objectMode||!!Ne.writableObjectMode),this.highWaterMark=w(this,Ne,"writableHighWaterMark",kt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var jt=Ne.decodeStrings===!1;this.decodeStrings=!jt,this.defaultEncoding=Ne.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(_n){vn(Oe,_n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ne.emitClose!==!1,this.autoDestroy=!!Ne.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}$.prototype.getBuffer=function(){for(var Oe=this.bufferedRequest,kt=[];Oe;)kt.push(Oe),Oe=Oe.next;return kt},function(){try{Object.defineProperty($.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var he;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(he=Function.prototype[Symbol.hasInstance],Object.defineProperty(le,Symbol.hasInstance,{value:function(Oe){return he.call(this,Oe)?!0:this!==le?!1:Oe&&Oe._writableState instanceof $}})):he=function(Oe){return Oe instanceof this};function le(Ne){d=d||i("./_stream_duplex");var Oe=this instanceof d;if(!Oe&&!he.call(le,this))return new le(Ne);this._writableState=new $(Ne,this,Oe),this.writable=!0,Ne&&(typeof Ne.write=="function"&&(this._write=Ne.write),typeof Ne.writev=="function"&&(this._writev=Ne.writev),typeof Ne.destroy=="function"&&(this._destroy=Ne.destroy),typeof Ne.final=="function"&&(this._final=Ne.final)),v.call(this)}le.prototype.pipe=function(){V(this,new L)};function Ie(Ne,Oe){var kt=new F;V(Ne,kt),u.nextTick(Oe,kt)}function Fe(Ne,Oe,kt,jt){var _n;return kt===null?_n=new re:typeof kt!="string"&&!Oe.objectMode&&(_n=new S("chunk",["string","Buffer"],kt)),_n?(V(Ne,_n),u.nextTick(jt,_n),!1):!0}le.prototype.write=function(Ne,Oe,kt){var jt=this._writableState,_n=!1,ie=!jt.objectMode&&_(Ne);return ie&&!g.isBuffer(Ne)&&(Ne=y(Ne)),typeof Oe=="function"&&(kt=Oe,Oe=null),ie?Oe="buffer":Oe||(Oe=jt.defaultEncoding),typeof kt!="function"&&(kt=z),jt.ending?Ie(this,kt):(ie||Fe(this,jt,Ne,kt))&&(jt.pendingcb++,_n=Lt(this,jt,ie,Ne,Oe,kt)),_n},le.prototype.cork=function(){this._writableState.corked++},le.prototype.uncork=function(){var Ne=this._writableState;Ne.corked&&(Ne.corked--,!Ne.writing&&!Ne.corked&&!Ne.bufferProcessing&&Ne.bufferedRequest&&qe(this,Ne))},le.prototype.setDefaultEncoding=function(Oe){if(typeof Oe=="string"&&(Oe=Oe.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Oe+"").toLowerCase())>-1))throw new j(Oe);return this._writableState.defaultEncoding=Oe,this},Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function pe(Ne,Oe,kt){return!Ne.objectMode&&Ne.decodeStrings!==!1&&typeof Oe=="string"&&(Oe=g.from(Oe,kt)),Oe}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Lt(Ne,Oe,kt,jt,_n,ie){if(!kt){var ae=pe(Oe,jt,_n);jt!==ae&&(kt=!0,_n="buffer",jt=ae)}var Y=Oe.objectMode?1:jt.length;Oe.length+=Y;var k=Oe.length<Oe.highWaterMark;if(k||(Oe.needDrain=!0),Oe.writing||Oe.corked){var D=Oe.lastBufferedRequest;Oe.lastBufferedRequest={chunk:jt,encoding:_n,isBuf:kt,callback:ie,next:null},D?D.next=Oe.lastBufferedRequest:Oe.bufferedRequest=Oe.lastBufferedRequest,Oe.bufferedRequestCount+=1}else _e(Ne,Oe,!1,Y,jt,_n,ie);return k}function _e(Ne,Oe,kt,jt,_n,ie,ae){Oe.writelen=jt,Oe.writecb=ae,Oe.writing=!0,Oe.sync=!0,Oe.destroyed?Oe.onwrite(new M("write")):kt?Ne._writev(_n,Oe.onwrite):Ne._write(_n,ie,Oe.onwrite),Oe.sync=!1}function Et(Ne,Oe,kt,jt,_n){--Oe.pendingcb,kt?(u.nextTick(_n,jt),u.nextTick(Ce,Ne,Oe),Ne._writableState.errorEmitted=!0,V(Ne,jt)):(_n(jt),Ne._writableState.errorEmitted=!0,V(Ne,jt),Ce(Ne,Oe))}function Cn(Ne){Ne.writing=!1,Ne.writecb=null,Ne.length-=Ne.writelen,Ne.writelen=0}function vn(Ne,Oe){var kt=Ne._writableState,jt=kt.sync,_n=kt.writecb;if(typeof _n!="function")throw new O;if(Cn(kt),Oe)Et(Ne,kt,jt,Oe,_n);else{var ie=Pt(kt)||Ne.destroyed;!ie&&!kt.corked&&!kt.bufferProcessing&&kt.bufferedRequest&&qe(Ne,kt),jt?u.nextTick(Dt,Ne,kt,ie,_n):Dt(Ne,kt,ie,_n)}}function Dt(Ne,Oe,kt,jt){kt||de(Ne,Oe),Oe.pendingcb--,jt(),Ce(Ne,Oe)}function de(Ne,Oe){Oe.length===0&&Oe.needDrain&&(Oe.needDrain=!1,Ne.emit("drain"))}function qe(Ne,Oe){Oe.bufferProcessing=!0;var kt=Oe.bufferedRequest;if(Ne._writev&&kt&&kt.next){var jt=Oe.bufferedRequestCount,_n=new Array(jt),ie=Oe.corkedRequestsFree;ie.entry=kt;for(var ae=0,Y=!0;kt;)_n[ae]=kt,kt.isBuf||(Y=!1),kt=kt.next,ae+=1;_n.allBuffers=Y,_e(Ne,Oe,!0,Oe.length,_n,"",ie.finish),Oe.pendingcb++,Oe.lastBufferedRequest=null,ie.next?(Oe.corkedRequestsFree=ie.next,ie.next=null):Oe.corkedRequestsFree=new f(Oe),Oe.bufferedRequestCount=0}else{for(;kt;){var k=kt.chunk,D=kt.encoding,oe=kt.callback,xe=Oe.objectMode?1:k.length;if(_e(Ne,Oe,!1,xe,k,D,oe),kt=kt.next,Oe.bufferedRequestCount--,Oe.writing)break}kt===null&&(Oe.lastBufferedRequest=null)}Oe.bufferedRequest=kt,Oe.bufferProcessing=!1}le.prototype._write=function(Ne,Oe,kt){kt(new x("_write()"))},le.prototype._writev=null,le.prototype.end=function(Ne,Oe,kt){var jt=this._writableState;return typeof Ne=="function"?(kt=Ne,Ne=null,Oe=null):typeof Oe=="function"&&(kt=Oe,Oe=null),Ne!=null&&this.write(Ne,Oe),jt.corked&&(jt.corked=1,this.uncork()),jt.ending||ue(this,jt,kt),this},Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Pt(Ne){return Ne.ending&&Ne.length===0&&Ne.bufferedRequest===null&&!Ne.finished&&!Ne.writing}function In(Ne,Oe){Ne._final(function(kt){Oe.pendingcb--,kt&&V(Ne,kt),Oe.prefinished=!0,Ne.emit("prefinish"),Ce(Ne,Oe)})}function $e(Ne,Oe){!Oe.prefinished&&!Oe.finalCalled&&(typeof Ne._final=="function"&&!Oe.destroyed?(Oe.pendingcb++,Oe.finalCalled=!0,u.nextTick(In,Ne,Oe)):(Oe.prefinished=!0,Ne.emit("prefinish")))}function Ce(Ne,Oe){var kt=Pt(Oe);if(kt&&($e(Ne,Oe),Oe.pendingcb===0&&(Oe.finished=!0,Ne.emit("finish"),Oe.autoDestroy))){var jt=Ne._readableState;(!jt||jt.autoDestroy&&jt.endEmitted)&&Ne.destroy()}return kt}function ue(Ne,Oe,kt){Oe.ending=!0,Ce(Ne,Oe),kt&&(Oe.finished?u.nextTick(kt):Ne.once("finish",kt)),Oe.ended=!0,Ne.writable=!1}function At(Ne,Oe,kt){var jt=Ne.entry;for(Ne.entry=null;jt;){var _n=jt.callback;Oe.pendingcb--,_n(kt),jt=jt.next}Oe.corkedRequestsFree.next=Ne}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Oe){this._writableState&&(this._writableState.destroyed=Oe)}}),le.prototype.destroy=b.destroy,le.prototype._undestroy=b.undestroy,le.prototype._destroy=function(Ne,Oe){Oe(Ne)}}).call(this)}).call(this,i("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/destroy":41,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,inherits:51,"util-deprecate":139}],39:[function(i,o,a){(function(u){(function(){var c;function f(M,re,F){return re in M?Object.defineProperty(M,re,{value:F,enumerable:!0,configurable:!0,writable:!0}):M[re]=F,M}var d=i("./end-of-stream"),h=Symbol("lastResolve"),v=Symbol("lastReject"),g=Symbol("error"),p=Symbol("ended"),y=Symbol("lastPromise"),_=Symbol("handlePromise"),b=Symbol("stream");function A(M,re){return{value:M,done:re}}function w(M){var re=M[h];if(re!==null){var F=M[b].read();F!==null&&(M[y]=null,M[h]=null,M[v]=null,re(A(F,!1)))}}function T(M){u.nextTick(w,M)}function S(M,re){return function(F,j){M.then(function(){if(re[p]){F(A(void 0,!0));return}re[_](F,j)},j)}}var x=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((c={get stream(){return this[b]},next:function(){var re=this,F=this[g];if(F!==null)return Promise.reject(F);if(this[p])return Promise.resolve(A(void 0,!0));if(this[b].destroyed)return new Promise(function($,he){u.nextTick(function(){re[g]?he(re[g]):$(A(void 0,!0))})});var j=this[y],V;if(j)V=new Promise(S(j,this));else{var z=this[b].read();if(z!==null)return Promise.resolve(A(z,!1));V=new Promise(this[_])}return this[y]=V,V}},f(c,Symbol.asyncIterator,function(){return this}),f(c,"return",function(){var re=this;return new Promise(function(F,j){re[b].destroy(null,function(V){if(V){j(V);return}F(A(void 0,!0))})})}),c),x),L=function(re){var F,j=Object.create(O,(F={},f(F,b,{value:re,writable:!0}),f(F,h,{value:null,writable:!0}),f(F,v,{value:null,writable:!0}),f(F,g,{value:null,writable:!0}),f(F,p,{value:re._readableState.endEmitted,writable:!0}),f(F,_,{value:function(z,$){var he=j[b].read();he?(j[y]=null,j[h]=null,j[v]=null,z(A(he,!1))):(j[h]=z,j[v]=$)},writable:!0}),F));return j[y]=null,d(re,function(V){if(V&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"){var z=j[v];z!==null&&(j[y]=null,j[h]=null,j[v]=null,z(V)),j[g]=V;return}var $=j[h];$!==null&&(j[y]=null,j[h]=null,j[v]=null,$(A(void 0,!0))),j[p]=!0}),re.on("readable",T.bind(null,j)),j};o.exports=L}).call(this)}).call(this,i("_process"))},{"./end-of-stream":42,_process:102}],40:[function(i,o,a){function u(w,T){var S=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);T&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(w,O).enumerable})),S.push.apply(S,x)}return S}function c(w){for(var T=1;T<arguments.length;T++){var S=arguments[T]!=null?arguments[T]:{};T%2?u(Object(S),!0).forEach(function(x){f(w,x,S[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):u(Object(S)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(S,x))})}return w}function f(w,T,S){return T in w?Object.defineProperty(w,T,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[T]=S,w}function d(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function h(w,T){for(var S=0;S<T.length;S++){var x=T[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}function v(w,T,S){return T&&h(w.prototype,T),S&&h(w,S),w}var g=i("buffer"),p=g.Buffer,y=i("util"),_=y.inspect,b=_&&_.custom||"inspect";function A(w,T,S){p.prototype.copy.call(w,T,S)}o.exports=function(){function w(){d(this,w),this.head=null,this.tail=null,this.length=0}return v(w,[{key:"push",value:function(S){var x={data:S,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(S){var x={data:S,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var x=this.head,O=""+x.data;x=x.next;)O+=S+x.data;return O}},{key:"concat",value:function(S){if(this.length===0)return p.alloc(0);for(var x=p.allocUnsafe(S>>>0),O=this.head,L=0;O;)A(O.data,x,L),L+=O.data.length,O=O.next;return x}},{key:"consume",value:function(S,x){var O;return S<this.head.data.length?(O=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?O=this.shift():O=x?this._getString(S):this._getBuffer(S),O}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var x=this.head,O=1,L=x.data;for(S-=L.length;x=x.next;){var M=x.data,re=S>M.length?M.length:S;if(re===M.length?L+=M:L+=M.slice(0,S),S-=re,S===0){re===M.length?(++O,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=M.slice(re));break}++O}return this.length-=O,L}},{key:"_getBuffer",value:function(S){var x=p.allocUnsafe(S),O=this.head,L=1;for(O.data.copy(x),S-=O.data.length;O=O.next;){var M=O.data,re=S>M.length?M.length:S;if(M.copy(x,x.length-S,0,re),S-=re,S===0){re===M.length?(++L,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=M.slice(re));break}++L}return this.length-=L,x}},{key:b,value:function(S,x){return _(this,c({},x,{depth:0,customInspect:!1}))}}]),w}()},{buffer:29,util:26}],41:[function(i,o,a){(function(u){(function(){function c(p,y){var _=this,b=this._readableState&&this._readableState.destroyed,A=this._writableState&&this._writableState.destroyed;return b||A?(y?y(p):p&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(v,this,p)):u.nextTick(v,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(w){!y&&w?_._writableState?_._writableState.errorEmitted?u.nextTick(d,_):(_._writableState.errorEmitted=!0,u.nextTick(f,_,w)):u.nextTick(f,_,w):y?(u.nextTick(d,_),y(w)):u.nextTick(d,_)}),this)}function f(p,y){v(p,y),d(p)}function d(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function h(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(p,y){p.emit("error",y)}function g(p,y){var _=p._readableState,b=p._writableState;_&&_.autoDestroy||b&&b.autoDestroy?p.destroy(y):p.emit("error",y)}o.exports={destroy:c,undestroy:h,errorOrDestroy:g}}).call(this)}).call(this,i("_process"))},{_process:102}],42:[function(i,o,a){var u=i("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function c(v){var g=!1;return function(){if(!g){g=!0;for(var p=arguments.length,y=new Array(p),_=0;_<p;_++)y[_]=arguments[_];v.apply(this,y)}}}function f(){}function d(v){return v.setHeader&&typeof v.abort=="function"}function h(v,g,p){if(typeof g=="function")return h(v,null,g);g||(g={}),p=c(p||f);var y=g.readable||g.readable!==!1&&v.readable,_=g.writable||g.writable!==!1&&v.writable,b=function(){v.writable||w()},A=v._writableState&&v._writableState.finished,w=function(){_=!1,A=!0,y||p.call(v)},T=v._readableState&&v._readableState.endEmitted,S=function(){y=!1,T=!0,_||p.call(v)},x=function(re){p.call(v,re)},O=function(){var re;if(y&&!T)return(!v._readableState||!v._readableState.ended)&&(re=new u),p.call(v,re);if(_&&!A)return(!v._writableState||!v._writableState.ended)&&(re=new u),p.call(v,re)},L=function(){v.req.on("finish",w)};return d(v)?(v.on("complete",w),v.on("abort",O),v.req?L():v.on("request",L)):_&&!v._writableState&&(v.on("end",b),v.on("close",b)),v.on("end",S),v.on("finish",w),g.error!==!1&&v.on("error",x),v.on("close",O),function(){v.removeListener("complete",w),v.removeListener("abort",O),v.removeListener("request",L),v.req&&v.req.removeListener("finish",w),v.removeListener("end",b),v.removeListener("close",b),v.removeListener("finish",w),v.removeListener("end",S),v.removeListener("error",x),v.removeListener("close",O)}}o.exports=h},{"../../../errors":33}],43:[function(i,o,a){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],44:[function(i,o,a){var u;function c(w){var T=!1;return function(){T||(T=!0,w.apply(void 0,arguments))}}var f=i("../../../errors").codes,d=f.ERR_MISSING_ARGS,h=f.ERR_STREAM_DESTROYED;function v(w){if(w)throw w}function g(w){return w.setHeader&&typeof w.abort=="function"}function p(w,T,S,x){x=c(x);var O=!1;w.on("close",function(){O=!0}),u===void 0&&(u=i("./end-of-stream")),u(w,{readable:T,writable:S},function(M){if(M)return x(M);O=!0,x()});var L=!1;return function(M){if(!O&&!L){if(L=!0,g(w))return w.abort();if(typeof w.destroy=="function")return w.destroy();x(M||new h("pipe"))}}}function y(w){w()}function _(w,T){return w.pipe(T)}function b(w){return!w.length||typeof w[w.length-1]!="function"?v:w.pop()}function A(){for(var w=arguments.length,T=new Array(w),S=0;S<w;S++)T[S]=arguments[S];var x=b(T);if(Array.isArray(T[0])&&(T=T[0]),T.length<2)throw new d("streams");var O,L=T.map(function(M,re){var F=re<T.length-1,j=re>0;return p(M,F,j,function(V){O||(O=V),V&&L.forEach(y),!F&&(L.forEach(y),x(O))})});return T.reduce(_)}o.exports=A},{"../../../errors":33,"./end-of-stream":42}],45:[function(i,o,a){var u=i("../../../errors").codes.ERR_INVALID_OPT_VALUE;function c(d,h,v){return d.highWaterMark!=null?d.highWaterMark:h?d[v]:null}function f(d,h,v,g){var p=c(h,g,v);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var y=g?v:"highWaterMark";throw new u(y,p)}return Math.floor(p)}return d.objectMode?16:16*1024}o.exports={getHighWaterMark:f}},{"../../../errors":33}],46:[function(i,o,a){o.exports=i("events").EventEmitter},{events:49}],47:[function(i,o,a){a=o.exports=i("./lib/_stream_readable.js"),a.Stream=a,a.Readable=a,a.Writable=i("./lib/_stream_writable.js"),a.Duplex=i("./lib/_stream_duplex.js"),a.Transform=i("./lib/_stream_transform.js"),a.PassThrough=i("./lib/_stream_passthrough.js"),a.finished=i("./lib/internal/streams/end-of-stream.js"),a.pipeline=i("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":34,"./lib/_stream_passthrough.js":35,"./lib/_stream_readable.js":36,"./lib/_stream_transform.js":37,"./lib/_stream_writable.js":38,"./lib/internal/streams/end-of-stream.js":42,"./lib/internal/streams/pipeline.js":44}],48:[function(i,o,a){(function(u){(function(){var c=i("once"),f=function(){},d=function(g){return g.setHeader&&typeof g.abort=="function"},h=function(g){return g.stdio&&Array.isArray(g.stdio)&&g.stdio.length===3},v=function(g,p,y){if(typeof p=="function")return v(g,null,p);p||(p={}),y=c(y||f);var _=g._writableState,b=g._readableState,A=p.readable||p.readable!==!1&&g.readable,w=p.writable||p.writable!==!1&&g.writable,T=!1,S=function(){g.writable||x()},x=function(){w=!1,A||y.call(g)},O=function(){A=!1,w||y.call(g)},L=function(V){y.call(g,V?new Error("exited with error code: "+V):null)},M=function(V){y.call(g,V)},re=function(){u.nextTick(F)},F=function(){if(!T){if(A&&!(b&&b.ended&&!b.destroyed))return y.call(g,new Error("premature close"));if(w&&!(_&&_.ended&&!_.destroyed))return y.call(g,new Error("premature close"))}},j=function(){g.req.on("finish",x)};return d(g)?(g.on("complete",x),g.on("abort",re),g.req?j():g.on("request",j)):w&&!_&&(g.on("end",S),g.on("close",S)),h(g)&&g.on("exit",L),g.on("end",O),g.on("finish",x),p.error!==!1&&g.on("error",M),g.on("close",re),function(){T=!0,g.removeListener("complete",x),g.removeListener("abort",re),g.removeListener("request",j),g.req&&g.req.removeListener("finish",x),g.removeListener("end",S),g.removeListener("close",S),g.removeListener("finish",x),g.removeListener("exit",L),g.removeListener("end",O),g.removeListener("error",M),g.removeListener("close",re)}};o.exports=v}).call(this)}).call(this,i("_process"))},{_process:102,once:100}],49:[function(i,o,a){var u=typeof Reflect=="object"?Reflect:null,c=u&&typeof u.apply=="function"?u.apply:function(j,V,z){return Function.prototype.apply.call(j,V,z)},f;u&&typeof u.ownKeys=="function"?f=u.ownKeys:Object.getOwnPropertySymbols?f=function(j){return Object.getOwnPropertyNames(j).concat(Object.getOwnPropertySymbols(j))}:f=function(j){return Object.getOwnPropertyNames(j)};function d(F){console&&console.warn&&console.warn(F)}var h=Number.isNaN||function(j){return j!==j};function v(){v.init.call(this)}o.exports=v,o.exports.once=L,v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var g=10;function p(F){if(typeof F!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof F)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(F){if(typeof F!="number"||F<0||h(F))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+F+".");g=F}}),v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(j){if(typeof j!="number"||j<0||h(j))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+j+".");return this._maxListeners=j,this};function y(F){return F._maxListeners===void 0?v.defaultMaxListeners:F._maxListeners}v.prototype.getMaxListeners=function(){return y(this)},v.prototype.emit=function(j){for(var V=[],z=1;z<arguments.length;z++)V.push(arguments[z]);var $=j==="error",he=this._events;if(he!==void 0)$=$&&he.error===void 0;else if(!$)return!1;if($){var le;if(V.length>0&&(le=V[0]),le instanceof Error)throw le;var Ie=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw Ie.context=le,Ie}var Fe=he[j];if(Fe===void 0)return!1;if(typeof Fe=="function")c(Fe,this,V);else for(var pe=Fe.length,Lt=S(Fe,pe),z=0;z<pe;++z)c(Lt[z],this,V);return!0};function _(F,j,V,z){var $,he,le;if(p(V),he=F._events,he===void 0?(he=F._events=Object.create(null),F._eventsCount=0):(he.newListener!==void 0&&(F.emit("newListener",j,V.listener?V.listener:V),he=F._events),le=he[j]),le===void 0)le=he[j]=V,++F._eventsCount;else if(typeof le=="function"?le=he[j]=z?[V,le]:[le,V]:z?le.unshift(V):le.push(V),$=y(F),$>0&&le.length>$&&!le.warned){le.warned=!0;var Ie=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ie.name="MaxListenersExceededWarning",Ie.emitter=F,Ie.type=j,Ie.count=le.length,d(Ie)}return F}v.prototype.addListener=function(j,V){return _(this,j,V,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(j,V){return _(this,j,V,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(F,j,V){var z={fired:!1,wrapFn:void 0,target:F,type:j,listener:V},$=b.bind(z);return $.listener=V,z.wrapFn=$,$}v.prototype.once=function(j,V){return p(V),this.on(j,A(this,j,V)),this},v.prototype.prependOnceListener=function(j,V){return p(V),this.prependListener(j,A(this,j,V)),this},v.prototype.removeListener=function(j,V){var z,$,he,le,Ie;if(p(V),$=this._events,$===void 0)return this;if(z=$[j],z===void 0)return this;if(z===V||z.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete $[j],$.removeListener&&this.emit("removeListener",j,z.listener||V));else if(typeof z!="function"){for(he=-1,le=z.length-1;le>=0;le--)if(z[le]===V||z[le].listener===V){Ie=z[le].listener,he=le;break}if(he<0)return this;he===0?z.shift():x(z,he),z.length===1&&($[j]=z[0]),$.removeListener!==void 0&&this.emit("removeListener",j,Ie||V)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(j){var V,z,$;if(z=this._events,z===void 0)return this;if(z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):z[j]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete z[j]),this;if(arguments.length===0){var he=Object.keys(z),le;for($=0;$<he.length;++$)le=he[$],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=z[j],typeof V=="function")this.removeListener(j,V);else if(V!==void 0)for($=V.length-1;$>=0;$--)this.removeListener(j,V[$]);return this};function w(F,j,V){var z=F._events;if(z===void 0)return[];var $=z[j];return $===void 0?[]:typeof $=="function"?V?[$.listener||$]:[$]:V?O($):S($,$.length)}v.prototype.listeners=function(j){return w(this,j,!0)},v.prototype.rawListeners=function(j){return w(this,j,!1)},v.listenerCount=function(F,j){return typeof F.listenerCount=="function"?F.listenerCount(j):T.call(F,j)},v.prototype.listenerCount=T;function T(F){var j=this._events;if(j!==void 0){var V=j[F];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function S(F,j){for(var V=new Array(j),z=0;z<j;++z)V[z]=F[z];return V}function x(F,j){for(;j+1<F.length;j++)F[j]=F[j+1];F.pop()}function O(F){for(var j=new Array(F.length),V=0;V<j.length;++V)j[V]=F[V].listener||F[V];return j}function L(F,j){return new Promise(function(V,z){function $(le){F.removeListener(j,he),z(le)}function he(){typeof F.removeListener=="function"&&F.removeListener("error",$),V([].slice.call(arguments))}re(F,j,he,{once:!0}),j!=="error"&&M(F,$,{once:!0})})}function M(F,j,V){typeof F.on=="function"&&re(F,"error",j,V)}function re(F,j,V,z){if(typeof F.on=="function")z.once?F.once(j,V):F.on(j,V);else if(typeof F.addEventListener=="function")F.addEventListener(j,function $(he){z.once&&F.removeEventListener(j,$),V(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof F)}},{}],50:[function(i,o,a){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */a.read=function(u,c,f,d,h){var v,g,p=h*8-d-1,y=(1<<p)-1,_=y>>1,b=-7,A=f?h-1:0,w=f?-1:1,T=u[c+A];for(A+=w,v=T&(1<<-b)-1,T>>=-b,b+=p;b>0;v=v*256+u[c+A],A+=w,b-=8);for(g=v&(1<<-b)-1,v>>=-b,b+=d;b>0;g=g*256+u[c+A],A+=w,b-=8);if(v===0)v=1-_;else{if(v===y)return g?NaN:(T?-1:1)*(1/0);g=g+Math.pow(2,d),v=v-_}return(T?-1:1)*g*Math.pow(2,v-d)},a.write=function(u,c,f,d,h,v){var g,p,y,_=v*8-h-1,b=(1<<_)-1,A=b>>1,w=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=d?0:v-1,S=d?1:-1,x=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(p=isNaN(c)?1:0,g=b):(g=Math.floor(Math.log(c)/Math.LN2),c*(y=Math.pow(2,-g))<1&&(g--,y*=2),g+A>=1?c+=w/y:c+=w*Math.pow(2,1-A),c*y>=2&&(g++,y/=2),g+A>=b?(p=0,g=b):g+A>=1?(p=(c*y-1)*Math.pow(2,h),g=g+A):(p=c*Math.pow(2,A-1)*Math.pow(2,h),g=0));h>=8;u[f+T]=p&255,T+=S,p/=256,h-=8);for(g=g<<h|p,_+=h;_>0;u[f+T]=g&255,T+=S,g/=256,_-=8);u[f+T-S]|=x*128}},{}],51:[function(i,o,a){typeof Object.create=="function"?o.exports=function(c,f){f&&(c.super_=f,c.prototype=Object.create(f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(c,f){if(f){c.super_=f;var d=function(){};d.prototype=f.prototype,c.prototype=new d,c.prototype.constructor=c}}},{}],52:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.ContainerIterator=a.Container=a.Base=void 0;class u{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}}a.ContainerIterator=u;class c{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}a.Base=c;class f extends c{}a.Container=f},{}],53:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.HashContainerIterator=a.HashContainer=void 0;var u=i("../../ContainerBase"),c=d(i("../../../utils/checkObject")),f=i("../../../utils/throwError");function d(g){return g&&g.t?g:{default:g}}class h extends u.ContainerIterator{constructor(p,y,_){super(_),this.o=p,this.h=y,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this})}}a.HashContainerIterator=h;class v extends u.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(p){const{L:y,B:_}=p;y.B=_,_.L=y,p===this.p&&(this.p=_),p===this._&&(this._=y),this.i-=1}M(p,y,_){_===void 0&&(_=(0,c.default)(p));let b;if(_){const A=p[this.HASH_TAG];if(A!==void 0)return this.H[A].l=y,this.i;Object.defineProperty(p,this.HASH_TAG,{value:this.H.length,configurable:!0}),b={u:p,l:y,L:this._,B:this.h},this.H.push(b)}else{const A=this.g[p];if(A)return A.l=y,this.i;b={u:p,l:y,L:this._,B:this.h},this.g[p]=b}return this.i===0?(this.p=b,this.h.B=b):this._.B=b,this._=b,this.h.L=b,++this.i}I(p,y){if(y===void 0&&(y=(0,c.default)(p)),y){const _=p[this.HASH_TAG];return _===void 0?this.h:this.H[_]}else return this.g[p]||this.h}clear(){const p=this.HASH_TAG;this.H.forEach(function(y){delete y.u[p]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(p,y){let _;if(y===void 0&&(y=(0,c.default)(p)),y){const b=p[this.HASH_TAG];if(b===void 0)return!1;delete p[this.HASH_TAG],_=this.H[b],delete this.H[b]}else{if(_=this.g[p],_===void 0)return!1;delete this.g[p]}return this.V(_),!0}eraseElementByIterator(p){const y=p.o;return y===this.h&&(0,f.throwIteratorAccessError)(),this.V(y),p.next()}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;let y=this.p;for(;p--;)y=y.B;return this.V(y),this.i}}a.HashContainer=v},{"../../../utils/checkObject":70,"../../../utils/throwError":71,"../../ContainerBase":52}],54:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./Base"),c=d(i("../../utils/checkObject")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends u.HashContainerIterator{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){this.o===this.h&&(0,f.throwIteratorAccessError)();const y=this;return new Proxy([],{get(_,b){if(b==="0")return y.o.u;if(b==="1")return y.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return y.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.HashContainer{constructor(y=[]){super();const _=this;y.forEach(function(b){_.setElement(b[0],b[1])})}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(y,_,b){return this.M(y,_,b)}getElementByKey(y,_){if(_===void 0&&(_=(0,c.default)(y)),_){const A=y[this.HASH_TAG];return A!==void 0?this.H[A].l:void 0}const b=this.g[y];return b?b.l:void 0}getElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return[_.u,_.l]}find(y,_){const b=this.I(y,_);return new h(b,this.h,this)}forEach(y){let _=0,b=this.p;for(;b!==this.h;)y([b.u,b.l],_++,this),b=b.B}[Symbol.iterator](){return function*(){let y=this.p;for(;y!==this.h;)yield[y.u,y.l],y=y.B}.bind(this)()}}var g=v;a.default=g},{"../../utils/checkObject":70,"../../utils/throwError":71,"./Base":53}],55:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./Base"),c=i("../../utils/throwError");class f extends u.HashContainerIterator{constructor(g,p,y,_){super(g,p,_),this.container=y}get pointer(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o.u}copy(){return new f(this.o,this.h,this.container,this.iteratorType)}}class d extends u.HashContainer{constructor(g=[]){super();const p=this;g.forEach(function(y){p.insert(y)})}begin(){return new f(this.p,this.h,this)}end(){return new f(this.h,this.h,this)}rBegin(){return new f(this._,this.h,this,1)}rEnd(){return new f(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(g,p){return this.M(g,void 0,p)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=this.p;for(;g--;)p=p.B;return p.u}find(g,p){const y=this.I(g,p);return new f(y,this.h,this)}forEach(g){let p=0,y=this.p;for(;y!==this.h;)g(y.u,p++,this),y=y.B}[Symbol.iterator](){return function*(){let g=this.p;for(;g!==this.h;)yield g.u,g=g.B}.bind(this)()}}var h=d;a.default=h},{"../../utils/throwError":71,"./Base":53}],56:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[],v=function(p,y){return p>y?-1:p<y?1:0},g=!0){if(super(),this.v=v,Array.isArray(h))this.C=g?[...h]:h;else{this.C=[];const y=this;h.forEach(function(_){y.C.push(_)})}this.i=this.C.length;const p=this.i>>1;for(let y=this.i-1>>1;y>=0;--y)this.k(y,p)}m(h){const v=this.C[h];for(;h>0;){const g=h-1>>1,p=this.C[g];if(this.v(p,v)<=0)break;this.C[h]=p,h=g}this.C[h]=v}k(h,v){const g=this.C[h];for(;h<v;){let p=h<<1|1;const y=p+1;let _=this.C[p];if(y<this.i&&this.v(_,this.C[y])>0&&(p=y,_=this.C[y]),this.v(_,g)>=0)break;this.C[h]=_,h=p}this.C[h]=g}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;const h=this.C[0],v=this.C.pop();return this.i-=1,this.i&&(this.C[0]=v,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){const v=this.C.indexOf(h);return v<0?!1:(v===0?this.pop():v===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(v,1,this.C.pop()),this.i-=1,this.m(v),this.k(v,this.i>>1)),!0)}updateItem(h){const v=this.C.indexOf(h);return v<0?!1:(this.m(v),this.k(v,this.i>>1),!0)}toArray(){return[...this.C]}}var f=c;a.default=f},{"../ContainerBase":52}],57:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.j=0,this.q=[];const v=this;h.forEach(function(g){v.push(g)})}clear(){this.q=[],this.i=this.j=0}push(h){const v=this.q.length;if(this.j/v>.5&&this.j+this.i>=v&&v>4096){const g=this.i;for(let p=0;p<g;++p)this.q[p]=this.q[this.j+p];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;const h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}}var f=c;a.default=f},{"../ContainerBase":52}],58:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.S=[];const v=this;h.forEach(function(g){v.push(g)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}}var f=c;a.default=f},{"../ContainerBase":52}],59:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.RandomIterator=void 0;var u=i("../../ContainerBase"),c=i("../../../utils/throwError");class f extends u.ContainerIterator{constructor(h,v){super(v),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,c.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,c.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,c.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,c.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}}a.RandomIterator=f},{"../../../utils/throwError":71,"../../ContainerBase":52}],60:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../../ContainerBase");class c extends u.Container{}var f=c;a.default=f},{"../../ContainerBase":52}],61:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(i("./Base")),c=i("./Base/RandomIterator");function f(g){return g&&g.t?g:{default:g}}class d extends c.RandomIterator{constructor(p,y,_){super(p,_),this.container=y}copy(){return new d(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],y=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];const _=(()=>{if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size;if(typeof p.size=="function")return p.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=y,this.P=Math.max(Math.ceil(_/this.F),1);for(let w=0;w<this.P;++w)this.A.push(new Array(this.F));const b=Math.ceil(_/this.F);this.j=this.R=(this.P>>1)-(b>>1),this.D=this.N=this.F-_%this.F>>1;const A=this;p.forEach(function(w){A.pushBack(w)})}T(){const p=[],y=Math.max(this.P>>1,1);for(let _=0;_<y;++_)p[_]=new Array(this.F);for(let _=this.j;_<this.P;++_)p[p.length]=this.A[_];for(let _=0;_<this.R;++_)p[p.length]=this.A[_];p[p.length]=[...this.A[this.R]],this.j=y,this.R=p.length-1;for(let _=0;_<y;++_)p[p.length]=new Array(this.F);this.A=p,this.P=p.length}O(p){const y=this.D+p+1,_=y%this.F;let b=_-1,A=this.j+(y-_)/this.F;return _===0&&(A-=1),A%=this.P,b<0&&(b+=this.F),{curNodeBucketIndex:A,curNodePointerIndex:b}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new d(0,this)}end(){return new d(this.i,this)}rBegin(){return new d(this.i-1,this,1)}rEnd(){return new d(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(p){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=p,this.i}popBack(){if(this.i===0)return;const p=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,p}pushFront(p){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=p,this.i}popFront(){if(this.i===0)return;const p=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,p}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:y,curNodePointerIndex:_}=this.O(p);return this.A[y][_]}setElementByPos(p,y){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:_,curNodePointerIndex:b}=this.O(p);this.A[_][b]=y}insert(p,y,_=1){if(p<0||p>this.i)throw new RangeError;if(p===0)for(;_--;)this.pushFront(y);else if(p===this.i)for(;_--;)this.pushBack(y);else{const b=[];for(let A=p;A<this.i;++A)b.push(this.getElementByPos(A));this.cut(p-1);for(let A=0;A<_;++A)this.pushBack(y);for(let A=0;A<b.length;++A)this.pushBack(b[A])}return this.i}cut(p){if(p<0)return this.clear(),0;const{curNodeBucketIndex:y,curNodePointerIndex:_}=this.O(p);return this.R=y,this.N=_,this.i=p+1,this.i}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;if(p===0)this.popFront();else if(p===this.i-1)this.popBack();else{const y=[];for(let b=p+1;b<this.i;++b)y.push(this.getElementByPos(b));this.cut(p),this.popBack();const _=this;y.forEach(function(b){_.pushBack(b)})}return this.i}eraseElementByValue(p){if(this.i===0)return 0;const y=[];for(let b=0;b<this.i;++b){const A=this.getElementByPos(b);A!==p&&y.push(A)}const _=y.length;for(let b=0;b<_;++b)this.setElementByPos(b,y[b]);return this.cut(_-1)}eraseElementByIterator(p){const y=p.o;return this.eraseElementByPos(y),p=p.next(),p}find(p){for(let y=0;y<this.i;++y)if(this.getElementByPos(y)===p)return new d(y,this);return this.end()}reverse(){let p=0,y=this.i-1;for(;p<y;){const _=this.getElementByPos(p);this.setElementByPos(p,this.getElementByPos(y)),this.setElementByPos(y,_),p+=1,y-=1}}unique(){if(this.i<=1)return this.i;let p=1,y=this.getElementByPos(0);for(let _=1;_<this.i;++_){const b=this.getElementByPos(_);b!==y&&(y=b,this.setElementByPos(p++,b))}for(;this.i>p;)this.popBack();return this.i}sort(p){const y=[];for(let _=0;_<this.i;++_)y.push(this.getElementByPos(_));y.sort(p);for(let _=0;_<this.i;++_)this.setElementByPos(_,y[_])}shrinkToFit(){if(this.i===0)return;const p=[];this.forEach(function(y){p.push(y)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let y=0;y<this.P;++y)this.A.push(new Array(this.F));for(let y=0;y<p.length;++y)this.pushBack(p[y])}forEach(p){for(let y=0;y<this.i;++y)p(this.getElementByPos(y),y,this)}[Symbol.iterator](){return function*(){for(let p=0;p<this.i;++p)yield this.getElementByPos(p)}.bind(this)()}}var v=h;a.default=v},{"./Base":60,"./Base/RandomIterator":59}],62:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=i("../ContainerBase"),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.ContainerIterator{constructor(y,_,b,A){super(A),this.o=y,this.h=_,this.container=b,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.l}set pointer(y){this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.l=y}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;const _=this;y.forEach(function(b){_.pushBack(b)})}V(y){const{L:_,B:b}=y;_.B=b,b.L=_,y===this.p&&(this.p=b),y===this._&&(this._=_),this.i-=1}G(y,_){const b=_.B,A={l:y,L:_,B:b};_.B=A,b.L=A,_===this.h&&(this.p=A),b===this.h&&(this._=A),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return _.l}eraseElementByPos(y){if(y<0||y>this.i-1)throw new RangeError;let _=this.p;for(;y--;)_=_.B;return this.V(_),this.i}eraseElementByValue(y){let _=this.p;for(;_!==this.h;)_.l===y&&this.V(_),_=_.B;return this.i}eraseElementByIterator(y){const _=y.o;return _===this.h&&(0,f.throwIteratorAccessError)(),y=y.next(),this.V(_),y}pushBack(y){return this.G(y,this._),this.i}popBack(){if(this.i===0)return;const y=this._.l;return this.V(this._),y}pushFront(y){return this.G(y,this.h),this.i}popFront(){if(this.i===0)return;const y=this.p.l;return this.V(this.p),y}setElementByPos(y,_){if(y<0||y>this.i-1)throw new RangeError;let b=this.p;for(;y--;)b=b.B;b.l=_}insert(y,_,b=1){if(y<0||y>this.i)throw new RangeError;if(b<=0)return this.i;if(y===0)for(;b--;)this.pushFront(_);else if(y===this.i)for(;b--;)this.pushBack(_);else{let A=this.p;for(let T=1;T<y;++T)A=A.B;const w=A.B;for(this.i+=b;b--;)A.B={l:_,L:A},A.B.L=A,A=A.B;A.B=w,w.L=A}return this.i}find(y){let _=this.p;for(;_!==this.h;){if(_.l===y)return new h(_,this.h,this);_=_.B}return this.end()}reverse(){if(this.i<=1)return;let y=this.p,_=this._,b=0;for(;b<<1<this.i;){const A=y.l;y.l=_.l,_.l=A,y=y.B,_=_.L,b+=1}}unique(){if(this.i<=1)return this.i;let y=this.p;for(;y!==this.h;){let _=y;for(;_.B!==this.h&&_.l===_.B.l;)_=_.B,this.i-=1;y.B=_.B,y.B.L=y,y=y.B}return this.i}sort(y){if(this.i<=1)return;const _=[];this.forEach(function(A){_.push(A)}),_.sort(y);let b=this.p;_.forEach(function(A){b.l=A,b=b.B})}merge(y){const _=this;if(this.i===0)y.forEach(function(b){_.pushBack(b)});else{let b=this.p;y.forEach(function(A){for(;b!==_.h&&b.l<=A;)b=b.B;_.G(A,b.L)})}return this.i}forEach(y){let _=this.p,b=0;for(;_!==this.h;)y(_.l,b++,this),_=_.B}[Symbol.iterator](){return function*(){if(this.i===0)return;let y=this.p;for(;y!==this.h;)yield y.l,y=y.B}.bind(this)()}}var g=v;a.default=g},{"../../utils/throwError":71,"../ContainerBase":52,"./Base":60}],63:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(i("./Base")),c=i("./Base/RandomIterator");function f(g){return g&&g.t?g:{default:g}}class d extends c.RandomIterator{constructor(p,y,_){super(p,_),this.container=y}copy(){return new d(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],y=!0){if(super(),Array.isArray(p))this.J=y?[...p]:p,this.i=p.length;else{this.J=[];const _=this;p.forEach(function(b){_.pushBack(b)})}}clear(){this.i=0,this.J.length=0}begin(){return new d(0,this)}end(){return new d(this.i,this)}rBegin(){return new d(this.i-1,this,1)}rEnd(){return new d(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J[p]}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J.splice(p,1),this.i-=1,this.i}eraseElementByValue(p){let y=0;for(let _=0;_<this.i;++_)this.J[_]!==p&&(this.J[y++]=this.J[_]);return this.i=this.J.length=y,this.i}eraseElementByIterator(p){const y=p.o;return p=p.next(),this.eraseElementByPos(y),p}pushBack(p){return this.J.push(p),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(p,y){if(p<0||p>this.i-1)throw new RangeError;this.J[p]=y}insert(p,y,_=1){if(p<0||p>this.i)throw new RangeError;return this.J.splice(p,0,...new Array(_).fill(y)),this.i+=_,this.i}find(p){for(let y=0;y<this.i;++y)if(this.J[y]===p)return new d(y,this);return this.end()}reverse(){this.J.reverse()}unique(){let p=1;for(let y=1;y<this.i;++y)this.J[y]!==this.J[y-1]&&(this.J[p++]=this.J[y]);return this.i=this.J.length=p,this.i}sort(p){this.J.sort(p)}forEach(p){for(let y=0;y<this.i;++y)p(this.J[y],y,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}}var v=h;a.default=v},{"./Base":60,"./Base/RandomIterator":59}],64:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("../../ContainerBase"),c=i("../../../utils/throwError");class f extends u.ContainerIterator{constructor(v,g,p){super(p),this.o=v,this.h=g,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let v=this.o;const g=this.h.tt;if(v===this.h)return g?g.rt-1:0;let p=0;for(v.U&&(p+=v.U.rt);v!==g;){const y=v.tt;v===y.W&&(p+=1,y.U&&(p+=y.U.rt)),v=y}return p}}var d=f;a.default=d},{"../../../utils/throwError":71,"../../ContainerBase":52}],65:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.TreeNodeEnableIndex=a.TreeNode=void 0;class u{constructor(d,h){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=d,this.l=h}L(){let d=this;if(d.ee===1&&d.tt.tt===d)d=d.W;else if(d.U)for(d=d.U;d.W;)d=d.W;else{let h=d.tt;for(;h.U===d;)d=h,h=d.tt;d=h}return d}B(){let d=this;if(d.W){for(d=d.W;d.U;)d=d.U;return d}else{let h=d.tt;for(;h.W===d;)d=h,h=d.tt;return d.W!==h?h:d}}te(){const d=this.tt,h=this.W,v=h.U;return d.tt===this?d.tt=h:d.U===this?d.U=h:d.W=h,h.tt=d,h.U=this,this.tt=h,this.W=v,v&&(v.tt=this),h}se(){const d=this.tt,h=this.U,v=h.W;return d.tt===this?d.tt=h:d.U===this?d.U=h:d.W=h,h.tt=d,h.W=this,this.tt=h,this.U=v,v&&(v.tt=this),h}}a.TreeNode=u;class c extends u{constructor(){super(...arguments),this.rt=1}te(){const d=super.te();return this.ie(),d.ie(),d}se(){const d=super.se();return this.ie(),d.ie(),d}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}a.TreeNodeEnableIndex=c},{}],66:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=i("./TreeNode"),c=i("../../ContainerBase"),f=i("../../../utils/throwError");class d extends c.Container{constructor(g=function(y,_){return y<_?-1:y>_?1:0},p=!1){super(),this.Y=void 0,this.v=g,p?(this.re=u.TreeNodeEnableIndex,this.M=function(y,_,b){const A=this.ne(y,_,b);if(A){let w=A.tt;for(;w!==this.h;)w.rt+=1,w=w.tt;const T=this.he(A);if(T){const{parentNode:S,grandParent:x,curNode:O}=T;S.ie(),x.ie(),O.ie()}}return this.i},this.V=function(y){let _=this.fe(y);for(;_!==this.h;)_.rt-=1,_=_.tt}):(this.re=u.TreeNode,this.M=function(y,_,b){const A=this.ne(y,_,b);return A&&this.he(A),this.i},this.V=this.fe),this.h=new this.re}X(g,p){let y=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)g=g.W;else if(_>0)y=g,g=g.U;else return g}return y}Z(g,p){let y=this.h;for(;g;)this.v(g.u,p)<=0?g=g.W:(y=g,g=g.U);return y}$(g,p){let y=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)y=g,g=g.W;else if(_>0)g=g.U;else return g}return y}rr(g,p){let y=this.h;for(;g;)this.v(g.u,p)<0?(y=g,g=g.W):g=g.U;return y}ue(g){for(;;){const p=g.tt;if(p===this.h)return;if(g.ee===1){g.ee=0;return}if(g===p.U){const y=p.W;if(y.ee===1)y.ee=0,p.ee=1,p===this.Y?this.Y=p.te():p.te();else if(y.W&&y.W.ee===1){y.ee=p.ee,p.ee=0,y.W.ee=0,p===this.Y?this.Y=p.te():p.te();return}else y.U&&y.U.ee===1?(y.ee=1,y.U.ee=0,y.se()):(y.ee=1,g=p)}else{const y=p.U;if(y.ee===1)y.ee=0,p.ee=1,p===this.Y?this.Y=p.se():p.se();else if(y.U&&y.U.ee===1){y.ee=p.ee,p.ee=0,y.U.ee=0,p===this.Y?this.Y=p.se():p.se();return}else y.W&&y.W.ee===1?(y.ee=1,y.W.ee=0,y.te()):(y.ee=1,g=p)}}}fe(g){if(this.i===1)return this.clear(),this.h;let p=g;for(;p.U||p.W;){if(p.W)for(p=p.W;p.U;)p=p.U;else p=p.U;[g.u,p.u]=[p.u,g.u],[g.l,p.l]=[p.l,g.l],g=p}this.h.U===p?this.h.U=p.tt:this.h.W===p&&(this.h.W=p.tt),this.ue(p);const y=p.tt;return p===y.U?y.U=void 0:y.W=void 0,this.i-=1,this.Y.ee=0,y}oe(g,p){return g===void 0?!1:this.oe(g.U,p)||p(g)?!0:this.oe(g.W,p)}he(g){for(;;){const p=g.tt;if(p.ee===0)return;const y=p.tt;if(p===y.U){const _=y.W;if(_&&_.ee===1){if(_.ee=p.ee=0,y===this.Y)return;y.ee=1,g=y;continue}else if(g===p.W){if(g.ee=0,g.U&&(g.U.tt=p),g.W&&(g.W.tt=y),p.W=g.U,y.U=g.W,g.U=p,g.W=y,y===this.Y)this.Y=g,this.h.tt=g;else{const b=y.tt;b.U===y?b.U=g:b.W=g}return g.tt=y.tt,p.tt=g,y.tt=g,y.ee=1,{parentNode:p,grandParent:y,curNode:g}}else p.ee=0,y===this.Y?this.Y=y.se():y.se(),y.ee=1}else{const _=y.U;if(_&&_.ee===1){if(_.ee=p.ee=0,y===this.Y)return;y.ee=1,g=y;continue}else if(g===p.U){if(g.ee=0,g.U&&(g.U.tt=y),g.W&&(g.W.tt=p),y.W=g.U,p.U=g.W,g.U=y,g.W=p,y===this.Y)this.Y=g,this.h.tt=g;else{const b=y.tt;b.U===y?b.U=g:b.W=g}return g.tt=y.tt,p.tt=g,y.tt=g,y.ee=1,{parentNode:p,grandParent:y,curNode:g}}else p.ee=0,y===this.Y?this.Y=y.te():y.te(),y.ee=1}return}}ne(g,p,y){if(this.Y===void 0){this.i+=1,this.Y=new this.re(g,p),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let _;const b=this.h.U,A=this.v(b.u,g);if(A===0){b.l=p;return}else if(A>0)b.U=new this.re(g,p),b.U.tt=b,_=b.U,this.h.U=_;else{const w=this.h.W,T=this.v(w.u,g);if(T===0){w.l=p;return}else if(T<0)w.W=new this.re(g,p),w.W.tt=w,_=w.W,this.h.W=_;else{if(y!==void 0){const S=y.o;if(S!==this.h){const x=this.v(S.u,g);if(x===0){S.l=p;return}else if(x>0){const O=S.L(),L=this.v(O.u,g);if(L===0){O.l=p;return}else L<0&&(_=new this.re(g,p),O.W===void 0?(O.W=_,_.tt=O):(S.U=_,_.tt=S))}}}if(_===void 0)for(_=this.Y;;){const S=this.v(_.u,g);if(S>0){if(_.U===void 0){_.U=new this.re(g,p),_.U.tt=_,_=_.U;break}_=_.U}else if(S<0){if(_.W===void 0){_.W=new this.re(g,p),_.W.tt=_,_=_.W;break}_=_.W}else{_.l=p;return}}}}return this.i+=1,_}I(g,p){for(;g;){const y=this.v(g.u,p);if(y<0)g=g.W;else if(y>0)g=g.U;else return g}return g||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(g,p){const y=g.o;if(y===this.h&&(0,f.throwIteratorAccessError)(),this.i===1)return y.u=p,!0;if(y===this.h.U)return this.v(y.B().u,p)>0?(y.u=p,!0):!1;if(y===this.h.W)return this.v(y.L().u,p)<0?(y.u=p,!0):!1;const _=y.L().u;if(this.v(_,p)>=0)return!1;const b=y.B().u;return this.v(b,p)<=0?!1:(y.u=p,!0)}eraseElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=0;const y=this;return this.oe(this.Y,function(_){return g===p?(y.V(_),!0):(p+=1,!1)}),this.i}eraseElementByKey(g){if(this.i===0)return!1;const p=this.I(this.Y,g);return p===this.h?!1:(this.V(p),!0)}eraseElementByIterator(g){const p=g.o;p===this.h&&(0,f.throwIteratorAccessError)();const y=p.W===void 0;return g.iteratorType===0?y&&g.next():(!y||p.U===void 0)&&g.next(),this.V(p),g}forEach(g){let p=0;for(const y of this)g(y,p++,this)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p,y=0;for(const _ of this){if(y===g){p=_;break}y+=1}return p}getHeight(){if(this.i===0)return 0;const g=function(p){return p?Math.max(g(p.U),g(p.W))+1:0};return g(this.Y)}}var h=d;a.default=h},{"../../../utils/throwError":71,"../../ContainerBase":52,"./TreeNode":65}],67:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=d(i("./Base/TreeIterator")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){this.o===this.h&&(0,f.throwIteratorAccessError)();const y=this;return new Proxy([],{get(_,b){if(b==="0")return y.o.u;if(b==="1")return y.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return y.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[],_,b){super(_,b);const A=this;y.forEach(function(w){A.setElement(w[0],w[1])})}*K(y){y!==void 0&&(yield*this.K(y.U),yield[y.u,y.l],yield*this.K(y.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i===0)return;const y=this.h.U;return[y.u,y.l]}back(){if(this.i===0)return;const y=this.h.W;return[y.u,y.l]}lowerBound(y){const _=this.X(this.Y,y);return new h(_,this.h,this)}upperBound(y){const _=this.Z(this.Y,y);return new h(_,this.h,this)}reverseLowerBound(y){const _=this.$(this.Y,y);return new h(_,this.h,this)}reverseUpperBound(y){const _=this.rr(this.Y,y);return new h(_,this.h,this)}setElement(y,_,b){return this.M(y,_,b)}find(y){const _=this.I(this.Y,y);return new h(_,this.h,this)}getElementByKey(y){return this.I(this.Y,y).l}union(y){const _=this;return y.forEach(function(b){_.setElement(b[0],b[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=v;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],68:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(i("./Base")),c=d(i("./Base/TreeIterator")),f=i("../../utils/throwError");function d(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(y,_,b,A){super(y,_,A),this.container=b}get pointer(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.u}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class v extends u.default{constructor(y=[],_,b){super(_,b);const A=this;y.forEach(function(w){A.insert(w)})}*K(y){y!==void 0&&(yield*this.K(y.U),yield y.u,yield*this.K(y.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(y,_){return this.M(y,void 0,_)}find(y){const _=this.I(this.Y,y);return new h(_,this.h,this)}lowerBound(y){const _=this.X(this.Y,y);return new h(_,this.h,this)}upperBound(y){const _=this.Z(this.Y,y);return new h(_,this.h,this)}reverseLowerBound(y){const _=this.$(this.Y,y);return new h(_,this.h,this)}reverseUpperBound(y){const _=this.rr(this.Y,y);return new h(_,this.h,this)}union(y){const _=this;return y.forEach(function(b){_.insert(b)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=v;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],69:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),Object.defineProperty(a,"Deque",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(a,"HashMap",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(a,"HashSet",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(a,"LinkList",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(a,"OrderedMap",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(a,"OrderedSet",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(a,"PriorityQueue",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(a,"Queue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(a,"Stack",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(a,"Vector",{enumerable:!0,get:function(){return d.default}});var u=b(i("./container/OtherContainer/Stack")),c=b(i("./container/OtherContainer/Queue")),f=b(i("./container/OtherContainer/PriorityQueue")),d=b(i("./container/SequentialContainer/Vector")),h=b(i("./container/SequentialContainer/LinkList")),v=b(i("./container/SequentialContainer/Deque")),g=b(i("./container/TreeContainer/OrderedSet")),p=b(i("./container/TreeContainer/OrderedMap")),y=b(i("./container/HashContainer/HashSet")),_=b(i("./container/HashContainer/HashMap"));function b(A){return A&&A.t?A:{default:A}}},{"./container/HashContainer/HashMap":54,"./container/HashContainer/HashSet":55,"./container/OtherContainer/PriorityQueue":56,"./container/OtherContainer/Queue":57,"./container/OtherContainer/Stack":58,"./container/SequentialContainer/Deque":61,"./container/SequentialContainer/LinkList":62,"./container/SequentialContainer/Vector":63,"./container/TreeContainer/OrderedMap":67,"./container/TreeContainer/OrderedSet":68}],70:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=u;function u(c){const f=typeof c;return f==="object"&&c!==null||f==="function"}},{}],71:[function(i,o,a){Object.defineProperty(a,"t",{value:!0}),a.throwIteratorAccessError=u;function u(){throw new RangeError("Iterator access denied!")}},{}],72:[function(i,o,a){(function(u){(function(){const c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,d=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(F=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||F,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},h=typeof AbortSignal=="function",v=typeof d.AbortSignal=="function",g=h?AbortSignal:v?d.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(F){F.type==="abort"&&(this.aborted=!0,this.onabort(F),this._listeners.forEach(j=>j(F),this))}onabort(){}addEventListener(F,j){F==="abort"&&this._listeners.push(j)}removeEventListener(F,j){F==="abort"&&(this._listeners=this._listeners.filter(V=>V!==j))}},p=new Set,y=(re,F)=>{const j=`LRU_CACHE_OPTION_${re}`;w(j)&&T(j,`${re} option`,`options.${F}`,M)},_=(re,F)=>{const j=`LRU_CACHE_METHOD_${re}`;if(w(j)){const{prototype:V}=M,{get:z}=Object.getOwnPropertyDescriptor(V,re);T(j,`${re} method`,`cache.${F}()`,z)}},b=(re,F)=>{const j=`LRU_CACHE_PROPERTY_${re}`;if(w(j)){const{prototype:V}=M,{get:z}=Object.getOwnPropertyDescriptor(V,re);T(j,`${re} property`,`cache.${F}`,z)}},A=(...re)=>{typeof u=="object"&&u&&typeof u.emitWarning=="function"?u.emitWarning(...re):console.error(...re)},w=re=>!p.has(re),T=(re,F,j,V)=>{p.add(re);const z=`The ${F} is deprecated. Please use ${j} instead.`;A(z,"DeprecationWarning",re,V)},S=re=>re&&re===Math.floor(re)&&re>0&&isFinite(re),x=re=>S(re)?re<=Math.pow(2,8)?Uint8Array:re<=Math.pow(2,16)?Uint16Array:re<=Math.pow(2,32)?Uint32Array:re<=Number.MAX_SAFE_INTEGER?O:null:null;class O extends Array{constructor(F){super(F),this.fill(0)}}class L{constructor(F){if(F===0)return[];const j=x(F);this.heap=new j(F),this.length=0}push(F){this.heap[this.length++]=F}pop(){return this.heap[--this.length]}}class M{constructor(F={}){const{max:j=0,ttl:V,ttlResolution:z=1,ttlAutopurge:$,updateAgeOnGet:he,updateAgeOnHas:le,allowStale:Ie,dispose:Fe,disposeAfter:pe,noDisposeOnSet:Lt,noUpdateTTL:_e,maxSize:Et=0,maxEntrySize:Cn=0,sizeCalculation:vn,fetchMethod:Dt,fetchContext:de,noDeleteOnFetchRejection:qe,noDeleteOnStaleGet:Pt,allowStaleOnFetchRejection:In,allowStaleOnFetchAbort:$e,ignoreFetchAbort:Ce}=F,{length:ue,maxAge:At,stale:Ne}=F instanceof M?{}:F;if(j!==0&&!S(j))throw new TypeError("max option must be a nonnegative integer");const Oe=j?x(j):Array;if(!Oe)throw new Error("invalid max value: "+j);if(this.max=j,this.maxSize=Et,this.maxEntrySize=Cn||this.maxSize,this.sizeCalculation=vn||ue,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=Dt||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=de,!this.fetchMethod&&de!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(j).fill(null),this.valList=new Array(j).fill(null),this.next=new Oe(j),this.prev=new Oe(j),this.head=0,this.tail=0,this.free=new L(j),this.initialFill=1,this.size=0,typeof Fe=="function"&&(this.dispose=Fe),typeof pe=="function"?(this.disposeAfter=pe,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!Lt,this.noUpdateTTL=!!_e,this.noDeleteOnFetchRejection=!!qe,this.allowStaleOnFetchRejection=!!In,this.allowStaleOnFetchAbort=!!$e,this.ignoreFetchAbort=!!Ce,this.maxEntrySize!==0){if(this.maxSize!==0&&!S(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!S(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!Ie||!!Ne,this.noDeleteOnStaleGet=!!Pt,this.updateAgeOnGet=!!he,this.updateAgeOnHas=!!le,this.ttlResolution=S(z)||z===0?z:1,this.ttlAutopurge=!!$,this.ttl=V||At||0,this.ttl){if(!S(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const kt="LRU_CACHE_UNBOUNDED";w(kt)&&(p.add(kt),A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",kt,M))}Ne&&y("stale","allowStale"),At&&y("maxAge","ttl"),ue&&y("length","sizeCalculation")}getRemainingTTL(F){return this.has(F,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new O(this.max),this.starts=new O(this.max),this.setItemTTL=(V,z,$=c.now())=>{if(this.starts[V]=z!==0?$:0,this.ttls[V]=z,z!==0&&this.ttlAutopurge){const he=setTimeout(()=>{this.isStale(V)&&this.delete(this.keyList[V])},z+1);he.unref&&he.unref()}},this.updateItemAge=V=>{this.starts[V]=this.ttls[V]!==0?c.now():0},this.statusTTL=(V,z)=>{V&&(V.ttl=this.ttls[z],V.start=this.starts[z],V.now=F||j(),V.remainingTTL=V.now+V.ttl-V.start)};let F=0;const j=()=>{const V=c.now();if(this.ttlResolution>0){F=V;const z=setTimeout(()=>F=0,this.ttlResolution);z.unref&&z.unref()}return V};this.getRemainingTTL=V=>{const z=this.keyMap.get(V);return z===void 0?0:this.ttls[z]===0||this.starts[z]===0?1/0:this.starts[z]+this.ttls[z]-(F||j())},this.isStale=V=>this.ttls[V]!==0&&this.starts[V]!==0&&(F||j())-this.starts[V]>this.ttls[V]}updateItemAge(F){}statusTTL(F,j){}setItemTTL(F,j,V){}isStale(F){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new O(this.max),this.removeItemSize=F=>{this.calculatedSize-=this.sizes[F],this.sizes[F]=0},this.requireSize=(F,j,V,z)=>{if(this.isBackgroundFetch(j))return 0;if(!S(V))if(z){if(typeof z!="function")throw new TypeError("sizeCalculation must be a function");if(V=z(j,F),!S(V))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V},this.addItemSize=(F,j,V)=>{if(this.sizes[F]=j,this.maxSize){const z=this.maxSize-this.sizes[F];for(;this.calculatedSize>z;)this.evict(!0)}this.calculatedSize+=this.sizes[F],V&&(V.entrySize=j,V.totalCalculatedSize=this.calculatedSize)}}removeItemSize(F){}addItemSize(F,j){}requireSize(F,j,V,z){if(V||z)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:F=this.allowStale}={}){if(this.size)for(let j=this.tail;!(!this.isValidIndex(j)||((F||!this.isStale(j))&&(yield j),j===this.head));)j=this.prev[j]}*rindexes({allowStale:F=this.allowStale}={}){if(this.size)for(let j=this.head;!(!this.isValidIndex(j)||((F||!this.isStale(j))&&(yield j),j===this.tail));)j=this.next[j]}isValidIndex(F){return F!==void 0&&this.keyMap.get(this.keyList[F])===F}*entries(){for(const F of this.indexes())this.valList[F]!==void 0&&this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield[this.keyList[F],this.valList[F]])}*rentries(){for(const F of this.rindexes())this.valList[F]!==void 0&&this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield[this.keyList[F],this.valList[F]])}*keys(){for(const F of this.indexes())this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.keyList[F])}*rkeys(){for(const F of this.rindexes())this.keyList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.keyList[F])}*values(){for(const F of this.indexes())this.valList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.valList[F])}*rvalues(){for(const F of this.rindexes())this.valList[F]!==void 0&&!this.isBackgroundFetch(this.valList[F])&&(yield this.valList[F])}[Symbol.iterator](){return this.entries()}find(F,j){for(const V of this.indexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;if($!==void 0&&F($,this.keyList[V],this))return this.get(this.keyList[V],j)}}forEach(F,j=this){for(const V of this.indexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;$!==void 0&&F.call(j,$,this.keyList[V],this)}}rforEach(F,j=this){for(const V of this.rindexes()){const z=this.valList[V],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;$!==void 0&&F.call(j,$,this.keyList[V],this)}}get prune(){return _("prune","purgeStale"),this.purgeStale}purgeStale(){let F=!1;for(const j of this.rindexes({allowStale:!0}))this.isStale(j)&&(this.delete(this.keyList[j]),F=!0);return F}dump(){const F=[];for(const j of this.indexes({allowStale:!0})){const V=this.keyList[j],z=this.valList[j],$=this.isBackgroundFetch(z)?z.__staleWhileFetching:z;if($===void 0)continue;const he={value:$};if(this.ttls){he.ttl=this.ttls[j];const le=c.now()-this.starts[j];he.start=Math.floor(Date.now()-le)}this.sizes&&(he.size=this.sizes[j]),F.unshift([V,he])}return F}load(F){this.clear();for(const[j,V]of F){if(V.start){const z=Date.now()-V.start;V.start=c.now()-z}this.set(j,V.value,V)}}dispose(F,j,V){}set(F,j,{ttl:V=this.ttl,start:z,noDisposeOnSet:$=this.noDisposeOnSet,size:he=0,sizeCalculation:le=this.sizeCalculation,noUpdateTTL:Ie=this.noUpdateTTL,status:Fe}={}){if(he=this.requireSize(F,j,he,le),this.maxEntrySize&&he>this.maxEntrySize)return Fe&&(Fe.set="miss",Fe.maxEntrySizeExceeded=!0),this.delete(F),this;let pe=this.size===0?void 0:this.keyMap.get(F);if(pe===void 0)pe=this.newIndex(),this.keyList[pe]=F,this.valList[pe]=j,this.keyMap.set(F,pe),this.next[this.tail]=pe,this.prev[pe]=this.tail,this.tail=pe,this.size++,this.addItemSize(pe,he,Fe),Fe&&(Fe.set="add"),Ie=!1;else{this.moveToTail(pe);const Lt=this.valList[pe];if(j!==Lt){if(this.isBackgroundFetch(Lt)?Lt.__abortController.abort(new Error("replaced")):$||(this.dispose(Lt,F,"set"),this.disposeAfter&&this.disposed.push([Lt,F,"set"])),this.removeItemSize(pe),this.valList[pe]=j,this.addItemSize(pe,he,Fe),Fe){Fe.set="replace";const _e=Lt&&this.isBackgroundFetch(Lt)?Lt.__staleWhileFetching:Lt;_e!==void 0&&(Fe.oldValue=_e)}}else Fe&&(Fe.set="update")}if(V!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),Ie||this.setItemTTL(pe,V,z),this.statusTTL(Fe,pe),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const F=this.valList[this.head];return this.evict(!0),F}}evict(F){const j=this.head,V=this.keyList[j],z=this.valList[j];return this.isBackgroundFetch(z)?z.__abortController.abort(new Error("evicted")):(this.dispose(z,V,"evict"),this.disposeAfter&&this.disposed.push([z,V,"evict"])),this.removeItemSize(j),F&&(this.keyList[j]=null,this.valList[j]=null,this.free.push(j)),this.head=this.next[j],this.keyMap.delete(V),this.size--,j}has(F,{updateAgeOnHas:j=this.updateAgeOnHas,status:V}={}){const z=this.keyMap.get(F);if(z!==void 0)if(this.isStale(z))V&&(V.has="stale",this.statusTTL(V,z));else return j&&this.updateItemAge(z),V&&(V.has="hit"),this.statusTTL(V,z),!0;else V&&(V.has="miss");return!1}peek(F,{allowStale:j=this.allowStale}={}){const V=this.keyMap.get(F);if(V!==void 0&&(j||!this.isStale(V))){const z=this.valList[V];return this.isBackgroundFetch(z)?z.__staleWhileFetching:z}}backgroundFetch(F,j,V,z){const $=j===void 0?void 0:this.valList[j];if(this.isBackgroundFetch($))return $;const he=new d;V.signal&&V.signal.addEventListener("abort",()=>he.abort(V.signal.reason));const le={signal:he.signal,options:V,context:z},Ie=(Et,Cn=!1)=>{const{aborted:vn}=he.signal,Dt=V.ignoreFetchAbort&&Et!==void 0;return V.status&&(vn&&!Cn?(V.status.fetchAborted=!0,V.status.fetchError=he.signal.reason,Dt&&(V.status.fetchAbortIgnored=!0)):V.status.fetchResolved=!0),vn&&!Dt&&!Cn?pe(he.signal.reason):(this.valList[j]===_e&&(Et===void 0?_e.__staleWhileFetching?this.valList[j]=_e.__staleWhileFetching:this.delete(F):(V.status&&(V.status.fetchUpdated=!0),this.set(F,Et,le.options))),Et)},Fe=Et=>(V.status&&(V.status.fetchRejected=!0,V.status.fetchError=Et),pe(Et)),pe=Et=>{const{aborted:Cn}=he.signal,vn=Cn&&V.allowStaleOnFetchAbort,Dt=vn||V.allowStaleOnFetchRejection,de=Dt||V.noDeleteOnFetchRejection;if(this.valList[j]===_e&&(!de||_e.__staleWhileFetching===void 0?this.delete(F):vn||(this.valList[j]=_e.__staleWhileFetching)),Dt)return V.status&&_e.__staleWhileFetching!==void 0&&(V.status.returnedStale=!0),_e.__staleWhileFetching;if(_e.__returned===_e)throw Et},Lt=(Et,Cn)=>{this.fetchMethod(F,$,le).then(vn=>Et(vn),Cn),he.signal.addEventListener("abort",()=>{(!V.ignoreFetchAbort||V.allowStaleOnFetchAbort)&&(Et(),V.allowStaleOnFetchAbort&&(Et=vn=>Ie(vn,!0)))})};V.status&&(V.status.fetchDispatched=!0);const _e=new Promise(Lt).then(Ie,Fe);return _e.__abortController=he,_e.__staleWhileFetching=$,_e.__returned=null,j===void 0?(this.set(F,_e,{...le.options,status:void 0}),j=this.keyMap.get(F)):this.valList[j]=_e,_e}isBackgroundFetch(F){return F&&typeof F=="object"&&typeof F.then=="function"&&Object.prototype.hasOwnProperty.call(F,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(F,"__returned")&&(F.__returned===F||F.__returned===null)}async fetch(F,{allowStale:j=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,ttl:$=this.ttl,noDisposeOnSet:he=this.noDisposeOnSet,size:le=0,sizeCalculation:Ie=this.sizeCalculation,noUpdateTTL:Fe=this.noUpdateTTL,noDeleteOnFetchRejection:pe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Lt=this.allowStaleOnFetchRejection,ignoreFetchAbort:_e=this.ignoreFetchAbort,allowStaleOnFetchAbort:Et=this.allowStaleOnFetchAbort,fetchContext:Cn=this.fetchContext,forceRefresh:vn=!1,status:Dt,signal:de}={}){if(!this.fetchMethod)return Dt&&(Dt.fetch="get"),this.get(F,{allowStale:j,updateAgeOnGet:V,noDeleteOnStaleGet:z,status:Dt});const qe={allowStale:j,updateAgeOnGet:V,noDeleteOnStaleGet:z,ttl:$,noDisposeOnSet:he,size:le,sizeCalculation:Ie,noUpdateTTL:Fe,noDeleteOnFetchRejection:pe,allowStaleOnFetchRejection:Lt,allowStaleOnFetchAbort:Et,ignoreFetchAbort:_e,status:Dt,signal:de};let Pt=this.keyMap.get(F);if(Pt===void 0){Dt&&(Dt.fetch="miss");const In=this.backgroundFetch(F,Pt,qe,Cn);return In.__returned=In}else{const In=this.valList[Pt];if(this.isBackgroundFetch(In)){const Ne=j&&In.__staleWhileFetching!==void 0;return Dt&&(Dt.fetch="inflight",Ne&&(Dt.returnedStale=!0)),Ne?In.__staleWhileFetching:In.__returned=In}const $e=this.isStale(Pt);if(!vn&&!$e)return Dt&&(Dt.fetch="hit"),this.moveToTail(Pt),V&&this.updateItemAge(Pt),this.statusTTL(Dt,Pt),In;const Ce=this.backgroundFetch(F,Pt,qe,Cn),ue=Ce.__staleWhileFetching!==void 0,At=ue&&j;return Dt&&(Dt.fetch=ue&&$e?"stale":"refresh",At&&$e&&(Dt.returnedStale=!0)),At?Ce.__staleWhileFetching:Ce.__returned=Ce}}get(F,{allowStale:j=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,status:$}={}){const he=this.keyMap.get(F);if(he!==void 0){const le=this.valList[he],Ie=this.isBackgroundFetch(le);return this.statusTTL($,he),this.isStale(he)?($&&($.get="stale"),Ie?($&&($.returnedStale=j&&le.__staleWhileFetching!==void 0),j?le.__staleWhileFetching:void 0):(z||this.delete(F),$&&($.returnedStale=j),j?le:void 0)):($&&($.get="hit"),Ie?le.__staleWhileFetching:(this.moveToTail(he),V&&this.updateItemAge(he),le))}else $&&($.get="miss")}connect(F,j){this.prev[j]=F,this.next[F]=j}moveToTail(F){F!==this.tail&&(F===this.head?this.head=this.next[F]:this.connect(this.prev[F],this.next[F]),this.connect(this.tail,F),this.tail=F)}get del(){return _("del","delete"),this.delete}delete(F){let j=!1;if(this.size!==0){const V=this.keyMap.get(F);if(V!==void 0)if(j=!0,this.size===1)this.clear();else{this.removeItemSize(V);const z=this.valList[V];this.isBackgroundFetch(z)?z.__abortController.abort(new Error("deleted")):(this.dispose(z,F,"delete"),this.disposeAfter&&this.disposed.push([z,F,"delete"])),this.keyMap.delete(F),this.keyList[V]=null,this.valList[V]=null,V===this.tail?this.tail=this.prev[V]:V===this.head?this.head=this.next[V]:(this.next[this.prev[V]]=this.next[V],this.prev[this.next[V]]=this.prev[V]),this.size--,this.free.push(V)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return j}clear(){for(const F of this.rindexes({allowStale:!0})){const j=this.valList[F];if(this.isBackgroundFetch(j))j.__abortController.abort(new Error("deleted"));else{const V=this.keyList[F];this.dispose(j,V,"delete"),this.disposeAfter&&this.disposed.push([j,V,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return _("reset","clear"),this.clear}get length(){return b("length","size"),this.size}static get AbortController(){return d}static get AbortSignal(){return g}}o.exports=M}).call(this)}).call(this,i("_process"))},{_process:102}],73:[function(i,o,a){const u=o.exports,{Buffer:c}=i("buffer");u.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},u.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},u.requiredHeaderFlagsErrors={};for(const d in u.requiredHeaderFlags){const h=u.requiredHeaderFlags[d];u.requiredHeaderFlagsErrors[d]="Invalid header flag bits, must be 0x"+h.toString(16)+" for "+u.types[d]+" packet"}u.codes={};for(const d in u.types){const h=u.types[d];u.codes[h]=d}u.CMD_SHIFT=4,u.CMD_MASK=240,u.DUP_MASK=8,u.QOS_MASK=3,u.QOS_SHIFT=1,u.RETAIN_MASK=1,u.VARBYTEINT_MASK=127,u.VARBYTEINT_FIN_MASK=128,u.VARBYTEINT_MAX=268435455,u.SESSIONPRESENT_MASK=1,u.SESSIONPRESENT_HEADER=c.from([u.SESSIONPRESENT_MASK]),u.CONNACK_HEADER=c.from([u.codes.connack<<u.CMD_SHIFT]),u.USERNAME_MASK=128,u.PASSWORD_MASK=64,u.WILL_RETAIN_MASK=32,u.WILL_QOS_MASK=24,u.WILL_QOS_SHIFT=3,u.WILL_FLAG_MASK=4,u.CLEAN_SESSION_MASK=2,u.CONNECT_HEADER=c.from([u.codes.connect<<u.CMD_SHIFT]),u.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},u.propertiesCodes={};for(const d in u.properties){const h=u.properties[d];u.propertiesCodes[h]=d}u.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function f(d){return[0,1,2].map(h=>[0,1].map(v=>[0,1].map(g=>{const p=c.alloc(1);return p.writeUInt8(u.codes[d]<<u.CMD_SHIFT|(v?u.DUP_MASK:0)|h<<u.QOS_SHIFT|g,0,!0),p})))}u.PUBLISH_HEADER=f("publish"),u.SUBSCRIBE_HEADER=f("subscribe"),u.SUBSCRIBE_OPTIONS_QOS_MASK=3,u.SUBSCRIBE_OPTIONS_NL_MASK=1,u.SUBSCRIBE_OPTIONS_NL_SHIFT=2,u.SUBSCRIBE_OPTIONS_RAP_MASK=1,u.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,u.SUBSCRIBE_OPTIONS_RH_MASK=3,u.SUBSCRIBE_OPTIONS_RH_SHIFT=4,u.SUBSCRIBE_OPTIONS_RH=[0,16,32],u.SUBSCRIBE_OPTIONS_NL=4,u.SUBSCRIBE_OPTIONS_RAP=8,u.SUBSCRIBE_OPTIONS_QOS=[0,1,2],u.UNSUBSCRIBE_HEADER=f("unsubscribe"),u.ACKS={unsuback:f("unsuback"),puback:f("puback"),pubcomp:f("pubcomp"),pubrel:f("pubrel"),pubrec:f("pubrec")},u.SUBACK_HEADER=c.from([u.codes.suback<<u.CMD_SHIFT]),u.VERSION3=c.from([3]),u.VERSION4=c.from([4]),u.VERSION5=c.from([5]),u.VERSION131=c.from([131]),u.VERSION132=c.from([132]),u.QOS=[0,1,2].map(d=>c.from([d])),u.EMPTY={pingreq:c.from([u.codes.pingreq<<4,0]),pingresp:c.from([u.codes.pingresp<<4,0]),disconnect:c.from([u.codes.disconnect<<4,0])},u.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},u.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},u.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},u.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},{buffer:29}],74:[function(i,o,a){const u=i("./writeToStream"),c=i("events"),{Buffer:f}=i("buffer");function d(v,g){const p=new h;return u(v,p,g),p.concat()}class h extends c{constructor(){super(),this._array=new Array(20),this._i=0}write(g){return this._array[this._i++]=g,!0}concat(){let g=0;const p=new Array(this._array.length),y=this._array;let _=0,b;for(b=0;b<y.length&&y[b]!==void 0;b++)typeof y[b]!="string"?p[b]=y[b].length:p[b]=f.byteLength(y[b]),g+=p[b];const A=f.allocUnsafe(g);for(b=0;b<y.length&&y[b]!==void 0;b++)typeof y[b]!="string"?(y[b].copy(A,_),_+=p[b]):(A.write(y[b],_),_+=p[b]);return A}destroy(g){g&&this.emit("error",g)}}o.exports=d},{"./writeToStream":96,buffer:29,events:49}],75:[function(i,o,a){a.parser=i("./parser").parser,a.generate=i("./generate"),a.writeToStream=i("./writeToStream")},{"./generate":74,"./parser":95,"./writeToStream":96}],76:[function(i,o,a){const{Buffer:u}=i("buffer"),c=Symbol.for("BufferList");function f(d){if(!(this instanceof f))return new f(d);f._init.call(this,d)}f._init=function(h){Object.defineProperty(this,c,{value:!0}),this._bufs=[],this.length=0,h&&this.append(h)},f.prototype._new=function(h){return new f(h)},f.prototype._offset=function(h){if(h===0)return[0,0];let v=0;for(let g=0;g<this._bufs.length;g++){const p=v+this._bufs[g].length;if(h<p||g===this._bufs.length-1)return[g,h-v];v=p}},f.prototype._reverseOffset=function(d){const h=d[0];let v=d[1];for(let g=0;g<h;g++)v+=this._bufs[g].length;return v},f.prototype.get=function(h){if(h>this.length||h<0)return;const v=this._offset(h);return this._bufs[v[0]][v[1]]},f.prototype.slice=function(h,v){return typeof h=="number"&&h<0&&(h+=this.length),typeof v=="number"&&v<0&&(v+=this.length),this.copy(null,0,h,v)},f.prototype.copy=function(h,v,g,p){if((typeof g!="number"||g<0)&&(g=0),(typeof p!="number"||p>this.length)&&(p=this.length),g>=this.length||p<=0)return h||u.alloc(0);const y=!!h,_=this._offset(g),b=p-g;let A=b,w=y&&v||0,T=_[1];if(g===0&&p===this.length){if(!y)return this._bufs.length===1?this._bufs[0]:u.concat(this._bufs,this.length);for(let S=0;S<this._bufs.length;S++)this._bufs[S].copy(h,w),w+=this._bufs[S].length;return h}if(A<=this._bufs[_[0]].length-T)return y?this._bufs[_[0]].copy(h,v,T,T+A):this._bufs[_[0]].slice(T,T+A);y||(h=u.allocUnsafe(b));for(let S=_[0];S<this._bufs.length;S++){const x=this._bufs[S].length-T;if(A>x)this._bufs[S].copy(h,w,T),w+=x;else{this._bufs[S].copy(h,w,T,T+A),w+=x;break}A-=x,T&&(T=0)}return h.length>w?h.slice(0,w):h},f.prototype.shallowSlice=function(h,v){if(h=h||0,v=typeof v!="number"?this.length:v,h<0&&(h+=this.length),v<0&&(v+=this.length),h===v)return this._new();const g=this._offset(h),p=this._offset(v),y=this._bufs.slice(g[0],p[0]+1);return p[1]===0?y.pop():y[y.length-1]=y[y.length-1].slice(0,p[1]),g[1]!==0&&(y[0]=y[0].slice(g[1])),this._new(y)},f.prototype.toString=function(h,v,g){return this.slice(v,g).toString(h)},f.prototype.consume=function(h){if(h=Math.trunc(h),Number.isNaN(h)||h<=0)return this;for(;this._bufs.length;)if(h>=this._bufs[0].length)h-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(h),this.length-=h;break}return this},f.prototype.duplicate=function(){const h=this._new();for(let v=0;v<this._bufs.length;v++)h.append(this._bufs[v]);return h},f.prototype.append=function(h){if(h==null)return this;if(h.buffer)this._appendBuffer(u.from(h.buffer,h.byteOffset,h.byteLength));else if(Array.isArray(h))for(let v=0;v<h.length;v++)this.append(h[v]);else if(this._isBufferList(h))for(let v=0;v<h._bufs.length;v++)this.append(h._bufs[v]);else typeof h=="number"&&(h=h.toString()),this._appendBuffer(u.from(h));return this},f.prototype._appendBuffer=function(h){this._bufs.push(h),this.length+=h.length},f.prototype.indexOf=function(d,h,v){if(v===void 0&&typeof h=="string"&&(v=h,h=void 0),typeof d=="function"||Array.isArray(d))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof d=="number"?d=u.from([d]):typeof d=="string"?d=u.from(d,v):this._isBufferList(d)?d=d.slice():Array.isArray(d.buffer)?d=u.from(d.buffer,d.byteOffset,d.byteLength):u.isBuffer(d)||(d=u.from(d)),h=Number(h||0),isNaN(h)&&(h=0),h<0&&(h=this.length+h),h<0&&(h=0),d.length===0)return h>this.length?this.length:h;const g=this._offset(h);let p=g[0],y=g[1];for(;p<this._bufs.length;p++){const _=this._bufs[p];for(;y<_.length;)if(_.length-y>=d.length){const A=_.indexOf(d,y);if(A!==-1)return this._reverseOffset([p,A]);y=_.length-d.length+1}else{const A=this._reverseOffset([p,y]);if(this._match(A,d))return A;y++}y=0}return-1},f.prototype._match=function(d,h){if(this.length-d<h.length)return!1;for(let v=0;v<h.length;v++)if(this.get(d+v)!==h[v])return!1;return!0},function(){const d={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const h in d)(function(v){d[v]===null?f.prototype[v]=function(g,p){return this.slice(g,g+p)[v](0,p)}:f.prototype[v]=function(g=0){return this.slice(g,g+d[v])[v](0)}})(h)}(),f.prototype._isBufferList=function(h){return h instanceof f||f.isBufferList(h)},f.isBufferList=function(h){return h!=null&&h[c]},o.exports=f},{buffer:29}],77:[function(i,o,a){const u=i("readable-stream").Duplex,c=i("inherits"),f=i("./BufferList");function d(h){if(!(this instanceof d))return new d(h);if(typeof h=="function"){this._callback=h;const v=function(p){this._callback&&(this._callback(p),this._callback=null)}.bind(this);this.on("pipe",function(p){p.on("error",v)}),this.on("unpipe",function(p){p.removeListener("error",v)}),h=null}f._init.call(this,h),u.call(this)}c(d,u),Object.assign(d.prototype,f.prototype),d.prototype._new=function(v){return new d(v)},d.prototype._write=function(v,g,p){this._appendBuffer(v),typeof p=="function"&&p()},d.prototype._read=function(v){if(!this.length)return this.push(null);v=Math.min(v,this.length),this.push(this.slice(0,v)),this.consume(v)},d.prototype.end=function(v){u.prototype.end.call(this,v),this._callback&&(this._callback(null,this.slice()),this._callback=null)},d.prototype._destroy=function(v,g){this._bufs.length=0,this.length=0,g(v)},d.prototype._isBufferList=function(v){return v instanceof d||v instanceof f||d.isBufferList(v)},d.isBufferList=f.isBufferList,o.exports=d,o.exports.BufferListStream=d,o.exports.BufferList=f},{"./BufferList":76,inherits:51,"readable-stream":92}],78:[function(i,o,a){arguments[4][33][0].apply(a,arguments)},{dup:33}],79:[function(i,o,a){arguments[4][34][0].apply(a,arguments)},{"./_stream_readable":81,"./_stream_writable":83,_process:102,dup:34,inherits:51}],80:[function(i,o,a){arguments[4][35][0].apply(a,arguments)},{"./_stream_transform":82,dup:35,inherits:51}],81:[function(i,o,a){arguments[4][36][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/async_iterator":84,"./internal/streams/buffer_list":85,"./internal/streams/destroy":86,"./internal/streams/from":88,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:36,events:49,inherits:51,"string_decoder/":136,util:26}],82:[function(i,o,a){arguments[4][37][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,dup:37,inherits:51}],83:[function(i,o,a){arguments[4][38][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:38,inherits:51,"util-deprecate":139}],84:[function(i,o,a){arguments[4][39][0].apply(a,arguments)},{"./end-of-stream":87,_process:102,dup:39}],85:[function(i,o,a){arguments[4][40][0].apply(a,arguments)},{buffer:29,dup:40,util:26}],86:[function(i,o,a){arguments[4][41][0].apply(a,arguments)},{_process:102,dup:41}],87:[function(i,o,a){arguments[4][42][0].apply(a,arguments)},{"../../../errors":78,dup:42}],88:[function(i,o,a){arguments[4][43][0].apply(a,arguments)},{dup:43}],89:[function(i,o,a){arguments[4][44][0].apply(a,arguments)},{"../../../errors":78,"./end-of-stream":87,dup:44}],90:[function(i,o,a){arguments[4][45][0].apply(a,arguments)},{"../../../errors":78,dup:45}],91:[function(i,o,a){arguments[4][46][0].apply(a,arguments)},{dup:46,events:49}],92:[function(i,o,a){arguments[4][47][0].apply(a,arguments)},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89,dup:47}],93:[function(i,o,a){const{Buffer:u}=i("buffer"),c=65536,f={},d=u.isBuffer(u.from([1,2]).subarray(0,1));function h(y){const _=u.allocUnsafe(2);return _.writeUInt8(y>>8,0),_.writeUInt8(y&255,0+1),_}function v(){for(let y=0;y<c;y++)f[y]=h(y)}function g(y){let b=0,A=0;const w=u.allocUnsafe(4);do b=y%128|0,y=y/128|0,y>0&&(b=b|128),w.writeUInt8(b,A++);while(y>0&&A<4);return y>0&&(A=0),d?w.subarray(0,A):w.slice(0,A)}function p(y){const _=u.allocUnsafe(4);return _.writeUInt32BE(y,0),_}o.exports={cache:f,generateCache:v,generateNumber:h,genBufVariableByteInt:g,generate4ByteBuffer:p}},{buffer:29}],94:[function(i,o,a){class u{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}o.exports=u},{}],95:[function(i,o,a){const u=i("bl"),c=i("events"),f=i("./packet"),d=i("./constants"),h=i("debug")("mqtt-packet:parser");class v extends c{constructor(){super(),this.parser=this.constructor.parser}static parser(p){return this instanceof v?(this.settings=p||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new v().parser(p)}_resetState(){h("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new f,this.error=null,this._list=u(),this._stateCounter=0}parse(p){for(this.error&&this._resetState(),this._list.append(p),h("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,h("parse: state complete. _stateCounter is now: %d",this._stateCounter),h("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return h("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const p=this._list.readUInt8(0),y=p>>d.CMD_SHIFT;this.packet.cmd=d.types[y];const _=p&15,b=d.requiredHeaderFlags[y];return b!=null&&_!==b?this._emitError(new Error(d.requiredHeaderFlagsErrors[y])):(this.packet.retain=(p&d.RETAIN_MASK)!==0,this.packet.qos=p>>d.QOS_SHIFT&d.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(p&d.DUP_MASK)!==0,h("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const p=this._parseVarByteNum(!0);return p&&(this.packet.length=p.value,this._list.consume(p.bytes)),h("_parseLength %d",p.value),!!p}_parsePayload(){h("_parsePayload: payload %O",this._list);let p=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}p=!0}return h("_parsePayload complete result: %s",p),p}_parseConnect(){h("_parseConnect");let p,y,_,b;const A={},w=this.packet,T=this._parseString();if(T===null)return this._emitError(new Error("Cannot parse protocolId"));if(T!=="MQTT"&&T!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(w.protocolId=T,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(w.protocolVersion=this._list.readUInt8(this._pos),w.protocolVersion>=128&&(w.bridgeMode=!0,w.protocolVersion=w.protocolVersion-128),w.protocolVersion!==3&&w.protocolVersion!==4&&w.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));A.username=this._list.readUInt8(this._pos)&d.USERNAME_MASK,A.password=this._list.readUInt8(this._pos)&d.PASSWORD_MASK,A.will=this._list.readUInt8(this._pos)&d.WILL_FLAG_MASK;const S=!!(this._list.readUInt8(this._pos)&d.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&d.WILL_QOS_MASK)>>d.WILL_QOS_SHIFT;if(A.will)w.will={},w.will.retain=S,w.will.qos=x;else{if(S)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(w.clean=(this._list.readUInt8(this._pos)&d.CLEAN_SESSION_MASK)!==0,this._pos++,w.keepalive=this._parseNum(),w.keepalive===-1)return this._emitError(new Error("Packet too short"));if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.properties=L)}const O=this._parseString();if(O===null)return this._emitError(new Error("Packet too short"));if(w.clientId=O,h("_parseConnect: packet.clientId: %s",w.clientId),A.will){if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.will.properties=L)}if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse will topic"));if(w.will.topic=p,h("_parseConnect: packet.will.topic: %s",w.will.topic),y=this._parseBuffer(),y===null)return this._emitError(new Error("Cannot parse will payload"));w.will.payload=y,h("_parseConnect: packet.will.paylaod: %s",w.will.payload)}if(A.username){if(b=this._parseString(),b===null)return this._emitError(new Error("Cannot parse username"));w.username=b,h("_parseConnect: packet.username: %s",w.username)}if(A.password){if(_=this._parseBuffer(),_===null)return this._emitError(new Error("Cannot parse password"));w.password=_}return this.settings=w,h("_parseConnect: complete"),w}_parseConnack(){h("_parseConnack");const p=this.packet;if(this._list.length<1)return null;const y=this._list.readUInt8(this._pos++);if(y>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(p.sessionPresent=!!(y&d.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?p.reasonCode=this._list.readUInt8(this._pos++):p.reasonCode=0;else{if(this._list.length<2)return null;p.returnCode=this._list.readUInt8(this._pos++)}if(p.returnCode===-1||p.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(p.properties=_)}h("_parseConnack: complete")}_parsePublish(){h("_parsePublish");const p=this.packet;if(p.topic=this._parseString(),p.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(p.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}p.payload=this._list.slice(this._pos,p.length),h("_parsePublish: payload from buffer list: %o",p.payload)}}_parseSubscribe(){h("_parseSubscribe");const p=this.packet;let y,_,b,A,w,T,S;if(p.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(p.properties=x)}if(p.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<p.length;){if(y=this._parseString(),y===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=p.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(_=this._parseByte(),this.settings.protocolVersion===5){if(_&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(_&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(b=_&d.SUBSCRIBE_OPTIONS_QOS_MASK,b>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(T=(_>>d.SUBSCRIBE_OPTIONS_NL_SHIFT&d.SUBSCRIBE_OPTIONS_NL_MASK)!==0,w=(_>>d.SUBSCRIBE_OPTIONS_RAP_SHIFT&d.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,A=_>>d.SUBSCRIBE_OPTIONS_RH_SHIFT&d.SUBSCRIBE_OPTIONS_RH_MASK,A>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));S={topic:y,qos:b},this.settings.protocolVersion===5?(S.nl=T,S.rap=w,S.rh=A):this.settings.bridgeMode&&(S.rh=0,S.rap=!0,S.nl=!0),h("_parseSubscribe: push subscription `%s` to subscription",S),p.subscriptions.push(S)}}}_parseSuback(){h("_parseSuback");const p=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}if(p.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const y=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!d.MQTT5_SUBACK_CODES[y])return this._emitError(new Error("Invalid suback code"))}else if(y>2&&y!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(y)}}}_parseUnsubscribe(){h("_parseUnsubscribe");const p=this.packet;if(p.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}if(p.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<p.length;){const y=this._parseString();if(y===null)return this._emitError(new Error("Cannot parse topic"));h("_parseUnsubscribe: push topic `%s` to unsubscriptions",y),p.unsubscriptions.push(y)}}}_parseUnsuback(){h("_parseUnsuback");const p=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&p.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(p.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){const y=this._parseProperties();for(Object.getOwnPropertyNames(y).length&&(p.properties=y),p.granted=[];this._pos<this.packet.length;){const _=this._list.readUInt8(this._pos++);if(!d.MQTT5_UNSUBACK_CODES[_])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(_)}}}_parseConfirmation(){h("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const p=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(p.length>2){switch(p.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!d.MQTT5_PUBACK_PUBREC_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!d.MQTT5_PUBREL_PUBCOMP_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}h("_parseConfirmation: packet.reasonCode `%d`",p.reasonCode)}else p.reasonCode=0;if(p.length>3){const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}}return!0}_parseDisconnect(){const p=this.packet;if(h("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(p.reasonCode=this._parseByte(),d.MQTT5_DISCONNECT_CODES[p.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):p.reasonCode=0;const y=this._parseProperties();Object.getOwnPropertyNames(y).length&&(p.properties=y)}return h("_parseDisconnect result: true"),!0}_parseAuth(){h("_parseAuth");const p=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(p.reasonCode=this._parseByte(),!d.MQTT5_AUTH_CODES[p.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const y=this._parseProperties();return Object.getOwnPropertyNames(y).length&&(p.properties=y),h("_parseAuth: result: true"),!0}_parseMessageId(){const p=this.packet;return p.messageId=this._parseNum(),p.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(h("_parseMessageId: packet.messageId %d",p.messageId),!0)}_parseString(p){const y=this._parseNum(),_=y+this._pos;if(y===-1||_>this._list.length||_>this.packet.length)return null;const b=this._list.toString("utf8",this._pos,_);return this._pos+=y,h("_parseString: result: %s",b),b}_parseStringPair(){return h("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const p=this._parseNum(),y=p+this._pos;if(p===-1||y>this._list.length||y>this.packet.length)return null;const _=this._list.slice(this._pos,y);return this._pos+=p,h("_parseBuffer: result: %o",_),_}_parseNum(){if(this._list.length-this._pos<2)return-1;const p=this._list.readUInt16BE(this._pos);return this._pos+=2,h("_parseNum: result: %s",p),p}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const p=this._list.readUInt32BE(this._pos);return this._pos+=4,h("_parse4ByteNum: result: %s",p),p}_parseVarByteNum(p){h("_parseVarByteNum");const y=4;let _=0,b=1,A=0,w=!1,T;const S=this._pos?this._pos:0;for(;_<y&&S+_<this._list.length;){if(T=this._list.readUInt8(S+_++),A+=b*(T&d.VARBYTEINT_MASK),b*=128,!(T&d.VARBYTEINT_FIN_MASK)){w=!0;break}if(this._list.length<=_)break}return!w&&_===y&&this._list.length>=_&&this._emitError(new Error("Invalid variable byte integer")),S&&(this._pos+=_),w?p?w={bytes:_,value:A}:w=A:w=!1,h("_parseVarByteNum: result: %o",w),w}_parseByte(){let p;return this._pos<this._list.length&&(p=this._list.readUInt8(this._pos),this._pos++),h("_parseByte: result: %o",p),p}_parseByType(p){switch(h("_parseByType: type: %s",p),p){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){h("_parseProperties");const p=this._parseVarByteNum(),_=this._pos+p,b={};for(;this._pos<_;){const A=this._parseByte();if(!A)return this._emitError(new Error("Cannot parse property code type")),!1;const w=d.propertiesCodes[A];if(!w)return this._emitError(new Error("Unknown property")),!1;if(w==="userProperties"){b[w]||(b[w]=Object.create(null));const T=this._parseByType(d.propertiesTypes[w]);if(b[w][T.name])if(Array.isArray(b[w][T.name]))b[w][T.name].push(T.value);else{const S=b[w][T.name];b[w][T.name]=[S],b[w][T.name].push(T.value)}else b[w][T.name]=T.value;continue}b[w]?Array.isArray(b[w])?b[w].push(this._parseByType(d.propertiesTypes[w])):(b[w]=[b[w]],b[w].push(this._parseByType(d.propertiesTypes[w]))):b[w]=this._parseByType(d.propertiesTypes[w])}return b}_newPacket(){return h("_newPacket"),this.packet&&(this._list.consume(this.packet.length),h("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),h("_newPacket: new packet"),this.packet=new f,this._pos=0,!0}_emitError(p){h("_emitError",p),this.error=p,this.emit("error",p)}}o.exports=v},{"./constants":73,"./packet":94,bl:77,debug:30,events:49}],96:[function(i,o,a){const u=i("./constants"),{Buffer:c}=i("buffer"),f=c.allocUnsafe(0),d=c.from([0]),h=i("./numbers"),v=i("process-nextick-args").nextTick,g=i("debug")("mqtt-packet:writeToStream"),p=h.cache,y=h.generateNumber,_=h.generateCache,b=h.genBufVariableByteInt,A=h.generate4ByteBuffer;let w=_e,T=!0;function S(Ce,ue,At){switch(g("generate called"),ue.cork&&(ue.cork(),v(x,ue)),T&&(T=!1,_()),g("generate: packet.cmd: %s",Ce.cmd),Ce.cmd){case"connect":return O(Ce,ue);case"connack":return L(Ce,ue,At);case"publish":return M(Ce,ue,At);case"puback":case"pubrec":case"pubrel":case"pubcomp":return re(Ce,ue,At);case"subscribe":return F(Ce,ue,At);case"suback":return j(Ce,ue,At);case"unsubscribe":return V(Ce,ue,At);case"unsuback":return z(Ce,ue,At);case"pingreq":case"pingresp":return $(Ce,ue);case"disconnect":return he(Ce,ue,At);case"auth":return le(Ce,ue,At);default:return ue.destroy(new Error("Unknown command")),!1}}Object.defineProperty(S,"cacheNumbers",{get(){return w===_e},set(Ce){Ce?((!p||Object.keys(p).length===0)&&(T=!0),w=_e):(T=!1,w=Et)}});function x(Ce){Ce.uncork()}function O(Ce,ue,At){const Ne=Ce||{},Oe=Ne.protocolId||"MQTT";let kt=Ne.protocolVersion||4;const jt=Ne.will;let _n=Ne.clean;const ie=Ne.keepalive||0,ae=Ne.clientId||"",Y=Ne.username,k=Ne.password,D=Ne.properties;_n===void 0&&(_n=!0);let oe=0;if(!Oe||typeof Oe!="string"&&!c.isBuffer(Oe))return ue.destroy(new Error("Invalid protocolId")),!1;if(oe+=Oe.length+2,kt!==3&&kt!==4&&kt!==5)return ue.destroy(new Error("Invalid protocol version")),!1;if(oe+=1,(typeof ae=="string"||c.isBuffer(ae))&&(ae||kt>=4)&&(ae||_n))oe+=c.byteLength(ae)+2;else{if(kt<4)return ue.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(_n*1===0)return ue.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof ie!="number"||ie<0||ie>65535||ie%1!==0)return ue.destroy(new Error("Invalid keepalive")),!1;oe+=2,oe+=1;let xe,ze;if(kt===5){if(xe=Dt(ue,D),!xe)return!1;oe+=xe.length}if(jt){if(typeof jt!="object")return ue.destroy(new Error("Invalid will")),!1;if(!jt.topic||typeof jt.topic!="string")return ue.destroy(new Error("Invalid will topic")),!1;if(oe+=c.byteLength(jt.topic)+2,oe+=2,jt.payload)if(jt.payload.length>=0)typeof jt.payload=="string"?oe+=c.byteLength(jt.payload):oe+=jt.payload.length;else return ue.destroy(new Error("Invalid will payload")),!1;if(ze={},kt===5){if(ze=Dt(ue,jt.properties),!ze)return!1;oe+=ze.length}}let hn=!1;if(Y!=null)if($e(Y))hn=!0,oe+=c.byteLength(Y)+2;else return ue.destroy(new Error("Invalid username")),!1;if(k!=null){if(!hn)return ue.destroy(new Error("Username is required to use password")),!1;if($e(k))oe+=In(k)+2;else return ue.destroy(new Error("Invalid password")),!1}ue.write(u.CONNECT_HEADER),Fe(ue,oe),vn(ue,Oe),Ne.bridgeMode&&(kt+=128),ue.write(kt===131?u.VERSION131:kt===132?u.VERSION132:kt===4?u.VERSION4:kt===5?u.VERSION5:u.VERSION3);let An=0;return An|=Y!=null?u.USERNAME_MASK:0,An|=k!=null?u.PASSWORD_MASK:0,An|=jt&&jt.retain?u.WILL_RETAIN_MASK:0,An|=jt&&jt.qos?jt.qos<<u.WILL_QOS_SHIFT:0,An|=jt?u.WILL_FLAG_MASK:0,An|=_n?u.CLEAN_SESSION_MASK:0,ue.write(c.from([An])),w(ue,ie),kt===5&&xe.write(),vn(ue,ae),jt&&(kt===5&&ze.write(),pe(ue,jt.topic),vn(ue,jt.payload)),Y!=null&&vn(ue,Y),k!=null&&vn(ue,k),!0}function L(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Ne===5?Oe.reasonCode:Oe.returnCode,jt=Oe.properties;let _n=2;if(typeof kt!="number")return ue.destroy(new Error("Invalid return code")),!1;let ie=null;if(Ne===5){if(ie=Dt(ue,jt),!ie)return!1;_n+=ie.length}return ue.write(u.CONNACK_HEADER),Fe(ue,_n),ue.write(Oe.sessionPresent?u.SESSIONPRESENT_HEADER:d),ue.write(c.from([kt])),ie!=null&&ie.write(),!0}function M(Ce,ue,At){g("publish: packet: %o",Ce);const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.qos||0,jt=Oe.retain?u.RETAIN_MASK:0,_n=Oe.topic,ie=Oe.payload||f,ae=Oe.messageId,Y=Oe.properties;let k=0;if(typeof _n=="string")k+=c.byteLength(_n)+2;else if(c.isBuffer(_n))k+=_n.length+2;else return ue.destroy(new Error("Invalid topic")),!1;if(c.isBuffer(ie)?k+=ie.length:k+=c.byteLength(ie),kt&&typeof ae!="number")return ue.destroy(new Error("Invalid messageId")),!1;kt&&(k+=2);let D=null;if(Ne===5){if(D=Dt(ue,Y),!D)return!1;k+=D.length}return ue.write(u.PUBLISH_HEADER[kt][Oe.dup?1:0][jt?1:0]),Fe(ue,k),w(ue,In(_n)),ue.write(_n),kt>0&&w(ue,ae),D!=null&&D.write(),g("publish: payload: %o",ie),ue.write(ie)}function re(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.cmd||"puback",jt=Oe.messageId,_n=Oe.dup&&kt==="pubrel"?u.DUP_MASK:0;let ie=0;const ae=Oe.reasonCode,Y=Oe.properties;let k=Ne===5?3:2;if(kt==="pubrel"&&(ie=1),typeof jt!="number")return ue.destroy(new Error("Invalid messageId")),!1;let D=null;if(Ne===5&&typeof Y=="object"){if(D=de(ue,Y,At,k),!D)return!1;k+=D.length}return ue.write(u.ACKS[kt][ie][_n][0]),k===3&&(k+=ae!==0?1:-1),Fe(ue,k),w(ue,jt),Ne===5&&k!==2&&ue.write(c.from([ae])),D!==null?D.write():k===4&&ue.write(c.from([0])),!0}function F(Ce,ue,At){g("subscribe: packet: ");const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.dup?u.DUP_MASK:0,jt=Oe.messageId,_n=Oe.subscriptions,ie=Oe.properties;let ae=0;if(typeof jt!="number")return ue.destroy(new Error("Invalid messageId")),!1;ae+=2;let Y=null;if(Ne===5){if(Y=Dt(ue,ie),!Y)return!1;ae+=Y.length}if(typeof _n=="object"&&_n.length)for(let D=0;D<_n.length;D+=1){const oe=_n[D].topic,xe=_n[D].qos;if(typeof oe!="string")return ue.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof xe!="number")return ue.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(Ne===5){if(typeof(_n[D].nl||!1)!="boolean")return ue.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(_n[D].rap||!1)!="boolean")return ue.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const An=_n[D].rh||0;if(typeof An!="number"||An>2)return ue.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}ae+=c.byteLength(oe)+2+1}else return ue.destroy(new Error("Invalid subscriptions")),!1;g("subscribe: writing to stream: %o",u.SUBSCRIBE_HEADER),ue.write(u.SUBSCRIBE_HEADER[1][kt?1:0][0]),Fe(ue,ae),w(ue,jt),Y!==null&&Y.write();let k=!0;for(const D of _n){const oe=D.topic,xe=D.qos,ze=+D.nl,hn=+D.rap,An=D.rh;let Tn;pe(ue,oe),Tn=u.SUBSCRIBE_OPTIONS_QOS[xe],Ne===5&&(Tn|=ze?u.SUBSCRIBE_OPTIONS_NL:0,Tn|=hn?u.SUBSCRIBE_OPTIONS_RAP:0,Tn|=An?u.SUBSCRIBE_OPTIONS_RH[An]:0),k=ue.write(c.from([Tn]))}return k}function j(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.granted,_n=Oe.properties;let ie=0;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(ie+=2,typeof jt=="object"&&jt.length)for(let Y=0;Y<jt.length;Y+=1){if(typeof jt[Y]!="number")return ue.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return ue.destroy(new Error("Invalid qos vector")),!1;let ae=null;if(Ne===5){if(ae=de(ue,_n,At,ie),!ae)return!1;ie+=ae.length}return ue.write(u.SUBACK_HEADER),Fe(ue,ie),w(ue,kt),ae!==null&&ae.write(),ue.write(c.from(jt))}function V(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.dup?u.DUP_MASK:0,_n=Oe.unsubscriptions,ie=Oe.properties;let ae=0;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(ae+=2,typeof _n=="object"&&_n.length)for(let D=0;D<_n.length;D+=1){if(typeof _n[D]!="string")return ue.destroy(new Error("Invalid unsubscriptions")),!1;ae+=c.byteLength(_n[D])+2}else return ue.destroy(new Error("Invalid unsubscriptions")),!1;let Y=null;if(Ne===5){if(Y=Dt(ue,ie),!Y)return!1;ae+=Y.length}ue.write(u.UNSUBSCRIBE_HEADER[1][jt?1:0][0]),Fe(ue,ae),w(ue,kt),Y!==null&&Y.write();let k=!0;for(let D=0;D<_n.length;D++)k=pe(ue,_n[D]);return k}function z(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.messageId,jt=Oe.dup?u.DUP_MASK:0,_n=Oe.granted,ie=Oe.properties,ae=Oe.cmd,Y=0;let k=2;if(typeof kt!="number")return ue.destroy(new Error("Invalid messageId")),!1;if(Ne===5)if(typeof _n=="object"&&_n.length)for(let oe=0;oe<_n.length;oe+=1){if(typeof _n[oe]!="number")return ue.destroy(new Error("Invalid qos vector")),!1;k+=1}else return ue.destroy(new Error("Invalid qos vector")),!1;let D=null;if(Ne===5){if(D=de(ue,ie,At,k),!D)return!1;k+=D.length}return ue.write(u.ACKS[ae][Y][jt][0]),Fe(ue,k),w(ue,kt),D!==null&&D.write(),Ne===5&&ue.write(c.from(_n)),!0}function $(Ce,ue,At){return ue.write(u.EMPTY[Ce.cmd])}function he(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.reasonCode,jt=Oe.properties;let _n=Ne===5?1:0,ie=null;if(Ne===5){if(ie=de(ue,jt,At,_n),!ie)return!1;_n+=ie.length}return ue.write(c.from([u.codes.disconnect<<4])),Fe(ue,_n),Ne===5&&ue.write(c.from([kt])),ie!==null&&ie.write(),!0}function le(Ce,ue,At){const Ne=At?At.protocolVersion:4,Oe=Ce||{},kt=Oe.reasonCode,jt=Oe.properties;let _n=Ne===5?1:0;Ne!==5&&ue.destroy(new Error("Invalid mqtt version for auth packet"));const ie=de(ue,jt,At,_n);return ie?(_n+=ie.length,ue.write(c.from([u.codes.auth<<4])),Fe(ue,_n),ue.write(c.from([kt])),ie!==null&&ie.write(),!0):!1}const Ie={};function Fe(Ce,ue){if(ue>u.VARBYTEINT_MAX)return Ce.destroy(new Error(`Invalid variable byte integer: ${ue}`)),!1;let At=Ie[ue];return At||(At=b(ue),ue<16384&&(Ie[ue]=At)),g("writeVarByteInt: writing to stream: %o",At),Ce.write(At)}function pe(Ce,ue){const At=c.byteLength(ue);return w(Ce,At),g("writeString: %s",ue),Ce.write(ue,"utf8")}function Lt(Ce,ue,At){pe(Ce,ue),pe(Ce,At)}function _e(Ce,ue){return g("writeNumberCached: number: %d",ue),g("writeNumberCached: %o",p[ue]),Ce.write(p[ue])}function Et(Ce,ue){const At=y(ue);return g("writeNumberGenerated: %o",At),Ce.write(At)}function Cn(Ce,ue){const At=A(ue);return g("write4ByteNumber: %o",At),Ce.write(At)}function vn(Ce,ue){typeof ue=="string"?pe(Ce,ue):ue?(w(Ce,ue.length),Ce.write(ue)):w(Ce,0)}function Dt(Ce,ue){if(typeof ue!="object"||ue.length!=null)return{length:1,write(){Pt(Ce,{},0)}};let At=0;function Ne(kt,jt){const _n=u.propertiesTypes[kt];let ie=0;switch(_n){case"byte":{if(typeof jt!="boolean")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+1;break}case"int8":{if(typeof jt!="number"||jt<0||jt>255)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+1;break}case"binary":{if(jt&&jt===null)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+c.byteLength(jt)+2;break}case"int16":{if(typeof jt!="number"||jt<0||jt>65535)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+2;break}case"int32":{if(typeof jt!="number"||jt<0||jt>4294967295)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+4;break}case"var":{if(typeof jt!="number"||jt<0||jt>268435455)return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+c.byteLength(b(jt));break}case"string":{if(typeof jt!="string")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=1+2+c.byteLength(jt.toString());break}case"pair":{if(typeof jt!="object")return Ce.destroy(new Error(`Invalid ${kt}: ${jt}`)),!1;ie+=Object.getOwnPropertyNames(jt).reduce((ae,Y)=>{const k=jt[Y];return Array.isArray(k)?ae+=k.reduce((D,oe)=>(D+=1+2+c.byteLength(Y.toString())+2+c.byteLength(oe.toString()),D),0):ae+=1+2+c.byteLength(Y.toString())+2+c.byteLength(jt[Y].toString()),ae},0);break}default:return Ce.destroy(new Error(`Invalid property ${kt}: ${jt}`)),!1}return ie}if(ue)for(const kt in ue){let jt=0,_n=0;const ie=ue[kt];if(Array.isArray(ie))for(let ae=0;ae<ie.length;ae++){if(_n=Ne(kt,ie[ae]),!_n)return!1;jt+=_n}else{if(_n=Ne(kt,ie),!_n)return!1;jt=_n}if(!jt)return!1;At+=jt}return{length:c.byteLength(b(At))+At,write(){Pt(Ce,ue,At)}}}function de(Ce,ue,At,Ne){const Oe=["reasonString","userProperties"],kt=At&&At.properties&&At.properties.maximumPacketSize?At.properties.maximumPacketSize:0;let jt=Dt(Ce,ue);if(kt)for(;Ne+jt.length>kt;){const _n=Oe.shift();if(_n&&ue[_n])delete ue[_n],jt=Dt(Ce,ue);else return!1}return jt}function qe(Ce,ue,At){switch(u.propertiesTypes[ue]){case"byte":{Ce.write(c.from([u.properties[ue]])),Ce.write(c.from([+At]));break}case"int8":{Ce.write(c.from([u.properties[ue]])),Ce.write(c.from([At]));break}case"binary":{Ce.write(c.from([u.properties[ue]])),vn(Ce,At);break}case"int16":{Ce.write(c.from([u.properties[ue]])),w(Ce,At);break}case"int32":{Ce.write(c.from([u.properties[ue]])),Cn(Ce,At);break}case"var":{Ce.write(c.from([u.properties[ue]])),Fe(Ce,At);break}case"string":{Ce.write(c.from([u.properties[ue]])),pe(Ce,At);break}case"pair":{Object.getOwnPropertyNames(At).forEach(Oe=>{const kt=At[Oe];Array.isArray(kt)?kt.forEach(jt=>{Ce.write(c.from([u.properties[ue]])),Lt(Ce,Oe.toString(),jt.toString())}):(Ce.write(c.from([u.properties[ue]])),Lt(Ce,Oe.toString(),kt.toString()))});break}default:return Ce.destroy(new Error(`Invalid property ${ue} value: ${At}`)),!1}}function Pt(Ce,ue,At){Fe(Ce,At);for(const Ne in ue)if(Object.prototype.hasOwnProperty.call(ue,Ne)&&ue[Ne]!==null){const Oe=ue[Ne];if(Array.isArray(Oe))for(let kt=0;kt<Oe.length;kt++)qe(Ce,Ne,Oe[kt]);else qe(Ce,Ne,Oe)}}function In(Ce){return Ce?Ce instanceof c?Ce.length:c.byteLength(Ce):0}function $e(Ce){return typeof Ce=="string"||Ce instanceof c}o.exports=S},{"./constants":73,"./numbers":93,buffer:29,debug:30,"process-nextick-args":101}],97:[function(i,o,a){var u=1e3,c=u*60,f=c*60,d=f*24,h=d*7,v=d*365.25;o.exports=function(b,A){A=A||{};var w=typeof b;if(w==="string"&&b.length>0)return g(b);if(w==="number"&&isFinite(b))return A.long?y(b):p(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function g(b){if(b=String(b),!(b.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(A){var w=parseFloat(A[1]),T=(A[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return w*v;case"weeks":case"week":case"w":return w*h;case"days":case"day":case"d":return w*d;case"hours":case"hour":case"hrs":case"hr":case"h":return w*f;case"minutes":case"minute":case"mins":case"min":case"m":return w*c;case"seconds":case"second":case"secs":case"sec":case"s":return w*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function p(b){var A=Math.abs(b);return A>=d?Math.round(b/d)+"d":A>=f?Math.round(b/f)+"h":A>=c?Math.round(b/c)+"m":A>=u?Math.round(b/u)+"s":b+"ms"}function y(b){var A=Math.abs(b);return A>=d?_(b,A,d,"day"):A>=f?_(b,A,f,"hour"):A>=c?_(b,A,c,"minute"):A>=u?_(b,A,u,"second"):b+" ms"}function _(b,A,w,T){var S=A>=w*1.5;return Math.round(b/w)+" "+T+(S?"s":"")}},{}],98:[function(i,o,a){const u=i("./lib/number-allocator.js");o.exports.NumberAllocator=u},{"./lib/number-allocator.js":99}],99:[function(i,o,a){const u=i("js-sdsl").OrderedSet,c=i("debug")("number-allocator:trace"),f=i("debug")("number-allocator:error");function d(v,g){this.low=v,this.high=g}d.prototype.equals=function(v){return this.low===v.low&&this.high===v.high},d.prototype.compare=function(v){return this.low<v.low&&this.high<v.low?-1:v.low<this.low&&v.high<this.low?1:0};function h(v,g){if(!(this instanceof h))return new h(v,g);this.min=v,this.max=g,this.ss=new u([],(p,y)=>p.compare(y)),c("Create"),this.clear()}h.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},h.prototype.alloc=function(){if(this.ss.size()===0)return c("alloc():empty"),null;const v=this.ss.begin(),g=v.pointer.low,p=v.pointer.high,y=g;return y+1<=p?this.ss.updateKeyByIterator(v,new d(g+1,p)):this.ss.eraseElementByPos(0),c("alloc():"+y),y},h.prototype.use=function(v){const g=new d(v,v),p=this.ss.lowerBound(g);if(!p.equals(this.ss.end())){const y=p.pointer.low,_=p.pointer.high;return p.pointer.equals(g)?(this.ss.eraseElementByIterator(p),c("use():"+v),!0):y>v?!1:y===v?(this.ss.updateKeyByIterator(p,new d(y+1,_)),c("use():"+v),!0):_===v?(this.ss.updateKeyByIterator(p,new d(y,_-1)),c("use():"+v),!0):(this.ss.updateKeyByIterator(p,new d(v+1,_)),this.ss.insert(new d(y,v-1)),c("use():"+v),!0)}return c("use():failed"),!1},h.prototype.free=function(v){if(v<this.min||v>this.max){f("free():"+v+" is out of range");return}const g=new d(v,v),p=this.ss.upperBound(g);if(p.equals(this.ss.end())){if(p.equals(this.ss.begin())){this.ss.insert(g);return}p.pre();const y=p.pointer.high;p.pointer.high+1===v?this.ss.updateKeyByIterator(p,new d(y,v)):this.ss.insert(g)}else if(p.equals(this.ss.begin()))if(v+1===p.pointer.low){const y=p.pointer.high;this.ss.updateKeyByIterator(p,new d(v,y))}else this.ss.insert(g);else{const y=p.pointer.low,_=p.pointer.high;p.pre();const b=p.pointer.low;p.pointer.high+1===v?v+1===y?(this.ss.eraseElementByIterator(p),this.ss.updateKeyByIterator(p,new d(b,_))):this.ss.updateKeyByIterator(p,new d(b,v)):v+1===y?(this.ss.eraseElementByIterator(p.next()),this.ss.insert(new d(v,_))):this.ss.insert(g)}c("free():"+v)},h.prototype.clear=function(){c("clear()"),this.ss.clear(),this.ss.insert(new d(this.min,this.max))},h.prototype.intervalCount=function(){return this.ss.size()},h.prototype.dump=function(){console.log("length:"+this.ss.size());for(const v of this.ss)console.log(v)},o.exports=h},{debug:30,"js-sdsl":69}],100:[function(i,o,a){var u=i("wrappy");o.exports=u(c),o.exports.strict=u(f),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return f(this)},configurable:!0})});function c(d){var h=function(){return h.called?h.value:(h.called=!0,h.value=d.apply(this,arguments))};return h.called=!1,h}function f(d){var h=function(){if(h.called)throw new Error(h.onceError);return h.called=!0,h.value=d.apply(this,arguments)},v=d.name||"Function wrapped with `once`";return h.onceError=v+" shouldn't be called more than once",h.called=!1,h}},{wrappy:140}],101:[function(i,o,a){(function(u){(function(){typeof u>"u"||!u.version||u.version.indexOf("v0.")===0||u.version.indexOf("v1.")===0&&u.version.indexOf("v1.8.")!==0?o.exports={nextTick:c}:o.exports=u;function c(f,d,h,v){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,p,y;switch(g){case 0:case 1:return u.nextTick(f);case 2:return u.nextTick(function(){f.call(null,d)});case 3:return u.nextTick(function(){f.call(null,d,h)});case 4:return u.nextTick(function(){f.call(null,d,h,v)});default:for(p=new Array(g-1),y=0;y<p.length;)p[y++]=arguments[y];return u.nextTick(function(){f.apply(null,p)})}}}).call(this)}).call(this,i("_process"))},{_process:102}],102:[function(i,o,a){var u=o.exports={},c,f;function d(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?c=setTimeout:c=d}catch{c=d}try{typeof clearTimeout=="function"?f=clearTimeout:f=h}catch{f=h}})();function v(x){if(c===setTimeout)return setTimeout(x,0);if((c===d||!c)&&setTimeout)return c=setTimeout,setTimeout(x,0);try{return c(x,0)}catch{try{return c.call(null,x,0)}catch{return c.call(this,x,0)}}}function g(x){if(f===clearTimeout)return clearTimeout(x);if((f===h||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(x);try{return f(x)}catch{try{return f.call(null,x)}catch{return f.call(this,x)}}}var p=[],y=!1,_,b=-1;function A(){!y||!_||(y=!1,_.length?p=_.concat(p):b=-1,p.length&&w())}function w(){if(!y){var x=v(A);y=!0;for(var O=p.length;O;){for(_=p,p=[];++b<O;)_&&_[b].run();b=-1,O=p.length}_=null,y=!1,g(x)}}u.nextTick=function(x){var O=new Array(arguments.length-1);if(arguments.length>1)for(var L=1;L<arguments.length;L++)O[L-1]=arguments[L];p.push(new T(x,O)),p.length===1&&!y&&v(w)};function T(x,O){this.fun=x,this.array=O}T.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={};function S(){}u.on=S,u.addListener=S,u.once=S,u.off=S,u.removeListener=S,u.removeAllListeners=S,u.emit=S,u.prependListener=S,u.prependOnceListener=S,u.listeners=function(x){return[]},u.binding=function(x){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(x){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],103:[function(i,o,a){(function(u){(function(){(function(c){var f=typeof a=="object"&&a&&!a.nodeType&&a,d=typeof o=="object"&&o&&!o.nodeType&&o,h=typeof u=="object"&&u;(h.global===h||h.window===h||h.self===h)&&(c=h);var v,g=2147483647,p=36,y=1,_=26,b=38,A=700,w=72,T=128,S="-",x=/^xn--/,O=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},re=p-y,F=Math.floor,j=String.fromCharCode,V;function z(Dt){throw new RangeError(M[Dt])}function $(Dt,de){for(var qe=Dt.length,Pt=[];qe--;)Pt[qe]=de(Dt[qe]);return Pt}function he(Dt,de){var qe=Dt.split("@"),Pt="";qe.length>1&&(Pt=qe[0]+"@",Dt=qe[1]),Dt=Dt.replace(L,".");var In=Dt.split("."),$e=$(In,de).join(".");return Pt+$e}function le(Dt){for(var de=[],qe=0,Pt=Dt.length,In,$e;qe<Pt;)In=Dt.charCodeAt(qe++),In>=55296&&In<=56319&&qe<Pt?($e=Dt.charCodeAt(qe++),($e&64512)==56320?de.push(((In&1023)<<10)+($e&1023)+65536):(de.push(In),qe--)):de.push(In);return de}function Ie(Dt){return $(Dt,function(de){var qe="";return de>65535&&(de-=65536,qe+=j(de>>>10&1023|55296),de=56320|de&1023),qe+=j(de),qe}).join("")}function Fe(Dt){return Dt-48<10?Dt-22:Dt-65<26?Dt-65:Dt-97<26?Dt-97:p}function pe(Dt,de){return Dt+22+75*(Dt<26)-((de!=0)<<5)}function Lt(Dt,de,qe){var Pt=0;for(Dt=qe?F(Dt/A):Dt>>1,Dt+=F(Dt/de);Dt>re*_>>1;Pt+=p)Dt=F(Dt/re);return F(Pt+(re+1)*Dt/(Dt+b))}function _e(Dt){var de=[],qe=Dt.length,Pt,In=0,$e=T,Ce=w,ue,At,Ne,Oe,kt,jt,_n,ie,ae;for(ue=Dt.lastIndexOf(S),ue<0&&(ue=0),At=0;At<ue;++At)Dt.charCodeAt(At)>=128&&z("not-basic"),de.push(Dt.charCodeAt(At));for(Ne=ue>0?ue+1:0;Ne<qe;){for(Oe=In,kt=1,jt=p;Ne>=qe&&z("invalid-input"),_n=Fe(Dt.charCodeAt(Ne++)),(_n>=p||_n>F((g-In)/kt))&&z("overflow"),In+=_n*kt,ie=jt<=Ce?y:jt>=Ce+_?_:jt-Ce,!(_n<ie);jt+=p)ae=p-ie,kt>F(g/ae)&&z("overflow"),kt*=ae;Pt=de.length+1,Ce=Lt(In-Oe,Pt,Oe==0),F(In/Pt)>g-$e&&z("overflow"),$e+=F(In/Pt),In%=Pt,de.splice(In++,0,$e)}return Ie(de)}function Et(Dt){var de,qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt,jt=[],_n,ie,ae,Y;for(Dt=le(Dt),_n=Dt.length,de=T,qe=0,$e=w,Ce=0;Ce<_n;++Ce)kt=Dt[Ce],kt<128&&jt.push(j(kt));for(Pt=In=jt.length,In&&jt.push(S);Pt<_n;){for(ue=g,Ce=0;Ce<_n;++Ce)kt=Dt[Ce],kt>=de&&kt<ue&&(ue=kt);for(ie=Pt+1,ue-de>F((g-qe)/ie)&&z("overflow"),qe+=(ue-de)*ie,de=ue,Ce=0;Ce<_n;++Ce)if(kt=Dt[Ce],kt<de&&++qe>g&&z("overflow"),kt==de){for(At=qe,Ne=p;Oe=Ne<=$e?y:Ne>=$e+_?_:Ne-$e,!(At<Oe);Ne+=p)Y=At-Oe,ae=p-Oe,jt.push(j(pe(Oe+Y%ae,0))),At=F(Y/ae);jt.push(j(pe(At,0))),$e=Lt(qe,ie,Pt==In),qe=0,++Pt}++qe,++de}return jt.join("")}function Cn(Dt){return he(Dt,function(de){return x.test(de)?_e(de.slice(4).toLowerCase()):de})}function vn(Dt){return he(Dt,function(de){return O.test(de)?"xn--"+Et(de):de})}if(v={version:"1.4.1",ucs2:{decode:le,encode:Ie},decode:_e,encode:Et,toASCII:vn,toUnicode:Cn},f&&d)if(o.exports==f)d.exports=v;else for(V in v)v.hasOwnProperty(V)&&(f[V]=v[V]);else c.punycode=v})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],104:[function(i,o,a){function u(f,d){return Object.prototype.hasOwnProperty.call(f,d)}o.exports=function(f,d,h,v){d=d||"&",h=h||"=";var g={};if(typeof f!="string"||f.length===0)return g;var p=/\+/g;f=f.split(d);var y=1e3;v&&typeof v.maxKeys=="number"&&(y=v.maxKeys);var _=f.length;y>0&&_>y&&(_=y);for(var b=0;b<_;++b){var A=f[b].replace(p,"%20"),w=A.indexOf(h),T,S,x,O;w>=0?(T=A.substr(0,w),S=A.substr(w+1)):(T=A,S=""),x=decodeURIComponent(T),O=decodeURIComponent(S),u(g,x)?c(g[x])?g[x].push(O):g[x]=[g[x],O]:g[x]=O}return g};var c=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"}},{}],105:[function(i,o,a){var u=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};o.exports=function(h,v,g,p){return v=v||"&",g=g||"=",h===null&&(h=void 0),typeof h=="object"?f(d(h),function(y){var _=encodeURIComponent(u(y))+g;return c(h[y])?f(h[y],function(b){return _+encodeURIComponent(u(b))}).join(v):_+encodeURIComponent(u(h[y]))}).join(v):p?encodeURIComponent(u(p))+g+encodeURIComponent(u(h)):""};var c=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function f(h,v){if(h.map)return h.map(v);for(var g=[],p=0;p<h.length;p++)g.push(v(h[p],p));return g}var d=Object.keys||function(h){var v=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&v.push(g);return v}},{}],106:[function(i,o,a){a.decode=a.parse=i("./decode"),a.encode=a.stringify=i("./encode")},{"./decode":104,"./encode":105}],107:[function(i,o,a){const{AbortError:u,codes:c}=i("../../ours/errors"),{isNodeStream:f,isWebStream:d,kControllerErrorFunction:h}=i("./utils"),v=i("./end-of-stream"),{ERR_INVALID_ARG_TYPE:g}=c,p=(y,_)=>{if(typeof y!="object"||!("aborted"in y))throw new g(_,"AbortSignal",y)};o.exports.addAbortSignal=function(_,b){if(p(_,"signal"),!f(b)&&!d(b))throw new g("stream",["ReadableStream","WritableStream","Stream"],b);return o.exports.addAbortSignalNoValidate(_,b)},o.exports.addAbortSignalNoValidate=function(y,_){if(typeof y!="object"||!("aborted"in y))return _;const b=f(_)?()=>{_.destroy(new u(void 0,{cause:y.reason}))}:()=>{_[h](new u(void 0,{cause:y.reason}))};return y.aborted?b():(y.addEventListener("abort",b),v(_,()=>y.removeEventListener("abort",b))),_}},{"../../ours/errors":126,"./end-of-stream":113,"./utils":122}],108:[function(i,o,a){const{StringPrototypeSlice:u,SymbolIterator:c,TypedArrayPrototypeSet:f,Uint8Array:d}=i("../../ours/primordials"),{Buffer:h}=i("buffer"),{inspect:v}=i("../../ours/util");o.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const y={data:p,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}unshift(p){const y={data:p,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let y=this.head,_=""+y.data;for(;(y=y.next)!==null;)_+=p+y.data;return _}concat(p){if(this.length===0)return h.alloc(0);const y=h.allocUnsafe(p>>>0);let _=this.head,b=0;for(;_;)f(y,_.data,b),b+=_.data.length,_=_.next;return y}consume(p,y){const _=this.head.data;if(p<_.length){const b=_.slice(0,p);return this.head.data=_.slice(p),b}return p===_.length?this.shift():y?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[c](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let y="",_=this.head,b=0;do{const A=_.data;if(p>A.length)y+=A,p-=A.length;else{p===A.length?(y+=A,++b,_.next?this.head=_.next:this.head=this.tail=null):(y+=u(A,0,p),this.head=_,_.data=u(A,p));break}++b}while((_=_.next)!==null);return this.length-=b,y}_getBuffer(p){const y=h.allocUnsafe(p),_=p;let b=this.head,A=0;do{const w=b.data;if(p>w.length)f(y,w,_-p),p-=w.length;else{p===w.length?(f(y,w,_-p),++A,b.next?this.head=b.next:this.head=this.tail=null):(f(y,new d(w.buffer,w.byteOffset,p),_-p),this.head=b,b.data=w.slice(p));break}++A}while((b=b.next)!==null);return this.length-=A,y}[Symbol.for("nodejs.util.inspect.custom")](p,y){return v(this,{...y,depth:0,customInspect:!1})}}},{"../../ours/primordials":127,"../../ours/util":128,buffer:29}],109:[function(i,o,a){const{pipeline:u}=i("./pipeline"),c=i("./duplex"),{destroyer:f}=i("./destroy"),{isNodeStream:d,isReadable:h,isWritable:v,isWebStream:g,isTransformStream:p,isWritableStream:y,isReadableStream:_}=i("./utils"),{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:A,ERR_MISSING_ARGS:w}}=i("../../ours/errors"),T=i("./end-of-stream");o.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return c.from(x[0]);const O=[...x];if(typeof x[0]=="function"&&(x[0]=c.from(x[0])),typeof x[x.length-1]=="function"){const Ie=x.length-1;x[Ie]=c.from(x[Ie])}for(let Ie=0;Ie<x.length;++Ie)if(!(!d(x[Ie])&&!g(x[Ie]))){if(Ie<x.length-1&&!(h(x[Ie])||_(x[Ie])||p(x[Ie])))throw new A(`streams[${Ie}]`,O[Ie],"must be readable");if(Ie>0&&!(v(x[Ie])||y(x[Ie])||p(x[Ie])))throw new A(`streams[${Ie}]`,O[Ie],"must be writable")}let L,M,re,F,j;function V(Ie){const Fe=F;F=null,Fe?Fe(Ie):Ie?j.destroy(Ie):!le&&!he&&j.destroy()}const z=x[0],$=u(x,V),he=!!(v(z)||y(z)||p(z)),le=!!(h($)||_($)||p($));if(j=new c({writableObjectMode:!!(z!=null&&z.writableObjectMode),readableObjectMode:!!($!=null&&$.writableObjectMode),writable:he,readable:le}),he){if(d(z))j._write=function(Fe,pe,Lt){z.write(Fe,pe)?Lt():L=Lt},j._final=function(Fe){z.end(),M=Fe},z.on("drain",function(){if(L){const Fe=L;L=null,Fe()}});else if(g(z)){const pe=(p(z)?z.writable:z).getWriter();j._write=async function(Lt,_e,Et){try{await pe.ready,pe.write(Lt).catch(()=>{}),Et()}catch(Cn){Et(Cn)}},j._final=async function(Lt){try{await pe.ready,pe.close().catch(()=>{}),M=Lt}catch(_e){Lt(_e)}}}const Ie=p($)?$.readable:$;T(Ie,()=>{if(M){const Fe=M;M=null,Fe()}})}if(le){if(d($))$.on("readable",function(){if(re){const Ie=re;re=null,Ie()}}),$.on("end",function(){j.push(null)}),j._read=function(){for(;;){const Ie=$.read();if(Ie===null){re=j._read;return}if(!j.push(Ie))return}};else if(g($)){const Fe=(p($)?$.readable:$).getReader();j._read=async function(){for(;;)try{const{value:pe,done:Lt}=await Fe.read();if(!j.push(pe))return;if(Lt){j.push(null);return}}catch{return}}}}return j._destroy=function(Ie,Fe){!Ie&&F!==null&&(Ie=new b),re=null,L=null,M=null,F===null?Fe(Ie):(F=Fe,d($)&&f($,Ie))},j}},{"../../ours/errors":126,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./pipeline":118,"./utils":122}],110:[function(i,o,a){const u=i("process/"),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:f},AbortError:d}=i("../../ours/errors"),{Symbol:h}=i("../../ours/primordials"),{kDestroyed:v,isDestroyed:g,isFinished:p,isServerRequest:y}=i("./utils"),_=h("kDestroy"),b=h("kConstruct");function A(le,Ie,Fe){le&&(le.stack,Ie&&!Ie.errored&&(Ie.errored=le),Fe&&!Fe.errored&&(Fe.errored=le))}function w(le,Ie){const Fe=this._readableState,pe=this._writableState,Lt=pe||Fe;return pe!=null&&pe.destroyed||Fe!=null&&Fe.destroyed?(typeof Ie=="function"&&Ie(),this):(A(le,pe,Fe),pe&&(pe.destroyed=!0),Fe&&(Fe.destroyed=!0),Lt.constructed?T(this,le,Ie):this.once(_,function(_e){T(this,c(_e,le),Ie)}),this)}function T(le,Ie,Fe){let pe=!1;function Lt(_e){if(pe)return;pe=!0;const Et=le._readableState,Cn=le._writableState;A(_e,Cn,Et),Cn&&(Cn.closed=!0),Et&&(Et.closed=!0),typeof Fe=="function"&&Fe(_e),_e?u.nextTick(S,le,_e):u.nextTick(x,le)}try{le._destroy(Ie||null,Lt)}catch(_e){Lt(_e)}}function S(le,Ie){O(le,Ie),x(le)}function x(le){const Ie=le._readableState,Fe=le._writableState;Fe&&(Fe.closeEmitted=!0),Ie&&(Ie.closeEmitted=!0),(Fe!=null&&Fe.emitClose||Ie!=null&&Ie.emitClose)&&le.emit("close")}function O(le,Ie){const Fe=le._readableState,pe=le._writableState;pe!=null&&pe.errorEmitted||Fe!=null&&Fe.errorEmitted||(pe&&(pe.errorEmitted=!0),Fe&&(Fe.errorEmitted=!0),le.emit("error",Ie))}function L(){const le=this._readableState,Ie=this._writableState;le&&(le.constructed=!0,le.closed=!1,le.closeEmitted=!1,le.destroyed=!1,le.errored=null,le.errorEmitted=!1,le.reading=!1,le.ended=le.readable===!1,le.endEmitted=le.readable===!1),Ie&&(Ie.constructed=!0,Ie.destroyed=!1,Ie.closed=!1,Ie.closeEmitted=!1,Ie.errored=null,Ie.errorEmitted=!1,Ie.finalCalled=!1,Ie.prefinished=!1,Ie.ended=Ie.writable===!1,Ie.ending=Ie.writable===!1,Ie.finished=Ie.writable===!1)}function M(le,Ie,Fe){const pe=le._readableState,Lt=le._writableState;if(Lt!=null&&Lt.destroyed||pe!=null&&pe.destroyed)return this;pe!=null&&pe.autoDestroy||Lt!=null&&Lt.autoDestroy?le.destroy(Ie):Ie&&(Ie.stack,Lt&&!Lt.errored&&(Lt.errored=Ie),pe&&!pe.errored&&(pe.errored=Ie),Fe?u.nextTick(O,le,Ie):O(le,Ie))}function re(le,Ie){if(typeof le._construct!="function")return;const Fe=le._readableState,pe=le._writableState;Fe&&(Fe.constructed=!1),pe&&(pe.constructed=!1),le.once(b,Ie),!(le.listenerCount(b)>1)&&u.nextTick(F,le)}function F(le){let Ie=!1;function Fe(pe){if(Ie){M(le,pe??new f);return}Ie=!0;const Lt=le._readableState,_e=le._writableState,Et=_e||Lt;Lt&&(Lt.constructed=!0),_e&&(_e.constructed=!0),Et.destroyed?le.emit(_,pe):pe?M(le,pe,!0):u.nextTick(j,le)}try{le._construct(pe=>{u.nextTick(Fe,pe)})}catch(pe){u.nextTick(Fe,pe)}}function j(le){le.emit(b)}function V(le){return(le==null?void 0:le.setHeader)&&typeof le.abort=="function"}function z(le){le.emit("close")}function $(le,Ie){le.emit("error",Ie),u.nextTick(z,le)}function he(le,Ie){!le||g(le)||(!Ie&&!p(le)&&(Ie=new d),y(le)?(le.socket=null,le.destroy(Ie)):V(le)?le.abort():V(le.req)?le.req.abort():typeof le.destroy=="function"?le.destroy(Ie):typeof le.close=="function"?le.close():Ie?u.nextTick($,le,Ie):u.nextTick(z,le),le.destroyed||(le[v]=!0))}o.exports={construct:re,destroyer:he,destroy:w,undestroy:L,errorOrDestroy:M}},{"../../ours/errors":126,"../../ours/primordials":127,"./utils":122,"process/":102}],111:[function(i,o,a){const{ObjectDefineProperties:u,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:f,ObjectSetPrototypeOf:d}=i("../../ours/primordials");o.exports=g;const h=i("./readable"),v=i("./writable");d(g.prototype,h.prototype),d(g,h);{const b=f(v.prototype);for(let A=0;A<b.length;A++){const w=b[A];g.prototype[w]||(g.prototype[w]=v.prototype[w])}}function g(b){if(!(this instanceof g))return new g(b);h.call(this,b),v.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}u(g.prototype,{writable:{__proto__:null,...c(v.prototype,"writable")},writableHighWaterMark:{__proto__:null,...c(v.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...c(v.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...c(v.prototype,"writableBuffer")},writableLength:{__proto__:null,...c(v.prototype,"writableLength")},writableFinished:{__proto__:null,...c(v.prototype,"writableFinished")},writableCorked:{__proto__:null,...c(v.prototype,"writableCorked")},writableEnded:{__proto__:null,...c(v.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...c(v.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let p;function y(){return p===void 0&&(p={}),p}g.fromWeb=function(b,A){return y().newStreamDuplexFromReadableWritablePair(b,A)},g.toWeb=function(b){return y().newReadableWritablePairFromDuplex(b)};let _;g.from=function(b){return _||(_=i("./duplexify")),_(b,"body")}},{"../../ours/primordials":127,"./duplexify":112,"./readable":119,"./writable":123}],112:[function(i,o,a){const u=i("process/"),c=i("buffer"),{isReadable:f,isWritable:d,isIterable:h,isNodeStream:v,isReadableNodeStream:g,isWritableNodeStream:p,isDuplexNodeStream:y}=i("./utils"),_=i("./end-of-stream"),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:w}}=i("../../ours/errors"),{destroyer:T}=i("./destroy"),S=i("./duplex"),x=i("./readable"),{createDeferredPromise:O}=i("../../ours/util"),L=i("./from"),M=globalThis.Blob||c.Blob,re=typeof M<"u"?function(le){return le instanceof M}:function(le){return!1},F=globalThis.AbortController||i("abort-controller").AbortController,{FunctionPrototypeCall:j}=i("../../ours/primordials");class V extends S{constructor(le){super(le),(le==null?void 0:le.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(le==null?void 0:le.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}o.exports=function he(le,Ie){if(y(le))return le;if(g(le))return $({readable:le});if(p(le))return $({writable:le});if(v(le))return $({writable:!1,readable:!1});if(typeof le=="function"){const{value:pe,write:Lt,final:_e,destroy:Et}=z(le);if(h(pe))return L(V,pe,{objectMode:!0,write:Lt,final:_e,destroy:Et});const Cn=pe==null?void 0:pe.then;if(typeof Cn=="function"){let vn;const Dt=j(Cn,pe,de=>{if(de!=null)throw new w("nully","body",de)},de=>{T(vn,de)});return vn=new V({objectMode:!0,readable:!1,write:Lt,final(de){_e(async()=>{try{await Dt,u.nextTick(de,null)}catch(qe){u.nextTick(de,qe)}})},destroy:Et})}throw new w("Iterable, AsyncIterable or AsyncFunction",Ie,pe)}if(re(le))return he(le.arrayBuffer());if(h(le))return L(V,le,{objectMode:!0,writable:!1});if(typeof(le==null?void 0:le.writable)=="object"||typeof(le==null?void 0:le.readable)=="object"){const pe=le!=null&&le.readable?g(le==null?void 0:le.readable)?le==null?void 0:le.readable:he(le.readable):void 0,Lt=le!=null&&le.writable?p(le==null?void 0:le.writable)?le==null?void 0:le.writable:he(le.writable):void 0;return $({readable:pe,writable:Lt})}const Fe=le==null?void 0:le.then;if(typeof Fe=="function"){let pe;return j(Fe,le,Lt=>{Lt!=null&&pe.push(Lt),pe.push(null)},Lt=>{T(pe,Lt)}),pe=new V({objectMode:!0,writable:!1,read(){}})}throw new A(Ie,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],le)};function z(he){let{promise:le,resolve:Ie}=O();const Fe=new F,pe=Fe.signal;return{value:he(async function*(){for(;;){const _e=le;le=null;const{chunk:Et,done:Cn,cb:vn}=await _e;if(u.nextTick(vn),Cn)return;if(pe.aborted)throw new b(void 0,{cause:pe.reason});({promise:le,resolve:Ie}=O()),yield Et}}(),{signal:pe}),write(_e,Et,Cn){const vn=Ie;Ie=null,vn({chunk:_e,done:!1,cb:Cn})},final(_e){const Et=Ie;Ie=null,Et({done:!0,cb:_e})},destroy(_e,Et){Fe.abort(),Et(_e)}}}function $(he){const le=he.readable&&typeof he.readable.read!="function"?x.wrap(he.readable):he.readable,Ie=he.writable;let Fe=!!f(le),pe=!!d(Ie),Lt,_e,Et,Cn,vn;function Dt(de){const qe=Cn;Cn=null,qe?qe(de):de&&vn.destroy(de)}return vn=new V({readableObjectMode:!!(le!=null&&le.readableObjectMode),writableObjectMode:!!(Ie!=null&&Ie.writableObjectMode),readable:Fe,writable:pe}),pe&&(_(Ie,de=>{pe=!1,de&&T(le,de),Dt(de)}),vn._write=function(de,qe,Pt){Ie.write(de,qe)?Pt():Lt=Pt},vn._final=function(de){Ie.end(),_e=de},Ie.on("drain",function(){if(Lt){const de=Lt;Lt=null,de()}}),Ie.on("finish",function(){if(_e){const de=_e;_e=null,de()}})),Fe&&(_(le,de=>{Fe=!1,de&&T(le,de),Dt(de)}),le.on("readable",function(){if(Et){const de=Et;Et=null,de()}}),le.on("end",function(){vn.push(null)}),vn._read=function(){for(;;){const de=le.read();if(de===null){Et=vn._read;return}if(!vn.push(de))return}}),vn._destroy=function(de,qe){!de&&Cn!==null&&(de=new b),Et=null,Lt=null,_e=null,Cn===null?qe(de):(Cn=qe,T(Ie,de),T(le,de))},vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./readable":119,"./utils":122,"abort-controller":24,buffer:29,"process/":102}],113:[function(i,o,a){const u=i("process/"),{AbortError:c,codes:f}=i("../../ours/errors"),{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:h}=f,{kEmptyObject:v,once:g}=i("../../ours/util"),{validateAbortSignal:p,validateFunction:y,validateObject:_,validateBoolean:b}=i("../validators"),{Promise:A,PromisePrototypeThen:w}=i("../../ours/primordials"),{isClosed:T,isReadable:S,isReadableNodeStream:x,isReadableStream:O,isReadableFinished:L,isReadableErrored:M,isWritable:re,isWritableNodeStream:F,isWritableStream:j,isWritableFinished:V,isWritableErrored:z,isNodeStream:$,willEmitClose:he,kIsClosedPromise:le}=i("./utils");function Ie(Et){return Et.setHeader&&typeof Et.abort=="function"}const Fe=()=>{};function pe(Et,Cn,vn){var Dt,de;if(arguments.length===2?(vn=Cn,Cn=v):Cn==null?Cn=v:_(Cn,"options"),y(vn,"callback"),p(Cn.signal,"options.signal"),vn=g(vn),O(Et)||j(Et))return Lt(Et,Cn,vn);if(!$(Et))throw new d("stream",["ReadableStream","WritableStream","Stream"],Et);const qe=(Dt=Cn.readable)!==null&&Dt!==void 0?Dt:x(Et),Pt=(de=Cn.writable)!==null&&de!==void 0?de:F(Et),In=Et._writableState,$e=Et._readableState,Ce=()=>{Et.writable||Ne()};let ue=he(Et)&&x(Et)===qe&&F(Et)===Pt,At=V(Et,!1);const Ne=()=>{At=!0,Et.destroyed&&(ue=!1),!(ue&&(!Et.readable||qe))&&(!qe||Oe)&&vn.call(Et)};let Oe=L(Et,!1);const kt=()=>{Oe=!0,Et.destroyed&&(ue=!1),!(ue&&(!Et.writable||Pt))&&(!Pt||At)&&vn.call(Et)},jt=D=>{vn.call(Et,D)};let _n=T(Et);const ie=()=>{_n=!0;const D=z(Et)||M(Et);if(D&&typeof D!="boolean")return vn.call(Et,D);if(qe&&!Oe&&x(Et,!0)&&!L(Et,!1))return vn.call(Et,new h);if(Pt&&!At&&!V(Et,!1))return vn.call(Et,new h);vn.call(Et)},ae=()=>{_n=!0;const D=z(Et)||M(Et);if(D&&typeof D!="boolean")return vn.call(Et,D);vn.call(Et)},Y=()=>{Et.req.on("finish",Ne)};Ie(Et)?(Et.on("complete",Ne),ue||Et.on("abort",ie),Et.req?Y():Et.on("request",Y)):Pt&&!In&&(Et.on("end",Ce),Et.on("close",Ce)),!ue&&typeof Et.aborted=="boolean"&&Et.on("aborted",ie),Et.on("end",kt),Et.on("finish",Ne),Cn.error!==!1&&Et.on("error",jt),Et.on("close",ie),_n?u.nextTick(ie):In!=null&&In.errorEmitted||$e!=null&&$e.errorEmitted?ue||u.nextTick(ae):(!qe&&(!ue||S(Et))&&(At||re(Et)===!1)||!Pt&&(!ue||re(Et))&&(Oe||S(Et)===!1)||$e&&Et.req&&Et.aborted)&&u.nextTick(ae);const k=()=>{vn=Fe,Et.removeListener("aborted",ie),Et.removeListener("complete",Ne),Et.removeListener("abort",ie),Et.removeListener("request",Y),Et.req&&Et.req.removeListener("finish",Ne),Et.removeListener("end",Ce),Et.removeListener("close",Ce),Et.removeListener("finish",Ne),Et.removeListener("end",kt),Et.removeListener("error",jt),Et.removeListener("close",ie)};if(Cn.signal&&!_n){const D=()=>{const oe=vn;k(),oe.call(Et,new c(void 0,{cause:Cn.signal.reason}))};if(Cn.signal.aborted)u.nextTick(D);else{const oe=vn;vn=g((...xe)=>{Cn.signal.removeEventListener("abort",D),oe.apply(Et,xe)}),Cn.signal.addEventListener("abort",D)}}return k}function Lt(Et,Cn,vn){let Dt=!1,de=Fe;if(Cn.signal)if(de=()=>{Dt=!0,vn.call(Et,new c(void 0,{cause:Cn.signal.reason}))},Cn.signal.aborted)u.nextTick(de);else{const Pt=vn;vn=g((...In)=>{Cn.signal.removeEventListener("abort",de),Pt.apply(Et,In)}),Cn.signal.addEventListener("abort",de)}const qe=(...Pt)=>{Dt||u.nextTick(()=>vn.apply(Et,Pt))};return w(Et[le].promise,qe,qe),Fe}function _e(Et,Cn){var vn;let Dt=!1;return Cn===null&&(Cn=v),(vn=Cn)!==null&&vn!==void 0&&vn.cleanup&&(b(Cn.cleanup,"cleanup"),Dt=Cn.cleanup),new A((de,qe)=>{const Pt=pe(Et,Cn,In=>{Dt&&Pt(),In?qe(In):de()})})}o.exports=pe,o.exports.finished=_e},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./utils":122,"process/":102}],114:[function(i,o,a){const u=i("process/"),{PromisePrototypeThen:c,SymbolAsyncIterator:f,SymbolIterator:d}=i("../../ours/primordials"),{Buffer:h}=i("buffer"),{ERR_INVALID_ARG_TYPE:v,ERR_STREAM_NULL_VALUES:g}=i("../../ours/errors").codes;function p(y,_,b){let A;if(typeof _=="string"||_ instanceof h)return new y({objectMode:!0,...b,read(){this.push(_),this.push(null)}});let w;if(_&&_[f])w=!0,A=_[f]();else if(_&&_[d])w=!1,A=_[d]();else throw new v("iterable",["Iterable"],_);const T=new y({objectMode:!0,highWaterMark:1,...b});let S=!1;T._read=function(){S||(S=!0,O())},T._destroy=function(L,M){c(x(L),()=>u.nextTick(M,L),re=>u.nextTick(M,re||L))};async function x(L){const M=L!=null,re=typeof A.throw=="function";if(M&&re){const{value:F,done:j}=await A.throw(L);if(await F,j)return}if(typeof A.return=="function"){const{value:F}=await A.return();await F}}async function O(){for(;;){try{const{value:L,done:M}=w?await A.next():A.next();if(M)T.push(null);else{const re=L&&typeof L.then=="function"?await L:L;if(re===null)throw S=!1,new g;if(T.push(re))continue;S=!1}}catch(L){T.destroy(L)}break}}return T}o.exports=p},{"../../ours/errors":126,"../../ours/primordials":127,buffer:29,"process/":102}],115:[function(i,o,a){const{ArrayIsArray:u,ObjectSetPrototypeOf:c}=i("../../ours/primordials"),{EventEmitter:f}=i("events");function d(v){f.call(this,v)}c(d.prototype,f.prototype),c(d,f),d.prototype.pipe=function(v,g){const p=this;function y(x){v.writable&&v.write(x)===!1&&p.pause&&p.pause()}p.on("data",y);function _(){p.readable&&p.resume&&p.resume()}v.on("drain",_),!v._isStdio&&(!g||g.end!==!1)&&(p.on("end",A),p.on("close",w));let b=!1;function A(){b||(b=!0,v.end())}function w(){b||(b=!0,typeof v.destroy=="function"&&v.destroy())}function T(x){S(),f.listenerCount(this,"error")===0&&this.emit("error",x)}h(p,"error",T),h(v,"error",T);function S(){p.removeListener("data",y),v.removeListener("drain",_),p.removeListener("end",A),p.removeListener("close",w),p.removeListener("error",T),v.removeListener("error",T),p.removeListener("end",S),p.removeListener("close",S),v.removeListener("close",S)}return p.on("end",S),p.on("close",S),v.on("close",S),v.emit("pipe",p),v};function h(v,g,p){if(typeof v.prependListener=="function")return v.prependListener(g,p);!v._events||!v._events[g]?v.on(g,p):u(v._events[g])?v._events[g].unshift(p):v._events[g]=[p,v._events[g]]}o.exports={Stream:d,prependListener:h}},{"../../ours/primordials":127,events:49}],116:[function(i,o,a){const u=globalThis.AbortController||i("abort-controller").AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:f,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:h},AbortError:v}=i("../../ours/errors"),{validateAbortSignal:g,validateInteger:p,validateObject:y}=i("../validators"),_=i("../../ours/primordials").Symbol("kWeak"),{finished:b}=i("./end-of-stream"),A=i("./compose"),{addAbortSignalNoValidate:w}=i("./add-abort-signal"),{isWritable:T,isNodeStream:S}=i("./utils"),{ArrayPrototypePush:x,MathFloor:O,Number:L,NumberIsNaN:M,Promise:re,PromiseReject:F,PromisePrototypeThen:j,Symbol:V}=i("../../ours/primordials"),z=V("kEmpty"),$=V("kEof");function he($e,Ce){if(Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),S($e)&&!T($e))throw new c("stream",$e,"must be writable");const ue=A(this,$e);return Ce!=null&&Ce.signal&&w(Ce.signal,ue),ue}function le($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal");let ue=1;return(Ce==null?void 0:Ce.concurrency)!=null&&(ue=O(Ce.concurrency)),p(ue,"concurrency",1),async function*(){var Ne,Oe;const kt=new u,jt=this,_n=[],ie=kt.signal,ae={signal:ie},Y=()=>kt.abort();Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted&&Y(),Ce==null||(Oe=Ce.signal)===null||Oe===void 0||Oe.addEventListener("abort",Y);let k,D,oe=!1;function xe(){oe=!0}async function ze(){try{for await(let Tn of jt){var hn;if(oe)return;if(ie.aborted)throw new v;try{Tn=$e(Tn,ae)}catch(Rn){Tn=F(Rn)}Tn!==z&&(typeof((hn=Tn)===null||hn===void 0?void 0:hn.catch)=="function"&&Tn.catch(xe),_n.push(Tn),k&&(k(),k=null),!oe&&_n.length&&_n.length>=ue&&await new re(Rn=>{D=Rn}))}_n.push($)}catch(Tn){const Rn=F(Tn);j(Rn,void 0,xe),_n.push(Rn)}finally{var An;oe=!0,k&&(k(),k=null),Ce==null||(An=Ce.signal)===null||An===void 0||An.removeEventListener("abort",Y)}}ze();try{for(;;){for(;_n.length>0;){const hn=await _n[0];if(hn===$)return;if(ie.aborted)throw new v;hn!==z&&(yield hn),_n.shift(),D&&(D(),D=null)}await new re(hn=>{k=hn})}}finally{kt.abort(),oe=!0,D&&(D(),D=null)}}.call(this)}function Ie($e=void 0){return $e!=null&&y($e,"options"),($e==null?void 0:$e.signal)!=null&&g($e.signal,"options.signal"),async function*(){let ue=0;for await(const Ne of this){var At;if($e!=null&&(At=$e.signal)!==null&&At!==void 0&&At.aborted)throw new v({cause:$e.signal.reason});yield[ue++,Ne]}}.call(this)}async function Fe($e,Ce=void 0){for await(const ue of Et.call(this,$e,Ce))return!0;return!1}async function pe($e,Ce=void 0){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);return!await Fe.call(this,async(...ue)=>!await $e(...ue),Ce)}async function Lt($e,Ce){for await(const ue of Et.call(this,$e,Ce))return ue}async function _e($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);async function ue(At,Ne){return await $e(At,Ne),z}for await(const At of le.call(this,ue,Ce));}function Et($e,Ce){if(typeof $e!="function")throw new f("fn",["Function","AsyncFunction"],$e);async function ue(At,Ne){return await $e(At,Ne)?At:z}return le.call(this,ue,Ce)}class Cn extends d{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function vn($e,Ce,ue){var At;if(typeof $e!="function")throw new f("reducer",["Function","AsyncFunction"],$e);ue!=null&&y(ue,"options"),(ue==null?void 0:ue.signal)!=null&&g(ue.signal,"options.signal");let Ne=arguments.length>1;if(ue!=null&&(At=ue.signal)!==null&&At!==void 0&&At.aborted){const ie=new v(void 0,{cause:ue.signal.reason});throw this.once("error",()=>{}),await b(this.destroy(ie)),ie}const Oe=new u,kt=Oe.signal;if(ue!=null&&ue.signal){const ie={once:!0,[_]:this};ue.signal.addEventListener("abort",()=>Oe.abort(),ie)}let jt=!1;try{for await(const ie of this){var _n;if(jt=!0,ue!=null&&(_n=ue.signal)!==null&&_n!==void 0&&_n.aborted)throw new v;Ne?Ce=await $e(Ce,ie,{signal:kt}):(Ce=ie,Ne=!0)}if(!jt&&!Ne)throw new Cn}finally{Oe.abort()}return Ce}async function Dt($e){$e!=null&&y($e,"options"),($e==null?void 0:$e.signal)!=null&&g($e.signal,"options.signal");const Ce=[];for await(const At of this){var ue;if($e!=null&&(ue=$e.signal)!==null&&ue!==void 0&&ue.aborted)throw new v(void 0,{cause:$e.signal.reason});x(Ce,At)}return Ce}function de($e,Ce){const ue=le.call(this,$e,Ce);return async function*(){for await(const Ne of ue)yield*Ne}.call(this)}function qe($e){if($e=L($e),M($e))return 0;if($e<0)throw new h("number",">= 0",$e);return $e}function Pt($e,Ce=void 0){return Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),$e=qe($e),async function*(){var At;if(Ce!=null&&(At=Ce.signal)!==null&&At!==void 0&&At.aborted)throw new v;for await(const Oe of this){var Ne;if(Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted)throw new v;$e--<=0&&(yield Oe)}}.call(this)}function In($e,Ce=void 0){return Ce!=null&&y(Ce,"options"),(Ce==null?void 0:Ce.signal)!=null&&g(Ce.signal,"options.signal"),$e=qe($e),async function*(){var At;if(Ce!=null&&(At=Ce.signal)!==null&&At!==void 0&&At.aborted)throw new v;for await(const Oe of this){var Ne;if(Ce!=null&&(Ne=Ce.signal)!==null&&Ne!==void 0&&Ne.aborted)throw new v;if($e-- >0)yield Oe;else return}}.call(this)}o.exports.streamReturningOperators={asIndexedPairs:Ie,drop:Pt,filter:Et,flatMap:de,map:le,take:In,compose:he},o.exports.promiseReturningOperators={every:pe,forEach:_e,reduce:vn,toArray:Dt,some:Fe,find:Lt}},{"../../ours/errors":126,"../../ours/primordials":127,"../validators":124,"./add-abort-signal":107,"./compose":109,"./end-of-stream":113,"./utils":122,"abort-controller":24}],117:[function(i,o,a){const{ObjectSetPrototypeOf:u}=i("../../ours/primordials");o.exports=f;const c=i("./transform");u(f.prototype,c.prototype),u(f,c);function f(d){if(!(this instanceof f))return new f(d);c.call(this,d)}f.prototype._transform=function(d,h,v){v(null,d)}},{"../../ours/primordials":127,"./transform":121}],118:[function(i,o,a){const u=i("process/"),{ArrayIsArray:c,Promise:f,SymbolAsyncIterator:d}=i("../../ours/primordials"),h=i("./end-of-stream"),{once:v}=i("../../ours/util"),g=i("./destroy"),p=i("./duplex"),{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:T},AbortError:S}=i("../../ours/errors"),{validateFunction:x,validateAbortSignal:O}=i("../validators"),{isIterable:L,isReadable:M,isReadableNodeStream:re,isNodeStream:F,isTransformStream:j,isWebStream:V,isReadableStream:z,isReadableEnded:$}=i("./utils"),he=globalThis.AbortController||i("abort-controller").AbortController;let le,Ie;function Fe(qe,Pt,In){let $e=!1;qe.on("close",()=>{$e=!0});const Ce=h(qe,{readable:Pt,writable:In},ue=>{$e=!ue});return{destroy:ue=>{$e||($e=!0,g.destroyer(qe,ue||new w("pipe")))},cleanup:Ce}}function pe(qe){return x(qe[qe.length-1],"streams[stream.length - 1]"),qe.pop()}function Lt(qe){if(L(qe))return qe;if(re(qe))return _e(qe);throw new _("val",["Readable","Iterable","AsyncIterable"],qe)}async function*_e(qe){Ie||(Ie=i("./readable")),yield*Ie.prototype[d].call(qe)}async function Et(qe,Pt,In,{end:$e}){let Ce,ue=null;const At=kt=>{if(kt&&(Ce=kt),ue){const jt=ue;ue=null,jt()}},Ne=()=>new f((kt,jt)=>{Ce?jt(Ce):ue=()=>{Ce?jt(Ce):kt()}});Pt.on("drain",At);const Oe=h(Pt,{readable:!1},At);try{Pt.writableNeedDrain&&await Ne();for await(const kt of qe)Pt.write(kt)||await Ne();$e&&Pt.end(),await Ne(),In()}catch(kt){In(Ce!==kt?y(Ce,kt):kt)}finally{Oe(),Pt.off("drain",At)}}async function Cn(qe,Pt,In,{end:$e}){j(Pt)&&(Pt=Pt.writable);const Ce=Pt.getWriter();try{for await(const ue of qe)await Ce.ready,Ce.write(ue).catch(()=>{});await Ce.ready,$e&&await Ce.close(),In()}catch(ue){try{await Ce.abort(ue),In(ue)}catch(At){In(At)}}}function vn(...qe){return Dt(qe,v(pe(qe)))}function Dt(qe,Pt,In){if(qe.length===1&&c(qe[0])&&(qe=qe[0]),qe.length<2)throw new A("streams");const $e=new he,Ce=$e.signal,ue=In==null?void 0:In.signal,At=[];O(ue,"options.signal");function Ne(){ae(new S)}ue==null||ue.addEventListener("abort",Ne);let Oe,kt;const jt=[];let _n=0;function ie(oe){ae(oe,--_n===0)}function ae(oe,xe){if(oe&&(!Oe||Oe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Oe=oe),!(!Oe&&!xe)){for(;jt.length;)jt.shift()(Oe);ue==null||ue.removeEventListener("abort",Ne),$e.abort(),xe&&(Oe||At.forEach(ze=>ze()),u.nextTick(Pt,Oe,kt))}}let Y;for(let oe=0;oe<qe.length;oe++){const xe=qe[oe],ze=oe<qe.length-1,hn=oe>0,An=ze||(In==null?void 0:In.end)!==!1,Tn=oe===qe.length-1;if(F(xe)){let Rn=function(Ve){Ve&&Ve.name!=="AbortError"&&Ve.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ie(Ve)};if(An){const{destroy:Ve,cleanup:Ue}=Fe(xe,ze,hn);jt.push(Ve),M(xe)&&Tn&&At.push(Ue)}xe.on("error",Rn),M(xe)&&Tn&&At.push(()=>{xe.removeListener("error",Rn)})}if(oe===0)if(typeof xe=="function"){if(Y=xe({signal:Ce}),!L(Y))throw new b("Iterable, AsyncIterable or Stream","source",Y)}else L(xe)||re(xe)||j(xe)?Y=xe:Y=p.from(xe);else if(typeof xe=="function"){if(j(Y)){var k;Y=Lt((k=Y)===null||k===void 0?void 0:k.readable)}else Y=Lt(Y);if(Y=xe(Y,{signal:Ce}),ze){if(!L(Y,!0))throw new b("AsyncIterable",`transform[${oe-1}]`,Y)}else{var D;le||(le=i("./passthrough"));const Rn=new le({objectMode:!0}),Ve=(D=Y)===null||D===void 0?void 0:D.then;if(typeof Ve=="function")_n++,Ve.call(Y,Sn=>{kt=Sn,Sn!=null&&Rn.write(Sn),An&&Rn.end(),u.nextTick(ie)},Sn=>{Rn.destroy(Sn),u.nextTick(ie,Sn)});else if(L(Y,!0))_n++,Et(Y,Rn,ie,{end:An});else if(z(Y)||j(Y)){const Sn=Y.readable||Y;_n++,Et(Sn,Rn,ie,{end:An})}else throw new b("AsyncIterable or Promise","destination",Y);Y=Rn;const{destroy:Ue,cleanup:En}=Fe(Y,!1,!0);jt.push(Ue),Tn&&At.push(En)}}else if(F(xe)){if(re(Y)){_n+=2;const Rn=de(Y,xe,ie,{end:An});M(xe)&&Tn&&At.push(Rn)}else if(j(Y)||z(Y)){const Rn=Y.readable||Y;_n++,Et(Rn,xe,ie,{end:An})}else if(L(Y))_n++,Et(Y,xe,ie,{end:An});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=xe}else if(V(xe)){if(re(Y))_n++,Cn(Lt(Y),xe,ie,{end:An});else if(z(Y)||L(Y))_n++,Cn(Y,xe,ie,{end:An});else if(j(Y))_n++,Cn(Y.readable,xe,ie,{end:An});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=xe}else Y=p.from(xe)}return(Ce!=null&&Ce.aborted||ue!=null&&ue.aborted)&&u.nextTick(Ne),Y}function de(qe,Pt,In,{end:$e}){let Ce=!1;if(Pt.on("close",()=>{Ce||In(new T)}),qe.pipe(Pt,{end:!1}),$e){let ue=function(){Ce=!0,Pt.end()};$(qe)?u.nextTick(ue):qe.once("end",ue)}else In();return h(qe,{readable:!0,writable:!1},ue=>{const At=qe._readableState;ue&&ue.code==="ERR_STREAM_PREMATURE_CLOSE"&&At&&At.ended&&!At.errored&&!At.errorEmitted?qe.once("end",In).once("error",In):In(ue)}),h(Pt,{readable:!1,writable:!0},In)}o.exports={pipelineImpl:Dt,pipeline:vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./passthrough":117,"./readable":119,"./utils":122,"abort-controller":24,"process/":102}],119:[function(i,o,a){const u=i("process/"),{ArrayPrototypeIndexOf:c,NumberIsInteger:f,NumberIsNaN:d,NumberParseInt:h,ObjectDefineProperties:v,ObjectKeys:g,ObjectSetPrototypeOf:p,Promise:y,SafeSet:_,SymbolAsyncIterator:b,Symbol:A}=i("../../ours/primordials");o.exports=de,de.ReadableState=Dt;const{EventEmitter:w}=i("events"),{Stream:T,prependListener:S}=i("./legacy"),{Buffer:x}=i("buffer"),{addAbortSignal:O}=i("./add-abort-signal"),L=i("./end-of-stream");let M=i("../../ours/util").debuglog("stream",Ve=>{M=Ve});const re=i("./buffer_list"),F=i("./destroy"),{getHighWaterMark:j,getDefaultHighWaterMark:V}=i("./state"),{aggregateTwoErrors:z,codes:{ERR_INVALID_ARG_TYPE:$,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:le,ERR_STREAM_PUSH_AFTER_EOF:Ie,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Fe}}=i("../../ours/errors"),{validateObject:pe}=i("../validators"),Lt=A("kPaused"),{StringDecoder:_e}=i("string_decoder"),Et=i("./from");p(de.prototype,T.prototype),p(de,T);const Cn=()=>{},{errorOrDestroy:vn}=F;function Dt(Ve,Ue,En){typeof En!="boolean"&&(En=Ue instanceof i("./duplex")),this.objectMode=!!(Ve&&Ve.objectMode),En&&(this.objectMode=this.objectMode||!!(Ve&&Ve.readableObjectMode)),this.highWaterMark=Ve?j(this,Ve,"readableHighWaterMark",En):V(!1),this.buffer=new re,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Lt]=null,this.errorEmitted=!1,this.emitClose=!Ve||Ve.emitClose!==!1,this.autoDestroy=!Ve||Ve.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=Ve&&Ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,Ve&&Ve.encoding&&(this.decoder=new _e(Ve.encoding),this.encoding=Ve.encoding)}function de(Ve){if(!(this instanceof de))return new de(Ve);const Ue=this instanceof i("./duplex");this._readableState=new Dt(Ve,this,Ue),Ve&&(typeof Ve.read=="function"&&(this._read=Ve.read),typeof Ve.destroy=="function"&&(this._destroy=Ve.destroy),typeof Ve.construct=="function"&&(this._construct=Ve.construct),Ve.signal&&!Ue&&O(Ve.signal,this)),T.call(this,Ve),F.construct(this,()=>{this._readableState.needReadable&&Oe(this,this._readableState)})}de.prototype.destroy=F.destroy,de.prototype._undestroy=F.undestroy,de.prototype._destroy=function(Ve,Ue){Ue(Ve)},de.prototype[w.captureRejectionSymbol]=function(Ve){this.destroy(Ve)},de.prototype.push=function(Ve,Ue){return qe(this,Ve,Ue,!1)},de.prototype.unshift=function(Ve,Ue){return qe(this,Ve,Ue,!0)};function qe(Ve,Ue,En,Sn){M("readableAddChunk",Ue);const xn=Ve._readableState;let Pn;if(xn.objectMode||(typeof Ue=="string"?(En=En||xn.defaultEncoding,xn.encoding!==En&&(Sn&&xn.encoding?Ue=x.from(Ue,En).toString(xn.encoding):(Ue=x.from(Ue,En),En=""))):Ue instanceof x?En="":T._isUint8Array(Ue)?(Ue=T._uint8ArrayToBuffer(Ue),En=""):Ue!=null&&(Pn=new $("chunk",["string","Buffer","Uint8Array"],Ue))),Pn)vn(Ve,Pn);else if(Ue===null)xn.reading=!1,ue(Ve,xn);else if(xn.objectMode||Ue&&Ue.length>0)if(Sn)if(xn.endEmitted)vn(Ve,new Fe);else{if(xn.destroyed||xn.errored)return!1;Pt(Ve,xn,Ue,!0)}else if(xn.ended)vn(Ve,new Ie);else{if(xn.destroyed||xn.errored)return!1;xn.reading=!1,xn.decoder&&!En?(Ue=xn.decoder.write(Ue),xn.objectMode||Ue.length!==0?Pt(Ve,xn,Ue,!1):Oe(Ve,xn)):Pt(Ve,xn,Ue,!1)}else Sn||(xn.reading=!1,Oe(Ve,xn));return!xn.ended&&(xn.length<xn.highWaterMark||xn.length===0)}function Pt(Ve,Ue,En,Sn){Ue.flowing&&Ue.length===0&&!Ue.sync&&Ve.listenerCount("data")>0?(Ue.multiAwaitDrain?Ue.awaitDrainWriters.clear():Ue.awaitDrainWriters=null,Ue.dataEmitted=!0,Ve.emit("data",En)):(Ue.length+=Ue.objectMode?1:En.length,Sn?Ue.buffer.unshift(En):Ue.buffer.push(En),Ue.needReadable&&At(Ve)),Oe(Ve,Ue)}de.prototype.isPaused=function(){const Ve=this._readableState;return Ve[Lt]===!0||Ve.flowing===!1},de.prototype.setEncoding=function(Ve){const Ue=new _e(Ve);this._readableState.decoder=Ue,this._readableState.encoding=this._readableState.decoder.encoding;const En=this._readableState.buffer;let Sn="";for(const xn of En)Sn+=Ue.write(xn);return En.clear(),Sn!==""&&En.push(Sn),this._readableState.length=Sn.length,this};const In=1073741824;function $e(Ve){if(Ve>In)throw new le("size","<= 1GiB",Ve);return Ve--,Ve|=Ve>>>1,Ve|=Ve>>>2,Ve|=Ve>>>4,Ve|=Ve>>>8,Ve|=Ve>>>16,Ve++,Ve}function Ce(Ve,Ue){return Ve<=0||Ue.length===0&&Ue.ended?0:Ue.objectMode?1:d(Ve)?Ue.flowing&&Ue.length?Ue.buffer.first().length:Ue.length:Ve<=Ue.length?Ve:Ue.ended?Ue.length:0}de.prototype.read=function(Ve){M("read",Ve),Ve===void 0?Ve=NaN:f(Ve)||(Ve=h(Ve,10));const Ue=this._readableState,En=Ve;if(Ve>Ue.highWaterMark&&(Ue.highWaterMark=$e(Ve)),Ve!==0&&(Ue.emittedReadable=!1),Ve===0&&Ue.needReadable&&((Ue.highWaterMark!==0?Ue.length>=Ue.highWaterMark:Ue.length>0)||Ue.ended))return M("read: emitReadable",Ue.length,Ue.ended),Ue.length===0&&Ue.ended?ze(this):At(this),null;if(Ve=Ce(Ve,Ue),Ve===0&&Ue.ended)return Ue.length===0&&ze(this),null;let Sn=Ue.needReadable;if(M("need readable",Sn),(Ue.length===0||Ue.length-Ve<Ue.highWaterMark)&&(Sn=!0,M("length less than watermark",Sn)),Ue.ended||Ue.reading||Ue.destroyed||Ue.errored||!Ue.constructed)Sn=!1,M("reading, ended or constructing",Sn);else if(Sn){M("do read"),Ue.reading=!0,Ue.sync=!0,Ue.length===0&&(Ue.needReadable=!0);try{this._read(Ue.highWaterMark)}catch(Pn){vn(this,Pn)}Ue.sync=!1,Ue.reading||(Ve=Ce(En,Ue))}let xn;return Ve>0?xn=xe(Ve,Ue):xn=null,xn===null?(Ue.needReadable=Ue.length<=Ue.highWaterMark,Ve=0):(Ue.length-=Ve,Ue.multiAwaitDrain?Ue.awaitDrainWriters.clear():Ue.awaitDrainWriters=null),Ue.length===0&&(Ue.ended||(Ue.needReadable=!0),En!==Ve&&Ue.ended&&ze(this)),xn!==null&&!Ue.errorEmitted&&!Ue.closeEmitted&&(Ue.dataEmitted=!0,this.emit("data",xn)),xn};function ue(Ve,Ue){if(M("onEofChunk"),!Ue.ended){if(Ue.decoder){const En=Ue.decoder.end();En&&En.length&&(Ue.buffer.push(En),Ue.length+=Ue.objectMode?1:En.length)}Ue.ended=!0,Ue.sync?At(Ve):(Ue.needReadable=!1,Ue.emittedReadable=!0,Ne(Ve))}}function At(Ve){const Ue=Ve._readableState;M("emitReadable",Ue.needReadable,Ue.emittedReadable),Ue.needReadable=!1,Ue.emittedReadable||(M("emitReadable",Ue.flowing),Ue.emittedReadable=!0,u.nextTick(Ne,Ve))}function Ne(Ve){const Ue=Ve._readableState;M("emitReadable_",Ue.destroyed,Ue.length,Ue.ended),!Ue.destroyed&&!Ue.errored&&(Ue.length||Ue.ended)&&(Ve.emit("readable"),Ue.emittedReadable=!1),Ue.needReadable=!Ue.flowing&&!Ue.ended&&Ue.length<=Ue.highWaterMark,k(Ve)}function Oe(Ve,Ue){!Ue.readingMore&&Ue.constructed&&(Ue.readingMore=!0,u.nextTick(kt,Ve,Ue))}function kt(Ve,Ue){for(;!Ue.reading&&!Ue.ended&&(Ue.length<Ue.highWaterMark||Ue.flowing&&Ue.length===0);){const En=Ue.length;if(M("maybeReadMore read 0"),Ve.read(0),En===Ue.length)break}Ue.readingMore=!1}de.prototype._read=function(Ve){throw new he("_read()")},de.prototype.pipe=function(Ve,Ue){const En=this,Sn=this._readableState;Sn.pipes.length===1&&(Sn.multiAwaitDrain||(Sn.multiAwaitDrain=!0,Sn.awaitDrainWriters=new _(Sn.awaitDrainWriters?[Sn.awaitDrainWriters]:[]))),Sn.pipes.push(Ve),M("pipe count=%d opts=%j",Sn.pipes.length,Ue);const Pn=(!Ue||Ue.end!==!1)&&Ve!==u.stdout&&Ve!==u.stderr?$n:Vn;Sn.endEmitted?u.nextTick(Pn):En.once("end",Pn),Ve.on("unpipe",kn);function kn(Nn,Dn){M("onunpipe"),Nn===En&&Dn&&Dn.hasUnpiped===!1&&(Dn.hasUnpiped=!0,wn())}function $n(){M("onend"),Ve.end()}let Wn,bn=!1;function wn(){M("cleanup"),Ve.removeListener("close",On),Ve.removeListener("finish",Gn),Wn&&Ve.removeListener("drain",Wn),Ve.removeListener("error",Mn),Ve.removeListener("unpipe",kn),En.removeListener("end",$n),En.removeListener("end",Vn),En.removeListener("data",Bn),bn=!0,Wn&&Sn.awaitDrainWriters&&(!Ve._writableState||Ve._writableState.needDrain)&&Wn()}function Ln(){bn||(Sn.pipes.length===1&&Sn.pipes[0]===Ve?(M("false write response, pause",0),Sn.awaitDrainWriters=Ve,Sn.multiAwaitDrain=!1):Sn.pipes.length>1&&Sn.pipes.includes(Ve)&&(M("false write response, pause",Sn.awaitDrainWriters.size),Sn.awaitDrainWriters.add(Ve)),En.pause()),Wn||(Wn=jt(En,Ve),Ve.on("drain",Wn))}En.on("data",Bn);function Bn(Nn){M("ondata");const Dn=Ve.write(Nn);M("dest.write",Dn),Dn===!1&&Ln()}function Mn(Nn){if(M("onerror",Nn),Vn(),Ve.removeListener("error",Mn),Ve.listenerCount("error")===0){const Dn=Ve._writableState||Ve._readableState;Dn&&!Dn.errorEmitted?vn(Ve,Nn):Ve.emit("error",Nn)}}S(Ve,"error",Mn);function On(){Ve.removeListener("finish",Gn),Vn()}Ve.once("close",On);function Gn(){M("onfinish"),Ve.removeListener("close",On),Vn()}Ve.once("finish",Gn);function Vn(){M("unpipe"),En.unpipe(Ve)}return Ve.emit("pipe",En),Ve.writableNeedDrain===!0?Sn.flowing&&Ln():Sn.flowing||(M("pipe resume"),En.resume()),Ve};function jt(Ve,Ue){return function(){const Sn=Ve._readableState;Sn.awaitDrainWriters===Ue?(M("pipeOnDrain",1),Sn.awaitDrainWriters=null):Sn.multiAwaitDrain&&(M("pipeOnDrain",Sn.awaitDrainWriters.size),Sn.awaitDrainWriters.delete(Ue)),(!Sn.awaitDrainWriters||Sn.awaitDrainWriters.size===0)&&Ve.listenerCount("data")&&Ve.resume()}}de.prototype.unpipe=function(Ve){const Ue=this._readableState,En={hasUnpiped:!1};if(Ue.pipes.length===0)return this;if(!Ve){const xn=Ue.pipes;Ue.pipes=[],this.pause();for(let Pn=0;Pn<xn.length;Pn++)xn[Pn].emit("unpipe",this,{hasUnpiped:!1});return this}const Sn=c(Ue.pipes,Ve);return Sn===-1?this:(Ue.pipes.splice(Sn,1),Ue.pipes.length===0&&this.pause(),Ve.emit("unpipe",this,En),this)},de.prototype.on=function(Ve,Ue){const En=T.prototype.on.call(this,Ve,Ue),Sn=this._readableState;return Ve==="data"?(Sn.readableListening=this.listenerCount("readable")>0,Sn.flowing!==!1&&this.resume()):Ve==="readable"&&!Sn.endEmitted&&!Sn.readableListening&&(Sn.readableListening=Sn.needReadable=!0,Sn.flowing=!1,Sn.emittedReadable=!1,M("on readable",Sn.length,Sn.reading),Sn.length?At(this):Sn.reading||u.nextTick(ie,this)),En},de.prototype.addListener=de.prototype.on,de.prototype.removeListener=function(Ve,Ue){const En=T.prototype.removeListener.call(this,Ve,Ue);return Ve==="readable"&&u.nextTick(_n,this),En},de.prototype.off=de.prototype.removeListener,de.prototype.removeAllListeners=function(Ve){const Ue=T.prototype.removeAllListeners.apply(this,arguments);return(Ve==="readable"||Ve===void 0)&&u.nextTick(_n,this),Ue};function _n(Ve){const Ue=Ve._readableState;Ue.readableListening=Ve.listenerCount("readable")>0,Ue.resumeScheduled&&Ue[Lt]===!1?Ue.flowing=!0:Ve.listenerCount("data")>0?Ve.resume():Ue.readableListening||(Ue.flowing=null)}function ie(Ve){M("readable nexttick read 0"),Ve.read(0)}de.prototype.resume=function(){const Ve=this._readableState;return Ve.flowing||(M("resume"),Ve.flowing=!Ve.readableListening,ae(this,Ve)),Ve[Lt]=!1,this};function ae(Ve,Ue){Ue.resumeScheduled||(Ue.resumeScheduled=!0,u.nextTick(Y,Ve,Ue))}function Y(Ve,Ue){M("resume",Ue.reading),Ue.reading||Ve.read(0),Ue.resumeScheduled=!1,Ve.emit("resume"),k(Ve),Ue.flowing&&!Ue.reading&&Ve.read(0)}de.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Lt]=!0,this};function k(Ve){const Ue=Ve._readableState;for(M("flow",Ue.flowing);Ue.flowing&&Ve.read()!==null;);}de.prototype.wrap=function(Ve){let Ue=!1;Ve.on("data",Sn=>{!this.push(Sn)&&Ve.pause&&(Ue=!0,Ve.pause())}),Ve.on("end",()=>{this.push(null)}),Ve.on("error",Sn=>{vn(this,Sn)}),Ve.on("close",()=>{this.destroy()}),Ve.on("destroy",()=>{this.destroy()}),this._read=()=>{Ue&&Ve.resume&&(Ue=!1,Ve.resume())};const En=g(Ve);for(let Sn=1;Sn<En.length;Sn++){const xn=En[Sn];this[xn]===void 0&&typeof Ve[xn]=="function"&&(this[xn]=Ve[xn].bind(Ve))}return this},de.prototype[b]=function(){return D(this)},de.prototype.iterator=function(Ve){return Ve!==void 0&&pe(Ve,"options"),D(this,Ve)};function D(Ve,Ue){typeof Ve.read!="function"&&(Ve=de.wrap(Ve,{objectMode:!0}));const En=oe(Ve,Ue);return En.stream=Ve,En}async function*oe(Ve,Ue){let En=Cn;function Sn(kn){this===Ve?(En(),En=Cn):En=kn}Ve.on("readable",Sn);let xn;const Pn=L(Ve,{writable:!1},kn=>{xn=kn?z(xn,kn):null,En(),En=Cn});try{for(;;){const kn=Ve.destroyed?null:Ve.read();if(kn!==null)yield kn;else{if(xn)throw xn;if(xn===null)return;await new y(Sn)}}}catch(kn){throw xn=z(xn,kn),xn}finally{(xn||(Ue==null?void 0:Ue.destroyOnReturn)!==!1)&&(xn===void 0||Ve._readableState.autoDestroy)?F.destroyer(Ve,null):(Ve.off("readable",Sn),Pn())}}v(de.prototype,{readable:{__proto__:null,get(){const Ve=this._readableState;return!!Ve&&Ve.readable!==!1&&!Ve.destroyed&&!Ve.errorEmitted&&!Ve.endEmitted},set(Ve){this._readableState&&(this._readableState.readable=!!Ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ve){this._readableState&&(this._readableState.flowing=Ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Ve){this._readableState&&(this._readableState.destroyed=Ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),v(Dt.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Lt]!==!1},set(Ve){this[Lt]=!!Ve}}}),de._fromList=xe;function xe(Ve,Ue){if(Ue.length===0)return null;let En;return Ue.objectMode?En=Ue.buffer.shift():!Ve||Ve>=Ue.length?(Ue.decoder?En=Ue.buffer.join(""):Ue.buffer.length===1?En=Ue.buffer.first():En=Ue.buffer.concat(Ue.length),Ue.buffer.clear()):En=Ue.buffer.consume(Ve,Ue.decoder),En}function ze(Ve){const Ue=Ve._readableState;M("endReadable",Ue.endEmitted),Ue.endEmitted||(Ue.ended=!0,u.nextTick(hn,Ue,Ve))}function hn(Ve,Ue){if(M("endReadableNT",Ve.endEmitted,Ve.length),!Ve.errored&&!Ve.closeEmitted&&!Ve.endEmitted&&Ve.length===0){if(Ve.endEmitted=!0,Ue.emit("end"),Ue.writable&&Ue.allowHalfOpen===!1)u.nextTick(An,Ue);else if(Ve.autoDestroy){const En=Ue._writableState;(!En||En.autoDestroy&&(En.finished||En.writable===!1))&&Ue.destroy()}}}function An(Ve){Ve.writable&&!Ve.writableEnded&&!Ve.destroyed&&Ve.end()}de.from=function(Ve,Ue){return Et(de,Ve,Ue)};let Tn;function Rn(){return Tn===void 0&&(Tn={}),Tn}de.fromWeb=function(Ve,Ue){return Rn().newStreamReadableFromReadableStream(Ve,Ue)},de.toWeb=function(Ve,Ue){return Rn().newReadableStreamFromStreamReadable(Ve,Ue)},de.wrap=function(Ve,Ue){var En,Sn;return new de({objectMode:(En=(Sn=Ve.readableObjectMode)!==null&&Sn!==void 0?Sn:Ve.objectMode)!==null&&En!==void 0?En:!0,...Ue,destroy(xn,Pn){F.destroyer(Ve,xn),Pn(xn)}}).wrap(Ve)}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./add-abort-signal":107,"./buffer_list":108,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102,string_decoder:28}],120:[function(i,o,a){const{MathFloor:u,NumberIsInteger:c}=i("../../ours/primordials"),{ERR_INVALID_ARG_VALUE:f}=i("../../ours/errors").codes;function d(g,p,y){return g.highWaterMark!=null?g.highWaterMark:p?g[y]:null}function h(g){return g?16:16*1024}function v(g,p,y,_){const b=d(p,_,y);if(b!=null){if(!c(b)||b<0){const A=_?`options.${y}`:"options.highWaterMark";throw new f(A,b)}return u(b)}return h(g.objectMode)}o.exports={getHighWaterMark:v,getDefaultHighWaterMark:h}},{"../../ours/errors":126,"../../ours/primordials":127}],121:[function(i,o,a){const{ObjectSetPrototypeOf:u,Symbol:c}=i("../../ours/primordials");o.exports=g;const{ERR_METHOD_NOT_IMPLEMENTED:f}=i("../../ours/errors").codes,d=i("./duplex"),{getHighWaterMark:h}=i("./state");u(g.prototype,d.prototype),u(g,d);const v=c("kCallback");function g(_){if(!(this instanceof g))return new g(_);const b=_?h(this,_,"readableHighWaterMark",!0):null;b===0&&(_={..._,highWaterMark:null,readableHighWaterMark:b,writableHighWaterMark:_.writableHighWaterMark||0}),d.call(this,_),this._readableState.sync=!1,this[v]=null,_&&(typeof _.transform=="function"&&(this._transform=_.transform),typeof _.flush=="function"&&(this._flush=_.flush)),this.on("prefinish",y)}function p(_){typeof this._flush=="function"&&!this.destroyed?this._flush((b,A)=>{if(b){_?_(b):this.destroy(b);return}A!=null&&this.push(A),this.push(null),_&&_()}):(this.push(null),_&&_())}function y(){this._final!==p&&p.call(this)}g.prototype._final=p,g.prototype._transform=function(_,b,A){throw new f("_transform()")},g.prototype._write=function(_,b,A){const w=this._readableState,T=this._writableState,S=w.length;this._transform(_,b,(x,O)=>{if(x){A(x);return}O!=null&&this.push(O),T.ended||S===w.length||w.length<w.highWaterMark?A():this[v]=A})},g.prototype._read=function(){if(this[v]){const _=this[v];this[v]=null,_()}}},{"../../ours/errors":126,"../../ours/primordials":127,"./duplex":111,"./state":120}],122:[function(i,o,a){const{Symbol:u,SymbolAsyncIterator:c,SymbolIterator:f,SymbolFor:d}=i("../../ours/primordials"),h=u("kDestroyed"),v=u("kIsErrored"),g=u("kIsReadable"),p=u("kIsDisturbed"),y=d("nodejs.webstream.isClosedPromise"),_=d("nodejs.webstream.controllerErrorFunction");function b(de,qe=!1){var Pt;return!!(de&&typeof de.pipe=="function"&&typeof de.on=="function"&&(!qe||typeof de.pause=="function"&&typeof de.resume=="function")&&(!de._writableState||((Pt=de._readableState)===null||Pt===void 0?void 0:Pt.readable)!==!1)&&(!de._writableState||de._readableState))}function A(de){var qe;return!!(de&&typeof de.write=="function"&&typeof de.on=="function"&&(!de._readableState||((qe=de._writableState)===null||qe===void 0?void 0:qe.writable)!==!1))}function w(de){return!!(de&&typeof de.pipe=="function"&&de._readableState&&typeof de.on=="function"&&typeof de.write=="function")}function T(de){return de&&(de._readableState||de._writableState||typeof de.write=="function"&&typeof de.on=="function"||typeof de.pipe=="function"&&typeof de.on=="function")}function S(de){return!!(de&&!T(de)&&typeof de.pipeThrough=="function"&&typeof de.getReader=="function"&&typeof de.cancel=="function")}function x(de){return!!(de&&!T(de)&&typeof de.getWriter=="function"&&typeof de.abort=="function")}function O(de){return!!(de&&!T(de)&&typeof de.readable=="object"&&typeof de.writable=="object")}function L(de){return S(de)||x(de)||O(de)}function M(de,qe){return de==null?!1:qe===!0?typeof de[c]=="function":qe===!1?typeof de[f]=="function":typeof de[c]=="function"||typeof de[f]=="function"}function re(de){if(!T(de))return null;const qe=de._writableState,Pt=de._readableState,In=qe||Pt;return!!(de.destroyed||de[h]||In!=null&&In.destroyed)}function F(de){if(!A(de))return null;if(de.writableEnded===!0)return!0;const qe=de._writableState;return qe!=null&&qe.errored?!1:typeof(qe==null?void 0:qe.ended)!="boolean"?null:qe.ended}function j(de,qe){if(!A(de))return null;if(de.writableFinished===!0)return!0;const Pt=de._writableState;return Pt!=null&&Pt.errored?!1:typeof(Pt==null?void 0:Pt.finished)!="boolean"?null:!!(Pt.finished||qe===!1&&Pt.ended===!0&&Pt.length===0)}function V(de){if(!b(de))return null;if(de.readableEnded===!0)return!0;const qe=de._readableState;return!qe||qe.errored?!1:typeof(qe==null?void 0:qe.ended)!="boolean"?null:qe.ended}function z(de,qe){if(!b(de))return null;const Pt=de._readableState;return Pt!=null&&Pt.errored?!1:typeof(Pt==null?void 0:Pt.endEmitted)!="boolean"?null:!!(Pt.endEmitted||qe===!1&&Pt.ended===!0&&Pt.length===0)}function $(de){return de&&de[g]!=null?de[g]:typeof(de==null?void 0:de.readable)!="boolean"?null:re(de)?!1:b(de)&&de.readable&&!z(de)}function he(de){return typeof(de==null?void 0:de.writable)!="boolean"?null:re(de)?!1:A(de)&&de.writable&&!F(de)}function le(de,qe){return T(de)?re(de)?!0:!((qe==null?void 0:qe.readable)!==!1&&$(de)||(qe==null?void 0:qe.writable)!==!1&&he(de)):null}function Ie(de){var qe,Pt;return T(de)?de.writableErrored?de.writableErrored:(qe=(Pt=de._writableState)===null||Pt===void 0?void 0:Pt.errored)!==null&&qe!==void 0?qe:null:null}function Fe(de){var qe,Pt;return T(de)?de.readableErrored?de.readableErrored:(qe=(Pt=de._readableState)===null||Pt===void 0?void 0:Pt.errored)!==null&&qe!==void 0?qe:null:null}function pe(de){if(!T(de))return null;if(typeof de.closed=="boolean")return de.closed;const qe=de._writableState,Pt=de._readableState;return typeof(qe==null?void 0:qe.closed)=="boolean"||typeof(Pt==null?void 0:Pt.closed)=="boolean"?(qe==null?void 0:qe.closed)||(Pt==null?void 0:Pt.closed):typeof de._closed=="boolean"&&Lt(de)?de._closed:null}function Lt(de){return typeof de._closed=="boolean"&&typeof de._defaultKeepAlive=="boolean"&&typeof de._removedConnection=="boolean"&&typeof de._removedContLen=="boolean"}function _e(de){return typeof de._sent100=="boolean"&&Lt(de)}function Et(de){var qe;return typeof de._consuming=="boolean"&&typeof de._dumped=="boolean"&&((qe=de.req)===null||qe===void 0?void 0:qe.upgradeOrConnect)===void 0}function Cn(de){if(!T(de))return null;const qe=de._writableState,Pt=de._readableState,In=qe||Pt;return!In&&_e(de)||!!(In&&In.autoDestroy&&In.emitClose&&In.closed===!1)}function vn(de){var qe;return!!(de&&((qe=de[p])!==null&&qe!==void 0?qe:de.readableDidRead||de.readableAborted))}function Dt(de){var qe,Pt,In,$e,Ce,ue,At,Ne,Oe,kt;return!!(de&&((qe=(Pt=(In=($e=(Ce=(ue=de[v])!==null&&ue!==void 0?ue:de.readableErrored)!==null&&Ce!==void 0?Ce:de.writableErrored)!==null&&$e!==void 0?$e:(At=de._readableState)===null||At===void 0?void 0:At.errorEmitted)!==null&&In!==void 0?In:(Ne=de._writableState)===null||Ne===void 0?void 0:Ne.errorEmitted)!==null&&Pt!==void 0?Pt:(Oe=de._readableState)===null||Oe===void 0?void 0:Oe.errored)!==null&&qe!==void 0?qe:!((kt=de._writableState)===null||kt===void 0)&&kt.errored))}o.exports={kDestroyed:h,isDisturbed:vn,kIsDisturbed:p,isErrored:Dt,kIsErrored:v,isReadable:$,kIsReadable:g,kIsClosedPromise:y,kControllerErrorFunction:_,isClosed:pe,isDestroyed:re,isDuplexNodeStream:w,isFinished:le,isIterable:M,isReadableNodeStream:b,isReadableStream:S,isReadableEnded:V,isReadableFinished:z,isReadableErrored:Fe,isNodeStream:T,isWebStream:L,isWritable:he,isWritableNodeStream:A,isWritableStream:x,isWritableEnded:F,isWritableFinished:j,isWritableErrored:Ie,isServerRequest:Et,isServerResponse:_e,willEmitClose:Cn,isTransformStream:O}},{"../../ours/primordials":127}],123:[function(i,o,a){const u=i("process/"),{ArrayPrototypeSlice:c,Error:f,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:h,ObjectDefineProperties:v,ObjectSetPrototypeOf:g,StringPrototypeToLowerCase:p,Symbol:y,SymbolHasInstance:_}=i("../../ours/primordials");o.exports=_e,_e.WritableState=pe;const{EventEmitter:b}=i("events"),A=i("./legacy").Stream,{Buffer:w}=i("buffer"),T=i("./destroy"),{addAbortSignal:S}=i("./add-abort-signal"),{getHighWaterMark:x,getDefaultHighWaterMark:O}=i("./state"),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_MULTIPLE_CALLBACK:re,ERR_STREAM_CANNOT_PIPE:F,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:V,ERR_STREAM_NULL_VALUES:z,ERR_STREAM_WRITE_AFTER_END:$,ERR_UNKNOWN_ENCODING:he}=i("../../ours/errors").codes,{errorOrDestroy:le}=T;g(_e.prototype,A.prototype),g(_e,A);function Ie(){}const Fe=y("kOnFinished");function pe(ie,ae,Y){typeof Y!="boolean"&&(Y=ae instanceof i("./duplex")),this.objectMode=!!(ie&&ie.objectMode),Y&&(this.objectMode=this.objectMode||!!(ie&&ie.writableObjectMode)),this.highWaterMark=ie?x(this,ie,"writableHighWaterMark",Y):O(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const k=!!(ie&&ie.decodeStrings===!1);this.decodeStrings=!k,this.defaultEncoding=ie&&ie.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=de.bind(void 0,ae),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Lt(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ie||ie.emitClose!==!1,this.autoDestroy=!ie||ie.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fe]=[]}function Lt(ie){ie.buffered=[],ie.bufferedIndex=0,ie.allBuffers=!0,ie.allNoop=!0}pe.prototype.getBuffer=function(){return c(this.buffered,this.bufferedIndex)},h(pe.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function _e(ie){const ae=this instanceof i("./duplex");if(!ae&&!d(_e,this))return new _e(ie);this._writableState=new pe(ie,this,ae),ie&&(typeof ie.write=="function"&&(this._write=ie.write),typeof ie.writev=="function"&&(this._writev=ie.writev),typeof ie.destroy=="function"&&(this._destroy=ie.destroy),typeof ie.final=="function"&&(this._final=ie.final),typeof ie.construct=="function"&&(this._construct=ie.construct),ie.signal&&S(ie.signal,this)),A.call(this,ie),T.construct(this,()=>{const Y=this._writableState;Y.writing||$e(this,Y),Ne(this,Y)})}h(_e,_,{__proto__:null,value:function(ie){return d(this,ie)?!0:this!==_e?!1:ie&&ie._writableState instanceof pe}}),_e.prototype.pipe=function(){le(this,new F)};function Et(ie,ae,Y,k){const D=ie._writableState;if(typeof Y=="function")k=Y,Y=D.defaultEncoding;else{if(!Y)Y=D.defaultEncoding;else if(Y!=="buffer"&&!w.isEncoding(Y))throw new he(Y);typeof k!="function"&&(k=Ie)}if(ae===null)throw new z;if(!D.objectMode)if(typeof ae=="string")D.decodeStrings!==!1&&(ae=w.from(ae,Y),Y="buffer");else if(ae instanceof w)Y="buffer";else if(A._isUint8Array(ae))ae=A._uint8ArrayToBuffer(ae),Y="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],ae);let oe;return D.ending?oe=new $:D.destroyed&&(oe=new j("write")),oe?(u.nextTick(k,oe),le(ie,oe,!0),oe):(D.pendingcb++,Cn(ie,D,ae,Y,k))}_e.prototype.write=function(ie,ae,Y){return Et(this,ie,ae,Y)===!0},_e.prototype.cork=function(){this._writableState.corked++},_e.prototype.uncork=function(){const ie=this._writableState;ie.corked&&(ie.corked--,ie.writing||$e(this,ie))},_e.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=p(ae)),!w.isEncoding(ae))throw new he(ae);return this._writableState.defaultEncoding=ae,this};function Cn(ie,ae,Y,k,D){const oe=ae.objectMode?1:Y.length;ae.length+=oe;const xe=ae.length<ae.highWaterMark;return xe||(ae.needDrain=!0),ae.writing||ae.corked||ae.errored||!ae.constructed?(ae.buffered.push({chunk:Y,encoding:k,callback:D}),ae.allBuffers&&k!=="buffer"&&(ae.allBuffers=!1),ae.allNoop&&D!==Ie&&(ae.allNoop=!1)):(ae.writelen=oe,ae.writecb=D,ae.writing=!0,ae.sync=!0,ie._write(Y,k,ae.onwrite),ae.sync=!1),xe&&!ae.errored&&!ae.destroyed}function vn(ie,ae,Y,k,D,oe,xe){ae.writelen=k,ae.writecb=xe,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new j("write")):Y?ie._writev(D,ae.onwrite):ie._write(D,oe,ae.onwrite),ae.sync=!1}function Dt(ie,ae,Y,k){--ae.pendingcb,k(Y),In(ae),le(ie,Y)}function de(ie,ae){const Y=ie._writableState,k=Y.sync,D=Y.writecb;if(typeof D!="function"){le(ie,new re);return}Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ae?(ae.stack,Y.errored||(Y.errored=ae),ie._readableState&&!ie._readableState.errored&&(ie._readableState.errored=ae),k?u.nextTick(Dt,ie,Y,ae,D):Dt(ie,Y,ae,D)):(Y.buffered.length>Y.bufferedIndex&&$e(ie,Y),k?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===D?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:D,stream:ie,state:Y},u.nextTick(qe,Y.afterWriteTickInfo)):Pt(ie,Y,1,D))}function qe({stream:ie,state:ae,count:Y,cb:k}){return ae.afterWriteTickInfo=null,Pt(ie,ae,Y,k)}function Pt(ie,ae,Y,k){for(!ae.ending&&!ie.destroyed&&ae.length===0&&ae.needDrain&&(ae.needDrain=!1,ie.emit("drain"));Y-- >0;)ae.pendingcb--,k();ae.destroyed&&In(ae),Ne(ie,ae)}function In(ie){if(ie.writing)return;for(let D=ie.bufferedIndex;D<ie.buffered.length;++D){var ae;const{chunk:oe,callback:xe}=ie.buffered[D],ze=ie.objectMode?1:oe.length;ie.length-=ze,xe((ae=ie.errored)!==null&&ae!==void 0?ae:new j("write"))}const Y=ie[Fe].splice(0);for(let D=0;D<Y.length;D++){var k;Y[D]((k=ie.errored)!==null&&k!==void 0?k:new j("end"))}Lt(ie)}function $e(ie,ae){if(ae.corked||ae.bufferProcessing||ae.destroyed||!ae.constructed)return;const{buffered:Y,bufferedIndex:k,objectMode:D}=ae,oe=Y.length-k;if(!oe)return;let xe=k;if(ae.bufferProcessing=!0,oe>1&&ie._writev){ae.pendingcb-=oe-1;const ze=ae.allNoop?Ie:An=>{for(let Tn=xe;Tn<Y.length;++Tn)Y[Tn].callback(An)},hn=ae.allNoop&&xe===0?Y:c(Y,xe);hn.allBuffers=ae.allBuffers,vn(ie,ae,!0,ae.length,hn,"",ze),Lt(ae)}else{do{const{chunk:ze,encoding:hn,callback:An}=Y[xe];Y[xe++]=null;const Tn=D?1:ze.length;vn(ie,ae,!1,Tn,ze,hn,An)}while(xe<Y.length&&!ae.writing);xe===Y.length?Lt(ae):xe>256?(Y.splice(0,xe),ae.bufferedIndex=0):ae.bufferedIndex=xe}ae.bufferProcessing=!1}_e.prototype._write=function(ie,ae,Y){if(this._writev)this._writev([{chunk:ie,encoding:ae}],Y);else throw new M("_write()")},_e.prototype._writev=null,_e.prototype.end=function(ie,ae,Y){const k=this._writableState;typeof ie=="function"?(Y=ie,ie=null,ae=null):typeof ae=="function"&&(Y=ae,ae=null);let D;if(ie!=null){const oe=Et(this,ie,ae);oe instanceof f&&(D=oe)}return k.corked&&(k.corked=1,this.uncork()),D||(!k.errored&&!k.ending?(k.ending=!0,Ne(this,k,!0),k.ended=!0):k.finished?D=new V("end"):k.destroyed&&(D=new j("end"))),typeof Y=="function"&&(D||k.finished?u.nextTick(Y,D):k[Fe].push(Y)),this};function Ce(ie){return ie.ending&&!ie.destroyed&&ie.constructed&&ie.length===0&&!ie.errored&&ie.buffered.length===0&&!ie.finished&&!ie.writing&&!ie.errorEmitted&&!ie.closeEmitted}function ue(ie,ae){let Y=!1;function k(D){if(Y){le(ie,D??re());return}if(Y=!0,ae.pendingcb--,D){const oe=ae[Fe].splice(0);for(let xe=0;xe<oe.length;xe++)oe[xe](D);le(ie,D,ae.sync)}else Ce(ae)&&(ae.prefinished=!0,ie.emit("prefinish"),ae.pendingcb++,u.nextTick(Oe,ie,ae))}ae.sync=!0,ae.pendingcb++;try{ie._final(k)}catch(D){k(D)}ae.sync=!1}function At(ie,ae){!ae.prefinished&&!ae.finalCalled&&(typeof ie._final=="function"&&!ae.destroyed?(ae.finalCalled=!0,ue(ie,ae)):(ae.prefinished=!0,ie.emit("prefinish")))}function Ne(ie,ae,Y){Ce(ae)&&(At(ie,ae),ae.pendingcb===0&&(Y?(ae.pendingcb++,u.nextTick((k,D)=>{Ce(D)?Oe(k,D):D.pendingcb--},ie,ae)):Ce(ae)&&(ae.pendingcb++,Oe(ie,ae))))}function Oe(ie,ae){ae.pendingcb--,ae.finished=!0;const Y=ae[Fe].splice(0);for(let k=0;k<Y.length;k++)Y[k]();if(ie.emit("finish"),ae.autoDestroy){const k=ie._readableState;(!k||k.autoDestroy&&(k.endEmitted||k.readable===!1))&&ie.destroy()}}v(_e.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ie){this._writableState&&(this._writableState.destroyed=ie)}},writable:{__proto__:null,get(){const ie=this._writableState;return!!ie&&ie.writable!==!1&&!ie.destroyed&&!ie.errored&&!ie.ending&&!ie.ended},set(ie){this._writableState&&(this._writableState.writable=!!ie)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ie=this._writableState;return ie?!ie.destroyed&&!ie.ending&&ie.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const kt=T.destroy;_e.prototype.destroy=function(ie,ae){const Y=this._writableState;return!Y.destroyed&&(Y.bufferedIndex<Y.buffered.length||Y[Fe].length)&&u.nextTick(In,Y),kt.call(this,ie,ae),this},_e.prototype._undestroy=T.undestroy,_e.prototype._destroy=function(ie,ae){ae(ie)},_e.prototype[b.captureRejectionSymbol]=function(ie){this.destroy(ie)};let jt;function _n(){return jt===void 0&&(jt={}),jt}_e.fromWeb=function(ie,ae){return _n().newStreamWritableFromWritableStream(ie,ae)},_e.toWeb=function(ie){return _n().newWritableStreamFromStreamWritable(ie)}},{"../../ours/errors":126,"../../ours/primordials":127,"./add-abort-signal":107,"./destroy":110,"./duplex":111,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102}],124:[function(i,o,a){const{ArrayIsArray:u,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:f,ArrayPrototypeMap:d,NumberIsInteger:h,NumberIsNaN:v,NumberMAX_SAFE_INTEGER:g,NumberMIN_SAFE_INTEGER:p,NumberParseInt:y,ObjectPrototypeHasOwnProperty:_,RegExpPrototypeExec:b,String:A,StringPrototypeToUpperCase:w,StringPrototypeTrim:T}=i("../ours/primordials"),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:O,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:M,ERR_UNKNOWN_SIGNAL:re}}=i("../ours/errors"),{normalizeEncoding:F}=i("../ours/util"),{isAsyncFunction:j,isArrayBufferView:V}=i("../ours/util").types,z={};function $(oe){return oe===(oe|0)}function he(oe){return oe===oe>>>0}const le=/^[0-7]+$/,Ie="must be a 32-bit unsigned integer or an octal string";function Fe(oe,xe,ze){if(typeof oe>"u"&&(oe=ze),typeof oe=="string"){if(b(le,oe)===null)throw new L(xe,oe,Ie);oe=y(oe,8)}return _e(oe,xe),oe}const pe=S((oe,xe,ze=p,hn=g)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);if(oe<ze||oe>hn)throw new M(xe,`>= ${ze} && <= ${hn}`,oe)}),Lt=S((oe,xe,ze=-2147483648,hn=2147483647)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);if(oe<ze||oe>hn)throw new M(xe,`>= ${ze} && <= ${hn}`,oe)}),_e=S((oe,xe,ze=!1)=>{if(typeof oe!="number")throw new O(xe,"number",oe);if(!h(oe))throw new M(xe,"an integer",oe);const hn=ze?1:0,An=4294967295;if(oe<hn||oe>An)throw new M(xe,`>= ${hn} && <= ${An}`,oe)});function Et(oe,xe){if(typeof oe!="string")throw new O(xe,"string",oe)}function Cn(oe,xe,ze=void 0,hn){if(typeof oe!="number")throw new O(xe,"number",oe);if(ze!=null&&oe<ze||hn!=null&&oe>hn||(ze!=null||hn!=null)&&v(oe))throw new M(xe,`${ze!=null?`>= ${ze}`:""}${ze!=null&&hn!=null?" && ":""}${hn!=null?`<= ${hn}`:""}`,oe)}const vn=S((oe,xe,ze)=>{if(!c(ze,oe)){const An="must be one of: "+f(d(ze,Tn=>typeof Tn=="string"?`'${Tn}'`:A(Tn)),", ");throw new L(xe,oe,An)}});function Dt(oe,xe){if(typeof oe!="boolean")throw new O(xe,"boolean",oe)}function de(oe,xe,ze){return oe==null||!_(oe,xe)?ze:oe[xe]}const qe=S((oe,xe,ze=null)=>{const hn=de(ze,"allowArray",!1),An=de(ze,"allowFunction",!1);if(!de(ze,"nullable",!1)&&oe===null||!hn&&u(oe)||typeof oe!="object"&&(!An||typeof oe!="function"))throw new O(xe,"Object",oe)}),Pt=S((oe,xe)=>{if(oe!=null&&typeof oe!="object"&&typeof oe!="function")throw new O(xe,"a dictionary",oe)}),In=S((oe,xe,ze=0)=>{if(!u(oe))throw new O(xe,"Array",oe);if(oe.length<ze){const hn=`must be longer than ${ze}`;throw new L(xe,oe,hn)}});function $e(oe,xe){In(oe,xe);for(let ze=0;ze<oe.length;ze++)Et(oe[ze],`${xe}[${ze}]`)}function Ce(oe,xe){In(oe,xe);for(let ze=0;ze<oe.length;ze++)Dt(oe[ze],`${xe}[${ze}]`)}function ue(oe,xe="signal"){if(Et(oe,xe),z[oe]===void 0)throw z[w(oe)]!==void 0?new re(oe+" (signals must use all capital letters)"):new re(oe)}const At=S((oe,xe="buffer")=>{if(!V(oe))throw new O(xe,["Buffer","TypedArray","DataView"],oe)});function Ne(oe,xe){const ze=F(xe),hn=oe.length;if(ze==="hex"&&hn%2!==0)throw new L("encoding",xe,`is invalid for data of length ${hn}`)}function Oe(oe,xe="Port",ze=!0){if(typeof oe!="number"&&typeof oe!="string"||typeof oe=="string"&&T(oe).length===0||+oe!==+oe>>>0||oe>65535||oe===0&&!ze)throw new x(xe,oe,ze);return oe|0}const kt=S((oe,xe)=>{if(oe!==void 0&&(oe===null||typeof oe!="object"||!("aborted"in oe)))throw new O(xe,"AbortSignal",oe)}),jt=S((oe,xe)=>{if(typeof oe!="function")throw new O(xe,"Function",oe)}),_n=S((oe,xe)=>{if(typeof oe!="function"||j(oe))throw new O(xe,"Function",oe)}),ie=S((oe,xe)=>{if(oe!==void 0)throw new O(xe,"undefined",oe)});function ae(oe,xe,ze){if(!c(ze,oe))throw new O(xe,`('${f(ze,"|")}')`,oe)}const Y=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function k(oe,xe){if(typeof oe>"u"||!b(Y,oe))throw new L(xe,oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function D(oe){if(typeof oe=="string")return k(oe,"hints"),oe;if(u(oe)){const xe=oe.length;let ze="";if(xe===0)return ze;for(let hn=0;hn<xe;hn++){const An=oe[hn];k(An,"hints"),ze+=An,hn!==xe-1&&(ze+=", ")}return ze}throw new L("hints",oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o.exports={isInt32:$,isUint32:he,parseFileMode:Fe,validateArray:In,validateStringArray:$e,validateBooleanArray:Ce,validateBoolean:Dt,validateBuffer:At,validateDictionary:Pt,validateEncoding:Ne,validateFunction:jt,validateInt32:Lt,validateInteger:pe,validateNumber:Cn,validateObject:qe,validateOneOf:vn,validatePlainFunction:_n,validatePort:Oe,validateSignalName:ue,validateString:Et,validateUint32:_e,validateUndefined:ie,validateUnion:ae,validateAbortSignal:kt,validateLinkHeaderValue:D}},{"../ours/errors":126,"../ours/primordials":127,"../ours/util":128}],125:[function(i,o,a){const u=i("../stream"),c=i("../stream/promises"),f=u.Readable.destroy;o.exports=u.Readable,o.exports._uint8ArrayToBuffer=u._uint8ArrayToBuffer,o.exports._isUint8Array=u._isUint8Array,o.exports.isDisturbed=u.isDisturbed,o.exports.isErrored=u.isErrored,o.exports.isReadable=u.isReadable,o.exports.Readable=u.Readable,o.exports.Writable=u.Writable,o.exports.Duplex=u.Duplex,o.exports.Transform=u.Transform,o.exports.PassThrough=u.PassThrough,o.exports.addAbortSignal=u.addAbortSignal,o.exports.finished=u.finished,o.exports.destroy=u.destroy,o.exports.destroy=f,o.exports.pipeline=u.pipeline,o.exports.compose=u.compose,Object.defineProperty(u,"promises",{configurable:!0,enumerable:!0,get(){return c}}),o.exports.Stream=u.Stream,o.exports.default=o.exports},{"../stream":129,"../stream/promises":130}],126:[function(i,o,a){const{format:u,inspect:c,AggregateError:f}=i("./util"),d=globalThis.AggregateError||f,h=Symbol("kIsNodeError"),v=["string","function","number","object","Function","Object","boolean","bigint","symbol"],g=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",y={};function _(O,L){if(!O)throw new y.ERR_INTERNAL_ASSERTION(L)}function b(O){let L="",M=O.length;const re=O[0]==="-"?1:0;for(;M>=re+4;M-=3)L=`_${O.slice(M-3,M)}${L}`;return`${O.slice(0,M)}${L}`}function A(O,L,M){if(typeof L=="function")return _(L.length<=M.length,`Code: ${O}; The provided arguments length (${M.length}) does not match the required ones (${L.length}).`),L(...M);const re=(L.match(/%[dfijoOs]/g)||[]).length;return _(re===M.length,`Code: ${O}; The provided arguments length (${M.length}) does not match the required ones (${re}).`),M.length===0?L:u(L,...M)}function w(O,L,M){M||(M=Error);class re extends M{constructor(...j){super(A(O,L,j))}toString(){return`${this.name} [${O}]: ${this.message}`}}Object.defineProperties(re.prototype,{name:{value:M.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${O}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),re.prototype.code=O,re.prototype[h]=!0,y[O]=re}function T(O){const L=p+O.name;return Object.defineProperty(O,"name",{value:L}),O}function S(O,L){if(O&&L&&O!==L){if(Array.isArray(L.errors))return L.errors.push(O),L;const M=new d([L,O],L.message);return M.code=L.code,M}return O||L}class x extends Error{constructor(L="The operation was aborted",M=void 0){if(M!==void 0&&typeof M!="object")throw new y.ERR_INVALID_ARG_TYPE("options","Object",M);super(L,M),this.code="ABORT_ERR",this.name="AbortError"}}w("ERR_ASSERTION","%s",Error),w("ERR_INVALID_ARG_TYPE",(O,L,M)=>{_(typeof O=="string","'name' must be a string"),Array.isArray(L)||(L=[L]);let re="The ";O.endsWith(" argument")?re+=`${O} `:re+=`"${O}" ${O.includes(".")?"property":"argument"} `,re+="must be ";const F=[],j=[],V=[];for(const $ of L)_(typeof $=="string","All expected entries have to be of type string"),v.includes($)?F.push($.toLowerCase()):g.test($)?j.push($):(_($!=="object",'The value "object" should be written as "Object"'),V.push($));if(j.length>0){const $=F.indexOf("object");$!==-1&&(F.splice(F,$,1),j.push("Object"))}if(F.length>0){switch(F.length){case 1:re+=`of type ${F[0]}`;break;case 2:re+=`one of type ${F[0]} or ${F[1]}`;break;default:{const $=F.pop();re+=`one of type ${F.join(", ")}, or ${$}`}}(j.length>0||V.length>0)&&(re+=" or ")}if(j.length>0){switch(j.length){case 1:re+=`an instance of ${j[0]}`;break;case 2:re+=`an instance of ${j[0]} or ${j[1]}`;break;default:{const $=j.pop();re+=`an instance of ${j.join(", ")}, or ${$}`}}V.length>0&&(re+=" or ")}switch(V.length){case 0:break;case 1:V[0].toLowerCase()!==V[0]&&(re+="an "),re+=`${V[0]}`;break;case 2:re+=`one of ${V[0]} or ${V[1]}`;break;default:{const $=V.pop();re+=`one of ${V.join(", ")}, or ${$}`}}if(M==null)re+=`. Received ${M}`;else if(typeof M=="function"&&M.name)re+=`. Received function ${M.name}`;else if(typeof M=="object"){var z;if((z=M.constructor)!==null&&z!==void 0&&z.name)re+=`. Received an instance of ${M.constructor.name}`;else{const $=c(M,{depth:-1});re+=`. Received ${$}`}}else{let $=c(M,{colors:!1});$.length>25&&($=`${$.slice(0,25)}...`),re+=`. Received type ${typeof M} (${$})`}return re},TypeError),w("ERR_INVALID_ARG_VALUE",(O,L,M="is invalid")=>{let re=c(L);return re.length>128&&(re=re.slice(0,128)+"..."),`The ${O.includes(".")?"property":"argument"} '${O}' ${M}. Received ${re}`},TypeError),w("ERR_INVALID_RETURN_VALUE",(O,L,M)=>{var re;const F=M!=null&&(re=M.constructor)!==null&&re!==void 0&&re.name?`instance of ${M.constructor.name}`:`type ${typeof M}`;return`Expected ${O} to be returned from the "${L}" function but got ${F}.`},TypeError),w("ERR_MISSING_ARGS",(...O)=>{_(O.length>0,"At least one arg needs to be specified");let L;const M=O.length;switch(O=(Array.isArray(O)?O:[O]).map(re=>`"${re}"`).join(" or "),M){case 1:L+=`The ${O[0]} argument`;break;case 2:L+=`The ${O[0]} and ${O[1]} arguments`;break;default:{const re=O.pop();L+=`The ${O.join(", ")}, and ${re} arguments`}break}return`${L} must be specified`},TypeError),w("ERR_OUT_OF_RANGE",(O,L,M)=>{_(L,'Missing "range" argument');let re;return Number.isInteger(M)&&Math.abs(M)>2**32?re=b(String(M)):typeof M=="bigint"?(re=String(M),(M>2n**32n||M<-(2n**32n))&&(re=b(re)),re+="n"):re=c(M),`The value of "${O}" is out of range. It must be ${L}. Received ${re}`},RangeError),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),w("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),w("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),w("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),w("ERR_STREAM_WRITE_AFTER_END","write after end",Error),w("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),o.exports={AbortError:x,aggregateTwoErrors:T(S),hideStackFrames:T,codes:y}},{"./util":128}],127:[function(i,o,a){o.exports={ArrayIsArray(u){return Array.isArray(u)},ArrayPrototypeIncludes(u,c){return u.includes(c)},ArrayPrototypeIndexOf(u,c){return u.indexOf(c)},ArrayPrototypeJoin(u,c){return u.join(c)},ArrayPrototypeMap(u,c){return u.map(c)},ArrayPrototypePop(u,c){return u.pop(c)},ArrayPrototypePush(u,c){return u.push(c)},ArrayPrototypeSlice(u,c,f){return u.slice(c,f)},Error,FunctionPrototypeCall(u,c,...f){return u.call(c,...f)},FunctionPrototypeSymbolHasInstance(u,c){return Function.prototype[Symbol.hasInstance].call(u,c)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(u,c){return Object.defineProperties(u,c)},ObjectDefineProperty(u,c,f){return Object.defineProperty(u,c,f)},ObjectGetOwnPropertyDescriptor(u,c){return Object.getOwnPropertyDescriptor(u,c)},ObjectKeys(u){return Object.keys(u)},ObjectSetPrototypeOf(u,c){return Object.setPrototypeOf(u,c)},Promise,PromisePrototypeCatch(u,c){return u.catch(c)},PromisePrototypeThen(u,c,f){return u.then(c,f)},PromiseReject(u){return Promise.reject(u)},ReflectApply:Reflect.apply,RegExpPrototypeTest(u,c){return u.test(c)},SafeSet:Set,String,StringPrototypeSlice(u,c,f){return u.slice(c,f)},StringPrototypeToLowerCase(u){return u.toLowerCase()},StringPrototypeToUpperCase(u){return u.toUpperCase()},StringPrototypeTrim(u){return u.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(u,c,f){return u.set(c,f)},Uint8Array}},{}],128:[function(i,o,a){const u=i("buffer"),c=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||u.Blob,d=typeof f<"u"?function(g){return g instanceof f}:function(g){return!1};class h extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let p="";for(let y=0;y<g.length;y++)p+=` ${g[y].stack}
|
270
270
|
`;super(p),this.name="AggregateError",this.errors=g}}o.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(v){let g=!1;return function(...p){g||(g=!0,v.apply(this,p))}},createDeferredPromise:function(){let v,g;return{promise:new Promise((y,_)=>{v=y,g=_}),resolve:v,reject:g}},promisify(v){return new Promise((g,p)=>{v((y,..._)=>y?p(y):g(..._))})},debuglog(){return function(){}},format(v,...g){return v.replace(/%([sdifj])/g,function(...[p,y]){const _=g.shift();return y==="f"?_.toFixed(6):y==="j"?JSON.stringify(_):y==="s"&&typeof _=="object"?`${_.constructor!==Object?_.constructor.name:""} {}`.trim():_.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof c},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:d},o.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},{buffer:29}],129:[function(i,o,a){const{Buffer:u}=i("buffer"),{ObjectDefineProperty:c,ObjectKeys:f,ReflectApply:d}=i("./ours/primordials"),{promisify:{custom:h}}=i("./ours/util"),{streamReturningOperators:v,promiseReturningOperators:g}=i("./internal/streams/operators"),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=i("./ours/errors"),y=i("./internal/streams/compose"),{pipeline:_}=i("./internal/streams/pipeline"),{destroyer:b}=i("./internal/streams/destroy"),A=i("./internal/streams/end-of-stream"),w=i("./stream/promises"),T=i("./internal/streams/utils"),S=o.exports=i("./internal/streams/legacy").Stream;S.isDisturbed=T.isDisturbed,S.isErrored=T.isErrored,S.isReadable=T.isReadable,S.Readable=i("./internal/streams/readable");for(const O of f(v)){let M=function(...re){if(new.target)throw p();return S.Readable.from(d(L,this,re))};const L=v[O];c(M,"name",{__proto__:null,value:L.name}),c(M,"length",{__proto__:null,value:L.length}),c(S.Readable.prototype,O,{__proto__:null,value:M,enumerable:!1,configurable:!0,writable:!0})}for(const O of f(g)){let M=function(...re){if(new.target)throw p();return d(L,this,re)};const L=g[O];c(M,"name",{__proto__:null,value:L.name}),c(M,"length",{__proto__:null,value:L.length}),c(S.Readable.prototype,O,{__proto__:null,value:M,enumerable:!1,configurable:!0,writable:!0})}S.Writable=i("./internal/streams/writable"),S.Duplex=i("./internal/streams/duplex"),S.Transform=i("./internal/streams/transform"),S.PassThrough=i("./internal/streams/passthrough"),S.pipeline=_;const{addAbortSignal:x}=i("./internal/streams/add-abort-signal");S.addAbortSignal=x,S.finished=A,S.destroy=b,S.compose=y,c(S,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),c(_,h,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),c(A,h,{__proto__:null,enumerable:!0,get(){return w.finished}}),S.Stream=S,S._isUint8Array=function(L){return L instanceof Uint8Array},S._uint8ArrayToBuffer=function(L){return u.from(L.buffer,L.byteOffset,L.byteLength)}},{"./internal/streams/add-abort-signal":107,"./internal/streams/compose":109,"./internal/streams/destroy":110,"./internal/streams/duplex":111,"./internal/streams/end-of-stream":113,"./internal/streams/legacy":115,"./internal/streams/operators":116,"./internal/streams/passthrough":117,"./internal/streams/pipeline":118,"./internal/streams/readable":119,"./internal/streams/transform":121,"./internal/streams/utils":122,"./internal/streams/writable":123,"./ours/errors":126,"./ours/primordials":127,"./ours/util":128,"./stream/promises":130,buffer:29}],130:[function(i,o,a){const{ArrayPrototypePop:u,Promise:c}=i("../ours/primordials"),{isIterable:f,isNodeStream:d,isWebStream:h}=i("../internal/streams/utils"),{pipelineImpl:v}=i("../internal/streams/pipeline"),{finished:g}=i("../internal/streams/end-of-stream");i("../../lib/stream.js");function p(...y){return new c((_,b)=>{let A,w;const T=y[y.length-1];if(T&&typeof T=="object"&&!d(T)&&!f(T)&&!h(T)){const S=u(y);A=S.signal,w=S.end}v(y,(S,x)=>{S?b(S):_(x)},{signal:A,end:w})})}o.exports={finished:g,pipeline:p}},{"../../lib/stream.js":129,"../internal/streams/end-of-stream":113,"../internal/streams/pipeline":118,"../internal/streams/utils":122,"../ours/primordials":127}],131:[function(i,o,a){function u(f,d,h){var v=this;this._callback=f,this._args=h,this._interval=setInterval(f,d,this._args),this.reschedule=function(g){g||(g=v._interval),v._interval&&clearInterval(v._interval),v._interval=setInterval(v._callback,g,v._args)},this.clear=function(){v._interval&&(clearInterval(v._interval),v._interval=void 0)},this.destroy=function(){v._interval&&clearInterval(v._interval),v._callback=void 0,v._interval=void 0,v._args=void 0}}function c(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var f;if(arguments.length>0){f=new Array(arguments.length-2);for(var d=0;d<f.length;d++)f[d]=arguments[d+2]}return new u(arguments[0],arguments[1],f)}o.exports=c},{}],132:[function(i,o,a){o.exports=i("./index.js")()},{"./index.js":133}],133:[function(i,o,a){(function(u){(function(){o.exports=f;function c(h){return h instanceof u?u.from(h):new h.constructor(h.buffer.slice(),h.byteOffset,h.length)}function f(h){if(h=h||{},h.circles)return d(h);return h.proto?p:g;function v(y,_){for(var b=Object.keys(y),A=new Array(b.length),w=0;w<b.length;w++){var T=b[w],S=y[T];typeof S!="object"||S===null?A[T]=S:S instanceof Date?A[T]=new Date(S):ArrayBuffer.isView(S)?A[T]=c(S):A[T]=_(S)}return A}function g(y){if(typeof y!="object"||y===null)return y;if(y instanceof Date)return new Date(y);if(Array.isArray(y))return v(y,g);if(y instanceof Map)return new Map(v(Array.from(y),g));if(y instanceof Set)return new Set(v(Array.from(y),g));var _={};for(var b in y)if(Object.hasOwnProperty.call(y,b)!==!1){var A=y[b];typeof A!="object"||A===null?_[b]=A:A instanceof Date?_[b]=new Date(A):A instanceof Map?_[b]=new Map(v(Array.from(A),g)):A instanceof Set?_[b]=new Set(v(Array.from(A),g)):ArrayBuffer.isView(A)?_[b]=c(A):_[b]=g(A)}return _}function p(y){if(typeof y!="object"||y===null)return y;if(y instanceof Date)return new Date(y);if(Array.isArray(y))return v(y,p);if(y instanceof Map)return new Map(v(Array.from(y),p));if(y instanceof Set)return new Set(v(Array.from(y),p));var _={};for(var b in y){var A=y[b];typeof A!="object"||A===null?_[b]=A:A instanceof Date?_[b]=new Date(A):A instanceof Map?_[b]=new Map(v(Array.from(A),p)):A instanceof Set?_[b]=new Set(v(Array.from(A),p)):ArrayBuffer.isView(A)?_[b]=c(A):_[b]=p(A)}return _}}function d(h){var v=[],g=[];return h.proto?_:y;function p(b,A){for(var w=Object.keys(b),T=new Array(w.length),S=0;S<w.length;S++){var x=w[S],O=b[x];if(typeof O!="object"||O===null)T[x]=O;else if(O instanceof Date)T[x]=new Date(O);else if(ArrayBuffer.isView(O))T[x]=c(O);else{var L=v.indexOf(O);L!==-1?T[x]=g[L]:T[x]=A(O)}}return T}function y(b){if(typeof b!="object"||b===null)return b;if(b instanceof Date)return new Date(b);if(Array.isArray(b))return p(b,y);if(b instanceof Map)return new Map(p(Array.from(b),y));if(b instanceof Set)return new Set(p(Array.from(b),y));var A={};v.push(b),g.push(A);for(var w in b)if(Object.hasOwnProperty.call(b,w)!==!1){var T=b[w];if(typeof T!="object"||T===null)A[w]=T;else if(T instanceof Date)A[w]=new Date(T);else if(T instanceof Map)A[w]=new Map(p(Array.from(T),y));else if(T instanceof Set)A[w]=new Set(p(Array.from(T),y));else if(ArrayBuffer.isView(T))A[w]=c(T);else{var S=v.indexOf(T);S!==-1?A[w]=g[S]:A[w]=y(T)}}return v.pop(),g.pop(),A}function _(b){if(typeof b!="object"||b===null)return b;if(b instanceof Date)return new Date(b);if(Array.isArray(b))return p(b,_);if(b instanceof Map)return new Map(p(Array.from(b),_));if(b instanceof Set)return new Set(p(Array.from(b),_));var A={};v.push(b),g.push(A);for(var w in b){var T=b[w];if(typeof T!="object"||T===null)A[w]=T;else if(T instanceof Date)A[w]=new Date(T);else if(T instanceof Map)A[w]=new Map(p(Array.from(T),_));else if(T instanceof Set)A[w]=new Set(p(Array.from(T),_));else if(ArrayBuffer.isView(T))A[w]=c(T);else{var S=v.indexOf(T);S!==-1?A[w]=g[S]:A[w]=_(T)}}return v.pop(),g.pop(),A}}}).call(this)}).call(this,i("buffer").Buffer)},{buffer:29}],134:[function(i,o,a){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var u=i("buffer"),c=u.Buffer;function f(h,v){for(var g in h)v[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(f(u,a),a.Buffer=d);function d(h,v,g){return c(h,v,g)}d.prototype=Object.create(c.prototype),f(c,d),d.from=function(h,v,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,v,g)},d.alloc=function(h,v,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return v!==void 0?typeof g=="string"?p.fill(v,g):p.fill(v):p.fill(0),p},d.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},d.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],135:[function(i,o,a){o.exports=u;function u(f){var d=f._readableState;return d?d.objectMode||typeof f._duplexState=="number"?f.read():f.read(c(d)):null}function c(f){return f.buffer.length?f.buffer.head?f.buffer.head.data.length:f.buffer[0].length:f.length}},{}],136:[function(i,o,a){arguments[4][28][0].apply(a,arguments)},{dup:28,"safe-buffer":134}],137:[function(i,o,a){var u=i("punycode"),c=i("./util");a.parse=M,a.resolve=F,a.resolveObject=j,a.format=re,a.Url=f;function f(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var d=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,v=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,g=["<",">",'"',"`"," ","\r",`
|
271
|
-
`," "],p=["{","}","|","\\","^","`"].concat(g),y=["'"].concat(p),_=["%","/","?",";","#"].concat(y),b=["/","?","#"],A=255,w=/^[+a-z0-9A-Z_-]{0,63}$/,T=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},L=i("querystring");function M(V,z,$){if(V&&c.isObject(V)&&V instanceof f)return V;var he=new f;return he.parse(V,z,$),he}f.prototype.parse=function(V,z,$){if(!c.isString(V))throw new TypeError("Parameter 'url' must be a string, not "+typeof V);var he=V.indexOf("?"),le=he!==-1&&he<V.indexOf("#")?"?":"#",Ie=V.split(le),Fe=/\\/g;Ie[0]=Ie[0].replace(Fe,"/"),V=Ie.join(le);var pe=V;if(pe=pe.trim(),!$&&V.split("#").length===1){var Lt=v.exec(pe);if(Lt)return this.path=pe,this.href=pe,this.pathname=Lt[1],Lt[2]?(this.search=Lt[2],z?this.query=L.parse(this.search.substr(1)):this.query=this.search.substr(1)):z&&(this.search="",this.query={}),this}var _e=d.exec(pe);if(_e){_e=_e[0];var Et=_e.toLowerCase();this.protocol=Et,pe=pe.substr(_e.length)}if($||_e||pe.match(/^\/\/[^@\/]+@[^@\/]+/)){var Cn=pe.substr(0,2)==="//";Cn&&!(_e&&x[_e])&&(pe=pe.substr(2),this.slashes=!0)}if(!x[_e]&&(Cn||_e&&!O[_e])){for(var vn=-1,Dt=0;Dt<b.length;Dt++){var de=pe.indexOf(b[Dt]);de!==-1&&(vn===-1||de<vn)&&(vn=de)}var qe,Pt;vn===-1?Pt=pe.lastIndexOf("@"):Pt=pe.lastIndexOf("@",vn),Pt!==-1&&(qe=pe.slice(0,Pt),pe=pe.slice(Pt+1),this.auth=decodeURIComponent(qe)),vn=-1;for(var Dt=0;Dt<_.length;Dt++){var de=pe.indexOf(_[Dt]);de!==-1&&(vn===-1||de<vn)&&(vn=de)}vn===-1&&(vn=pe.length),this.host=pe.slice(0,vn),pe=pe.slice(vn),this.parseHost(),this.hostname=this.hostname||"";var In=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!In)for(var $e=this.hostname.split(/\./),Dt=0,Ce=$e.length;Dt<Ce;Dt++){var ue=$e[Dt];if(ue&&!ue.match(w)){for(var At="",Ne=0,Oe=ue.length;Ne<Oe;Ne++)ue.charCodeAt(Ne)>127?At+="x":At+=ue[Ne];if(!At.match(w)){var kt=$e.slice(0,Dt),jt=$e.slice(Dt+1),_n=ue.match(T);_n&&(kt.push(_n[1]),jt.unshift(_n[2])),jt.length&&(pe="/"+jt.join(".")+pe),this.hostname=kt.join(".");break}}}this.hostname.length>A?this.hostname="":this.hostname=this.hostname.toLowerCase(),In||(this.hostname=u.toASCII(this.hostname));var ie=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+ie,this.href+=this.host,In&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),pe[0]!=="/"&&(pe="/"+pe))}if(!S[Et])for(var Dt=0,Ce=y.length;Dt<Ce;Dt++){var Y=y[Dt];if(pe.indexOf(Y)!==-1){var k=encodeURIComponent(Y);k===Y&&(k=escape(Y)),pe=pe.split(Y).join(k)}}var D=pe.indexOf("#");D!==-1&&(this.hash=pe.substr(D),pe=pe.slice(0,D));var oe=pe.indexOf("?");if(oe!==-1?(this.search=pe.substr(oe),this.query=pe.substr(oe+1),z&&(this.query=L.parse(this.query)),pe=pe.slice(0,oe)):z&&(this.search="",this.query={}),pe&&(this.pathname=pe),O[Et]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ie=this.pathname||"",xe=this.search||"";this.path=ie+xe}return this.href=this.format(),this};function re(V){return c.isString(V)&&(V=M(V)),V instanceof f?V.format():f.prototype.format.call(V)}f.prototype.format=function(){var V=this.auth||"";V&&(V=encodeURIComponent(V),V=V.replace(/%3A/i,":"),V+="@");var z=this.protocol||"",$=this.pathname||"",he=this.hash||"",le=!1,Ie="";this.host?le=V+this.host:this.hostname&&(le=V+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(le+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(Ie=L.stringify(this.query));var Fe=this.search||Ie&&"?"+Ie||"";return z&&z.substr(-1)!==":"&&(z+=":"),this.slashes||(!z||O[z])&&le!==!1?(le="//"+(le||""),$&&$.charAt(0)!=="/"&&($="/"+$)):le||(le=""),he&&he.charAt(0)!=="#"&&(he="#"+he),Fe&&Fe.charAt(0)!=="?"&&(Fe="?"+Fe),$=$.replace(/[?#]/g,function(pe){return encodeURIComponent(pe)}),Fe=Fe.replace("#","%23"),z+le+$+Fe+he};function F(V,z){return M(V,!1,!0).resolve(z)}f.prototype.resolve=function(V){return this.resolveObject(M(V,!1,!0)).format()};function j(V,z){return V?M(V,!1,!0).resolveObject(z):z}f.prototype.resolveObject=function(V){if(c.isString(V)){var z=new f;z.parse(V,!1,!0),V=z}for(var $=new f,he=Object.keys(this),le=0;le<he.length;le++){var Ie=he[le];$[Ie]=this[Ie]}if($.hash=V.hash,V.href==="")return $.href=$.format(),$;if(V.slashes&&!V.protocol){for(var Fe=Object.keys(V),pe=0;pe<Fe.length;pe++){var Lt=Fe[pe];Lt!=="protocol"&&($[Lt]=V[Lt])}return O[$.protocol]&&$.hostname&&!$.pathname&&($.path=$.pathname="/"),$.href=$.format(),$}if(V.protocol&&V.protocol!==$.protocol){if(!O[V.protocol]){for(var _e=Object.keys(V),Et=0;Et<_e.length;Et++){var Cn=_e[Et];$[Cn]=V[Cn]}return $.href=$.format(),$}if($.protocol=V.protocol,!V.host&&!x[V.protocol]){for(var Ce=(V.pathname||"").split("/");Ce.length&&!(V.host=Ce.shift()););V.host||(V.host=""),V.hostname||(V.hostname=""),Ce[0]!==""&&Ce.unshift(""),Ce.length<2&&Ce.unshift(""),$.pathname=Ce.join("/")}else $.pathname=V.pathname;if($.search=V.search,$.query=V.query,$.host=V.host||"",$.auth=V.auth,$.hostname=V.hostname||V.host,$.port=V.port,$.pathname||$.search){var vn=$.pathname||"",Dt=$.search||"";$.path=vn+Dt}return $.slashes=$.slashes||V.slashes,$.href=$.format(),$}var de=$.pathname&&$.pathname.charAt(0)==="/",qe=V.host||V.pathname&&V.pathname.charAt(0)==="/",Pt=qe||de||$.host&&V.pathname,In=Pt,$e=$.pathname&&$.pathname.split("/")||[],Ce=V.pathname&&V.pathname.split("/")||[],ue=$.protocol&&!O[$.protocol];if(ue&&($.hostname="",$.port=null,$.host&&($e[0]===""?$e[0]=$.host:$e.unshift($.host)),$.host="",V.protocol&&(V.hostname=null,V.port=null,V.host&&(Ce[0]===""?Ce[0]=V.host:Ce.unshift(V.host)),V.host=null),Pt=Pt&&(Ce[0]===""||$e[0]==="")),qe)$.host=V.host||V.host===""?V.host:$.host,$.hostname=V.hostname||V.hostname===""?V.hostname:$.hostname,$.search=V.search,$.query=V.query,$e=Ce;else if(Ce.length)$e||($e=[]),$e.pop(),$e=$e.concat(Ce),$.search=V.search,$.query=V.query;else if(!c.isNullOrUndefined(V.search)){if(ue){$.hostname=$.host=$e.shift();var At=$.host&&$.host.indexOf("@")>0?$.host.split("@"):!1;At&&($.auth=At.shift(),$.host=$.hostname=At.shift())}return $.search=V.search,$.query=V.query,(!c.isNull($.pathname)||!c.isNull($.search))&&($.path=($.pathname?$.pathname:"")+($.search?$.search:"")),$.href=$.format(),$}if(!$e.length)return $.pathname=null,$.search?$.path="/"+$.search:$.path=null,$.href=$.format(),$;for(var Ne=$e.slice(-1)[0],Oe=($.host||V.host||$e.length>1)&&(Ne==="."||Ne==="..")||Ne==="",kt=0,jt=$e.length;jt>=0;jt--)Ne=$e[jt],Ne==="."?$e.splice(jt,1):Ne===".."?($e.splice(jt,1),kt++):kt&&($e.splice(jt,1),kt--);if(!Pt&&!In)for(;kt--;kt)$e.unshift("..");Pt&&$e[0]!==""&&(!$e[0]||$e[0].charAt(0)!=="/")&&$e.unshift(""),Oe&&$e.join("/").substr(-1)!=="/"&&$e.push("");var _n=$e[0]===""||$e[0]&&$e[0].charAt(0)==="/";if(ue){$.hostname=$.host=_n?"":$e.length?$e.shift():"";var At=$.host&&$.host.indexOf("@")>0?$.host.split("@"):!1;At&&($.auth=At.shift(),$.host=$.hostname=At.shift())}return Pt=Pt||$.host&&$e.length,Pt&&!_n&&$e.unshift(""),$e.length?$.pathname=$e.join("/"):($.pathname=null,$.path=null),(!c.isNull($.pathname)||!c.isNull($.search))&&($.path=($.pathname?$.pathname:"")+($.search?$.search:"")),$.auth=V.auth||$.auth,$.slashes=$.slashes||V.slashes,$.href=$.format(),$},f.prototype.parseHost=function(){var V=this.host,z=h.exec(V);z&&(z=z[0],z!==":"&&(this.port=z.substr(1)),V=V.substr(0,V.length-z.length)),V&&(this.hostname=V)}},{"./util":138,punycode:103,querystring:106}],138:[function(i,o,a){o.exports={isString:function(u){return typeof u=="string"},isObject:function(u){return typeof u=="object"&&u!==null},isNull:function(u){return u===null},isNullOrUndefined:function(u){return u==null}}},{}],139:[function(i,o,a){(function(u){(function(){o.exports=c;function c(d,h){if(f("noDeprecation"))return d;var v=!1;function g(){if(!v){if(f("throwDeprecation"))throw new Error(h);f("traceDeprecation")?console.trace(h):console.warn(h),v=!0}return d.apply(this,arguments)}return g}function f(d){try{if(!u.localStorage)return!1}catch{return!1}var h=u.localStorage[d];return h==null?!1:String(h).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],140:[function(i,o,a){o.exports=u;function u(c,f){if(c&&f)return u(c)(f);if(typeof c!="function")throw new TypeError("need wrapper function");return Object.keys(c).forEach(function(h){d[h]=c[h]}),d;function d(){for(var h=new Array(arguments.length),v=0;v<h.length;v++)h[v]=arguments[v];var g=c.apply(this,h),p=h[h.length-1];return typeof g=="function"&&g!==p&&Object.keys(p).forEach(function(y){g[y]=p[y]}),g}}},{}],141:[function(i,o,a){o.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}]},{},[23])(23)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(r,n,i,o,a)=>{const u=r.trim();if(!/^wss?:\/\/.*$/.test(u)){console.error('编辑器MQTT通信只支持ws协议 (url必须以"ws://"开头)');return}client=mqttExports.connect(u,{username:n.trim(),password:i.trim(),reconnectPeriod:6e5}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(o,{qos:1})}),client.on("message",a)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1=["transform"],_hoisted_2=["transform","onClick"],_hoisted_3=["transform"],_hoisted_4=["xlink:href","width","height","id","transform"],_hoisted_5=["id"],_sfc_main=vue.defineComponent({__name:"svg-viewer",props:{vueComp:{},data:{},canvasDrag:{type:Boolean,default:!0}},emits:["onMessage"],setup(r,{expose:n,emit:i}){const o=r;vue.useCssVars(w=>({"95589e5a":vue.unref(c)})),setEditorLoadTime();const a=useGlobalStore(pinia);componentsRegister(o.vueComp);const u=vue.reactive(o.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,grid_color:"#ebebeb"},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),c=vue.computed(()=>a.intention==EGlobalStoreIntention.MoveCanvas?"grab":"default"),f=w=>{if(a.mouse_info.state!=EMouseInfoState.Down&&a.intention!==EGlobalStoreIntention.Connection||!o.canvasDrag)return;const{clientX:T,clientY:S}=w;a.mouse_info.new_position_x=a.mouse_info.now_position_x+T-a.mouse_info.position_x,a.mouse_info.new_position_y=a.mouse_info.now_position_y+S-a.mouse_info.position_y,a.intention==EGlobalStoreIntention.MoveCanvas&&(u.layout_center.x=a.mouse_info.new_position_x,u.layout_center.y=a.mouse_info.new_position_y)},d=()=>{a.mouse_info.state==EMouseInfoState.Down&&(a.intention!=EGlobalStoreIntention.Select&&(a.intention=EGlobalStoreIntention.None),a.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0})},h=w=>{const{clientX:T,clientY:S}=w;a.intention=EGlobalStoreIntention.MoveCanvas,a.mouse_info={state:EMouseInfoState.Down,position_x:T,position_y:S,now_position_x:u.layout_center.x,now_position_y:u.layout_center.y,new_position_x:u.layout_center.x,new_position_y:u.layout_center.y}};function v(w){w!=null&&w.wheelDelta&&(w.wheelDelta>0?u.config.svg.scale=parseFloat((u.config.svg.scale+.1).toFixed(1)):u.config.svg.scale=parseFloat((u.config.svg.scale-.1).toFixed(1)))}const g=(w,T,S)=>({x:w.x-w.width/2*T+w.width/2,y:w.y-w.height/2*S+w.height/2,width:w.width*T,height:w.height*S}),p=w=>{var S;let T=!1;if(((S=w.events)==null?void 0:S.length)>0){for(let x of w.events)if(x.type===EEventType.Click){T=!0;break}}return{cursor:T?"pointer":"default"}},y=(w,T)=>{var S;if(console.log(w.events,T),((S=w.events)==null?void 0:S.length)>0){for(let x of w.events)if(x.type===T){if(x.condition&&x.condition.type!=="None"&&x.condition.type==="Relation"&&x.condition.Relation&&x.condition.Relation.relation){const O=x.condition.Relation.key,L=x.condition.Relation.relation,M=valFormat(x.condition.Relation.val),re=valFormat(x.condition.Relation.val2);if(w.props.hasOwnProperty(O)){const F=w.props[O].val;if(!_(F,L,M,re))continue}}if(x.action===EEventAction.ChangeAttr){if(x.attrs&&x.attrs.length>0){let O;if(x.target){for(let L of u.done_json)if(L.id===x.target){O=L;break}}else O=w;if(!O)continue;for(let L of x.attrs)L.key==="state"?O.defaultState=valFormat(L.val):O.props.hasOwnProperty(L.key)&&(O.props[L.key].val=valFormat(L.val))}}else x.action===EEventAction.JavaScript&&new Function(x.scripts)()}}},_=(w,T,S,x)=>{switch(T){case">":return w>S;case">=":return w>=S;case"<":return w<S;case"<=":return w<=S;case"==":return w==S;case"!=":return w!=S;case">=,=<":return w>=S&&w<=x;case"<,>":return w<S||w>x}},b=()=>{const w=u.config.net.mqtt;w&&w.url&&w.user&&w.pwd&&w.topics&&sub(w.url,w.user,w.pwd,w.topics,(T,S)=>{console.log(T),console.log(S.toString()),i("onMessage",{topics:T,message:S})})},A=(w,T,S)=>setArrItemByID(w,T,S,u.done_json);return vue.onMounted(()=>{b()}),vue.onBeforeUnmount(close),n({setNodeAttrByID:A}),(w,T)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:h,onMousemove:f,onMouseup:d,onMousewheel:v,onContextmenu:T[4]||(T[4]=(...S)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...S))},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(u).config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${vue.unref(u).layout_center.x},${vue.unref(u).layout_center.y})rotate(0)scale(${vue.unref(u).config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(u).done_json,S=>{var x,O,L,M,re,F,j,V;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:S.id,transform:`translate(${S.x},${S.y})rotate(0)scale(1)`,style:vue.normalizeStyle(p(S)),onClick:z=>y(S,vue.unref(EEventType).Click),onMousedown:T[0]||(T[0]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMousemove:T[1]||(T[1]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMouseup:T[2]||(T[2]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMousewheel:T[3]||(T[3]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(S)}`)},[vue.createElementVNode("g",{transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2})rotate(${S.rotate}) scale(1) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`},[S.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":S},null,8,["item-info"])):S.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${S.name}`},vue.unref(prosToVBind)(S,["height","width"]),{width:((O=(x=S.props)==null?void 0:x.width)==null?void 0:O.val)??100,height:((M=(L=S.props)==null?void 0:L.height)==null?void 0:M.val)??100,id:S.id,transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),null,16,_hoisted_4)):S.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(S.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(S,["height","width"]),{width:((F=(re=S.props)==null?void 0:re.width)==null?void 0:F.val)??100,height:((V=(j=S.props)==null?void 0:j.height)==null?void 0:V.val)??100,id:S.id,onOnChange:z=>y(S,vue.unref(EEventType).Change),transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),null,16,["width","height","id","onOnChange","transform"])):S.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},g(S.actual_bound,S.scale_x,S.scale_y),{id:`foreign-object${S.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(S.tag),vue.mergeProps(vue.unref(prosToVBind)(S),{id:S.id,onOnChange:z=>y(S,vue.unref(EEventType).Change),transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(S.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],44,_hoisted_2)),[[vue.vShow,S.display]])}),128))],8,_hoisted_1)],4))],32))}}),svgViewer_vue_vue_type_style_index_0_scoped_c4bb0b2d_lang="",svgViewer=_export_sfc$1(_sfc_main,[["__scopeId","data-v-c4bb0b2d"]]);exports.SvgEditor=index,exports.SvgViewer=svgViewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
271
|
+
`," "],p=["{","}","|","\\","^","`"].concat(g),y=["'"].concat(p),_=["%","/","?",";","#"].concat(y),b=["/","?","#"],A=255,w=/^[+a-z0-9A-Z_-]{0,63}$/,T=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},O={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},L=i("querystring");function M(V,z,$){if(V&&c.isObject(V)&&V instanceof f)return V;var he=new f;return he.parse(V,z,$),he}f.prototype.parse=function(V,z,$){if(!c.isString(V))throw new TypeError("Parameter 'url' must be a string, not "+typeof V);var he=V.indexOf("?"),le=he!==-1&&he<V.indexOf("#")?"?":"#",Ie=V.split(le),Fe=/\\/g;Ie[0]=Ie[0].replace(Fe,"/"),V=Ie.join(le);var pe=V;if(pe=pe.trim(),!$&&V.split("#").length===1){var Lt=v.exec(pe);if(Lt)return this.path=pe,this.href=pe,this.pathname=Lt[1],Lt[2]?(this.search=Lt[2],z?this.query=L.parse(this.search.substr(1)):this.query=this.search.substr(1)):z&&(this.search="",this.query={}),this}var _e=d.exec(pe);if(_e){_e=_e[0];var Et=_e.toLowerCase();this.protocol=Et,pe=pe.substr(_e.length)}if($||_e||pe.match(/^\/\/[^@\/]+@[^@\/]+/)){var Cn=pe.substr(0,2)==="//";Cn&&!(_e&&x[_e])&&(pe=pe.substr(2),this.slashes=!0)}if(!x[_e]&&(Cn||_e&&!O[_e])){for(var vn=-1,Dt=0;Dt<b.length;Dt++){var de=pe.indexOf(b[Dt]);de!==-1&&(vn===-1||de<vn)&&(vn=de)}var qe,Pt;vn===-1?Pt=pe.lastIndexOf("@"):Pt=pe.lastIndexOf("@",vn),Pt!==-1&&(qe=pe.slice(0,Pt),pe=pe.slice(Pt+1),this.auth=decodeURIComponent(qe)),vn=-1;for(var Dt=0;Dt<_.length;Dt++){var de=pe.indexOf(_[Dt]);de!==-1&&(vn===-1||de<vn)&&(vn=de)}vn===-1&&(vn=pe.length),this.host=pe.slice(0,vn),pe=pe.slice(vn),this.parseHost(),this.hostname=this.hostname||"";var In=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!In)for(var $e=this.hostname.split(/\./),Dt=0,Ce=$e.length;Dt<Ce;Dt++){var ue=$e[Dt];if(ue&&!ue.match(w)){for(var At="",Ne=0,Oe=ue.length;Ne<Oe;Ne++)ue.charCodeAt(Ne)>127?At+="x":At+=ue[Ne];if(!At.match(w)){var kt=$e.slice(0,Dt),jt=$e.slice(Dt+1),_n=ue.match(T);_n&&(kt.push(_n[1]),jt.unshift(_n[2])),jt.length&&(pe="/"+jt.join(".")+pe),this.hostname=kt.join(".");break}}}this.hostname.length>A?this.hostname="":this.hostname=this.hostname.toLowerCase(),In||(this.hostname=u.toASCII(this.hostname));var ie=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+ie,this.href+=this.host,In&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),pe[0]!=="/"&&(pe="/"+pe))}if(!S[Et])for(var Dt=0,Ce=y.length;Dt<Ce;Dt++){var Y=y[Dt];if(pe.indexOf(Y)!==-1){var k=encodeURIComponent(Y);k===Y&&(k=escape(Y)),pe=pe.split(Y).join(k)}}var D=pe.indexOf("#");D!==-1&&(this.hash=pe.substr(D),pe=pe.slice(0,D));var oe=pe.indexOf("?");if(oe!==-1?(this.search=pe.substr(oe),this.query=pe.substr(oe+1),z&&(this.query=L.parse(this.query)),pe=pe.slice(0,oe)):z&&(this.search="",this.query={}),pe&&(this.pathname=pe),O[Et]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ie=this.pathname||"",xe=this.search||"";this.path=ie+xe}return this.href=this.format(),this};function re(V){return c.isString(V)&&(V=M(V)),V instanceof f?V.format():f.prototype.format.call(V)}f.prototype.format=function(){var V=this.auth||"";V&&(V=encodeURIComponent(V),V=V.replace(/%3A/i,":"),V+="@");var z=this.protocol||"",$=this.pathname||"",he=this.hash||"",le=!1,Ie="";this.host?le=V+this.host:this.hostname&&(le=V+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(le+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(Ie=L.stringify(this.query));var Fe=this.search||Ie&&"?"+Ie||"";return z&&z.substr(-1)!==":"&&(z+=":"),this.slashes||(!z||O[z])&&le!==!1?(le="//"+(le||""),$&&$.charAt(0)!=="/"&&($="/"+$)):le||(le=""),he&&he.charAt(0)!=="#"&&(he="#"+he),Fe&&Fe.charAt(0)!=="?"&&(Fe="?"+Fe),$=$.replace(/[?#]/g,function(pe){return encodeURIComponent(pe)}),Fe=Fe.replace("#","%23"),z+le+$+Fe+he};function F(V,z){return M(V,!1,!0).resolve(z)}f.prototype.resolve=function(V){return this.resolveObject(M(V,!1,!0)).format()};function j(V,z){return V?M(V,!1,!0).resolveObject(z):z}f.prototype.resolveObject=function(V){if(c.isString(V)){var z=new f;z.parse(V,!1,!0),V=z}for(var $=new f,he=Object.keys(this),le=0;le<he.length;le++){var Ie=he[le];$[Ie]=this[Ie]}if($.hash=V.hash,V.href==="")return $.href=$.format(),$;if(V.slashes&&!V.protocol){for(var Fe=Object.keys(V),pe=0;pe<Fe.length;pe++){var Lt=Fe[pe];Lt!=="protocol"&&($[Lt]=V[Lt])}return O[$.protocol]&&$.hostname&&!$.pathname&&($.path=$.pathname="/"),$.href=$.format(),$}if(V.protocol&&V.protocol!==$.protocol){if(!O[V.protocol]){for(var _e=Object.keys(V),Et=0;Et<_e.length;Et++){var Cn=_e[Et];$[Cn]=V[Cn]}return $.href=$.format(),$}if($.protocol=V.protocol,!V.host&&!x[V.protocol]){for(var Ce=(V.pathname||"").split("/");Ce.length&&!(V.host=Ce.shift()););V.host||(V.host=""),V.hostname||(V.hostname=""),Ce[0]!==""&&Ce.unshift(""),Ce.length<2&&Ce.unshift(""),$.pathname=Ce.join("/")}else $.pathname=V.pathname;if($.search=V.search,$.query=V.query,$.host=V.host||"",$.auth=V.auth,$.hostname=V.hostname||V.host,$.port=V.port,$.pathname||$.search){var vn=$.pathname||"",Dt=$.search||"";$.path=vn+Dt}return $.slashes=$.slashes||V.slashes,$.href=$.format(),$}var de=$.pathname&&$.pathname.charAt(0)==="/",qe=V.host||V.pathname&&V.pathname.charAt(0)==="/",Pt=qe||de||$.host&&V.pathname,In=Pt,$e=$.pathname&&$.pathname.split("/")||[],Ce=V.pathname&&V.pathname.split("/")||[],ue=$.protocol&&!O[$.protocol];if(ue&&($.hostname="",$.port=null,$.host&&($e[0]===""?$e[0]=$.host:$e.unshift($.host)),$.host="",V.protocol&&(V.hostname=null,V.port=null,V.host&&(Ce[0]===""?Ce[0]=V.host:Ce.unshift(V.host)),V.host=null),Pt=Pt&&(Ce[0]===""||$e[0]==="")),qe)$.host=V.host||V.host===""?V.host:$.host,$.hostname=V.hostname||V.hostname===""?V.hostname:$.hostname,$.search=V.search,$.query=V.query,$e=Ce;else if(Ce.length)$e||($e=[]),$e.pop(),$e=$e.concat(Ce),$.search=V.search,$.query=V.query;else if(!c.isNullOrUndefined(V.search)){if(ue){$.hostname=$.host=$e.shift();var At=$.host&&$.host.indexOf("@")>0?$.host.split("@"):!1;At&&($.auth=At.shift(),$.host=$.hostname=At.shift())}return $.search=V.search,$.query=V.query,(!c.isNull($.pathname)||!c.isNull($.search))&&($.path=($.pathname?$.pathname:"")+($.search?$.search:"")),$.href=$.format(),$}if(!$e.length)return $.pathname=null,$.search?$.path="/"+$.search:$.path=null,$.href=$.format(),$;for(var Ne=$e.slice(-1)[0],Oe=($.host||V.host||$e.length>1)&&(Ne==="."||Ne==="..")||Ne==="",kt=0,jt=$e.length;jt>=0;jt--)Ne=$e[jt],Ne==="."?$e.splice(jt,1):Ne===".."?($e.splice(jt,1),kt++):kt&&($e.splice(jt,1),kt--);if(!Pt&&!In)for(;kt--;kt)$e.unshift("..");Pt&&$e[0]!==""&&(!$e[0]||$e[0].charAt(0)!=="/")&&$e.unshift(""),Oe&&$e.join("/").substr(-1)!=="/"&&$e.push("");var _n=$e[0]===""||$e[0]&&$e[0].charAt(0)==="/";if(ue){$.hostname=$.host=_n?"":$e.length?$e.shift():"";var At=$.host&&$.host.indexOf("@")>0?$.host.split("@"):!1;At&&($.auth=At.shift(),$.host=$.hostname=At.shift())}return Pt=Pt||$.host&&$e.length,Pt&&!_n&&$e.unshift(""),$e.length?$.pathname=$e.join("/"):($.pathname=null,$.path=null),(!c.isNull($.pathname)||!c.isNull($.search))&&($.path=($.pathname?$.pathname:"")+($.search?$.search:"")),$.auth=V.auth||$.auth,$.slashes=$.slashes||V.slashes,$.href=$.format(),$},f.prototype.parseHost=function(){var V=this.host,z=h.exec(V);z&&(z=z[0],z!==":"&&(this.port=z.substr(1)),V=V.substr(0,V.length-z.length)),V&&(this.hostname=V)}},{"./util":138,punycode:103,querystring:106}],138:[function(i,o,a){o.exports={isString:function(u){return typeof u=="string"},isObject:function(u){return typeof u=="object"&&u!==null},isNull:function(u){return u===null},isNullOrUndefined:function(u){return u==null}}},{}],139:[function(i,o,a){(function(u){(function(){o.exports=c;function c(d,h){if(f("noDeprecation"))return d;var v=!1;function g(){if(!v){if(f("throwDeprecation"))throw new Error(h);f("traceDeprecation")?console.trace(h):console.warn(h),v=!0}return d.apply(this,arguments)}return g}function f(d){try{if(!u.localStorage)return!1}catch{return!1}var h=u.localStorage[d];return h==null?!1:String(h).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],140:[function(i,o,a){o.exports=u;function u(c,f){if(c&&f)return u(c)(f);if(typeof c!="function")throw new TypeError("need wrapper function");return Object.keys(c).forEach(function(h){d[h]=c[h]}),d;function d(){for(var h=new Array(arguments.length),v=0;v<h.length;v++)h[v]=arguments[v];var g=c.apply(this,h),p=h[h.length-1];return typeof g=="function"&&g!==p&&Object.keys(p).forEach(function(y){g[y]=p[y]}),g}}},{}],141:[function(i,o,a){o.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}]},{},[23])(23)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(r,n,i,o,a)=>{const u=r.trim();if(!/^wss?:\/\/.*$/.test(u)){console.error('编辑器MQTT通信只支持ws协议 (url必须以"ws://"开头)');return}client=mqttExports.connect(u,{username:n.trim(),password:i.trim(),reconnectPeriod:6e5}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(o,{qos:1})}),client.on("message",a)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1={style:{position:"absolute",left:"0",top:"0",bottom:"0",right:"0"}},_hoisted_2={xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},_hoisted_3=["transform"],_hoisted_4=["transform","onClick"],_hoisted_5=["transform"],_hoisted_6=["xlink:href","width","height","id","transform"],_hoisted_7=["id"],_sfc_main=vue.defineComponent({__name:"svg-viewer",props:{vueComp:{},data:{},canvasDrag:{type:Boolean,default:!0}},emits:["onMessage"],setup(r,{expose:n,emit:i}){const o=r;vue.useCssVars(w=>({"01996f39":vue.unref(c)})),setEditorLoadTime();const a=useGlobalStore(pinia);componentsRegister(o.vueComp);const u=vue.reactive(o.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,grid_color:"#ebebeb"},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),c=vue.computed(()=>a.intention==EGlobalStoreIntention.MoveCanvas?"grab":"default"),f=w=>{if(a.mouse_info.state!=EMouseInfoState.Down&&a.intention!==EGlobalStoreIntention.Connection||!o.canvasDrag)return;const{clientX:T,clientY:S}=w;a.mouse_info.new_position_x=a.mouse_info.now_position_x+T-a.mouse_info.position_x,a.mouse_info.new_position_y=a.mouse_info.now_position_y+S-a.mouse_info.position_y,a.intention==EGlobalStoreIntention.MoveCanvas&&(u.layout_center.x=a.mouse_info.new_position_x,u.layout_center.y=a.mouse_info.new_position_y)},d=()=>{a.mouse_info.state==EMouseInfoState.Down&&(a.intention!=EGlobalStoreIntention.Select&&(a.intention=EGlobalStoreIntention.None),a.mouse_info={state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0})},h=w=>{const{clientX:T,clientY:S}=w;a.intention=EGlobalStoreIntention.MoveCanvas,a.mouse_info={state:EMouseInfoState.Down,position_x:T,position_y:S,now_position_x:u.layout_center.x,now_position_y:u.layout_center.y,new_position_x:u.layout_center.x,new_position_y:u.layout_center.y}};function v(w){w!=null&&w.wheelDelta&&(w.wheelDelta>0?u.config.svg.scale=parseFloat((u.config.svg.scale+.1).toFixed(1)):u.config.svg.scale=parseFloat((u.config.svg.scale-.1).toFixed(1)))}const g=(w,T,S)=>({x:w.x-w.width/2*T+w.width/2,y:w.y-w.height/2*S+w.height/2,width:w.width*T,height:w.height*S}),p=w=>{var S;let T=!1;if(((S=w.events)==null?void 0:S.length)>0){for(let x of w.events)if(x.type===EEventType.Click){T=!0;break}}return{cursor:T?"pointer":"default"}},y=(w,T)=>{var S;if(console.log(w.events,T),((S=w.events)==null?void 0:S.length)>0){for(let x of w.events)if(x.type===T){if(x.condition&&x.condition.type!=="None"&&x.condition.type==="Relation"&&x.condition.Relation&&x.condition.Relation.relation){const O=x.condition.Relation.key,L=x.condition.Relation.relation,M=valFormat(x.condition.Relation.val),re=valFormat(x.condition.Relation.val2);if(w.props.hasOwnProperty(O)){const F=w.props[O].val;if(!_(F,L,M,re))continue}}if(x.action===EEventAction.ChangeAttr){if(x.attrs&&x.attrs.length>0){let O;if(x.target){for(let L of u.done_json)if(L.id===x.target){O=L;break}}else O=w;if(!O)continue;for(let L of x.attrs)L.key==="state"?O.defaultState=valFormat(L.val):O.props.hasOwnProperty(L.key)&&(O.props[L.key].val=valFormat(L.val))}}else x.action===EEventAction.JavaScript&&new Function(x.scripts)()}}},_=(w,T,S,x)=>{switch(T){case">":return w>S;case">=":return w>=S;case"<":return w<S;case"<=":return w<=S;case"==":return w==S;case"!=":return w!=S;case">=,=<":return w>=S&&w<=x;case"<,>":return w<S||w>x}},b=()=>{const w=u.config.net.mqtt;w&&w.url&&w.user&&w.pwd&&w.topics&&sub(w.url,w.user,w.pwd,w.topics,(T,S)=>{console.log(T),console.log(S.toString()),i("onMessage",{topics:T,message:S})})},A=(w,T,S)=>setArrItemByID(w,T,S,u.done_json);return vue.onMounted(()=>{b()}),vue.onBeforeUnmount(close),n({setNodeAttrByID:A}),(w,T)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",style:vue.normalizeStyle({backgroundColor:vue.unref(u).config.svg.background_color,position:"relative"}),onMousedown:h,onMousemove:f,onMouseup:d,onMousewheel:v,onContextmenu:T[4]||(T[4]=(...S)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...S))},[vue.renderSlot(w.$slots,"background",{},void 0,!0),vue.createElementVNode("div",_hoisted_1,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_2,[vue.createElementVNode("g",{transform:`translate(${vue.unref(u).layout_center.x},${vue.unref(u).layout_center.y})rotate(0)scale(${vue.unref(u).config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(u).done_json,S=>{var x,O,L,M,re,F,j,V;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:S.id,transform:`translate(${S.x},${S.y})rotate(0)scale(1)`,style:vue.normalizeStyle(p(S)),onClick:z=>y(S,vue.unref(EEventType).Click),onMousedown:T[0]||(T[0]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMousemove:T[1]||(T[1]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMouseup:T[2]||(T[2]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z)),onMousewheel:T[3]||(T[3]=(...z)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...z))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(S)}`)},[vue.createElementVNode("g",{transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2})rotate(${S.rotate}) scale(1) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`},[S.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$y,{key:0,"item-info":S},null,8,["item-info"])):S.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${S.name}`},vue.unref(prosToVBind)(S,["height","width"]),{width:((O=(x=S.props)==null?void 0:x.width)==null?void 0:O.val)??100,height:((M=(L=S.props)==null?void 0:L.height)==null?void 0:M.val)??100,id:S.id,transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),null,16,_hoisted_6)):S.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(S.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(S,["height","width"]),{width:((F=(re=S.props)==null?void 0:re.width)==null?void 0:F.val)??100,height:((V=(j=S.props)==null?void 0:j.height)==null?void 0:V.val)??100,id:S.id,onOnChange:z=>y(S,vue.unref(EEventType).Change),transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),null,16,["width","height","id","onOnChange","transform"])):S.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},g(S.actual_bound,S.scale_x,S.scale_y),{id:`foreign-object${S.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(S.tag),vue.mergeProps(vue.unref(prosToVBind)(S),{id:S.id,onOnChange:z=>y(S,vue.unref(EEventType).Change),transform:`translate(${S.actual_bound.x+S.actual_bound.width/2},${S.actual_bound.y+S.actual_bound.height/2}) scale(${S.scale_x},${S.scale_y}) translate(${-(S.actual_bound.x+S.actual_bound.width/2)},${-(S.actual_bound.y+S.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(S.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_7)):vue.createCommentVNode("",!0)],8,_hoisted_5)],2)],44,_hoisted_4)),[[vue.vShow,S.display]])}),128))],8,_hoisted_3)]))])],36))}}),svgViewer_vue_vue_type_style_index_0_scoped_7f6cd20a_lang="",svgViewer=_export_sfc$1(_sfc_main,[["__scopeId","data-v-7f6cd20a"]]);exports.SvgEditor=index,exports.SvgViewer=svgViewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|