@tuoyuan/web-plus-dev
Version:
基于arco-design的配置化表格表单组件
6 lines • 126 kB
JavaScript
"use strict";var Cn=Object.defineProperty;var kn=(t,n,o)=>n in t?Cn(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var Ct=(t,n,o)=>kn(t,typeof n!="symbol"?n+"":n,o);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Fo=require("@wangeditor/editor-for-vue");require("@wangeditor/editor/dist/css/style.css");const Lo=require("@wangeditor/editor"),wn=require("@arco-design/web-vue"),Sn=require("@arco-design/web-vue/es/_utils/global-config"),Bn=require("json-editor-vue"),jo=new WeakMap,Co=new ResizeObserver(t=>{for(const n of t){const o=jo.get(n.target);o&&o({width:n.borderBoxSize[0].inlineSize,height:n.borderBoxSize[0].blockSize})}}),zn={install(t){t.directive("resize",{mounted(n,o){jo.set(n,o.value),Co.observe(n)},unmounted(n){Co.unobserve(n)}})}};function Vn(t,n){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>{t.apply(this,l)},n)}}function _n(t,n=300){const o=e.ref(window.innerWidth),l=e.ref(window.innerHeight),i=Vn(()=>{o.value=window.innerWidth,l.value=window.innerHeight,t&&t({width:o.value,height:l.value})},n);return e.onMounted(()=>{i(),window.addEventListener("resize",i)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",i)}),{width:o,height:l}}function xn(t,n,o){e.onMounted(()=>{const[l,r]=n.value,i=o.context[l],a=r.split(".");t.value=a.reduce((u,d)=>u&&u[d],i),t.addEventListener("input",u=>{const d=u.target.value;a.reduce((p,f,s)=>{if(s===a.length-1)p[f]=d;else return p[f]||o.context.$set(p,f,{}),p[f]},i)})})}const Ho=t=>{const n=e.ref(t),o=e.ref({});function l(f){n.value=f}function r(f,s){Reflect.set(n.value,f,s)}function i(){n.value.columns=[]}function a(f,s){s?n.value.columns.splice(s,0,f):n.value.columns.push(f)}function u(f){n.value.columns.splice(f,1)}function d(f,s,v){const{found:y,config:N}=p(f,n.value);if(y)Reflect.set(N,s,v);else throw new Error("字段不存在")}function p(f,s){const v=s.columns.find(y=>y.field===f);if(v)return{found:!0,config:v};if(!s.groups)return{found:!1,config:null};for(const y of s.groups??[]){const N=y.columns.find(w=>w.field===f);if(N)return{found:!0,config:N,group:y.label}}return{found:!1,config:null}}return{option:n,formData:o,setColumn:d,addColumn:a,clearColumn:i,setOptionConfig:r,setOption:l,delColumn:u}},Me=t=>(t.install=n=>{const o=t.name||t.__name;n.component(o,t)},t);function Be(t){return t==null}function ke(t){if(typeof t!="object"||t===null)return t;let n=Array.isArray(t)?[]:{};for(let o in t)t.hasOwnProperty(o)&&(n[o]=ke(t[o]));return n}let Nn={a:1,b:{c:2}};ke(Nn);const En=(t,n)=>{const o={};if((n.type==="input"||n.type===void 0)&&(o.allowClear=!0,o.placeholder=`请输入${n.label}`),n.type==="input-password"){const l=ke(n);return delete l.type,{...o,...l,msg:null}}return n.type==="input-number"&&(o.placeholder=`请输入${n.label}`),n.type==="textarea"&&(o.allowClear=!0,o.showWordLimit=n.showWordLimit??!0,o.placeholder=`请输入${n.label}`),n.type==="select"&&(o.allowClear=!0,o.placeholder=`请选择${n.label}`,o.options=[],o.options=t[n.field]||n.dicData),n.type==="cascader"&&(o.allowClear=!0,o.placeholder=`请选择${n.label}`,o.options=t[n.field]||n.dicData),n.type==="radio"&&(o.options=t[n.field]||n.dicData),n.type==="radio-group"&&(o.options=t[n.field]||n.dicData),n.type==="checkbox-group"&&(o.options=t[n.field]||n.dicData),n.type==="checkbox"&&(o.options=t[n.field]||n.dicData),n.type==="date-picker"&&(o.placeholder="请选择日期"),n.type==="time-picker"&&(o.allowClear=!0,o.placeholder="请选择时间"),{...o,...n,msg:null,field:null,type:null,onChange:(...l)=>{n.onChange&&n.onChange(...l)}}},ko=new Set;function Jt(){let t;do t=`${Date.now()}${Math.floor(Math.random()*1e6)}`;while(ko.has(t));return ko.add(t),t}const oo={colGap:1,rowGap:1,span:8,marginTop:"10px",autoLabelWidth:!0,scrollToFirstError:!0,layout:"horizontal",gutter:10,size:"medium",labelAlign:"right",columns:[],justify:"start",align:"start",wrap:!0,submitBtn:!0,resetBtn:!0,menuBtn:!0,menu:!0,submitBtnText:"提交",resetBtnText:"重置"},Tn={key:0,class:"form-plus-left-bot"},Dn=e.defineComponent({name:"aFormPlus",__name:"main",props:e.mergeModels({menuRight:{type:Boolean,default:!1},option:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["submit","reset","form-change"],["update:modelValue"]),setup(t,{expose:n,emit:o}){const l=e.useSlots(),r=e.useAttrs(),i=t,a=oo,u=e.useModel(t,"modelValue"),d=e.ref(null),p=o,f=e.reactive({}),s=e.reactive({submit:!1,reset:!1});function v(){s.submit=!1}const y=({values:m,errors:B})=>{B===void 0&&(s.submit=!0,p("submit",m,v))};function N(){d.value.resetFields(),d.value.clearValidate(),p("reset")}function w(m){return i.option.disabled??m??!1}function I(m,B){p("form-change",m,B,v)}n(new Proxy({},{get(m,B){var C;return B==="reset"?N:B==="done"?v:(C=d.value)==null?void 0:C[B]},has(m,B){return B==="reset"||B==="done"||B in d.value}}));function D(m){return Be(m.bind)?Reflect.get(u.value,m.field):j(u.value,m.bind)}function U(m,B){Be(m.bind)?Reflect.set(u.value,m.field,B):(u[m.field]=B,X(u.value,m.bind,B))}const j=(m,B)=>B.split(".").reduce((C,V)=>C&&C[V],m),X=(m,B,C)=>{const V=B.split("."),z=V.pop(),P=V.reduce((c,b)=>c[b]=c[b]||{},m);P[z]=C},H=(m,B)=>{const C={};if((B.type==="input"||B.type===void 0)&&(C.allowClear=!0,C.placeholder=`请入${B.label}`),B.type==="input-password"){const V=ke(B);return delete V.type,{...C,...V,msg:null}}return B.type==="input-number"&&(C.placeholder=`请输入${B.label}`),B.type==="textarea"&&(C.allowClear=!0,C.showWordLimit=B.showWordLimit??!0,C.placeholder=`请输入${B.label}`),B.type==="select"&&(C.allowClear=!0,C.placeholder=`请选择${B.label}`,C.options=[],C.options=m[B.field]||B.dicData),B.type==="cascader"&&(C.allowClear=!0,C.placeholder=`请选择${B.label}`,C.options=m[B.field]||B.dicData),B.type==="radio"&&(C.options=m[B.field]||B.dicData),B.type==="radio-group"&&(C.options=m[B.field]||B.dicData),B.type==="checkbox-group"&&(C.options=m[B.field]||B.dicData),B.type==="checkbox"&&(C.options=m[B.field]||B.dicData),B.type==="date-picker"&&(C.placeholder="请选择日期"),B.type==="time-picker"&&(C.allowClear=!0,C.placeholder="请选择时间"),{...C,...B,msg:null,field:null,type:null}};return(m,B)=>{const C=e.resolveComponent("icon-question-circle-fill"),V=e.resolveComponent("a-tooltip"),z=e.resolveComponent("a-form-item"),P=e.resolveComponent("a-col"),c=e.resolveComponent("a-button"),b=e.resolveComponent("icon-refresh"),x=e.resolveComponent("a-row"),A=e.resolveComponent("a-space"),G=e.resolveComponent("a-form");return e.openBlock(),e.createBlock(G,e.mergeProps({ref_key:"formRef",ref:d,"auto-label-width":m.option.autoLabelWidth??e.unref(a).autoLabelWidth,layout:m.option.layout??e.unref(a).layout??"horizontal",scrollToFirstError:m.option.scrollToFirstError??e.unref(a).scrollToFirstError,size:m.option.size??e.unref(a).size,"label-align":m.option.labelAlign??e.unref(a).labelAlign,model:u.value,onSubmit:y,disabled:!0},e.unref(r)),{default:e.withCtx(()=>[e.createVNode(x,{class:"form-row__container",justify:m.option.justify??e.unref(a).justify,align:m.option.align??e.unref(a).align,wrap:m.option.wrap??e.unref(a).wrap,cols:24,gutter:m.option.gutter||e.unref(a).gutter,colGap:m.option.colGap??e.unref(a).colGap,rowGap:m.option.rowGap??e.unref(a).rowGap},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.option.columns,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.field},[g.display??!0?(e.openBlock(),e.createBlock(P,{key:0,style:e.normalizeStyle({marginTop:m.option.marginTop??e.unref(a).marginTop}),span:g.span??m.option.span??e.unref(a).span,offset:g.offset??0,order:g.order??0},{default:e.withCtx(()=>[e.createVNode(z,e.normalizeProps({[(s.submit?"":"disabled")||""]:w(g.disabled),label:g.label,tooltip:g.tooltip,help:g.help,extra:g.extra,"label-component":g.labelComponent,"hide-label":g.hideLabel,"hide-asterisk":g.hideAsterisk,"content-flex":g.contentFlex,feedback:g.feedback,field:g.bind??g.field,rules:g.rules}),e.createSlots({default:e.withCtx(()=>[e.unref(l)[g.field]?e.renderSlot(m.$slots,g.field,{key:0,item:g,size:m.option.size??e.unref(a).size},void 0,!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.component?g.component:`a-${g.type||"input"}`),e.mergeProps({key:1,style:{width:g.type==="switch"?"":"100%"},size:m.option.size??e.unref(a).size,disabled:m.option.detail??g.disabled??!1,modelValue:D(g),"onUpdate:modelValue":h=>U(g,h),visibility:g.visibility,"onUpdate:visibility":h=>g.visibility=h,ref_for:!0},H(f,g),{onChange:h=>I(h,g)}),null,16,["style","size","disabled","modelValue","onUpdate:modelValue","visibility","onUpdate:visibility","onChange"]))]),_:2},[e.unref(l)[g.field+"Label"]?{name:"label",fn:e.withCtx(()=>[e.renderSlot(m.$slots,g.field+"Label",{},void 0,!0)]),key:"0"}:void 0,e.unref(l)[g.field+"Label"]?void 0:{name:"label",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.label)+" ",1),g.helpIconText?(e.openBlock(),e.createBlock(V,{key:0,content:g.helpIconText},{default:e.withCtx(()=>[e.createVNode(C,{size:m.option.size??e.unref(a).size},null,8,["size"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)]),key:"1"},e.unref(l)[g.field+"Help"]||g.help?{name:"help",fn:e.withCtx(()=>[e.renderSlot(m.$slots,g.field+"Help",{},void 0,!0),e.createElementVNode("span",null,e.toDisplayString(g.help),1)]),key:"2"}:void 0,e.unref(l)[g.field+"Extra"]||g.extra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(m.$slots,g.field+"Extra",{},void 0,!0),e.createElementVNode("span",null,e.toDisplayString(g.extra),1)]),key:"3"}:void 0]),1040,["label","tooltip","help","extra","label-component","hide-label","hide-asterisk","content-flex","feedback","field","rules"])]),_:2},1032,["style","span","offset","order"])):e.createCommentVNode("",!0)],64))),128)),m.option.search===!0&&(i==null?void 0:i.menuRight)!==!0?(e.openBlock(),e.createBlock(P,{key:0,order:11,span:m.option.searchMenuSpan??8,style:e.normalizeStyle({textAlign:m.option.searchMenuAlign??"left",marginTop:m.option.searchMenuMargintop??"10px"})},{default:e.withCtx(()=>[e.unref(l).menu?e.renderSlot(m.$slots,"menu",{key:0,size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"menuLeft",{size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0),e.renderSlot(m.$slots,"suffix",{loading:s.submit},()=>[m.option.menuBtn??m.option.submitBtn??e.unref(a).submitBtn?(e.openBlock(),e.createBlock(c,{key:0,size:m.option.size??e.unref(a).size,type:"primary",loading:s.submit,"html-type":"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.option.submitBtnText??e.unref(a).submitBtnText),1)]),_:1},8,["size","loading"])):e.createCommentVNode("",!0),m.option.menuBtn??m.option.resetBtn??e.unref(a).resetBtn?(e.openBlock(),e.createBlock(c,{key:1,type:"text",size:m.option.size??e.unref(a).size,onClick:B[0]||(B[0]=g=>N())},{icon:e.withCtx(()=>[e.createVNode(b,{rotate:180})]),_:1},8,["size"])):e.createCommentVNode("",!0)],!0),e.renderSlot(m.$slots,"menuright",{size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0)]),_:3},8,["span","style"])):e.createCommentVNode("",!0)]),_:3},8,["justify","align","wrap","gutter","colGap","rowGap"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.option.groups,g=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(g.display,e.openBlock(),e.createBlock(x,{key:0,style:e.normalizeStyle(m.option.groupContainerStyle??{})},{default:e.withCtx(()=>[e.createVNode(P,{span:24},{default:e.withCtx(()=>[!e.unref(l)[g.field+"GroupHeader"]&&!e.unref(Be)(g.label)?(e.openBlock(),e.createElementBlock("div",Tn,e.toDisplayString(g.label),1)):e.renderSlot(m.$slots,g.field+"GroupHeader",{key:1,label:g.label,record:g},void 0,!0)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.columns,h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.field},[h.display??!0?(e.openBlock(),e.createBlock(P,{key:0,span:h.span??m.option.span??e.unref(a).span,offset:h.offset??0,order:h.order??100},{default:e.withCtx(()=>[e.createVNode(z,e.normalizeProps({"label-col-style":{width:"100px"},[(s.submit?"":"disabled")||""]:w(h.disabled),label:h.label,tooltip:h.tooltip,help:h.help,extra:h.extra,"label-component":h.labelComponent,"hide-label":h.hideLabel,"hide-asterisk":h.hideAsterisk,"content-flex":h.contentFlex,feedback:h.feedback,field:h.field,rules:h.rules}),e.createSlots({default:e.withCtx(()=>[e.unref(l)[h.field]?e.renderSlot(m.$slots,h.field,{key:0,item:h,size:m.option.size??e.unref(a).size},void 0,!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h.component?h.component:`a-${h.type||"input"}`),e.mergeProps({key:1,style:{width:h.type==="switch"?"":"100%"},size:m.option.size??e.unref(a).size,disabled:m.option.detail??h.disabled??!1,modelValue:D(h),"onUpdate:modelValue":R=>U(h,R),visibility:h.visibility,"onUpdate:visibility":R=>h.visibility=R,ref_for:!0},H(f,h),{onChange:R=>I(R,h)}),null,16,["style","size","disabled","modelValue","onUpdate:modelValue","visibility","onUpdate:visibility","onChange"]))]),_:2},[e.unref(l)[h.field+"Label"]?{name:"label",fn:e.withCtx(()=>[e.renderSlot(m.$slots,h.field+"Label",{},void 0,!0)]),key:"0"}:void 0,e.unref(l)[h.field+"Label"]?void 0:{name:"label",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label)+" ",1),h.helpIconText?(e.openBlock(),e.createBlock(V,{key:0,content:h.helpIconText},{default:e.withCtx(()=>[e.createVNode(C,{size:m.option.size??e.unref(a).size},null,8,["size"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)]),key:"1"},e.unref(l)[h.field+"Help"]||h.help?{name:"help",fn:e.withCtx(()=>[e.renderSlot(m.$slots,h.field+"Help",{},void 0,!0),e.createElementVNode("span",null,e.toDisplayString(h.help),1)]),key:"2"}:void 0,e.unref(l)[h.field+"Extra"]||h.extra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(m.$slots,h.field+"Extra",{},void 0,!0),e.createElementVNode("span",null,e.toDisplayString(h.extra),1)]),key:"3"}:void 0]),1040,["label","tooltip","help","extra","label-component","hide-label","hide-asterisk","content-flex","feedback","field","rules"])]),_:2},1032,["span","offset","order"])):e.createCommentVNode("",!0)],64))),128))]),_:2},1032,["style"]))],64))),256)),!m.option.search&&m.option.detail!==!0?(e.openBlock(),e.createBlock(x,{key:0,class:e.normalizeClass({formMenuContainer:m.option.menu??!m.option.detail??!0})},{default:e.withCtx(()=>[m.option.menu??!m.option.detail??!0?(e.openBlock(),e.createBlock(P,{key:0,order:1e4,span:m.option.menuSpan??24,style:e.normalizeStyle({textAlign:m.option.menuAlign??"center"})},{default:e.withCtx(()=>[e.unref(l).menu?e.renderSlot(m.$slots,"menu",{key:0,size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0):e.createCommentVNode("",!0),e.createVNode(A,{wrap:""},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"menuLeft",{size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0),e.renderSlot(m.$slots,"suffix",{loading:s.submit},()=>[m.option.menuBtn??m.option.submitBtn??!0?(e.openBlock(),e.createBlock(c,{key:0,size:m.option.size??e.unref(a).size,type:"primary",loading:s.submit,"html-type":"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.option.submitBtnText??e.unref(a).submitBtnText),1)]),_:1},8,["size","loading"])):e.createCommentVNode("",!0),m.option.menuBtn??m.option.resetBtn??!0?(e.openBlock(),e.createBlock(c,{key:1,size:m.option.size??e.unref(a).size,onClick:B[1]||(B[1]=g=>N())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.option.resetBtnText??e.unref(a).resetBtnText),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)],!0),e.renderSlot(m.$slots,"menuright",{size:m.option.size??e.unref(a).size,loading:s.submit},void 0,!0)]),_:3})]),_:3},8,["span","style"])):e.createCommentVNode("",!0)]),_:3},8,["class"])):e.createCommentVNode("",!0)]),_:3},16,["auto-label-width","layout","scrollToFirstError","size","label-align","model"])}}}),Oe=(t,n)=>{const o=t.__vccOpts||t;for(const[l,r]of n)o[l]=r;return o},no=Oe(Dn,[["__scopeId","data-v-66da9cf6"]]),Wo=Me(no),Mn=e.defineComponent({__name:"FormModel",props:e.mergeModels({title:{type:String,default:""},option:{type:Object,default:()=>({})}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t){const n=e.ref({}),o=t,l=e.useModel(t,"visible"),r=e.computed(()=>Object.assign({},o.option,{}));function i(a,u){u()}return(a,u)=>{const d=e.resolveComponent("aFormPlus"),p=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(p,{visible:l.value,"onUpdate:visible":u[1]||(u[1]=f=>l.value=f),title:o.title,footer:!1,width:"60vw","render-to-body":!1,"popup-container":"form-create-render"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=f=>n.value=f),option:r.value,onSubmit:i},null,8,["modelValue","option"])]),_:1},8,["visible","title"])}}}),On={style:{height:"60vh"}},$n=e.defineComponent({__name:"JsonModel",props:e.mergeModels({title:{type:String,default:""},type:{type:String,default:""},option:{type:Object,default:()=>({})}},{visible:{default:!1},visibleModifiers:{}}),emits:e.mergeModels(["importJson"],["update:visible"]),setup(t,{emit:n}){const o=t;e.onMounted(()=>{o.type==="export"&&(i.value=o.option)});const l=n,r=e.computed(()=>o.type==="export"),i=e.ref({}),a=e.useModel(t,"visible");function u(){a.value=!1,l("importJson",i.value)}return(d,p)=>{const f=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(f,{visible:a.value,"onUpdate:visible":p[1]||(p[1]=s=>a.value=s),title:r.value?"生成Json":"导入Json",footer:!r.value,width:"60vw","hide-cancel":!0,onOk:u,"render-to-body":r.value,"popup-container":"form-create-render"},{default:e.withCtx(()=>[e.createElementVNode("div",On,[e.createVNode(e.unref(io),{style:{height:"60vh"},modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=s=>i.value=s)},null,8,["modelValue"])])]),_:1},8,["visible","title","footer","render-to-body"])}}}),Pn=[{label:"基础组件",list:[{label:"输入框",icon:"biaodanzujian-shurukuang",type:"input"},{label:"数字输入框",icon:"shuzishurukuang",type:"input-number"},{label:"验证码",icon:"shuzishurukuang",type:"verification-code"},{label:"标签输入框",icon:"shuzishurukuang",type:"input-tag"},{label:"多行输入框",icon:"duohangshurukuang",type:"textarea"},{label:"下拉框",icon:"jilian",type:"select"},{label:"单选",icon:"danxuankuang-xuanzhong",type:"radio-group"},{label:"评分",icon:"pingfen",type:"rate"}]},{label:"时间组件",list:[{label:"日期选择",icon:"shijianxuanzeqi1",type:"date-picker"},{label:"日期范围",icon:"shijianfanweixuanze",type:"range-picker"},{label:"时间选择",icon:"shijianxuanzeqi1",type:"time-picker"},{label:"周",icon:"shijianxuanzeqi1",type:"week-picker"},{label:"月份",icon:"shijianxuanzeqi1",type:"month-picker"},{label:"年份",icon:"shijianxuanzeqi1",type:"year-picker"},{label:"季度",icon:"shijianxuanzeqi1",type:"quarter-picker"}]},{label:"高级组件",list:[{label:"文件上传",icon:"fujianshangchuan",type:"upload"},{label:"颜色选择器",icon:"yansexuanzeqi",type:"color-picker"}]}],In={input:{label:"输入框"},"verification-code":{label:"验证码",span:24},"radio-group":{dicData:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}]}};function wo(t){return In[t]??{}}var An=Object.defineProperty,Tt=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,So=(t,n,o)=>n in t?An(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,We=(t,n)=>{for(var o in n||(n={}))Uo.call(n,o)&&So(t,o,n[o]);if(Tt)for(var o of Tt(n))Yo.call(n,o)&&So(t,o,n[o]);return t},Xo=(t,n)=>{var o={};for(var l in t)Uo.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&Tt)for(var l of Tt(t))n.indexOf(l)<0&&Yo.call(t,l)&&(o[l]=t[l]);return o};function Bo(t,n,o){return o>=0&&o<t.length&&t.splice(o,0,t.splice(n,1)[0]),t}function Rn(t){return t.replace(/-(\w)/g,(n,o)=>o?o.toUpperCase():"")}function Fn(t){return Object.keys(t).reduce((n,o)=>(typeof t[o]<"u"&&(n[Rn(o)]=t[o]),n),{})}function zo(t,n){return Array.isArray(t)&&t.splice(n,1),t}function Vo(t,n,o){return Array.isArray(t)&&t.splice(n,0,o),t}function Ln(t){return typeof t>"u"}function jn(t){return typeof t=="string"}function _o(t,n,o){const l=t.children[o];t.insertBefore(n,l)}function Ft(t){t.parentNode&&t.parentNode.removeChild(t)}function Hn(t,n=document){var o;let l=null;return typeof(n==null?void 0:n.querySelector)=="function"?l=(o=n==null?void 0:n.querySelector)==null?void 0:o.call(n,t):l=document.querySelector(t),l||(`${t}`,void 0),l}function Wn(t,n,o=null){return function(...l){return t.apply(o,l),n.apply(o,l)}}function Un(t,n){const o=We({},t);return Object.keys(n).forEach(l=>{o[l]?o[l]=Wn(t[l],n[l]):o[l]=n[l]}),o}function Yn(t){return t instanceof HTMLElement}function xo(t,n){Object.keys(t).forEach(o=>{n(o,t[o])})}function Xn(t){return t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97)}const qn=Object.assign;/**!
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function No(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);n&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,l)}return o}function we(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?No(Object(o),!0).forEach(function(l){Gn(t,l,o[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):No(Object(o)).forEach(function(l){Object.defineProperty(t,l,Object.getOwnPropertyDescriptor(o,l))})}return t}function Vt(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vt=function(n){return typeof n}:Vt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Vt(t)}function Gn(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function Ve(){return Ve=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(t[l]=o[l])}return t},Ve.apply(this,arguments)}function Jn(t,n){if(t==null)return{};var o={},l=Object.keys(t),r,i;for(i=0;i<l.length;i++)r=l[i],!(n.indexOf(r)>=0)&&(o[r]=t[r]);return o}function Kn(t,n){if(t==null)return{};var o=Jn(t,n),l,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)l=i[r],!(n.indexOf(l)>=0)&&Object.prototype.propertyIsEnumerable.call(t,l)&&(o[l]=t[l])}return o}var Zn="1.15.2";function ze(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var _e=ze(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ut=ze(/Edge/i),Eo=ze(/firefox/i),lt=ze(/safari/i)&&!ze(/chrome/i)&&!ze(/android/i),qo=ze(/iP(ad|od|hone)/i),Go=ze(/chrome/i)&&ze(/android/i),Jo={capture:!1,passive:!1};function Y(t,n,o){t.addEventListener(n,o,!_e&&Jo)}function W(t,n,o){t.removeEventListener(n,o,!_e&&Jo)}function Dt(t,n){if(n){if(n[0]===">"&&(n=n.substring(1)),t)try{if(t.matches)return t.matches(n);if(t.msMatchesSelector)return t.msMatchesSelector(n);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(n)}catch{return!1}return!1}}function Qn(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function be(t,n,o,l){if(t){o=o||document;do{if(n!=null&&(n[0]===">"?t.parentNode===o&&Dt(t,n):Dt(t,n))||l&&t===o)return t;if(t===o)break}while(t=Qn(t))}return null}var To=/\s+/g;function de(t,n,o){if(t&&n)if(t.classList)t.classList[o?"add":"remove"](n);else{var l=(" "+t.className+" ").replace(To," ").replace(" "+n+" "," ");t.className=(l+(o?" "+n:"")).replace(To," ")}}function M(t,n,o){var l=t&&t.style;if(l){if(o===void 0)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(o=t.currentStyle),n===void 0?o:o[n];!(n in l)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),l[n]=o+(typeof o=="string"?"":"px")}}function Ye(t,n){var o="";if(typeof t=="string")o=t;else do{var l=M(t,"transform");l&&l!=="none"&&(o=l+" "+o)}while(!n&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(o)}function Ko(t,n,o){if(t){var l=t.getElementsByTagName(n),r=0,i=l.length;if(o)for(;r<i;r++)o(l[r],r);return l}return[]}function Ce(){var t=document.scrollingElement;return t||document.documentElement}function oe(t,n,o,l,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,u,d,p,f,s;if(t!==window&&t.parentNode&&t!==Ce()?(i=t.getBoundingClientRect(),a=i.top,u=i.left,d=i.bottom,p=i.right,f=i.height,s=i.width):(a=0,u=0,d=window.innerHeight,p=window.innerWidth,f=window.innerHeight,s=window.innerWidth),(n||o)&&t!==window&&(r=r||t.parentNode,!_e))do if(r&&r.getBoundingClientRect&&(M(r,"transform")!=="none"||o&&M(r,"position")!=="static")){var v=r.getBoundingClientRect();a-=v.top+parseInt(M(r,"border-top-width")),u-=v.left+parseInt(M(r,"border-left-width")),d=a+i.height,p=u+i.width;break}while(r=r.parentNode);if(l&&t!==window){var y=Ye(r||t),N=y&&y.a,w=y&&y.d;y&&(a/=w,u/=N,s/=N,f/=w,d=a+f,p=u+s)}return{top:a,left:u,bottom:d,right:p,width:s,height:f}}}function Do(t,n,o){for(var l=De(t,!0),r=oe(t)[n];l;){var i=oe(l)[o],a=void 0;if(a=r>=i,!a)return l;if(l===Ce())break;l=De(l,!1)}return!1}function Xe(t,n,o,l){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==O.ghost&&(l||a[i]!==O.dragged)&&be(a[i],o.draggable,t,!1)){if(r===n)return a[i];r++}i++}return null}function lo(t,n){for(var o=t.lastElementChild;o&&(o===O.ghost||M(o,"display")==="none"||n&&!Dt(o,n));)o=o.previousElementSibling;return o||null}function fe(t,n){var o=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==O.clone&&(!n||Dt(t,n))&&o++;return o}function Mo(t){var n=0,o=0,l=Ce();if(t)do{var r=Ye(t),i=r.a,a=r.d;n+=t.scrollLeft*i,o+=t.scrollTop*a}while(t!==l&&(t=t.parentNode));return[n,o]}function el(t,n){for(var o in t)if(t.hasOwnProperty(o)){for(var l in n)if(n.hasOwnProperty(l)&&n[l]===t[o][l])return Number(o)}return-1}function De(t,n){if(!t||!t.getBoundingClientRect)return Ce();var o=t,l=!1;do if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var r=M(o);if(o.clientWidth<o.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||o.clientHeight<o.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!o.getBoundingClientRect||o===document.body)return Ce();if(l||n)return o;l=!0}}while(o=o.parentNode);return Ce()}function tl(t,n){if(t&&n)for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);return t}function Lt(t,n){return Math.round(t.top)===Math.round(n.top)&&Math.round(t.left)===Math.round(n.left)&&Math.round(t.height)===Math.round(n.height)&&Math.round(t.width)===Math.round(n.width)}var at;function Zo(t,n){return function(){if(!at){var o=arguments,l=this;o.length===1?t.call(l,o[0]):t.apply(l,o),at=setTimeout(function(){at=void 0},n)}}}function ol(){clearTimeout(at),at=void 0}function Qo(t,n,o){t.scrollLeft+=n,t.scrollTop+=o}function en(t){var n=window.Polymer,o=window.jQuery||window.Zepto;return n&&n.dom?n.dom(t).cloneNode(!0):o?o(t).clone(!0)[0]:t.cloneNode(!0)}function tn(t,n,o){var l={};return Array.from(t.children).forEach(function(r){var i,a,u,d;if(!(!be(r,n.draggable,t,!1)||r.animated||r===o)){var p=oe(r);l.left=Math.min((i=l.left)!==null&&i!==void 0?i:1/0,p.left),l.top=Math.min((a=l.top)!==null&&a!==void 0?a:1/0,p.top),l.right=Math.max((u=l.right)!==null&&u!==void 0?u:-1/0,p.right),l.bottom=Math.max((d=l.bottom)!==null&&d!==void 0?d:-1/0,p.bottom)}}),l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}var pe="Sortable"+new Date().getTime();function nl(){var t=[],n;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(l){if(!(M(l,"display")==="none"||l===O.ghost)){t.push({target:l,rect:oe(l)});var r=we({},t[t.length-1].rect);if(l.thisAnimationDuration){var i=Ye(l,!0);i&&(r.top-=i.f,r.left-=i.e)}l.fromRect=r}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(el(t,{target:o}),1)},animateAll:function(o){var l=this;if(!this.options.animation){clearTimeout(n),typeof o=="function"&&o();return}var r=!1,i=0;t.forEach(function(a){var u=0,d=a.target,p=d.fromRect,f=oe(d),s=d.prevFromRect,v=d.prevToRect,y=a.rect,N=Ye(d,!0);N&&(f.top-=N.f,f.left-=N.e),d.toRect=f,d.thisAnimationDuration&&Lt(s,f)&&!Lt(p,f)&&(y.top-f.top)/(y.left-f.left)===(p.top-f.top)/(p.left-f.left)&&(u=al(y,s,v,l.options)),Lt(f,p)||(d.prevFromRect=p,d.prevToRect=f,u||(u=l.options.animation),l.animate(d,y,f,u)),u&&(r=!0,i=Math.max(i,u),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},u),d.thisAnimationDuration=u)}),clearTimeout(n),r?n=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),t=[]},animate:function(o,l,r,i){if(i){M(o,"transition",""),M(o,"transform","");var a=Ye(this.el),u=a&&a.a,d=a&&a.d,p=(l.left-r.left)/(u||1),f=(l.top-r.top)/(d||1);o.animatingX=!!p,o.animatingY=!!f,M(o,"transform","translate3d("+p+"px,"+f+"px,0)"),this.forRepaintDummy=ll(o),M(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),M(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){M(o,"transition",""),M(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function ll(t){return t.offsetWidth}function al(t,n,o,l){return Math.sqrt(Math.pow(n.top-t.top,2)+Math.pow(n.left-t.left,2))/Math.sqrt(Math.pow(n.top-o.top,2)+Math.pow(n.left-o.left,2))*l.animation}var Le=[],jt={initializeByDefault:!0},dt={mount:function(t){for(var n in jt)jt.hasOwnProperty(n)&&!(n in t)&&(t[n]=jt[n]);Le.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Le.push(t)},pluginEvent:function(t,n,o){var l=this;this.eventCanceled=!1,o.cancel=function(){l.eventCanceled=!0};var r=t+"Global";Le.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](we({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](we({sortable:n},o)))})},initializePlugins:function(t,n,o,l){Le.forEach(function(a){var u=a.pluginName;if(!(!t.options[u]&&!a.initializeByDefault)){var d=new a(t,n,t.options);d.sortable=t,d.options=t.options,t[u]=d,Ve(o,d.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return Le.forEach(function(l){typeof l.eventProperties=="function"&&Ve(o,l.eventProperties.call(n[l.pluginName],t))}),o},modifyOption:function(t,n,o){var l;return Le.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(l=r.optionListeners[n].call(t[r.pluginName],o))}),l}};function rl(t){var n=t.sortable,o=t.rootEl,l=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,u=t.fromEl,d=t.oldIndex,p=t.newIndex,f=t.oldDraggableIndex,s=t.newDraggableIndex,v=t.originalEvent,y=t.putSortable,N=t.extraEventProperties;if(n=n||o&&o[pe],!!n){var w,I=n.options,D="on"+l.charAt(0).toUpperCase()+l.substr(1);window.CustomEvent&&!_e&&!ut?w=new CustomEvent(l,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(l,!0,!0)),w.to=a||o,w.from=u||o,w.item=r||o,w.clone=i,w.oldIndex=d,w.newIndex=p,w.oldDraggableIndex=f,w.newDraggableIndex=s,w.originalEvent=v,w.pullMode=y?y.lastPutMode:void 0;var U=we(we({},N),dt.getEventProperties(l,n));for(var j in U)w[j]=U[j];o&&o.dispatchEvent(w),I[D]&&I[D].call(n,w)}}var il=["evt"],ue=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=o.evt,r=Kn(o,il);dt.pluginEvent.bind(O)(t,n,we({dragEl:k,parentEl:Z,ghostEl:$,rootEl:J,nextEl:Ae,lastDownEl:_t,cloneEl:K,cloneHidden:Te,dragStarted:tt,putSortable:ae,activeSortable:O.active,originalEvent:l,oldIndex:Ue,oldDraggableIndex:rt,newIndex:ce,newDraggableIndex:Ee,hideGhostForTarget:an,unhideGhostForTarget:rn,cloneNowHidden:function(){Te=!0},cloneNowShown:function(){Te=!1},dispatchSortableEvent:function(i){ie({sortable:n,name:i,originalEvent:l})}},r))};function ie(t){rl(we({putSortable:ae,cloneEl:K,targetEl:k,rootEl:J,oldIndex:Ue,oldDraggableIndex:rt,newIndex:ce,newDraggableIndex:Ee},t))}var k,Z,$,J,Ae,_t,K,Te,Ue,ce,rt,Ee,kt,ae,He=!1,Mt=!1,Ot=[],Pe,ge,Ht,Wt,Oo,$o,tt,je,it,st=!1,wt=!1,xt,re,Ut=[],Kt=!1,$t=[],It=typeof document<"u",St=qo,Po=ut||_e?"cssFloat":"float",sl=It&&!Go&&!qo&&"draggable"in document.createElement("div"),on=function(){if(It){if(_e)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),nn=function(t,n){var o=M(t),l=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=Xe(t,0,n),i=Xe(t,1,n),a=r&&M(r),u=i&&M(i),d=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+oe(r).width,p=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+oe(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var f=a.float==="left"?"left":"right";return i&&(u.clear==="both"||u.clear===f)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||d>=l&&o[Po]==="none"||i&&o[Po]==="none"&&d+p>l)?"vertical":"horizontal"},ul=function(t,n,o){var l=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,u=o?n.right:n.bottom,d=o?n.width:n.height;return l===a||r===u||l+i/2===a+d/2},dl=function(t,n){var o;return Ot.some(function(l){var r=l[pe].options.emptyInsertThreshold;if(!(!r||lo(l))){var i=oe(l),a=t>=i.left-r&&t<=i.right+r,u=n>=i.top-r&&n<=i.bottom+r;if(a&&u)return o=l}}),o},ln=function(t){function n(r,i){return function(a,u,d,p){var f=a.options.group.name&&u.options.group.name&&a.options.group.name===u.options.group.name;if(r==null&&(i||f))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,u,d,p),i)(a,u,d,p);var s=(i?a:u).options.group.name;return r===!0||typeof r=="string"&&r===s||r.join&&r.indexOf(s)>-1}}var o={},l=t.group;(!l||Vt(l)!="object")&&(l={name:l}),o.name=l.name,o.checkPull=n(l.pull,!0),o.checkPut=n(l.put),o.revertClone=l.revertClone,t.group=o},an=function(){!on&&$&&M($,"display","none")},rn=function(){!on&&$&&M($,"display","")};It&&!Go&&document.addEventListener("click",function(t){if(Mt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Mt=!1,!1},!0);var Ie=function(t){if(k){t=t.touches?t.touches[0]:t;var n=dl(t.clientX,t.clientY);if(n){var o={};for(var l in t)t.hasOwnProperty(l)&&(o[l]=t[l]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[pe]._onDragOver(o)}}},cl=function(t){k&&k.parentNode[pe]._isOutsideThisEl(t.target)};function O(t,n){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=n=Ve({},n),t[pe]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return nn(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:O.supportPointer!==!1&&"PointerEvent"in window&&!lt,emptyInsertThreshold:5};dt.initializePlugins(this,t,o);for(var l in o)!(l in n)&&(n[l]=o[l]);ln(n);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=n.forceFallback?!1:sl,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?Y(t,"pointerdown",this._onTapStart):(Y(t,"mousedown",this._onTapStart),Y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Y(t,"dragover",this),Y(t,"dragenter",this)),Ot.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),Ve(this,nl())}O.prototype={constructor:O,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(je=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,k):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,l=this.options,r=l.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(a||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,p=l.filter;if(yl(o),!k&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||l.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&<&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=be(u,l.draggable,o,!1),!(u&&u.animated)&&_t!==u)){if(Ue=fe(u),rt=fe(u,l.draggable),typeof p=="function"){if(p.call(this,t,u,this)){ie({sortable:n,rootEl:d,name:"filter",targetEl:u,toEl:o,fromEl:o}),ue("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(p&&(p=p.split(",").some(function(f){if(f=be(d,f.trim(),o,!1),f)return ie({sortable:n,rootEl:f,name:"filter",targetEl:u,fromEl:o,toEl:o}),ue("filter",n,{evt:t}),!0}),p)){r&&t.cancelable&&t.preventDefault();return}l.handle&&!be(d,l.handle,o,!1)||this._prepareDragStart(t,a,u)}}},_prepareDragStart:function(t,n,o){var l=this,r=l.el,i=l.options,a=r.ownerDocument,u;if(o&&!k&&o.parentNode===r){var d=oe(o);if(J=r,k=o,Z=k.parentNode,Ae=k.nextSibling,_t=o,kt=i.group,O.dragged=k,Pe={target:k,clientX:(n||t).clientX,clientY:(n||t).clientY},Oo=Pe.clientX-d.left,$o=Pe.clientY-d.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,k.style["will-change"]="all",u=function(){if(ue("delayEnded",l,{evt:t}),O.eventCanceled){l._onDrop();return}l._disableDelayedDragEvents(),!Eo&&l.nativeDraggable&&(k.draggable=!0),l._triggerDragStart(t,n),ie({sortable:l,name:"choose",originalEvent:t}),de(k,i.chosenClass,!0)},i.ignore.split(",").forEach(function(p){Ko(k,p.trim(),Yt)}),Y(a,"dragover",Ie),Y(a,"mousemove",Ie),Y(a,"touchmove",Ie),Y(a,"mouseup",l._onDrop),Y(a,"touchend",l._onDrop),Y(a,"touchcancel",l._onDrop),Eo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,k.draggable=!0),ue("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ut||_e))){if(O.eventCanceled){this._onDrop();return}Y(a,"mouseup",l._disableDelayedDrag),Y(a,"touchend",l._disableDelayedDrag),Y(a,"touchcancel",l._disableDelayedDrag),Y(a,"mousemove",l._delayedDragTouchMoveHandler),Y(a,"touchmove",l._delayedDragTouchMoveHandler),i.supportPointer&&Y(a,"pointermove",l._delayedDragTouchMoveHandler),l._dragStartTimer=setTimeout(u,i.delay)}else u()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){k&&Yt(k),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;W(t,"mouseup",this._disableDelayedDrag),W(t,"touchend",this._disableDelayedDrag),W(t,"touchcancel",this._disableDelayedDrag),W(t,"mousemove",this._delayedDragTouchMoveHandler),W(t,"touchmove",this._delayedDragTouchMoveHandler),W(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Y(document,"pointermove",this._onTouchMove):n?Y(document,"touchmove",this._onTouchMove):Y(document,"mousemove",this._onTouchMove):(Y(k,"dragend",this),Y(J,"dragstart",this._onDragStart));try{document.selection?Nt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(He=!1,J&&k){ue("dragStarted",this,{evt:n}),this.nativeDraggable&&Y(document,"dragover",cl);var o=this.options;!t&&de(k,o.dragClass,!1),de(k,o.ghostClass,!0),O.active=this,t&&this._appendGhost(),ie({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ge){this._lastX=ge.clientX,this._lastY=ge.clientY,an();for(var t=document.elementFromPoint(ge.clientX,ge.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ge.clientX,ge.clientY),t!==n);)n=t;if(k.parentNode[pe]._isOutsideThisEl(t),n)do{if(n[pe]){var o=void 0;if(o=n[pe]._onDragOver({clientX:ge.clientX,clientY:ge.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);rn()}},_onTouchMove:function(t){if(Pe){var n=this.options,o=n.fallbackTolerance,l=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=$&&Ye($,!0),a=$&&i&&i.a,u=$&&i&&i.d,d=St&&re&&Mo(re),p=(r.clientX-Pe.clientX+l.x)/(a||1)+(d?d[0]-Ut[0]:0)/(a||1),f=(r.clientY-Pe.clientY+l.y)/(u||1)+(d?d[1]-Ut[1]:0)/(u||1);if(!O.active&&!He){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if($){i?(i.e+=p-(Ht||0),i.f+=f-(Wt||0)):i={a:1,b:0,c:0,d:1,e:p,f};var s="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");M($,"webkitTransform",s),M($,"mozTransform",s),M($,"msTransform",s),M($,"transform",s),Ht=p,Wt=f,ge=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!$){var t=this.options.fallbackOnBody?document.body:J,n=oe(k,!0,St,!0,t),o=this.options;if(St){for(re=t;M(re,"position")==="static"&&M(re,"transform")==="none"&&re!==document;)re=re.parentNode;re!==document.body&&re!==document.documentElement?(re===document&&(re=Ce()),n.top+=re.scrollTop,n.left+=re.scrollLeft):re=Ce(),Ut=Mo(re)}$=k.cloneNode(!0),de($,o.ghostClass,!1),de($,o.fallbackClass,!0),de($,o.dragClass,!0),M($,"transition",""),M($,"transform",""),M($,"box-sizing","border-box"),M($,"margin",0),M($,"top",n.top),M($,"left",n.left),M($,"width",n.width),M($,"height",n.height),M($,"opacity","0.8"),M($,"position",St?"absolute":"fixed"),M($,"zIndex","100000"),M($,"pointerEvents","none"),O.ghost=$,t.appendChild($),M($,"transform-origin",Oo/parseInt($.style.width)*100+"% "+$o/parseInt($.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,l=t.dataTransfer,r=o.options;if(ue("dragStart",this,{evt:t}),O.eventCanceled){this._onDrop();return}ue("setupClone",this),O.eventCanceled||(K=en(k),K.removeAttribute("id"),K.draggable=!1,K.style["will-change"]="",this._hideClone(),de(K,this.options.chosenClass,!1),O.clone=K),o.cloneId=Nt(function(){ue("clone",o),!O.eventCanceled&&(o.options.removeCloneOnHide||J.insertBefore(K,k),o._hideClone(),ie({sortable:o,name:"clone"}))}),!n&&de(k,r.dragClass,!0),n?(Mt=!0,o._loopId=setInterval(o._emulateDragOver,50)):(W(document,"mouseup",o._onDrop),W(document,"touchend",o._onDrop),W(document,"touchcancel",o._onDrop),l&&(l.effectAllowed="move",r.setData&&r.setData.call(o,l,k)),Y(document,"drop",o),M(k,"transform","translateZ(0)")),He=!0,o._dragStartId=Nt(o._dragStarted.bind(o,n,t)),Y(document,"selectstart",o),tt=!0,lt&&M(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,l,r,i,a=this.options,u=a.group,d=O.active,p=kt===u,f=a.sort,s=ae||d,v,y=this,N=!1;if(Kt)return;function w(g,h){ue(g,y,we({evt:t,isOwner:p,axis:v?"vertical":"horizontal",revert:i,dragRect:l,targetRect:r,canSort:f,fromSortable:s,target:o,completed:D,onMove:function(R,ne){return Bt(J,n,k,l,R,oe(R),t,ne)},changed:U},h))}function I(){w("dragOverAnimationCapture"),y.captureAnimationState(),y!==s&&s.captureAnimationState()}function D(g){return w("dragOverCompleted",{insertion:g}),g&&(p?d._hideClone():d._showClone(y),y!==s&&(de(k,ae?ae.options.ghostClass:d.options.ghostClass,!1),de(k,a.ghostClass,!0)),ae!==y&&y!==O.active?ae=y:y===O.active&&ae&&(ae=null),s===y&&(y._ignoreWhileAnimating=o),y.animateAll(function(){w("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==s&&(s.animateAll(),s._ignoreWhileAnimating=null)),(o===k&&!k.animated||o===n&&!o.animated)&&(je=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(k.parentNode[pe]._isOutsideThisEl(t.target),!g&&Ie(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),N=!0}function U(){ce=fe(k),Ee=fe(k,a.draggable),ie({sortable:y,name:"change",toEl:n,newIndex:ce,newDraggableIndex:Ee,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=be(o,a.draggable,n,!0),w("dragOver"),O.eventCanceled)return N;if(k.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||y._ignoreWhileAnimating===o)return D(!1);if(Mt=!1,d&&!a.disabled&&(p?f||(i=Z!==J):ae===this||(this.lastPutMode=kt.checkPull(this,d,k,t))&&u.checkPut(this,d,k,t))){if(v=this._getDirection(t,o)==="vertical",l=oe(k),w("dragOverValid"),O.eventCanceled)return N;if(i)return Z=J,I(),this._hideClone(),w("revert"),O.eventCanceled||(Ae?J.insertBefore(k,Ae):J.appendChild(k)),D(!0);var j=lo(n,a.draggable);if(!j||ml(t,v,this)&&!j.animated){if(j===k)return D(!1);if(j&&n===t.target&&(o=j),o&&(r=oe(o)),Bt(J,n,k,l,o,r,t,!!o)!==!1)return I(),j&&j.nextSibling?n.insertBefore(k,j.nextSibling):n.appendChild(k),Z=n,U(),D(!0)}else if(j&&hl(t,v,this)){var X=Xe(n,0,a,!0);if(X===k)return D(!1);if(o=X,r=oe(o),Bt(J,n,k,l,o,r,t,!1)!==!1)return I(),n.insertBefore(k,X),Z=n,U(),D(!0)}else if(o.parentNode===n){r=oe(o);var H=0,m,B=k.parentNode!==n,C=!ul(k.animated&&k.toRect||l,o.animated&&o.toRect||r,v),V=v?"top":"left",z=Do(o,"top","top")||Do(k,"top","top"),P=z?z.scrollTop:void 0;je!==o&&(m=r[V],st=!1,wt=!C&&a.invertSwap||B),H=gl(t,o,r,v,C?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,wt,je===o);var c;if(H!==0){var b=fe(k);do b-=H,c=Z.children[b];while(c&&(M(c,"display")==="none"||c===$))}if(H===0||c===o)return D(!1);je=o,it=H;var x=o.nextElementSibling,A=!1;A=H===1;var G=Bt(J,n,k,l,o,r,t,A);if(G!==!1)return(G===1||G===-1)&&(A=G===1),Kt=!0,setTimeout(fl,30),I(),A&&!x?n.appendChild(k):o.parentNode.insertBefore(k,A?x:o),z&&Qo(z,0,P-z.scrollTop),Z=k.parentNode,m!==void 0&&!wt&&(xt=Math.abs(m-oe(o)[V])),U(),D(!0)}if(n.contains(k))return D(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){W(document,"mousemove",this._onTouchMove),W(document,"touchmove",this._onTouchMove),W(document,"pointermove",this._onTouchMove),W(document,"dragover",Ie),W(document,"mousemove",Ie),W(document,"touchmove",Ie)},_offUpEvents:function(){var t=this.el.ownerDocument;W(t,"mouseup",this._onDrop),W(t,"touchend",this._onDrop),W(t,"pointerup",this._onDrop),W(t,"touchcancel",this._onDrop),W(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(ce=fe(k),Ee=fe(k,o.draggable),ue("drop",this,{evt:t}),Z=k&&k.parentNode,ce=fe(k),Ee=fe(k,o.draggable),O.eventCanceled){this._nulling();return}He=!1,wt=!1,st=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Zt(this.cloneId),Zt(this._dragStartId),this.nativeDraggable&&(W(document,"drop",this),W(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),lt&&M(document.body,"user-select",""),M(k,"transform",""),t&&(tt&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),$&&$.parentNode&&$.parentNode.removeChild($),(J===Z||ae&&ae.lastPutMode!=="clone")&&K&&K.parentNode&&K.parentNode.removeChild(K),k&&(this.nativeDraggable&&W(k,"dragend",this),Yt(k),k.style["will-change"]="",tt&&!He&&de(k,ae?ae.options.ghostClass:this.options.ghostClass,!1),de(k,this.options.chosenClass,!1),ie({sortable:this,name:"unchoose",toEl:Z,newIndex:null,newDraggableIndex:null,originalEvent:t}),J!==Z?(ce>=0&&(ie({rootEl:Z,name:"add",toEl:Z,fromEl:J,originalEvent:t}),ie({sortable:this,name:"remove",toEl:Z,originalEvent:t}),ie({rootEl:Z,name:"sort",toEl:Z,fromEl:J,originalEvent:t}),ie({sortable:this,name:"sort",toEl:Z,originalEvent:t})),ae&&ae.save()):ce!==Ue&&ce>=0&&(ie({sortable:this,name:"update",toEl:Z,originalEvent:t}),ie({sortable:this,name:"sort",toEl:Z,originalEvent:t})),O.active&&((ce==null||ce===-1)&&(ce=Ue,Ee=rt),ie({sortable:this,name:"end",toEl:Z,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ue("nulling",this),J=k=Z=$=Ae=K=_t=Te=Pe=ge=tt=ce=Ee=Ue=rt=je=it=ae=kt=O.dragged=O.ghost=O.clone=O.active=null,$t.forEach(function(t){t.checked=!0}),$t.length=Ht=Wt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":k&&(this._onDragOver(t),pl(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,l=0,r=o.length,i=this.options;l<r;l++)n=o[l],be(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||vl(n));return t},sort:function(t,n){var o={},l=this.el;this.toArray().forEach(function(r,i){var a=l.children[i];be(a,this.options.draggable,l,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(l.removeChild(o[r]),l.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return be(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var l=dt.modifyOption(this,t,n);typeof l<"u"?o[t]=l:o[t]=n,t==="group"&&ln(o)},destroy:function(){ue("destroy",this);var t=this.el;t[pe]=null,W(t,"mousedown",this._onTapStart),W(t,"touchstart",this._onTapStart),W(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(W(t,"dragover",this),W(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}